:root {
  color-scheme: dark;
  --bg: #151419;
  --sidebar: #19181d;
  --panel: #211f26;
  --surface: #2b2831;
  --line: #49424f;
  --divider: #342f38;
  --text: #f5f1f5;
  --muted: #b8afbe;
  --violet: #e7b6ed;
  --accent-soft: #382a3d;
  --cyan: #98dbbb;
  --amber: #f0c486;
  --red: #ffadb7;
  --danger-soft: #39262e;
  --chrome: #1a181e;
  --action: #e8b9eb;
  --action-hover: #f3d0f2;
  --on-action: #2a1c2d;
  --shadow: 0 1px 3px #0002;
  --float-shadow: 0 14px 46px #0006;
  --content: 880px;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; height: 100vh; height: var(--app-height, 100dvh); display: flex; flex-direction: column; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; -webkit-tap-highlight-color: transparent; }
a { color: var(--violet); }
button:disabled { cursor: default; opacity: .48; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); }
.icon-button:hover { color: var(--violet); }
.top { min-height: calc(64px + env(safe-area-inset-top)); flex: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 14px; padding: env(safe-area-inset-top) max(22px, env(safe-area-inset-right)) 0 max(22px, env(safe-area-inset-left)); background: var(--chrome); border-bottom: 1px solid var(--divider); }
.mobile-nav, .mobile-compose, .mobile-chat-list, .drawer-head, #sidebar-backdrop { display: none; }
.brand { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 10px; width: fit-content; line-height: 1.05; font-size: 18px; letter-spacing: -.035em; font-weight: 750; white-space: nowrap; }

.mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: #fff; font-weight: 720; font-size: 19px; background: linear-gradient(145deg, #6257ad, #302852 78%); box-shadow: inset 0 1px 0 #ffffff35, 0 3px 8px #2e234026; }
small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.brand small { margin-top: 4px; font-size: 8px; letter-spacing: .15em; font-weight: 700; }
.top-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; }

.status { justify-self: end; color: var(--muted); display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12px; font-weight: 650; padding: 4px 9px; border: 1px solid var(--line); border-radius: 99px; }
.status i { height: 6px; width: 6px; border-radius: 50%; background: var(--cyan); }
.top-account { display: flex; justify-self: end; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.profile-button { display: flex; align-items: center; gap: 8px; min-height: 44px; max-width: 190px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); font-size: 13px; font-weight: 650; }
.profile-button:hover { border-color: var(--violet); }
.profile-button #current-profile { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.profile-avatar { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--violet); font-size: 11px; font-weight: 750; }

.shell { flex: 1; min-height: 0; display: grid; grid-template-columns: 284px minmax(0, 1fr); }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--divider); display: flex; flex-direction: column; gap: 10px; padding: 17px 12px 12px max(12px, env(safe-area-inset-left)); min-height: 0; overflow: hidden; }
.sidebar > :not(#threads) { flex-shrink: 0; }
.new-thread, .thread-link, .memory-link { background: transparent; display: flex; align-items: center; gap: 10px; text-align: left; border: 0; border-radius: 11px; padding: 7px 10px; width: 100%; min-width: 0; }
.new-thread { min-height: 44px; border: 1px solid var(--line); background: var(--panel); font-size: 14px; font-weight: 650; box-shadow: var(--shadow); }
.new-thread .icon, .memory-link .icon { color: var(--violet); width: 19px; height: 19px; }
.new-thread:hover, .thread-link:hover, .memory-link:hover { background: var(--surface); }
.thread-link.current, .memory-link[aria-current] { background: var(--accent-soft); color: var(--violet); font-weight: 650; }
.thread-link { min-height: 46px; font-size: 13px; line-height: 1.4; align-items: flex-start; padding: 10px; }
.thread-copy { display: grid; gap: 4px; flex: 1; min-width: 0; }
.thread-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; white-space: normal; font-weight: 550; }
.thread-link.current .thread-title { font-weight: 700; }
.thread-link .running-dot { margin: 3px 0 0 auto; color: var(--cyan); font-size: 10px; flex: none; }
.thread-meta { display: flex; gap: 5px; align-items: center; min-width: 0; color: var(--muted); font-size: 10px; font-weight: 450; }
.thread-product { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#threads { display: grid; align-content: start; gap: 5px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 0; min-height: 44px; padding: 0 2px 14px 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.thread-controls { display: grid; gap: 8px; }
.thread-search-box { display: flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 0 10px; color: var(--muted); }
.thread-search-box:focus-within { border-color: var(--violet); box-shadow: 0 0 0 2px var(--accent-soft); }
.thread-search-box .icon { width: 16px; height: 16px; }
.thread-search-box input { border: 0; background: transparent; color: var(--text); width: 100%; min-width: 0; min-height: 38px; padding: 7px 0; font-size: 12px; outline: none; }
.thread-search-box input::placeholder { color: var(--muted); }
.thread-search-box input:focus-visible { outline: none; }
.thread-profile-filter { display:grid; gap:5px; color:var(--muted); font-size:10px; padding:0 3px; }
.thread-profile-filter select { width:100%; min-width:0; min-height:36px; padding:6px 9px; border:1px solid var(--line); border-radius:9px; background:var(--panel); color:var(--text); font:inherit; font-size:12px; }
.thread-owner { font-size:10px; color:var(--muted); font-weight:400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-list-empty { margin:8px 6px; color:var(--muted); font-size:12px; line-height:1.5; }
.thread-group { min-width: 0; }
.thread-group-row { display: flex; align-items: center; gap: 2px; min-width: 0; border-radius: 12px; }
.thread-group.has-current-child > .thread-group-row { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.thread-group-row > .thread-link { flex: 1; width: auto; }
.thread-group.has-current-child > .thread-group-row > .thread-link { color: var(--violet); }
.thread-group-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: none; min-width: 40px; min-height: 44px; padding: 4px 6px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.thread-group-toggle:hover { background: var(--surface); color: var(--text); }
.thread-group-toggle:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.thread-group-count { font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; border-radius: 5px; background: var(--surface); padding: 1px 4px; }
.thread-group-toggle.has-running .thread-group-count { color: var(--cyan); }
.thread-group-caret { font-size: 21px; line-height: 1; transition: transform .15s; }
.thread-group-toggle[aria-expanded="true"] .thread-group-caret { transform: rotate(90deg); }
.thread-children { display: grid; gap: 2px; margin: 2px 0 8px 14px; padding-left: 9px; border-left: 1px solid var(--line); min-width: 0; }
.thread-child { font-size: 12px; min-height: 42px; padding: 8px 9px; color: var(--muted); }
.thread-child.current { color: var(--violet); }
@media (max-width: 720px) { .thread-group-toggle, .thread-child { min-height: 44px; } .thread-group-toggle { min-width: 44px; } }
.queue summary { cursor: pointer; padding: 6px; border-radius: 7px; }
.queue summary:hover { background: var(--surface); }
.queue #jobs { max-height: 23vh; }

.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 5px; margin-top: 5px; }
.sidebar-head h2, .eyebrow { color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 750; margin: 0; }
.sidebar-head span { background: var(--accent-soft); color: var(--violet); border-radius: 7px; padding: 1px 7px; font-size: 11px; }
#jobs { overflow: auto; display: grid; align-content: start; gap: 7px; }
.job-link { border: 1px solid var(--line); background: var(--panel); border-radius: 9px; text-align: left; padding: 9px; }
.job-link:hover, .job-link.current { border-color: var(--violet); }
.job-link strong { display: block; overflow-wrap: anywhere; font-size: 13px; }
.job-link .progress-line { display: block; margin-top: 7px; height: 2px; background: var(--line); }
.job-link .progress-line i { display: block; height: 2px; background: var(--violet); width: 22%; }
.job-link[data-status="running"] .progress-line i { width: 60%; background: var(--cyan); }
.job-link[data-status="done"] .progress-line i { width: 100%; background: var(--cyan); }
.job-link[data-status="failed"] .progress-line i { width: 100%; background: var(--red); }
.studio-menu { flex: none; border-top: 1px solid var(--line); padding-top: 8px; }
.studio-menu-toggle { display: flex; align-items: center; gap: 9px; list-style: none; cursor: pointer; border-radius: 11px; min-height: 44px; padding: 9px 10px; font-size: 13px; font-weight: 650; }
.studio-menu-toggle::-webkit-details-marker { display: none; }
.studio-menu-toggle:hover, .studio-menu[open] > .studio-menu-toggle { background: var(--surface); }
.studio-menu-toggle .icon { width: 18px; height: 18px; color: var(--muted); }
.studio-menu-caret { margin-left: auto; font-size: 17px; line-height: 1; color: var(--muted); transition: transform .15s; }
.studio-menu[open] .studio-menu-caret { transform: rotate(180deg); }
.studio-menu-content { overflow-y: auto; overscroll-behavior: contain; max-height: min(38dvh, 350px); padding-top: 5px; scrollbar-width: thin; }
.sidebar-end { display: grid; gap: 2px; }
.sidebar-end .memory-link { min-height: 38px; padding: 8px 10px; font-size: 12px; }
.sidebar-end .memory-link small { display: none; }
.studio-menu .queue { margin-top: 7px; border-top: 1px solid var(--divider); padding-top: 5px; }
main, .view { min-width: 0; min-height: 0; height: 100%; }
.view { display: flex; flex-direction: column; }
.view-head { flex: none; padding: 19px max(24px, calc((100% - var(--content)) / 2)) 16px; border-bottom: 1px solid var(--divider); background: var(--chrome); }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chat-head > div { min-width: 0; }
.chat-head h1 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.view-head .eyebrow { color: var(--violet); }
h1 { color: var(--text); font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -.042em; line-height: 1.12; margin: 3px 0 4px; font-weight: 730; overflow-wrap: anywhere; }
.view-head p { color: var(--muted); margin: 0; font-size: 13px; }
.timeline, .scroll-content { overflow: auto; overscroll-behavior: contain; flex: 1; padding: 24px max(24px, calc((100% - var(--content)) / 2)); min-height: 0; }
.timeline { display: flex; flex-direction: column; gap: 16px; }
.empty { color: var(--muted); font-size: 13px; padding: 10px 5px; }
.welcome { align-self: center; margin: auto 0; max-width: 630px; width: 100%; text-align: left; padding: 25px 4px; }
.welcome h2 { font-size: clamp(26px, 5vw, 42px); letter-spacing: -.05em; line-height: 1.12; margin: 8px 0; }
.welcome p { color: var(--muted); margin: 0 0 17px; }
.examples { display: flex; gap: 8px; flex-wrap: wrap; }
.examples button, .secondary { min-height: 37px; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 11px; padding: 7px 12px; font-weight: 600; }
.examples button:hover, .secondary:hover { background: var(--surface); color: var(--violet); }
.message { padding: 11px 0; border-radius: 17px; max-width: 100%; align-self: flex-start; min-width: 0; overflow-wrap: anywhere; }
.message.user { align-self: flex-end; background: var(--accent-soft); border-radius: 19px 19px 6px 19px; padding: 11px 15px; max-width: 85%; }
.message.highlight, .message.running, .message.failed { padding-inline: 13px; background: var(--surface); }
.message.running { box-shadow: inset 3px 0 var(--cyan); }
.message.failed { background: var(--danger-soft); box-shadow: inset 3px 0 var(--red); }
.retry-chat { margin: 8px 0 0; }
.message header, .history-item summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 5px; font-size: 11px; color: var(--muted); }
.message header strong { color: var(--violet); }
.rich { white-space: pre-wrap; overflow-wrap: anywhere; }
.composer-area { flex: none; padding: 9px max(24px, calc((100% - var(--content)) / 2)) 18px; background: var(--bg); }
.composer { background: var(--panel); border: 1px solid var(--line); border-radius: 21px; padding: 9px 10px; box-shadow: var(--shadow); }
textarea { color: var(--text); background: transparent; border: 0; width: 100%; display: block; min-height: 52px; max-height: min(28vh, 185px); padding: 3px 4px; resize: vertical; }
textarea:focus-visible { outline: none; }
.composer:focus-within { border-color: var(--violet); }
.compose-footer { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; gap: 9px; }
.compose-actions { display: flex; gap: 7px; align-items: center; margin-left: auto; min-width: 0; }
.model-picker { position: relative; min-width: 0; }
.model-button { background: transparent; border: 1px solid transparent; border-radius: 10px; color: var(--muted); padding: 6px 9px; font-weight: 650; }
#model-button { display: block; max-width: min(260px, 45vw); min-height: 38px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-button:hover, .model-button[aria-expanded="true"] { color: var(--violet); background: var(--accent-soft); }
.model-panel { position: absolute; bottom: calc(100% + 11px); right: 0; z-index: 4; width: min(285px, calc(100vw - 40px)); padding: 14px; border-radius: 17px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--float-shadow); color: var(--text); font-size: 13px; }
.model-title, #effort-controls label, .effort-limits { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.model-title label { font-weight: 650; }
#chat-model, #chat-provider { width: 100%; margin: 6px 0; border: 1px solid var(--line); border-radius: 9px; padding: 7px; background: var(--surface); color: var(--text); font: inherit; }

#effort-controls { margin-top: 10px; }
#effort-label { color: var(--violet); }
#chat-effort { width: 100%; margin: 8px 0 0; accent-color: var(--violet); }
.effort-limits, #model-status { color: var(--muted); font-size: 11px; }
#model-status { margin-top: 6px; }
.composer-files, .message-files { display: flex; flex-wrap: wrap; gap: 7px; margin: 5px 0 9px; }
.composer-files { max-height: 25dvh; overflow: auto; }
.file-chip { display: flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; padding: 5px 8px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 12px; text-decoration: none; overflow-wrap: anywhere; }
.file-chip img { width: 42px; height: 42px; object-fit: cover; border-radius: 5px; }
.file-chip button { background: transparent; border: 0; color: var(--muted); font-size: 17px; }
.file-chip:hover { border-color: var(--violet); }
.edit-result { width:min(100%, 520px); margin:0; border:1px solid var(--line); border-radius:14px; overflow:hidden; background:var(--panel); }
.edit-result video { display:block; width:100%; max-height:60vh; background:#101013; object-fit:contain; }
.edit-result figcaption { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 12px; font-size:12px; }
.edit-result figcaption span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.edit-result figcaption a { flex:none; display:inline-flex; align-items:center; min-height:36px; }
.edit-hint { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center; padding:8px 10px; margin-bottom:8px; border:1px solid var(--line); border-radius:11px; background:var(--bg); color:var(--muted); font-size:13px; }
.edit-hint span { flex:1 1 200px; }
.edit-video-launch[aria-expanded="true"] { border-color:var(--violet); background:var(--accent-soft); }
@media (max-width:480px) {
  .edit-video-launch span { display:none; }
  .edit-result figcaption a { min-height:44px; }
}
.composer.dragging { border-color: var(--violet); }
.primary { border: 1px solid transparent; color: var(--on-action); border-radius: 12px; background: var(--action); font-weight: 680; min-height: 40px; padding: 8px 14px; }
.primary:hover { background: var(--action-hover); color: var(--on-action); }
#send-button { padding: 0; border-radius: 50%; }
.error { color: var(--red); font-size: 13px; margin: 8px 0; }
.filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 15px; }
.filter label { color: var(--muted); display: flex; align-items: center; gap: 5px; font-size: 12px; }
.filter input:not([type="checkbox"]) { color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
#query { flex: 1; min-width: 175px; }
.history, .card-grid { display: grid; gap: 10px; align-content: start; }
.history-item, .task-card, .agent-card { background: var(--panel); border: 1px solid var(--line); border-radius: 17px; padding: 15px 17px; min-width: 0; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.history-item summary { cursor: pointer; margin: 0; }
.history-item summary strong { color: var(--violet); }
.history-item .rich { margin-top: 10px; }
.snippet { flex: 1; min-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item[open] .snippet { display: none; }
.attachments { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.attachments img { width: 125px; height: 91px; object-fit: contain; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
#more { margin-top: 12px; }
.card-grid { grid-template-columns: repeat(auto-fit,minmax(min(235px, 100%),1fr)); }
.agent-card h2, .task-card h2 { margin: 0 0 5px; font-size: 17px; }
.agent-card p { color: var(--muted); margin: 4px 0; }
.task-card { margin-bottom: 12px; }
.hf-content { width: 100%; }
.hf-form { margin-top: 14px; display: grid; gap: 11px; }
.hf-form-hint { margin: 0; font-size: 12px; color: var(--muted); }
.hf-form label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
.hf-form input, .hf-form select, .hf-form textarea { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; color: var(--text); }
.hf-fields { display: grid; gap: 8px; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); }
.hf-references { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hf-upload { display: grid; gap: 8px; align-items: end; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; }
.hf-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 9px; }
.hf-preview { display: block; margin-top: 10px; width: min(100%, 370px); max-height: 60vh; border-radius: 13px; }
.message-videos.has-videos { margin-top: 14px; width: 100%; }
.message.assistant:has(.video-batch) { width: 100%; }
.message-videos .task-card, .account-generations .task-card { margin-bottom: 6px; }
.video-batches { display: grid; gap: 16px; }
.hf-operation-list { display: grid; gap: 16px; }
.video-batches:not([hidden]) + .hf-operation-list:not([hidden]) { margin-top: 16px; }
.video-batch { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 23px; background: var(--panel); box-shadow: var(--shadow); }
.video-batch-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.video-batch-heading .eyebrow { font-size: 9px; letter-spacing: .16em; color: var(--muted); }
.video-batch-heading h2 { margin: 2px 0 0; font-size: 21px; font-weight: 690; line-height: 1.2; letter-spacing: -.035em; }
.video-batch-badge { max-width: 100%; font-size: 11px; font-weight: 600; padding: 5px 9px; color: var(--violet); background: var(--accent-soft); border-radius: 99px; }
.video-batch[data-state="done"] .video-batch-badge { color: var(--cyan); background: var(--surface); }
.video-batch[data-state="failed"] .video-batch-badge, .video-batch[data-state="partial_failed"] .video-batch-badge { color: var(--red); background: var(--danger-soft); }
.video-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px 12px; }
.video-result-grid.single-result { grid-template-columns: minmax(0, 1fr); }
.video-result { min-width: 0; }
.video-result-preview { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; aspect-ratio: 9 / 16; max-height: min(57dvh, 520px); overflow: hidden; border-radius: 16px; background: #101116; color: #c0c2ce; box-shadow: inset 0 0 0 1px #ffffff09; }
.video-result-grid.single-result .video-result-preview { max-height: min(65dvh, 640px); }
.video-result-preview:has(.video-result-player) { background: #08090b; }
.video-result-player { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.video-render-label { max-width: 85%; font-size: 12px; text-align: center; color: #b4b6c2; }
.video-render-symbol { font-size: 36px; font-weight: 300; line-height: 1; opacity: .65; }
.video-render-duration { position: absolute; bottom: 11px; right: 12px; font-size: 10px; font-weight: 650; padding: 3px 6px; border-radius: 5px; background: #ffffff0d; color: #b4b6c2; }
.video-render-spinner { width: 23px; height: 23px; border: 2px solid #ffffff1d; border-top-color: #c3bfff; border-radius: 50%; animation: render-spin 1.2s linear infinite; }
@keyframes render-spin { to { transform: rotate(360deg); } }
.video-result-info { padding: 10px 1px 0; }
.video-result-info h3 { margin: 0; font-size: 14px; font-weight: 650; line-height: 1.4; letter-spacing: -.015em; }
.video-result-info > small { margin: 3px 0 7px; font-size: 10px; }
.video-result-status { display: block; margin: 5px 0 7px; font-size: 10px; color: var(--muted); }
.video-batch-notice { font-size: 12px; color: var(--muted); margin: 16px 0 0; }
.video-result-details summary { color: var(--muted); cursor: pointer; font-size: 11px; width: fit-content; }
.video-result-details .rich { font-size: 12px; margin: 8px 0; max-height: 240px; overflow: auto; padding-right: 4px; }
.video-result-details small { font-size: 10px; }
.video-download-link { display: inline-block; font-size: 12px; font-weight: 650; text-decoration: none; margin-top: 9px; min-height: 30px; padding: 4px 0; }
.video-download-link:hover { text-decoration: underline; }
.video-batch-progress { display: flex; flex-direction: column; gap: 7px; margin-top: 18px; }
.video-batch-progress progress { display: block; width: 100%; height: 4px; accent-color: var(--violet); border: 0; border-radius: 99px; overflow: hidden; }
.video-batch-progress span { color: var(--muted); font-size: 11px; }
.video-batch-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 17px; border-top: 1px solid var(--divider); padding-top: 15px; }
.video-batch-actions small { flex-basis: 100%; margin: 0; font-size: 11px; }
.video-batch-approve { min-height: 45px; padding-inline: 17px; }
.video-download { display: inline-flex; align-items: center; text-decoration: none; font-size: 12px; min-height: 40px; }
@media (max-width: 520px) {
  .video-batch { padding: 13px; border-radius: 19px; }
  .video-batch-heading { gap: 8px; margin-bottom: 13px; }
  .video-batch-heading h2 { font-size: 19px; }
  .video-batch-badge { font-size: 10px; }
  .video-result-grid { gap: 14px 9px; }
  .video-result-preview { border-radius: 11px; }
  .video-result-info h3 { font-size: 12px; }
  .video-result-info > small { font-size: 9px; }
  .video-render-label { font-size: 10px; }
  .video-render-spinner { width: 19px; height: 19px; }
  .video-batch-actions .primary, .video-batch-actions .secondary { width: 100%; text-align: center; justify-content: center; min-height: 46px; font-size: 13px; }
  .video-download-link { min-height: 44px; padding-block: 11px; }
  .video-result-details summary { min-height: 34px; padding-block: 8px; }
}
@media (prefers-reduced-motion: reduce) { .video-render-spinner { animation: none; border-color: #c3bfff; opacity: .65; } }
.hf-operation-summary { margin: 0 0 14px; color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.hf-operation-working { display: flex; align-items: center; gap: 13px; min-height: 100px; padding: 20px; background: var(--surface); border-radius: 15px; color: var(--muted); font-size: 12px; }
.hf-operation-working .video-render-spinner { flex: none; border-color: var(--line); border-top-color: var(--violet); }
.hf-operation-details { margin-top: 14px; }
.hf-operation-details summary { cursor: pointer; font-size: 12px; color: var(--muted); width: fit-content; }
.hf-operation-details pre { max-height: 330px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.6 ui-monospace, monospace; color: var(--muted); padding: 12px; border-radius: 10px; background: var(--surface); }
.hf-result-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; align-items: start; }
.hf-result-grid.single-result { grid-template-columns: minmax(0,1fr); }
.hf-result { min-width: 0; }
.hf-result-media { display: block; width: 100%; max-height: 60dvh; object-fit: contain; border-radius: 15px; background: #090a0d; }
audio.hf-result-media { min-height: 44px; border-radius: 99px; background: var(--surface); }
.hf-result[data-kind="audio"], .hf-result[data-kind="report"] { grid-column: 1 / -1; }
.hf-result h3 { margin: 9px 0 0; font-size: 14px; font-weight: 650; }
.hf-report-result { margin: 9px 0; font-size: 13px; max-height: 480px; overflow: auto; }
.hf-file-result { display: grid; place-items: center; min-height: 130px; color: var(--violet); font-size: 23px; font-weight: 650; letter-spacing: -.03em; border-radius: 15px; background: var(--accent-soft); }
.hf-catalog { margin-top: 16px; }
.hf-catalog .hf-form-hint { margin-top: 5px; }
.hf-catalog-filter { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin: 16px 0; }
.hf-catalog-filter input, .hf-catalog-filter select { min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px; font-size: 13px; }
.hf-capability-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,220px),1fr)); gap: 10px; }
.hf-capability { padding: 14px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; border-radius: 15px; border: 1px solid var(--divider); background: var(--bg); }
.hf-capability-type { margin: 0 0 5px; color: var(--violet); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.hf-capability h3 { font-size: 14px; line-height: 1.4; letter-spacing: -.02em; margin: 0; }
.hf-capability p { font-size: 11px; line-height: 1.55; margin: 7px 0 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hf-capability-actions { margin-top: auto; display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.hf-capability > button { margin-top: auto; }
.hf-capability button { font-size: 11px; padding: 6px 9px; min-height: 34px; }
#hf-catalog-more { margin-top: 12px; }
.hf-model-options { grid-template-columns: repeat(auto-fit,minmax(min(100%,180px),1fr)); }
#hf-model-chat { margin-left: 8px; }
@media (max-width: 520px) {
  .hf-catalog-filter { grid-template-columns: minmax(0,1fr); }
  .hf-catalog-filter input, .hf-catalog-filter select, .hf-capability button { min-height: 44px; }
  .hf-capability-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hf-capability { padding: 11px; }
  .hf-capability h3 { font-size: 12px; }
  .hf-capability p { font-size: 10px; -webkit-line-clamp: 4; }
  .hf-capability-actions { gap: 0; }
  .hf-operation-working { padding: 15px; }
  .hf-result-grid { gap: 10px; }
  #hf-model-chat { margin: 8px 0 0; }
}
.account-generations { margin-top: 14px; }
.account-generations-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; margin-top: 8px; }
.library-item { min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 7px; overflow-wrap: anywhere; }
.library-item img, .library-item video, .library-item audio { display: block; width: 100%; max-height: 220px; object-fit: contain; margin: 6px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.viral-content > div, .viral-feedback { width: min(100%, 960px); margin-inline: auto; }
.viral-form { margin-bottom: 18px; padding: 20px; background: linear-gradient(150deg, var(--panel) 45%, var(--accent-soft)); }
.viral-input-row { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; }
.viral-input-row input { flex: 1 1 220px; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 16px; }
.viral-actions { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 10px; }
.viral-filter { margin: 0 0 12px; }
.viral-list { display: grid; gap: 8px; margin-bottom: 12px; }
.viral-item { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); padding: 13px 15px; box-shadow: var(--shadow); }
.viral-item:hover { border-color: var(--violet); }
.viral-item strong, .viral-summary { display: block; overflow-wrap: anywhere; }
.viral-summary, .viral-feedback { color: var(--muted); font-size: 13px; }
.viral-summary { margin-top: 4px; }
.viral-item[data-status="done"] small, .viral-ready { color: var(--cyan); }
.viral-item[data-status="failed"] small { color: var(--red); }
.viral-preview { display: block; margin: 12px 0; max-height: min(55dvh, 510px); width: min(100%, 480px); border-radius: 12px; background: #101010; }
.viral-detail-card { margin-top: 12px; overflow-wrap: anywhere; }
.viral-detail-card h3 { font-size: 15px; margin: 15px 0 4px; }
.viral-detail-card p { margin: 5px 0; }
.viral-detail-card p, .viral-detail-card li { white-space: pre-wrap; }
.viral-detail-card ol, .viral-detail-card ul { padding-left: 23px; }
.viral-detail-card li + li { margin-top: 9px; }
.viral-form-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.viral-form-heading h2 { margin:0; }
.viral-goal, .viral-analysis-badge, .viral-corrected-badge { display:inline-block; width:fit-content; color:var(--violet); background:var(--accent-soft); border-radius:8px; padding:4px 8px; font-size:11px; font-weight:650; }
.viral-analysis-badge, .viral-corrected-badge { margin:7px 7px 0 0; }
.viral-corrected-badge { color:var(--cyan); background:var(--surface); }
#viral-bulk-entry label, .viral-correction-form label { display:block; font-size:13px; font-weight:650; margin-bottom:8px; }
#viral-batch-text, .viral-correction-form textarea { display:block; width:100%; min-height:140px; resize:vertical; border:1px solid var(--line); border-radius:14px; background:var(--bg); color:var(--text); padding:13px 15px; font-size:15px; line-height:1.6; }
.viral-help { color:var(--muted); font-size:12px; line-height:1.6; margin:8px 0; }
.viral-submit-row { display:flex; align-items:center; gap:14px; margin-top:14px; flex-wrap:wrap; }
.viral-submit-row .viral-help { flex:1 1 200px; }
.viral-queue { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin:18px 0; }
.viral-stat { background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:12px; min-width:0; }
.viral-stat strong { display:block; font-size:22px; font-weight:700; line-height:1.25; font-variant-numeric:tabular-nums; }
.viral-stat span { color:var(--muted); display:block; font-size:11px; margin-top:5px; }
.viral-stat[data-status=done] strong { color:var(--cyan); }
.viral-stat[data-status=running] strong { color:var(--violet); }
.viral-stat[data-status=failed] strong { color:var(--amber); }
.viral-batch-results { margin-bottom:16px; }
.viral-batch-results h3 { margin:0; }
.viral-import-details summary, .viral-shot-details summary, .viral-complete-timeline > summary { cursor:pointer; min-height:40px; padding-block:8px; font-size:13px; font-weight:600; }
.viral-import-items { padding:0; margin:5px 0 0; max-height:320px; overflow:auto; list-style:none; }
.viral-import-item { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:14px; align-items:center; padding:10px 0; border-top:1px solid var(--divider); }
.viral-import-link { padding:0; background:none; border:0; text-align:left; color:var(--text); font-size:12px; overflow-wrap:anywhere; }
button.viral-import-link:hover { color:var(--violet); }
.viral-import-item small { max-width:290px; margin:0; text-align:right; }
.viral-import-item[data-status=invalid] small { color:var(--red); }
.viral-import-item[data-status=added] small { color:var(--cyan); }
.viral-analysis-block { margin-top:22px; padding-top:18px; border-top:1px solid var(--divider); }
.viral-detail-card .viral-analysis-block > h3 { margin:0 0 10px; font-size:18px; letter-spacing:-.025em; }
.viral-field-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px 22px; margin:12px 0; }
.viral-field-list > div { min-width:0; }
.viral-field-list dt { color:var(--muted); font-size:11px; font-weight:650; margin-bottom:4px; }
.viral-field-list dd { margin:0; font-size:13px; line-height:1.65; white-space:pre-wrap; overflow-wrap:anywhere; }
.viral-shot { margin:12px 0; padding:16px; border:1px solid var(--line); border-radius:16px; background:var(--bg); }
.viral-shot-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.viral-shot-head strong { font-size:13px; }
.viral-time { border:0; border-radius:8px; background:var(--accent-soft); color:var(--violet); padding:7px 10px; font-size:12px; font-weight:650; white-space:nowrap; font-variant-numeric:tabular-nums; }
.viral-shot-visual { font-size:14px; }
.viral-shot-details { border-top:1px solid var(--divider); margin-top:12px; }
.viral-learning-status { color:var(--cyan); font-size:12px; }
.viral-corrections { background:var(--accent-soft); border:1px solid var(--line); padding:16px; border-radius:16px; }
.viral-correction + .viral-correction { margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
.viral-correction p { font-size:14px; }
.viral-correction-form { margin-top:22px; padding-top:18px; border-top:1px solid var(--divider); }
.viral-correction-form textarea { min-height:116px; }
.viral-correction-form .primary { margin-top:5px; }
.viral-correction-feedback { font-size:13px; }
@media (max-width:720px) {
  #viral-batch-text, .viral-correction-form textarea { font-size:16px; padding:11px 12px; }
  .viral-form-heading { gap:9px; }
  .viral-goal { font-size:10px; }
  .viral-submit-row { gap:4px; }
  .viral-submit-row .primary { width:100%; }
  .viral-submit-row .viral-help { margin-bottom:0; }
  .viral-queue { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .viral-stat { padding:10px; border-radius:12px; }
  .viral-stat strong { font-size:20px; }
  .viral-stat span { font-size:10px; }
  .viral-import-item { grid-template-columns:minmax(0,1fr); gap:3px; }
  .viral-import-item small { max-width:none; text-align:left; }
  .viral-field-list { grid-template-columns:minmax(0,1fr); gap:12px; }
  .viral-shot { padding:12px; border-radius:13px; }
  .viral-time { min-height:44px; }
  .viral-detail-card .viral-analysis-block > h3 { font-size:17px; }
  .viral-correction-form .primary { width:100%; }
}
.account-content { width: 100%; }
.profile-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.profile-summary p { margin: 0; color: var(--muted); font-size: 13px; }
.profile-summary button { flex: none; }
.connections-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.connection-card { margin: 0; padding: 20px; }
.connection-card:last-child { grid-column: 1 / -1; }
.connection-card p, #team-management > p { margin: 8px 0 16px; color: var(--muted); font-size: 13px; }
.connection-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.connection-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.connection-state { color: var(--muted); background: var(--surface); border-radius: 99px; padding: 4px 9px; font-size: 11px; font-weight: 650; }
.connection-state.connected { color: var(--cyan); background: var(--accent-soft); }
.connection-form { display: grid; gap: 12px; }
.connection-form label { display: grid; gap: 6px; font-size: 12px; font-weight: 650; }
.connection-form input, .login-form input:not(.sr-only) { width: 100%; min-width: 0; min-height: 44px; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; color: var(--text); font-size: 16px; padding: 10px 12px; }
#higgsfield-active-account, #higgsfield-workspace, #viral-provider { min-height: 44px; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--bg); padding: 7px 10px; font-size: 16px; }
#higgsfield-account-picker { margin-bottom: 14px; min-width: 0; }
#higgsfield-workspace-form { margin-top: 16px; }
.connection-form small { line-height: 1.5; margin: -5px 0 0; }
.connection-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.connection-actions a { font-size: 12px; }
.account-feedback { font-size: 13px; color: var(--muted); margin: 10px 0; }
.account-feedback:empty { display: none; }
#team-management { margin-top: 20px; padding: 20px; }
.profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.team-profiles { display: grid; gap: 8px; margin: 12px 0 20px; }
.team-profile { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--divider); }
.team-profile-name { min-width: 0; overflow-wrap: anywhere; }
.team-profile small { margin-left: auto; white-space: nowrap; }
.team-profile .team-profile-remove { flex-shrink: 0; min-height: 44px; padding: 0 12px; color: var(--danger, #f6a6b7); }
#team-profile-feedback:not(:empty) { margin-bottom: 12px; font-size: 14px; }
.login-screen { position: fixed; inset: 0; z-index: 50; overflow: auto; display: grid; place-items: center; padding: max(35px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); background: radial-gradient(ellipse at 50% 0, var(--accent-soft), transparent 70%), var(--bg); }
.login-inner { width: min(100%, 720px); text-align: center; padding: 20px 0; margin: auto; }
.login-mark { width: 54px; height: 54px; border-radius: 17px; font-size: 30px; margin: 0 auto 24px; }
.login-inner .eyebrow { margin-bottom: 10px; }
.login-inner h1 { font-size: clamp(30px, 6vw, 44px); }
.login-intro { color: var(--muted); font-size: 15px; margin: 12px 0 25px; }
.login-profiles { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 14px; margin: 22px 0; }
.login-profile { width: 144px; display: flex; flex-direction: column; align-items: center; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); padding: 18px 10px 15px; box-shadow: var(--shadow); }
.login-profile[aria-pressed=true], .login-profile:hover { border-color: var(--violet); background: var(--accent-soft); }
.login-profile strong { display: block; font-size: 14px; overflow-wrap: anywhere; margin-top: 12px; line-height: 1.35; }
.login-profile small { font-size: 11px; }
.login-avatar { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 22px; color: #fff; background: linear-gradient(145deg, #8479ce, #40365f); font-size: 25px; font-weight: 650; letter-spacing: -.04em; }
.login-profile:nth-child(3n+2) .login-avatar { background: linear-gradient(145deg, #79b8b1, #255455); }
.login-profile:nth-child(3n) .login-avatar { background: linear-gradient(145deg, #d8a476, #855760); }
.login-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; width: min(100%, 380px); margin: 26px auto 10px; text-align: left; }
.login-form label { grid-column: 1 / -1; color: var(--muted); font-size: 13px; margin-bottom: 3px; }
.login-create-profile .login-avatar { background: var(--surface); color: var(--muted); border: 1px dashed var(--line); font-size: 40px; font-weight: 300; }
.register-form { width: min(100%, 410px); margin: 24px auto 12px; text-align: left; }
.register-form h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.register-form .connection-actions > button { flex: 1; }
.pending-profiles:not(:empty) { padding: 14px; margin: 0 0 20px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--line); }
.pending-profiles h3 { margin: 0 0 12px; font-size: 15px; }
.pending-profile-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 10px 0; }
.pending-profile-row + .pending-profile-row { border-top: 1px solid var(--line); }
.publishing-content { --content: 1160px; }
.publishing-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.publishing-compose { padding: 22px; }
.publishing-connection { padding: 20px 22px; margin-bottom: 22px; }
.publishing-connection h2, .publishing-compose h2 { font-size: 21px; letter-spacing: -.035em; }
.publishing-connection p { margin-top: 8px; color: var(--muted); }
.publishing-accounts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.publishing-account-chip { display: inline-block; padding: 5px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 12px; }
.publishing-settings { border-top: 1px solid var(--divider); margin-top: 16px; padding-top: 13px; }
.publishing-settings summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.publishing-settings .connection-form { max-width: 780px; }
.meta-setup-steps { max-width: 780px; padding-left: 20px; margin: 14px 0; color: var(--muted); font-size: 13px; }
.meta-setup-steps li { padding-left: 3px; margin: 6px 0; }
.publishing-source-heading { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.publishing-source-heading input[type=search] { flex: 1 1 180px; }
.publishing-source-heading button { flex: 0 0 auto; }
.publishing-media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.publishing-media-grid > .empty { grid-column: 1 / -1; margin: 8px 0; }
.publishing-media-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--bg); transition: border-color .15s, background .15s; }
.publishing-media-card.is-selected { border-color: var(--violet); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--violet); }
.publishing-media-preview, .publishing-media-placeholder { display: block; width: 100%; aspect-ratio: 4 / 5; max-height: 200px; object-fit: contain; background: #111216; }
.publishing-media-placeholder { display: grid; place-items: center; color: #a7a8b3; font-size: 13px; }
.publishing-media-label { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 7px !important; padding: 10px 8px; cursor: pointer; font-size: 12px !important; line-height: 1.45; color: var(--text) !important; }
.publishing-media-label input[type=checkbox] { min-height: 0; width: 17px; height: 17px; padding: 0; margin: 1px 0 0; flex: none; accent-color: var(--violet); }
.publishing-media-label span { overflow-wrap: anywhere; }
.publishing-captions:not(:empty) { border-top: 1px solid var(--divider); margin-top: 8px; padding-top: 14px; }
.publishing-captions h3 { margin: 0 0 14px; font-size: 15px; }
.publishing-caption-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; margin-bottom: 14px; }
.publishing-caption-row button { margin-top: 23px; padding: 8px; font-size: 12px; }
.publishing-caption-row textarea { width: 100%; min-height: 78px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); color: var(--text); resize: vertical; font-size: 15px; }
.publishing-timing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border-top: 1px solid var(--divider); padding-top: 16px; }
.publishing-content select { width: 100%; min-height: 44px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); color: var(--text); }
.publishing-content .connection-help { font-size: 12px; }
.publishing-queue-heading { padding: 4px 2px 12px; }
.publishing-queue-heading h2 { margin: 3px 0 0; font-size: 21px; letter-spacing: -.025em; }
.publication-batch { padding: 18px; }
.publication-batch h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.publication-batch .connection-heading { align-items: flex-start; gap: 8px; }
.publication-batch .connection-state { white-space: normal; text-align: right; }
.publication-destination { font-size: 14px; font-weight: 650; margin: 9px 0 4px; }
.publication-review-note { padding: 10px 12px; border-radius: 11px; background: var(--accent-soft); font-size: 12px; line-height: 1.6; }
.publication-batch progress { display: block; width: 100%; height: 5px; margin: 16px 0 0; accent-color: var(--violet); }
.publication-items { margin: 14px 0; border-top: 1px solid var(--divider); padding-top: 11px; }
.publication-items summary { font-size: 13px; font-weight: 650; cursor: pointer; }
.publication-result { display: grid; gap: 5px; padding: 12px 0; font-size: 13px; border-bottom: 1px solid var(--divider); }
.publication-result:last-child { border-bottom: 0; padding-bottom: 0; }
.publication-result small { color: var(--muted); }
.publication-caption { white-space: pre-wrap; margin: 3px 0; }
.publication-metrics { font-size: 12px; margin: 3px 0; color: var(--cyan); }
.publication-batch .connection-actions { margin-top: 14px; }
@media (max-width: 1200px) {
  .publishing-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .publishing-queue { min-width: 0; }
}
@media (max-width: 720px) {
  .publishing-compose, .publishing-connection { padding: 15px; }
  .publishing-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .publishing-source-heading input[type=search] { flex-basis: 100%; }
  .publishing-source-heading button { flex: 1 1 auto; font-size: 12px; }
  .publishing-caption-row { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .publishing-caption-row button { justify-self: end; margin: 0; }
  .publishing-timing { grid-template-columns: minmax(0, 1fr); }
  .publication-batch { padding: 15px; }
  .publication-batch .connection-actions button { flex: 1 1 auto; }
  #publishing .view-head > button { padding: 8px 10px; font-size: 12px; }
}
.login-footer { margin: 35px 0 0; color: var(--muted); font-size: 12px; }
@media (max-width: 1020px) {
  .shell { grid-template-columns: 248px minmax(0, 1fr); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .top { min-height: calc(56px + env(safe-area-inset-top)); display: flex; justify-content: space-between; padding-inline: max(13px, env(safe-area-inset-left)) max(13px, env(safe-area-inset-right)); }
  .brand { font-size: 17px; }
  .brand .mark { width: 32px; height: 32px; }
  .top-title, .status, .desktop-render-link, .compose-hint { display: none; }
  .top-account { margin-left: auto; }
  .profile-button { max-width: 145px; }
  .connections-grid, .profile-fields { grid-template-columns: minmax(0, 1fr); }
  .connection-card { padding: 17px; }
  .profile-summary { align-items: flex-start; }
  .profile-summary h2 { font-size: 18px; }
  .connection-actions button, .profile-summary button { min-height: 44px; }
  .login-screen { place-items: start center; }
  .login-inner { margin-block: auto; }
  .login-profile { width: min(140px, calc(50vw - 30px)); }
  .mobile-compose, .mobile-chat-list { display: inline-grid; }
  .mobile-compose, .mobile-chat-list { background: transparent; color: var(--violet); }
  .shell { display: block; }
  .mobile-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); flex: none; padding: 4px max(9px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(9px, env(safe-area-inset-left)); background: var(--chrome); border-top: 1px solid var(--divider); }
  .mobile-nav button { min-height: 53px; display: grid; align-content: center; justify-items: center; gap: 2px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 650; padding: 3px; }
  .mobile-nav button[aria-current] { color: var(--violet); background: var(--accent-soft); }
  .keyboard-open .mobile-nav { display: none; }
  #sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 9; border: 0; background: #15132965; }
  .sidebar { display: none; position: fixed; inset: auto 0 0; height: min(86dvh, 760px); max-height: calc(var(--app-height, 100dvh) - 12px); z-index: 10; padding: 11px max(15px, env(safe-area-inset-right)) calc(13px + env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left)); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; box-shadow: var(--float-shadow); overflow: hidden; overscroll-behavior: contain; }
  .drawer-open .sidebar { display: flex; }
  .drawer-head { display: flex; flex: none; justify-content: space-between; align-items: center; font-weight: 730; letter-spacing: -.025em; font-size: 21px; padding-left: 4px; }
  #threads { flex: 1 1 0; min-height: 44px; max-height: none; }
  .thread-link, .memory-link, .queue summary { min-height: 44px; }
  .sidebar-end { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-end .memory-link { min-height: 44px; }
  .sidebar > #studio-menu { flex-shrink: 1; min-height: 54px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .studio-menu-toggle { position: sticky; top: 0; z-index: 1; background: var(--sidebar); }
  .studio-menu-content { max-height: none; overflow: visible; }
  .thread-search-box input { min-height: 44px; font-size: 16px; }
  .memory-link { font-size: 13px; padding-inline: 8px; gap: 7px; }
  .memory-link small { font-size: 10px; }
  .queue { flex: none; }
  .view-head { padding: 10px max(14px, env(safe-area-inset-right)) 11px max(14px, env(safe-area-inset-left)); }
  .view-head .eyebrow { font-size: 10px; }
  .view-head h1 { font-size: 26px; }
  .chat-head h1 { font-size: 20px; }
  .chat-head .secondary { min-height: 44px; padding-inline: 8px; font-size: 12px; }
  .timeline, .scroll-content { padding: 14px max(13px, env(safe-area-inset-right)) 16px max(13px, env(safe-area-inset-left)); }
  .timeline { gap: 9px; }
  .message.user { max-width: 92%; padding: 9px 12px; }
  .composer-area { padding: 5px max(9px, env(safe-area-inset-right)) 8px max(9px, env(safe-area-inset-left)); }
  .composer { padding: 6px 7px; border-radius: 18px; }
  #prompt { min-height: 44px; font-size: 16px; resize: none; }
  @supports (field-sizing: content) { #prompt { field-sizing: content; } }
  #model-button { min-height: 44px; max-width: min(54vw, 260px); }
  .model-panel { right: -48px; max-height: 36dvh; overflow-y: auto; }
  #chat-model, #chat-provider, .filter input:not([type="checkbox"]), .hf-form input, .hf-form select, .hf-form textarea { font-size: 16px; }
  .primary, .secondary, .examples button, .filter input:not([type="checkbox"]), .viral-input-row input, #chat-model, #chat-provider { min-height: 44px; }
  .hf-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hf-upload { grid-template-columns: minmax(0, 1fr); }
  .hf-form label { min-width: 0; }
  .task-card, .history-item, .agent-card { padding: 12px; }
  .viral-form .viral-input-row { display: grid; }
  .viral-form .viral-input-row input, .viral-form .primary { width: 100%; }
  .viral-filter input { flex-basis: 150px; }
  .viral-preview { max-height: 55dvh; }
  #query { min-width: 130px; }
}
@media (max-width: 420px) {
  .top { gap: 7px; }
  .profile-button { width: 44px; padding: 5px; justify-content: center; }
  #current-profile { display: none; }
  .profile-summary { flex-wrap: wrap; }
}
@media (max-width: 720px) and (max-height: 460px) {
  body:has(#prompt:focus) .mobile-nav { display: none; }
}


.claude-plan-connection h3 { font-size: 14px; margin: 18px 0 8px; }
.connection-card .connection-help { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 9px 0 13px; }
.claude-auth-panel { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--accent-soft); }
.claude-auth-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; min-height: 44px; }
.claude-auth-panel .connection-form { margin-block: 15px; }
.claude-api-connection { border-top: 1px solid var(--divider); margin-top: 18px; padding-top: 12px; }
.claude-api-connection summary { cursor: pointer; min-height: 44px; display: list-item; align-content: center; font-size: 14px; font-weight: 650; }
#claude-code-input { width: 100%; min-width: 0; font-size: 16px; }

/* Product briefs, source-backed concepts and human review. */
.creative-content { --content: 1180px; }
.creative-tabs { display: flex; gap: 4px; padding: 4px; width: fit-content; max-width: 100%; border-radius: 14px; background: var(--surface); margin: 0 0 24px; }
.creative-tabs button { border: 0; background: transparent; padding: 10px 16px; border-radius: 11px; font-size: 13px; font-weight: 650; }
.creative-tabs button[aria-selected=true] { background: var(--panel); box-shadow: var(--shadow); color: var(--violet); }
.creative-layout { display: grid; grid-template-columns: minmax(240px,.75fr) minmax(0,1.7fr); gap: 24px; align-items: start; }
.creative-brief { position: sticky; top: 0; }
.creative-content h2 { margin: 3px 0 16px; font-size: 23px; letter-spacing: -.035em; line-height: 1.2; }
.creative-content h3 { margin: 5px 0 12px; font-size: 18px; letter-spacing: -.02em; line-height: 1.3; }
.creative-content .task-card { padding: 20px; }
.creative-content label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--muted); margin-bottom: 15px; }
.creative-content input, .creative-content select, .creative-content textarea { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); background: var(--bg); border-radius: 11px; padding: 10px 11px; color: var(--text); font-size: 14px; }
.creative-content textarea { min-height: 84px; max-height: 220px; }
.creative-brief > button, #creative-review-save { width: 100%; min-height: 44px; }
.creative-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.creative-filters input { flex: 1 1 170px; width: auto; }
.creative-filters select { flex: 0 1 160px; width: auto; }
.creative-card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.creative-concept-card { min-width: 0; margin: 0; }
.creative-concept-card p { font-size: 13px; overflow-wrap: anywhere; }
.creative-mechanism { border-left: 2px solid var(--violet); padding-left: 11px; }
.creative-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 8px; }
.creative-tags span { border-radius: 6px; padding: 3px 7px; font-size: 10px; color: var(--violet); background: var(--accent-soft); }
.creative-evidence { font-size: 10px; line-height: 1.5; }
.creative-concept-detail { border-top: 1px solid var(--divider); margin-top: 13px; padding-top: 11px; font-size: 12px; }
.creative-concept-detail summary { cursor: pointer; font-weight: 650; color: var(--muted); }
.creative-concept-detail strong { display: block; margin-top: 14px; }
.creative-concept-detail blockquote { margin: 12px 0; padding-left: 10px; border-left: 2px solid var(--line); color: var(--muted); white-space: pre-wrap; }
.creative-source-link { display: inline-block; font-size: 12px; overflow-wrap: anywhere; }
.creative-matches { padding: 20px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--accent-soft); }
.creative-matches > .primary { margin-top: 16px; min-height: 44px; }
.creative-match-reasons { padding-left: 16px; font-size: 11px; color: var(--muted); }
#creative-board-detail { font-size: 12px; margin-bottom: 18px; }
#creative-board-detail details { margin-bottom: 10px; }
.creative-review-intro { max-width: 680px; margin-bottom: 22px; }
.creative-review-intro p, .creative-memory-note p { color: var(--muted); font-size: 13px; }
.creative-review-layout { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.2fr); gap: 24px; align-items: start; }
.creative-review-picker { position: sticky; top: 0; }
.creative-review-player { display: block; width: 100%; max-height: 60dvh; object-fit: contain; border-radius: 13px; background: #101115; }
#creative-review-history { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.creative-ratings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 14px; }
.creative-evidence-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 10px; }
.creative-memory-note { max-width: 750px; margin-bottom: 26px; }
#creative-skill-status { display: inline-block; padding: 7px 10px; font-size: 12px; border-radius: 8px; background: var(--accent-soft); color: var(--violet); }
.creative-lesson p { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.creative-lesson button { margin-top: 13px; }
.creative-source-details { margin-top: 24px; }
.creative-source-details > summary { cursor: pointer; font-weight: 600; }
.creative-source-row { padding: 12px 0; border-bottom: 1px solid var(--divider); }
@media (max-width: 1100px) {
  .creative-layout { grid-template-columns: minmax(220px,.8fr) minmax(0,1.2fr); gap: 16px; }
  .creative-card-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 720px) {
  .creative-layout, .creative-review-layout { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .creative-brief, .creative-review-picker { position: static; }
  .creative-tabs { width: 100%; gap: 2px; margin-bottom: 18px; }
  .creative-tabs button { flex: 1; font-size: 11px; padding: 9px 7px; min-height: 44px; }
  .creative-content .task-card { padding: 16px; }
  .creative-content input, .creative-content select, .creative-content textarea { font-size: 16px; }
  .creative-evidence-row { grid-template-columns: 1fr 1fr; }
  .creative-evidence-row > label:first-child { grid-column: 1 / -1; }
  .creative-filters input { flex-basis: 100%; }
  .creative-filters select { flex: 1; }
  .creative-matches { padding: 14px; }
  #creative .view-head > button { padding: 8px 10px; font-size: 12px; }
  #creative .view-head p { max-width: 270px; }
}
.generation-preference-toggle { display:flex; align-items:center; gap:12px; cursor:pointer; margin:16px 0; font-weight:600; }
.generation-preference-toggle input { width:22px; height:22px; flex:0 0 22px; accent-color:var(--accent,#b8a9ed); }

/* Shared reference library: quiet gallery with the original media close at hand. */
.references-content { --content: 1260px; }
.reference-intro { display:flex; justify-content:space-between; align-items:center; gap:24px; padding:5px 0 24px; }
.reference-intro h2 { margin:0 0 9px; font-size:26px; letter-spacing:-.04em; line-height:1.2; }
.reference-intro p { max-width:650px; color:var(--muted); font-size:13px; margin:0; }
.reference-intro > button { flex:none; min-height:44px; }
.reference-upload { margin-bottom:24px; }
.references-content input, .references-content select, .references-content textarea { min-width:0; min-height:44px; color:var(--text); background:var(--bg); border:1px solid var(--line); border-radius:11px; padding:10px 12px; font:inherit; }
.references-content textarea { resize:vertical; min-height:88px; max-height:260px; }
.reference-upload label, .reference-edit label { display:flex; flex-direction:column; gap:7px; margin-bottom:14px; font-size:12px; color:var(--muted); }
.reference-upload-fields { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.reference-upload .reference-drop { align-items:center; border:1px dashed var(--line); border-radius:16px; padding:23px 14px; background:var(--accent-soft); color:var(--text); font-size:15px; text-align:center; }
.reference-drop small { color:var(--muted); font-size:11px; }
.reference-drop input { max-width:100%; font-size:12px; border:0; background:transparent; }
.reference-drop.dragging { outline:2px solid var(--violet); }
.reference-upload-footer { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.reference-upload-footer p { margin:0; font-size:12px; color:var(--muted); overflow-wrap:anywhere; }
.reference-upload-footer button { flex:none; }
.reference-filters { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:16px; }
.reference-filters input { flex:1 1 230px; }
.reference-filters select { flex:0 1 180px; }
.reference-results-head { display:flex; align-items:center; justify-content:space-between; color:var(--muted); font-size:11px; margin:0 0 14px; }
.reference-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; align-items:start; }
.reference-card { min-width:0; border:1px solid var(--line); border-radius:20px; background:var(--panel); overflow:hidden; box-shadow:var(--shadow); }
.reference-preview { aspect-ratio:4/3; background:var(--surface); overflow:hidden; display:flex; align-items:center; justify-content:center; position:relative; }
.reference-preview a { display:flex; width:100%; height:100%; align-items:center; justify-content:center; }
.reference-preview img, .reference-preview video { display:block; width:100%; height:100%; object-fit:contain; background:#15151b; }
.reference-preview-file { flex-direction:column; gap:9px; color:var(--muted); font-size:13px; padding:16px; }
.reference-preview audio { width:100%; min-width:0; height:40px; margin-top:8px; }
.reference-file-icon { font-size:42px; font-weight:300; color:var(--violet); }
.reference-card-body { padding:16px; }
.reference-card-topline { display:flex; justify-content:space-between; gap:8px; font-size:10px; color:var(--muted); }
.reference-card h3 { font-size:17px; line-height:1.3; letter-spacing:-.025em; margin:9px 0; overflow-wrap:anywhere; }
.reference-card-notes { font-size:12px; color:var(--muted); margin:8px 0 12px; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.reference-tags { display:flex; flex-wrap:wrap; gap:5px; margin:8px 0; }
.reference-tags span { font-size:10px; color:var(--violet); background:var(--accent-soft); border-radius:6px; padding:3px 6px; overflow-wrap:anywhere; }
.reference-byline { display:block; font-size:10px; color:var(--muted); overflow-wrap:anywhere; margin-top:10px; }
.reference-card-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:16px; }
.reference-card-actions .primary, .reference-card-actions .secondary { text-align:center; text-decoration:none; min-height:40px; padding:9px 10px; font-size:11px; flex:1 1 auto; }
.reference-settings { margin-top:14px; border-top:1px solid var(--divider); padding-top:10px; }
.reference-settings summary { cursor:pointer; font-size:11px; color:var(--muted); min-height:28px; }
.reference-edit { margin-top:10px; }
.reference-edit input, .reference-edit textarea { width:100%; font-size:13px; }
.reference-edit button { min-height:40px; font-size:12px; }
.reference-delete { border:0; background:var(--danger-soft); color:var(--red); border-radius:10px; min-height:40px; font-size:11px; padding:9px 12px; margin-top:10px; cursor:pointer; }
.reference-delete-confirm p { font-size:12px; }
.reference-delete-confirm button { margin-right:7px; }
.reference-empty { grid-column:1/-1; text-align:center; padding:58px 20px; border:1px dashed var(--line); border-radius:22px; }
.reference-empty-mark { display:inline-grid; place-items:center; width:58px; height:58px; background:var(--accent-soft); border-radius:18px; font-size:30px; color:var(--violet); }
.reference-empty h2 { font-size:22px; letter-spacing:-.035em; margin:20px 0 9px; }
.reference-empty p { max-width:460px; margin:auto; color:var(--muted); font-size:13px; }
#references-more { display:block; margin:24px auto 0; }
.file-chip { flex-wrap:wrap; }
.file-chip .reference-file-toggle { display:flex; align-items:center; flex:1 0 100%; gap:6px; padding:4px 0 0; font-size:10px; color:var(--muted); cursor:pointer; }
.reference-file-toggle input { width:15px; height:15px; margin:0; accent-color:var(--violet); }
.file-chip .reference-file-toggle span { white-space:normal; max-width:none; }
@media (min-width:1550px) { .reference-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (max-width:1100px) { .reference-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; } .reference-intro { align-items:flex-start; flex-direction:column; gap:16px; } }
@media (max-width:720px) {
  .reference-intro { padding:5px 0 20px; }
  .reference-intro h2 { font-size:24px; }
  .reference-intro > button { width:100%; }
  .reference-upload-fields { grid-template-columns:minmax(0,1fr); gap:0; }
  .reference-upload-footer { align-items:stretch; flex-direction:column; }
  .reference-filters { gap:8px; }
  .reference-filters input { flex-basis:100%; }
  .reference-filters select { flex:1; }
  .references-content input, .references-content select, .references-content textarea { font-size:16px; }
  .reference-grid { gap:10px; }
  .reference-card { border-radius:15px; }
  .reference-card-body { padding:11px; }
  .reference-card h3 { font-size:14px; }
  .reference-card-actions { gap:6px; }
  .reference-card-actions .primary, .reference-card-actions .secondary { flex-basis:100%; min-height:44px; }
  .reference-card-notes { font-size:11px; }
  .reference-preview-file { padding:8px; }
  .reference-preview audio { height:32px; }
  .reference-settings summary { min-height:36px; }
  .reference-edit input, .reference-edit textarea { padding:8px; }
  .reference-edit button, .reference-delete { width:100%; min-height:44px; }
  .file-chip .reference-file-toggle { min-height:32px; }
  #references .view-head > button { font-size:12px; padding:8px; }
}

.reference-analysis-label { display:block; color:var(--muted); font-size:10px; line-height:1.5; margin-top:8px; }
.reference-insights { border-top:1px solid var(--divider); padding-top:9px; margin-top:13px; }
.reference-insights summary { color:var(--violet); cursor:pointer; font-size:11px; font-weight:600; min-height:28px; }
.reference-insights p { font-size:12px; line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; margin:9px 0; }
.reference-insights strong { font-size:11px; display:block; margin-top:13px; }
@media (max-width:720px) { .reference-insights summary { min-height:36px; } .reference-insights p { font-size:11px; } }

.file-upload-progress { background:var(--accent-soft); border:1px solid var(--line); border-radius:12px; padding:10px 12px; margin:10px 0; }
.file-upload-progress > div { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.file-upload-progress span { font-size:11px; line-height:1.5; color:var(--muted); overflow-wrap:anywhere; min-width:0; }
.file-upload-progress button { flex:none; font-size:11px; min-height:36px; padding:7px 10px; }
.file-upload-progress progress { display:block; width:100%; height:5px; margin-top:9px; accent-color:var(--violet); }
@media (max-width:720px) { .file-upload-progress { padding:9px; } .file-upload-progress button { min-height:44px; } }

.reference-imports { margin:0 0 24px; }
.reference-imports h2 { font-size:19px; letter-spacing:-.025em; margin:0 0 5px; }
.reference-imports > p { color:var(--muted); font-size:12px; margin:0 0 12px; }
.reference-import-job { background:var(--panel); border:1px solid var(--line); border-radius:13px; padding:13px 15px; margin-bottom:8px; }
.reference-import-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; font-size:13px; }
.reference-import-heading strong { overflow-wrap:anywhere; min-width:0; }
.reference-import-heading span { color:var(--violet); font-size:11px; }
.reference-import-job p, .reference-import-job details { color:var(--muted); font-size:11px; overflow-wrap:anywhere; margin:8px 0 0; }
.reference-import-job progress { display:block; width:100%; height:5px; margin-top:10px; accent-color:var(--violet); }
.reference-import-job summary { cursor:pointer; min-height:28px; }
.reference-link-form { margin:0 0 20px; min-width:0; }
.reference-link-form > label { display:block; font-size:14px; font-weight:600; margin-bottom:10px; }
.reference-link-input { display:flex; gap:10px; min-width:0; }
.reference-link-input input { flex:1; width:0; }
.reference-link-input button { flex:none; min-height:44px; }
.reference-link-form > p { margin:10px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.reference-source-link { display:inline-flex; align-items:center; min-height:36px; font-size:11px; color:var(--violet); overflow-wrap:anywhere; }
.reference-link-job > button { margin-top:10px; min-height:40px; }
.reference-link-job .reference-link-failure { color:var(--red); }
@media(max-width:560px) { .reference-link-input { flex-wrap:wrap; } .reference-link-input input { flex:1 1 100%; width:100%; } .reference-link-input button { width:100%; } }

/* Product context and independent creative work. */
.product-workspace { flex:none; min-width:0; padding:10px max(24px,calc((100% - var(--content))/2)); border-bottom:1px solid var(--divider); background:var(--bg); }
.admin-provider-controls { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; }
.admin-provider-controls label { font-weight:600; }
.admin-provider-controls select { width:auto; }
.admin-provider-controls small { color:var(--muted); }
.product-context-row { display:flex; align-items:center; justify-content:space-between; gap:16px; min-width:0; }
.product-identity { display:flex; align-items:center; min-width:0; max-width:65%; gap:4px; }
.product-select { display:flex; align-items:center; gap:10px; min-width:0; border:1px solid transparent; padding:4px 9px 4px 4px; border-radius:14px; background:transparent; text-align:left; }
.product-remove { flex:none; display:grid; place-items:center; width:36px; height:36px; padding:0; border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--muted); }
.product-remove:hover:not(:disabled) { color:var(--text); border-color:var(--muted); }
.product-remove .icon { width:15px; height:15px; }
.product-clear { margin-bottom:12px; min-height:40px; }
.product-select:hover:not(:disabled) { background:var(--panel); border-color:var(--line); }
.product-select:disabled { opacity:1; }
.product-select > span:nth-child(2) { min-width:0; }
.product-select small { display:block; font-size:8px; font-weight:750; letter-spacing:.12em; color:var(--muted); }
.product-select strong { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:13px; letter-spacing:-.015em; }
.product-miniature { flex:none; display:grid; place-items:center; width:36px; height:36px; border-radius:10px; overflow:hidden; background:var(--accent-soft); color:var(--violet); font-size:20px; font-weight:650; }
.product-miniature img { width:100%; height:100%; object-fit:cover; }
.product-chevron { color:var(--muted); font-size:17px; padding:0 3px; }
.product-select:disabled .product-chevron { visibility:hidden; }
.product-readiness { text-align:right; min-width:0; font-size:10px; color:var(--muted); }
.product-readiness > span { display:block; }
.product-readiness [data-status=ready], .product-option-status[data-status=ready] { color:var(--cyan); }
.product-readiness [data-status=preparing], .product-option-status[data-status=preparing] { color:var(--violet); }
.product-readiness [data-status=failed], .product-option-status[data-status=failed], .product-readiness [data-status=error], .product-option-status[data-status=error] { color:var(--amber); }
.production-knowledge { margin:6px 4px 2px; color:var(--muted); font-size:9px; line-height:1.4; }
.production-knowledge[data-status=missing] { color:var(--amber); }
.shared-teaching { display:flex; flex-wrap:wrap; align-items:center; gap:2px 10px; margin:4px 4px 2px; min-width:0; color:var(--muted); font-size:10px; line-height:1.4; }
.shared-teaching-label { font-weight:600; }
.shared-teaching-topic { display:inline-flex; align-items:baseline; flex-wrap:wrap; gap:4px; max-width:100%; min-height:28px; padding:6px 0; overflow-wrap:anywhere; }
a.shared-teaching-topic { color:var(--violet); text-decoration:none; }
a.shared-teaching-topic:hover { text-decoration:underline; }
.shared-teaching-topic small { color:var(--muted); font-size:9px; white-space:nowrap; }
.shared-teaching-more { flex-basis:100%; min-width:0; }
.shared-teaching-more summary { width:fit-content; max-width:100%; min-height:28px; padding:6px 0; cursor:pointer; color:var(--violet); }
.shared-teaching-list { display:flex; flex-wrap:wrap; gap:2px 12px; max-height:180px; overflow-y:auto; }
.shared-teaching-partial { flex-basis:100%; }
.video-workflow { display:grid; grid-template-columns:auto minmax(0,240px); align-items:center; gap:5px 10px; margin:8px 4px 5px; min-width:0; }
.video-workflow-label { color:var(--muted); font-size:11px; font-weight:600; }
.video-workflow select { width:100%; min-width:0; min-height:34px; padding:6px 30px 6px 10px; border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--text); font:inherit; font-size:11px; }
.video-workflow[data-workflow=genjutsu_kling4_video_edit] select { border-color:var(--violet); }
.video-workflow select:focus-visible { outline:2px solid var(--violet); outline-offset:2px; }
.video-workflow select:disabled { opacity:.65; }
.video-workflow-hint, .video-workflow-status { grid-column:1 / -1; margin:0; color:var(--muted); font-size:10px; line-height:1.45; overflow-wrap:anywhere; }
.video-workflow-status { color:var(--cyan); }
.video-workflow-status[data-error=true] { color:var(--red); }
@media(max-width:720px) { .video-workflow { grid-template-columns:1fr; gap:4px; } .video-workflow select { min-height:42px; font-size:13px; } }
@media(max-width:720px) { .shared-teaching-topic, .shared-teaching-more summary { min-height:36px; padding:9px 0; } }
.product-text-button, .product-back { border:0; background:transparent; padding:6px 0; color:var(--violet); font-size:11px; font-weight:600; min-height:32px; text-align:left; }
.product-back { display:block; margin:0 0 3px; }
.product-text-button:hover, .product-back:hover { text-decoration:underline; }
.production-tray { margin-top:7px; border-top:1px solid var(--divider); }
.production-tray summary { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:35px; cursor:pointer; font-size:11px; font-weight:650; list-style:none; }
.production-tray summary::-webkit-details-marker { display:none; }
.production-tray summary::after { content:'⌄'; color:var(--muted); font-size:15px; }
.production-tray[open] summary::after { transform:rotate(180deg); }
.production-tray summary small { font-size:10px; color:var(--muted); font-weight:400; margin-left:auto; }
.production-count { display:inline-grid; place-items:center; min-width:19px; height:19px; border-radius:6px; background:var(--accent-soft); color:var(--violet); padding:0 4px; margin-left:5px; font-size:10px; }
.production-task-list { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(210px, 300px); gap:9px; overflow-x:auto; overscroll-behavior:contain; padding:2px 1px 10px; scroll-snap-type:x proximity; }
.production-task-card { display:flex; flex-direction:column; align-items:flex-start; gap:7px; border:1px solid var(--line); border-radius:13px; padding:11px 13px; background:var(--panel); text-align:left; min-width:0; max-width:300px; scroll-snap-align:start; }
.production-task-card:hover { border-color:var(--violet); }
.production-task-card strong { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-size:12px; line-height:1.4; letter-spacing:-.015em; }
.production-task-status { display:flex; align-items:center; gap:5px; font-size:9px; color:var(--muted); }
.production-state-dot { display:inline-block; width:5px; height:5px; border-radius:50%; background:var(--muted); }
.production-task-card[data-status=running] .production-state-dot, .production-task-card[data-status=rendering] .production-state-dot { background:var(--violet); box-shadow:0 0 0 3px var(--accent-soft); }
.production-task-card[data-status=done] .production-state-dot { background:var(--cyan); }
.production-task-card[data-status=attention] .production-state-dot, .production-task-card[data-status=failed] .production-state-dot, .production-task-card[data-status=waiting_approval] .production-state-dot { background:var(--amber); }
.production-task-detail { display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; font-size:10px; color:var(--muted); }
.production-task-open { color:var(--violet); font-size:10px; margin-top:auto; }
.production-launch { display:flex; align-items:center; justify-content:center; flex:none; gap:5px; border:1px solid var(--line); background:var(--panel); color:var(--violet); border-radius:11px; min-height:38px; padding:6px 10px; font-size:10px; font-weight:650; white-space:nowrap; }
.production-launch .icon { width:16px; height:16px; }
.production-launch:hover { background:var(--accent-soft); border-color:var(--violet); }
body:has(.production-launch:not([hidden])) .compose-hint { display:none; }
.product-dialog { width:min(740px,calc(100vw - 40px)); max-height:calc(100dvh - 64px); border:1px solid var(--line); border-radius:24px; padding:25px; color:var(--text); background:var(--panel); box-shadow:var(--float-shadow); overflow:auto; overscroll-behavior:contain; }
.product-dialog::backdrop { background:#10101d70; backdrop-filter:blur(7px); }
.product-dialog-head { display:flex; justify-content:space-between; align-items:flex-start; gap:15px; }
.product-dialog-head .eyebrow { font-size:9px; letter-spacing:.14em; color:var(--violet); }
.product-dialog-head h2 { font-size:27px; letter-spacing:-.045em; line-height:1.25; margin:6px 0; }
.product-dialog-head p { font-size:12px; color:var(--muted); margin:0; }
.product-dialog-head .icon-button { width:36px; height:36px; border-radius:11px; }
.product-tabs { display:flex; background:var(--surface); padding:4px; border-radius:12px; margin:23px 0 19px; gap:4px; }
.product-tabs button { flex:1; border:0; background:transparent; min-height:36px; border-radius:9px; font-size:12px; color:var(--muted); font-weight:600; }
.product-tabs button[aria-pressed=true] { background:var(--panel); color:var(--text); box-shadow:var(--shadow); }
.product-dialog input:not([type=checkbox]):not([type=file]), .product-dialog textarea { color:var(--text); width:100%; padding:11px 12px; border:1px solid var(--line); background:var(--bg); border-radius:11px; min-width:0; font-size:13px; }
.product-dialog textarea { resize:vertical; min-height:85px; max-height:200px; }
.product-list { display:flex; flex-direction:column; gap:8px; margin:14px 0 5px; min-height:90px; }
.product-option { display:flex; align-items:center; gap:12px; padding:12px; border:1px solid var(--line); border-radius:14px; background:var(--panel); text-align:left; width:100%; }
.product-option:hover, .product-option.selected { border-color:var(--violet); background:var(--accent-soft); }
.product-option-image { display:grid; place-items:center; flex:none; width:56px; height:56px; overflow:hidden; border-radius:11px; background:var(--surface); color:var(--violet); font-weight:700; font-size:22px; }
.product-option-image img { width:100%; height:100%; object-fit:cover; }
.product-option-copy { min-width:0; flex:1; }
.product-option-copy strong { display:block; font-size:14px; }
.product-option-copy small { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-size:11px; color:var(--muted); margin-top:3px; }
.product-option-status { flex:0 0 110px; font-size:10px; color:var(--muted); text-align:right; }
.product-empty { text-align:center; padding:35px 20px; }
.product-empty strong { font-size:17px; letter-spacing:-.02em; }
.product-empty p { font-size:12px; color:var(--muted); margin:8px auto 18px; max-width:360px; }
.product-create > label { display:block; font-size:12px; font-weight:650; margin-bottom:15px; }
.product-create > label input, .product-create > label textarea { display:block; margin-top:7px; font-weight:400; }
.product-photo-source { display:flex; align-items:center; justify-content:space-between; gap:16px; padding-top:4px; }
.product-photo-source strong { font-size:12px; }
.product-photo-source p { font-size:11px; line-height:1.5; color:var(--muted); margin:4px 0; }
.product-photo-source button { white-space:nowrap; font-size:11px; }
.product-photo-list { display:flex; gap:8px; flex-wrap:wrap; margin-top:13px; }
.product-photo-chip { display:flex; align-items:center; gap:7px; max-width:100%; border:1px solid var(--line); padding:5px 7px; border-radius:10px; font-size:10px; background:var(--bg); }
.product-photo-chip img { width:34px; height:34px; object-fit:cover; border-radius:6px; }
.product-photo-chip span { max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.product-photo-chip button { border:0; background:transparent; font-size:18px; color:var(--muted); min-width:28px; min-height:32px; }
.product-help { color:var(--muted); font-size:11px; margin:9px 0 15px; }
.product-reference-search { display:flex; align-items:center; gap:8px; padding:10px 0; }
.product-reference-search button { font-size:11px; }
.product-reference-list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; max-height:280px; overflow-y:auto; padding:3px; }
.product-reference-choice { position:relative; min-width:0; padding:6px; border:1px solid var(--line); border-radius:10px; cursor:pointer; }
.product-reference-choice:has(input:checked) { border-color:var(--violet); background:var(--accent-soft); }
.product-reference-choice img { width:100%; aspect-ratio:1; object-fit:cover; border-radius:6px; display:block; }
.product-reference-choice input { position:absolute; top:10px; left:10px; width:18px; height:18px; margin:0; accent-color:var(--violet); }
.product-reference-choice span { display:block; margin-top:5px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:9px; }
.product-create-footer { display:flex; justify-content:space-between; align-items:center; gap:20px; border-top:1px solid var(--divider); padding-top:17px; margin-top:20px; }
.product-create-footer p { color:var(--muted); font-size:11px; line-height:1.6; max-width:370px; margin:0; }
.product-create-footer button { flex:none; font-size:12px; }

/* A shared, browsable hook library; only the selection belongs to this chat. */
.hook-launch { display:flex; align-items:center; justify-content:center; flex:none; gap:5px; min-height:38px; padding:6px 10px; border:1px solid var(--line); border-radius:11px; background:var(--panel); color:var(--violet); font-size:10px; font-weight:650; white-space:nowrap; }
.hook-launch .icon { width:16px; height:16px; }
.hook-label-short { display:none; }
.hook-launch:hover { background:var(--accent-soft); border-color:var(--violet); }
body:has(.hook-launch:not([hidden])) .compose-hint { display:none; }
.chat-hook-pin { display:flex; flex-wrap:wrap; align-items:center; gap:8px; min-width:0; padding:6px; margin:0 0 10px; border:1px solid var(--line); border-radius:13px; background:var(--bg); }
.hook-pin-open { display:flex; align-items:center; gap:10px; min-width:0; flex:1; padding:0 4px; text-align:left; border:0; background:transparent; }
.hook-pin-open img { width:31px; height:41px; object-fit:cover; border-radius:7px; flex:none; }
.hook-pin-open > span { min-width:0; }
.hook-pin-open small { font-size:8px; letter-spacing:.1em; font-weight:700; color:var(--violet); }
.hook-pin-open strong { display:block; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hook-pin-attention { display:block; color:var(--amber); font-size:10px; line-height:1.5; overflow-wrap:anywhere; margin-top:3px; }
.hook-pin-remove { flex:none; width:36px; height:36px; border:0; border-radius:9px; font-size:22px; background:transparent; color:var(--muted); }
.hook-pin-remove:hover:not(:disabled) { background:var(--surface); }
.hook-pin-error { flex:1; min-width:0; font-size:11px; color:var(--amber); }
.hook-dashboard { width:min(1160px,calc(100vw - 48px)); height:min(1000px,calc(100dvh - 48px)); max-height:calc(100dvh - 48px); margin:auto; padding:0; border:1px solid var(--line); border-radius:25px; background:var(--bg); color:var(--text); box-shadow:var(--float-shadow); overflow:hidden; }
.hook-dashboard[open] { display:flex; flex-direction:column; }
.hook-dashboard::backdrop { background:#0b0b166d; backdrop-filter:blur(10px); }
.hook-dashboard-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding:24px 26px 18px; }
.hook-dashboard-head > div { min-width:0; }
.hook-dashboard-head .eyebrow { font-size:9px; letter-spacing:.14em; font-weight:700; color:var(--violet); }
.hook-dashboard-head h2 { margin:7px 0; font-size:31px; letter-spacing:-.045em; line-height:1.15; }
.hook-dashboard-head p { margin:0; color:var(--muted); font-size:12px; }
.hook-dashboard-head .icon-button { width:38px; height:38px; border-radius:12px; }
.hook-search-form { display:flex; gap:9px; min-width:0; padding:0 26px 16px; }
.hook-search-form input, .hook-search-form select { min-width:0; min-height:44px; border:1px solid var(--line); border-radius:12px; background:var(--panel); color:var(--text); padding:10px 13px; font-size:13px; }
.hook-search-form input { flex:1; }
.hook-search-form select { width:170px; flex:none; }
.hook-search-form button { min-height:44px; padding:8px 17px; font-size:12px; }
.hook-categories { display:flex; gap:7px; flex:none; overflow-x:auto; overscroll-behavior:contain; padding:1px 26px 12px; scrollbar-width:thin; }
.hook-category { display:flex; align-items:center; gap:8px; flex:none; min-height:36px; padding:7px 12px; border:1px solid var(--line); border-radius:99px; background:var(--panel); color:var(--muted); font-size:11px; font-weight:600; }
.hook-category small { font-size:10px; margin:0; opacity:.8; color:inherit; }
.hook-category[aria-pressed=true] { background:var(--action); border-color:transparent; color:var(--on-action); }
.hook-dashboard-status { display:flex; align-items:center; justify-content:space-between; gap:15px; flex:none; padding:0 26px 9px; border-bottom:1px solid var(--divider); }
.hook-dashboard-status p { font-size:11px; color:var(--muted); margin:0; }
.hook-write-note { margin:0; padding:11px 26px; color:var(--amber); background:var(--panel); font-size:11px; border-bottom:1px solid var(--divider); }
#hook-error { margin:10px 26px; }
.hook-results { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:20px 26px 28px; }
.hook-group { margin:0 0 28px; }
.hook-group > h3 { margin:0 0 12px; font-size:17px; font-weight:650; letter-spacing:-.025em; }
.hook-card-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); align-items:start; gap:14px; }
.hook-card { overflow:hidden; min-width:0; border:1px solid var(--line); border-radius:18px; background:var(--panel); box-shadow:var(--shadow); }
.hook-card-visual { position:relative; aspect-ratio:9/12; overflow:hidden; background:#09090d; border-bottom:1px solid var(--line); }
.hook-preview { display:block; width:100%; height:100%; object-fit:contain; background:#09090d; }
.hook-preview-toggle { position:absolute; left:9px; top:9px; z-index:1; min-height:30px; padding:6px 9px; border:1px solid #ffffff30; border-radius:99px; color:#fff; background:#121219b8; backdrop-filter:blur(8px); font-size:9px; font-weight:600; }
.hook-card-badges { position:absolute; bottom:67px; left:9px; right:9px; display:flex; flex-wrap:wrap; justify-content:space-between; gap:5px; pointer-events:none; }
.hook-card-badges span { background:#121219bd; backdrop-filter:blur(8px); color:#fff; font-size:9px; font-weight:600; padding:4px 7px; border-radius:7px; }
.hook-media-placeholder { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:12px; height:100%; padding:20px; color:#b9bac9; font-size:11px; text-align:center; background:linear-gradient(145deg,#222331,#15151e); }
.hook-media-symbol { display:grid; place-items:center; width:50px; height:50px; border:1px solid #ffffff20; border-radius:16px; color:#ddd9ff; font-size:25px; }
.hook-card-body { padding:13px; }
.hook-card-body h4 { margin:0; font-size:14px; line-height:1.35; letter-spacing:-.02em; overflow-wrap:anywhere; }
.hook-description { margin:7px 0 10px; font-size:11px; line-height:1.6; color:var(--muted); overflow-wrap:anywhere; }
.hook-tags { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:11px; }
.hook-tags span { max-width:100%; border-radius:6px; padding:3px 6px; font-size:9px; line-height:1.4; color:var(--violet); background:var(--accent-soft); overflow-wrap:anywhere; }
.hook-recipe { min-width:0; margin:0 0 10px; border:1px solid var(--line); border-radius:11px; background:var(--bg); }
.hook-recipe > summary { min-height:44px; padding:10px; color:var(--violet); cursor:pointer; font-size:11px; font-weight:650; line-height:1.7; overflow-wrap:anywhere; }
.hook-recipe > summary:focus-visible { outline:2px solid var(--violet); outline-offset:2px; border-radius:10px; }
.hook-recipe-status { display:inline-block; padding:1px 6px; margin-left:5px; border-radius:6px; font-size:9px; font-weight:550; color:var(--muted); background:var(--panel); }
.hook-recipe-status[data-state=detailed] { color:var(--cyan); }
.hook-recipe-status[data-state=partial], .hook-recipe-status[data-state=queued], .hook-recipe-status[data-state=running] { color:var(--amber); }
.hook-recipe-status[data-state=failed] { color:var(--red); }
.hook-recipe-content { max-height:560px; overflow:auto; overscroll-behavior:contain; padding:0 10px 12px; font-size:11px; line-height:1.65; overflow-wrap:anywhere; scrollbar-width:thin; }
.hook-recipe-content p { margin:7px 0; }
.hook-recipe-intro, .hook-recipe-clock, .hook-recipe-unknown { color:var(--muted); }
.hook-recipe-clock { font-size:10px; }
.hook-recipe-warning, .hook-recipe-job { padding:8px 9px; border-radius:8px; background:var(--panel); color:var(--amber); }
.hook-recipe-content h5 { margin:14px 0 7px; font-size:11px; color:var(--text); line-height:1.5; }
.hook-recipe-content h6 { margin:12px 0 6px; font-size:10px; font-weight:650; color:var(--muted); }
.hook-recipe-shot { margin:12px 0; padding:10px; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
.hook-recipe-shot > h5 { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:4px 9px; margin:0 0 8px; }
.hook-recipe-shot > h5 > span { font-weight:500; color:var(--violet); font-variant-numeric:tabular-nums; }
.hook-recipe-fields { margin:8px 0; }
.hook-recipe-fields dt { margin-top:7px; color:var(--muted); font-size:10px; font-weight:600; }
.hook-recipe-fields dd { margin:1px 0 0; white-space:pre-wrap; }
.hook-recipe-identity, .hook-recipe-blocking { border-left:2px solid var(--line); padding-left:9px; margin:9px 0 12px; }
.hook-recipe-blocking > strong, .hook-recipe-identity > strong { font-size:10px; color:var(--violet); }
.hook-recipe-list { padding-left:18px; margin:7px 0 12px; }
.hook-recipe-list li { margin:5px 0; }
.hook-recipe-dialogue { border-left:2px solid var(--violet); padding-left:9px; margin:9px 0; }
.hook-recipe-dialogue > strong { font-size:10px; color:var(--muted); }
.hook-recipe-pinned { flex-basis:100%; width:100%; margin:0; background:var(--panel); }
.hook-recipe-pinned .hook-recipe-content { max-height:320px; }
.hook-prompt { border-top:1px solid var(--divider); margin:0 0 10px; }
.hook-prompt summary { display:list-item; min-height:36px; padding:9px 0; font-size:10px; color:var(--muted); cursor:pointer; }
.hook-prompt pre { max-height:220px; overflow:auto; padding:10px; border-radius:9px; background:var(--bg); font:10px/1.65 ui-monospace,SFMono-Regular,Menlo,monospace; white-space:pre-wrap; overflow-wrap:anywhere; }
.hook-help, .hook-card-error { font-size:10px; line-height:1.6; color:var(--muted); overflow-wrap:anywhere; }
.hook-card-error { color:var(--red); }
.hook-boundary-warning { margin:0 0 12px; padding:9px 11px; border:1px solid var(--line); border-radius:9px; color:var(--amber); font-size:11px; line-height:1.6; overflow-wrap:anywhere; }
.hook-range-editor { margin:0 0 12px; border-top:1px solid var(--divider); }
.hook-range-editor > summary { display:list-item; min-height:44px; padding:12px 0; font-size:11px; color:var(--violet); cursor:pointer; }
.hook-range-source { display:block; width:100%; max-height:330px; margin:10px 0; background:#09090d; border:1px solid var(--line); border-radius:10px; }
.hook-range-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.hook-range-field { display:flex; min-width:0; flex-direction:column; gap:7px; font-size:11px; color:var(--muted); }
.hook-range-field input { min-width:0; width:100%; min-height:44px; padding:9px; border:1px solid var(--line); border-radius:9px; color:var(--text); background:var(--bg); font:inherit; }
.hook-range-time { min-height:44px; padding:7px; font-size:10px; line-height:1.3; white-space:normal; }
.hook-range-save { width:100%; min-height:44px; font-size:11px; padding:9px; }
.hook-range-message:empty { display:none; }
.hook-source { display:inline-flex; align-items:center; min-height:34px; font-size:10px; }
.hook-select { width:100%; min-height:40px; font-size:11px; padding:9px; border-radius:10px; }
.hook-more { display:block; min-height:44px; margin:5px auto 0; }
.hook-empty { padding:48px 20px; text-align:center; max-width:500px; margin:auto; }
.hook-empty-icon { display:grid; place-items:center; width:64px; height:64px; margin:0 auto 18px; background:var(--accent-soft); color:var(--violet); border-radius:20px; font-size:30px; }
.hook-empty h3 { font-size:22px; line-height:1.3; letter-spacing:-.035em; }
.hook-empty p { margin:12px 0 22px; font-size:13px; line-height:1.7; color:var(--muted); }
@media (max-width:1000px) { .hook-card-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:720px) {
  .hook-launch { min-width:44px; min-height:44px; padding:0 5px; border:0; background:transparent; font-size:12px; }
  .hook-label-full { display:none; }
  .hook-label-short { display:inline; }
  .hook-launch .icon { width:18px; height:18px; }
  .compose-footer:has(.hook-launch:not([hidden])) { gap:3px; }
  #chat .compose-footer:has(.hook-launch:not([hidden])) #model-button { max-width:min(100%,32vw,180px); min-width:44px; padding:6px 3px; }
  .hook-pin-remove { width:44px; height:44px; }
  .hook-dashboard { width:calc(100vw - 16px); height:calc(100dvh - 20px); max-height:calc(100dvh - 20px); border-radius:22px; }
  .hook-dashboard-head { gap:12px; padding:20px 17px 16px; }
  .hook-dashboard-head h2 { font-size:27px; }
  .hook-dashboard-head .icon-button { width:44px; height:44px; }
  .hook-dashboard-head p { font-size:11px; }
  .hook-search-form { flex-wrap:wrap; padding:0 17px 12px; gap:7px; }
  .hook-search-form input { flex:1 1 100%; font-size:16px; }
  .hook-search-form select { flex:1; width:auto; font-size:14px; }
  .hook-search-form button { min-width:84px; }
  .hook-categories { padding:1px 17px 10px; }
  .hook-category { min-height:40px; }
  .hook-dashboard-status { padding:0 17px 7px; }
  .hook-dashboard-status p { font-size:10px; }
  .hook-dashboard-status button { min-height:40px; }
  .hook-write-note { padding:10px 17px; }
  #hook-error { margin:10px 17px; }
  .hook-results { padding:17px 17px 24px; }
  .hook-card-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; }
  .hook-card-visual { aspect-ratio:9/13; }
  .hook-preview-toggle { min-height:36px; font-size:10px; }
  .hook-prompt summary, .hook-source { min-height:44px; }
  .hook-select { min-height:44px; }
}
@media (max-width:450px) {
  .hook-card-grid { grid-template-columns:minmax(0,1fr); }
  .hook-card-visual { aspect-ratio:9/10; }
  .hook-card-body { padding:15px; }
  .hook-card-body h4 { font-size:16px; }
  .hook-description { font-size:12px; }
  .hook-recipe-content { max-height:55dvh; font-size:12px; }
  .hook-recipe-content h5 { font-size:12px; }
  .hook-prompt summary, .hook-help, .hook-source { font-size:11px; }
  .hook-card-badges { bottom:67px; }
}
@media (max-width:720px) {
  .product-workspace { padding:7px max(13px,env(safe-area-inset-right)) 7px max(13px,env(safe-area-inset-left)); }
  .product-context-row { gap:9px; }
  .product-identity { max-width:67%; gap:2px; }
  .product-select { padding-left:0; gap:8px; }
  .product-remove { width:40px; height:44px; }
  .product-select strong { font-size:12px; }
  .product-select small { font-size:7px; }
  .product-miniature { width:32px; height:32px; border-radius:9px; }
  .product-readiness { font-size:9px; }
  .product-readiness .product-text-button { font-size:9px; min-height:28px; }
  .product-back { min-height:34px; font-size:11px; }
  .production-tray { margin-top:4px; }
  .production-tray summary { min-height:34px; font-size:10px; }
  .production-tray summary small { font-size:9px; max-width:48%; text-align:right; }
  .production-task-list { grid-auto-columns:205px; padding-bottom:7px; }
  .production-task-card { padding:10px 11px; gap:6px; }
  .production-launch { width:44px; min-height:44px; padding:0; border:0; background:transparent; }
  .production-launch span { display:none; }
  .production-launch .icon { width:20px; height:20px; }
  .compose-footer:has(.production-launch:not([hidden])) { gap:4px; }
  .compose-footer:has(.production-launch:not([hidden])) #model-button { max-width:min(41vw,220px); padding:6px 4px; }
  .product-dialog { width:calc(100vw - 18px); max-height:calc(100dvh - 28px); padding:18px 15px; border-radius:22px; }
  .product-dialog-head h2 { font-size:25px; }
  .product-dialog-head .icon-button { width:40px; height:40px; }
  .product-dialog input:not([type=checkbox]):not([type=file]), .product-dialog textarea { font-size:16px; }
  .product-tabs { margin:18px 0 16px; }
  .product-tabs button { min-height:40px; }
  .product-option { flex-wrap:wrap; gap:10px; padding:10px; }
  .product-option-image { width:48px; height:48px; }
  .product-option-copy { flex-basis:calc(100% - 70px); }
  .product-option-status { flex:1 1 100%; padding-left:58px; text-align:left; font-size:10px; }
  .product-photo-source { align-items:flex-start; flex-direction:column; gap:8px; }
  .product-photo-source button { width:100%; }
  .product-reference-list { grid-template-columns:repeat(3,minmax(0,1fr)); max-height:240px; }
  .product-create-footer { flex-direction:column; align-items:stretch; gap:13px; }
  .product-create-footer button { width:100%; }
  .product-create-footer p { max-width:none; }
}

/* Personal subscription handoff: readable and usable on a phone. */
.device-code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.device-code-row code { font-size: clamp(20px, 4vw, 28px); font-weight: 700; letter-spacing: .08em; color: var(--text); user-select: all; overflow-wrap: anywhere; }
.connection-api-alternative { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.connection-api-alternative > summary { cursor: pointer; font-size: 13px; font-weight: 650; }
.connection-api-alternative > form { margin-top: 14px; }
#higgsfield-switch-help h3 { margin: 0 0 10px; font-size: 15px; }
#higgsfield-connection-feedback.connection-notice { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text); }

body.customer-page { display: block; height: auto; min-height: 100dvh; overflow: auto; }
.customer-page > main { width: 100%; min-width: 0; }
#customer-connections { margin: 24px 0; }
#customer-connections > summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
#customer-connections .connections-grid { margin-top: 16px; }
.customer-page #customer-text { display: block; width: 100%; min-height: 100px; }
.customer-page nav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.customer-page nav select { max-width: 100%; }

/* Studio workspace: neutral canvas, orchard accent and compact navigation. */
.top .mark, .login-mark { color: #281b2e; background: linear-gradient(135deg,#bba7ed,#eebad5); box-shadow: inset 0 0 0 1px #ffffff40; }
#chat .chat-head { background: var(--bg); border-bottom: 0; }
#chat .chat-head h1 { font-size: clamp(20px, 2.2vw, 27px); line-height: 1.18; letter-spacing: -.032em; font-weight: 680; }
#chat .chat-head p { font-size: 12px; }
.new-thread { background: var(--accent-soft); border-color: #59405d; }
.new-thread:hover { background: #49364d; }
.thread-link.current { box-shadow: inset 2px 0 var(--violet); }
.thread-child:not(.current) .thread-title { font-weight: 475; }
.thread-children { border-color: #544552; }
.thread-search-box input { background: var(--bg); }
#chat .timeline { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.message.user { background: #302834; border: 1px solid #413346; }
.message.assistant:not(.running):not(.failed) > .rich { line-height: 1.62; }
#chat .composer { background: #242128; box-shadow: 0 4px 15px #0002; border-radius: 16px; }
#chat .composer:focus-within { border-color: var(--violet); }
#prompt::placeholder { color: #aca3b0; }
#chat .video-result-info h3 { color: var(--text); }
#chat .video-result-preview { border: 1px solid var(--divider); }
@media (min-width:721px) {
  .top { min-height: 52px; }
  .top-title { visibility: hidden; }
  .profile-button { min-height: 36px; }
  #chat .chat-head { padding-block: 12px 7px; }
  #chat .composer-area { padding-block: 6px 13px; }
  #chat .timeline { gap: 14px; padding-block: 18px; }
  #chat .video-result-grid:has(.video-result:nth-child(3)) { grid-template-columns: repeat(auto-fit,minmax(min(172px,100%),1fr)); }
}
@media (max-width:720px) {
  #chat .chat-head { padding-block: 7px 4px; }
  #chat .chat-head p { font-size: 11px; }
  .mobile-nav button { min-height: 44px; }
  .shell main, .shell .view { min-height: 0; }
}
/* Product identity and frequently used actions stay in one compact toolbar. */
#product-workspace {
  padding-block: 5px;
}
.context-toolbar {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  min-height: 40px;
}
.context-toolbar .product-identity {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}
.context-toolbar .product-select {
  max-width: 100%;
  min-height: 38px;
  gap: 8px;
}
.context-toolbar .product-miniature {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 17px;
}
.context-toolbar .product-select strong {
  font-size: 13px;
  font-weight: 600;
}
.context-toolbar .product-back,
#context-toggle,
#context-tasks {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  margin: 0;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.context-toolbar .product-back {
  min-width: 34px;
  padding-inline: 4px;
  font-size: 19px;
}
.context-toolbar .product-back:hover,
#context-toggle:hover,
#context-tasks:hover {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}
#context-toggle[aria-expanded="true"] {
  background: var(--accent-soft);
  color: var(--violet);
}
.context-toolbar .icon { width: 16px; height: 16px; }
#context-model {
  padding-inline-start: 8px;
  margin: 0;
  border-inline-start: 1px solid var(--line);
  color: var(--violet);
  font-size: 11px;
}
#context-warning, #context-tasks[data-state="attention"] {
  color: var(--amber);
}
#context-tasks[data-state="running"] { color: var(--cyan); }
#context-warning {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 50%;
}
#context-tasks[data-state="attention"]::after {
  content: "!";
  font-size: 11px;
  font-weight: 700;
}
#context-panel {
  max-height: min(36dvh, 330px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  margin: 3px 0 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  scrollbar-width: thin;
}
#context-panel .product-readiness {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  text-align: start;
  font-size: 12px;
}
#context-panel .product-remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
  width: auto;
  min-height: 32px;
  padding-inline: 8px;
  font-size: 11px;
}
#context-panel .production-knowledge,
#context-panel .shared-teaching { margin-inline: 0; font-size: 11px; }
#context-panel .video-workflow {
  grid-template-columns: max-content minmax(135px, 250px);
  justify-content: start;
  margin: 8px 0;
}
@media (max-width: 720px) {
  #product-workspace { padding-block: 2px; }
  .context-toolbar { gap: 2px; }
  .context-toolbar .product-select,
  .context-toolbar .product-back,
  #context-tasks,
  #context-toggle { min-height: 44px; }
  .context-toolbar .product-back, #context-tasks { min-width: 42px; }
  #context-toggle, #context-tasks { padding-inline: 6px; gap: 4px; }
  #context-model { display: none; }
  #context-panel { max-height: min(32dvh, 275px); padding: 10px; }
  #context-panel .video-workflow { grid-template-columns: minmax(0, 1fr); }
  #context-panel .product-text-button, #context-panel .product-remove { min-height: 44px; }
}

.product-motion { grid-column: 1 / -1; min-width: 0; margin-top: .3rem; }
.product-motion summary { cursor: pointer; padding: .45rem 0; color: var(--text); }
.motion-fields { display: grid; gap: .65rem; padding: .6rem 0; min-width: 0; }
.motion-fields label { display: grid; gap: .3rem; color: var(--muted); }
.motion-fields :is(textarea,select,input) { width: 100%; min-width: 0; max-width: 100%; }
.motion-fields textarea { resize: vertical; }
.motion-fields button { justify-self: start; }
.clip-review { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .75rem; }
.clip-review-reasons { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .3rem .8rem; }
.clip-review-reasons[hidden] { display: none; }
.clip-review-reasons label { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.5rem; cursor: pointer; }
.clip-review-reasons input[type=checkbox] { width: 1rem; height: 1rem; margin: 0; }
.clip-review .product-help { flex-basis: 100%; margin: 0; }
.dictation-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 3px 10px; color: var(--muted); font-size: 13px; }
.dictation-bar[hidden], #dictation-overflow[hidden] { display: none; }
.dictation-bar span { flex: 1 1 12rem; }
.dictation-bar button { font-size: 12px; }
#dictation-button { flex: none; }
#dictation-button .stop-shape, #dictation-button[aria-pressed="true"] .mic-shape { display: none; }
#dictation-button[aria-pressed="true"] { background: var(--accent-soft); color: var(--violet); }
#dictation-button[aria-pressed="true"] .stop-shape { display: inline; }
@media (max-width: 480px) {
  .compose-footer .compose-actions { gap: 2px; }
  #chat .compose-footer:has(#dictation-button) #model-button { max-width: min(24vw,100%); min-width: 0; }
}
#creative-quality-cohort:not(:empty) { display: grid; gap: .3rem; padding-bottom: .8rem; }
@media (max-width: 640px) {
  .clip-review button, .motion-fields button { min-height: 44px; }
}

.language-switch {
  flex: none;
  min-width: 44px;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .04em;
}
.login-inner { position: relative; }
.login-inner > .language-switch { position: absolute; top: 20px; right: 0; }
.login-open .top .language-switch { display: none; }
.customer-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

#higgsfield-account-info:not(:empty) {
  margin: 10px 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  overflow-wrap: anywhere;
}
#higgsfield-account-info[data-state="checking"] { color: var(--muted); }
#higgsfield-account-info[data-state="success"] { border-inline-start: 3px solid var(--cyan); }
#higgsfield-account-info[data-state="cached"] { border-inline-start: 3px solid var(--amber); }
#higgsfield-account-info[data-state="error"] { border-inline-start: 3px solid var(--red); background: var(--danger-soft); }
@media (max-width: 720px) {
  .language-switch { min-height: 44px; }
}
.workspace-switch { display:grid; grid-template-columns:1fr 1fr; gap:3px; padding:3px; border:1px solid var(--divider); border-radius:12px; background:var(--bg); }
.workspace-switch button { display:flex; justify-content:center; align-items:center; gap:7px; min-height:34px; border:0; border-radius:8px; background:transparent; color:var(--muted); font-weight:650; }
.workspace-switch button[aria-current] { background:var(--accent-soft); color:var(--violet); }
.workspace-switch .icon { width:16px; height:16px; }
.sidebar #edit-sidebar { display:none; }
body.edit-mode .sidebar #edit-sidebar:not([hidden]) { display:flex; flex:1 1 auto; flex-direction:column; min-height:0; gap:10px; }
body.edit-mode .sidebar > :is(#new-thread,.thread-heading,#thread-controls,#thread-search-status,#threads) { display:none; }
#edit-sidebar h2 { margin:7px 5px 2px; color:var(--muted); font-size:12px; font-weight:650; }
#edit-project-list { display:grid; align-content:start; gap:3px; overflow:auto; overscroll-behavior:contain; }
.ed-project-link { width:100%; min-height:40px; padding:8px 11px; border:0; border-radius:9px; color:var(--text); background:transparent; text-align:start; overflow-wrap:anywhere; }
.ed-project-link:hover { background:var(--surface); }
.ed-project-link[aria-current] { color:var(--violet); background:var(--accent-soft); font-weight:650; }
#edit:not([hidden]) { display:flex; flex-direction:column; height:100%; min-height:0; min-width:0; }
.ed-header { flex:none; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:17px max(22px,calc((100% - 860px)/2)); background:var(--chrome); border-bottom:1px solid var(--divider); }
.ed-header h1 { margin:0; font-size:clamp(21px,3vw,29px); line-height:1.18; overflow-wrap:anywhere; }
#ed-projects-toggle { display:none; }
.ed-scroll { min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.ed-content { width:min(100%,904px); padding:18px 22px 42px; margin:0 auto; }
#ed-form:not([hidden]) { display:grid; gap:12px; }
.ed-card { margin:0; padding:clamp(14px,2.2vw,23px); background:var(--panel); border:1px solid var(--divider); border-radius:16px; min-width:0; }
.ed-card h2 { margin:0 0 14px; font-size:17px; line-height:1.24; }
.ed-card label { display:flex; min-width:0; flex-direction:column; gap:6px; font-weight:620; font-size:13px; }
.ed-card :is(input:not([type=file]),textarea,select) { width:100%; min-width:0; min-height:40px; padding:9px 11px; border:1px solid var(--line); border-radius:9px; background:var(--bg); color:var(--text); font:inherit; font-size:14px; }
.ed-card textarea { resize:vertical; min-height:60px; }
.ed-card :is(input,textarea,select):focus-visible,.ed-icon:focus-visible,.ed-project-link:focus-visible { outline:2px solid var(--violet); outline-offset:2px; }
.ed-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.ed-timing { grid-template-columns:repeat(3,minmax(0,1fr)); margin-top:15px; }
.ed-card .ed-field { margin:15px 0 6px; }
.ed-source-block { display:flex; flex-wrap:wrap; align-items:end; gap:8px; }
.ed-source-block > :is(label,select) { flex:1 1 200px; }
.ed-source-block .secondary,#edit .secondary { min-height:40px; }
.ed-card p { margin:8px 0 0; color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
#ed-ends { display:grid; gap:5px; margin:6px 0 8px; padding:0; list-style:none; }
#ed-ends:empty,.ed-status:empty,#ed-suggestions:empty { display:none; }
#ed-ends li { display:flex; gap:6px; align-items:center; padding:5px 7px; border:1px solid var(--divider); border-radius:9px; background:var(--bg); }
.ed-clip-index { color:var(--muted); min-width:22px; text-align:center; font-size:12px; font-variant-numeric:tabular-nums; }
.ed-clip-name { flex:1; min-width:0; overflow-wrap:anywhere; font-size:13px; }
.ed-icon { min-width:34px; min-height:34px; border:0; border-radius:7px; color:var(--text); background:var(--surface); }
.ed-status { color:var(--muted); font-size:13px; margin:0 0 10px; overflow-wrap:anywhere; }
.ed-status.ed-error { color:var(--red); }
.ed-primary { min-height:42px; padding:9px 16px; color:var(--on-action); background:var(--action); border:0; border-radius:10px; font-weight:680; }
.ed-primary:hover { background:var(--action-hover); }
.ed-actions { display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:8px; margin-top:12px; }
#ed-suggest { margin-top:8px; }
#ed-suggestions { display:grid; gap:5px; margin-top:8px; }
.ed-suggestion { padding:9px 11px; text-align:start; border:1px solid var(--line); border-radius:9px; color:var(--text); background:var(--bg); }
.ed-suggestion:hover { color:var(--violet); border-color:var(--violet); }
#ed-font-preview { padding:11px 12px; margin-top:7px; color:white; background:#24232b; border-radius:9px; text-align:center; overflow-wrap:anywhere; font:700 18px/1.24 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; }
#ed-font-preview[data-font=mobile-classic] { font-weight:500; }
#ed-font-preview[data-font=mobile-heavy] { font-weight:900; text-shadow:0 1px 2px #000; }
#ed-outputs { margin-top:12px; }
.ed-run + .ed-run { margin-top:16px; padding-top:16px; border-top:1px solid var(--divider); }
.ed-run h3 { margin:0; font-size:14px; }
.ed-run-message { white-space:pre-wrap; }
@media (max-width:720px) {
  .mobile-nav { grid-template-columns:repeat(5,minmax(0,1fr)); }
  #ed-projects-toggle { display:inline-flex; }
  .ed-header { padding:12px 14px; }
  .ed-content { padding:12px 12px 24px; }
  .ed-card :is(input:not([type=file]),textarea,select) { font-size:16px; min-height:44px; }
  .ed-icon { min-width:40px; min-height:40px; }
}
@media (max-width:500px) {
  .ed-grid,.ed-timing { grid-template-columns:1fr; gap:9px; }
  .ed-source-block > :is(label,select) { flex-basis:100%; }
  .ed-source-block .secondary { flex:1 1 auto; }
}

.ed-modes { display:inline-flex; gap:3px; max-width:100%; margin:0 0 14px; padding:3px; border:1px solid var(--line); border-radius:12px; background:var(--bg); }
.ed-modes button { min-height:36px; padding:6px 13px; background:transparent; border:0; border-radius:9px; color:var(--muted); font:inherit; font-size:13px; font-weight:600; }
.ed-modes button[aria-pressed=true] { color:var(--text); background:var(--surface); }
#ed-series { min-width:0; }
#ed-series[hidden],#ed-basic[hidden],#ed-modes[hidden] { display:none; }
.es-toolbar { display:flex; gap:8px; align-items:center; margin:0 0 12px; }
.es-toolbar select { flex:1; min-width:0; height:40px; padding:0 10px; color:var(--text); background:var(--panel); border:1px solid var(--line); border-radius:9px; font:inherit; font-size:14px; }
.es-form { display:grid; gap:12px; min-width:0; border:0; margin:0; padding:0; }
.es-field { display:grid; align-content:start; min-width:0; gap:6px; }
.es-field-title { font-size:13px; font-weight:620; }
.es-field + .es-field,.es-product > .ed-grid + .es-field,.es-form > section > .es-field { margin-top:10px; }
.es-picker { display:flex; align-items:center; gap:6px; min-width:0; }
.es-picker select { flex:1; width:0; }
.es-picker button { flex:none; }
.es-refs { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:7px 0; }
.es-ref { display:inline-flex; align-items:center; gap:6px; max-width:100%; padding:3px 4px 3px 7px; overflow-wrap:anywhere; color:var(--text); font-size:12px; border-radius:8px; background:var(--surface); }
.es-ref img { width:30px; height:30px; object-fit:cover; border-radius:5px; }
.es-remove { min-width:31px; min-height:31px; color:var(--muted); background:transparent; border:0; border-radius:6px; font-size:19px; }
.es-mini { display:block; width:66px; height:66px; border-radius:8px; object-fit:cover; }
.es-triptych { display:block; width:100%; max-height:155px; margin:9px 0; object-fit:contain; border-radius:10px; background:var(--bg); }
.es-view { min-width:0; margin-top:12px; }
.es-view > summary { width:fit-content; padding:5px 0; color:var(--violet); cursor:pointer; font-size:13px; font-weight:600; }
.es-view > :not(summary) { margin-top:8px; }
.es-source-video { display:block; width:100%; max-height:300px; border-radius:10px; background:#08080a; }
.es-row { padding-top:0; padding-bottom:0; }
.es-row > summary { display:flex; align-items:center; flex-wrap:wrap; gap:9px; min-height:50px; cursor:pointer; list-style:none; }
.es-row > summary::-webkit-details-marker { display:none; }
.es-row > summary::after { content:'▾'; color:var(--muted); margin-inline-start:auto; }
.es-row[open] > summary::after { transform:rotate(180deg); }
.es-slot { display:grid; place-items:center; min-width:26px; height:26px; color:var(--violet); background:var(--accent-soft); border-radius:8px; font-size:13px; font-variant-numeric:tabular-nums; }
.es-summary-note { min-width:0; max-width:52%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:var(--muted); font-size:12px; }
.es-row-body { display:grid; gap:12px; padding:8px 0 18px; border-top:1px solid var(--divider); }
.es-row-body .ed-grid > .es-field { margin:0; }
.es-times { grid-template-columns:repeat(4,minmax(0,1fr)); }
.es-status { margin:6px 0 10px; color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.es-status:empty { display:none; }
.es-status.ed-error,#ed-series .ed-error { color:var(--red); }
.es-output { margin-top:12px; }
.es-matrix { display:grid; gap:5px; }
.es-matrix-row { display:grid; align-items:stretch; grid-template-columns:24px repeat(2,minmax(0,1fr)); gap:5px; }
.es-index { align-self:center; color:var(--muted); font-size:13px; text-align:center; }
.es-matrix-cell { display:grid; align-content:start; grid-template-columns:1fr auto; gap:3px 8px; min-width:0; padding:8px 10px; border:1px solid var(--divider); background:var(--bg); border-radius:8px; font-size:13px; overflow-wrap:anywhere; }
.es-matrix-cell span,.es-matrix-cell small { color:var(--muted); font-size:12px; }
.es-matrix-cell span,.es-matrix-cell .ed-error { grid-column:1/-1; }
.es-total { color:var(--text); font-size:14px; margin-inline-end:auto; }
.es-exports { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.es-export { display:grid; align-content:start; gap:7px; min-width:0; padding:11px; border:1px solid var(--divider); border-radius:10px; }
.es-export-head { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.es-export-head small { color:var(--muted); font-size:12px; }
.es-export video { width:100%; max-height:330px; object-fit:contain; border-radius:8px; background:#08080a; }
#ed-series :is(button,summary,select):focus-visible,#ed-modes button:focus-visible { outline:2px solid var(--violet); outline-offset:2px; }
@media(max-width:650px) {
  .ed-modes { width:100%; }
  .ed-modes button { flex:1; min-height:42px; }
  .es-field .es-picker button,.es-view button { min-height:42px; }
  .es-grid,.es-exports { grid-template-columns:minmax(0,1fr); }
  .es-times { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #ed-series :is(select,input,textarea) { font-size:16px; }
  .es-matrix-cell { padding:7px; }
  .es-toolbar { flex-wrap:wrap; }
}

/* === Genjutsu theme 2026-11-26 (Ecom OP styl) === */
:root{--bg:#090912;--sidebar:#0b0b15;--panel:#10101b;--surface:#171726;--line:#2d2a48;--divider:#1b1a2b;--text:#f5f3ff;--muted:#9c98ba;--violet:#b892ff;--accent-soft:#1c1637;--cyan:#5fe8a2;--amber:#ffb84f;--red:#ff5f97;--chrome:#090912;--action:#b892ff;--action-hover:#cdb0ff;--on-action:#0b0a14;--float-shadow:0 24px 80px #000c;--content:960px;font-family:ui-rounded,"SF Pro Rounded","Nunito",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;}
body{background:linear-gradient(#ffffff07 1px,transparent 1px) 0 0/34px 34px,linear-gradient(90deg,#ffffff07 1px,transparent 1px) 0 0/34px 34px,radial-gradient(900px 500px at 70% 0%,#2a1b55 0%,transparent 65%),var(--bg);-webkit-font-smoothing:antialiased;}
button,input,select,textarea{font-family:inherit;}
h1,h2,h3{letter-spacing:-.02em;font-weight:700;}
.top{background:#090912d9;backdrop-filter:blur(14px);border-bottom:1px solid var(--divider);}
.brand .mark{background:linear-gradient(135deg,#b892ff,#ff5f97);color:#0b0a14;border-radius:11px;box-shadow:0 0 18px #b892ff66;}
.status{border:1px solid #5fe8a266;background:#5fe8a212;}
.profile-button,.language-switch{border:1px solid var(--line);background:#10101b;}
.sidebar{background:#0b0b15e6;border-right:1px solid var(--divider);}
.workspace-switch{background:#10101b;border:1px solid var(--line);border-radius:999px;padding:4px;}
.workspace-switch button{border-radius:999px;}
.workspace-switch button[aria-current=page]{background:linear-gradient(135deg,#b892ff,#8f6bff);color:#0b0a14;box-shadow:0 0 20px #b892ff55;}
.new-thread{border-radius:16px;border:1px solid #b892ff;background:#b892ff14;font-weight:700;box-shadow:0 0 0 1px #b892ff22,0 0 22px #b892ff22;}
.thread-link{border-radius:12px;}
.thread-link.current{background:#b892ff1a;border:1px solid #b892ff88;}
#thread-count{border:1px solid #ffb84f88;color:#ffb84f;background:#ffb84f14;}
.view-head h1{font-size:30px;letter-spacing:-.03em;}
.desktop-render-link{border:1px solid #ff5f9788;border-radius:999px;background:#ff5f9712;}
.welcome h2{font-size:clamp(36px,4.4vw,60px);line-height:1.04;letter-spacing:-.035em;}
.welcome .eyebrow{color:var(--cyan);letter-spacing:.14em;}
.examples button{border-radius:999px;background:#10101b;padding:10px 18px;font-weight:600;border:1px solid var(--line);}
.examples button:nth-child(1){border-color:#b892ff;color:#d5c0ff;box-shadow:0 0 18px #b892ff22;}
.examples button:nth-child(2){border-color:#5fe8a2;color:#a7f4cc;box-shadow:0 0 18px #5fe8a222;}
.examples button:nth-child(3){border-color:#ff5f97;color:#ffb0cb;box-shadow:0 0 18px #ff5f9722;}
.composer{border-radius:26px;background:#10101bf2;border:1px solid #b892ff99;padding:14px 16px 12px;box-shadow:0 0 0 1px #b892ff1f,0 0 40px #b892ff26,0 20px 70px #000a;}
.composer:focus-within{border-color:#b892ff;box-shadow:0 0 0 4px #b892ff2e,0 0 60px #b892ff40,0 20px 70px #000a;}
#prompt{background:transparent;border:0;box-shadow:none;}
.compose-footer button{border-radius:999px;}
.compose-footer button[type=submit]{background:linear-gradient(135deg,#5fe8a2,#38c98a);color:#06140d;box-shadow:0 0 20px #5fe8a255;}
input,select,textarea{border-radius:12px;}
/* === konec theme === */

/* === Genjutsu home 2026-11-26 === */
.welcome.gj-home{width:min(960px,100%);max-width:960px;margin:28px auto;text-align:left;}
.welcome.gj-home>.eyebrow,.welcome.gj-home>h2,.welcome.gj-home>p{display:none;}
.welcome.gj-home>.examples{margin-top:16px;}
.gj-headrow{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;margin-bottom:20px;}
.gj-headrow h2{margin:4px 0 6px;font-size:40px;}
.gj-headrow p{margin:0;color:var(--muted);}
.gj-live{display:flex;align-items:center;gap:9px;padding:10px 16px;border-radius:999px;border:1px solid #5fe8a2;background:#5fe8a20f;font-weight:600;font-size:13px;white-space:nowrap;box-shadow:0 0 22px #5fe8a222;}
.gj-live i{width:8px;height:8px;border-radius:50%;background:#5fe8a2;box-shadow:0 0 10px #5fe8a2;}
.gj-tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px;}
.gj-tile{display:flex;justify-content:space-between;align-items:center;padding:16px 18px;border-radius:16px;background:#10101bcc;border:1px solid var(--c);box-shadow:0 0 24px color-mix(in srgb,var(--c) 14%,transparent);}
.gj-tile span{font-size:13px;color:#d9d5ee;}
.gj-tile b{font-size:32px;line-height:1;color:var(--c);letter-spacing:-.03em;}
.gj-dash .violet{--c:#b892ff}.gj-dash .green{--c:#5fe8a2}.gj-dash .pink{--c:#ff5f97}.gj-dash .amber{--c:#ffb84f}
.gj-quests,.gj-line{border:1px solid #ffb84f66;border-radius:18px;padding:16px;background:#10101b99;margin-bottom:16px;}
.gj-line{border-color:var(--line);}
.gj-qhead{color:#ffb84f;font-weight:700;font-size:16px;margin-bottom:12px;}
.gj-lhead{font-weight:700;font-size:14px;margin-bottom:10px;color:var(--muted);}
.gj-qhead small{color:var(--muted);font-weight:500;margin-left:10px;font-size:12px;}
.gj-qgrid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;}
.gj-q{display:flex;gap:12px;align-items:center;padding:13px 14px;border-radius:14px;background:#0d0d17;border:1px solid color-mix(in srgb,var(--c) 55%,transparent);border-left:3px solid var(--c);color:var(--text);text-align:left;cursor:pointer;font:inherit;}
.gj-q:hover{background:#141422;}
.gj-q em{font-style:normal;font-size:22px;}
.gj-q div{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;}
.gj-q strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.gj-q small{font-size:12px;color:var(--muted);}
.gj-q u{text-decoration:none;font-size:12px;color:var(--c);font-weight:700;}
.gj-chips{display:flex;flex-wrap:wrap;gap:10px;}
.gj-chip{display:flex;flex-direction:column;gap:2px;padding:10px 16px;border-radius:14px;background:#0d0d17;border:1px solid var(--c);color:var(--text);text-align:left;cursor:pointer;font:inherit;}
.gj-chip b{font-size:14px;}
.gj-chip small{font-size:12px;color:var(--c);}
@media(max-width:760px){.gj-tiles{grid-template-columns:repeat(2,1fr);}.gj-qgrid{grid-template-columns:1fr;}.gj-headrow{flex-direction:column;align-items:flex-start;}}
/* === konec home === */

/* === Genjutsu views 2026-11-26 === */
.task-card,.ed-card{border:1px solid var(--line);border-radius:18px;background:#10101bcc;box-shadow:0 10px 40px #0006;}
.hf-catalog,.viral-form,.reference-upload{border-color:#b892ff88;box-shadow:0 0 28px #b892ff1c,0 10px 40px #0006;}
.account-generations{border-color:#5fe8a288;box-shadow:0 0 28px #5fe8a218,0 10px 40px #0006;}
.hf-form,.connection-form{border-color:#ffb84f77;box-shadow:0 0 28px #ffb84f14,0 10px 40px #0006;}
.creative-concept-card{border-left:3px solid #b892ff;}
.creative-concept-card:nth-child(4n+2){border-left-color:#5fe8a2;}
.creative-concept-card:nth-child(4n+3){border-left-color:#ff5f97;}
.creative-concept-card:nth-child(4n+4){border-left-color:#ffb84f;}
.library-item,.hf-capability{border:1px solid var(--line);border-radius:14px;background:#0d0d17;transition:border-color .15s,box-shadow .15s;}
.library-item:hover,.hf-capability:hover{border-color:#b892ff;box-shadow:0 0 22px #b892ff26;}
.hf-capability-type{color:var(--cyan);letter-spacing:.08em;}
main .eyebrow{color:var(--cyan);letter-spacing:.14em;}
button.primary,button.ed-primary{background:linear-gradient(135deg,#b892ff,#8f6bff);color:#0b0a14;border:0;border-radius:999px;font-weight:700;box-shadow:0 0 22px #b892ff44;}
button.primary:hover,button.ed-primary:hover{background:linear-gradient(135deg,#cdb0ff,#a488ff);}
button.primary:disabled,button.ed-primary:disabled{background:#2a2740;color:#8f8ba8;box-shadow:none;}
button.secondary,.model-button{border-radius:999px;border:1px solid var(--line);background:#10101b;}
button.secondary:hover,.model-button:hover{border-color:#b892ff;}
.ed-header h1,.view-head h1{font-size:30px;letter-spacing:-.03em;}
.ed-modes{background:#10101b;border:1px solid var(--line);border-radius:999px;padding:4px;}
.ed-modes button{border-radius:999px;}
.ed-modes button[aria-pressed=true],.ed-modes button[aria-selected=true],.ed-modes button.active{background:linear-gradient(135deg,#b892ff,#8f6bff);color:#0b0a14;}
.ed-status{color:var(--muted);}
.memory-link{border-radius:12px;}
.memory-link[aria-current=page]{background:#b892ff1a;box-shadow:inset 0 0 0 1px #b892ff88;}
.connection-state{border:1px solid #5fe8a266;border-radius:999px;padding:2px 10px;}
.viral-goal{border:1px solid #ff5f9788;color:#ffb0cb;border-radius:999px;background:#ff5f9712;}
.empty{color:var(--muted);}
/* === konec views === */
