/* Image generation (Quiet Workspace, 2026-09-10). Native tokens with the admin
   --c-* names as fallbacks so the same sheet still resolves in Studio/admin. */
.ikb-image-panel{width:min(34rem,calc(100vw - 2rem));max-height:88dvh;padding:0;border:1px solid var(--border-color,var(--c-border,#ccd2da));border-top:3px solid var(--accent-color,#5b5bd6);border-radius:14px;background:var(--surface-raised,var(--c-surface,#fff));color:var(--text-primary,var(--c-text,#192535));box-shadow:var(--shadow-lg,0 24px 48px -12px rgba(0,0,0,.35));overflow:auto}
.ikb-image-panel::backdrop{background:rgb(0 0 0 / 40%)}
.ikb-image-panel-header{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin:0;padding:14px 16px 0 20px}
.ikb-image-panel h2{font-size:1.05rem;font-weight:600;margin:0;letter-spacing:-.01em}
.ikb-image-panel-header .btn{width:30px;height:30px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--text-muted,#8a8a90);font-size:22px;line-height:30px;text-align:center}
.ikb-image-panel-header .btn:hover{background:var(--hover-bg,rgba(20,20,22,.05));color:var(--text-primary,#1a1a1c)}
.ikb-image-panel-body{padding:6px 20px 18px}
.ikb-image-lead{margin:0 0 4px;font-size:.95rem;color:var(--text-primary,#1a1a1c)}
.ikb-image-hint{margin:0 0 14px;font-size:.82rem;color:var(--text-secondary,#5b5b62)}
.ikb-image-panel label{display:block;font-size:.82rem;font-weight:500;color:var(--text-secondary,#5b5b62);margin-bottom:6px}
.ikb-image-panel textarea{margin:0;border:1px solid var(--border-color,#ccd2da);border-radius:10px;background:var(--bg-primary,#fafaf9);color:var(--text-primary,#1a1a1c);box-shadow:none;font-size:.95rem;resize:vertical}
.ikb-image-panel textarea:focus{border-color:var(--accent-color,#5b5bd6);box-shadow:none;background:var(--surface-raised,#fff)}
.ikb-image-form-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px}
.ikb-image-form-note{margin:0;font-size:.78rem;color:var(--text-muted,#8a8a90)}
.ikb-image-panel .btn-primary{background:var(--accent-color,#5b5bd6);border-color:var(--accent-color,#5b5bd6);border-radius:10px;font-weight:500;min-height:38px;padding:6px 16px;white-space:nowrap}
.ikb-image-panel .btn-primary:hover{background:var(--accent-hover,#4a4ac4);border-color:var(--accent-hover,#4a4ac4)}
.ikb-image-panel .btn-primary:disabled{background:var(--bg-tertiary,#ebebe8);border-color:transparent;color:var(--text-muted,#8a8a90);opacity:1}
#imageGenerationStatus{margin:12px 0 0;padding:10px 12px;border-radius:10px;background:var(--accent-tint,rgba(91,91,214,.1));font-size:.85rem;color:var(--text-primary,#1a1a1c)}
#imageGenerationStatus:empty{display:none}
#imageGenerationResults:not(:empty){margin-top:14px;padding-top:14px;border-top:1px solid var(--border-light,rgba(20,20,22,.06))}

/* One card for every state, in the dialog and in the thread. */
.ikb-generated-image{margin:14px 0 0;padding:12px 14px 10px;border:1px solid var(--border-color,#ccd2da);border-radius:14px;background:var(--surface-raised,#fff);max-width:34rem;box-sizing:border-box}
.ikb-generated-image[data-state="succeeded"]{padding:0;overflow:hidden}
.ikb-image-frame{background:var(--bg-secondary,#f3f3f1)}
.ikb-image-frame img{display:block;width:100%;height:auto;max-height:70vh;object-fit:contain}
.ikb-generated-image figcaption{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 12px;padding:8px 12px 10px;font-size:.78rem;color:var(--text-muted,#8a8a90)}
.ikb-image-title{font-size:.82rem;font-weight:500;color:var(--text-secondary,#5b5b62)}
.ikb-image-actions{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:0}
.ikb-image-actions a,.ikb-image-actions button,.ikb-image-actions summary{display:inline-flex;align-items:center;gap:6px;min-height:32px;margin:0;padding:4px 10px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--text-secondary,#5b5b62);font:inherit;font-size:.82rem;font-weight:500;text-decoration:none;cursor:pointer;list-style:none}
.ikb-image-actions a:hover,.ikb-image-actions button:hover,.ikb-image-actions summary:hover{background:var(--hover-bg,rgba(20,20,22,.05));color:var(--text-primary,#1a1a1c)}
.ikb-image-actions details{display:contents}
.ikb-image-actions summary::-webkit-details-marker{display:none}
.ikb-image-meta{flex-basis:100%;margin:2px 0 0;padding:0 2px;font-size:.78rem;color:var(--text-muted,#8a8a90);overflow-wrap:anywhere}
.ikb-image-status{display:inline-flex;align-items:center;gap:8px;margin:0;padding:4px 12px 4px 9px;border-radius:999px;background:var(--bg-secondary,#f3f3f1);border:1px solid var(--border-light,rgba(20,20,22,.06));color:var(--text-secondary,#5b5b62);font-size:.85rem;font-weight:500;line-height:1.4}
.ikb-image-status::before{content:'';width:7px;height:7px;border-radius:50%;background:var(--accent-color,#5b5bd6);flex:0 0 auto;animation:ikb-image-pulse 1.4s ease-in-out infinite}
.ikb-generated-image[data-state="refused"] .ikb-image-status,.ikb-generated-image[data-state="failed"] .ikb-image-status,.ikb-generated-image[data-state="cancelled"] .ikb-image-status,.ikb-generated-image[data-state="outcome_unknown"] .ikb-image-status{display:flex;padding-left:12px;color:var(--text-primary,#1a1a1c);background:transparent;border:0;font-weight:400}
.ikb-generated-image[data-state="refused"] .ikb-image-status::before,.ikb-generated-image[data-state="failed"] .ikb-image-status::before,.ikb-generated-image[data-state="cancelled"] .ikb-image-status::before,.ikb-generated-image[data-state="outcome_unknown"] .ikb-image-status::before{background:var(--warn-color,#b7791f);animation:none}
.ikb-generated-image[data-state="queued"] .ikb-image-actions,.ikb-generated-image[data-state="running"] .ikb-image-actions{margin-top:8px}
@keyframes ikb-image-pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.45;transform:scale(.8)}}
@media (prefers-reduced-motion:reduce){.ikb-image-status::before{animation:none}}
#imageGenerationBtn[hidden]{display:none!important}
html[data-theme="dark"] .ikb-image-panel{border-color:rgba(255,255,255,.16);border-top-color:var(--accent-color,#8b8bf0)}
html[data-theme="dark"] .ikb-image-panel textarea{background:var(--bg-primary,#121214);border-color:rgba(255,255,255,.14)}
html[data-theme="dark"] .ikb-image-panel textarea:focus{background:var(--surface-raised,#1c1c1f)}
html[data-theme="dark"] .ikb-generated-image{border-color:rgba(255,255,255,.14)}
@media (max-width:768px){.ikb-image-panel{width:calc(100vw - 16px);max-height:92dvh}.ikb-image-actions a,.ikb-image-actions button,.ikb-image-actions summary{min-height:44px}.ikb-generated-image{max-width:none}}
