/* VDOgenie — "screening room" (plans/PLAN-ui-refresh-2026-11-15.md, REVIEW-ui-refresh-2026-11-15.md).
   A quiet dark room: the videos give the colour, and marigold is the one lamp, kept for the thing to press next.
   Deliberately one dark theme. Bricolage Grotesque (SIL OFL 1.1, self-hosted) for display type, the system stack for
   body text. The old variable names are kept as aliases, so pages not yet redrawn keep working. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/static/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* the room */
  --bg: #0a090b;
  --bg-2: #110f13;
  --surface: #17141a;
  --raised: #201c24;
  --line: rgba(255, 240, 222, 0.09);
  --line-2: rgba(255, 240, 222, 0.17);
  --ink: #f6f1e9;
  --ink-2: #b9b1a6;
  --ink-3: #90897e;
  /* the lamp, and the few states */
  --gold: #f0b24b;
  --gold-2: #f7cb7c;
  --gold-ink: #1d1405;
  --gold-wash: rgba(240, 178, 75, 0.13);
  --live: #4fd8c4;
  --bad: #ff7d73;
  --good: #6ee7a0;
  /* type and shape */
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif;
  --r-tile: 14px;
  --r-card: 20px;
  --r-sm: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --tabbar-h: 0px;
  --row-h: 216px;

  /* aliases for templates written against the previous theme */
  --bg2: var(--bg-2);
  --card: rgba(255, 240, 222, 0.03);
  --card-border: var(--line);
  --border: var(--line-2);
  --muted: var(--ink-2);
  --accent: var(--gold);
  --accent-strong: var(--gold-2);
  --accent-ink: var(--gold-ink);
  --accent2: var(--live);
  --coral: var(--bad);
  --violet: #b9a4ff;
  --ok: var(--good);
  --warn: #fbbf24;
  --err: var(--bad);
  --info: var(--live);
  --radius: var(--r-card);
  --radius-sm: var(--r-sm);
  --glow: 0 10px 30px rgba(240, 178, 75, 0.3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body); font-size: 15px; line-height: 1.55;
  background: var(--bg); color: var(--ink);
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
/* The projector's glow: one warm light at the top of the room. */
body::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 560px; pointer-events: none; z-index: 0;
  background: radial-gradient(760px 380px at 50% -60px, rgba(240, 178, 75, 0.13), transparent 70%);
}
body > * { position: relative; z-index: 1; }
::selection { background: rgba(240, 178, 75, 0.35); }
a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(240, 178, 75, 0.5);
    text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
a:hover { color: var(--gold-2); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
button { font: inherit; color: inherit; }
svg.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75;
        stroke-linecap: round; stroke-linejoin: round; }

h1, h2, h3, .display { font-family: var(--display); letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; line-height: 1.08; margin: 0 0 0.9rem; }
h2 { font-size: 1.12rem; font-weight: 700; margin: 1.3rem 0 0.6rem; }
p { margin: 0.5rem 0; }
.muted { color: var(--ink-2); font-size: 0.88rem; }
.eyebrow, .label-caps { font: 600 0.74rem var(--body); letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- top bar ---------- */
header.top { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
             background: rgba(10, 9, 11, 0.74); }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--ink);
         display: inline-flex; align-items: center; gap: 9px; text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--gold); color: var(--gold-ink);
              display: grid; place-items: center; }
.brand-mark svg { width: 15px; height: 15px; fill: currentColor; }
.brand b { color: var(--gold); font-weight: 800; }
.nav { display: flex; gap: 4px; }
.nav a { position: relative; font-family: var(--display); font-weight: 600; font-size: 0.98rem; color: var(--ink-2);
         text-decoration: none; padding: 8px 12px; border-radius: 10px; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 1px; height: 2px;
                                      border-radius: 2px; background: var(--gold); }
.top .gap { flex: 1; }
.studio { display: inline-flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--ink-2); padding: 6px 12px;
          border-radius: 999px; border: 1px solid var(--line); text-decoration: none; white-space: nowrap; }
.studio:hover { color: var(--ink); border-color: var(--line-2); }
.studio .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.studio.open .dot { background: var(--good); }
.studio.busy .dot { background: var(--live); box-shadow: 0 0 0 0 rgba(79, 216, 196, .6); animation: ping 1.8s var(--ease) infinite; }
.studio.making .dot { background: var(--live); box-shadow: 0 0 0 0 rgba(79, 216, 196, .6); animation: ping 1.8s var(--ease) infinite; }
.studio.resting .dot { background: var(--gold); }
@keyframes ping { 70%, 100% { box-shadow: 0 0 0 7px rgba(79, 216, 196, 0); } }

/* account menu (details/summary: works without JS) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
                  padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.9rem; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { border-color: var(--line-2); }
.menu-avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center;
               background: var(--gold-wash); color: var(--gold); font-family: var(--display); font-weight: 700; }
.menu-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--raised);
              border: 1px solid var(--line-2); border-radius: 16px; padding: 6px; z-index: 40;
              box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.menu-panel a, .menu-panel button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 9px 12px; border-radius: 10px; color: var(--ink); font-size: 0.92rem; background: none; border: 0; cursor: pointer;
  text-align: left; text-decoration: none; }
.menu-panel a:hover, .menu-panel button:hover { background: rgba(255, 240, 222, .07); color: var(--ink); }
.menu-panel a small { color: var(--ink-3); font-size: 0.78rem; }
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.menu-panel .menu-label { font: 600 0.7rem var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 8px 12px 3px; }
.menu-panel form { margin: 0; }
.menu-panel .logout { color: var(--bad); }

/* phone: the thumb reaches the bottom, so the places and Make live there */
.tabbar { display: none; }
@media (max-width: 760px) {
  :root { --tabbar-h: 66px; --row-h: 132px; }
  .top-inner { padding: 0 16px; gap: 12px; }
  .nav, .studio span, .menu > summary .who { display: none; }
  .studio { padding: 8px; }
  .menu > summary { padding: 3px; }
  .tabbar { position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr;
            align-items: center; padding: 8px 26px calc(8px + env(safe-area-inset-bottom, 0px));
            background: rgba(14, 12, 16, .93); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
            border-top: 1px solid var(--line); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; color: var(--ink-3); font: 600 0.72rem var(--display); text-decoration: none; }
  .tabbar a svg { font-size: 1.3rem; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar .go { width: 54px; height: 54px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); display: grid;
                place-items: center; margin-top: -22px; box-shadow: 0 10px 30px rgba(240, 178, 75, .4), 0 0 0 5px var(--bg); }
  .tabbar .go svg { font-size: 1.5rem; stroke-width: 2.2; }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- layout ---------- */
main { width: 100%; max-width: 760px; margin: 28px auto 40px; padding: 0 16px; flex: 1; }
main.wide { max-width: 1240px; padding: 0 24px; }
main.full { max-width: none; margin: 0; padding: 0; }
@media (max-width: 760px) { main.wide { padding: 0 16px; } main { margin-top: 18px; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 18px 0 20px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--ink-2); margin: 6px 0 0; max-width: 60ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.4rem; margin-bottom: 1.2rem; }
@media (max-width: 560px) { .card { padding: 1.1rem; } }
footer.foot { text-align: center; color: var(--ink-3); font-size: 0.8rem; padding: 26px 16px 30px; }
footer.foot a { color: var(--ink-2); }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; margin: 0.9rem 0 0.35rem; font-size: 0.9rem; }
input[type=text], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%; padding: 0.72rem 0.9rem; border: 1px solid var(--line-2); border-radius: var(--r-sm); font: inherit; font-size: 1rem;
  background: var(--bg-2); color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, textarea:focus, select:focus { outline: none; border-color: rgba(240, 178, 75, .7); box-shadow: 0 0 0 3px rgba(240, 178, 75, .15); }
select option { background: var(--bg-2); color: var(--ink); }
textarea { min-height: 7rem; resize: vertical; }
input[type=checkbox], input[type=radio] { accent-color: var(--gold); }
.row { display: flex; gap: 0.9rem; align-items: flex-end; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 140px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--gold); color: var(--gold-ink);
       border: 1px solid transparent; border-radius: 999px; padding: 0.7rem 1.3rem; font-family: var(--display); font-size: 1rem;
       font-weight: 700; cursor: pointer; text-decoration: none; text-align: center;
       transition: transform .15s var(--ease), box-shadow .2s, background .2s, color .2s; }
.btn:hover { background: var(--gold-2); box-shadow: var(--glow); color: var(--gold-ink); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 1.05em; height: 1.05em; }
.btn.secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); font-weight: 600; }
.btn.secondary:hover { background: var(--raised); box-shadow: none; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink-2); font-weight: 600; }
.btn.ghost:hover { background: rgba(255, 240, 222, .06); color: var(--ink); box-shadow: none; }
.btn.danger { background: rgba(255, 125, 115, .1); border-color: rgba(255, 125, 115, .4); color: var(--bad); font-weight: 600; }
.btn.danger:hover { background: rgba(255, 125, 115, .2); box-shadow: none; color: #ffd2cd; }
.btn.sm { padding: 0.42rem 0.9rem; font-size: 0.86rem; font-weight: 600; }
.btn.lg { padding: 0.95rem 1.6rem; font-size: 1.08rem; }
.btn.block { display: flex; width: 100%; }

/* ---------- messages, tables, chips ---------- */
.err, .ok, .note { padding: 0.75rem 0.95rem; border-radius: var(--r-sm); margin-bottom: 0.9rem; }
.err { background: rgba(255, 125, 115, .1); border: 1px solid rgba(255, 125, 115, .38); color: #ffc4be; }
.ok { background: rgba(110, 231, 160, .08); border: 1px solid rgba(110, 231, 160, .3); color: #bdf5d3; }
.note { background: var(--gold-wash); border: 1px solid rgba(240, 178, 75, .3); color: var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-3); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: .08em; }
tr:last-child td { border-bottom: 0; }
@media (max-width: 760px) { .card table, .dash-section table { display: block; overflow-x: auto; white-space: nowrap; } }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 0.74rem;
        font-weight: 600; border: 1px solid var(--line-2); color: var(--ink-2); background: rgba(255, 240, 222, .04); }
.chip.pending { color: var(--ink-2); }
.chip.running { color: var(--live); border-color: rgba(79, 216, 196, .4); background: rgba(79, 216, 196, .1); }
.chip.completed { color: var(--good); border-color: rgba(110, 231, 160, .3); background: rgba(110, 231, 160, .08); }
.chip.failed { color: var(--bad); border-color: rgba(255, 125, 115, .38); background: rgba(255, 125, 115, .1); }
.chip.cancelled { color: var(--ink-3); border-color: var(--line-2); background: rgba(255, 240, 222, .04); }
.chip.cancelling { color: var(--bad); border-color: rgba(255, 125, 115, .45); }
.progress { height: 6px; background: rgba(255, 240, 222, .08); border-radius: 999px; overflow: hidden; margin: 0.75rem 0; }
.progress > span { display: block; height: 100%; background: var(--gold); border-radius: 999px; transition: width .5s ease; }
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.2rem; height: 1.2rem; padding: 0 .35rem;
             background: var(--bad); color: #1a0606; border-radius: 999px; font-size: .7rem; font-weight: 800; line-height: 1; }

/* avatars (account page and menu) */
.avatar-chip { display: inline-flex; align-items: center; justify-content: center; width: 1.6em; height: 1.6em; font-size: 1rem; border-radius: 50%; vertical-align: middle; }
.avatar-v0 { background: rgba(240, 178, 75, .22); } .avatar-v1 { background: rgba(79, 216, 196, .22); }
.avatar-v2 { background: rgba(110, 231, 160, .2); } .avatar-v3 { background: rgba(185, 164, 255, .24); }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; margin: .75rem 0; }
@media (max-width: 560px) { .avatar-grid { grid-template-columns: repeat(4, 1fr); } }
.avatar-grid label { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: var(--r-sm); margin: 0;
                     border: 1px solid var(--line-2); cursor: pointer; font-size: 1.7rem; }
.avatar-grid label:hover { background: rgba(255, 240, 222, .06); }
.avatar-grid input[type=radio], .variant-row input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.avatar-grid label:has(input:checked) { border-color: var(--gold); background: var(--gold-wash); }
.avatar-grid label:has(input:focus-visible), .variant-row label:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.variant-row { display: flex; gap: .5rem; align-items: center; margin: .5rem 0; flex-wrap: wrap; }
.variant-row label { width: 1.8rem; height: 1.8rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
                     cursor: pointer; border: 1px solid var(--line-2); font-size: 0; position: relative; margin: 0; }
.variant-row label:has(input:checked) { border: 2px solid var(--gold); }

/* switch and toggle rows */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: rgba(255, 240, 222, .14); border-radius: 999px; transition: background .2s; cursor: pointer; }
.slider::before { content: ""; position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px;
                  border-radius: 50%; background: #e9e2d6; transition: left .2s var(--ease), background .2s; }
.switch input:checked + .slider { background: var(--gold); }
.switch input:checked + .slider::before { left: 22px; background: var(--gold-ink); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(240, 178, 75, .3); }
.toggle-row { display: flex; align-items: flex-start; gap: .75rem; padding: .8rem .9rem; border-radius: var(--r-sm); background: var(--bg-2);
              border: 1px solid var(--line); margin-top: .6rem; }
.toggle-row label { margin: 0; font-size: .92rem; }
.toggle-row .helper { font-size: .8rem; margin-top: .15rem; }
.toggle-row .grow { flex: 1; }
details.advanced { margin-top: 1.1rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); overflow: hidden; }
details.advanced summary { cursor: pointer; padding: .8rem .95rem; font-weight: 600; font-size: .9rem; color: var(--ink-2); list-style: none;
                           display: flex; align-items: center; gap: .5rem; }
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary::before { content: "▸"; transition: transform .2s; display: inline-block; }
details.advanced[open] summary::before { transform: rotate(90deg); }
details.advanced summary:hover { color: var(--ink); }
details.advanced .inner { padding: 0 .95rem 1rem; }

/* ---------- the wall ---------- */
.wallhead { display: flex; align-items: center; gap: 12px; margin: 34px 0 4px; flex-wrap: wrap; }
.wallhead h2 { font-size: 1.05rem; margin: 0; }
.wallhead .gap { flex: 1; }
.filters { display: inline-flex; gap: 2px; }
.filters a, .filters button { padding: 6px 12px; border-radius: 999px; font-size: .86rem; color: var(--ink-2); text-decoration: none;
                              background: none; border: 0; cursor: pointer; }
.filters a:hover, .filters button:hover { color: var(--ink); }
.filters [aria-pressed="true"], .filters [aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.day { margin: 22px 0 10px; font: 600 .74rem var(--body); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.rowgrid { display: flex; flex-wrap: wrap; gap: 10px; }
.rowgrid::after { content: ""; flex: 100 1 0; }
@media (max-width: 760px) { .rowgrid::after { display: none; } }

.tile { position: relative; flex: var(--ar, 1.7778) 1 calc(var(--ar, 1.7778) * var(--row-h)); height: var(--row-h); min-width: 0;
        border-radius: var(--r-tile); overflow: hidden; background: var(--surface); isolation: isolate;
        transition: transform .35s var(--ease), box-shadow .35s; }
.tile > a.open { position: absolute; inset: 0; z-index: 2; color: inherit; text-decoration: none; }
.tile img, .tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile video { opacity: 0; transition: opacity .3s; }
.tile video.playing { opacity: 1; }
.tile::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
               background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .78)); opacity: 0; transition: opacity .25s; }
.tile:hover, .tile:focus-within { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0, 0, 0, .55); z-index: 2; }
.tile:hover::after, .tile:focus-within::after { opacity: 1; }
.tile .cap { position: absolute; z-index: 3; left: 12px; right: 48px; bottom: 10px; font-size: .88rem; line-height: 1.3; color: #fff;
             opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s var(--ease); pointer-events: none;
             display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile:hover .cap, .tile:focus-within .cap { opacity: 1; transform: none; }
.tile .len { position: absolute; z-index: 3; right: 9px; top: 9px; font: 600 .72rem var(--body); font-variant-numeric: tabular-nums;
             color: #fff; background: rgba(0, 0, 0, .5); padding: 2px 7px; border-radius: 999px; backdrop-filter: blur(6px); pointer-events: none; }
.tile .tag { position: absolute; z-index: 3; left: 9px; top: 9px; font: 600 .72rem var(--body); color: var(--ink); pointer-events: none;
             background: rgba(0, 0, 0, .55); padding: 2px 8px; border-radius: 999px; backdrop-filter: blur(6px); }
.tile .tag.bad { color: #ffd2cd; background: rgba(120, 30, 24, .7); }
/* touch screens can't hover: show the words under the picture instead */
@media (hover: none) {
  .tile::after { opacity: 1; }
  .tile .cap { opacity: 1; transform: none; -webkit-line-clamp: 1; font-size: .8rem; }
}
/* a tile that isn't a finished video: words on a quiet ground */
.tile.plain { display: flex; flex-direction: column; justify-content: flex-end; padding: 14px; background:
  radial-gradient(120% 90% at 20% 10%, rgba(255, 125, 115, .08), transparent 60%), var(--surface); }
.tile.plain .what { position: relative; z-index: 3; font-size: .86rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2;
                    -webkit-box-orient: vertical; overflow: hidden; }
.tile.plain .state { position: relative; z-index: 3; font-family: var(--display); font-weight: 700; font-size: 1.05rem; margin-top: 2px; }
.tile.plain .why { position: relative; z-index: 3; font-size: .8rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.plain::after { display: none; }
.tile .acts { position: absolute; z-index: 4; right: 8px; bottom: 8px; display: flex; gap: 6px; }
.tile .acts form { margin: 0; }
.tile.plain .acts { position: relative; right: auto; bottom: auto; margin-top: 10px; }

/* making: grain that slowly resolves. It reads as "developing" and needs no preview from the server. */
.tile.making { display: flex; flex-direction: column; justify-content: flex-end; padding: 14px; color: var(--ink); }
.tile.making::before { content: ""; position: absolute; inset: -40%; z-index: 0; filter: blur(18px);
  background: radial-gradient(40% 50% at 30% 40%, rgba(240, 178, 75, .32), transparent 70%),
              radial-gradient(45% 45% at 72% 62%, rgba(79, 216, 196, .2), transparent 70%),
              radial-gradient(35% 40% at 55% 25%, rgba(255, 125, 115, .14), transparent 70%);
  animation: drift 9s ease-in-out infinite alternate; }
.tile.making::after { opacity: .5; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay; animation: grain .9s steps(4) infinite; }
.tile.making:hover { transform: none; box-shadow: none; }
.tile.making.waiting::before { animation-duration: 18s; opacity: .55; }
@keyframes drift { to { transform: translate(6%, -5%) rotate(8deg) scale(1.1); } }
@keyframes grain { 25% { background-position: 40px 70px; } 50% { background-position: 110px 20px; } 75% { background-position: 60px 130px; } }
.tile.making > * { position: relative; z-index: 3; }
.tile.making .what { font-size: .82rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile.making .now { font-family: var(--display); font-weight: 700; font-size: 1.12rem; letter-spacing: -.01em; margin-top: 2px; }
.tile.making .eta { font-size: .82rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tile.making .meter { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .08); }
.tile.making .meter i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .6s linear; }
.tile.making .stop { position: absolute; z-index: 4; top: 8px; right: 8px; margin: 0; }
.tile.making .stop button { padding: 4px 10px; border-radius: 999px; font-size: .78rem; color: var(--ink-2); background: rgba(0, 0, 0, .4);
                            border: 0; cursor: pointer; }
.tile.making .stop button:hover { color: #fff; }
.tile.arrive { animation: arrive 1.1s var(--ease); }
.tile.arrive img { animation: develop 1.4s var(--ease); }
@keyframes arrive { 0% { box-shadow: 0 0 0 0 rgba(240, 178, 75, .9); } 100% { box-shadow: 0 0 0 26px rgba(240, 178, 75, 0); } }
@keyframes develop { from { filter: blur(22px) saturate(.3) brightness(1.3); transform: scale(1.08); } }

/* select mode: pick finished videos and move them to the bin */
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; padding: 8px 12px;
            border: 1px solid var(--line-2); border-radius: 14px; background: var(--raised); position: sticky; top: 68px; z-index: 20; }
.bulk-bar label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .86rem; font-weight: 500; cursor: pointer; }
.bulk-bar .count { font-size: .84rem; color: var(--ink-2); margin-right: auto; }
.tile .pick { display: none; position: absolute; top: 8px; left: 8px; z-index: 5; margin: 0; line-height: 0; }
.tile .pick input { width: 1.3rem; height: 1.3rem; cursor: pointer; }
.selecting .tile .pick { display: block; }
.selecting .tile .acts, .selecting .tile .tag { visibility: hidden; }
.selecting .tile:not(.can-select) { opacity: .4; }
.selecting .tile.selected { box-shadow: 0 0 0 3px var(--gold); }
.empty { text-align: center; padding: 56px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-card); }
.empty h2 { font-size: 1.4rem; margin: 0 0 6px; }

/* ---------- the video page ---------- */
.theatre-page { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: calc(100vh - 60px); }
.screen { display: grid; place-items: center; align-content: center; gap: 18px; padding: 28px; min-width: 0; }
.player { width: min(100%, calc((100vh - 200px) * var(--ar, 1.7778))); aspect-ratio: var(--ar, 1.7778); border-radius: 16px; overflow: hidden;
          background: #000 center / cover no-repeat; box-shadow: 0 40px 120px rgba(0, 0, 0, .7); }
.player video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player.plain { display: grid; place-items: center; text-align: center; padding: 24px; position: relative; overflow: hidden;
                background: var(--surface); box-shadow: none; border: 1px solid var(--line); }
.player.plain.making::before { content: ""; position: absolute; inset: -40%; filter: blur(22px);
  background: radial-gradient(40% 50% at 30% 40%, rgba(240, 178, 75, .3), transparent 70%), radial-gradient(45% 45% at 72% 62%, rgba(79, 216, 196, .18), transparent 70%);
  animation: drift 9s ease-in-out infinite alternate; }
.player.plain > * { position: relative; }
.player .big { font-family: var(--display); font-weight: 800; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.02em; }
.player .small { color: var(--ink-2); font-size: .92rem; max-width: 44ch; margin: 6px auto 0; }
.player .meter { width: min(320px, 70%); height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); margin: 16px auto 0; overflow: hidden; }
.player .meter i { display: block; height: 100%; background: var(--gold); transition: width .6s linear; }
.strip { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.take { position: relative; width: 112px; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; opacity: .6; display: block;
        transition: opacity .2s, transform .2s var(--ease); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
.take:hover { opacity: 1; transform: translateY(-2px); }
.take[aria-current="true"] { opacity: 1; outline: 2px solid var(--gold); outline-offset: 2px; }
.take img { width: 100%; height: 100%; object-fit: cover; display: block; }
.take span { position: absolute; left: 6px; bottom: 4px; font: 600 .68rem var(--body); color: #fff; text-shadow: 0 1px 4px #000; }
.side { background: var(--bg-2); border-left: 1px solid var(--line); padding: 26px 26px 30px; min-width: 0; }
.side h1 { font-size: 1.4rem; line-height: 1.2; margin: 0 0 8px; }
.side .meta { color: var(--ink-3); font-size: .86rem; font-variant-numeric: tabular-nums; }
.side .back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: .86rem; text-decoration: none; margin-bottom: 14px; }
.side .back:hover { color: var(--ink); }
.acts2 { display: grid; gap: 8px; margin: 20px 0 6px; }
.acts2 form { margin: 0; }
.act { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border-radius: 14px; background: var(--surface);
       border: 1px solid var(--line); text-align: left; color: var(--ink); text-decoration: none; cursor: pointer; font: inherit;
       transition: background .2s, border-color .2s, transform .15s var(--ease); }
.act:hover { background: var(--raised); border-color: var(--line-2); transform: translateX(2px); color: var(--ink); }
.act svg { color: var(--gold); font-size: 1.1rem; }
.act b { display: block; font-weight: 600; font-size: .95rem; }
.act small { display: block; color: var(--ink-3); font-size: .8rem; }
.act.primary { background: var(--gold); border-color: transparent; color: var(--gold-ink); }
.act.primary svg, .act.primary small { color: inherit; }
.act.primary small { opacity: .72; }
.act.primary:hover { background: var(--gold-2); color: var(--gold-ink); }
.act:disabled, .act[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.recipe { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.recipe summary { list-style: none; cursor: pointer; color: var(--ink-2); font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.recipe summary::-webkit-details-marker { display: none; }
.recipe summary::before { content: "▸"; transition: transform .2s; }
.recipe[open] summary::before { transform: rotate(90deg); }
.recipe dl { margin: 12px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .86rem; }
.recipe dt { color: var(--ink-3); }
.recipe dd { margin: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.quiet { display: flex; gap: 18px; margin-top: 18px; font-size: .86rem; flex-wrap: wrap; }
.quiet form { margin: 0; }
.quiet button, .quiet a { color: var(--ink-3); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; font: inherit; }
.quiet button:hover, .quiet a:hover { color: var(--ink); }
.quiet .del:hover { color: var(--bad); }
@media (max-width: 900px) {
  .theatre-page { grid-template-columns: 1fr; min-height: 0; }
  .screen { padding: 14px 16px 6px; }
  .player { width: min(100%, calc(60vh * var(--ar, 1.7778))); }
  .side { border-left: 0; padding: 18px 16px 30px; }
  .take { width: 84px; }
}

/* ---------- the composer (home) ---------- */
.composer { text-align: left; }
.composer .err { margin: 0 0 12px; }
.c-box { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-card); padding: 12px 12px 10px;
         transition: border-color .2s, box-shadow .2s; }
.c-box:focus-within { border-color: rgba(240, 178, 75, .55); box-shadow: 0 0 0 4px rgba(240, 178, 75, .1); }
.c-box textarea { border: 0; background: transparent; box-shadow: none; padding: 6px 8px; min-height: 4.6rem; font-size: 1.08rem;
                  line-height: 1.45; resize: none; }
.c-box textarea:focus { box-shadow: none; }
.c-attached { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 4px 6px; }
.c-attached:empty { display: none; }
.att { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 12px; background: var(--raised);
       border: 1px solid var(--line); max-width: 100%; font-size: .84rem; }
.att img, .att .wave { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex: none; }
.att .wave { display: grid; place-items: center; background: var(--gold-wash); color: var(--gold); font-size: 1rem; }
.att span { display: grid; min-width: 0; line-height: 1.2; }
.att b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att small { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att button { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 1.1rem; padding: 0 4px; line-height: 1; }
.att button:hover { color: var(--bad); }
.c-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--line); }
.tool { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
        background: transparent; color: var(--ink-2); font: 600 .88rem var(--body); cursor: pointer; transition: background .2s, color .2s; }
.tool:hover { background: var(--raised); color: var(--ink); }
.tool:disabled { opacity: .4; cursor: not-allowed; background: transparent; color: var(--ink-2); }
.tool svg { width: 1.05em; height: 1.05em; }
.c-tools .gap { flex: 1; }
.c-polish { display: inline-flex; align-items: center; gap: 8px; margin: 0 6px 0 0; font-weight: 600; font-size: .86rem; color: var(--ink-2); cursor: pointer; }
.c-dials { display: grid; grid-template-columns: auto auto 1fr; gap: 10px 22px; margin-top: 14px; align-items: start; }
.seg { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg legend { padding: 0; margin-bottom: 6px; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.seg .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { margin: 0; display: grid; gap: 1px; padding: 7px 12px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer;
             font-size: .88rem; font-weight: 600; color: var(--ink-2); background: var(--bg-2); transition: border-color .2s, background .2s, color .2s; }
.seg label small { font-weight: 500; font-size: .74rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { border-color: rgba(240, 178, 75, .65); background: var(--gold-wash); color: var(--ink); }
.seg label:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(240, 178, 75, .3); }
.seg label:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.seg .lock { color: var(--gold); font-size: .7rem; font-weight: 700; }
.seg .shaped { font-size: .86rem; color: var(--ink-2); padding: 8px 2px; }
.c-readback { margin: 14px 2px 0; color: var(--ink-2); font-size: .92rem; min-height: 1.4em; }
.c-readback b { color: var(--ink); font-weight: 600; }
.c-readback .warn { color: var(--bad); }
.c-note { margin: 10px 2px 0; color: var(--ink-2); font-size: .88rem; }
.c-note a { color: var(--ink); }
.tool.see { font-size: .84rem; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }
.composer details.advanced .inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 4px 16px; }
.composer details.advanced label { font-size: .84rem; }
.composer details.advanced .hint { font-size: .78rem; color: var(--ink-3); margin: 4px 0 0; }
@media (max-width: 760px) {
  .c-dials { grid-template-columns: 1fr; }
  .c-tools .btn { flex: 1 0 100%; }
}

/* the picker for pictures, cast and sounds */
dialog.sheet { width: min(720px, calc(100vw - 32px)); max-height: min(80vh, 760px); padding: 0; border: 1px solid var(--line-2);
               border-radius: var(--r-card); background: var(--bg-2); color: var(--ink); box-shadow: 0 40px 120px rgba(0, 0, 0, .7); }
dialog.sheet::backdrop { background: rgba(6, 5, 7, .72); backdrop-filter: blur(6px); }
.sheet-in { display: grid; grid-template-rows: auto 1fr auto; max-height: inherit; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; }
.sheet-head h2 { margin: 0; font-size: 1.15rem; flex: 1; }
.sheet-head p { margin: 2px 0 0; color: var(--ink-3); font-size: .84rem; }
.sheet-body { overflow: auto; padding: 4px 18px 14px; min-height: 120px; }
.sheet-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }
.kg-fields { display: grid; gap: 10px; }
.kg-fields textarea { width: 100%; }
.sheet-foot .gap { flex: 1; }
.sheet-foot .status { color: var(--ink-3); font-size: .84rem; }
.sheet-foot .status.bad { color: var(--bad); }
.pick-h { margin: 14px 0 8px; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.pick { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 2px solid transparent; background: var(--surface);
        cursor: pointer; padding: 0; color: var(--ink); font: inherit; }
.pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: .72rem; font-weight: 600; text-align: left;
             background: linear-gradient(transparent, rgba(0, 0, 0, .75)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick[aria-pressed="true"] { border-color: var(--gold); }
.pick[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
                                    background: var(--gold); color: var(--gold-ink); font-size: .8rem; font-weight: 800; display: grid; place-items: center; }
.pick.sound { aspect-ratio: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: left; border-color: var(--line); }
.pick.sound span { position: static; background: none; padding: 0; font-size: .86rem; }
.pick.sound[aria-pressed="true"] { border-color: var(--gold); }
.pick.sound[aria-pressed="true"]::after { position: static; margin-left: auto; }
.pick-grid.sounds { grid-template-columns: 1fr; }
.pick-add { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--line-2); display: grid; place-items: center; text-align: center;
            color: var(--ink-2); font-size: .8rem; font-weight: 600; cursor: pointer; padding: 8px; margin: 0; }
.pick-add:hover { border-color: var(--gold); color: var(--ink); }
.pick-add input { display: none; }
.pick-grid.sounds .pick-add { aspect-ratio: auto; padding: 14px; }
.sheet .empty-note { color: var(--ink-3); font-size: .88rem; margin: 6px 0; }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(28px + var(--tabbar-h)); transform: translateX(-50%); background: var(--raised);
         border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 18px 8px 8px; display: flex; align-items: center; gap: 10px;
         box-shadow: 0 20px 50px rgba(0, 0, 0, .6); font-size: .92rem; color: var(--ink); text-decoration: none;
         animation: toast .4s var(--ease); max-width: calc(100vw - 32px); }
.toast img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex: none; }
.toast span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes toast { from { transform: translate(-50%, 20px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* --- remaining pages (ui-pages branch) --- */
/* Account, upgrade, bin, cast library, sets and sheets, log in and register, stories, guide and admin pages.
   Only tokens from the top of this file; nothing here is a one-theme colour. Each page has one wrapper class,
   so these rules cannot reach the home page or the video page. */

.card > h2:first-child, .card > .card-head h2 { margin-top: 0; }
.card h3 { font-size: 1rem; margin: 1.1rem 0 0.4rem; }
.card.alert { border-color: rgba(255, 125, 115, .45); background: rgba(255, 125, 115, .07); }
.card.alert.soft { border-color: rgba(240, 178, 75, .4); background: var(--gold-wash); }
.card.danger { border-color: rgba(255, 125, 115, .35); }
.card.danger > h2:first-child, .card.danger > summary { color: var(--bad); }
.card .sub { color: var(--ink-2); }
.page-head .eyebrow a { color: inherit; text-decoration: none; }
.page-head .eyebrow a:hover { color: var(--ink); }
.page-head .actions { margin-top: 0; }
.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 0.9rem; }
.actions form { margin: 0; }
.hint { color: var(--ink-3); font-size: 0.82rem; margin: 0.25rem 0 0; }
.empty-card { text-align: center; padding: 3rem 1rem; border: 1px dashed var(--line-2); border-radius: var(--r-card); color: var(--ink-2); }
.empty-card h2 { margin: 0 0 6px; font-size: 1.3rem; color: var(--ink); }
.empty-card p { max-width: 42ch; margin: 0.5rem auto 1.1rem; }
code { font-size: 0.86em; background: rgba(255, 240, 222, .07); border-radius: 6px; padding: 1px 6px; }

/* the seconds strip (shared by account, upgrade, user detail) */
.credit-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; font-size: 0.86rem; color: var(--ink-2); margin: 0 0 1rem; }
.credit-tier { font-family: var(--display); font-weight: 700; color: var(--ink); }
.credit-win strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.credit-win.empty strong { color: var(--bad); }

/* filter row (bin, dashboard, cast library for admins) */
.filter-bar { display: flex; align-items: center; gap: 0.6rem 0.75rem; flex-wrap: wrap; margin: 0 0 0.6rem; padding: 0.7rem 0.9rem;
              background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.filter-bar.bare { margin: 0; padding: 0; background: none; border: 0; }
.filter-bar label { margin: 0; font: 600 0.74rem var(--body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.filter-bar select { width: auto; max-width: 100%; padding: 0.4rem 0.7rem; font-size: 0.88rem; }
.filter-state { font-size: 0.84rem; color: var(--ink-2); margin: 0 0 0.8rem; }
.filter-state strong { color: var(--ink); font-weight: 600; }

/* ---------- log in, register ---------- */
.auth { max-width: 420px; margin: clamp(8px, 6vh, 64px) auto 0; }
.auth .card { padding: 1.8rem; }
.auth-head { text-align: center; margin-bottom: 1.3rem; }
.auth-mark { width: 48px; height: 48px; border-radius: 15px; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center;
             margin: 0 auto 14px; box-shadow: var(--glow); }
.auth-mark svg { width: 24px; height: 24px; fill: currentColor; }
.auth-head h1 { font-size: 1.8rem; margin: 0; }
.auth-head p { margin: 6px 0 0; }
.auth .btn { margin-top: 1.3rem; }
.auth-foot { text-align: center; margin: 1.3rem 0 0; }

/* ---------- account ---------- */
.acct-head { display: flex; align-items: center; gap: 1rem; margin: 18px 0 20px; }
.acct-head h1 { margin: 0; }
.acct-head .sub { color: var(--ink-2); margin: 0.2rem 0 0; font-size: 0.9rem; }
.acct-head .avatar-chip { font-size: 2rem; flex: none; }
.acct-initial { width: 3.2rem; height: 3.2rem; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--gold-wash);
                color: var(--gold); font-family: var(--display); font-weight: 800; font-size: 1.4rem; }
.acct .avatar-grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); max-width: 540px; }
.acct .avatar-grid .none { font-size: 0.78rem; font-weight: 600; color: var(--ink-2); }
.pw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 0.9rem; }
details.card > summary { cursor: pointer; font-family: var(--display); font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "▸"; transition: transform .2s; }
details.card[open] > summary::before { transform: rotate(90deg); }
details.card[open] > summary { margin-bottom: 0.5rem; }

/* ---------- the bin ---------- */
.bin-list { display: grid; gap: 10px; }
.bin-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.85rem 1rem; cursor: pointer;
            transition: border-color .2s, background .2s; }
.bin-item:hover { border-color: var(--line-2); background: var(--raised); }
.bin-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.bin-badges { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.bin-mode { font-size: 0.78rem; font-weight: 600; color: var(--ink-2); }
.bin-date { font-size: 0.78rem; }
.bin-prompt { margin-top: 0.45rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.bin-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.6rem; flex-wrap: wrap; }
.bin-meta form { margin: 0; }
.owner-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; white-space: nowrap;
               color: var(--live); background: rgba(79, 216, 196, .1); border: 1px solid rgba(79, 216, 196, .32); }

/* ---------- cast library ---------- */
.lib .lib-tools { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.lib .lib-quota { display: flex; align-items: center; gap: 0.7rem; font-size: 0.84rem; color: var(--ink-2); min-width: 0; }
.quota-bar { width: 140px; max-width: 40vw; height: 6px; border-radius: 999px; background: var(--raised); overflow: hidden; flex: none; }
.quota-bar > div { height: 100%; background: var(--gold); transition: width .3s; }
.lib .lib-filters { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pill-toggle { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.38rem 0.8rem; border-radius: 999px; border: 1px solid var(--line);
               background: var(--surface); color: var(--ink-2); font-size: 0.84rem; font-weight: 600; text-decoration: none; }
.pill-toggle:hover { color: var(--ink); border-color: var(--line-2); }
.pill-toggle[aria-pressed="true"] { color: var(--ink); border-color: rgba(240, 178, 75, .55); background: var(--gold-wash); }
.lib .bulk-bar { position: static; margin: 0 0 0.9rem; }
.lib .bulk-bar .select-all { margin: 0; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 0.9rem; grid-auto-flow: row dense; }
.gallery-card { position: relative; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); cursor: pointer;
                transition: border-color .2s, box-shadow .2s; }
.gallery-card:hover { border-color: var(--line-2); }
.gallery-card img, .gallery-card video { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--raised); }
.gallery-card .audio-preview { aspect-ratio: 1; display: flex; flex-direction: column; gap: 0.6rem; align-items: center; justify-content: center;
  background: radial-gradient(90% 70% at 30% 20%, var(--gold-wash), transparent 65%), var(--raised); }
.gallery-card .audio-preview audio { width: 88%; }
.gallery-card .card-meta { padding: 0.5rem 0.65rem 0.6rem; min-width: 0; }
.gallery-card .card-name { font-size: 0.86rem; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-card .card-sub { font-size: 0.74rem; color: var(--ink-3); margin-top: 0.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-card .kind { color: var(--ink-3); font-weight: 500; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; margin-right: 6px; }
.gallery-card .select-wrap { position: absolute; top: 0; left: 0; z-index: 2; padding: 8px; margin: 0; line-height: 0; cursor: pointer; }
.gallery-card .select-cb { margin: 0; width: 22px; height: 22px; cursor: pointer; }
.gallery-card.selected { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(240, 178, 75, .3); }
.gallery-card.set-card { overflow: visible; margin: 8px 8px 0 0;
  box-shadow: 4px -4px 0 -1px var(--surface), 4px -4px 0 0 var(--line), 8px -8px 0 -1px var(--surface), 8px -8px 0 0 var(--line); }
.gallery-card.set-card.selected { box-shadow: 0 0 0 2px rgba(240, 178, 75, .3), 4px -4px 0 -1px var(--surface), 4px -4px 0 0 var(--gold); }
.set-card .set-cover { position: relative; aspect-ratio: 1; border-radius: var(--r-sm) var(--r-sm) 0 0; overflow: hidden; background: var(--raised); }
.set-card .set-cover img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: auto; }
.set-card .set-cover.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; background: var(--line-2); }
.set-card .set-cover .empty-set { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--ink-3); font-size: 0.82rem; text-align: center; padding: 1rem; }
.set-badge { position: absolute; right: 8px; top: 8px; z-index: 1; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
             background: rgba(0, 0, 0, .6); color: #fff; backdrop-filter: blur(6px); }
.set-state { font-size: 0.72rem; }
.set-state.stale { color: var(--gold); }
.set-actions { display: flex; gap: 0.35rem; margin-top: 0.45rem; flex-wrap: wrap; }
.set-actions .btn { padding: 0.25rem 0.7rem; font-size: 0.78rem; }
.set-panel { grid-column: 1 / -1; padding: 0.9rem; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); display: grid; gap: 0.6rem; }
.set-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; font-size: 0.86rem; }
.set-panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.5rem; }
.set-panel-grid figure { margin: 0; min-width: 0; }
.set-panel-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: var(--raised); }
.set-panel-grid figcaption { font-size: 0.7rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 0.15rem; }
.set-panel-grid .is-sheet img { outline: 2px solid var(--gold); outline-offset: -2px; }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; } }

/* ---------- sets and sheets ---------- */
.rs .sheet-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .rs .sheet-layout { grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); } }
.sheet-tips { margin: 0 0 1.25rem; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sheet-tips li { font-size: 0.82rem; color: var(--ink-2); padding: 0.35rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.sheet-tips strong { color: var(--ink); font-weight: 600; }
.rs .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.1rem; min-width: 0; }
.rs .panel h2 { margin: 0 0 0.75rem; font-size: 1.02rem; display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.rs .panel h2 .muted { font-size: 0.8rem; font-weight: 400; font-family: var(--body); }
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.tab { padding: 0.45rem 0.95rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600;
       font-size: 0.88rem; text-decoration: none; }
.tab:hover { color: var(--ink); border-color: var(--line-2); }
.tab[aria-current="page"] { color: var(--ink); border-color: rgba(240, 178, 75, .55); background: var(--gold-wash); }
.rs .pick-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.6rem; }
.pick-card { position: relative; display: flex; flex-direction: column; gap: 0.35rem; padding: 0.35rem; border: 1px solid var(--line); border-radius: var(--r-sm);
             background: var(--raised); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .2s, opacity .2s; }
.pick-card:hover:not(:disabled) { border-color: rgba(240, 178, 75, .55); }
.pick-card:disabled { opacity: 0.4; cursor: not-allowed; }
.pick-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: var(--bg); }
.pick-card.chosen { border: 2px solid var(--gold); padding: calc(0.35rem - 1px); }
.pick-card .badge { position: absolute; top: 8px; right: 8px; min-width: 22px; height: 22px; padding: 0 6px; display: none; align-items: center; justify-content: center;
                    border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-size: 0.72rem; font-weight: 800; }
.pick-card.chosen .badge { display: flex; }
.pick-name { font-size: 0.76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-group { margin-top: 1rem; }
.pick-group > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.6rem; }
.pick-group > summary .muted { font-weight: 400; font-size: 0.8rem; }
/* the sheet is a picture of its own, drawn on white so the panels read the way the model will see them */
.sheet-mock { display: grid; gap: 1.2%; padding: 1.2%; aspect-ratio: 1; width: 100%; max-width: 100%; background: #fff; border-radius: var(--r-sm); margin-bottom: 0.9rem; }
.sheet-mock img { width: 100%; height: 100%; object-fit: contain; min-width: 0; min-height: 0; display: block; }
.sheet-mock-empty { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border: 1.5px dashed var(--line-2); border-radius: var(--r-sm);
                    color: var(--ink-3); font-size: 0.86rem; text-align: center; padding: 1rem; margin-bottom: 0.9rem; }
.sel-list { list-style: none; padding: 0; margin: 0 0 0.9rem; display: grid; gap: 0.4rem; }
.sel-item { display: grid; grid-template-columns: 1.6rem 40px minmax(0, 1fr) auto; gap: 0.55rem; align-items: center; padding: 0.3rem 0.4rem;
            border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raised); }
.sel-item .num { font-weight: 700; text-align: center; color: var(--gold); font-size: 0.85rem; }
.sel-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }
.sel-actions { display: flex; gap: 0.25rem; }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 0.9rem;
            line-height: 1; cursor: pointer; }
.icon-btn:hover:not(:disabled) { border-color: var(--gold); }
.icon-btn.rm:hover:not(:disabled) { border-color: var(--bad); color: var(--bad); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.sheet-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.85rem; }
.sheet-actions .btn { flex: 1 1 140px; }
.preview-item img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; border-radius: var(--r-sm); margin-bottom: 0.6rem; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; text-align: center; padding: 2rem 1rem;
            border: 1.5px dashed var(--line-2); border-radius: var(--r-card); background: var(--raised); color: var(--ink-2); transition: border-color .2s, background .2s; }
.dropzone.compact { padding: 1rem; flex-direction: row; flex-wrap: wrap; }
.dropzone.over { border-color: var(--gold); background: var(--gold-wash); color: var(--ink); }
.dropzone .big { font-size: 1.05rem; color: var(--ink); font-weight: 600; }
.dropzone[aria-disabled="true"] { opacity: 0.55; }
.up-list { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.3rem; font-size: 0.84rem; }
.up-list li { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.3rem 0.5rem; border-radius: 6px; background: var(--raised); }
.up-list .st { white-space: nowrap; color: var(--ink-2); }
.up-list .st.ok { color: var(--good); }
.up-list .st.bad { color: var(--bad); white-space: normal; text-align: right; }
.sets-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.6rem; margin: 0.4rem 0 0; }
.set-chip { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.35rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raised);
            color: var(--ink); text-decoration: none; }
.set-chip:hover { border-color: var(--line-2); color: var(--ink); }
.set-chip .cover { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--bg); display: grid; grid-template-columns: 1fr 1fr; gap: 1px; }
.set-chip .cover.one { grid-template-columns: 1fr; }
.set-chip .cover img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; }
.set-chip .nm { font-size: 0.76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-chip .sub { font-size: 0.7rem; color: var(--ink-3); }
.set-name-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.9rem; flex-wrap: wrap; }
.set-name-row input { flex: 1 1 200px; }
.sheet-state { font-size: 0.84rem; margin: 0 0 0.6rem; }
.sheet-state.stale { color: var(--gold); }
.tuck { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0.8rem 0 0; font-size: 0.85rem; font-weight: 500; cursor: pointer; }
.tuck input { margin-top: 0.2rem; }
.tuck .hint { display: block; color: var(--ink-3); font-size: 0.78rem; }
.danger-zone { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.member-actions { flex-wrap: wrap; justify-content: flex-end; }
.member-actions .move-out { padding: 0.3rem 0.5rem; font-size: 0.75rem; }
.rs .small { font-size: 0.8rem; }
@media (max-width: 600px) {
  #member-list .sel-item { grid-template-columns: 1.6rem 40px minmax(0, 1fr); }
  .member-actions { grid-column: 2 / -1; justify-content: flex-start; }
}

/* ---------- stories ---------- */
.story-form { display: grid; gap: 0.9rem; }
.story-form .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.9rem; }
.story-form .two label { margin-top: 0; }
.story-form textarea#story_text { min-height: 14rem; line-height: 1.5; }
.story-form label { margin-top: 0; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.75rem; }
.ref-pick { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.5rem; display: grid; gap: 0.4rem; background: var(--surface); min-width: 0; }
.ref-pick.on { border-color: rgba(240, 178, 75, .65); background: var(--gold-wash); }
.ref-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--raised); }
.ref-pick label { display: flex; gap: 0.4rem; align-items: center; font-size: 0.85rem; margin: 0; overflow-wrap: anywhere; }
.ref-pick input[type=text], .ref-pick select { padding: 0.3rem 0.45rem; font-size: 0.85rem; }
.ref-fields { display: grid; gap: 0.4rem; }
.ref-set { margin-top: 0.9rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); }
.ref-set > summary { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; cursor: pointer; font-weight: 600; list-style: none; }
.ref-set > summary::-webkit-details-marker { display: none; }
.ref-set > summary img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; }
.ref-set > summary::after { content: "▸"; margin-left: auto; transition: transform .2s; }
.ref-set[open] > summary::after { transform: rotate(90deg); }
.ref-set > summary span { overflow-wrap: anywhere; }
.ref-set .ref-grid { margin-top: 0.75rem; }
.ref-set-count, .ref-note { font-size: 0.78rem; color: var(--ink-3); font-weight: 500; }
.ref-note.stale { color: var(--gold); }
.ref-set .edit-set { display: inline-block; margin-top: 0.6rem; color: var(--ink-2); font-size: 0.86rem; }
.story-list td { vertical-align: top; }
.wide-scroll { overflow-x: auto; }
.mini-poster { width: 3rem; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 6px; display: block; background: var(--surface); }
.status-pill, .story-page .pill { display: inline-block; font-size: 0.78rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); }
.story-page .pill.busy { color: var(--live); border-color: rgba(79, 216, 196, .45); background: rgba(79, 216, 196, .1); }
.story-page .pill.done { color: var(--good); border-color: rgba(110, 231, 160, .35); background: rgba(110, 231, 160, .08); }
.story-page .pill.failed { color: var(--bad); border-color: rgba(255, 125, 115, .4); background: rgba(255, 125, 115, .1); }
.story-page .st-head { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.story-page .st-head h1 { margin: 0; }
.findings { display: grid; gap: 0.35rem; margin: 0.5rem 0 0; padding: 0; list-style: none; }
.findings li { padding: 0.5rem 0.7rem; border-radius: 10px; background: var(--bg-2); border-left: 3px solid var(--warn); font-size: 0.9rem; }
.findings li.error { border-left-color: var(--bad); }
.findings code { color: var(--ink-3); font-size: 0.8rem; }
.story-page .scene { margin: 1rem 0 0; }
.story-page .scene h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.shot-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.shot-table th, .shot-table td { text-align: left; padding: 0.5rem 0.5rem; border-top: 1px solid var(--line); border-bottom: 0; vertical-align: top; }
.shot-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.story-page .card .shot-table, .story-page .wide-scroll .shot-table { display: table; white-space: normal; overflow: visible; }
.beat { display: block; color: var(--ink-2); }
.beat .line { color: var(--ink); }
.story-page .cast { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.story-page .cast span { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.story-page textarea#sb-json { min-height: 22rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }
.story-page details > summary { cursor: pointer; color: var(--ink-2); }
.story-page pre.prompt { white-space: pre-wrap; font-size: 0.8rem; background: var(--bg-2); padding: 0.75rem; border-radius: 10px; max-height: 24rem; overflow: auto; }
.story-page #result { width: 100%; max-width: 100%; border-radius: var(--r-sm); background: #000; }
.story-page .story-text { white-space: pre-wrap; max-height: 16rem; overflow: auto; color: var(--ink-2); margin-top: 0.6rem; }
.story-page .actions label { display: flex; gap: 0.4rem; align-items: center; margin: 0; }
.story-page .actions input[type=number] { width: 4.5rem; }

/* ---------- the guide to pictures and cast ---------- */
.guide .help-toc { position: sticky; top: 4rem; z-index: 5; display: flex; flex-wrap: wrap; gap: 0.4rem 0.65rem; padding: 0.6rem 0.8rem; margin: 1rem 0 0;
                   background: rgba(23, 20, 26, .85); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 0.84rem;
                   backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.guide .help-toc a { color: var(--ink-2); font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 8px; text-decoration: none; }
.guide .help-toc a:hover { color: var(--ink); background: rgba(255, 240, 222, .06); }
.help-sep { border: 0; border-top: 1px solid var(--line); margin: 1.6rem 0; }
.guide section h2 { scroll-margin-top: 7rem; margin-top: 0; }
.help-quick-table { margin: 0.6rem 0 0; font-size: 0.88rem; }
.help-quick-table td { line-height: 1.4; }
.help-mode-grid, .help-coming-grid { display: grid; gap: 0.65rem; margin: 0.75rem 0; }
.help-mode-card, .help-coming-card { padding: 0.8rem 0.95rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); }
.help-mode-card h3, .help-coming-card h3 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.help-mode-card p, .help-coming-card p { margin: 0; font-size: 0.88rem; }
.help-coming-card { border-style: dashed; }
.help-coming-card.live { border-style: solid; }
.help-callout { margin: 1rem 0; padding: 0.75rem 0.95rem; border: 1px solid var(--line-2); border-left: 3px solid var(--gold); border-radius: var(--r-sm);
                background: var(--gold-wash); font-size: 0.88rem; }
.help-callout.info { border-left-color: var(--live); background: rgba(79, 216, 196, .07); }
.help-checklist { list-style: none; padding-left: 0; margin: 0.6rem 0; }
.help-checklist li { padding: 0.3rem 0 0.3rem 1.3rem; font-size: 0.9rem; position: relative; }
.help-checklist li::before { content: ""; position: absolute; left: 0; top: 0.85em; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.help-checklist.avoid li::before { background: var(--bad); }
.help-checklist.steps { counter-reset: step; }
.help-checklist.steps li::before { counter-increment: step; content: counter(step); width: auto; height: auto; background: none; top: 0.3rem; color: var(--gold);
                                   font: 700 0.85rem var(--display); }
@media (min-width: 700px) { .help-mode-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .guide .help-toc { position: static; } .help-quick-table { font-size: 0.8rem; } }

/* ---------- admin ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 1rem 1.1rem; min-width: 0; }
.stat-label { font: 600 0.74rem var(--body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin: 0 0 0.35rem; }
.stat-value { font-family: var(--display); font-size: 1.9rem; font-weight: 800; line-height: 1.1; margin: 0; overflow-wrap: anywhere; }
.stat-value.t-good { color: var(--good); }
.stat-value.t-warn { color: var(--warn); }
.stat-value.t-info { color: var(--live); }
.stat-value.t-bad { color: var(--bad); }
.stat-value.small { font-size: 1.1rem; }
.stat-sub { font-size: 0.82rem; color: var(--ink-2); margin: 0.3rem 0 0; }
.vram-bar { height: 8px; background: rgba(255, 240, 222, .08); border-radius: 999px; overflow: hidden; margin-top: 0.6rem; }
.vram-bar > span { display: block; height: 100%; background: var(--gold); border-radius: 999px; transition: width .5s; }
.dash-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.4rem; margin-bottom: 1.2rem; }
.dash-section > h2:first-child { margin-top: 0; font-size: 1.15rem; }
.dash-section h2 .muted { font-size: 0.86rem; font-weight: 500; font-family: var(--body); }
.dash-section h3 { font-size: 1rem; margin: 1rem 0 0.6rem; }
.dash-section.alert { border-color: rgba(255, 125, 115, .5); background: rgba(255, 125, 115, .07); }
.dash-section.alert .t { margin: 0; font-weight: 700; color: var(--bad); }
.dash-section.alert .t.warn { color: var(--warn); }
.dash-section .note-line { margin: 0.35rem 0 0; font-size: 0.86rem; color: var(--ink-2); overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 480px; }
.dash-section .table-wrap table { display: table; white-space: normal; overflow: visible; }
.prompt-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 0.85rem; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.4rem; vertical-align: middle; }
.status-dot.good { background: var(--good); }
.status-dot.busy { background: var(--live); animation: ping 1.8s var(--ease) infinite; }
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
.story-tile { display: flex; flex-direction: column; gap: 0.35rem; color: inherit; text-decoration: none; min-width: 0; }
.story-tile img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s; }
.story-tile:hover img { border-color: var(--gold); }
.story-tile-meta { font-size: 0.8rem; line-height: 1.3; overflow-wrap: anywhere; }
.rowform { display: flex; gap: 0.9rem; align-items: flex-end; flex-wrap: wrap; margin-top: 0.6rem; }
.rowform > div { flex: 1; min-width: 150px; }
.rowform .btn { margin-bottom: 1px; }
.radio-line { display: flex; gap: 0.5rem; align-items: center; font-weight: 500; margin: 0.4rem 0; }
.kv th { width: 9rem; text-transform: none; letter-spacing: 0; font-size: 0.88rem; font-weight: 600; color: var(--ink-2); }
@media (max-width: 760px) { .dash-section { padding: 1.1rem; } .kv th { width: 7rem; } }
.story-page details.edit-json { margin-top: 1rem; }
.dash-section .dash-grid { margin-bottom: 0; }
.dash-section > h2 + .dash-grid, .dash-section > .hint + .dash-grid { margin-top: 0.8rem; }
@media (max-width: 760px) { .card table.kv { display: table; } }
.rs .panel > input[type=text] { margin-bottom: 0.8rem; }
.story-page .wide-scroll .shot-table { min-width: 560px; }
.story-page .actions label input[type=number] { margin: 0; }
.guide .help-quick-table { display: table; white-space: normal; overflow: visible; }
.guide > .muted:first-child { margin: 0 0 1rem; }
tr:last-child th { border-bottom: 0; }
