:root {
  --bg: #09090b;
  --panel: #0d0d10;
  --panel-2: #141417;
  --elevated: #1c1c21;
  --control: #18181b;
  --line: rgba(255, 255, 255, 0.07);
  --line-soft: rgba(255, 255, 255, 0.05);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent: #f4f4f5;
  --accent-ink: #09090b;
  --gold: #f4f4f5;
  --sem-text: #38bdf8;
  --sakura: #ff7a9c;
  --sakura-deep: #f43f6e;
  --sakura-soft: #ffc2d1;
  --sem-image: #f59e0b;
  --sem-mesh: #a855f7;
  --sem-engine: #f5c451;
  --ok: #ff7a9c;
  --bad: #ef4444;
  --radius: 12px;
  --mono: "JetBrains Mono", "Geist Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --sans: "Inter", "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.55 var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
a { color: var(--accent); }

.shell { display: grid; grid-template-columns: minmax(340px, 440px) 1fr; gap: 16px; height: 100vh; padding: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 56px; }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--elevated); color: var(--text); font-weight: 700; }
.project-picker { display: flex; gap: 6px; min-width: 0; }
select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-width: 0; max-width: 220px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 18px; flex: none; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 8px 16px; font-weight: 600; }
.primary:hover { background: #e4e4e7; }
.primary:disabled { opacity: .5; cursor: default; }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; }
.ghost:hover { border-color: var(--line-strong); background: var(--elevated); }

/* Chat */
.tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 0; background: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; max-width: 180px; }
.tab span { overflow: hidden; text-overflow: ellipsis; }
.tab.active { color: var(--text); border-bottom-color: var(--text); }
.tab .x { opacity: 0; font-size: 14px; padding: 0 2px; }
.tab:hover .x, .tab.active .x { opacity: .6; }
.tab .x:hover { opacity: 1; color: var(--bad); }
.tab.add { color: var(--faint); font-size: 18px; }

.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 100%; }
.msg.user { align-self: flex-end; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px 12px 4px 12px; padding: 8px 12px; max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.agent { font-family: var(--sans); }
.msg.note { color: var(--faint); font-size: 12px; text-align: center; }
.msg .who { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.msg.agent .md > :first-child { margin-top: 0; }
.msg.agent .md > :last-child { margin-bottom: 0; }
.msg img.thumb { max-width: 120px; border-radius: 8px; display: block; margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font: 12px var(--mono); padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); }
.chip.ok::before { content: "✓ "; color: var(--ok); }
.chip.bad { color: var(--bad); border-color: #4a2a2a; }
.chip.link { cursor: pointer; }
.chip.link:hover { color: var(--text); }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

.chat-empty { margin: auto 0; color: var(--muted); }
.chat-empty h2 { color: var(--text); font-size: 18px; margin: 0 0 6px; }
.suggestions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.suggestion { text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); }
.suggestion:hover { border-color: var(--line-strong); background: var(--elevated); }

.banner { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.3); color: #fcd34d; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.banner button { margin-left: 6px; }

.composer { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.composer textarea { width: 100%; resize: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
.composer textarea:focus { border-color: rgba(255, 255, 255, 0.22); }
.composer-row { display: flex; align-items: center; gap: 10px; }
.hint { flex: 1; font-size: 12px; color: var(--faint); }
.attachments { display: flex; gap: 6px; flex-wrap: wrap; }
.attachments:empty { display: none; }
.attachments figure { margin: 0; position: relative; }
.attachments img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.attachments button { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; font-size: 11px; line-height: 1; }
.status { display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.dot.live { background: var(--ok); } .dot.off { background: var(--bad); }

/* Workspace */
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; color: var(--muted); font-size: 15px; }
.crumbs button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 3ch; }
.crumbs strong { flex-shrink: 0; max-width: 60%; }
.crumbs .sep { flex: none; }
.crumbs button { background: none; border: 0; padding: 0; color: var(--muted); }
.crumbs button:hover { color: var(--text); }
.crumbs strong { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .sep { color: var(--faint); }
.head-actions { display: flex; gap: 6px; }

.workspace-body { display: grid; grid-template-columns: 230px 1fr; flex: 1; min-height: 0; }
.sections { border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.proj-card { display: flex; gap: 12px; align-items: center; padding: 0 6px 20px; }
.proj-badge { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--gold); font-weight: 800; font-size: 18px; }
.proj-card strong { display: block; letter-spacing: .06em; text-transform: uppercase; font-size: 14px; }
.proj-card small { color: var(--muted); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sec-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 14px 8px 8px; }
.sec { display: flex; gap: 10px; align-items: baseline; text-align: left; padding: 10px 10px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--muted); }
.sec small { font: 11px var(--mono); color: var(--faint); }
.sec:hover { color: var(--text); }
.sec.active { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.sec.active small { color: var(--sakura); }
.sections .spacer { flex: 1; }
.sections .tip { font-size: 12px; color: var(--faint); padding: 8px; }

.content { overflow-y: auto; padding: 32px 40px 60px; min-width: 0; container-type: inline-size; }
.kicker { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 18px; }
.content h1.title { font-size: clamp(30px, 4vw, 46px); line-height: 1.08; margin: 0 0 14px; letter-spacing: -.02em; font-weight: 600; }
.lede { color: var(--muted); font-size: 15px; max-width: 640px; margin: 0 0 24px; }
.hero { width: 100%; max-height: 420px; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); display: block; margin-bottom: 28px; background: var(--panel-2); }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 28px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 18px 0 30px; }
.card { text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden; display: flex; flex-direction: column; color: var(--text); }
.card:hover { border-color: var(--line-strong); }
.card img { width: 100%; height: 130px; object-fit: cover; display: block; background: var(--panel); }
.card .body { padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.card .num { font: 12px var(--mono); color: var(--sakura); }
.card strong { font-size: 15px; }
.card p { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { font-size: 12px; color: var(--faint); margin-top: 4px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 14px 0 28px; }
.gallery a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.gallery span { display: block; font-size: 12px; color: var(--muted); padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
h2.block-title { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin: 34px 0 0; padding-top: 22px; border-top: 1px solid var(--line-soft); }

.empty { max-width: 560px; margin: 8vh auto; text-align: center; color: var(--muted); }
.empty h1 { color: var(--text); font-size: 30px; margin: 0 0 10px; font-weight: 600; }

.doc-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 22px; }
.doc-bar .path { font: 12px var(--mono); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 4ch; flex: 1 1 0; direction: rtl; text-align: left; }
.doc-bar > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex: 0 1 auto; }
.editor { width: 100%; min-height: 60vh; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; font: 13px/1.6 var(--mono); resize: vertical; outline: none; }

/* Markdown */
.md { max-width: 760px; overflow-wrap: anywhere; }
.md h1 { font-size: 28px; line-height: 1.2; margin: 1.2em 0 .5em; font-weight: 600; }
.md h2 { font-size: 21px; margin: 1.5em 0 .5em; font-weight: 600; }
.md h3 { font-size: 16px; margin: 1.3em 0 .4em; }
.md p, .md ul, .md ol, .md blockquote, .md table, .md pre { margin: 0 0 1em; }
.md ul, .md ol { padding-left: 1.4em; }
.md li { margin: .25em 0; }
.md blockquote { border-left: 3px solid var(--line-strong); padding: 4px 14px; color: var(--muted); background: var(--panel-2); border-radius: 0 8px 8px 0; }
.md code { font: 12.5px var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.md pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.md pre code { border: 0; padding: 0; background: none; }
.md table { border-collapse: collapse; width: 100%; font-size: 13px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--panel-2); }
.md img { max-width: 100%; border-radius: 10px; }
/* A table of images (a cast, a gallery) lays out as an even grid; a header row left blank isn't drawn. */
.md table:has(td img) { display: table; table-layout: fixed; }
.md table:has(td img) td { text-align: center; vertical-align: top; }
.md table:has(td img) td img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--panel-2); }
.md thead:not(:has(th:not(:empty))) { display: none; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }
.md input[type=checkbox] { margin-right: 6px; }

/* Project pages: readable long-form Markdown */
.content .md { font-size: 15px; line-height: 1.75; color: #d4d4d8; max-width: 720px; }
.content .md strong { color: var(--text); font-weight: 600; }
.content .md > h1:first-child { margin-top: 0; font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.02em; line-height: 1.1; color: var(--text); }
.content .md > h1:first-child + p { font-size: 17px; line-height: 1.6; color: var(--muted); margin-bottom: 1.6em; }
.content .md h2 { position: relative; font-size: 22px; letter-spacing: -.01em; color: var(--text); margin: 2.2em 0 .7em; padding-top: 1.1em; border-top: 1px solid var(--line-soft); scroll-margin-top: 16px; }
.content .md > h2:first-child { margin-top: .4em; border-top: 0; padding-top: 0; }
.content .md h2::before { content: ""; position: absolute; left: -18px; top: calc(1.1em + 8px); width: 4px; height: 18px; border-radius: 2px; background: var(--sakura); opacity: .8; }
.content .md > h2:first-child::before { top: 8px; }
.content .md h3 { font-size: 15px; font-weight: 600; color: var(--text); margin: 1.8em 0 .5em; scroll-margin-top: 16px; }
.content .md ul { list-style: none; padding-left: 1.3em; }
.content .md ul > li { position: relative; }
.content .md ul > li::before { content: ""; position: absolute; left: -1.05em; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.content .md ol { padding-left: 1.5em; }
.content .md ol > li::marker { color: var(--faint); font: 12px var(--mono); }
.content .md li { margin: .4em 0; }
.content .md a { color: var(--sakura); text-decoration: none; border-bottom: 1px solid rgba(255, 122, 156, .35); }
.content .md a:hover { border-bottom-color: var(--sakura); }
.content .md blockquote { border: 1px solid rgba(255, 122, 156, .2); border-left: 3px solid var(--sakura); background: rgba(255, 122, 156, .05); color: #d4d4d8; padding: 10px 16px; border-radius: 10px; }
.content .md blockquote > :last-child { margin-bottom: 0; }

.md .table-wrap { margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; background: var(--panel); }
.md .table-wrap table { display: table; margin: 0; border: 0; font-size: 13.5px; line-height: 1.55; min-width: 560px; }
.md .table-wrap th, .md .table-wrap td { border: 0; border-bottom: 1px solid var(--line-soft); padding: 11px 14px; }
.md .table-wrap th { background: var(--panel-2); color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.md .table-wrap tr:last-child td { border-bottom: 0; }
.md .table-wrap tbody tr:hover td { background: rgba(255, 255, 255, .02); }
.md .table-wrap td:first-child { color: var(--text); font-weight: 600; min-width: 120px; }

.md .kv { display: grid; gap: 1px; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line-soft); }
.md .kv-row { display: grid; grid-template-columns: minmax(110px, 160px) 1fr; gap: 16px; padding: 11px 16px; background: var(--panel); }
.md .kv-k { color: var(--sakura); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding-top: 3px; }
.md .kv-v { color: #d4d4d8; }

.doc-layout { display: grid; grid-template-columns: minmax(0, 720px) 180px; gap: 48px; align-items: start; }
.toc { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; padding-left: 14px; border-left: 1px solid var(--line); font-size: 13px; }
.toc span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.toc a { color: var(--muted); text-decoration: none; padding: 4px 0; line-height: 1.35; }
.toc a:hover { color: var(--text); }
@media (max-width: 1200px) { .doc-layout { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

/* Sidebar sub-folders */
.sub { display: flex; flex-direction: column; margin: 2px 0 4px 22px; padding-left: 10px; border-left: 1px solid var(--line); }
.sub .sub { margin-left: 8px; }
.sub-item { text-align: left; background: none; border: 0; color: var(--faint); font-size: 13px; padding: 5px 8px; border-radius: 7px; position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-item:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
.sub-item.on { color: var(--muted); }
.sub-item.active { color: var(--text); background: var(--panel-2); }
.sub-item.active::before { content: ""; position: absolute; left: -11px; top: 7px; bottom: 7px; width: 2px; border-radius: 1px; background: var(--sakura); }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
.dlg { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dlg h2 { margin: 0; font-size: 18px; }
.dlg p { margin: 0; color: var(--muted); font-size: 13px; }
.dlg label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.dlg input { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; outline: none; color: var(--text); }
.dlg .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.dlg .ok-tag { color: var(--ok); font-size: 12px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); z-index: 10; }
.toast.error { border-color: #5a2a2a; color: #ffb4b4; }

.mobile-switch { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; padding: 8px 8px 8px; height: calc(100vh - 48px); gap: 8px; }
  .shell[data-active="chat"] .workspace, .shell[data-active="workspace"] .chat { display: none; }
  .mobile-switch { display: flex; gap: 6px; padding: 8px 8px 0; }
  .mobile-switch button { flex: 1; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
  .mobile-switch button.active { color: var(--text); border-color: var(--accent); }
  .workspace-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sections { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .proj-card, .sec-label, .sections .spacer, .sections .tip, .sections .sub { display: none; }
  .sec { white-space: nowrap; }
  .content { padding: 20px 16px 40px; }
  .hint { display: none; }
}

/* Asset studio */
.kind-tag { align-self: flex-start; font: 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; color: var(--sem-image); background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.25); }
.kind-tag.mesh { color: var(--sem-mesh); background: rgba(168, 85, 247, 0.1); border-color: rgba(168, 85, 247, 0.3); }
.kind-tag.win { color: var(--sem-engine); background: rgba(245, 196, 81, 0.1); border-color: rgba(245, 196, 81, 0.3); }
.no-thumb { display: grid; place-items: center; height: 130px; color: var(--faint); font-size: 12px; background: var(--panel); text-align: center; padding: 12px; }
.no-thumb.big { height: 100%; min-height: 280px; }
.asset-card img { height: 170px; object-fit: contain; background: var(--panel); }

.pillars { margin: 34px 0 10px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--panel-2); }
.pillars-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.pillars-head strong { display: block; }
.pillars-head span { font-size: 12px; color: var(--muted); }
.pillar-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pillar-row img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; background: var(--panel); }
.pillar-row.small img { width: 48px; height: 48px; }
.pillar-item { position: relative; }
.pillar-remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: rgba(10, 10, 12, .85); color: var(--text, #e5e7eb); font-size: 15px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s; }
.pillar-item:hover .pillar-remove, .pillar-remove:focus-visible { opacity: 1; }
.pillar-remove:hover { color: #fda4af; border-color: rgba(244, 63, 94, .5); background: rgba(244, 63, 94, .15); }
.pillar-empty { color: var(--faint); font-size: 12px; margin: 0; }

.asset-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.asset-head .title { margin-bottom: 10px; }
.job-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(255, 122, 156, 0.3); background: rgba(255, 122, 156, 0.08); color: #7dd3fc; margin: 6px 0 18px; font-size: 13px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(125, 211, 252, 0.3); border-top-color: #7dd3fc; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.asset-top { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 24px; margin: 14px 0 8px; }
.winner-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); overflow: hidden; aspect-ratio: 1; }
.winner-box img { width: 100%; height: 100%; object-fit: contain; display: block; }
.asset-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.field-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.prompt-box, .dlg textarea, .dlg select { width: 100%; background: var(--control); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); outline: none; resize: vertical; font: inherit; }
.prompt-box:focus, .dlg textarea:focus { border-color: rgba(255, 255, 255, 0.22); }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.action-row button:disabled { opacity: .4; cursor: not-allowed; }
.sem-mesh { color: #d8b4fe; border-color: rgba(168, 85, 247, 0.35); }
.applied { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.applied-group span { display: block; font: 11px var(--mono); color: var(--sakura); margin-bottom: 4px; }
.applied-group p { margin: 0; color: var(--muted); font-size: 13px; }

.out-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 14px 0 10px; }
.out { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel-2); }
.out.winner { border-color: rgba(245, 196, 81, 0.55); box-shadow: 0 0 0 1px rgba(245, 196, 81, .15), 0 10px 30px rgba(245, 196, 81, .08); }
.out img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; background: var(--panel); }
.out-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px; }
.mini { font-size: 12px; padding: 4px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--control); color: var(--muted); text-decoration: none; }
.mini:hover { color: var(--text); border-color: var(--line-strong); }

.dlg.wide { width: auto; }
dialog:has(.dlg.wide) { width: min(860px, calc(100vw - 32px)); }
.dlg code { font: 12px var(--mono); color: var(--text); }
.parts { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.part { display: grid; grid-template-columns: 150px 1fr; gap: 10px; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); }
.part-src { font: 11px var(--mono); color: var(--sakura); padding-top: 2px; }
.refs { display: flex; gap: 10px; flex-wrap: wrap; }
.ref { position: relative; display: flex; flex-direction: column; gap: 4px; width: 104px; cursor: pointer; color: var(--muted); font-size: 11px; }
.ref img { width: 104px; height: 104px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-strong); }
.ref input { position: absolute; top: 6px; left: 6px; width: 16px; height: 16px; accent-color: #f4f4f5; }
.ref.off img { opacity: .3; }
.ref.add { height: 104px; justify-content: center; align-items: center; border: 1px dashed var(--line-strong); border-radius: 8px; background: none; }
.dlg .row { align-items: center; }
.dlg .grow { flex: 1; }
.dlg label.inline { flex-direction: row; align-items: center; gap: 8px; }
.dlg label.inline select { width: auto; }

@media (max-width: 900px) {
  .asset-top { grid-template-columns: 1fr; }
  .part { grid-template-columns: 1fr; }
}
.model-list { display: flex; flex-direction: column; gap: 6px; }
.model-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: 13px; }
.model-row code { margin-left: auto; color: var(--faint); font: 11px var(--mono); }

/* Sidebar caret for sections with sub-folders */
.sec .sec-name { flex: 1; }
.sec .caret { width: 7px; height: 7px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(-45deg); transition: transform .15s; align-self: center; margin-right: 4px; }
.sec .caret.open { transform: rotate(45deg); }

/* Folder page groups */
h2.group-title { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin: 30px 0 12px; }
h2.group-title span { font: 11px var(--mono); letter-spacing: 0; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }

.folder-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); margin-bottom: 8px; }
.folder-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: none; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--text); text-align: left; transition: background .12s; }
.folder-row:last-child { border-bottom: 0; }
.folder-row:hover { background: var(--panel-2); }
.folder-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: rgba(255, 122, 156, .08); border: 1px solid rgba(255, 122, 156, .2); color: var(--sakura); }
.folder-icon small { font: 12px var(--mono); }
.folder-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.folder-text strong { font-size: 15px; font-weight: 600; }
.folder-text span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-thumbs { display: flex; flex: none; }
.folder-thumbs img { width: 34px; height: 34px; object-fit: cover; border-radius: 8px; border: 2px solid var(--panel); margin-left: -10px; background: var(--panel-2); }
.folder-thumbs img:first-child { margin-left: 0; }
.folder-meta { display: flex; gap: 6px; flex: none; }
.folder-meta em { font-style: normal; font-size: 12px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.folder-row .chev { color: var(--faint); font-size: 20px; line-height: 1; transition: transform .12s, color .12s; }
.folder-row:hover .chev { color: var(--text); transform: translateX(2px); }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 8px; }
.asset-tile { display: flex; flex-direction: column; gap: 8px; background: none; border: 0; padding: 0; color: var(--text); text-align: left; }
.asset-img { position: relative; display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: radial-gradient(circle at 50% 35%, #1c1c21, var(--panel)); border: 1px solid var(--line); transition: border-color .12s, transform .12s; }
.asset-img img { width: 100%; height: 100%; object-fit: contain; }
.asset-tile:hover .asset-img { border-color: var(--line-strong); transform: translateY(-2px); }
.asset-tile .kind-tag { position: absolute; top: 8px; left: 8px; background: rgba(9, 9, 11, .75); backdrop-filter: blur(4px); }
.asset-empty { color: var(--faint); font-size: 12px; }
.asset-tile strong { font-size: 14px; font-weight: 600; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-tile.add .asset-img { border-style: dashed; background: none; }
.asset-tile.add .plus { font-size: 28px; color: var(--faint); font-weight: 300; }
.asset-tile.add strong { color: var(--muted); font-weight: 500; }
.asset-tile.add:hover .plus, .asset-tile.add:hover strong { color: var(--text); }
.page-body { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line-soft); }
@media (max-width: 700px) { .folder-thumbs, .folder-meta { display: none; } }
/* The workspace column narrows with the chat and nav open, whatever the window size: size by the column. */
@container (max-width: 620px) { .folder-thumbs { display: none; } .pillars-head { flex-wrap: wrap; } .asset-top { grid-template-columns: 1fr; } .split-layout { grid-template-columns: 1fr; } }
@container (max-width: 460px) { .folder-meta { display: none; } }
.folder-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Send sheet: what goes to the image / 3D API */
dialog:has(.sheet) { width: min(1080px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.sheet { --tone: var(--sakura); --tone-rgb: 255, 122, 156; padding: 0; gap: 0; }
.sheet.tone-amber { --tone: #f59e0b; --tone-rgb: 245, 158, 11; }
.sheet.tone-violet { --tone: #a855f7; --tone-rgb: 168, 85, 247; }
.sheet.tone-sky { --tone: #38bdf8; --tone-rgb: 56, 189, 248; }
.sheet-head { display: flex; gap: 16px; align-items: center; padding: 22px 24px 18px; background: linear-gradient(120deg, rgba(var(--tone-rgb), .22), rgba(var(--tone-rgb), .04) 55%, transparent); border-bottom: 1px solid rgba(var(--tone-rgb), .25); }
.sheet-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: #09090b; background: linear-gradient(135deg, var(--tone), rgba(var(--tone-rgb), .6)); box-shadow: 0 8px 28px rgba(var(--tone-rgb), .35); }
.sheet-head h2 { font-size: 20px; margin: 0; }
.sheet-head h2 span { color: var(--muted); font-weight: 500; }
.sheet-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.sheet-model { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 24px; border-bottom: 1px solid var(--line-soft); }
.dlg .model-pick { flex-direction: row; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin-right: 6px; }
.model-pick select { background: rgba(var(--tone-rgb), .1); border: 1px solid rgba(var(--tone-rgb), .45); color: var(--text); border-radius: 9px; padding: 7px 10px; font-weight: 600; outline: none; }
.chip { font-size: 12px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.chip b { color: var(--text); font-weight: 600; margin-left: 3px; }
.sheet-instruction { display: flex; gap: 10px; align-items: flex-end; padding: 16px 24px 0; }
.sheet-instruction label { flex: 1; }
.sheet-instruction textarea { border-color: rgba(var(--tone-rgb), .45) !important; }
.sheet-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; padding: 18px 24px; overflow-y: auto; }
.sheet-body.only-refs { grid-template-columns: 1fr; }
.sheet-body section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.recipe { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.recipe-part { --c: var(--text); --c-rgb: 244, 244, 245; border-left: 3px solid var(--c); background: rgba(var(--c-rgb), .06); border-radius: 4px 10px 10px 4px; padding: 8px 12px; }
.recipe-part.role-bible { --c: var(--sakura); --c-rgb: 255, 122, 156; }
.recipe-part.role-style { --c: #f59e0b; --c-rgb: 245, 158, 11; }
.recipe-part.role-rule { --c: #a855f7; --c-rgb: 168, 85, 247; }
.recipe-part > span { display: flex; gap: 8px; align-items: baseline; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--c); }
.recipe-part em { font-style: normal; color: var(--faint); text-transform: none; letter-spacing: 0; font-weight: 400; }
.recipe-part p { margin: 4px 0 0; font-size: 13px; line-height: 1.55; color: #d4d4d8; white-space: pre-wrap; }
.final-prompt { min-height: 170px; font: 13px/1.6 var(--mono) !important; border-color: rgba(var(--tone-rgb), .35) !important; background: #0b0b0e !important; }
.hint-line { margin: 0; font-size: 12px; color: var(--faint); }
.hint-line b { color: var(--sakura); font-weight: 600; }
.sheet .refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.sheet .ref { width: auto; }
.sheet .ref img { width: 100%; height: auto; aspect-ratio: 1; border-width: 2px; }
.ref.role-source img { border-color: rgba(var(--tone-rgb), .8); }
.ref.role-pillar img { border-color: rgba(255, 122, 156, .55); }
.ref.role-extra img { border-color: rgba(245, 158, 11, .6); }
.sheet .ref.add { height: auto; aspect-ratio: 1; }
.ref input { accent-color: var(--sakura); }
.sheet-foot { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--panel-2); }
.sheet-foot .grow { flex: 1; }
.sheet-foot .cost { font-size: 12px; color: var(--muted); }
.run-btn { border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 700; color: #09090b; background: linear-gradient(135deg, var(--tone), rgba(var(--tone-rgb), .75)); box-shadow: 0 6px 22px rgba(var(--tone-rgb), .35); }
.run-btn:hover { filter: brightness(1.08); }
@media (max-width: 820px) { .sheet-body { grid-template-columns: 1fr; } }
.dlg.sheet { max-height: calc(100vh - 34px); }
.dlg .model-pick select { width: auto; min-width: 260px; }

/* Pillars: style-bible text and "make pillar" */
.pillars-actions { display: flex; gap: 8px; flex: none; }
.bible-text { display: block; width: 100%; text-align: left; margin-bottom: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 122, 156, .3); background: linear-gradient(120deg, rgba(255, 122, 156, .1), rgba(255, 122, 156, .02)); color: var(--text); position: relative; }
.bible-text:hover { border-color: rgba(255, 122, 156, .6); }
.bible-text span { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--sakura); }
.bible-text p { margin: 6px 0 0; font-size: 13px; line-height: 1.55; color: #d4d4d8; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.bible-text em { position: absolute; top: 10px; right: 12px; font-style: normal; font-size: 12px; color: var(--muted); }
.applied-group.bible { border-left: 3px solid var(--sakura); padding-left: 10px; }
.applied-group.bible p { white-space: pre-wrap; color: #d4d4d8; }
.mini.pillar-btn { color: var(--sakura); border-color: rgba(255, 122, 156, .35); background: rgba(255, 122, 156, .08); }
.mini.pillar-btn:hover { color: #fff; border-color: var(--sakura); }
.pillar-pick-head { display: flex; gap: 14px; align-items: center; }
.pillar-pick-head img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; border: 2px solid var(--sakura); box-shadow: 0 8px 26px rgba(255, 122, 156, .3); }
.target-list { display: flex; flex-direction: column; gap: 6px; }
.dlg label.target { flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--text); }
.dlg label.target:has(input:checked) { border-color: var(--sakura); background: rgba(255, 122, 156, .08); }
.target input { accent-color: var(--sakura); }
.target span { display: flex; flex-direction: column; }
.target small { color: var(--faint); font: 11px var(--mono); }

/* Kind tags */
.dlg-field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.kind-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.dlg label.kind-chip { display: inline-flex; flex-direction: row; cursor: pointer; }
.kind-chip input { position: absolute; opacity: 0; pointer-events: none; }
.kind-chip span { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--muted); font-size: 13px; transition: all .12s; }
.kind-chip:hover span { color: var(--text); border-color: rgba(255, 122, 156, .5); }
.kind-chip input:checked + span { color: #09090b; background: var(--sakura); border-color: var(--sakura); font-weight: 600; box-shadow: 0 4px 16px rgba(255, 122, 156, .3); }
.kind-chip input:focus-visible + span { outline: 2px solid var(--sakura); outline-offset: 2px; }

/* Project button in the chat header */
.project-btn { display: flex; align-items: center; gap: 8px; max-width: 220px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--control); color: var(--text); font-weight: 600; }
.project-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-btn svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--sakura); stroke-width: 1.8; }
.project-btn:hover { border-color: rgba(255, 122, 156, .5); }
button.danger { background: #e11d48; color: #fff; border: 0; border-radius: 10px; padding: 8px 16px; font-weight: 600; }
button.danger:hover { background: #f43f5e; }

/* Projects page */
.projects-view { position: fixed; inset: 0; z-index: 20; background: #070708; overflow-y: auto; animation: fade-in .2s ease; }
.projects-view[hidden], .onboard[hidden] { display: none; }
.pv-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; }
.pv-main { max-width: 1240px; margin: 0 auto; padding: 48px 32px 80px; }
.pv-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 26px; }
.pv-head h1 { margin: 0; font-size: 34px; font-weight: 600; letter-spacing: -.02em; }
.pv-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.pv-tools input, .pv-tools select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; color: var(--text); outline: none; font: inherit; font-size: 13px; }
.pv-tools input { width: 240px; }
.pv-tools input:focus { border-color: rgba(255, 122, 156, .5); }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.pv-loading { color: var(--faint); }
.pcard { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 14px; min-height: 280px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: rgba(255, 122, 156, .45); transform: translateY(-2px); }
.pcard.current { border-color: rgba(255, 122, 156, .35); }
.pcard-head { display: flex; justify-content: space-between; gap: 10px; }
.pcard-head strong { display: block; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }
.pcard-head small { display: block; color: var(--faint); font-size: 12px; }
.pcard-del { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--faint); opacity: 0; transition: opacity .15s; }
.pcard:hover .pcard-del, .pcard-del:focus-visible { opacity: 1; }
.pcard-del:hover { color: #fda4af; border-color: rgba(244, 63, 94, .4); background: rgba(244, 63, 94, .1); }
.pcard-art { flex: 1; display: grid; gap: 8px; min-height: 180px; border-radius: 10px; overflow: hidden; }
.pcard-art img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; background: var(--panel); min-height: 0; }
.pcard-art.n2 { grid-template-columns: 1fr 1fr; }
.pcard-art.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pcard-art.n3 img:first-child { grid-row: span 2; }
.pcard-art.n0 { place-items: center; background: radial-gradient(circle at 30% 20%, rgba(255, 122, 156, .22), transparent 60%), radial-gradient(circle at 80% 90%, rgba(168, 85, 247, .14), transparent 55%), var(--panel); }
.pcard-initials { font-size: 46px; font-weight: 700; letter-spacing: -.03em; color: rgba(255, 255, 255, .85); }
.pcard-badge { position: absolute; bottom: 24px; right: 24px; font-size: 11px; font-weight: 700; color: #09090b; background: var(--sakura); border-radius: 999px; padding: 3px 9px; }
.pcard-new { justify-content: space-between; align-items: stretch; }
.pcard-new span { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pcard-new i { flex: 1; display: grid; place-items: center; font-style: normal; font-size: 54px; font-weight: 200; color: var(--muted); transition: color .15s, transform .2s; }
.pcard-new:hover i { color: var(--sakura); transform: scale(1.1) rotate(90deg); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Onboarding */
.onboard { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; overflow: hidden; background: radial-gradient(ellipse at 50% 120%, rgba(244, 63, 110, .28), transparent 60%), radial-gradient(ellipse at 15% 0%, rgba(255, 122, 156, .12), transparent 50%), #060607; animation: fade-in .5s ease; }
.onboard::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, .65)); }
.petals { position: absolute; inset: 0; pointer-events: none; }
.petals i { position: absolute; top: -40px; left: var(--x); width: 14px; height: 10px; border-radius: 12px 0 12px 0; background: linear-gradient(135deg, #ffd1dc, var(--sakura)); opacity: .75; transform: scale(var(--s)) rotate(var(--r)); animation: petal-fall var(--d) linear var(--delay) infinite; filter: drop-shadow(0 0 6px rgba(255, 122, 156, .5)); }
@keyframes petal-fall {
  0% { transform: translate3d(0, 0, 0) scale(var(--s)) rotate(var(--r)); }
  50% { transform: translate3d(var(--sway), 55vh, 0) scale(var(--s)) rotate(calc(var(--r) + 180deg)); }
  100% { transform: translate3d(calc(var(--sway) * -1), 110vh, 0) scale(var(--s)) rotate(calc(var(--r) + 360deg)); }
}
.ob-skip { position: absolute; top: 20px; right: 24px; z-index: 2; background: none; border: 1px solid var(--line-strong); color: var(--muted); border-radius: 999px; padding: 7px 14px; font-size: 13px; }
.ob-skip:hover { color: var(--text); border-color: var(--text); }
.onboard.forging .ob-skip, .onboard.blank .ob-skip:not(.ob-cancel) { display: none; }
.ob-skip.ob-cancel { right: auto; left: 24px; }
.ob-stage { position: relative; z-index: 1; width: min(720px, calc(100vw - 48px)); }
.ob-step { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.ob-step.enter > * { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.ob-step.enter > *:nth-child(2) { animation-delay: .08s; }
.ob-step.enter > *:nth-child(3) { animation-delay: .16s; }
.ob-step.enter > *:nth-child(4) { animation-delay: .24s; }
.ob-step.enter > *:nth-child(5) { animation-delay: .32s; }
.ob-step.enter > *:nth-child(6) { animation-delay: .4s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.ob-kicker { margin: 0; font: 600 12px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--sakura); }
.ob-step h1 { margin: 0; font-size: clamp(36px, 6vw, 64px); line-height: 1.02; letter-spacing: -.035em; font-weight: 600; }
.ob-step h1 em { font-style: normal; background: linear-gradient(90deg, #ffd1dc, var(--sakura), var(--sakura-deep)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ob-sub { margin: 0; max-width: 520px; color: var(--muted); font-size: 16px; }
.ob-input { width: 100%; background: rgba(255, 255, 255, .03); border: 0; border-bottom: 2px solid rgba(255, 122, 156, .35); color: var(--text); font: 500 26px/1.35 var(--sans); padding: 10px 2px; outline: none; resize: none; }
.ob-input.small { font-size: 16px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; }
.ob-input:focus { border-color: var(--sakura); }
.ob-chips, .ob-dim { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-chip { padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .03); color: var(--muted); font-size: 14px; transition: all .15s; }
.ob-chip:hover { color: var(--text); border-color: rgba(255, 122, 156, .5); }
.ob-chip.on { color: #09090b; background: var(--sakura); border-color: var(--sakura); font-weight: 600; box-shadow: 0 0 22px rgba(255, 122, 156, .35); }
.ob-nav { display: flex; gap: 10px; }
.ob-next, .ob-back { border-radius: 999px; padding: 12px 24px; font-weight: 600; font-size: 15px; }
.ob-next { border: 0; background: var(--text); color: #09090b; }
.ob-next:hover { background: #fff; }
.ob-next.forge { background: linear-gradient(135deg, #ffb3c6, var(--sakura) 45%, var(--sakura-deep)); box-shadow: 0 10px 40px rgba(244, 63, 110, .45); }
.ob-back { background: none; border: 1px solid var(--line-strong); color: var(--muted); }
.forging-step { align-items: center; text-align: center; }
.ob-orb { position: relative; width: 120px; height: 120px; }
.ob-orb span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--sakura); animation: spin 1.6s linear infinite; }
.ob-orb span:nth-child(2) { inset: 14px; border-top-color: #ffd1dc; animation-duration: 2.3s; animation-direction: reverse; }
.ob-orb span:nth-child(3) { inset: 32px; background: radial-gradient(circle, rgba(255, 122, 156, .9), rgba(244, 63, 110, .2) 60%, transparent 70%); border: 0; animation: pulse 1.8s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(.75); opacity: .6; } }
/* Done: the rings settle into a full circle and the core glows steady. */
.forged .ob-orb span:nth-child(-n+2) { animation: none; border-color: rgba(255, 122, 156, .55); transition: border-color .6s ease; }
.forged .ob-orb span:nth-child(3) { animation: none; }
.ob-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 120px; max-height: 40vh; overflow-y: auto; font: 13px var(--mono); color: var(--muted); }
.ob-log li { animation: rise .5s ease both; }
.ob-log li.ok { color: #ffd1dc; }
.ob-log li.bad { color: #fda4af; }
@media (prefers-reduced-motion: reduce) { .petals i, .ob-orb span, .ob-step.enter > * { animation: none; } }

/* ---------- Glob brand ---------- */
.glob-brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; color: var(--text); text-align: left; }
.glob-mark { width: 54px; height: auto; image-rendering: pixelated; filter: drop-shadow(0 4px 14px rgba(255, 122, 156, .35)); transition: transform .2s; }
button.glob-brand:hover .glob-mark { transform: translateY(-2px) rotate(-3deg); }
.glob-word { display: flex; flex-direction: column; font: 22px/1 "Silkscreen", var(--mono); letter-spacing: .02em; color: #ffd1dc; text-shadow: 0 0 18px rgba(255, 122, 156, .45), 2px 2px 0 #3b0a1e; }
.glob-word small { margin-top: 4px; font: 500 10px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); text-shadow: none; }

/* ---------- Chat panel: cinematic glass ---------- */
.panel.chat { position: relative; background: var(--panel); }
.chat-head { border-bottom: 1px solid rgba(255, 255, 255, .05); background: rgba(255, 255, 255, .015); backdrop-filter: blur(10px); }
.chat .tabs { gap: 6px; padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.chat .tab { gap: 7px; padding: 6px 10px 6px 7px; border-radius: 999px; border: 1px solid transparent; background: rgba(255, 255, 255, .03); font-size: 13px; transition: all .15s; }
.chat .tab img { width: 16px; height: auto; image-rendering: pixelated; opacity: .55; }
.chat .tab:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.chat .tab.active { color: var(--text); border-color: rgba(255, 122, 156, .4); background: rgba(255, 122, 156, .1); box-shadow: 0 0 18px rgba(255, 122, 156, .12); }
.chat .tab.active img { opacity: 1; }
.chat .tab.add { width: 30px; justify-content: center; padding: 6px 0; }

.chat .messages { gap: 18px; padding: 20px 16px 8px; scroll-behavior: smooth; }
.msg.fresh { animation: msg-in .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.msg.user { align-self: flex-end; max-width: 86%; background: none; border: 0; padding: 0; }
.msg.user .bubble { background: linear-gradient(135deg, rgba(255, 122, 156, .22), rgba(244, 63, 110, .12)); border: 1px solid rgba(255, 122, 156, .3); border-radius: 18px 18px 6px 18px; padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 8px 26px rgba(244, 63, 110, .1); }
.msg.agent { display: flex; gap: 10px; align-items: flex-start; }
.msg .avatar { flex: none; width: 30px; height: auto; margin-top: 2px; image-rendering: pixelated; filter: drop-shadow(0 3px 10px rgba(255, 122, 156, .35)); }
.msg .avatar.forge { width: 52px; margin-top: -4px; }
.msg.agent .bubble { min-width: 0; flex: 1; }
.msg .who { font: 11px "Silkscreen", var(--mono); letter-spacing: .06em; text-transform: none; color: var(--sakura); margin-bottom: 4px; }
.msg .who small { font: 10px var(--sans); color: var(--faint); margin-left: 6px; letter-spacing: 0; }
.msg.agent .md { color: #e4e4e7; font-size: 14px; line-height: 1.65; }
.msg.agent .md code { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .08); }
.shimmer { font-size: 14px; background: linear-gradient(90deg, var(--faint), #ffd1dc, var(--faint)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.changes { margin-top: 10px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; background: rgba(255, 255, 255, .025); overflow: hidden; }
.changes summary { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; list-style: none; font-size: 13px; color: var(--muted); }
.changes summary::-webkit-details-marker { display: none; }
.changes summary .spark { color: var(--sakura); }
.changes summary em { font-style: normal; color: #fda4af; }
.changes summary svg { width: 14px; height: 14px; margin-left: auto; transition: transform .2s; }
.changes[open] summary svg { transform: rotate(180deg); }
.changes summary:hover { color: var(--text); }
.changes ul { list-style: none; margin: 0; padding: 4px 6px 8px; border-top: 1px solid rgba(255, 255, 255, .05); }
.changes li { display: flex; gap: 8px; align-items: baseline; padding: 4px 8px; border-radius: 7px; font: 12px var(--mono); color: var(--muted); }
.changes li i { font-style: normal; width: 14px; text-align: center; color: #86efac; }
.changes li.bad, .changes li.bad i { color: #fda4af; }
.changes li.link { cursor: pointer; }
.changes li.link:hover { background: rgba(255, 122, 156, .08); color: var(--text); }

.chat-empty { margin: auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px; }
.hero-glob { width: 180px; image-rendering: pixelated; filter: drop-shadow(0 12px 40px rgba(255, 122, 156, .35)); animation: msg-in .7s ease both; }
.chat-empty h2 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.01em; color: var(--text); }
.chat-empty p { margin: 0; max-width: 340px; color: var(--muted); font-size: 13.5px; }
.chat .suggestions { width: 100%; margin-top: 10px; gap: 8px; }
.chat .suggestion { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 14px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .07); font-size: 13.5px; transition: all .15s; }
.chat .suggestion i { font-style: normal; color: var(--sakura); }
.chat .suggestion:hover { border-color: rgba(255, 122, 156, .4); background: rgba(255, 122, 156, .07); transform: translateX(3px); }

.chat .composer { border-top: 0; padding: 10px 14px 12px; gap: 6px; }
.composer-card { display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 8px 14px; border-radius: 18px; background: var(--panel-2); border: 1px solid rgba(255, 255, 255, .09); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: border-color .2s, box-shadow .2s; }
.composer-card:focus-within { border-color: rgba(255, 122, 156, .4); }
.chat .composer textarea { background: none; border: 0; padding: 4px 0; min-height: 26px; max-height: 220px; font-size: 14.5px; line-height: 1.5; }
.chat .composer textarea:focus { border: 0; }
.chat .composer-row { gap: 8px; }
.composer-row .grow { flex: 1; }
.tool-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--muted); cursor: pointer; }
.tool-btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.send-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; border: 0; color: #1a0610; background: linear-gradient(135deg, #ffb3c6, var(--sakura) 50%, var(--sakura-deep)); box-shadow: 0 6px 20px rgba(244, 63, 110, .4); transition: transform .15s, filter .15s; }
.send-btn svg { stroke-width: 2.4; }
.send-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.send-btn:disabled { opacity: .45; transform: none; box-shadow: none; }
.composer-hint { text-align: center; font-size: 11px; color: var(--faint); }

/* Model pill + popover */
.model-pill-wrap { position: relative; min-width: 0; }
.model-pill { display: flex; align-items: center; gap: 7px; max-width: 230px; padding: 5px 9px 5px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .09); background: rgba(255, 255, 255, .04); color: var(--muted); font-size: 12.5px; }
.model-pill span:not(.dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-pill em { font-style: normal; color: var(--sakura); }
.model-pill svg { width: 14px; height: 14px; flex: none; }
.model-pill:hover { color: var(--text); border-color: rgba(255, 122, 156, .4); }
.model-pop { position: absolute; bottom: calc(100% + 10px); left: -6px; z-index: 15; width: 300px; max-height: 420px; overflow-y: auto; padding: 8px; border-radius: 16px; background: rgba(20, 19, 23, .97); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(18px); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); animation: pop-in .18s ease both; }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.pop-group { padding: 10px 10px 4px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.pop-model { display: flex; align-items: center; width: 100%; gap: 8px; padding: 8px 10px; border-radius: 9px; border: 0; background: none; color: var(--muted); text-align: left; font-size: 13.5px; }
.pop-model span { flex: 1; }
.pop-model b { color: var(--sakura); }
.pop-model:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.pop-model.on { color: var(--text); background: rgba(255, 122, 156, .1); }
.pop-empty { margin: 8px 10px; color: var(--faint); font-size: 13px; }
.effort-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin: 2px 6px 6px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.effort-seg button { border: 0; border-radius: 8px; padding: 6px 0; background: none; color: var(--muted); font-size: 12px; }
.effort-seg button.on { color: #1a0610; background: var(--sakura); font-weight: 600; }
.pop-add { width: 100%; margin-top: 6px; padding: 9px 10px; border-radius: 9px; border: 1px dashed rgba(255, 122, 156, .35); background: none; color: var(--sakura); font-size: 13px; text-align: left; }
.pop-add:hover { background: rgba(255, 122, 156, .07); }

/* Project delete is always visible */
.pcard-del { opacity: .55; border-color: var(--line); }
.pcard-del svg { width: 15px; height: 15px; }

/* ---------- Settings ---------- */
.settings-view { position: fixed; inset: 0; z-index: 25; overflow-y: auto; background: radial-gradient(70% 40% at 50% 0%, rgba(255, 122, 156, .08), transparent 60%), #070708; animation: fade-in .2s ease; }
.settings-view[hidden] { display: none; }
.st-main { display: grid; grid-template-columns: 200px minmax(0, 760px); gap: 40px; justify-content: center; padding: 30px 32px 80px; }
.st-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 20px; align-self: start; }
.st-nav button { text-align: left; padding: 10px 14px; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--muted); font-size: 14px; }
.st-nav button:hover { color: var(--text); }
.st-nav button.on { color: var(--text); background: rgba(255, 122, 156, .1); border-color: rgba(255, 122, 156, .3); }
.st-body h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.st-lede { margin: 6px 0 26px; color: var(--muted); }
.st-label { margin: 26px 0 10px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.st-empty { color: var(--faint); }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.preset { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); text-align: left; transition: all .15s; }
.preset i { font-style: normal; font-size: 20px; color: var(--sakura); margin-bottom: 6px; }
.preset small { color: var(--faint); font-size: 12px; }
.preset:hover { border-color: rgba(255, 122, 156, .45); transform: translateY(-2px); }
.preset.featured { border-color: rgba(255, 122, 156, .45); background: linear-gradient(135deg, rgba(255, 122, 156, .16), rgba(255, 122, 156, .03)); }
.conn-group { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.conn-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.conn-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.conn-row:last-child { border-bottom: 0; }
.conn-row .grow { flex: 1; }
.in-use { font-style: normal; font-size: 11px; color: #1a0610; background: var(--sakura); border-radius: 999px; padding: 1px 8px; }
.test-result { font-size: 12px; color: var(--faint); }
.test-result.ok { color: #86efac; }
.test-result.bad { color: #fda4af; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 13px; padding: 0; }
.link-btn:hover { color: var(--text); }
.danger-text:hover { color: #fda4af; }
.add-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 16px; border: 1px solid rgba(255, 122, 156, .4); background: linear-gradient(160deg, rgba(255, 122, 156, .08), transparent 50%), var(--panel); }
.add-head { display: flex; align-items: center; gap: 12px; }
.add-head i { font-style: normal; font-size: 24px; color: var(--sakura); }
.add-head div { flex: 1; display: flex; flex-direction: column; }
.add-head small a { color: var(--sakura); }
.add-card label, .st-select { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.add-card input, .key-card input, .st-select select, .model-check-head input { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); outline: none; font: inherit; }
.add-card input:focus, .key-card input:focus { border-color: rgba(255, 122, 156, .5); }
.add-card .row, .key-cards .row { display: flex; justify-content: flex-end; }
.model-check-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.model-check-head input { width: 180px; padding: 6px 10px; }
.model-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; max-height: 280px; overflow-y: auto; }
.add-card label.model-check { flex-direction: row; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); font: 12.5px var(--mono); cursor: pointer; }
.model-check:has(input:checked) { border-color: rgba(255, 122, 156, .55); background: rgba(255, 122, 156, .08); }
.model-check input { accent-color: var(--sakura); }
.key-cards { display: flex; flex-direction: column; gap: 10px; }
.key-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.key-card.on { border-color: rgba(255, 122, 156, .35); }
.key-top { display: flex; align-items: center; gap: 8px; }
.key-top a { margin-left: auto; font-size: 12px; color: var(--sakura); text-decoration: none; }
.key-card small { color: var(--faint); }
.st-select select { max-width: none; }
@media (max-width: 800px) { .st-main { grid-template-columns: 1fr; gap: 16px; padding: 16px; } .st-nav { flex-direction: row; position: static; } }

/* Onboarding mascot */
.ob-glob { width: 200px; image-rendering: pixelated; filter: drop-shadow(0 14px 40px rgba(255, 122, 156, .4)); }

/* ---------- Coding-agent tabs ---------- */
.chat .tab.running { border-color: rgba(255, 122, 156, .25); }
.chat .tab.running::after { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 2px solid rgba(255, 122, 156, .3); border-top-color: var(--sakura); animation: spin .8s linear infinite; }
.new-tab-wrap { position: relative; }
.model-pop[hidden] { display: none; }
.pop-model img { width: 20px; image-rendering: pixelated; }
.pop-model small { display: block; color: var(--faint); font-size: 11.5px; margin-top: 1px; }
.pop-model.off { opacity: .55; }
span.avatar { display: grid; filter: none; }
.msg.agent.error .md { color: #fda4af; white-space: pre-wrap; }
.live-tools { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font: 12px var(--mono); color: var(--muted); }
.live-tools li { display: flex; gap: 8px; animation: msg-in .3s ease both; }
.live-tools i { font-style: normal; color: var(--sakura); }
.st-note { margin-top: 18px; color: var(--faint); font-size: 12.5px; }
.st-body > .row { display: flex; justify-content: flex-end; margin-top: 12px; }

/* Style bible switch in the send sheet */
.bible-switch { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.bible-switch.on { border-color: rgba(255, 122, 156, .4); background: rgba(255, 122, 156, .06); }
.bible-switch div { flex: 1; display: flex; flex-direction: column; }
.bible-switch small { color: var(--faint); font-size: 12px; }
.dlg label.switch { position: relative; flex: none; display: block; width: 38px; height: 22px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--sakura); }
.switch input:checked + span::after { transform: translateX(16px); }
.bible-view { display: flex; flex-direction: column; gap: 10px; max-height: 220px; overflow-y: auto; padding: 10px 12px; border-radius: 10px; background: #0b0b0e; border: 1px solid var(--line); font-size: 13px; }
.bible-view span { font: 600 11px var(--mono); color: var(--sakura); }
.bible-view .md { font-size: 13px; }
.bible-mini { margin-top: 6px; border: 1px solid rgba(255, 122, 156, .25); border-radius: 10px; background: rgba(255, 122, 156, .04); }
.bible-mini summary { display: flex; gap: 8px; align-items: center; padding: 8px 12px; cursor: pointer; list-style: none; font-size: 12.5px; color: var(--muted); }
.bible-mini summary::-webkit-details-marker { display: none; }
.bible-mini summary span { font: 600 11px var(--mono); color: var(--sakura); }
.bible-mini summary em { margin-left: auto; font-style: normal; color: var(--faint); }
.bible-mini[open] summary em { visibility: hidden; }
.bible-mini .md { padding: 0 12px 10px; font-size: 13px; max-height: 260px; overflow-y: auto; }

/* Make 3D: one source image, compact dialog */
dialog:has(.sheet.tone-sky) { width: min(560px, calc(100vw - 32px)); }
.sheet-body.only-refs .refs { grid-template-columns: minmax(0, 260px); justify-content: center; }
.sheet-body.only-refs .field-label, .sheet-body.only-refs .hint-line { text-align: center; }

/* Drop an image on the winner box */
.drop-zone { position: relative; transition: border-color .15s, box-shadow .15s; }
.drop-zone.over { border: 2px dashed var(--sakura); box-shadow: 0 0 0 6px rgba(255, 122, 156, .1); }
.drop-zone .no-thumb b { color: var(--sakura); font-weight: 600; }
.drop-zone .link-btn { color: var(--sakura); text-decoration: underline; font-size: inherit; }
.drop-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; background: rgba(9, 9, 11, .8); color: var(--muted); font-size: 11.5px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.drop-zone:hover .drop-hint, .drop-zone.over .drop-hint { opacity: 1; }

/* Agent settings + context meter */
.agent-form { display: flex; flex-direction: column; gap: 8px; }
.set-row { display: flex; align-items: center; gap: 20px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.set-row > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.set-row small { color: var(--faint); font-size: 12.5px; }
.set-row select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; color: var(--text); max-width: 170px; }
.settings-view label.switch { position: relative; flex: none; display: block; width: 38px; height: 22px; }
.agent-form .row { display: flex; justify-content: flex-end; margin-top: 6px; }
.composer-hint { display: flex; align-items: center; justify-content: center; gap: 6px; }
.composer-hint .link-btn { font-size: 11px; color: var(--sakura); }
.meter { display: inline-block; width: 46px; height: 4px; border-radius: 2px; background: var(--line-strong); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--sakura); }
.drop-copy { margin: 0; line-height: 1.7; }
.drop-icon { display: block; font-size: 26px; color: var(--sakura); margin-bottom: 6px; }

/* Slim scrollbars everywhere: no arrow buttons, no track, thumb only while it matters */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent; } }
::-webkit-scrollbar { width: 8px; height: 8px; background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 122, 156, .45); }
#input { scrollbar-width: none; }
#input::-webkit-scrollbar { display: none; }

/* Coding-agent model picker */
.effort-seg { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
.pop-custom { display: flex; gap: 6px; margin: 6px 6px 4px; }
.pop-custom input { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; color: var(--text); font-size: 12.5px; }
.pop-custom input:focus { outline: none; border-color: var(--sakura); }
.pop-custom button { border: 0; border-radius: 8px; padding: 0 12px; background: rgba(255, 122, 156, .16); color: var(--sakura); font-size: 12.5px; font-weight: 600; }

/* Open dropdown lists: the app's own dark colours, readable text, dimmed models without a key */
select, option, optgroup { color-scheme: dark; }
select option, select optgroup { background: var(--panel); color: var(--text); font-weight: 400; }
select option:checked { background: var(--sakura); color: #1a0610; }
select option:disabled { color: var(--faint); }

/* Sheet icons and run button */
.sheet-icon svg { width: 24px; height: 24px; stroke-width: 1.9; }
.run-btn { display: inline-flex; align-items: center; gap: 8px; }
.run-btn svg { width: 16px; height: 16px; stroke-width: 2; }

/* Output cards: image with a badge on top, tidy action buttons below */
.out-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.out { display: flex; flex-direction: column; border-radius: 16px; transition: border-color .15s, transform .15s; }
.out:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.out-img { position: relative; display: block; }
.out-img .no-thumb { aspect-ratio: 1; height: auto; }
.out-badge { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; backdrop-filter: blur(8px); background: rgba(9, 9, 11, .72); border: 1px solid var(--line-strong); color: var(--text); }
.out-badge svg { width: 13px; height: 13px; stroke-width: 2; }
.out-badge.win { color: #f5c451; border-color: rgba(245, 196, 81, .5); }
.out-badge.win svg { fill: currentColor; }
.out-badge.mesh { color: #38bdf8; border-color: rgba(56, 189, 248, .45); }
.out-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; border-top: 1px solid var(--line-soft); }
.act { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; transition: transform .12s, border-color .12s, background .12s, box-shadow .12s; }
.act svg { width: 15px; height: 15px; stroke-width: 1.9; flex: none; }
.act:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .3); background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03)); }
.act:active { transform: none; }
.act.wide { grid-column: 1 / -1; }
.act.hero-act { color: #1a1305; border-color: transparent; background: linear-gradient(135deg, #ffe08a, #f5c451); box-shadow: 0 6px 18px rgba(245, 196, 81, .25); }
.act.hero-act:hover { background: linear-gradient(135deg, #ffe9a8, #f7cd68); border-color: transparent; }
.act.pillar-act { color: #ffb3c6; border-color: rgba(255, 122, 156, .4); background: linear-gradient(135deg, rgba(255, 122, 156, .16), rgba(244, 63, 110, .06)); }
.act.pillar-act:hover { color: #fff; border-color: var(--sakura); background: linear-gradient(135deg, rgba(255, 122, 156, .3), rgba(244, 63, 110, .14)); box-shadow: 0 6px 18px rgba(244, 63, 110, .22); }

/* Back button next to the breadcrumbs */
.head-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 12px 6px 8px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); font-size: 13px; font-weight: 600; transition: border-color .12s, background .12s; }
.back-btn svg { width: 16px; height: 16px; stroke-width: 2.2; }
.back-btn:hover:not(:disabled) { border-color: rgba(255, 122, 156, .5); background: var(--elevated); }
.back-btn:disabled { opacity: .35; cursor: default; }
@media (max-width: 700px) { .back-btn span { display: none; } .back-btn { padding: 6px 8px; } }

/* Hideable chat */
.chat-show { display: none; }
@media (min-width: 901px) {
  .shell.chat-hidden { grid-template-columns: 1fr; }
  .shell.chat-hidden .chat { display: none; }
  .shell.chat-hidden .chat-show { display: inline-grid; }
}
@media (max-width: 900px) { .chat-toggle { display: none; } }
.chat-head .project-picker { align-items: center; }

/* Wide screens: keep the page centred instead of hugging the left edge */
@media (min-width: 1100px) {
  .content { padding-left: max(40px, calc((100% - 1120px) / 2)); padding-right: max(40px, calc((100% - 1120px) / 2)); }
}

/* Style text card: open area plus Edit / Remove */
.bible-text { display: flex; align-items: flex-start; gap: 12px; cursor: default; }
.bible-text .bible-open { flex: 1; min-width: 0; background: none; border: 0; padding: 0; text-align: left; color: inherit; }
.bible-actions { display: flex; gap: 6px; flex: none; }
.mini.danger-mini:hover { color: #fda4af; border-color: rgba(244, 63, 94, .5); background: rgba(244, 63, 94, .1); }

/* Calmer send sheet */
.sheet-body { gap: 28px; padding: 20px 24px; }
.sheet-body section { gap: 12px; }
.sheet-body { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.field-label em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--faint); margin-left: 6px; opacity: .8; }
.final-prompt { min-height: 130px; font-size: 12.5px !important; line-height: 1.55 !important; }
.sheet .refs { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.sheet .ref span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--faint); }
.sheet .ref img { border-width: 1px; border-radius: 10px; }
.sheet .ref.add { font-size: 12px; color: var(--muted); }
.sheet .bible-switch { padding: 8px 12px; }
.recipe-details { border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel-2); }
.recipe-details summary { cursor: pointer; list-style: none; padding: 9px 12px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.recipe-details summary::-webkit-details-marker { display: none; }
.recipe-details summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(-45deg); transition: transform .15s; }
.recipe-details[open] summary::before { transform: rotate(45deg); }
.recipe-details .recipe { padding: 0 10px 10px; max-height: 220px; }
.sheet-model { padding: 12px 24px; }
.sheet-model .chip { font-size: 11.5px; }
.dlg label.field-label { flex-direction: row; align-items: baseline; gap: 0; }

/* Game tools row on the asset page */
.tool-row { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.tool-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.tool { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 12.5px; font-weight: 600; transition: color .12s, border-color .12s, background .12s; }
.tool svg { width: 14px; height: 14px; stroke-width: 1.9; }
.tool:hover:not(:disabled) { color: var(--text); border-color: rgba(255, 122, 156, .45); background: var(--elevated); }
.tool:disabled { opacity: .38; cursor: not-allowed; }

/* Model cards open the viewer */
button.out-img { width: 100%; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.out.model .no-thumb { display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; aspect-ratio: 1; height: auto; }
.out.model .no-thumb svg { width: 34px; height: 34px; stroke-width: 1.3; color: var(--faint); }
.checker .out-img, .checker.icons-preview, .checker.sprite-preview, .out.checker img { background-color: #1a1a1f; background-image: linear-gradient(45deg, #24242a 25%, transparent 25%, transparent 75%, #24242a 75%), linear-gradient(45deg, #24242a 25%, transparent 25%, transparent 75%, #24242a 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
#content[data-drop-asset].over { outline: 2px dashed var(--sakura); outline-offset: -10px; background: rgba(255, 122, 156, .03); }

/* Make 3D with turnaround views: several pictures */
.sheet-body.only-refs .refs { grid-template-columns: repeat(auto-fill, minmax(120px, 170px)); justify-content: center; }

/* Rig sheet */
.rig-pick { flex-direction: row !important; align-items: center; gap: 20px !important; }
.rig-thumb { flex: none; display: grid; place-items: center; width: 150px; aspect-ratio: 1; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--panel-2); overflow: hidden; }
.rig-thumb img { width: 100%; height: 100%; object-fit: contain; }
.rig-thumb svg { width: 40px; height: 40px; color: var(--faint); }
.rig-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rig-height { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.rig-height input { width: 90px; background: var(--control); border: 1px solid var(--line-strong); border-radius: 9px; padding: 7px 10px; color: var(--text); }
dialog:has(.sheet.tone-sky) .rig-pick { padding: 4px 0; }

/* Animation picker */
.model-pick input[type=search] { background: var(--control); border: 1px solid var(--line-strong); border-radius: 9px; padding: 7px 10px; color: var(--text); outline: none; min-width: 220px; }
.anim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; max-height: 48vh; overflow-y: auto; padding: 2px; }
.anim { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); text-align: left; transition: border-color .12s, background .12s; }
.anim:hover { border-color: var(--line-strong); }
.anim.on { border-color: var(--tone); background: rgba(var(--tone-rgb), .12); box-shadow: 0 0 0 1px rgba(var(--tone-rgb), .4); }
.anim img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 7px; background: var(--panel); }
.anim-icon { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 7px; background: var(--panel); color: var(--faint); }
.anim strong { font-size: 12.5px; line-height: 1.3; }
.anim small { font-size: 11px; color: var(--faint); }

/* Split dialog */
dialog:has(.split-dlg), dialog:has(.viewer-dlg) { width: min(1100px, calc(100vw - 32px)); }
.dlg h2 svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; align-items: start; }
.split-stage { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-strong); cursor: crosshair; user-select: none; touch-action: none; background: #1a1a1f; }
.split-stage img { display: block; width: 100%; max-height: 62vh; object-fit: contain; pointer-events: none; }
.split-box { position: absolute; border: 2px solid var(--sakura); background: rgba(255, 122, 156, .12); border-radius: 4px; }
.split-box.drawing { border-style: dashed; }
.split-box span { position: absolute; top: -1px; left: -1px; padding: 0 6px; border-radius: 3px 0 4px 0; background: var(--sakura); color: #09090b; font: 700 11px var(--mono); }
.split-box button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 6px; border: 0; background: rgba(9, 9, 11, .8); color: #fff; font-size: 13px; line-height: 1; }
.split-box button:hover { background: #e11d48; }
.split-side { display: flex; flex-direction: column; gap: 10px; }
.split-names { display: flex; flex-direction: column; gap: 6px; max-height: 30vh; overflow-y: auto; }
.dlg .split-names label { flex-direction: row; align-items: center; gap: 8px; }
.split-names span { flex: none; width: 22px; font: 600 11px var(--mono); color: var(--sakura); }
.split-names input { flex: 1; min-width: 0; }
@media (max-width: 760px) { .split-layout { grid-template-columns: 1fr; } }

/* Icons dialog */
.icons-preview { display: grid; place-items: center; height: 180px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.icons-preview img { max-height: 160px; max-width: 90%; object-fit: contain; }
.dlg input[type=range] { padding: 0; accent-color: var(--sakura); }

/* 3D viewer */
.viewer-dlg { padding: 18px; }
.viewer-head { display: flex; justify-content: space-between; align-items: center; }
.viewer-head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }
.viewer-stage { position: relative; height: min(62vh, 560px); border-radius: 14px; border: 1px solid var(--line); background: radial-gradient(circle at 50% 35%, #1f1f25, #0b0b0e); overflow: hidden; display: grid; place-items: center; }
.viewer-stage canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.viewer-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; max-height: min(62vh, 560px); overflow-y: auto; }
.viewer-side select { max-width: none; width: 100%; }
.viewer-side .ghost, .viewer-side .primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.viewer-side svg { width: 15px; height: 15px; }
.viewer-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.viewer-stats span { padding: 8px 10px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.viewer-stats b { display: block; color: var(--text); font-size: 15px; }
.sprite-box { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.sprite-box summary { display: flex; align-items: center; gap: 6px; padding: 10px 0; cursor: pointer; list-style: none; font-weight: 600; font-size: 13px; }
.sprite-box summary::-webkit-details-marker { display: none; }
.sprite-box[open] { gap: 10px; }
.sprite-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.dlg .sprite-form label { gap: 4px; font-size: 11.5px; }
.sprite-preview { margin-top: 10px; border-radius: 10px; border: 1px solid var(--line); overflow: auto; max-height: 200px; }
.sprite-preview img { display: block; max-width: 100%; image-rendering: pixelated; }
#spriteOut .primary { width: 100%; margin-top: 8px; }
@media (max-width: 820px) { .viewer-layout { grid-template-columns: 1fr; } .viewer-stage { height: 46vh; } }
.split-guess { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.split-guess .ghost { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 8px; font-size: 12.5px; }
.split-guess svg { width: 14px; height: 14px; }
.split-note { display: flex; gap: 8px; align-items: flex-start; }
.split-note .spinner { flex: none; margin-top: 2px; border-color: rgba(255, 122, 156, .3); border-top-color: var(--sakura); }
.job-banner.bad { border-color: rgba(244, 63, 94, .4); background: rgba(244, 63, 94, .08); color: #fecdd3; }
.job-banner .grow { flex: 1; }
.bad-dot { flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #e11d48; color: #fff; font-weight: 800; font-size: 12px; }

/* Make 3D: settings on the left, the source image on the right */
dialog:has(.sheet.tone-sky .mesh-body) { width: min(900px, calc(100vw - 32px)); }
.sheet-body.mesh-body { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.sheet-body.mesh-body .refs { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.sheet-body.mesh-body > section:last-child .field-label { text-align: center; }
.mesh-opts { gap: 10px; }
.mesh-opts .field-label:not(:first-child) { margin-top: 8px; }
.mesh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.dlg .mesh-grid label { font-size: 12px; gap: 5px; }
.mesh-opts select { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none; color: var(--text); }
.mesh-opts select:focus, .poly-row input:focus { border-color: rgba(var(--tone-rgb), .6); }
.mesh-opts select:disabled { opacity: .5; }
.dlg label.mesh-toggle { flex-direction: row; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); cursor: pointer; }
.dlg label.mesh-toggle:has(input:checked) { border-color: rgba(var(--tone-rgb), .45); background: rgba(var(--tone-rgb), .06); }
.mesh-toggle.off { opacity: .5; cursor: default; }
.mesh-toggle > span:last-child { display: flex; flex-direction: column; font-size: 13px; }
.mesh-toggle small { color: var(--faint); font-size: 12px; }
.mesh-toggle .switch { position: relative; flex: none; display: block; width: 38px; height: 22px; }
.sheet .switch input:checked + span { background: var(--tone); }
.poly-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.poly-row.off { opacity: .45; }
.dlg .poly-row input { width: 110px; font: 13px var(--mono); }
.poly-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.poly-presets button { font: 12px var(--mono); padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); }
.poly-presets button:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); }
.poly-presets button.on { color: var(--text); border-color: var(--tone); background: rgba(var(--tone-rgb), .14); }
.poly-presets button:disabled { cursor: default; }
.fmt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.dlg label.fmt { flex-direction: row; align-items: center; gap: 6px; font: 12px var(--mono); padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; }
.dlg label.fmt.on { color: var(--text); border-color: rgba(var(--tone-rgb), .55); background: rgba(var(--tone-rgb), .1); }
.fmt input { accent-color: var(--tone); margin: 0; }
@media (max-width: 820px) { .sheet-body.mesh-body { grid-template-columns: 1fr; } .sheet-body.mesh-body > section:last-child { order: -1; } }

/* Final Vault */
.vault-sec { align-items: center; }
.vault-sec svg { width: 15px; height: 15px; color: var(--faint); }
.vault-sec.active svg { color: var(--sakura); }
.vault-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 22px; }
.vault-stats div { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.vault-stats b { font-size: 24px; font-weight: 600; }
.vault-stats span { font-size: 12px; color: var(--muted); }
.vault-stats .ok b { color: var(--sem-engine); }
.vault-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.vault-bar label.inline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.vault-bar input { accent-color: var(--sakura); }
.vault-bar .primary, .vault-bar .ghost { display: inline-flex; align-items: center; gap: 6px; }
.vault-bar svg { width: 15px; height: 15px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.seg button { border: 0; background: none; color: var(--muted); padding: 6px 12px; border-radius: 7px; font-size: 13px; }
.seg button.on { background: var(--elevated); color: var(--text); }
.vault-list { display: flex; flex-direction: column; gap: 8px; }
.vault-row { display: grid; grid-template-columns: 72px 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.vault-row.ready { border-color: rgba(245, 196, 81, .3); }
.vault-thumb { width: 72px; height: 72px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; display: grid; place-items: center; }
.vault-thumb img { width: 100%; height: 100%; object-fit: contain; }
.vault-thumb span { font-size: 11px; color: var(--faint); }
.vault-thumb.mesh { border-color: rgba(56, 189, 248, .3); }
.vault-thumb svg { width: 24px; height: 24px; color: var(--faint); }
.vault-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vault-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vault-name .kind-tag { align-self: center; }
.vault-info code { font: 12px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-files { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vault-files .chip { padding: 1px 8px; font: 11px var(--mono); }
.vault-files small { font-size: 12px; color: var(--faint); }
.vault-actions { display: flex; gap: 6px; }
.vault-actions .act { padding: 6px 10px; font-size: 12.5px; }
.vault-layout { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.vault-layout summary { padding: 10px 14px; cursor: pointer; font-size: 13px; color: var(--muted); }
.vault-layout pre { margin: 0; padding: 0 14px 14px; font: 12px/1.6 var(--mono); color: var(--muted); overflow-x: auto; }
@media (max-width: 720px) {
  .vault-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vault-row { grid-template-columns: 56px 56px minmax(0, 1fr); }
  .vault-thumb { width: 56px; height: 56px; }
  .vault-actions { grid-column: 1 / -1; }
}

/* Drop an image on the winner box */
.drop-zone { position: relative; transition: border-color .15s, box-shadow .15s; }
.drop-zone.over { border: 2px dashed var(--sakura); box-shadow: 0 0 0 6px rgba(255, 122, 156, .1); }
.drop-zone .no-thumb b { color: var(--sakura); font-weight: 600; }
.drop-zone .link-btn { color: var(--sakura); text-decoration: underline; font-size: inherit; }
.drop-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; background: rgba(9, 9, 11, .8); color: var(--muted); font-size: 11.5px; opacity: 0; transition: opacity .15s; pointer-events: none; }
.drop-zone:hover .drop-hint, .drop-zone.over .drop-hint { opacity: 1; }

/* Agent settings + context meter */
.agent-form { display: flex; flex-direction: column; gap: 8px; }
.set-row { display: flex; align-items: center; gap: 20px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.set-row > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.set-row small { color: var(--faint); font-size: 12.5px; }
.set-row select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; color: var(--text); max-width: 170px; }
.settings-view label.switch { position: relative; flex: none; display: block; width: 38px; height: 22px; }
.agent-form .row { display: flex; justify-content: flex-end; margin-top: 6px; }
.composer-hint { display: flex; align-items: center; justify-content: center; gap: 6px; }
.composer-hint .link-btn { font-size: 11px; color: var(--sakura); }
.meter { display: inline-block; width: 46px; height: 4px; border-radius: 2px; background: var(--line-strong); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--sakura); }
.drop-copy { margin: 0; line-height: 1.7; }
.drop-icon { display: block; font-size: 26px; color: var(--sakura); margin-bottom: 6px; }

/* Slim scrollbars everywhere: no arrow buttons, no track, thumb only while it matters */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent; } }
::-webkit-scrollbar { width: 8px; height: 8px; background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 122, 156, .45); }
#input { scrollbar-width: none; }
#input::-webkit-scrollbar { display: none; }

/* Coding-agent model picker */
.effort-seg { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
.pop-custom { display: flex; gap: 6px; margin: 6px 6px 4px; }
.pop-custom input { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; color: var(--text); font-size: 12.5px; }
.pop-custom input:focus { outline: none; border-color: var(--sakura); }
.pop-custom button { border: 0; border-radius: 8px; padding: 0 12px; background: rgba(255, 122, 156, .16); color: var(--sakura); font-size: 12.5px; font-weight: 600; }

/* Open dropdown lists: the app's own dark colours, readable text, dimmed models without a key */
select, option, optgroup { color-scheme: dark; }
select option, select optgroup { background: var(--panel); color: var(--text); font-weight: 400; }
select option:checked { background: var(--sakura); color: #1a0610; }
select option:disabled { color: var(--faint); }

/* Model cards: one download link per format */
.fmt-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 2px; color: var(--faint); }
.fmt-links svg { width: 14px; height: 14px; }
.fmt-links a { font: 600 11px var(--mono); padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line-strong); color: var(--muted); text-decoration: none; }
.fmt-links a:hover { color: var(--text); border-color: rgba(56, 189, 248, .5); }

/* ---------- drag & drop onto the chat and projects page ---------- */
.panel.chat.over::after, #projectsView.over::after {
  content: "Drop images to attach them"; position: absolute; inset: 10px; z-index: 6; display: grid; place-items: center;
  border: 2px dashed var(--sakura); border-radius: 12px; background: rgba(9, 9, 11, .82); color: var(--sakura-soft);
  font-weight: 600; font-size: 15px; pointer-events: none;
}
#projectsView.over::after { content: "Drop a Glob project .zip to import it"; position: fixed; inset: 16px; }

/* ---------- agent asks for a folder ---------- */
.access-card { margin-top: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 122, 156, .35); background: rgba(255, 122, 156, .06); display: grid; gap: 8px; }
.access-card.ok { border-color: var(--line); background: var(--panel-2); }
.ac-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: var(--sakura-soft); }
.access-card.ok .ac-head { color: var(--muted); }
.ac-head svg { width: 16px; height: 16px; }
.access-card code { font: 12.5px var(--mono); word-break: break-all; color: var(--text); }
.access-card p { margin: 0; color: var(--muted); font-size: 13px; }
.access-card .ac-warn { color: #fda4af; }
.ac-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ac-actions .primary, .ac-actions .ghost { padding: 6px 14px; font-size: 13px; }
.ac-actions small { width: 100%; color: var(--faint); font-size: 11.5px; }

/* ---------- import a game ---------- */
.import-view { overflow-y: auto; place-items: start center; padding: 70px 0 60px; }
.import-view .ob-stage.wide { width: min(1080px, calc(100vw - 48px)); }
.imp-pick { display: flex; gap: 10px; width: 100%; align-items: center; flex-wrap: wrap; }
.imp-pick .ob-input { flex: 1 1 360px; font: 15px var(--mono); }
.imp-recent { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--faint); font-size: 13px; }
.imp-preview { display: flex; flex-direction: column; gap: 22px; position: relative; z-index: 1; }
.imp-preview.enter { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.imp-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.imp-top h2 { margin: 4px 0; font-size: clamp(30px, 5vw, 48px); letter-spacing: -.03em; line-height: 1.05; }
.imp-top code { font: 12.5px var(--mono); color: var(--faint); }
.imp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.imp-tiles div { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); display: grid; }
.imp-tiles strong { font-size: 26px; letter-spacing: -.02em; }
.imp-tiles span { color: var(--muted); font-size: 12.5px; }
.imp-sections { display: grid; gap: 16px; max-height: 46vh; overflow-y: auto; padding-right: 6px; }
.imp-sections h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--sakura); }
.imp-sections h3 small { color: var(--faint); letter-spacing: 0; }
.imp-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.imp-unit { position: relative; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); display: grid; gap: 2px; min-width: 0; }
.imp-unit strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 64px; }
.imp-unit small { color: var(--faint); font-size: 11.5px; }
.imp-unit em { position: absolute; top: 9px; right: 10px; font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; font-style: normal; color: var(--muted); }
.imp-unit.needs { border-style: dashed; }
.imp-unit.needs em { color: var(--sem-engine); }
.imp-options { display: grid; gap: 10px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.imp-radio, .imp-check { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.imp-radio input[type=radio], .imp-check input { accent-color: var(--sakura); }
.imp-name { flex: 1 1 220px; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 9px; padding: 7px 11px; outline: none; }
.imp-name:focus { border-color: var(--sakura); }
.imp-note { margin: 0; color: var(--faint); font-size: 12.5px; }

/* ---------- storage & access ---------- */
.path-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.path-row code { flex: 1 1 280px; min-width: 0; padding: 8px 12px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); font: 12.5px var(--mono); word-break: break-all; }
.row.wrap { flex-wrap: wrap; margin-top: 14px; }
.grant-list { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.grant-list:has(.st-empty) { border: 0; }
.grant-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.grant-row:last-child { border-bottom: 0; }
.grant-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12.5px var(--mono); }
.grant-row select { background: var(--control); border: 1px solid var(--line); border-radius: 7px; padding: 3px 6px; font-size: 12px; color: var(--text); }
.grant-row.missing code { color: var(--faint); text-decoration: line-through; }
.grant-row small { color: var(--faint); }
.pv-foot { margin-top: 28px; color: var(--faint); font-size: 13px; }
.pv-foot code { font: 12.5px var(--mono); color: var(--muted); }

/* ---------- first-run setup ---------- */
.setup .ob-stage { max-height: calc(100vh - 80px); overflow-y: auto; padding: 4px 4px 20px; }
.setup-dots { display: flex; gap: 6px; margin-bottom: 26px; }
.setup-dots i { width: 22px; height: 4px; border-radius: 4px; background: var(--line-strong); }
.setup-dots i.done { background: rgba(255, 122, 156, .45); }
.setup-dots i.on { background: var(--sakura); }
.setup-list { display: grid; gap: 6px; width: 100%; max-width: 520px; }
.setup-list > div { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.setup-list small { margin-left: auto; color: var(--faint); }
.setup-list .empty { color: var(--faint); }
.setup-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.setup-actions.big { flex-direction: column; align-items: stretch; width: min(360px, 100%); }
.setup-keys { display: grid; gap: 12px; width: 100%; max-width: 560px; }
.setup-keys label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.setup-keys b { color: var(--text); }
.setup-keys a { color: var(--sakura-soft); }
.setup-keys input { background: rgba(255, 255, 255, .04); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; outline: none; font: 13px var(--mono); }
.setup-keys input:focus { border-color: var(--sakura); }
.setup-folder { display: grid; gap: 8px; width: 100%; }
.setup-folder span { color: var(--muted); font-size: 13px; }
.setup-folder code { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line-strong); font: 13px var(--mono); word-break: break-all; }
.setup-folder div { display: flex; gap: 8px; }
.grant-list.compact { width: 100%; max-width: 640px; }
.ob-sub.small { font-size: 13px; }
.out.file .no-thumb { gap: 6px; word-break: break-all; font-size: 11px; }
.file-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font: 12px var(--mono); text-decoration: none; }
.file-chip:hover { color: var(--text); border-color: var(--line-strong); }
.file-chip svg { width: 14px; height: 14px; }

/* ---------- update banner ---------- */
.update-banner { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 40px));
  padding: 10px 12px 10px 14px; border-radius: 14px; border: 1px solid rgba(255, 122, 156, .35); background: rgba(20, 20, 23, .96);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .55); font-size: 13px; animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.update-banner[hidden] { display: none; }
.update-banner .grow { flex: 1; min-width: 0; }
.update-banner small { color: var(--faint); }
.update-banner a:not(.mini) { color: var(--sakura-soft); }
.update-banner code { font: 11.5px var(--mono); padding: 4px 8px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--line); user-select: all; }
.update-banner .mini.on { color: #09090b; background: var(--sakura); border-color: var(--sakura); font-weight: 600; }
.ub-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--sakura); box-shadow: 0 0 12px var(--sakura); }
.ub-dot.bad { background: var(--bad); box-shadow: none; }
.ub-pct { font: 12px var(--mono); color: var(--muted); }
.set-row > .update-actions { flex: none; flex-direction: row; gap: 8px; }

/* Full-screen scenes cross-fade into each other (see showScene / hideScene in app.js) */
.scene-over { z-index: 40 !important; }
.scene-out { animation: scene-out .3s ease forwards !important; pointer-events: none; }
@keyframes scene-out { to { opacity: 0; } }

/* Asset hero: the newest 3D model fills the slot when there is no winner image */
.winner-box.hero-3d { position: relative; background: radial-gradient(ellipse at 50% 85%, rgba(56, 189, 248, .10), transparent 60%), var(--panel-2); cursor: grab; }
.winner-box.hero-3d:active { cursor: grabbing; }
.hero-3d .hero-poster { position: absolute; inset: 0; object-fit: contain; transition: opacity .5s ease; }
.hero-3d .hero-stage { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.hero-3d .hero-stage canvas { width: 100%; height: 100%; display: block; }
.hero-3d.live .hero-stage { opacity: 1; }
.hero-3d.live .hero-poster { opacity: 0; }
.hero-3d .hero-badge { z-index: 1; pointer-events: none; }
.hero-3d .hero-open { position: absolute; top: 10px; right: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; opacity: 0; transition: opacity .15s; }
.hero-3d .hero-open svg { width: 14px; height: 14px; }
.hero-3d:hover .hero-open, .hero-3d .hero-open:focus-visible { opacity: 1; }

/* Delete an output: × on the card, Undo in the toast */
.out { position: relative; }
.out-del, .chip-del { display: grid; place-items: center; padding: 0; border: 1px solid var(--line-strong); color: var(--muted); cursor: pointer; line-height: 1; }
.out-del { position: absolute; top: 8px; right: 8px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; background: rgba(9, 9, 11, .78); backdrop-filter: blur(6px); font-size: 17px; opacity: 0; transform: scale(.85); transition: opacity .15s, transform .15s, color .15s, border-color .15s; }
.out:hover .out-del, .out-del:focus-visible { opacity: 1; transform: none; }
.out-del:hover, .chip-del:hover { color: #fda4af; border-color: #fb7185; }
@media (hover: none) { .out-del { opacity: 1; transform: none; } }
.out.leaving, .file-chip-wrap.leaving { opacity: .35; transform: scale(.97); pointer-events: none; transition: opacity .2s, transform .2s; }
.file-chip-wrap { display: inline-flex; align-items: center; gap: 2px; }
.chip-del { width: 22px; height: 22px; border-radius: 6px; background: var(--panel-2); font-size: 14px; }
.toast.has-action { display: flex; align-items: center; gap: 14px; }
.toast-act { border: 0; background: none; padding: 0; color: var(--sakura); font-weight: 600; cursor: pointer; }
.toast-act:hover { text-decoration: underline; }

/* Copy prompt + images on the generation sheet */
.copy-req { display: inline-flex; align-items: center; gap: 7px; }
.copy-req svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.hero-3d .hero-open svg { fill: none; stroke: currentColor; stroke-width: 1.8; }

/* Prompt autosave tick */
label[for=assetPrompt]::after { content: " · saved"; color: #86efac; opacity: 0; transition: opacity .3s; }
label[for=assetPrompt].saved::after { opacity: 1; }

/* Glob chat turned off in Settings: the project fills the window everywhere */
.shell.chat-off { grid-template-columns: 1fr; }
.shell.chat-off .chat, .shell.chat-off [data-toggle-chat] { display: none !important; }
body:has(.shell.chat-off) .mobile-switch { display: none; }
.dot.warn { background: var(--sem-image); }

/* Coding agent (Settings) */
.cn-how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 22px; }
.cn-how > div { display: flex; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 13px; line-height: 1.45; }
.cn-how b { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: rgba(255, 122, 156, .14); color: var(--sakura); font: 700 12px var(--mono); }
.cn-how strong { color: var(--text); font-weight: 600; }
.cn-pick { display: flex; gap: 8px; margin-bottom: 18px; }
.cn-pick input { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); font: 13px var(--mono); }
.ob-chips.left { justify-content: flex-start; margin-bottom: 14px; }
.cn-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; margin-bottom: 22px; border-radius: 16px; border: 1px solid rgba(255, 122, 156, .3); background: var(--panel); }
.cn-card .set-row { padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.cn-top { display: flex; align-items: center; gap: 12px; }
.cn-top > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cn-top small { color: var(--faint); font: 11.5px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-warn { margin: 4px 0; color: var(--sem-image); font-size: 13px; }
.cn-tries { display: grid; gap: 8px; }
.cn-try { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-align: left; font-size: 13px; cursor: pointer; }
.cn-try span { flex: 1; }
.cn-try i { font-style: normal; color: var(--faint); font-size: 12px; }
.cn-try:hover { border-color: var(--line-strong); }
.cn-try:hover i { color: var(--sakura); }
@media (max-width: 820px) { .cn-how { grid-template-columns: 1fr; } }

/* Agent orders */
.sec-badge { margin-left: auto; min-width: 18px; padding: 1px 6px; border-radius: 999px; background: var(--sakura); color: #1a0b10; font: 700 11px var(--mono); text-align: center; }
.ord-conn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 13px; }
.ord-conn.off { border-color: rgba(255, 122, 156, .3); }
.ord-conn code { font: 12px var(--mono); color: var(--text); }
.ord-conn .primary { margin-left: auto; }
.ord-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.ord-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.ord-col header { display: flex; align-items: center; justify-content: space-between; }
.ord-col header span { font: 12px var(--mono); color: var(--faint); }
.ord-col.col-ready header strong { color: var(--sem-engine); }
.ord-col.col-draft header strong { color: var(--sakura); }
.ord-hint { margin: -2px 0 4px; color: var(--faint); font-size: 12px; line-height: 1.4; }
.ord-list { display: flex; flex-direction: column; gap: 8px; }
.ord-list.row { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ord-empty { padding: 18px 8px; border: 1px dashed var(--line); border-radius: 12px; color: var(--faint); font-size: 12.5px; text-align: center; }
.ord-card { display: flex; flex-direction: column; gap: 7px; padding: 12px; border-radius: 13px; border: 1px solid var(--line); background: var(--panel-2); }
.ord-card.st-ready { border-color: rgba(245, 196, 81, .35); }
.ord-card.st-draft { border-color: rgba(255, 122, 156, .25); }
.ord-card.st-cancelled { opacity: .6; }
.ord-top { display: flex; align-items: center; gap: 8px; }
.ord-status { font-size: 11.5px; color: var(--faint); }
.st-ready .ord-status { color: var(--sem-engine); }
.st-integrated .ord-status, .st-delivered .ord-status { color: var(--sakura); }
.ord-menu { margin-left: auto; width: 24px; height: 22px; border-radius: 7px; border: 0; background: none; color: var(--faint); cursor: pointer; }
.ord-menu:hover { background: var(--control); color: var(--text); }
.ord-title { font-size: 14px; line-height: 1.3; }
.ord-brief { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ord-ph { align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px var(--mono); color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.ord-asset { display: flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--faint); font: 11px var(--mono); text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ord-asset svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
.ord-asset:hover { color: var(--text); }
.ord-needs { display: flex; flex-wrap: wrap; gap: 5px; }
.need { font-size: 11px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--faint); }
.need.ok { color: var(--sakura); border-color: rgba(255, 122, 156, .35); background: rgba(255, 122, 156, .08); }
.ord-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ord-foot small { color: var(--faint); font-size: 11.5px; }
.ord-foot .act.on { color: var(--sem-engine); border-color: rgba(245, 196, 81, .4); }
.cn-cmd { margin: 10px 0; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); font: 12.5px var(--mono); white-space: pre-wrap; }
.dlg [hidden] { display: none !important; }

/* Sound assets */
.out.audio { display: flex; flex-direction: column; }
.audio-face { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 120px; padding: 14px; background: radial-gradient(circle at 50% 40%, rgba(255, 122, 156, .12), transparent 70%); }
.audio-face small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font: 11px var(--mono); }
.audio-face .out-badge { position: absolute; top: 8px; left: 8px; }
.out.audio audio { width: calc(100% - 16px); margin: 0 8px 8px; height: 34px; }
.wave { display: flex; align-items: center; gap: 3px; height: 44px; }
.wave i { display: block; width: 4px; border-radius: 2px; background: linear-gradient(180deg, var(--sakura-soft), var(--sakura-deep)); opacity: .75; }
.wave i:nth-child(4n+1) { height: 30%; } .wave i:nth-child(4n+2) { height: 75%; } .wave i:nth-child(4n+3) { height: 50%; } .wave i:nth-child(4n) { height: 95%; }
.wave i:nth-child(7n) { height: 20%; } .wave i:nth-child(5n) { height: 62%; }
.wave.big { height: 90px; gap: 5px; }
.wave.big i { width: 6px; }
.audio-hero { display: grid; place-items: center; }
.audio-big { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; padding: 24px; }
.audio-big audio { width: 100%; max-width: 360px; }
.audio-big small { color: var(--faint); font: 11.5px var(--mono); }
.audio-opts { display: flex; flex-direction: column; gap: 14px; }
.audio-opts label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.audio-opts select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; color: var(--text); }
.audio-opts .mesh-toggle { flex-direction: row; }

/* Import review */
.imp-review { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
button.imp-unit { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.imp-unit.out { opacity: .35; text-decoration: line-through; }
.imp-sections section.off .imp-units { opacity: .3; pointer-events: none; }
.imp-sections section.merged .imp-sec-title { opacity: .5; }
.imp-sections h3 { display: flex; align-items: center; gap: 8px; }
.imp-sec-check input { accent-color: var(--sakura); }
.imp-sec-title { flex: 1; min-width: 0; padding: 4px 8px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--text); font: 600 15px var(--sans); }
.imp-sec-title:hover:not(:disabled), .imp-sec-title:focus { border-color: var(--line-strong); background: var(--panel-2); outline: none; }
.imp-merge { max-width: 150px; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 12px; }
.budget-card { display: grid; gap: 8px; margin: 0 0 20px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.budget-card strong { font-size: 22px; }
.budget-card span { color: var(--muted); font-size: 13px; }
.budget-card small { color: var(--faint); font-size: 12px; }
.budget-card .meter { display: block; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.budget-card .meter i { display: block; height: 100%; background: var(--sakura); }
.order-banner { display: flex; align-items: center; gap: 10px; margin: -6px 0 18px; padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(255, 122, 156, .25); background: rgba(255, 122, 156, .06); color: var(--muted); font-size: 13px; }
.order-banner svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--sakura); stroke-width: 1.8; }
.order-banner b { color: var(--text); }
.order-banner code { font: 12px var(--mono); color: var(--text); }
.order-banner.st-ready { border-color: rgba(245, 196, 81, .4); background: rgba(245, 196, 81, .06); }

/* Model menu: a tab per coding agent plus favorites, so a long list stays short. */
.model-pop { display: flex; flex-direction: column; overflow: hidden; }
.pop-tabs { display: flex; gap: 3px; padding: 3px; margin: 2px 2px 0; border-radius: 11px; background: rgba(255, 255, 255, .04); }
.pop-tabs button { flex: 1; display: grid; place-items: center; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.pop-tabs button img { width: 17px; height: 17px; object-fit: contain; opacity: .7; }
.pop-tabs button:hover { background: rgba(255, 255, 255, .06); }
.pop-tabs button:hover img, .pop-tabs button.on img { opacity: 1; }
.pop-tabs button.on { background: rgba(255, 122, 156, .16); color: var(--sakura); }
.pop-tab-name { padding: 8px 10px 2px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.pop-list { overflow-y: auto; min-height: 0; flex: 1; }
.pop-model img { width: 16px; height: 16px; object-fit: contain; image-rendering: auto; }
.pop-star { font-style: normal; font-size: 13px; color: var(--faint); opacity: 0; padding: 0 2px; transition: opacity .12s, color .12s; }
.pop-model:hover .pop-star { opacity: .8; }
.pop-star:hover { color: #ffd166; opacity: 1 !important; }
.pop-star.on { opacity: 1; color: #ffd166; }

/* Setup → new project: same backdrop, so the questions take over in place. */
.onboard.instant { animation: none; }
.ob-stage.stage-out { opacity: 0; transform: translateY(-8px); transition: opacity .25s ease, transform .25s ease; }
.ob-next:disabled { opacity: .35; cursor: not-allowed; }

/* Required game folder in the new-project flow. */
.ob-folder { display: grid; gap: 3px; width: min(520px, 100%); padding: 16px 18px; border-radius: 14px; border: 1px dashed rgba(255, 122, 156, .45); background: rgba(255, 122, 156, .05); color: var(--text); text-align: left; transition: border-color .15s, background .15s; }
.ob-folder:hover { background: rgba(255, 122, 156, .1); border-color: var(--sakura); }
.ob-folder strong { font-size: 16px; }
.ob-folder small { color: var(--faint); font: 12px var(--mono); overflow-wrap: anywhere; }
.ob-folder.on { border-style: solid; border-color: rgba(255, 122, 156, .6); }
.ob-home { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; width: min(520px, 100%); margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.ob-home code { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font: 12px var(--mono); direction: rtl; text-align: left; }
/* rtl puts the ellipsis at the start, so the end of the path (game/glob) stays visible. */
.ob-home .link-btn { font-size: 12.5px; }

/* Setup: coding agents as plug-and-play cards. */
.agent-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: min(560px, 100%); }
@media (max-width: 560px) { .agent-cards { grid-template-columns: 1fr; } }
.agent-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .03); color: var(--text); text-align: left; transition: border-color .2s, background .2s, transform .15s; }
.agent-card:hover { border-color: rgba(255, 122, 156, .5); background: rgba(255, 255, 255, .05); transform: translateY(-1px); }
.agent-logo { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 11px; background: rgba(255, 255, 255, .06); }
.agent-logo img { width: 24px; height: 24px; object-fit: contain; }
.agent-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.agent-text strong { font-size: 14.5px; }
.agent-text small { color: var(--faint); font-size: 12px; }
.agent-mark { flex: none; width: 22px; text-align: center; color: var(--faint); font-weight: 700; }
.agent-card.missing .agent-logo img { filter: grayscale(1); opacity: .55; }
.agent-card.checking, .agent-card.installing, .agent-card.login { border-color: rgba(255, 209, 102, .45); cursor: progress; }
.agent-card.login small, .agent-card.installing small { color: #ffd166; }
.agent-card.error small { color: #ff8a8a; }
.agent-card.ok { border-color: rgba(84, 214, 140, .55); background: rgba(84, 214, 140, .07); }
.agent-card.ok small, .agent-card.ok .agent-mark { color: #54d68c; }
.agent-card.ok .agent-logo { box-shadow: 0 0 0 2px rgba(84, 214, 140, .5), 0 0 22px rgba(84, 214, 140, .25); }
.agent-spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 209, 102, .3); border-top-color: #ffd166; animation: agent-spin .8s linear infinite; }
@keyframes agent-spin { to { transform: rotate(360deg); } }
.setup-alt { margin: 0; color: var(--faint); font-size: 13px; }
.setup-alt .link-btn { color: var(--sakura-soft, var(--sakura)); text-decoration: underline; text-underline-offset: 3px; }

/* The Glob fistbump when an agent connects. */
.fistbump { display: grid; justify-items: center; gap: 6px; width: min(560px, 100%); padding: 10px 0 2px; }
.fistbump[hidden] { display: none; }
.fb-row { position: relative; display: flex; align-items: center; justify-content: center; height: 84px; }
.fb-side { display: flex; align-items: center; gap: 2px; }
.fb-glob { width: 64px; filter: drop-shadow(0 6px 18px rgba(255, 122, 156, .45)); }
.fb-logo { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line-strong); }
.fb-logo img { width: 32px; height: 32px; object-fit: contain; }
.fb-fist { font-size: 34px; line-height: 1; }
.fb-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.fb-burst i { position: absolute; left: -2px; top: -14px; width: 4px; height: 12px; border-radius: 3px; background: linear-gradient(#ffd166, var(--sakura)); transform: rotate(var(--a)) translateY(-18px); opacity: 0; transform-origin: 2px 14px; }
.fb-text { margin: 0; color: var(--muted); font-size: 14px; opacity: 0; }
.fb-text b { color: #54d68c; }
.fistbump.play .left { animation: fb-left .9s cubic-bezier(.2, .8, .2, 1) both; }
.fistbump.play .right { animation: fb-right .9s cubic-bezier(.2, .8, .2, 1) both; }
.fistbump.play .fb-burst i { animation: fb-burst .7s ease-out .55s both; }
.fistbump.play .fb-text { animation: rise .6s ease .75s both; }
@keyframes fb-left { 0% { transform: translateX(-90px); opacity: 0; } 55% { transform: translateX(6px); opacity: 1; } 70% { transform: translateX(-4px); } 100% { transform: translateX(0); opacity: 1; } }
@keyframes fb-right { 0% { transform: translateX(90px); opacity: 0; } 55% { transform: translateX(-6px); opacity: 1; } 70% { transform: translateX(4px); } 100% { transform: translateX(0); opacity: 1; } }
@keyframes fb-burst { 0% { opacity: 0; transform: rotate(var(--a)) translateY(-10px) scaleY(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-40px) scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .fistbump.play .left, .fistbump.play .right, .fistbump.play .fb-burst i, .fistbump.play .fb-text { animation: none; opacity: 1; } }
.preset-logo { width: 20px; height: 20px; object-fit: contain; }

/* Sign-in services next to API keys. */
.setup-more { width: min(560px, 100%); color: var(--muted); font-size: 13px; }
.setup-more summary { cursor: pointer; padding: 4px 0 10px; color: var(--faint); }
.setup-more summary:hover { color: var(--text); }
.setup-more[open] summary { color: var(--text); }
.settings-view .agent-cards { width: 100%; margin-bottom: 10px; }
.agent-card .agent-logo img[src$=".png"] { width: 40px; height: 40px; border-radius: 11px; }
.agent-mark .link-btn { color: #54d68c; font-weight: 700; }
.agent-mark .link-btn:hover { color: #ff8a8a; }

/* Settings → Generators: default 2D and 3D generators */
.gen-defaults { display: grid; gap: 10px; margin-bottom: 8px; }
.gen-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--control); }
.gen-kind { display: grid; gap: 2px; flex: 1 1 100%; }
.gen-kind small { color: var(--faint); font-size: 12px; }
.gen-row label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.gen-row select { min-width: 150px; max-width: 100%; }
.gen-row .gen-check { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
.sheet-model .sheet-bg { margin-left: 4px; }

/* ---------- Project covers and key art ---------- */
.pcard-art.cover { display: block; position: relative; }
.pcard-art.cover img { position: absolute; inset: 0; border-radius: 10px; }
.pcard-art { position: relative; }
.pcard-keyart { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 122, 156, .45); background: rgba(9, 9, 11, .78); backdrop-filter: blur(8px); color: var(--sakura-soft); font-size: 12px; font-weight: 600; white-space: nowrap; opacity: 0; transition: opacity .15s; }
.pcard-keyart svg { width: 14px; height: 14px; }
.pcard:hover .pcard-keyart, .pcard-keyart:focus-visible, .pcard-keyart:disabled { opacity: 1; }
.pcard-keyart:hover { color: #fff; border-color: var(--sakura); }
.pcard-keyart:disabled { opacity: .6; cursor: progress; }
.pcard-sample { flex-direction: column; padding: 0; overflow: hidden; border-style: dashed; border-color: rgba(255, 122, 156, .35); }
.pcard-sample-art { position: relative; flex: 1; min-height: 160px; overflow: hidden; }
.pcard-sample-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.9); transition: transform .4s; }
.pcard-sample:hover .pcard-sample-art img { transform: scale(1.04); }
.pcard-sample-text { display: flex; flex-direction: column; gap: 4px; padding: 0 14px 14px; }
.pcard-sample-text strong { font-size: 14px; }
.pcard-sample-text small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.pcard-sample.busy { opacity: .6; cursor: progress; }
.ob-sample { margin-top: 22px; display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--muted); font-size: 13px; padding: 6px 2px; border-bottom: 1px dashed rgba(255, 255, 255, .2); }
.ob-sample:hover { color: var(--sakura-soft); border-bottom-color: var(--sakura); }
.ob-sample svg { width: 15px; height: 15px; }

.proj-hero { position: relative; margin: -32px -40px 24px; padding: 32px 40px 8px; }
.proj-hero.has-cover { min-height: 340px; display: flex; align-items: flex-end; padding-bottom: 28px; overflow: hidden; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.proj-hero-blur { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(36px) saturate(1.2) brightness(.55); transform: scale(1.1); }
.proj-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 96%); mask-image: linear-gradient(180deg, #000 30%, transparent 96%); }
.proj-hero.has-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13, 13, 16, 0) 30%, rgba(13, 13, 16, .55) 62%, var(--panel) 100%); }
.proj-hero-text { position: relative; z-index: 1; max-width: 720px; }
.proj-hero.has-cover .kicker { color: rgba(255, 255, 255, .7); }
.proj-hero.has-cover .title { text-shadow: 0 2px 24px rgba(0, 0, 0, .55); }
.proj-hero.has-cover .lede { color: #e4e4e7; margin-bottom: 0; text-shadow: 0 1px 12px rgba(0, 0, 0, .6); }
.keyart-cta { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 720px; margin: 4px 0 8px; padding: 16px 18px; border-radius: 14px; border: 1px dashed rgba(255, 122, 156, .4); background: linear-gradient(120deg, rgba(255, 122, 156, .08), rgba(168, 85, 247, .06)); color: var(--text); text-align: left; transition: border-color .15s, background .15s; }
.keyart-cta:hover { border-color: var(--sakura); background: linear-gradient(120deg, rgba(255, 122, 156, .14), rgba(168, 85, 247, .1)); }
.keyart-cta svg { width: 26px; height: 26px; color: var(--sakura); flex: none; }
.keyart-cta span { display: flex; flex-direction: column; }
.keyart-cta small { color: var(--muted); font-size: 12.5px; }
.keyart-cta:disabled { cursor: progress; opacity: .75; }
.actions-row svg { width: 15px; height: 15px; vertical-align: -3px; }
@container (max-width: 620px) { .proj-hero, .proj-hero.has-cover { margin: -24px -16px 20px; padding-left: 16px; padding-right: 16px; } .proj-hero.has-cover { min-height: 240px; } }

/* ---------- Board ---------- */
.board { position: relative; height: calc(100vh - 290px); min-height: 380px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: grab; touch-action: none; background: radial-gradient(circle, rgba(255, 255, 255, .06) 1px, transparent 1px) 0 0 / 22px 22px, #0a0a0d; }
.board.dragging { cursor: grabbing; }
.board.dragging .board-card { pointer-events: none; }
.board-canvas { display: flex; align-items: flex-start; gap: 28px; padding: 28px; transform-origin: 0 0; width: max-content; }
.board-col { display: flex; flex-direction: column; gap: 14px; width: 220px; }
.board-col h2 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 2px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.board-col h2 small { color: var(--sakura); font: 11px var(--mono); }
.board-col h2 span { color: var(--faint); font: 11px var(--mono); }
.board-card { display: flex; flex-direction: column; padding: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); text-align: left; transition: border-color .15s, transform .15s, box-shadow .15s; }
.board-card:hover { border-color: rgba(255, 122, 156, .5); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.board-card > img, .board-card > .asset-sound, .board-card > .asset-empty { width: 100%; aspect-ratio: 1; object-fit: cover; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, #1c1c21, var(--panel)); user-select: none; }
.board-card.unpicked > img { opacity: .55; }
.board-label { display: flex; flex-direction: column; padding: 8px 10px 10px; }
.board-label strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-label em { font-style: normal; color: var(--faint); font: 11px var(--mono); }
.board-card.unpicked .board-label em { color: var(--sem-image); }
.zoom-btns { display: inline-flex; align-items: center; gap: 6px; }
.zoom-btns span { min-width: 44px; text-align: center; font: 12px var(--mono); color: var(--muted); }
.lineup-stage { height: min(60vh, 540px); }
.lineup-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lineup-legend b { color: var(--text); font-weight: 600; }

/* ---------- Tiles: sounds and models ---------- */
.asset-sound { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 100%; }
.asset-sound small { color: var(--faint); font-size: 11px; opacity: 0; transition: opacity .15s; }
.asset-tile:hover .asset-sound small, .board-card:hover .asset-sound small { opacity: 1; }
.asset-tile:hover .asset-sound .wave i, .board-card:hover .asset-sound .wave i { animation: wave-bob .9s ease-in-out infinite alternate; }
.asset-sound .wave i:nth-child(odd) { animation-delay: -.3s; }
@keyframes wave-bob { to { transform: scaleY(.45); } }
.tile-3d { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px; font: 600 10.5px var(--mono); color: #38bdf8; background: rgba(9, 9, 11, .75); border: 1px solid rgba(56, 189, 248, .35); backdrop-filter: blur(4px); }
.tile-3d svg { width: 12px; height: 12px; }
.hover-stage { position: absolute; inset: 0; opacity: 0; transition: opacity .25s; background: radial-gradient(circle at 50% 35%, #1f1f25, #0b0b0e); }
.hover-stage.live { opacity: 1; }
.hover-stage canvas { width: 100% !important; height: 100% !important; }

/* ---------- Pillar strength, credits, viewer extras ---------- */
.field-label.pillar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pillar-strength { font-size: 12px; padding: 3px 6px; max-width: 170px; text-transform: none; letter-spacing: 0; }
.credit-warn { display: flex; gap: 10px; align-items: center; margin: 0 20px 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .08); color: #fecaca; font-size: 13px; }
.credit-warn b { color: #fff; font-weight: 600; }
.height-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.height-row input { width: 84px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.height-row span { color: var(--faint); }
.height-row .ghost { padding: 5px 10px; }
.export-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.export-row a, .export-row .link-btn { font: 600 12px var(--mono); }

/* ---------- Batch dialog and job dock ---------- */
.batch-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; margin: 4px 0 12px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.batch-list label { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.batch-list label:hover { background: var(--elevated); }
.batch-list span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-list small { color: var(--faint); font: 11px var(--mono); white-space: nowrap; }
.job-dock { position: fixed; right: 20px; bottom: 20px; z-index: 25; min-width: 220px; max-width: 320px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(20, 20, 23, .92); backdrop-filter: blur(14px); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: fade-in .2s ease; }
.dock-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 0; background: none; color: var(--text); font-size: 13px; font-weight: 600; }
.dock-head .caret { margin-left: auto; }
.job-dock ul { list-style: none; margin: 0; padding: 0 8px 8px; max-height: 260px; overflow-y: auto; }
.job-dock li { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.job-dock li .link-btn { flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-dock li small { color: var(--faint); font-size: 11.5px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; gap: 8px; padding: 24px; background: rgba(5, 5, 7, .92); backdrop-filter: blur(10px); animation: fade-in .15s ease; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-height: 100%; min-height: 0; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 170px); object-fit: contain; border-radius: 12px; background: #111; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.lightbox figcaption { display: flex; align-items: center; gap: 12px; width: min(100%, 760px); }
.lb-count { font: 12px var(--mono); color: var(--muted); }
.out-badge.static { position: static; }
.lightbox kbd, .palette kbd, .palette-btn kbd { font: 11px var(--mono); padding: 1px 5px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, .25); background: rgba(0, 0, 0, .12); }
.btn-link { text-decoration: none; color: var(--text); font-size: 13px; }
.lb-prompt { width: min(100%, 760px); font-size: 13px; color: var(--muted); }
.lb-prompt summary { cursor: pointer; }
.lb-prompt p { margin: 8px 0; color: #d4d4d8; line-height: 1.6; max-height: 120px; overflow-y: auto; }
.lb-nav { height: 64px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--text); font-size: 34px; line-height: 1; }
.lb-nav:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.lb-nav:disabled { opacity: .2; cursor: default; }
.lb-close { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text); }
@media (max-width: 640px) { .lightbox { grid-template-columns: 40px minmax(0, 1fr) 40px; padding: 12px; } .lb-nav { height: 48px; font-size: 26px; } }

/* ---------- Sound tools ---------- */
.audio-big[data-wave-src] { --wave: #ff7a9c; --wave-sel: rgba(255, 122, 156, .2); }
.wave-canvas { width: 100%; height: 120px; cursor: crosshair; border-radius: 10px; background: rgba(255, 255, 255, .02); touch-action: none; }
.wave-tools { display: flex; align-items: center; gap: 8px; width: 100%; flex-wrap: wrap; }
.wave-tools .mini { display: inline-flex; align-items: center; gap: 5px; }
.wave-tools .mini svg { width: 13px; height: 13px; }
.wave-sel { font: 11.5px var(--mono); color: var(--sakura); }

/* ---------- Command palette ---------- */
.palette-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--faint); }
.palette-btn:hover { color: var(--text); border-color: var(--line-strong); }
.palette-btn svg { width: 16px; height: 16px; }
.palette-btn kbd { border-color: var(--line); background: none; color: var(--faint); }
.palette { position: fixed; inset: 0; z-index: 45; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(5, 5, 7, .6); backdrop-filter: blur(4px); animation: fade-in .12s ease; }
.palette-card { width: min(620px, 100%); border-radius: 16px; border: 1px solid var(--line-strong); background: var(--panel-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overflow: hidden; }
.palette-card input { width: 100%; padding: 16px 18px; border: 0; border-bottom: 1px solid var(--line); background: none; font-size: 16px; outline: none; }
.palette-card ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette-card li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.palette-card li svg { width: 16px; height: 16px; color: var(--faint); flex: none; }
.palette-card li span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-card li small { color: var(--faint); font-size: 12px; white-space: nowrap; }
.palette-card li.on { background: rgba(255, 122, 156, .12); }
.palette-card li.on svg { color: var(--sakura); }
.palette-card li.none { color: var(--faint); cursor: default; }
.palette-card footer { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }
#galleryBtn.on { color: var(--sakura); border-color: rgba(255, 122, 156, .45); }
@container (max-width: 520px) { .palette-btn kbd { display: none; } }

/* ---------- Gallery mode: the art in front, the tools out of the way ---------- */
body.gallery-mode { --panel: #050506; --panel-2: #0b0b0d; --bg: #000; }
body.gallery-mode .shell { grid-template-columns: 1fr; }
body.gallery-mode .shell .chat, body.gallery-mode .chat-show { display: none; }
body.gallery-mode .workspace-body { grid-template-columns: 1fr; }
body.gallery-mode .sections, body.gallery-mode .pillars, body.gallery-mode .doc-bar, body.gallery-mode .applied, body.gallery-mode .tool-row { display: none; }
body.gallery-mode .asset-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
body.gallery-mode .asset-img { border-color: transparent; background: #0d0d10; }
body.gallery-mode .asset-img img { object-fit: cover; }
body.gallery-mode .board { height: calc(100vh - 250px); }
body.gallery-mode .board-col { width: 280px; }
.empty .sample-cta { margin: 28px auto 0; max-width: 460px; }
.lightbox[hidden], .job-dock[hidden] { display: none; }
body.gallery-mode .asset-tile.add, body.gallery-mode .actions-row { display: none; }
.dlg .batch-list label { display: flex; flex-direction: row; align-items: center; gap: 10px; margin: 0; text-align: left; font-size: 13.5px; color: var(--text); }
.dlg .batch-list input { width: auto; flex: none; margin: 0; }
.action-row .primary { display: inline-flex; align-items: center; gap: 6px; }
.action-row .primary svg { width: 15px; height: 15px; }
@media (max-width: 700px) { #paletteBtn, #galleryBtn { display: none; } .proj-hero-blur { inset: -20px; } }
