/* Card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat-warn .stat-value { color: var(--warn); }

/* Status dots */
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot-idle, .dot-done { background: var(--ok); box-shadow: 0 0 10px rgba(58, 210, 159, 0.6); }
.dot-busy, .dot-running, .dot-loading { background: var(--accent-2); box-shadow: 0 0 10px rgba(58, 211, 255, 0.6); animation: pulse 1.4s infinite; }
.dot-queued { background: var(--warn); }
.dot-offline, .dot-cancelled { background: var(--muted); }
.dot-failed { background: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Worker badge */
.worker { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; background: var(--surface); }
.worker-head { display: flex; align-items: center; gap: 10px; }
.worker-name { font-weight: 600; }
.worker-status { margin-left: auto; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.worker-body { margin-top: 8px; font-size: 13px; }
.worker-gpu { font-size: 12px; margin-top: 4px; }
.bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.bar-fill { height: 100%; background: var(--accent-grad); border-radius: 999px; }

/* Pills */
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); margin-left: 8px; vertical-align: middle; }
.pill-accent { background: rgba(139, 124, 255, 0.2); color: #c9c2ff; }

/* Studio tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { display: block; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); transition: transform 0.15s, border-color 0.15s, background 0.15s; }
.tile:hover { transform: translateY(-2px); border-color: var(--border-strong); background: var(--surface-2); }
.tile-soon { opacity: 0.55; }
.tile-soon:hover { transform: none; }
.tile-icon { width: 34px; height: 34px; border-radius: 10px; margin-bottom: 10px; background: var(--accent-grad); opacity: 0.9; }
.tile-image .tile-icon { background: linear-gradient(135deg, #ff7ab6, #ffb85c); }
.tile-video .tile-icon { background: linear-gradient(135deg, #ff5c7a, #8b7cff); }
.tile-model3d .tile-icon { background: linear-gradient(135deg, #3ad29f, #3ad3ff); }
.tile-audio .tile-icon { background: linear-gradient(135deg, #ffb85c, #ff5c7a); }
.tile-transcribe .tile-icon { background: linear-gradient(135deg, #3ad3ff, #3ad29f); }
.tile-research .tile-icon { background: linear-gradient(135deg, #c9c2ff, #8b7cff); }
.tile-team .tile-icon { background: linear-gradient(135deg, #3ad29f, #8b7cff); }
.tile-name { font-weight: 600; }
.tile-blurb { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* Model picker */
.model-picker { display: grid; gap: 10px; margin-bottom: 14px; }
.model-card { display: block; cursor: pointer; }
.model-card input { position: absolute; opacity: 0; pointer-events: none; }
.model-card-body { display: block; position: relative; padding: 12px 44px 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); transition: border-color 0.15s, background 0.15s; }
.model-card input:checked + .model-card-body { border-color: var(--accent); background: rgba(139, 124, 255, 0.1); box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.15); }
/* the chosen card gets a check badge at the right, so the selection reads at a glance */
.model-card-body::after { content: ""; position: absolute; top: 50%; right: 14px; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); }
.model-card input:checked + .model-card-body::after { content: "\2713"; border-color: transparent; background: var(--accent-grad); color: #0b0d14; font-size: 14px; font-weight: 700; line-height: 22px; text-align: center; }
.model-name { display: block; font-weight: 600; }
.model-desc { display: block; font-size: 13px; color: var(--muted); }
.model-meta { display: block; font-size: 12px; margin-top: 2px; }

/* Lists */
.conv { display: flex; flex-direction: column; padding: 10px 12px; border-radius: var(--radius-sm); transition: background 0.15s; }
.conv:hover, .conv.active { background: var(--surface-2); }
.conv-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { font-size: 12px; }
.job { display: grid; grid-template-columns: 12px 1fr 1fr auto auto; align-items: center; gap: 10px; padding: 8px 6px; font-size: 13px; border-bottom: 1px solid var(--border); }
.job:last-child { border-bottom: none; }
.job-status { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; padding: 36px 32px; border-radius: 22px; background: rgba(14, 19, 32, 0.8); border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.login-tag { color: var(--muted); margin: 8px 0 26px; }
.login-foot { font-size: 12px; text-align: center; margin: 18px 0 0; }

/* Chat */
body.chat-page .page { max-width: none; padding: 0; height: calc(100vh - var(--nav-h)); }
.chat-layout { display: grid; grid-template-columns: 260px 1fr; height: 100%; min-height: 0; overflow: hidden; }
.chat-side { border-right: 1px solid var(--border); padding: 14px; overflow-y: auto; background: rgba(255, 255, 255, 0.02); }
.chat-side-new { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.chat-side-options { font-size: 12px; }
.chat-side-toggle { display: none; }
.chat-head-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chat-head-title h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-side { display: none; position: fixed; top: var(--nav-h); left: 0; bottom: 0; width: min(300px, 85vw); z-index: 20; background: rgba(9, 12, 19, 0.97); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
  .chat-side.open { display: block; }
  .chat-side-toggle { display: inline-block; }
}
.bulb { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.bulb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); opacity: 0.6; flex: none; transition: background 0.3s, box-shadow 0.3s; }
.bulb.on { color: var(--ok); }
.bulb.on .bulb-dot { background: var(--ok); opacity: 1; box-shadow: 0 0 8px rgba(58, 210, 159, 0.8); }
.chat-side-list { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; border-bottom: 1px solid var(--border); }
.chat-head-actions { display: flex; align-items: center; gap: 12px; }
.conn { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.conn.online { color: var(--ok); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { position: relative; width: 32px; height: 18px; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--border-strong); transition: background 0.15s, border-color 0.15s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s; }
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(14px); background: #0b0d14; }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.3); }
.switch input:disabled + .switch-track { opacity: 0.5; }
.switch-label { font-size: 12px; color: var(--muted); }
.switch input:checked ~ .switch-label { color: var(--text); }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; max-width: 900px; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-3); }
.msg-user .msg-avatar { background: var(--accent-grad); color: #0b0d14; }
.msg-body { min-width: 0; }
.msg-text { white-space: pre-wrap; word-wrap: break-word; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-family: inherit; }
.msg-user .msg-text { background: rgba(139, 124, 255, 0.18); border-color: rgba(139, 124, 255, 0.3); }
.msg-text.pending:empty::after { content: "▍"; animation: pulse 1s infinite; color: var(--accent-2); }
.msg-text.streaming::after { content: "▍"; animation: pulse 1s infinite; color: var(--accent-2); }
.msg-error { color: var(--danger); font-size: 13px; margin-top: 6px; }
.tool-live { font-size: 12px; margin-top: 6px; animation: pulse 1.4s infinite; }
.tool-card { margin-top: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255, 122, 182, 0.35); background: rgba(255, 122, 182, 0.08); }
.tool-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.tool-icon { width: 12px; height: 12px; border-radius: 3px; background: linear-gradient(135deg, #ff7ab6, #ffb85c); flex: none; }
.tool-prompt { white-space: pre-wrap; font-size: 14px; }
.tool-image { margin-top: 10px; }
.tool-image img { display: block; max-width: 100%; max-height: 520px; border-radius: 10px; border: 1px solid var(--border); }
.img-progress-inline { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.img-progress-inline .bar { flex: 1; margin: 0; }
.img-chat { color: var(--accent-2); }
.tool-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tool-actions form { display: inline; }
.tool-save[disabled] { color: var(--ok); opacity: 1; }
.msg-tool { display: flex; gap: 8px; align-items: baseline; font-size: 12px; padding: 4px 22px 4px 52px; word-break: break-word; }
.reasoning { margin-bottom: 8px; font-size: 13px; }
.reasoning summary { cursor: pointer; color: var(--muted); user-select: none; }
.reasoning-text { white-space: pre-wrap; color: var(--muted); padding: 8px 12px; border-left: 2px solid var(--accent); margin-top: 6px; font-family: var(--mono); font-size: 12px; max-height: 320px; overflow-y: auto; }
.composer { display: flex; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--border); background: rgba(9, 12, 19, 0.6); }
.composer textarea { flex: 1; max-height: 200px; }
.pill-ok { background: rgba(58, 210, 159, 0.18); color: #9ff0d3; }
.pill-warn { background: rgba(255, 196, 87, 0.18); color: #ffd98a; }
.pill-danger { background: rgba(255, 99, 99, 0.18); color: #ffb3b3; }
.img-status { margin: 0 0 6px; }
.img-status .pill { margin-left: 0; }
/* Training page: one row per image, chat prompt, or chat */
.train-tabs, .page-tabs { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 10px 0 4px; }
.train-tabs a, .page-tabs a { padding: 6px 10px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; }
.train-tabs a.active, .page-tabs a.active { background: var(--accent); color: #0b0d14; }
.train-tabs .muted { margin-left: auto; font-size: 12px; }
.train-row { display: grid; grid-template-columns: 140px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.train-row.excluded { opacity: 0.55; }
.train-row .train-thumb img { width: 100%; border-radius: var(--radius-sm); display: block; }
.train-row .train-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.train-row .field { margin: 0; }
.train-row textarea { width: 100%; }
.train-chat { grid-column: 1 / -1; }
.trace summary { cursor: pointer; font-size: 13px; user-select: none; }
.trace-body { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; font-size: 13px; }
.trace-block { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.trace-label { color: var(--muted); min-width: 96px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.trace-call { flex-basis: 100%; padding-left: 102px; word-break: break-word; }
.trace .reasoning-text { flex-basis: 100%; margin: 0 0 0 102px; }
@media (max-width: 640px) { .trace-call, .trace .reasoning-text { padding-left: 0; margin-left: 0; } }
@media (max-width: 640px) { .train-row { grid-template-columns: 1fr; } .train-thumb img { max-width: 200px; } }
.review-item { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.review-picture img { width: 100%; border-radius: var(--radius-sm); }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.input-sm { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; width: 160px; }
@media (max-width: 700px) { .review-item { grid-template-columns: 1fr; } }

/* Team rooms */
.side-section { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 14px 12px 6px; }
.side-new { margin: 6px 0; }
.side-new summary { list-style: none; }
.side-new summary::-webkit-details-marker { display: none; }
.side-form { display: flex; flex-direction: column; gap: 8px; padding: 10px 6px; }
.check { font-size: 13px; display: flex; gap: 8px; align-items: center; color: var(--muted); }
.conv-btn { width: 100%; text-align: left; background: none; border: none; font: inherit; color: inherit; cursor: pointer; }
.badge { display: inline-block; min-width: 18px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: #0b0d14; font-size: 11px; font-weight: 700; text-align: center; margin-left: 8px; }
.tmsg { display: flex; gap: 12px; max-width: 900px; }
.tmsg.mine .msg-avatar { background: var(--accent-grad); color: #0b0d14; }
.tmsg-body { min-width: 0; }
.tmsg-head { display: flex; gap: 10px; align-items: baseline; font-size: 13px; margin-bottom: 2px; }
.tmsg-sender { font-weight: 600; }
.tmsg-ts { font-size: 11px; }
.tmsg-text { white-space: pre-wrap; word-wrap: break-word; }
.tmsg-edited { font-size: 11px; font-style: italic; }
.tmsg-actions { display: inline-flex; gap: 8px; margin-left: 6px; opacity: 0; transition: opacity 0.15s; }
.tmsg:hover .tmsg-actions, .tmsg.editing .tmsg-actions { opacity: 1; }
.tmsg-btn { font: inherit; font-size: 11px; background: none; border: none; padding: 0; color: var(--muted); cursor: pointer; }
.tmsg-btn:hover { color: var(--text); }
.tmsg-btn-danger:hover { color: var(--danger); }
.tmsg-edit { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.tmsg-edit-actions { display: flex; gap: 8px; }
/* ---- admin console ---- */
.console-main { overflow-y: auto; }
.console-body { max-width: 720px; padding: 28px 32px 60px; }
.console-body h1 { font-size: 24px; margin-bottom: 4px; }
.console-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.console-form { margin-top: 18px; }
.console-stats { margin-top: 16px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 4px; }
.console-danger { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); }
.job-row form { flex: none; }
.console-group { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 22px 0 10px; }
.console-group:first-child { margin-top: 8px; }
.console-form .field input, .console-form .field textarea { font-size: 15px; }
.console-list { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.console-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: background 0.15s, border-color 0.15s; }
.console-row:hover { background: var(--surface-2); border-color: var(--border-strong); }
.console-row.muted { opacity: 0.6; }
.console-row-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console-row-meta { font-size: 12px; flex: none; }
.worker-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; }
.worker-row .worker { flex: 1; margin-bottom: 0; }
.worker-row.muted .worker { opacity: 0.6; }
.flash { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid var(--border); background: var(--surface-2); font-size: 14px; }
.flash-success { border-color: rgba(58, 210, 159, 0.4); }
.flash-error { border-color: rgba(255, 92, 122, 0.4); }
.token { display: block; margin-top: 6px; padding: 8px 10px; word-break: break-all; user-select: all; }
.nav-admin { color: var(--accent-2) !important; }
/* ---- image studio ---- */
.field-switch { margin: 2px 0 14px; }
/* right-edge tool drawer */
.gallery-card { margin-right: 52px; }
.drawer { position: fixed; top: var(--nav-h); right: 0; bottom: 0; z-index: 20; display: flex; pointer-events: none; }
.drawer-tabs { display: flex; flex-direction: column; gap: 6px; padding: 14px 6px; width: 44px; pointer-events: auto; order: 1; }
.drawer.open .drawer-tabs { order: 0; }
.drawer-tab { writing-mode: vertical-rl; transform: rotate(180deg); padding: 14px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; backdrop-filter: blur(10px); }
.drawer-tab:hover { color: var(--text); background: var(--surface-3); }
.drawer-tab[aria-selected="true"] { color: #0b0d14; background: var(--accent-grad); border-color: transparent; }
.drawer-panel { position: relative; width: 50vw; max-width: 720px; height: 100%; overflow-y: auto; padding: 22px 24px 40px; pointer-events: auto; background: rgba(14, 19, 32, 0.96); border-left: 1px solid var(--border); backdrop-filter: blur(14px); box-shadow: -20px 0 50px rgba(0, 0, 0, 0.45); order: 1; }
.drawer-panel h2 { margin-bottom: 14px; }
.drawer-close { position: absolute; top: 14px; right: 16px; width: 34px; height: 34px; border: none; border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
.drawer-close:hover { background: var(--surface-3); }
.drawer-backdrop { position: fixed; inset: var(--nav-h) 0 0 0; z-index: 15; background: rgba(4, 6, 10, 0.35); }
.has-drawer { padding-right: 44px; }
@media (max-width: 860px) { .drawer-panel { width: calc(100vw - 44px); max-width: none; } .gallery-card { margin-right: 44px; } }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.stat-link { display: contents; color: inherit; text-decoration: none; }
.stat-link .stat:hover { border-color: var(--accent); }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.gallery-tools { display: flex; align-items: center; gap: 14px; }
.per-page select { margin-left: 6px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; }
.pager [aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.img-card { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.img-frame { position: relative; width: 100%; background: var(--bg-2); display: grid; place-items: center; }
.img-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.img-progress { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 0 18px; font-size: 12px; text-align: center; }
.img-card.pending .img-frame { background: linear-gradient(120deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.img-fs { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 30px; height: 30px; border: none; border-radius: 8px; background: rgba(9, 12, 19, 0.7); color: var(--text); cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.img-card:hover .img-fs, .img-fs:focus-visible { opacity: 1; }
.lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(4, 6, 10, 0.94); cursor: zoom-out; overflow: hidden; touch-action: none; }
.lightbox img { display: block; width: auto; height: auto; max-width: calc(100vw - 48px); max-height: calc(100vh - 48px); object-fit: contain; border-radius: 6px; box-shadow: var(--shadow); cursor: zoom-in; user-select: none; -webkit-user-drag: none; transform-origin: center center; will-change: transform; }
.lightbox img.zoomed { cursor: grab; }
.lightbox img.dragging { cursor: grabbing; }
.lightbox-hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--muted); pointer-events: none; }
.lightbox-close { position: absolute; top: 14px; right: 18px; width: 40px; height: 40px; border: none; border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
.lightbox-close:hover { background: var(--surface-3); }
.img-error { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px; font-size: 12px; color: var(--danger); text-align: center; }
.img-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.img-prompt { margin: 0; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.img-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; }
.img-actions { display: inline-flex; gap: 8px; align-items: center; flex: none; }
.img-actions form { display: inline; }
.img-save[disabled] { color: var(--ok); cursor: default; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin-right: 8px; }
.side-head .side-section { margin-right: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; border: none; background: none; color: var(--muted); cursor: pointer; margin-top: 8px; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { color: var(--text); background: var(--surface-2); }

/* TV page: player on top, category chips, poster grid */

/* Projects page: inline rename */
.proj-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.proj-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-edit { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border: none; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; padding: 0; opacity: 0.7; }
.proj-edit:hover { background: var(--surface-3); color: var(--text); opacity: 1; }
.proj-edit svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.proj-input { width: 100%; font: inherit; font-size: 13px; color: var(--text); background: var(--surface-2); border: 1px solid var(--accent); border-radius: 6px; padding: 2px 6px; }

/* video studio: the same cards as the image gallery with a player in the frame */
.vid-card .img-frame { background: #000; }
.vid-card .img-frame video { display: block; width: 100%; height: 100%; object-fit: contain; }
.vid-card .img-frame .vid-start { opacity: 0.5; }
.form-error { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255, 92, 122, 0.12); border: 1px solid rgba(255, 92, 122, 0.4); }

/* Worker options */
.wo-card .card-head { flex-wrap: wrap; gap: 8px; }
.wo-card h2 { display: flex; align-items: center; gap: 8px; }
.wo-status { font-size: 13px; font-weight: 400; }
.wo-dir { font-size: 12px; color: var(--muted); word-break: break-all; }
.wo-kind { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 18px 0 6px; }
.wo-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(120px, auto) minmax(220px, 2fr); gap: 8px 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.wo-row.complete { opacity: 0.7; }
.wo-present { display: flex; flex-wrap: wrap; gap: 6px; }
.wo-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wo-drop { grid-column: 1 / -1; }
.wo-row.gated .wo-state, .wo-row.error .wo-state { color: var(--danger); }
.wo-row.done .wo-state { color: var(--ok); }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); }
.chip-ok { color: var(--ok); border-color: rgba(58, 210, 159, 0.5); }
.chip-missing { color: var(--muted); text-decoration: line-through; }
.btn-small { padding: 4px 10px; font-size: 12px; }
.small { font-size: 12px; }
@media (max-width: 760px) { .wo-row { grid-template-columns: 1fr; } }
