/* benetto://studio. Tokens and base components are copied from /style.css (do not import it:
   the chat CSS sets body{overflow:hidden} and chat layout). Keep the tokens in sync by hand. */
:root {
  --bg: #0a0a0a;
  --bg-2: #111;
  --bg-3: #1a1a1a;
  --fg: #d4d4d4;
  --fg-dim: #888;
  --accent: #ffb000;
  --accent-soft: rgba(255,176,0,.08);
  --accent-line: rgba(255,176,0,.3);
  --accent-2: #ff3b3b;
  --ok: #4ade80;
  --border: #2a2a2a;
  --shadow: 0 0 18px rgba(255, 176, 0, .12);
  --radius: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.5; }
a { color: inherit; }
.hidden { display: none !important; }
.dim { color: var(--fg-dim); }
.err { color: var(--accent-2); }
.brand-accent { color: var(--accent); }
.mono { font-family: var(--mono); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- copied base components ---------- */
.btn-primary {
  background: var(--accent); color: #000; border: 0;
  padding: 12px 16px; border-radius: 6px; font-family: var(--mono);
  font-size: 14px; font-weight: 700; cursor: pointer; transition: transform .1s, box-shadow .15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary.small { padding: 7px 12px; font-size: 12px; }
.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--fg-dim);
  font-family: var(--mono); font-size: 12px; padding: 8px 12px; border-radius: 6px;
  cursor: pointer; transition: all .15s; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn-ghost:hover { color: var(--fg); border-color: var(--fg-dim); }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost.danger { color: var(--accent-2); }
.btn-ghost.danger:hover { border-color: rgba(255,59,59,.5); }
.btn-link { background: none; border: 0; color: var(--accent); cursor: pointer; font-family: var(--mono); font-size: 12px; padding: 0; }
.btn-link:hover { text-decoration: underline; }

.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card {
  width: 100%; max-width: 480px; max-height: 90dvh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-weight: 700; margin-bottom: 12px; }
.modal-x { background: none; border: 0; color: var(--fg-dim); cursor: pointer; font-size: 16px; }
.modal-x:hover { color: var(--accent-2); }

.field { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--fg-dim); margin-bottom: 14px; }
.field.check { flex-direction: row; align-items: center; gap: 8px; margin-bottom: 8px; cursor: pointer; }
.field textarea, .field input[type=text], .field input[type=search], .field select, .st-input {
  background: var(--bg); border: 1px solid var(--border); color: var(--fg); padding: 10px 12px; border-radius: 6px;
  font-family: var(--font); font-size: 14px; outline: none; resize: vertical; width: 100%;
}
.field textarea:focus, .field input:focus, .st-input:focus { border-color: var(--accent); }
.field input[type=checkbox] { accent-color: var(--accent); }
.hint { font-size: 11px; color: var(--fg-dim); font-weight: 400; font-family: var(--mono); }
.group-title { font-family: var(--mono); font-size: 11px; color: var(--accent); text-transform: lowercase; margin-bottom: 8px; }
.pill { font-family: var(--mono); font-size: 10px; padding: 1px 7px; border-radius: 10px; border: 1px solid var(--border); color: var(--fg-dim); white-space: nowrap; }
.pill.red { color: var(--accent-2); border-color: rgba(255,59,59,.4); }
.pill.green { color: var(--ok); border-color: rgba(74,222,128,.4); }
.pill.amber { color: var(--accent); border-color: var(--accent-line); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--border); padding: 10px 18px; border-radius: 8px;
  font-family: var(--mono); font-size: 13px; z-index: 200; box-shadow: var(--shadow); max-width: 90vw;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-dim); }

/* ---------- shell ---------- */
.st-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px;
  padding: 10px 20px; background: rgba(10,10,10,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.st-brand { font-family: var(--mono); font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; }
.st-nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.st-nav a {
  text-decoration: none; color: var(--fg-dim); font-size: 14px; padding: 8px 12px; border-radius: 6px;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: color .15s, background .15s;
}
.st-nav a:hover { color: var(--fg); background: var(--bg-2); }
.st-nav a.active { color: var(--accent); background: var(--accent-soft); }
.st-soon { font-family: var(--mono); font-size: 9px; color: var(--fg-dim); border: 1px solid var(--border); border-radius: 8px; padding: 0 5px; }
.st-badge { font-family: var(--mono); font-size: 10px; background: var(--accent); color: #000; border-radius: 8px; padding: 0 6px; font-weight: 700; }
.st-spend { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); white-space: nowrap; text-align: right; line-height: 1.35; }
.st-spend b { color: var(--fg); font-weight: 500; }
.st-spend .warn { color: var(--accent-2); }
.st-main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; }
.st-h1 { font-family: var(--mono); font-size: 20px; margin: 0 0 4px; font-weight: 700; }
.st-lead { color: var(--fg-dim); margin: 0 0 22px; font-size: 14px; }

/* ---------- create ---------- */
.st-create { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.st-panel { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.st-panel + .st-panel { margin-top: 16px; }
.st-step { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); margin: 0 0 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.st-step b { color: var(--fg); font-weight: 500; }

.st-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.st-mode {
  text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
  color: var(--fg); cursor: pointer; transition: border-color .15s, background .15s;
}
.st-mode:hover { border-color: var(--fg-dim); }
.st-mode.active { border-color: var(--accent); background: var(--accent-soft); }
.st-mode .t { font-weight: 600; font-size: 14px; display: block; }
.st-mode.active .t { color: var(--accent); }
.st-mode:disabled { opacity: .4; cursor: not-allowed; }
.st-mode .d { font-size: 12px; color: var(--fg-dim); display: block; margin-top: 2px; }

.st-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 10px; }
.st-model {
  text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  color: var(--fg); cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: border-color .15s;
}
.st-model:hover { border-color: var(--fg-dim); }
.st-model.active { border-color: var(--accent); background: var(--accent-soft); }
.st-model .row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.st-model .n { font-weight: 600; font-size: 13px; }
.st-model .p { font-family: var(--mono); font-size: 12px; color: var(--accent); white-space: nowrap; }
.st-model .d { font-size: 12px; color: var(--fg-dim); }
.st-model .pill { align-self: flex-start; }
.st-model .s { font-family: var(--mono); font-size: 10px; color: var(--fg-dim); }

.st-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.st-seg button {
  background: var(--bg); color: var(--fg-dim); border: 0; border-right: 1px solid var(--border);
  padding: 8px 14px; cursor: pointer; font-family: var(--mono); font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.st-seg button:last-child { border-right: 0; }
.st-seg button:hover:not(:disabled) { color: var(--fg); }
.st-seg button.active { background: var(--accent-soft); color: var(--accent); }
.st-seg button:disabled { opacity: .35; cursor: not-allowed; }
.st-seg small { font-size: 9px; opacity: .8; }
.st-opts { display: flex; gap: 24px; flex-wrap: wrap; }

.st-refs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.st-chip { font-family: var(--mono); font-size: 11px; border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px 4px 10px; display: inline-flex; gap: 6px; align-items: center; max-width: 220px; }
.st-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-chip img { width: 20px; height: 20px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.st-chip.bad { border-color: rgba(255,59,59,.45); color: var(--accent-2); }
.st-chip button { background: none; border: 0; color: var(--fg-dim); cursor: pointer; }
.st-chip button:hover { color: var(--accent-2); }

.st-brief { position: relative; }
.st-brief textarea { min-height: 120px; }
.st-brief.writing textarea { border-color: var(--accent-line); }
.st-pick { display: flex; gap: 10px; align-items: center; background: var(--bg); border: 1px solid var(--accent-line); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; flex-wrap: wrap; }
.st-pick b { color: var(--accent); font-weight: 600; }

/* price box */
.st-price { position: sticky; top: 76px; }
.st-price .total { font-family: var(--mono); font-size: 28px; font-weight: 700; color: var(--accent); margin: 2px 0 6px; }
.st-price .lines { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px; }
.st-price .lines div { display: flex; justify-content: space-between; gap: 8px; }
.st-price .btn-primary { width: 100%; }
.st-price .note { font-size: 12px; color: var(--fg-dim); margin-top: 10px; line-height: 1.45; }
.st-alert { border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; border: 1px solid; }
.st-alert.warn { border-color: var(--accent-line); background: var(--accent-soft); }
.st-alert.bad { border-color: rgba(255,59,59,.35); background: rgba(255,59,59,.07); }
.st-alert .btn-primary { margin-top: 8px; }
.st-meter { display: flex; height: 4px; background: var(--bg-3); border-radius: 2px; overflow: hidden; margin: 6px 0 2px; }
.st-meter > div { height: 100%; background: var(--accent); transition: width .3s; }
.st-meter > div.res { background: var(--accent-line); }

/* ---------- library ---------- */
.st-libbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.st-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.st-filter {
  background: none; border: 1px solid var(--border); color: var(--fg-dim); border-radius: 16px;
  padding: 5px 12px; cursor: pointer; font-size: 13px; display: inline-flex; gap: 6px; align-items: center;
}
.st-filter:hover { color: var(--fg); }
.st-filter.active { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.st-filter .c { font-family: var(--mono); font-size: 11px; opacity: .8; }
.st-search { margin-left: auto; width: 240px; }

.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.st-tile {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; transition: border-color .15s, transform .15s; text-decoration: none; color: inherit;
}
.st-tile:hover { border-color: var(--fg-dim); transform: translateY(-1px); }
.st-tile .meta { padding: 9px 11px 10px; display: flex; flex-direction: column; gap: 4px; }
.st-tile .title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-tile .sub { font-family: var(--mono); font-size: 10px; color: var(--fg-dim); display: flex; justify-content: space-between; gap: 8px; }
.st-tile .fav { color: var(--accent); }

/* preview placeholder (fake image) */
.st-art { position: relative; width: 100%; aspect-ratio: 1 / 1; background: var(--bg-3); overflow: hidden; }
.st-tile .st-art { aspect-ratio: 4 / 3; }
.st-art .fill { position: absolute; inset: 0; }
.st-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.st-stage .st-art > img { object-fit: contain; }
.st-art > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.st-art .dur { position: absolute; left: 8px; bottom: 8px; font-family: var(--mono); font-size: 10px; background: rgba(0,0,0,.65); color: #fff; padding: 1px 6px; border-radius: 4px; }
.st-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.55); color: #fff; font-size: 22px; cursor: pointer; padding-left: 4px;
}
.st-play:hover { border-color: var(--accent); color: var(--accent); }
.st-art.alpha { background: repeating-conic-gradient(#1d1d1d 0 25%, #2a2a2a 0 50%) 0 0 / 16px 16px; }
.st-art .fmt { position: absolute; left: 8px; top: 8px; font-family: var(--mono); font-size: 10px; background: rgba(0,0,0,.55); color: #fff; padding: 1px 6px; border-radius: 4px; }
.st-art .state {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: rgba(10,10,10,.72); font-family: var(--mono); font-size: 12px; text-align: center; padding: 12px;
}
.st-art .state.bad { color: var(--accent-2); }
.st-art .state .bar { width: 70%; height: 3px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
.st-art .state .bar > div { height: 100%; background: var(--accent); transition: width .6s; box-shadow: 0 0 10px var(--accent); }
.st-art .state .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: st-pulse 1.2s ease-in-out infinite; }
.st-art .corner { position: absolute; right: 8px; top: 8px; }
@keyframes st-pulse { 50% { opacity: .25; transform: scale(.7); } }

.st-empty { text-align: center; padding: 60px 20px; color: var(--fg-dim); border: 1px dashed var(--border); border-radius: 10px; }
.st-empty p { margin: 0 0 14px; }

/* ---------- video ---------- */
.st-kinds button { padding: 6px 12px; }
.st-src { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.st-src .thumb { width: 96px; flex-shrink: 0; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.st-src .thumb .st-art { aspect-ratio: 1 / 1; }
.st-src .txt { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 2px; }
.st-src .txt b { font-weight: 600; font-size: 14px; }
.st-src .btn-link { align-self: flex-start; }
.st-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 60dvh; overflow-y: auto; }
.st-pick-item { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 4px; cursor: pointer; color: inherit; text-align: left; }
.st-pick-item:hover:not(:disabled) { border-color: var(--accent); }
.st-pick-item:disabled { opacity: .4; cursor: not-allowed; }
.st-pick-item .st-art { aspect-ratio: 1 / 1; border-radius: 4px; }
.st-pick-item .l { display: block; font-size: 11px; padding: 4px 2px 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-switch { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-family: var(--mono); font-size: 12px; background: var(--bg); }
.st-switch input { accent-color: var(--accent); }
.st-switch.off { opacity: .5; cursor: not-allowed; }
.st-fixed { margin: 4px 0 0; font-family: var(--mono); font-size: 12px; }
.modal-card:has(.st-picker) { max-width: 640px; }

/* ---------- drafts / disk (§10a) ---------- */
.st-expiry { font-family: var(--mono); font-size: 10px; color: var(--accent-2); }
.st-disk { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); }
.st-alert.ok { border-color: rgba(74,222,128,.35); background: rgba(74,222,128,.06); }

/* ---------- editor ---------- */
.st-main.wide { max-width: 1560px; }
.ed-start { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ed-start .st-panel + .st-panel { margin-top: 0; }
.ed-start .hint { margin: 0 0 12px; }
.ed-gap { margin-top: 12px; }
.ed-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ed-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ed-title .st-back { margin: 0; }
.ed-title b { font-size: 16px; }
.ed-tools-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ed-tools-row .st-seg button { padding: 7px 10px; }
.ed { display: grid; grid-template-columns: 190px minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.ed-left { display: flex; flex-direction: column; gap: 6px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.ed-left .st-act { font-size: 12px; padding: 8px 10px; }
.ed-left .hint { margin: 4px 0 0; }
.ed-add { text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--fg); padding: 8px 10px; cursor: pointer; font-size: 13px; }
.ed-add:hover { border-color: var(--accent-line); color: var(--accent); }
.ed-center { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ed-stage {
  display: flex; align-items: center; justify-content: center; padding: 12px; min-height: 320px; border-radius: 10px; border: 1px solid var(--border);
  background: repeating-conic-gradient(#151515 0 25%, #1c1c1c 0 50%) 0 0 / 20px 20px;
}
.ed-stage .canvas-container { box-shadow: 0 0 0 1px var(--border), 0 10px 40px rgba(0,0,0,.5); }
.ed-pending { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; padding: 10px 12px; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 8px; }
.ed-pending .bar { flex: 1; min-width: 120px; height: 3px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
.ed-pending .bar > div { height: 100%; background: var(--accent); transition: width .6s; }
.ed-ai .st-step { margin-bottom: 8px; }
.ed-ai-row { display: flex; gap: 8px; align-items: stretch; }
.ed-ai-row textarea { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border); color: var(--fg); padding: 9px 11px; border-radius: 6px; font-family: var(--font); font-size: 14px; resize: vertical; outline: none; }
.ed-ai-row textarea:focus { border-color: var(--accent); }
.ed-ai-row .btn-primary { white-space: nowrap; }
.ed-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.ed-chips .st-filter { font-size: 12px; padding: 3px 10px; }
.ed-res { margin: 10px 0 0; }
.ed-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ed-right .st-panel + .st-panel { margin-top: 0; }
.ed-props .field { margin-bottom: 10px; }
.ed-props select { background: var(--bg); border: 1px solid var(--border); color: var(--fg); padding: 8px 9px; border-radius: 6px; font-family: var(--font); font-size: 13px; }
.ed-props input[type=color] { width: 100%; height: 34px; padding: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.ed-props input[type=range] { accent-color: var(--accent); width: 100%; }
.ed-props input[type=number] { padding: 8px 9px; font-size: 13px; }
.ed-props .st-seg button { padding: 6px 10px; }
.ed-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ed-row > .field { flex: 1; min-width: 110px; }
.ed-align button { font-size: 14px; padding: 5px 9px; }
.ed-layer-list { display: flex; flex-direction: column; gap: 3px; max-height: 300px; overflow-y: auto; }
.ed-layer { display: flex; align-items: center; gap: 2px; border: 1px solid transparent; border-radius: 6px; padding: 1px 2px; }
.ed-layer.active { border-color: var(--accent-line); background: var(--accent-soft); }
.ed-layer.off .name { opacity: .45; text-decoration: line-through; }
.ed-layer button { background: none; border: 0; color: var(--fg-dim); cursor: pointer; padding: 5px 6px; font-size: 13px; border-radius: 4px; }
.ed-layer button:hover:not(:disabled) { color: var(--accent); background: var(--bg-3); }
.ed-layer button:disabled { opacity: .25; cursor: default; }
.ed-layer .name { flex: 1; text-align: left; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ed-layer.active .name { color: var(--accent); }
@media (max-width: 1180px) {
  .ed { grid-template-columns: minmax(0, 1fr); }
  .ed-left { flex-direction: row; flex-wrap: wrap; }
  .ed-left .group-title, .ed-left .hint { flex-basis: 100%; }
  .ed-start { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- item ---------- */
.st-back { display: inline-block; margin-bottom: 14px; font-family: var(--mono); font-size: 12px; color: var(--fg-dim); text-decoration: none; }
.st-back:hover { color: var(--accent); }
.st-item { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.st-stage { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.st-stage .st-art { margin: 0 auto; border-radius: 6px; }
.st-versions { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; }
.st-ver {
  flex: 0 0 auto; width: 96px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 4px; cursor: pointer; color: inherit; text-align: left;
}
.st-ver.active { border-color: var(--accent); }
.st-ver .st-art { aspect-ratio: 1 / 1; border-radius: 4px; }
.st-ver .st-art .state { font-size: 10px; padding: 4px; gap: 4px; }
.st-ver .l { font-family: var(--mono); font-size: 10px; color: var(--fg-dim); padding: 4px 2px 1px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-ver.active .l { color: var(--accent); }

.st-side { display: flex; flex-direction: column; gap: 16px; }
.st-titlerow { display: flex; gap: 8px; align-items: center; }
.st-title { font-size: 18px; font-weight: 600; margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.st-star { background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--fg-dim); cursor: pointer; width: 34px; height: 34px; font-size: 16px; }
.st-star.on { color: var(--accent); border-color: var(--accent-line); }
.st-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; margin: 0; }
.st-facts dt { color: var(--fg-dim); font-family: var(--mono); font-size: 11px; padding-top: 2px; }
.st-facts dd { margin: 0; }
.st-prompt { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13px; white-space: pre-wrap; max-height: 180px; overflow-y: auto; }
.st-actions { display: flex; flex-direction: column; gap: 6px; }
.st-act {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; color: var(--fg); cursor: pointer; text-align: left; font-size: 13px;
}
.st-act:hover:not(:disabled) { border-color: var(--accent-line); }
.st-act:disabled { opacity: .45; cursor: not-allowed; }
.st-act .p { font-family: var(--mono); font-size: 11px; color: var(--accent); white-space: nowrap; }
.st-act .p.dim { color: var(--fg-dim); }
a.st-act { text-decoration: none; }
.st-actrow { display: flex; gap: 6px; flex-wrap: wrap; }
.st-sibs { display: flex; gap: 6px; flex-wrap: wrap; }
.st-sib { width: 56px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); display: block; }
.st-sib:hover { border-color: var(--accent); }
.st-sib .st-art { aspect-ratio: 1 / 1; }

/* ---------- modal bits ---------- */
.st-confirm .sum { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); margin: 6px 0 14px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.st-confirm .sum b { color: var(--accent); font-size: 18px; }
.st-confirm .btns { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- stubs ---------- */
.st-stub { max-width: 680px; }
.st-stub ul { padding-left: 20px; color: var(--fg); margin: 0 0 16px; }
.st-stub li { margin-bottom: 4px; }
.st-stub .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- mock panel ---------- */
.st-mock-toggle {
  position: fixed; right: 14px; bottom: 14px; z-index: 150; background: var(--bg-3); color: var(--fg-dim);
  border: 1px dashed var(--border); border-radius: 6px; font-family: var(--mono); font-size: 11px; padding: 6px 10px; cursor: pointer;
}
.st-mock-toggle:hover { color: var(--accent); border-color: var(--accent); }
.st-mock {
  position: fixed; right: 14px; bottom: 50px; z-index: 150; width: 290px; background: var(--bg-2); border: 1px dashed var(--accent-line);
  border-radius: 10px; padding: 14px; box-shadow: var(--shadow);
}
.st-mock .field { color: var(--fg); font-family: var(--font); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .st-create, .st-item { grid-template-columns: minmax(0, 1fr); }
  .st-price { position: static; }
}
@media (max-width: 760px) {
  .st-top { flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; }
  .st-nav { order: 3; flex-basis: 100%; }
  .st-tochat { display: none; }
  .st-spend { margin-left: auto; white-space: normal; font-size: 10px; min-width: 0; }
  .st-main { padding: 16px 12px 80px; }
  .st-modes { grid-template-columns: 1fr; }
  .st-opts { gap: 14px; }
  .st-seg button { padding: 8px 10px; }
  .st-search { margin-left: 0; width: 100%; }
  .st-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
