@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/dm-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url(../fonts/fraunces-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(../fonts/fraunces-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* ==========================================================================
   GenieStudio app — styles (mobile-first). Same palette and type as the landing site.
   ========================================================================== */
:root {
  --bg: #0A0820; --bg-2: #120E33; --bg-3: #1B1550; --indigo: #2A1F7A; --violet: #6A4CFF;
  --gold: #F0B44A; --gold-2: #FFD98A; --gold-3: #C98A1E; --ember: #F26B4E; --mint: #7EE0C8;
  --ink: #F4ECD8; --ink-2: #D9D0BC; --ink-3: #A99FCF;
  --line: rgba(244,236,216,.10); --line-2: rgba(244,236,216,.20);
  --glass: rgba(255,255,255,.035); --glass-2: rgba(255,255,255,.06); --glass-3: rgba(255,255,255,.09);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 14px; --r-lg: 22px; --r-xl: 30px; --side-w: 272px; --top-h: 60px;
  --ease: cubic-bezier(.22,.61,.36,1); --ease-out: cubic-bezier(.16,1,.3,1);
  --shadow-gold: 0 14px 40px -14px rgba(240,180,74,.7);
  --shadow: 0 20px 60px -20px rgba(0,0,0,.6);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 15.5px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; overflow-x: clip; animation: pagein .5s ease-out both; }
/* 16.2: "clip" (not "hidden") keeps the page from scrolling sideways without making body a scroll box, so the sticky header and install bar really stay on top. Older browsers keep "hidden". */
html { overflow-x: hidden; }
@keyframes pagein { from { opacity: 0; } }
img, svg:not(.ic) { display: block; max-width: 100%; }
svg.ic { display: inline-block; vertical-align: -.2em; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.h3 > svg.ic:first-child, .h4 > svg.ic:first-child, .h5 > svg.ic:first-child { margin-right: 6px; }
svg.ic.big { width: 40px; height: 40px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, h5, p, ul, ol, dl, figure { margin: 0; }
[hidden] { display: none !important; }
ul, ol { padding: 0; list-style: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; background: var(--glass-2); padding: 2px 6px; border-radius: 6px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 6px; }
.h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.6rem, 3.6vw, 2.1rem); line-height: 1.1; letter-spacing: -.02em; }
.h3 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.3rem, 2.6vw, 1.6rem); line-height: 1.15; letter-spacing: -.015em; }
.h4 { font-family: var(--font-display); font-weight: 500; font-size: 1.2rem; line-height: 1.2; }
.h5 { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.small { font-size: .86rem; } .tiny { font-size: .78rem; } .center { text-align: center; } .mt { margin-top: 14px; }
.bad { color: #FF9A86; } .good { color: var(--mint); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; }
.ell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { color: var(--gold); font-weight: 600; } .link:hover { color: var(--gold-2); }
.inline { display: inline; }
.narrow { max-width: 640px; }
.brand-mark { width: 26px; height: 26px; color: var(--gold); stroke: var(--gold); fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Atmosphere ---------- */
.aurora { position: fixed; inset: -20%; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora i { position: absolute; border-radius: 50%; opacity: .5; will-change: transform; animation: drift 26s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 70vmax; height: 70vmax; left: -15%; top: -25%; background: radial-gradient(circle at 40% 40%, rgba(106,76,255,.6), transparent 60%); }
.aurora i:nth-child(2) { width: 55vmax; height: 55vmax; right: -20%; top: -10%; background: radial-gradient(circle, rgba(240,180,74,.38), rgba(242,107,78,.16) 45%, transparent 66%); animation-delay: -8s; }
.aurora i:nth-child(3) { width: 50vmax; height: 50vmax; left: 15%; bottom: -35%; background: radial-gradient(circle, rgba(126,224,200,.22), transparent 60%); animation-delay: -16s; }
@keyframes drift { to { transform: translate3d(4%, 6%, 0) scale(1.08); } }
.stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; background-image: radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.5) 50%, transparent 51%), radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,.4) 50%, transparent 51%), radial-gradient(1.5px 1.5px at 40% 80%, rgba(255,217,138,.5) 50%, transparent 51%), radial-gradient(1px 1px at 85% 65%, rgba(255,255,255,.35) 50%, transparent 51%), radial-gradient(1px 1px at 10% 70%, rgba(255,255,255,.3) 50%, transparent 51%), radial-gradient(1.5px 1.5px at 60% 50%, rgba(255,255,255,.35) 50%, transparent 51%); background-size: 600px 600px; animation: twinkle 6s ease-in-out infinite alternate; }
@keyframes twinkle { to { opacity: .55; } }
.lamp { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(240,180,74,.28), rgba(240,180,74,.05) 70%); position: relative; }
.lamp svg { width: 30px; height: 30px; color: var(--gold); stroke: var(--gold); fill: none; stroke-width: 1.75; filter: drop-shadow(0 0 14px rgba(240,180,74,.8)); animation: lampFloat 4s ease-in-out infinite; }
.lamp.big { width: 90px; height: 90px; } .lamp.big svg { width: 48px; height: 48px; }
@keyframes lampFloat { 50% { transform: translateY(-4px) rotate(8deg); } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: .95rem; line-height: 1; border: 1px solid transparent; transition: transform .25s var(--ease-out), box-shadow .25s, background .25s, border-color .25s, color .25s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-gold { background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, var(--gold-3)); color: #2A1B05; box-shadow: var(--shadow-gold); }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 18px 44px -14px rgba(240,180,74,.85); }
.btn-outline { border-color: var(--line-2); background: var(--glass); color: var(--ink); }
.btn-outline:hover { background: var(--glass-2); border-color: rgba(244,236,216,.35); }
.btn-ghost { color: var(--ink-2); } .btn-ghost:hover { background: var(--glass); color: var(--ink); }
.btn.danger { color: #FF9A86; } .btn.danger:hover { background: rgba(242,107,78,.12); }
.btn-sm { padding: 8px 14px; font-size: .86rem; } .btn-xs { padding: 5px 10px; font-size: .78rem; } .btn-lg { padding: 14px 24px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn.loading svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); position: relative; transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--glass-2); color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; }
.chip-warn { background: rgba(240,180,74,.15); border-color: rgba(240,180,74,.4); color: var(--gold-2); }
.tag { display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; background: var(--glass-2); color: var(--ink-3); vertical-align: middle; }
.tag.bad { background: rgba(242,107,78,.15); color: #FF9A86; }
.nav-count { margin-left: auto; min-width: 22px; text-align: center; font-size: .72rem; font-weight: 700; font-style: normal; background: var(--gold); color: #2A1B05; padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.badge { position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--ember); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; font-style: normal; }
.status { display: inline-block; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; background: var(--glass-2); color: var(--ink-3); white-space: nowrap; }
.st-ready, .st-paid, .st-active { background: rgba(126,224,200,.15); color: var(--mint); }
.st-processing, .st-submitted, .st-downloading, .st-queued, .st-pending_manual { background: rgba(240,180,74,.15); color: var(--gold-2); }
.st-failed, .st-cancelled, .st-rejected, .st-refunded, .st-past_due { background: rgba(242,107,78,.15); color: #FF9A86; }
.st-off { background: var(--glass); color: var(--ink-3); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.field > span { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.field small { font-weight: 400; }
.field-aside { font-weight: 500; color: var(--gold); font-size: .82rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="search"], input[type="file"], input[type="date"], input[type="datetime-local"], input[type="time"], input[type="tel"], textarea, .select {
  width: 100%; font: inherit; font-size: .98rem; color: var(--ink); background: rgba(10,8,32,.55); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; transition: border-color .2s, box-shadow .2s, background .2s; -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: rgba(169,159,207,.7); }
input:focus, textarea:focus, .select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(240,180,74,.15); background: rgba(10,8,32,.8); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A99FCF' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; cursor: pointer; }
.select option { background: var(--bg-2); color: var(--ink); }
input[type="file"] { padding: 9px 12px; }
:root { color-scheme: dark; } :root[data-theme="light"] { color-scheme: light; }
input[type="file"]::file-selector-button { font: inherit; background: var(--glass-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; margin-right: 10px; cursor: pointer; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-3); }
.pw-eye:hover { color: var(--ink); background: var(--glass-2); }
.strength { display: flex; gap: 4px; height: 4px; margin-top: 2px; }
.strength i { flex: 1; border-radius: 2px; background: var(--glass-2); transition: background .3s; }
.strength.s1 i:nth-child(-n+1) { background: var(--ember); } .strength.s2 i:nth-child(-n+2) { background: var(--gold); } .strength.s3 i:nth-child(-n+3) { background: var(--gold-2); } .strength.s4 i { background: var(--mint); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--gold); flex: none; }
.check.big { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--glass); }
.check.big input { width: 20px; height: 20px; }
.switch { width: 46px; height: 26px; border-radius: 999px; background: var(--glass-3); border: 1px solid var(--line-2); position: relative; transition: background .25s; flex: none; }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-3); transition: transform .25s var(--ease-out), background .25s; }
.switch.on { background: rgba(126,224,200,.3); border-color: rgba(126,224,200,.5); } .switch.on i { transform: translateX(20px); background: var(--mint); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-inline input { width: auto; flex: 1; min-width: 180px; }
.hint { font-size: .84rem; color: var(--ink-3); background: var(--glass); border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px 14px; line-height: 1.55; }
.hint code { color: var(--gold-2); word-break: break-all; }

/* ---------- Cards, grids, tables ---------- */
.card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.card + .card, .card + .two-col, .two-col + .card, .two-col + .two-col, section + section, .stats + .two-col, .stats + .card, .three-col + .two-col, .bill-grid + section, .plans-section + section, .lib-bar + .card, .page-head + .card, .flash + .stats, .flash + .prov-grid, .prov-grid + .card, .tabs-settings + .form { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card > .h4 { margin-bottom: 12px; }
.two-col, .three-col { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.two-col.tight { gap: 12px; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.stat, .stat-card { display: grid; gap: 4px; align-content: start; padding: 16px 18px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .2s, transform .25s var(--ease-out); }
a.stat:hover { border-color: var(--line-2); transform: translateY(-2px); }
.stat.bad { border-color: rgba(242,107,78,.35); } .stat.warn { border-color: rgba(240,180,74,.4); }
.stat-label { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.stat-big { font-family: var(--font-display); font-size: 2rem; line-height: 1; font-weight: 500; color: var(--ink); }
.stat-big small { font-size: 1rem; color: var(--ink-3); margin-left: 4px; }
.stat-big.stat-text { font-size: 1.5rem; }
.stat-sub { font-size: .82rem; color: var(--ink-3); }
.stat-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.bill-grid { display: grid; gap: 12px; }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -8px; padding: 0 8px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td { padding: 8px 10px; }
.table.compact td:last-child { white-space: nowrap; }
.table a { color: var(--gold-2); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; white-space: nowrap; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: .9rem; margin-bottom: 14px; }
.dl dt { color: var(--ink-3); font-weight: 600; } .dl dd { margin: 0; word-break: break-word; }
.meter { height: 6px; border-radius: 3px; background: var(--glass-3); overflow: hidden; margin: 8px 0; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-3), var(--gold-2)); border-radius: 3px; transition: width .6s var(--ease-out); }
.ledger li { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.ledger li:last-child { border: 0; }
.ledger .plus { color: var(--mint); font-weight: 700; } .ledger .minus { color: var(--ink-3); font-weight: 700; }
.ledger time { font-size: .8rem; color: var(--ink-3); }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pager a { padding: 6px 12px; border-radius: 8px; background: var(--glass); border: 1px solid var(--line); font-size: .86rem; }
.pager a.on { background: var(--gold); color: #2A1B05; border-color: transparent; font-weight: 700; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 8px 13px; border-radius: 999px; font-size: .88rem; font-weight: 600; color: var(--ink-3); transition: background .2s, color .2s; }
.tabs a:hover { background: var(--glass); color: var(--ink); }
.tabs a.on { background: var(--glass-3); color: var(--ink); }
.tabs a b { font-weight: 600; opacity: .6; font-size: .8em; }
.tabs-settings { margin-bottom: 4px; }
.tabs + .card, .tabs + .empty, .tabs + .table, .tabs + .tscroll { margin-top: 14px; }
/* Items side by side in a grid never get the stacking margin above (keeps rows level). */
:is(.two-col, .three-col, .bill-grid, .conn-grid, .stats, .topups, .pw-plans) > :is(.card, section, .stat) { margin-top: 0; }
section + .two-col, section + .stats, .stats + .three-col, .stats + .stats { margin-top: 18px; }
.flash + .flash { margin-top: 10px; }
.pw-plans + .tiny { margin-top: 14px; }
.lib-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 18px 0; }
.search { display: flex; align-items: center; gap: 8px; background: rgba(10,8,32,.55); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 14px; color: var(--ink-3); flex: 1; min-width: 200px; max-width: 340px; }
.search input { border: 0; background: none; padding: 10px 0; box-shadow: none !important; }
.spark { display: flex; gap: 4px; align-items: flex-end; height: 80px; }
.spark i { flex: 1; background: linear-gradient(180deg, var(--gold-2), var(--gold-3)); border-radius: 3px 3px 0 0; min-width: 6px; }
.bars { display: flex; gap: 6px; align-items: flex-end; height: 150px; }
.bar-col { flex: 1; max-width: 64px; display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; font-size: .7rem; color: var(--ink-3); }
.bar-col i { align-self: end; display: block; background: rgba(242,107,78,.45); border-radius: 4px 4px 0 0; position: relative; overflow: hidden; }
.bar-col i b { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(180deg, var(--gold-2), var(--gold-3)); }
.plist li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plist li:last-child { border: 0; }
.pl-name { display: grid; } .pl-name small { color: var(--ink-3); font-size: .8rem; }
.pl-state { margin-left: auto; text-align: right; max-width: 45%; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: none; display: inline-block; }
.dot.ready { background: var(--mint); box-shadow: 0 0 8px rgba(126,224,200,.8); }
.dot.processing, .dot.queued, .dot.submitted, .dot.downloading { background: var(--gold); animation: pulse 1.6s ease-in-out infinite; }
.dot.failed, .dot.cancelled { background: var(--ember); } .dot.off { background: rgba(169,159,207,.4); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Flash & toasts ---------- */
.flashes { padding: 14px 16px 0; display: grid; gap: 8px; }
.flash { position: relative; padding: 12px 40px 12px 16px; border-radius: 12px; font-size: .92rem; background: var(--glass-2); border: 1px solid var(--line-2); line-height: 1.5; animation: rise .4s var(--ease-out) both; }
.flash-success { background: rgba(126,224,200,.12); border-color: rgba(126,224,200,.35); }
.flash-error, .flash-warning { background: rgba(242,107,78,.12); border-color: rgba(242,107,78,.35); }
.flash-warning { background: rgba(240,180,74,.12); border-color: rgba(240,180,74,.4); }
.flash-info { background: rgba(106,76,255,.14); border-color: rgba(106,76,255,.4); }
.flash code { background: rgba(0,0,0,.3); overflow-wrap: anywhere; }
.flash-x { position: absolute; right: 8px; top: 6px; width: 28px; height: 28px; font-size: 20px; line-height: 1; color: var(--ink-3); border-radius: 8px; }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 16px; font-size: .92rem; box-shadow: var(--shadow); animation: rise .35s var(--ease-out) both; display: flex; gap: 10px; align-items: center; }
.toast.ok { border-color: rgba(126,224,200,.5); } .toast.err { border-color: rgba(242,107,78,.5); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Shell ---------- */
.shell { position: relative; z-index: 1; min-height: 100vh; display: flex; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--top-h); display: flex; align-items: center; gap: 8px; padding: 0 12px 0 8px; border-bottom: 1px solid var(--line); background: rgba(10,8,32,.65); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 30; }
.topbar-title { font-weight: 600; font-size: .95rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; letter-spacing: -.01em; }
.brand-mobile { display: inline-flex; } .brand-mobile span { display: none; }
.content { padding: 18px 16px 60px; flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: linear-gradient(135deg, var(--violet), var(--indigo)); color: #fff; flex: none; }
.avatar-link { transition: transform .2s; } .avatar-link:hover { transform: scale(1.06); }
.announce { position: relative; z-index: 2; background: linear-gradient(90deg, rgba(240,180,74,.25), rgba(106,76,255,.25)); border-bottom: 1px solid var(--line); text-align: center; padding: 8px 16px; font-size: .88rem; }
.announce a { color: var(--gold-2); font-weight: 600; margin-left: 6px; }

/* Sidebar */
.side { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(var(--side-w), 86vw); background: rgba(14,11,40,.97); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 14px 16px; gap: 14px; transform: translateX(-104%); transition: transform .35s var(--ease-out); overflow-y: auto; }
body.side-open .side { transform: none; box-shadow: var(--shadow); }
.side-backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(4,3,14,.6); opacity: 0; pointer-events: none; transition: opacity .3s; }
body.side-open .side-backdrop { opacity: 1; pointer-events: auto; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.side-close { display: grid; }
.new-video { margin: 0 2px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a, .side-nav-link { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; font-weight: 600; font-size: .94rem; color: var(--ink-2); transition: background .2s, color .2s; }
.side-nav a:hover, .side-nav-link:hover { background: var(--glass-2); color: var(--ink); }
.side-nav a.on { background: rgba(240,180,74,.14); color: var(--gold-2); }
.side-nav a.on svg { color: var(--gold); }
.side-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 0 12px; margin-bottom: 6px; }
.side-recent { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }  /* a long list scrolls inside, never over the minutes card */
.side-recent ul { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.side-recent li { min-width: 0; }
.side-recent a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; font-size: .88rem; color: var(--ink-2); }
.side-recent a:hover, .side-recent a.on { background: var(--glass-2); color: var(--ink); }
.side-recent .t { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-more { display: block; padding: 8px 12px; font-size: .82rem; color: var(--gold); font-weight: 600; }
.side-foot { display: grid; gap: 10px; margin-top: auto; }
.minutes-card { background: linear-gradient(160deg, rgba(240,180,74,.14), rgba(106,76,255,.14)); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.mc-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.mc-top strong { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); font-weight: 500; }
.mc-sub { font-size: .78rem; color: var(--ink-3); margin-bottom: 6px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; }
.side-user:hover { background: var(--glass-2); }
.su-name { display: grid; font-size: .9rem; font-weight: 600; min-width: 0; }
.su-name small { font-weight: 400; color: var(--ink-3); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-admin { font-family: var(--font-body); font-style: normal; font-size: .62rem; font-weight: 800; letter-spacing: .1em; padding: 2px 6px; border-radius: 6px; background: var(--gold); color: #2A1B05; margin-left: 2px; }
.cron-state { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--ink-3); padding: 8px 12px; border-radius: 10px; background: var(--glass); }
.cron-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); flex: none; }
.cron-state.ok i { background: var(--mint); box-shadow: 0 0 8px rgba(126,224,200,.8); }

/* Notifications */
.notif { position: relative; }
.notif-panel { position: absolute; right: 0; top: 46px; width: min(360px, calc(100vw - 24px)); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); z-index: 50; animation: rise .25s var(--ease-out) both; }
.np-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.np-head .link { font-size: .8rem; }
.np-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.np-list .muted { padding: 16px; text-align: center; font-size: .88rem; }
.np-item { display: grid; gap: 2px; padding: 10px 10px 10px 22px; border-radius: 10px; font-size: .86rem; position: relative; }
.np-item:hover { background: var(--glass-2); }
.np-item::before { content: ""; position: absolute; left: 8px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); opacity: .35; }
.np-item.unread::before { background: var(--gold); opacity: 1; box-shadow: 0 0 8px rgba(240,180,74,.8); }
.np-item.k-success::before { background: var(--mint); } .np-item.k-warning::before { background: var(--ember); }
.np-item span { color: var(--ink-3); } .np-item time { font-size: .74rem; color: var(--ink-3); }

/* ---------- Page bits ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.page-head p { margin-top: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: .88rem; font-weight: 600; margin-bottom: 12px; }
.back:hover { color: var(--ink); }
.empty { text-align: center; padding: 50px 20px; display: grid; justify-items: center; gap: 12px; }

/* ---------- Studio ---------- */
.studio { display: grid; gap: 28px; }
.composer-wrap { display: grid; gap: 22px; max-width: 860px; margin: 0 auto; width: 100%; }
.greet { display: grid; justify-items: center; text-align: center; gap: 14px; padding-top: 18px; }
.greet h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 5vw, 2.6rem); line-height: 1.1; letter-spacing: -.02em; animation: rise .6s var(--ease-out) both; }
.greet h1 em { font-style: italic; color: var(--gold-2); }
.composer { display: grid; gap: 14px; }
.composer-box { position: relative; background: rgba(18,14,51,.75); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 8px 8px 8px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.05); transition: border-color .25s, box-shadow .25s; animation: rise .6s .08s var(--ease-out) both; }
.composer-box::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(120deg, rgba(240,180,74,.6), rgba(106,76,255,.5), rgba(126,224,200,.4)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .3s; pointer-events: none; }
.composer-box.focus::before, .composer-box:focus-within::before { opacity: 1; }
.composer-box textarea { border: 0; background: none; box-shadow: none !important; font-family: var(--font-display); font-size: 1.15rem; line-height: 1.4; padding: 16px 16px 8px; min-height: 92px; max-height: 50vh; resize: none; color: var(--ink); }
.composer-box textarea::placeholder { color: rgba(169,159,207,.65); font-style: italic; }
.composer-tools { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px; }
.tool { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 7px 11px; border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--ink-2); background: var(--glass); border: 1px solid var(--line); transition: background .2s, color .2s; }
.tool:hover { background: var(--glass-3); color: var(--gold-2); }
.tool.loading svg { animation: spin 1s linear infinite; }
.count { margin-left: auto; font-size: .76rem; color: var(--ink-3); white-space: nowrap; }
.options { display: none; }
.options.open { display: grid; gap: 14px; animation: optIn .45s var(--ease-out) both; }
@keyframes optIn { from { opacity: 0; transform: translateY(-10px); } }
.opt-block { display: grid; gap: 8px; }
.opt-head { display: flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.opt-head svg { width: 15px; height: 15px; color: var(--gold); }
.opt-head small { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-3); }
.opt-cols { display: grid; gap: 16px; }
.seg { display: grid; gap: 6px; grid-auto-flow: column; grid-auto-columns: 1fr; }
.seg button { padding: 11px 8px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); display: grid; justify-items: center; gap: 2px; font-weight: 600; font-size: .92rem; transition: background .2s, border-color .2s, transform .2s var(--ease-out), color .2s; color: var(--ink-2); position: relative; }
.seg button small { font-size: .72rem; font-weight: 500; color: var(--ink-3); }
.seg button:hover { background: var(--glass-2); transform: translateY(-1px); }
.seg button.on { background: rgba(240,180,74,.16); border-color: rgba(240,180,74,.6); color: var(--gold-2); }
.seg button.on small { color: var(--gold-2); opacity: .8; }
.seg button.locked { opacity: .55; } .seg button.locked::after { content: "🔒"; position: absolute; top: 5px; right: 7px; font-size: .62rem; }
.seg-orient { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.seg-orient button { display: grid; grid-template-columns: 1fr; justify-items: center; align-content: center; gap: 4px; padding: 10px 8px; min-width: 0; }
.seg button small { display: block; white-space: normal; line-height: 1.25; font-size: .7rem; max-width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips button { padding: 8px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: .88rem; font-weight: 600; color: var(--ink-2); transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease-out); }
.chips button:hover { background: var(--glass-2); transform: translateY(-1px); }
.chips button.on { background: rgba(240,180,74,.16); border-color: rgba(240,180,74,.6); color: var(--gold-2); }
.voices { display: grid; gap: 7px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.voices button { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); text-align: left; transition: background .2s, border-color .2s, transform .2s var(--ease-out); }
.voices button:hover { background: var(--glass-2); transform: translateY(-1px); }
.voices button.on { background: rgba(240,180,74,.16); border-color: rgba(240,180,74,.6); }
.voices .va { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .82rem; background: linear-gradient(135deg, var(--violet), var(--indigo)); color: #fff; flex: none; }
.voices button.on .va { background: linear-gradient(135deg, var(--gold-2), var(--gold-3)); color: #2A1B05; }
.voices .vn { display: grid; min-width: 0; font-size: .88rem; font-weight: 600; line-height: 1.2; }
.voices .vn small { font-weight: 400; font-size: .72rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cost { font-size: .9rem; color: var(--ink-2); }
.cost b { color: var(--gold-2); }
.cost.over b[data-cost-min] { color: #FF9A86; }
.btn-generate { position: relative; overflow: hidden; }
.btn-generate::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); }
.btn-generate:hover::after { animation: shine .9s var(--ease-out); }
@keyframes shine { to { transform: translateX(120%); } }
.ideas { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; animation: rise .6s .16s var(--ease-out) both; }
.ideas-label { font-size: .8rem; color: var(--ink-3); font-weight: 600; margin-right: 2px; }
.idea { padding: 7px 12px; border-radius: 999px; border: 1px dashed var(--line-2); font-size: .82rem; color: var(--ink-2); max-width: 100%; text-align: left; transition: background .2s, border-color .2s, color .2s; }
.idea:hover { background: var(--glass-2); border-style: solid; color: var(--gold-2); }
.idea-more { padding: 7px 9px; }
.idea-more svg { width: 14px; height: 14px; }

/* Generation stage */
.stage { width: 100%; animation: rise .5s var(--ease-out) both; }
.stage-card { background: linear-gradient(160deg, rgba(240,180,74,.12), rgba(106,76,255,.14) 60%, rgba(126,224,200,.08)); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 22px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.stage-top { display: flex; align-items: center; gap: 14px; }
.stage-lamp { position: relative; width: 56px; height: 56px; flex: none; display: grid; place-items: center; }
.stage-lamp svg { width: 30px; height: 30px; color: var(--gold); stroke: var(--gold); fill: none; stroke-width: 1.75; filter: drop-shadow(0 0 14px rgba(240,180,74,.9)); animation: lampFloat 3s ease-in-out infinite; position: relative; z-index: 1; }
.stage-lamp i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(240,180,74,.5); animation: ripple 2.4s ease-out infinite; }
.stage-lamp i:nth-child(3) { animation-delay: .8s; } .stage-lamp i:nth-child(4) { animation-delay: 1.6s; }
@keyframes ripple { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.stage-text { flex: 1; min-width: 0; }
.stage-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 500; line-height: 1.15; }
.stage-sub { color: var(--ink-3); font-size: .9rem; margin-top: 2px; min-height: 1.3em; transition: opacity .4s; }
.stage-sub.swap { opacity: 0; }
.stage-pct { font-family: var(--font-display); font-size: 1.8rem; color: var(--gold-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 4px; background: rgba(0,0,0,.3); overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold-3), var(--gold-2)); transition: width 1.2s var(--ease-out); position: relative; overflow: hidden; }
.bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%); animation: shimmer 1.8s linear infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.stage.done .bar i::after { animation: none; }
.stage-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: .84rem; color: var(--ink-3); }
.stage-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stage-ready { display: grid; gap: 12px; margin-top: 4px; }
.stage-ready video { width: 100%; border-radius: 16px; background: #000; max-height: 60vh; }
.stage-ready-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stage-failed { display: grid; gap: 10px; }
.stage.done .stage-lamp i { display: none; } .stage.done .stage-lamp svg { animation: none; }
.stage.failed .stage-card { background: rgba(242,107,78,.08); border-color: rgba(242,107,78,.35); }
.stage.failed .stage-lamp svg { filter: none; color: var(--ember); stroke: var(--ember); animation: none; }
.stage.failed .stage-lamp i { display: none; }

.active-jobs, .recent-ready { max-width: 860px; margin: 0 auto; width: 100%; }
.job-rows { display: grid; gap: 8px; }
.job-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); transition: background .2s; }
.job-row:hover { background: var(--glass-2); }
.jr-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(240,180,74,.25); border-top-color: var(--gold); animation: spin 1s linear infinite; }
.jr-body { display: grid; min-width: 0; } .jr-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.jr-body small { color: var(--ink-3); font-size: .8rem; }
.jr-pct { font-family: var(--font-display); color: var(--gold-2); font-size: 1.1rem; }
.job-row.ready .jr-spin { border: 0; background: var(--mint); } .job-row.failed .jr-spin { border: 0; background: var(--ember); animation: none; }

/* Video grid */
.vgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); align-items: start; }
.vcard-wrap { position: relative; }
.vcard { display: grid; gap: 6px; transition: transform .3s var(--ease-out); }
.vcard:hover { transform: translateY(-3px); }
.vthumb { position: relative; display: block; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, var(--bg-3), var(--bg-2)); border: 1px solid var(--line); }
/* Portrait videos keep the same card footprint; the image is centred inside it. */
.vthumb.tall { aspect-ratio: 16/9; }
.vthumb.tall img { object-fit: contain; background: #07060f; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; }
.vthumb > b { position: absolute; right: 8px; bottom: 8px; font-size: .72rem; font-weight: 700; background: rgba(0,0,0,.6); padding: 2px 7px; border-radius: 6px; }
.vthumb-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); }
.vthumb-ph svg { width: 34px; height: 34px; opacity: .8; }
.vthumb-ph.failed { color: #FF9A86; gap: 4px; align-content: center; justify-items: center; }
.vthumb-ph.failed svg { width: 22px; height: 22px; } .vthumb-ph.failed em { font-style: normal; font-size: .74rem; color: var(--ink-3); }
.vthumb-prog { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 6px; background: rgba(10,8,32,.5); }
.ring { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; color: var(--gold-2); background: conic-gradient(var(--gold) var(--p, 10%), rgba(255,255,255,.1) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--bg-2); }
.ring b { position: relative; }
.vthumb-prog em { font-style: normal; font-size: .74rem; color: var(--ink-2); }
.vtitle { font-weight: 600; font-size: .9rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vmeta { font-size: .76rem; color: var(--ink-3); }
.fav { position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(10,8,32,.6); display: grid; place-items: center; color: #fff; opacity: 0; transition: opacity .2s, transform .2s; }
.fav svg { width: 15px; height: 15px; }
.vcard-wrap:hover .fav, .fav.on { opacity: 1; }
.fav.on { color: var(--ember); } .fav.on svg { fill: var(--ember); }
.fav-btn.on { color: var(--ember); border-color: rgba(242,107,78,.5); } .fav-btn.on svg { fill: var(--ember); }
@media (hover: none) { .fav { opacity: 1; } }

/* Video page */
.video-layout { display: grid; gap: 20px; }
.video-main { display: grid; gap: 14px; min-width: 0; }
.player { border-radius: 18px; overflow: hidden; background: #000; border: 1px solid var(--line); aspect-ratio: 16/9; position: relative; max-height: 72vh; box-shadow: var(--shadow); }
.player.tall { aspect-ratio: 9/16; max-height: 78vh; margin: 0 auto; width: auto; }
.player video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.player-busy { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; padding: 20px; background: linear-gradient(160deg, rgba(240,180,74,.10), rgba(106,76,255,.16)); }
.player-busy .bar { width: min(360px, 80%); }
.player-busy .pb-pct { font-family: var(--font-display); font-size: 2.4rem; color: var(--gold-2); line-height: 1; }
.player-busy .pb-status { font-weight: 600; }

/* Actual saved work alongside overall generation progress. */
.work-progress { min-width: 0; padding: 20px; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--glass); }
.work-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.work-heading > div { min-width: 0; }
.work-heading h2 { margin: 3px 0 0; font-size: 1.18rem; }
.work-eyebrow { margin: 0; color: var(--gold-2); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.work-live { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: .68rem; color: var(--mint); border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; }
.work-live::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.work-progress[data-mode="paused"] .work-live, .work-progress[data-mode="reconnecting"] .work-live { color: var(--gold-2); }
.work-summary { font-size: .84rem; line-height: 1.5; margin: 12px 0 16px; color: var(--ink-2); }
.work-steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.work-steps li { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; font-size: .65rem; color: var(--ink-3); text-align: center; }
.work-step-mark { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--line-2); border-radius: 50%; font-size: .69rem; font-weight: 700; }
.work-steps li[data-state="done"] { color: var(--mint); }
.work-steps li[data-state="done"] .work-step-mark { border-color: currentColor; background: rgba(126,224,200,.08); }
.work-steps li[data-state="active"] { color: var(--gold-2); font-weight: 700; }
.work-steps li[data-state="active"] .work-step-mark { border-color: currentColor; background: rgba(240,180,74,.12); box-shadow: 0 0 0 3px rgba(240,180,74,.06); }
.work-steps li[data-state="paused"] { color: var(--gold-2); }
.work-counters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.work-counter { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--glass); }
.work-counter[data-state="working"] { border-color: rgba(240,180,74,.4); }
.work-counter-top { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 8px; }
.work-icon { display: inline-flex; color: var(--gold-2); }
.work-icon .ic { width: 16px; height: 16px; }
.work-counter-state { font-size: .62rem; color: var(--ink-3); }
.work-counter[data-state="ready"] .work-counter-state { color: var(--mint); }
.work-counter[data-state="working"] .work-counter-state { color: var(--gold-2); }
.work-counter-label { font-size: .75rem; font-weight: 600; color: var(--ink-2); }
.work-counter-value { display: block; margin: 5px 0; font-size: 1.6rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--ink); overflow-wrap: anywhere; }
.work-counter p { margin: 0; font-size: .67rem; line-height: 1.45; color: var(--ink-3); overflow-wrap: anywhere; }
.work-footnote { margin: 13px 0 0; font-size: .68rem; color: var(--ink-3); line-height: 1.5; }
.video-page[data-busy="1"] .player { aspect-ratio: auto; min-height: 300px; }
@media (max-width: 600px) {
  .work-progress { padding: 15px; }
  .work-heading h2 { font-size: 1.05rem; }
  .work-heading { gap: 8px; }
  .work-live { font-size: .6rem; padding: 5px 6px; }
  .work-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .work-counter { padding: 11px; }
  .work-counter-value { font-size: 1.4rem; }
  .work-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 12px; }
}
:root[data-theme="light"] .work-steps li[data-state="done"], :root[data-theme="light"] .work-counter[data-state="ready"] .work-counter-state, :root[data-theme="light"] .work-live { color: #16745e; }
:root[data-theme="light"] .work-progress[data-mode="paused"] .work-live, :root[data-theme="light"] .work-progress[data-mode="reconnecting"] .work-live { color: var(--gold-3); }
.player-busy.failed { color: #FF9A86; }
.video-title-row { display: flex; align-items: center; gap: 8px; }
.video-title-row h1 { flex: 1; min-width: 0; padding: 4px 6px; margin: -4px -6px; border-radius: 8px; word-break: break-word; }
.video-title-row h1[contenteditable="true"] { background: var(--glass-2); outline: 2px solid var(--gold); }
.video-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .84rem; color: var(--ink-3); }
.video-meta span { display: inline-flex; align-items: center; gap: 5px; }
.video-meta svg { width: 14px; height: 14px; }
.video-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-box { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.share-box label { font-size: .8rem; font-weight: 600; color: var(--ink-3); }
.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; font-size: .86rem; padding: 9px 12px; }
.video-side { display: grid; gap: 14px; align-content: start; }
.prompt-text { font-family: var(--font-display); font-size: 1rem; line-height: 1.5; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.timeline { display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 4px 10px; padding: 6px 0 12px; position: relative; font-size: .88rem; }
.timeline li i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); margin-top: 5px; position: relative; z-index: 1; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 16px; bottom: -6px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li time { grid-column: 2; font-size: .76rem; color: var(--ink-3); }
.timeline .tl-created i { background: var(--ink-3); } .timeline .tl-submit i { background: var(--gold); } .timeline .tl-ready i { background: var(--mint); box-shadow: 0 0 8px rgba(126,224,200,.8); } .timeline .tl-failed i { background: var(--ember); }
.timeline .tl-live i { background: var(--gold); animation: pulse 1.4s infinite; }

/* Modals */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(4,3,14,.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: pagein .25s both; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal-card { position: relative; width: min(520px, 100%); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 28px 22px 22px; box-shadow: var(--shadow); animation: modalIn .45s var(--ease-out) both; margin: auto; }
.modal-wide { width: min(940px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); z-index: 6; background: var(--glass-2); }
.modal-x:hover { background: var(--glass-2); color: var(--ink); }
.pw-head { display: grid; justify-items: center; text-align: center; gap: 8px; margin-bottom: 18px; }
.pw-toggle { display: inline-flex; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin: 0 auto 16px; }
.pw-toggle button { padding: 7px 14px; border-radius: 999px; font-size: .86rem; font-weight: 600; color: var(--ink-3); transition: background .2s, color .2s; }
.pw-toggle button.on { background: var(--glass-3); color: var(--ink); }
.pw-toggle em { font-style: normal; font-size: .72rem; color: var(--mint); margin-left: 4px; }
.pw-plans { display: grid; gap: 12px; }
.pw-plan { position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: grid; gap: 8px; align-content: start; transition: transform .3s var(--ease-out), border-color .3s; }
.pw-plan:hover { transform: translateY(-3px); border-color: var(--line-2); }
.pw-plan.featured { border-color: rgba(240,180,74,.55); background: linear-gradient(160deg, rgba(240,180,74,.12), rgba(106,76,255,.1)); box-shadow: 0 30px 60px -30px rgba(240,180,74,.5); }
.pw-plan.hl { outline: 2px solid var(--gold); }
.pw-plan.current { border-color: rgba(126,224,200,.5); }
.pw-plan h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; }
.pw-tag { position: absolute; z-index: 2; top: -11px; left: 18px; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--gold); color: #2A1B05; padding: 4px 10px; border-radius: 999px; }
.pw-plan.current .pw-tag { background: var(--mint); }
.pw-tagline { font-size: .86rem; color: var(--ink-3); }
.pw-price { display: flex; align-items: baseline; gap: 4px; margin: 4px 0; }
.pw-price span { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; }
.pw-price small { color: var(--ink-3); }
.pw-plan ul { display: grid; gap: 6px; font-size: .88rem; color: var(--ink-2); margin: 4px 0 10px; }
.pw-plan li { display: flex; gap: 8px; align-items: flex-start; }
.pw-plan li svg { width: 15px; height: 15px; color: var(--mint); margin-top: 3px; }
.pw-plan .btn { margin-top: auto; }
.topups { display: grid; gap: 10px; }
.topup { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; }
.tour-steps { position: relative; min-height: 200px; }
.tour-step { display: none; text-align: center; gap: 12px; justify-items: center; }
.tour-step.on { display: grid; animation: rise .4s var(--ease-out) both; }
.tour-step p { color: var(--ink-2); line-height: 1.6; }
.tour-art { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(240,180,74,.3), rgba(240,180,74,.05) 70%); color: var(--gold); }
.tour-art svg { width: 32px; height: 32px; }
.tour-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.tour-dots { display: flex; gap: 6px; }
.tour-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--glass-3); transition: background .3s, transform .3s; }
.tour-dots i.on { background: var(--gold); transform: scale(1.25); }

/* ---------- Auth ---------- */
.auth-body { min-height: 100vh; }
.auth-split { position: relative; z-index: 1; min-height: 100vh; display: grid; }
.auth-show { display: none; }
.auth-pane { display: grid; align-content: center; justify-items: center; gap: 22px; padding: 28px 16px 40px; }
.auth-pane .brand-mobile { display: inline-flex; } .auth-pane .brand-mobile span { display: inline; }
.auth-card { width: min(440px, 100%); background: rgba(18,14,51,.7); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 30px 24px; box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: modalIn .6s var(--ease-out) both; display: grid; gap: 18px; }
.auth-title { font-family: var(--font-display); font-weight: 500; font-size: 1.85rem; line-height: 1.1; letter-spacing: -.02em; }
.auth-sub { color: var(--ink-3); margin-top: -10px; }
.auth-switch { text-align: center; font-size: .9rem; color: var(--ink-3); }
.auth-switch a { color: var(--gold); font-weight: 600; }
.sample-showcase { display: grid; gap: 10px; min-width: 0; }
.sample-showcase video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; max-width: 960px; border-radius: 12px; background: #142820; }
.sample-actions a { color: var(--gold); font-size: .85rem; }
.sample-transcript summary { cursor: pointer; font-size: .85rem; color: var(--ink-2); }
.sample-transcript p { margin-top: 8px; color: var(--ink-3); font-size: .85rem; line-height: 1.7; }
.auth-sample { border-top: 1px solid var(--line-2); padding-top: 16px; min-width: 0; }
.auth-sample > summary { display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: .9rem; color: var(--ink-2); }
.auth-sample > summary span { margin-left: auto; color: var(--ink-3); font-size: .8rem; }
.auth-sample .sample-showcase { margin-top: 14px; }
.auth-foot { font-size: .8rem; color: var(--ink-3); }
.auth-foot a:hover { color: var(--ink); }
.verify-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(240,180,74,.15); color: var(--gold); margin: 0 auto; }
.verify-icon svg { width: 30px; height: 30px; }
.auth-h { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.05; letter-spacing: -.02em; }
.auth-h em { font-style: italic; color: var(--gold-2); }
.auth-show-body { display: grid; gap: 20px; max-width: 480px; }
.auth-show-body p { color: var(--ink-2); font-size: 1.05rem; line-height: 1.6; }
.auth-demo { background: rgba(10,8,32,.6); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 14px; }
.ad-prompt { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.4; min-height: 3em; }
.ad-cursor::after { content: "▍"; color: var(--gold); animation: pulse 1s infinite; }
.ad-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-steps span { font-size: .78rem; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-3); transition: all .4s; }
.ad-steps span.on { border-color: rgba(240,180,74,.6); color: var(--gold-2); background: rgba(240,180,74,.12); }
.ad-steps span.done { color: var(--mint); border-color: rgba(126,224,200,.4); }
.ad-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.ad-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-3), var(--gold-2)); transition: width 1s linear; }
.auth-quotes blockquote { font-family: var(--font-display); font-style: italic; font-size: 1.05rem; color: var(--ink-2); line-height: 1.5; margin: 0; }
.auth-quotes cite { display: block; font-style: normal; font-family: var(--font-body); font-size: .82rem; color: var(--ink-3); margin-top: 8px; }

/* ---------- Public ---------- */
.public-body { display: flex; flex-direction: column; min-height: 100vh; }
.pub-head { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; }
.pub-head nav { display: flex; gap: 8px; }
.pub-main { position: relative; z-index: 1; flex: 1; width: min(920px, 100% - 32px); margin: 0 auto; padding: 20px 0 60px; }
.pub-foot { position: relative; z-index: 1; text-align: center; padding: 20px; font-size: .8rem; color: var(--ink-3); }
.pub-center { text-align: center; display: grid; justify-items: center; gap: 14px; padding: 60px 0; }
.big-code { font-family: var(--font-display); font-size: 6rem; line-height: 1; color: var(--gold); opacity: .8; }
.share-page { display: grid; gap: 14px; }
.share-cta { margin-top: 10px; }

/* ---------- Admin ---------- */
.prov-grid { display: grid; gap: 14px; }
.prov-card { display: grid; gap: 12px; align-content: start; border-left: 3px solid var(--line-2); }
.prov-card.on { border-left-color: var(--mint); }
.prov-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.prov-rows { display: grid; gap: 6px; font-size: .88rem; }
.prov-rows > div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 5px; }
.prov-rows span { color: var(--ink-3); }
.prov-notes { line-height: 1.5; }
.prov-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.test-out, .preview-out, .worker-out { font-size: .84rem; padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid var(--line); margin-top: 10px; }
.test-out.ok { border-color: rgba(126,224,200,.5); color: var(--mint); } .test-out.err { border-color: rgba(242,107,78,.5); color: #FF9A86; }
.preview-out, .worker-out { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink-2); max-height: 400px; overflow: auto; margin-bottom: 16px; }
.test-msg { font-size: .86rem; margin-left: 8px; }
.admin-video { width: 100%; border-radius: 12px; background: #000; max-height: 360px; }
.loglist { display: grid; gap: 4px; }
.logrow summary { display: grid; grid-template-columns: 130px 90px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; font-size: .86rem; cursor: pointer; list-style: none; }
.logrow summary::-webkit-details-marker { display: none; }
.logrow summary:hover { background: var(--glass); }
.logrow time { color: var(--ink-3); font-size: .8rem; }
.logrow .stage { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; background: var(--glass-2); text-align: center; }
.stage-ready { background: rgba(126,224,200,.15) !important; color: var(--mint); } .stage-failed { background: rgba(242,107,78,.15) !important; color: #FF9A86; } .stage-submit, .stage-poll { color: var(--gold-2); }
.logbody { padding: 6px 10px 12px; } .logbody strong { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.logbody pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; background: rgba(0,0,0,.35); border-radius: 10px; padding: 10px 12px; max-height: 300px; overflow: auto; margin-top: 4px; }
.danger-zone summary { cursor: pointer; font-weight: 600; color: #FF9A86; }
.danger-zone p { margin: 10px 0; }
.instructions { white-space: pre-wrap; line-height: 1.6; color: var(--ink-2); }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .bill-grid { grid-template-columns: repeat(3, 1fr); }
  .opt-cols { grid-template-columns: 1fr 1fr; }
  .pw-plans { grid-template-columns: repeat(3, 1fr); }
  .video-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prov-grid { grid-template-columns: repeat(2, 1fr); }
  .vgrid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .content { padding: 26px 26px 70px; }
  .topups { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .side { transform: none; box-shadow: none; }
  .side-close, .side-backdrop, [data-side-open] { display: none; }
  .main { margin-left: var(--side-w); }
  .topbar { padding: 0 24px; }
  .brand-mobile { display: none; }
  .content { padding: 34px 36px 80px; }
  .video-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .auth-split { grid-template-columns: 1.05fr 1fr; }
  .auth-show { display: flex; flex-direction: column; justify-content: space-between; padding: 36px 48px; border-right: 1px solid var(--line); background: linear-gradient(160deg, rgba(42,31,122,.35), rgba(10,8,32,0) 60%); }
  .auth-pane .brand-mobile { display: none; }
  .auth-pane { padding: 40px; }
  .prov-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1280px) { .prov-grid { grid-template-columns: repeat(3, 1fr); } .vgrid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }
@media (max-width: 639px) {
  .card > .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .seg-dur { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); }
  .logrow summary { grid-template-columns: 1fr auto; }
  .logrow summary span { grid-column: 1 / -1; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; } .dl dd { margin-bottom: 8px; }
  .stage-pct { font-size: 1.4rem; }
  .composer-foot .btn-generate { width: 100%; }
  .tool { padding: 6px 9px; font-size: .78rem; } .composer-tools { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ==========================================================================
   v2 — richer studio, animations, light theme
   ========================================================================== */

/* Greeting stats */
.greet-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.greet-stats span { font-size: .82rem; color: var(--ink-3); padding: 6px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); }
.greet-stats b { color: var(--gold-2); font-weight: 700; }

/* Templates row */
.templates { display: grid; gap: 10px; }
.tpl-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.tpl-actions { flex: none; }
.tpl-actions .link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tpl-actions .link .ic { width: 16px; height: 16px; }
.tpl-row { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.tpl { flex: 0 0 172px; align-content: start; min-width: 0; scroll-snap-align: start; display: grid; gap: 4px; justify-items: start; text-align: left; padding: 12px 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); position: relative; transition: transform .3s var(--ease-out), border-color .25s, background .25s; }
.tpl:hover { transform: translateY(-3px); border-color: rgba(240,180,74,.5); background: var(--glass-2); }
.tpl.on { border-color: var(--gold); background: rgba(240,180,74,.14); }
.tpl em { font-style: normal; font-size: 1.4rem; line-height: 1; }
.tpl b { font-size: .92rem; font-weight: 600; min-width: 0; }
.tpl small { font-size: .74rem; color: var(--ink-3); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-height: 2.6em; min-width: 0; }
.tpl.mine { border-style: dashed; }
.tpl .tpl-x { position: absolute; top: 6px; right: 8px; font-style: normal; color: var(--ink-3); font-size: 1rem; line-height: 1; padding: 2px 5px; border-radius: 6px; }
.tpl .tpl-x:hover { background: rgba(242,107,78,.2); color: #FF9A86; }

/* 5.6 Style gallery: real demo videos that apply a complete style recipe */
.styles { display: grid; gap: 10px; }
.styles-head { display: grid; gap: 2px; }
.styles-head small { font-size: .78rem; }
.styles-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.styles-row .style-card { flex: 0 0 208px; scroll-snap-align: start; }
.style-card { position: relative; display: grid; text-align: left; border-radius: 16px; overflow: hidden; background: var(--glass); border: 1px solid var(--line); isolation: isolate;
  transition: transform .35s var(--ease-out), border-color .25s, box-shadow .35s var(--ease-out), background .25s; }
.style-card .sc-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #05040f; }
.style-card video, .style-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out), opacity .3s; }
.style-card.vertical video, .style-card.vertical img { object-fit: contain; background: radial-gradient(circle at 50% 40%, #1b1550, #05040f 70%); }
.style-card .sc-text { display: grid; gap: 2px; padding: 9px 12px 11px; }
.style-card b { font-size: .92rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.style-card small { font-size: .74rem; color: var(--ink-3); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.style-card .sc-play { position: absolute; top: 8px; right: 8px; z-index: 3; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(5,4,15,.55); color: #fff; border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: .9; transition: background .2s, transform .2s; }
.style-card .sc-play:hover { background: var(--gold); color: #1a1205; transform: scale(1.08); }
.style-card .sc-play svg { width: 13px; height: 13px; margin-left: 2px; }
.style-card .sc-check { position: absolute; top: 8px; left: 8px; z-index: 3; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #1a1205; transform: scale(0); transition: transform .35s var(--ease-out); }
.style-card .sc-check svg { width: 15px; height: 15px; stroke-width: 2.6; }
.style-card:hover { transform: translateY(-3px); border-color: rgba(240,180,74,.55); background: var(--glass-2); box-shadow: 0 18px 40px -22px rgba(240,180,74,.6); }
.style-card:hover video { transform: scale(1.04); }
.style-card.on { border-color: var(--gold); background: rgba(240,180,74,.12); box-shadow: 0 0 0 1px var(--gold), var(--shadow-gold); }
.style-card.on .sc-check { transform: scale(1); }
.style-modal { width: min(860px, 100%); padding: 14px; display: grid; gap: 12px; }
.style-modal video { width: 100%; max-height: 70vh; border-radius: 14px; background: #000; }
.style-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 4px 2px; }
.style-modal-foot div { display: grid; gap: 2px; }
@media (max-width: 640px) { .styles-row .style-card { flex: 0 0 64%; } }
@media (prefers-reduced-motion: reduce) { .style-card, .style-card video { transition: none; } .style-card:hover video { transform: none; } }

/* Composer extras */
.tool.on { background: rgba(240,180,74,.16); border-color: rgba(240,180,74,.6); color: var(--gold-2); }
.bulk-hint { padding: 6px 14px 8px; font-size: .8rem; color: var(--ink-3); border-top: 1px dashed var(--line); margin-top: 4px; }
.bulk-hint b { color: var(--gold-2); }
.summary { display: flex; flex-wrap: wrap; gap: 6px; }
.summary button { font-size: .78rem; padding: 5px 11px; border-radius: 999px; background: rgba(240,180,74,.1); border: 1px solid rgba(240,180,74,.3); color: var(--gold-2); font-weight: 600; transition: background .2s; }
.summary button:hover { background: rgba(240,180,74,.22); }
.osec { border: 1px solid var(--line); border-radius: 16px; background: var(--glass); overflow: hidden; transition: border-color .25s; }
.osec[open] { border-color: var(--line-2); }
.osec summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; user-select: none; }
.osec summary::-webkit-details-marker { display: none; }
.osec summary:hover { background: var(--glass-2); }
.osec-t { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; }
.osec-t svg { width: 16px; height: 16px; color: var(--gold); }
.osec-sum { font-size: .8rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.osec-chev { display: grid; color: var(--ink-3); transition: transform .3s var(--ease-out); }
.osec[open] .osec-chev { transform: rotate(180deg); }
.osec-body { display: grid; gap: 16px; padding: 4px 16px 18px; animation: rise .35s var(--ease-out) both; }
.osec-tools { text-align: right; font-size: .8rem; color: var(--ink-3); }
.custom-dur { display: grid; gap: 8px; padding: 12px 14px; border-radius: 12px; background: rgba(240,180,74,.08); border: 1px dashed rgba(240,180,74,.4); animation: rise .3s var(--ease-out) both; }
.custom-dur input[type="range"] { width: 100%; accent-color: var(--gold); height: 28px; }
.cd-row { display: flex; align-items: center; gap: 10px; font-size: .88rem; flex-wrap: wrap; }
.cd-num { width: 96px; padding: 8px 10px; }
.cd-row b { color: var(--gold-2); }
.seg-wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.seg button .ori { display: block; border: 2px solid currentColor; border-radius: 3px; width: 24px; height: 14px; margin-bottom: 4px; }
.seg button .ori[data-o="9:16"] { width: 12px; height: 20px; } .seg button .ori[data-o="1:1"] { width: 16px; height: 16px; } .seg button .ori[data-o="4:5"] { width: 15px; height: 19px; } .seg button .ori[data-o="21:9"] { width: 28px; height: 12px; }
.seg-orient button { grid-template-columns: 1fr; justify-items: center; }
.chips button em { font-style: normal; margin-right: 6px; }
.chips button.pop, .seg button.pop, .voices button.pop { animation: pop .35s var(--ease-out); }
@keyframes pop { 40% { transform: scale(1.06); } }
.radios { display: grid; gap: 8px; }
.radios button { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; text-align: left; padding: 11px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); transition: border-color .2s, background .2s; }
.radios button i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); margin-top: 2px; position: relative; }
.radios button.on { border-color: rgba(240,180,74,.6); background: rgba(240,180,74,.12); }
.radios button.on i { border-color: var(--gold); } .radios button.on i::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--gold); }
.radios b { display: block; font-size: .9rem; } .radios small { color: var(--ink-3); font-size: .78rem; }
.toggles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.toggle { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .sw { width: 40px; height: 22px; border-radius: 999px; background: var(--glass-3); border: 1px solid var(--line-2); position: relative; flex: none; transition: background .25s; }
.toggle .sw i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-3); transition: transform .25s var(--ease-out), background .25s; }
.toggle input:checked + .sw { background: rgba(240,180,74,.35); border-color: rgba(240,180,74,.6); } .toggle input:checked + .sw i { transform: translateX(18px); background: var(--gold); }
.toggle .tl { display: grid; line-height: 1.2; } .toggle b { font-size: .88rem; } .toggle small { color: var(--ink-3); font-size: .74rem; }
.history-list { display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; margin: 12px 0; }
.history-list button { width: 100%; display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 10px; background: var(--glass); border: 1px solid var(--line); font-size: .86rem; }
.history-list button:hover { background: var(--glass-2); }
.history-list time { font-size: .72rem; color: var(--ink-3); }
.idea-more.spin svg { animation: spin .6s var(--ease-out); }

/* Stage v2 */
.stage-card { position: relative; overflow: hidden; }
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.stage-ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold) calc(var(--p, 3) * 1%), rgba(255,255,255,.08) 0); position: relative; flex: none; transition: --p 1s; }
.stage-ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--bg-2); }
.stage-ring b { position: relative; font-family: var(--font-display); font-size: 1rem; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.stage-steps { display: flex; gap: 4px; flex-wrap: wrap; }
.stage-steps span { font-size: .72rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-3); transition: all .4s; }
.stage-steps span.on { border-color: rgba(126,224,200,.5); color: var(--mint); background: rgba(126,224,200,.1); }
.stage-bulk { display: grid; gap: 6px; }
.bulk-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.2); font-size: .86rem; }
.bulk-row.ready .jr-spin { border: 0; background: var(--mint); animation: none; } .bulk-row.failed .jr-spin { border: 0; background: var(--ember); animation: none; }
.bulk-row.err { color: #FF9A86; }
.bulk-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Reveal on scroll, count-up, ripple, tilt */
.reveal { transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
/* Only hide while JavaScript is running, so content can never get stuck invisible. */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in { opacity: 1; transform: none; }
.ripple { position: relative; overflow: hidden; }
.ripple .rp { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.45); animation: rp .6s ease-out forwards; pointer-events: none; }
@keyframes rp { to { transform: scale(3); opacity: 0; } }
.tilt { transform-style: preserve-3d; will-change: transform; }
.vcard .vthumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.vcard:hover .vthumb video.playing { opacity: 1; }
.cursor-glow { position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; z-index: 0; pointer-events: none; background: radial-gradient(circle, rgba(240,180,74,.12), rgba(106,76,255,.06) 40%, transparent 65%); mix-blend-mode: screen; will-change: transform; opacity: 0; transition: opacity .6s; }
body.has-glow .cursor-glow { opacity: 1; }
.side-nav a { position: relative; }
.side-nav a.on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--gold); animation: rise .3s var(--ease-out); }
.stat-big[data-count-up] { transition: none; }
.skeleton { background: linear-gradient(90deg, var(--glass) 25%, var(--glass-3) 50%, var(--glass) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 10px; }

/* Library v2 */
.lib-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.view-toggle { display: inline-flex; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.view-toggle button { width: 32px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: var(--ink-3); }
.view-toggle button.on { background: var(--glass-3); color: var(--ink); }
.select.sm { padding: 8px 32px 8px 12px; font-size: .86rem; width: auto; }
.vlist { display: grid; gap: 8px; }
.vlist .vcard-wrap { display: grid; grid-template-columns: 120px 1fr auto; gap: 14px; align-items: center; padding: 8px 12px 8px 8px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); }
.vlist .vcard { display: contents; }
.vlist .vthumb { aspect-ratio: 16/9; border-radius: 10px; }
.vlist .vthumb.tall { aspect-ratio: 9/16; max-height: 90px; width: 50px; }
.vlist .vinfo { display: grid; gap: 2px; min-width: 0; }
.vlist .fav { position: static; opacity: 1; background: none; }
.vlist .fav.on { color: var(--ember); }
.tagrow { display: flex; flex-wrap: wrap; gap: 4px; }
.tagchip { font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: rgba(106,76,255,.18); color: #C7BBFF; border: 1px solid rgba(106,76,255,.35); }
.bulkbar { position: sticky; bottom: 12px; z-index: 20; display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: rise .3s var(--ease-out); margin-top: 16px; }
.selbox { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 7px; border: 2px solid rgba(255,255,255,.7); background: rgba(10,8,32,.5); display: grid; place-items: center; color: #fff; opacity: 0; transition: opacity .2s; cursor: pointer; }
.selbox svg { width: 14px; height: 14px; opacity: 0; }
.vcard-wrap:hover .selbox, .selbox.on, body.selecting .selbox { opacity: 1; }
.selbox.on { background: var(--gold); border-color: var(--gold); color: #2A1B05; } .selbox.on svg { opacity: 1; }
.vlist .selbox { position: static; opacity: 1; }
.lib-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-3); margin: -6px 0 14px; }
.lib-stats b { color: var(--ink); }

/* Video page v2 */
.player-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--ink-3); }
.player-tools button { padding: 5px 10px; border-radius: 8px; background: var(--glass); border: 1px solid var(--line); font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.player-tools button.on { background: rgba(240,180,74,.16); border-color: rgba(240,180,74,.5); color: var(--gold-2); }
.player.theater { max-height: none; aspect-ratio: 16/9; }
.notes-box textarea { font-size: .9rem; min-height: 96px; }
.embed-box { display: grid; gap: 8px; }
.embed-box textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; min-height: 60px; }
.versions { display: grid; gap: 6px; }
.versions a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--glass); font-size: .86rem; }
.versions a.cur { border: 1px solid rgba(240,180,74,.4); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.settings-grid div { padding: 8px 10px; border-radius: 10px; background: var(--glass); font-size: .82rem; }
.settings-grid span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.kbd { font-family: ui-monospace, monospace; font-size: .74rem; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--glass); }

/* Account v2 */
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-pick button { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); display: grid; gap: 6px; justify-items: center; font-size: .82rem; font-weight: 600; }
.theme-pick button.on { border-color: var(--gold); background: rgba(240,180,74,.12); }
.theme-pick i { width: 44px; height: 28px; border-radius: 6px; border: 1px solid var(--line-2); }
.theme-pick .t-dark { background: linear-gradient(135deg, #0A0820, #2A1F7A); } .theme-pick .t-light { background: linear-gradient(135deg, #FFFDF8, #E9E1FF); } .theme-pick .t-auto { background: linear-gradient(135deg, #0A0820 50%, #FFFDF8 50%); }
.token-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.token-box code { flex: 1; min-width: 200px; padding: 10px 12px; word-break: break-all; }
.ref-link { display: flex; gap: 8px; }
.ref-link input { flex: 1; }
.activity li { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.activity li:last-child { border: 0; }
.activity li i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); margin-top: 7px; }
.activity li.k-success i { background: var(--mint); } .activity li.k-warning i { background: var(--ember); } .activity li.k-info i { background: var(--violet); }
.activity time { font-size: .78rem; color: var(--ink-3); white-space: nowrap; }
.docs pre { background: rgba(0,0,0,.35); border-radius: 12px; padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; overflow-x: auto; }
.docs h3 { margin-top: 20px; }
.docs table { font-size: .86rem; }

/* Admin v2 */
.catalog-editor { display: grid; gap: 8px; }
.cat-row { display: grid; grid-template-columns: 24px 1fr 1fr 1.4fr 60px 32px; gap: 6px; align-items: center; }
.cat-row input { padding: 7px 10px; font-size: .86rem; }
.cat-row .handle { cursor: grab; color: var(--ink-3); text-align: center; }
.cat-row .del { width: 30px; height: 30px; border-radius: 8px; color: #FF9A86; display: grid; place-items: center; }
.cat-row .del:hover { background: rgba(242,107,78,.15); }
.cat-head { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.cat-simple .cat-row { grid-template-columns: 24px 1fr 32px; }
.vis-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.line-chart { width: 100%; height: 160px; }
.line-chart path { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; }
.line-chart .area { fill: url(#gfill); stroke: none; }
.line-chart text { font-size: 10px; fill: var(--ink-3); }
.health li { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.health li:last-child { border: 0; }
.health .ok { color: var(--mint); } .health .warn { color: var(--gold-2); } .health .bad { color: #FF9A86; }
.kpi-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Light theme ---------- */
:root[data-theme="light"] {
  --bg: #F6F2EA; --bg-2: #FFFFFF; --bg-3: #EEE8F7; --indigo: #D9D1F5; --violet: #6A4CFF;
  --gold: #D99A2B; --gold-2: #B77A12; --gold-3: #F0B44A; --ember: #E2543A; --mint: #1E9E80;
  --ink: #1C1633; --ink-2: #3A3358; --ink-3: #6E6791;
  --line: rgba(28,22,51,.09); --line-2: rgba(28,22,51,.18);
  --glass: rgba(255,255,255,.55); --glass-2: rgba(255,255,255,.85); --glass-3: rgba(28,22,51,.06);
  --shadow: 0 20px 50px -24px rgba(28,22,51,.35); --shadow-gold: 0 14px 34px -14px rgba(217,154,43,.6);
}
:root[data-theme="light"] .aurora i { opacity: .28; }
:root[data-theme="light"] .side { background: rgba(255,255,255,.92); }
:root[data-theme="light"] .topbar { background: rgba(246,242,234,.8); }
:root[data-theme="light"] input[type="text"], :root[data-theme="light"] input[type="email"], :root[data-theme="light"] input[type="password"], :root[data-theme="light"] input[type="number"], :root[data-theme="light"] input[type="url"], :root[data-theme="light"] input[type="search"], :root[data-theme="light"] input[type="file"], :root[data-theme="light"] input[type="date"], :root[data-theme="light"] input[type="datetime-local"], :root[data-theme="light"] input[type="time"], :root[data-theme="light"] input[type="tel"], :root[data-theme="light"] textarea, :root[data-theme="light"] .select { background: #fff; color: var(--ink); }
:root[data-theme="light"] input:focus, :root[data-theme="light"] textarea:focus, :root[data-theme="light"] .select:focus { background: #fff; }
:root[data-theme="light"] .composer-box { background: rgba(255,255,255,.9); box-shadow: 0 30px 60px -30px rgba(28,22,51,.3); }
:root[data-theme="light"] .btn-gold { background: linear-gradient(135deg, #F7C868, #E9A93B 55%, #C98A1E); color: #2A1B05; }
:root[data-theme="light"] .seg button.on, :root[data-theme="light"] .chips button.on, :root[data-theme="light"] .voices button.on, :root[data-theme="light"] .tpl.on { background: rgba(217,154,43,.14); border-color: rgba(217,154,43,.6); color: #7A4F05; }
:root[data-theme="light"] .side-nav a.on { background: rgba(217,154,43,.14); color: #7A4F05; }
:root[data-theme="light"] .avatar, :root[data-theme="light"] .voices .va { color: #fff; }
:root[data-theme="light"] .stage-card { background: linear-gradient(160deg, rgba(240,180,74,.18), rgba(106,76,255,.12) 60%, rgba(30,158,128,.1)); }
:root[data-theme="light"] .stage-ring::before, :root[data-theme="light"] .ring::before { background: #fff; }
:root[data-theme="light"] .notif-panel, :root[data-theme="light"] .modal-card, :root[data-theme="light"] .toast, :root[data-theme="light"] .bulkbar { background: #fff; }
:root[data-theme="light"] .flash-success { background: rgba(30,158,128,.12); } :root[data-theme="light"] .flash-info { background: rgba(106,76,255,.1); }
:root[data-theme="light"] .status { color: var(--ink-3); }
:root[data-theme="light"] .st-ready, :root[data-theme="light"] .st-paid, :root[data-theme="light"] .st-active { background: rgba(30,158,128,.14); color: #146B57; }
:root[data-theme="light"] .st-processing, :root[data-theme="light"] .st-queued, :root[data-theme="light"] .st-submitted, :root[data-theme="light"] .st-downloading, :root[data-theme="light"] .st-pending_manual { background: rgba(217,154,43,.16); color: #7A4F05; }
:root[data-theme="light"] .st-failed, :root[data-theme="light"] .st-cancelled, :root[data-theme="light"] .st-rejected { background: rgba(226,84,58,.14); color: #9E2F1B; }
:root[data-theme="light"] .bad { color: #B8391F; } :root[data-theme="light"] .good { color: #146B57; }
:root[data-theme="light"] .test-out, :root[data-theme="light"] .preview-out, :root[data-theme="light"] .worker-out, :root[data-theme="light"] .logbody pre, :root[data-theme="light"] .docs pre, :root[data-theme="light"] .bulk-row { background: rgba(28,22,51,.06); }
:root[data-theme="light"] .pw-plan.featured { background: linear-gradient(160deg, rgba(240,180,74,.2), rgba(106,76,255,.08)); }
:root[data-theme="light"] .minutes-card { background: linear-gradient(160deg, rgba(240,180,74,.2), rgba(106,76,255,.12)); }
:root[data-theme="light"] .tagchip { background: rgba(106,76,255,.12); color: #4A32C9; }
:root[data-theme="light"] .auth-card { background: rgba(255,255,255,.9); }
:root[data-theme="light"] .auth-demo { background: rgba(255,255,255,.7); }
:root[data-theme="light"] .stars { display: none; }
:root[data-theme="light"] .idea:hover, :root[data-theme="light"] .tool:hover { color: #7A4F05; }
.theme-btn svg { transition: transform .4s var(--ease-out); } .theme-btn:hover svg { transform: rotate(20deg); }

@media (max-width: 639px) {
  .cat-row { grid-template-columns: 1fr 1fr 32px; } .cat-row .handle, .cat-row .c-hint, .cat-row .c-emoji { display: none; }
  .vlist .vcard-wrap { grid-template-columns: 90px 1fr auto; }
  .osec summary { grid-template-columns: 1fr auto; } .osec-sum { display: none; }
  .theme-pick { grid-template-columns: repeat(3, 1fr); }
}


/* Grid/flex children must be allowed to shrink, or long content widens the page on phones. */
.content, .studio, .composer-wrap, .video-layout, .two-col, .three-col, .stats, .bill-grid, .osec, .osec-body, .opt-cols, .vgrid, .vlist { min-width: 0; }
.composer-wrap > *, .studio > *, .osec-body > *, .opt-cols > *, .two-col > *, .three-col > *, .video-layout > *, .main, .vcard-wrap, .job-row, .bulk-row, .tpl-row, .templates, .tpl-head { min-width: 0; }
.tpl-head { flex-wrap: wrap; }
.greet h1, .greet-stats { max-width: 100%; }
.jr-body strong, .bulk-t, .vtitle { min-width: 0; }

.composer, .composer > *, .composer-box, .composer-tools, .composer-foot, .ideas, .active-jobs, .recent-ready, .stage, .stage-card, .stage-top, .stage-text { min-width: 0; }
.composer-tools { flex-wrap: wrap; row-gap: 6px; }
.composer-box textarea { max-width: 100%; }
@media (max-width: 480px) { .count { width: 100%; text-align: right; margin-left: 0; } }

/* ============ Connect a video API ============ */
.conn-group { margin: 26px 0; }
.conn-group-head { margin-bottom: 12px; }
.conn-group-head p { max-width: 62ch; margin: 4px 0 0; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; align-items: start; }
.conn-card { display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; min-width: 0; }
.conn-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: transparent; transition: background .3s var(--ease-out); }
.conn-card.is-on::before { background: linear-gradient(180deg, var(--gold), #59d0a0); }
.conn-card.is-off::before { background: rgba(240,180,74,.45); }
.conn-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.conn-top h3 { margin: 0 0 2px; }
.conn-top p { margin: 0; }
.conn-len { display: flex; align-items: center; gap: 7px; margin: 0; font-size: .86rem; color: var(--muted); background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
.conn-len .ic { width: 14px; height: 14px; flex: none; }
.conn-state { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.conn-state > div { min-width: 0; }
.conn-state span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.conn-state strong { font-weight: 600; font-size: .86rem; display: block; overflow: hidden; text-overflow: ellipsis; }
.conn-state code { font-size: .78rem; }
.conn-form { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.conn-form .field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.conn-form .lbl { font-size: .8rem; font-weight: 600; }
.conn-form input { width: 100%; max-width: 100%; }
.conn-help { display: flex; gap: 7px; align-items: flex-start; line-height: 1.5; }
.conn-help .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.conn-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.conn-out { font-size: .85rem; line-height: 1.5; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); }
.conn-out.is-busy { color: var(--muted); }
.conn-out.is-good { color: #59d0a0; border-color: rgba(89,208,160,.35); background: rgba(89,208,160,.08); }
.conn-out.is-warn { color: var(--gold); border-color: rgba(240,180,74,.35); background: rgba(240,180,74,.08); }
.conn-out.is-bad  { color: #ff8b8b; border-color: rgba(255,139,139,.35); background: rgba(255,139,139,.08); }
.conn-models { border-top: 1px solid var(--line); padding-top: 10px; }
.conn-models summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.conn-models summary:hover { color: var(--ink); }
.conn-model-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.conn-model-list li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.conn-model-list strong { display: block; font-size: .87rem; font-weight: 600; }
.conn-model-list .small { display: block; line-height: 1.4; }
.conn-model-list li > a { flex: none; margin-left: auto; white-space: nowrap; }
.conn-model-list .min0 { flex: 1; }
/* Workflow editor: breathing room above each section heading */
[data-workflow-form] .card > * + * { margin-top: 12px; }
[data-workflow-form] .card > .h4:not(:first-child) { margin-top: 22px; }
[data-workflow-form] .two-col.tight { align-items: start; }
/* Compact two-line lists (dashboard: latest jobs, new users) */
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; }
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; }
.mini-list li:first-child { border-top: 0; padding-top: 2px; }
.ml-main { flex: 1; min-width: 0; display: grid; gap: 2px; color: inherit; text-decoration: none; }
.ml-main:hover .ml-title { color: var(--gold); }
.ml-title { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-sub { font-size: .8rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list .status, .ml-side { flex: none; }
.ml-side { font-size: .84rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.conn-notes { margin: 12px 0 0; line-height: 1.55; }
.switch-sm { width: 34px; height: 19px; flex: none; }
.switch-sm i { width: 13px; height: 13px; }
.switch-sm.on i { transform: translateX(15px); }
.pill { font-size: .72rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; flex: none; }
.pill-good { color: #59d0a0; border-color: rgba(89,208,160,.4); background: rgba(89,208,160,.1); display: inline-flex; align-items: center; gap: 4px; }
.pill-good .ic { width: 12px; height: 12px; }
.pill-warn { color: var(--gold); border-color: rgba(240,180,74,.4); background: rgba(240,180,74,.1); }
/* 4.3: render server states */
.pill-bad { color: #ff7a7a; border-color: rgba(255,122,122,.4); background: rgba(255,122,122,.1); }
.pill-info { color: #7fb4ff; border-color: rgba(127,180,255,.4); background: rgba(127,180,255,.1); }
.bar-mini { display: block; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 4px 0 2px; max-width: 160px; }
.bar-mini i { display: block; height: 100%; background: var(--gold); border-radius: 4px; transition: width .4s; }
.testvid { margin-bottom: 8px; }
.testvid-body { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.testvid-out { font-size: .88rem; line-height: 1.55; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--line); width: 100%; }
.testvid-out.is-busy { color: var(--muted); }
.testvid-out.is-good { color: #59d0a0; border-color: rgba(89,208,160,.35); background: rgba(89,208,160,.08); }
.testvid-out.is-bad  { color: #ff8b8b; border-color: rgba(255,139,139,.35); background: rgba(255,139,139,.08); }
.testvid-out a { color: inherit; font-weight: 600; text-decoration: underline; }
.min0 { min-width: 0; }
@media (max-width: 520px) { .conn-grid { grid-template-columns: 1fr; } }

/* First-run demo credentials on the login page (vanishes once the password is changed) */
.demo-creds { margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; background: rgba(240,180,74,.06); }
.demo-creds strong { display: flex; align-items: center; gap: 7px; font-size: .9rem; color: var(--gold); }
.demo-creds strong .ic { width: 15px; height: 15px; }
.demo-creds p { margin: 7px 0 0; font-size: .86rem; color: var(--muted); line-height: 1.5; }
.dc-pair { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dc-pair code { cursor: pointer; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; font-size: .84rem; color: var(--ink); }
.dc-pair code:hover { border-color: var(--gold); }
.dc-copy { background: none; border: none; color: var(--gold); font-size: .78rem; cursor: pointer; padding: 2px 4px; }
.dc-copy:hover { text-decoration: underline; }
.dc-warn { font-size: .79rem !important; opacity: .85; }

/* A table cell holding a name plus a description needs room, or the text wraps one letter per line. */
.table .tcell-name { min-width: 190px; }
.table .tcell-wide { min-width: 240px; }

/* ============ Setup checklist ============ */
.setup-hero { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.setup-ring { position: relative; width: 104px; height: 104px; flex: none; }
.setup-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.setup-ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.setup-ring .sr-bg { stroke: var(--line); }
.setup-ring .sr-fg { stroke: url(#none); stroke: var(--gold); transition: stroke-dasharray .8s var(--ease-out); }
.setup-ring span { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; gap: 1px; font-size: 1.5rem; font-weight: 700; font-family: var(--font-display, inherit); }
.setup-ring span i { font-style: normal; font-size: .9rem; color: var(--muted); font-weight: 500; }
.setup-hero h2 { margin: 0 0 4px; }
.setup-hero p { margin: 0; max-width: 62ch; }
.setup-jump { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.setup-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: step; }
.setup-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.setup-item.is-done { opacity: .72; }
.setup-item.is-blocking { border-color: rgba(240,180,74,.4); background: rgba(240,180,74,.05); }
.si-mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 700; border: 1px solid var(--line); color: var(--muted); }
.setup-item.is-done .si-mark { background: rgba(89,208,160,.14); border-color: rgba(89,208,160,.4); color: #59d0a0; }
.setup-item.is-blocking .si-mark { background: rgba(240,180,74,.14); border-color: rgba(240,180,74,.45); color: var(--gold); }
.si-mark .ic { width: 15px; height: 15px; }
.si-body h3 { margin: 0 0 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.si-body p { margin: 0; line-height: 1.55; max-width: 74ch; }
.cron-box { margin-top: 11px; padding: 12px 13px; border: 1px dashed var(--line-2); border-radius: 11px; background: var(--glass); }
.cron-box p { margin: 0 0 8px; }
.cron-box p:last-child { margin: 8px 0 0; }
.copy-line { display: flex; align-items: center; gap: 10px; justify-content: space-between; background: rgba(0,0,0,.28); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-size: .8rem; color: var(--gold-2); word-break: break-all; }
.copy-line button { flex: none; background: none; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: .72rem; padding: 3px 9px; cursor: pointer; }
.copy-line button:hover { color: var(--gold); border-color: var(--gold); }
.setup-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.setup-banner .btn { margin-left: auto; }
@media (max-width: 560px) {
  .setup-item { grid-template-columns: 30px minmax(0, 1fr); }
  .setup-item > .btn { grid-column: 2; justify-self: start; }
}

/* Workflow editor: "hide these options" grid */
.hide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 14px; margin: 10px 0 4px; }

/* Studio: the Settings button that opens the options panel */
.tool-opt { position: relative; }
.tool-opt.on { color: var(--gold); border-color: rgba(240,180,74,.45); background: rgba(240,180,74,.08); }
.tool-opt b { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; margin-left: 2px; border-radius: 999px; background: var(--gold); color: #2A1B02; font-size: .68rem; font-weight: 700; }

/* Template card: the length this studio can actually make, when it differs from the template's */
.tpl-fit { display: inline-block; margin-top: 6px; font-size: .68rem; font-weight: 600; color: var(--gold); background: rgba(240,180,74,.12); border: 1px solid rgba(240,180,74,.3); border-radius: 999px; padding: 2px 8px; }

/* =====================================================================
   v3.1 — search button, command palette, shortcuts, action toasts,
   low-minutes banner, mobile tab bar
   ===================================================================== */

/* Search button in the top bar */
.search-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 11px; border-radius: 11px; border: 1px solid var(--line); background: var(--glass); color: var(--ink-3); font: inherit; font-size: .86rem; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.search-btn:hover { border-color: rgba(240,180,74,.45); color: var(--ink); }
.search-btn .ic { width: 16px; height: 16px; }
.search-btn kbd { font: 600 .7rem/1 inherit; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--ink-3); background: rgba(255,255,255,.04); }
@media (max-width: 760px) { .search-btn { width: 36px; padding: 0; justify-content: center; } .search-btn span, .search-btn kbd { display: none; } }

kbd { font-family: inherit; }

/* Command palette */
.palette { position: fixed; inset: 0; z-index: 120; background: rgba(5,4,16,.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 14px 14px; animation: fadeIn .18s ease-out both; }
.palette[hidden] { display: none; }
.pal-card { width: min(640px, 100%); max-height: 72vh; display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.55); overflow: hidden; animation: palIn .22s var(--ease-out) both; }
@keyframes palIn { from { transform: translateY(-8px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.pal-search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-search .ic { width: 18px; height: 18px; color: var(--gold); flex: none; }
.pal-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: 1.02rem; padding: 4px 0; }
.pal-search kbd, .pal-foot kbd, .pal-item kbd, .keys-list kbd { font-size: .7rem; font-weight: 600; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--ink-3); background: rgba(255,255,255,.04); }
.pal-list { overflow-y: auto; padding: 6px 8px 10px; }
.pal-group { font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); padding: 12px 10px 5px; }
.pal-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 11px; background: none; border: 0; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.pal-item .ic { width: 17px; height: 17px; color: var(--ink-3); flex: none; }
.pal-item.on { background: rgba(240,180,74,.12); }
.pal-item.on .ic { color: var(--gold); }
.pal-t { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.pal-t, .pal-t small { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.pal-t small { color: var(--ink-3); font-size: .76rem; }
.pal-empty { color: var(--ink-3); padding: 18px 12px; margin: 0; font-size: .9rem; }
.pal-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 9px 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .74rem; }
.pal-foot span { display: inline-flex; align-items: center; gap: 4px; }
body.pal-open { overflow: hidden; }
@media (max-width: 640px) { .palette { padding-top: 10px; } .pal-card { max-height: calc(100vh - 20px); } .pal-foot { display: none; } }

/* Keyboard shortcuts sheet */
.keys-card { max-width: 460px; }
.keys-list { margin: 14px 0 0; display: grid; gap: 2px; }
.keys-list div { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.keys-list div:last-child { border-bottom: 0; }
.keys-list dt { color: var(--ink-2, var(--ink)); font-size: .9rem; }
.keys-list dd { margin: 0; display: flex; gap: 4px; }

/* Toast with a button */
.toast-action { justify-content: space-between; }
.toast-action span { flex: 1; min-width: 0; }
.toast-action a { color: var(--gold); font-weight: 700; white-space: nowrap; }
.toast-action button { background: none; border: 0; color: var(--ink-3); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.toast.ok { border-color: rgba(89,208,160,.4); }
.toast.err { border-color: rgba(255,139,139,.45); }

/* Low minutes */
.low-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 16px 0; padding: 11px 14px; border-radius: 14px; border: 1px solid rgba(240,180,74,.4); background: linear-gradient(90deg, rgba(240,180,74,.13), rgba(240,180,74,.04)); font-size: .9rem; }
.low-banner > .ic { width: 18px; height: 18px; color: var(--gold); flex: none; }
.low-banner span { flex: 1; min-width: 200px; }
@media (min-width: 640px) { .low-banner { margin: 18px 26px 0; } }
@media (min-width: 1024px) { .low-banner { margin: 22px 36px 0; } }
.minutes-card.is-low { border-color: rgba(240,180,74,.55); }
.minutes-card.is-low .mc-top strong { color: var(--gold); }

/* Mobile tab bar (shown whenever the sidebar is a drawer) */
.tabbar { display: none; }
@media (max-width: 1023px) {
  .tabbar { position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(12,10,34,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 4px; color: var(--ink-3); font-size: .68rem; font-weight: 600; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
  .tabbar a .ic { width: 21px; height: 21px; }
  .tabbar a.on { color: var(--gold); }
  .tabbar a.on::before { content: ''; position: absolute; top: -7px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
  .tabbar .tb-create { align-self: center; justify-self: center; width: 50px; height: 50px; padding: 0; margin-top: -18px; border-radius: 17px; display: grid; place-items: center; color: #2A1B02; background: linear-gradient(135deg, #F7D384, #F0B44A 45%, #D8912A); box-shadow: 0 10px 26px rgba(240,180,74,.35), inset 0 1px 0 rgba(255,255,255,.4); }
  .tabbar .tb-create .ic { width: 24px; height: 24px; }
  .tabbar .tb-create:active { transform: scale(.94); }
  .tb-dot { position: absolute; top: 4px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(12,10,34,.92); animation: pulseDot 1.6s ease-in-out infinite; }
  @keyframes pulseDot { 50% { transform: scale(1.35); opacity: .7; } }
  .content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
:root[data-theme="light"] .tabbar { background: rgba(250,247,240,.94); }
:root[data-theme="light"] .pal-card { background: #fff; }
:root[data-theme="light"] .palette { background: rgba(30,24,60,.35); }
/* Busy / failed cards: the status sits at the bottom, so the length badge moves to the top. */
.vthumb:not(.st-ready) > b { top: 8px; bottom: auto; }
/* The palette's input must not pick up the normal form-field box. */
.palette .pal-search input, .palette .pal-search input:focus { border: 0; box-shadow: none; outline: 0; background: transparent; height: auto; border-radius: 0; padding: 4px 0; }

/* ---------- Prompt strength ---------- */
.pstrength { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 4px 2px; font-size: .8rem; }
.st-meter { width: 74px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; flex: none; }
.st-meter i { display: block; height: 100%; border-radius: inherit; background: #ff8b8b; transition: width .4s var(--ease-out), background .4s; }
.pstrength[data-level="2"] .st-meter i { background: var(--gold); }
.pstrength[data-level="3"] .st-meter i, .pstrength[data-level="4"] .st-meter i { background: #59d0a0; }
.st-label { font-weight: 700; color: var(--ink-2, var(--ink)); }
.st-tips { display: flex; gap: 6px; flex-wrap: wrap; }
.st-tip { font: inherit; font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; border: 1px dashed rgba(240,180,74,.45); background: rgba(240,180,74,.07); color: var(--gold-2, var(--gold)); cursor: pointer; transition: background .2s, border-color .2s; }
.st-tip:hover { background: rgba(240,180,74,.16); border-style: solid; }

/* ---------- Stage: device alerts ---------- */
.notify-me { margin-top: 10px; display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: .84rem; font-weight: 600; color: var(--gold); background: rgba(240,180,74,.08); border: 1px solid rgba(240,180,74,.35); border-radius: 10px; padding: 7px 12px; cursor: pointer; }
.notify-me .ic { width: 15px; height: 15px; }
.notify-me:hover { background: rgba(240,180,74,.16); }

/* ---------- Video page ---------- */
.rate-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); }
.rate-q { font-weight: 600; font-size: .9rem; margin-right: 4px; }
.rate-btn { width: 40px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: transparent; font-size: 1.1rem; cursor: pointer; transition: transform .15s, background .2s, border-color .2s; }
.rate-btn:hover { transform: translateY(-1px); border-color: var(--line-2); }
.rate-btn.up.on { background: rgba(89,208,160,.16); border-color: rgba(89,208,160,.55); }
.rate-btn.down.on { background: rgba(255,139,139,.14); border-color: rgba(255,139,139,.5); }
.rate-thanks { font-size: .8rem; color: var(--ink-3); }
.rate-reasons { flex-basis: 100%; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-top: 6px; }
.chip-btn { font: inherit; font-size: .78rem; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--ink-2, var(--ink)); cursor: pointer; }
.chip-btn.on { border-color: rgba(255,139,139,.55); background: rgba(255,139,139,.12); color: #ffb3b3; }

.kit { margin-top: 14px; padding: 0; }
.kit-head { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; }
.kit-head::-webkit-details-marker { display: none; }
.kit-t { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.kit-t .ic { width: 16px; height: 16px; color: var(--gold); }
.kit-t small { font-size: .78rem; }
.kit[open] .osec-chev { transform: rotate(180deg); }
.kit-body { padding: 0 16px 16px; display: grid; gap: 16px; }
.kit-sec h4 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.kit-titles { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kit-titles li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--glass); font-size: .9rem; }
.kit-titles li span { min-width: 0; }
.kit-desc { width: 100%; resize: vertical; font-size: .88rem; line-height: 1.55; }
.kit-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kit-tags span { font-size: .8rem; padding: 3px 9px; border-radius: 99px; background: rgba(106,76,255,.14); border: 1px solid rgba(106,76,255,.3); }
.kit-chapters { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; font-size: .88rem; }
.kit-chapters b { font-variant-numeric: tabular-nums; color: var(--gold, #e6b84a); margin-right: 6px; }
.kit-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.kit-thumbs button { font: 800 .82rem/1.2 inherit; letter-spacing: .02em; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(240,180,74,.35); background: linear-gradient(135deg, rgba(240,180,74,.18), rgba(240,180,74,.05)); color: var(--gold-2, var(--gold)); cursor: pointer; text-transform: uppercase; }
.kit-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.kit-loading { animation: pulseText 1.2s ease-in-out infinite; }
@keyframes pulseText { 50% { opacity: .45; } }

/* Keyboard hints only make sense with a keyboard. */
@media (hover: none) { .kbd-hints { display: none; } }
/* Phones: player tools scroll sideways instead of wrapping into rows; actions become a tidy grid. */
@media (max-width: 639px) {
  .player-tools { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .player-tools::-webkit-scrollbar { display: none; }
  .player-tools > * { flex: none; }
  .video-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .video-actions .btn { justify-content: center; padding-left: 8px; padding-right: 8px; min-width: 0; }
  .video-actions .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .video-actions .va-main { grid-column: 1 / -1; }
  .video-actions .va-del { grid-column: 1 / -1; justify-self: center; }
  .hide-sm { display: none; }
  .rate-q { flex-basis: 100%; }
}

/* ---------- Help center ---------- */
.help-page { max-width: 860px; margin: 0 auto; }
.help-search { position: relative; margin: 6px 0 14px; }
.help-search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.help-search input { width: 100%; padding-left: 42px; height: 48px; border-radius: 14px; font-size: 1rem; }
.faq { display: grid; gap: 8px; }
.faq-item { border: 1px solid var(--line); border-radius: 14px; background: var(--glass); transition: border-color .2s; }
.faq-item[open] { border-color: rgba(240,180,74,.35); }
.faq-item summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; font-weight: 600; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] .osec-chev { transform: rotate(180deg); }
.faq-a { padding: 0 16px 16px; color: var(--ink-2, var(--ink)); line-height: 1.65; font-size: .93rem; }
.help-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 22px 0; }
.help-card { display: grid; gap: 4px; justify-items: start; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: transform .25s var(--ease-out), border-color .2s; }
.help-card:hover { transform: translateY(-2px); border-color: rgba(240,180,74,.4); }
.help-card > .ic { width: 22px; height: 22px; color: var(--gold); margin-bottom: 4px; }
.contact-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.my-msgs { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.my-msg { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.my-msg:last-child { border-bottom: 0; }
.my-msg > span:first-child { flex: 1; min-width: 160px; }

/* ---------- Admin support inbox ---------- */
.row-strong td strong, .row-strong td a { font-weight: 700; }
.support-msg { white-space: normal; line-height: 1.7; font-size: .97rem; }
.support-note { font-size: .86rem; color: var(--ink-3); line-height: 1.6; }
.stack-actions { display: grid; gap: 8px; justify-items: start; }
.stack-actions form { margin: 0; }

/* =====================================================================
   Charts (partials/colchart.php) — validated colours:
   series 1 = brand violet (#8b74ff dark / #6A4CFF light), failed = status critical #d03b3b.
   Both pass lightness, chroma, CVD (deutan ΔE 20+) and 3:1 contrast on the card surface.
   ===================================================================== */
.colchart { --cc-s1: #8b74ff; --cc-bad: #d03b3b; --cc-grid: rgba(244,236,216,.07); --cc-base: rgba(244,236,216,.22); --cc-surface: #13112A; }
:root[data-theme="light"] .colchart { --cc-s1: #6A4CFF; --cc-grid: rgba(28,22,51,.08); --cc-base: rgba(28,22,51,.25); --cc-surface: #FAF8F4; }
.cc-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2, var(--ink)); margin-bottom: 10px; }
.cc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cc-legend b { font-weight: 700; color: var(--ink); }
.cc-key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cc-key.s1, .cc-seg.s1 { background: var(--cc-s1); }
.cc-key.sbad, .cc-seg.sbad { background: var(--cc-bad); }
.cc-frame { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.cc-y { position: relative; height: var(--cc-h, 170px); width: 30px; font-size: .7rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cc-y span { position: absolute; right: 0; transform: translateY(50%); }
.cc-plot { position: relative; height: var(--cc-h, 170px); margin-bottom: 22px; }
.cc-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--cc-grid); }
.cc-grid:first-child { background: var(--cc-base); }
.cc-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); align-items: end; }
.cc-col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; background: none; border: 0; padding: 0; cursor: default; border-radius: 6px; }
.cc-col:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.cc-col.on { background: rgba(255,255,255,.04); }
.cc-stack { width: min(24px, 70%); display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.cc-seg { display: block; min-height: 2px; }
.cc-seg:first-child { border-radius: 4px 4px 0 0; }
.cc-col.on .cc-seg { filter: brightness(1.15); }
.cc-x { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-style: normal; font-size: .68rem; color: var(--ink-3); white-space: nowrap; }
.cc-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 6px 10px; font-size: .78rem; font-weight: 600; white-space: nowrap; box-shadow: 0 10px 24px rgba(0,0,0,.35); pointer-events: none; z-index: 3; }
.cc-table { margin-top: 6px; }
.cc-table summary { cursor: pointer; font-size: .78rem; color: var(--ink-3); }
.cc-table .table { margin-top: 8px; }
.colchart ~ .lib-stats { margin-top: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.ell1 { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strong { font-weight: 600; }
.job-cell { max-width: 480px; min-width: 220px; }
.job-cell .ell1 + .ell1 { margin-top: 2px; }

/* Meter: fill carries the state, the track is a lighter step; the number always sits beside it. */
.meter-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.meter-cell .mt { flex: 1; height: 6px; border-radius: 99px; background: rgba(139,116,255,.18); overflow: hidden; min-width: 50px; }
.meter-cell .mt i { display: block; height: 100%; border-radius: inherit; }
.meter-cell .mt i.good { background: #0ca30c; } .meter-cell .mt i.warn { background: #fab219; } .meter-cell .mt i.crit { background: #d03b3b; }
.meter-cell b { font-variant-numeric: tabular-nums; font-size: .84rem; min-width: 38px; text-align: right; }

/* Horizontal bars (single series): value at the tip. */
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; }
.hbar-top span { min-width: 0; overflow-wrap: anywhere; }
.hbar-top b { font-variant-numeric: tabular-nums; }
.hbar-track { height: 8px; }
.hbars + p { margin-top: 12px; }
.hbar-track i { display: block; height: 100%; max-width: 100%; border-radius: 0 4px 4px 0; background: #8b74ff; }
:root[data-theme="light"] .hbar-track i { background: #6A4CFF; }

/* Analytics */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.chip-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--ink-3); }
.chip-link .ic { width: 16px; height: 16px; stroke-width: 3; }
.chip-link:hover { color: var(--ink); background: var(--glass); }
.chip-link.on { color: var(--ink); border-color: rgba(240,180,74,.45); background: rgba(240,180,74,.1); }
.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.kpis + .kpis { margin-top: 12px; }
.kpis-3 .stat:last-child { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .kpis-3 .stat:last-child { grid-column: auto; }
}
.kpis .stat small { display: block; margin-top: 2px; }
.neg { color: #ff8b8b; }
.usage-card { margin-top: 18px; }
.usage-facts { display: flex; gap: 14px; flex-wrap: wrap; font-size: .84rem; color: var(--ink-3); }
.usage-facts b { color: var(--ink); font-weight: 700; }
@media (max-width: 600px) { .usage-card .card-head { flex-direction: column; align-items: flex-start; gap: 6px; } }

/* Admin: email templates */
.email-list { display: grid; gap: 10px; }
.email-item { padding: 0; }
.email-sum { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; gap: 14px; align-items: center; padding: 14px 16px; cursor: pointer; }
.email-sum::-webkit-details-marker { display: none; }
.email-sum strong { margin-right: 6px; }
.email-sum small { display: block; margin-top: 2px; }
.email-item[open] .osec-chev { transform: rotate(180deg); }
.email-subj { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; padding: 0 16px 16px; }
.email-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.email-preview iframe { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 12px; background: #0A0820; margin-top: 6px; }
.var-chip { font: 600 .76rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 4px 7px; margin: 2px 2px 0 0; border-radius: 7px; border: 1px solid var(--line-2); background: var(--glass); color: var(--gold-2, var(--gold)); cursor: pointer; }
@media (max-width: 900px) { .email-body { grid-template-columns: 1fr; } .email-subj { display: none; } .email-sum { grid-template-columns: minmax(0, 1fr) 20px; } }
/* Settings → Help: FAQ editor */
.faq-editor { display: grid; gap: 10px; margin-bottom: 12px; }
.faq-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--glass); }
.faq-row-fields { display: grid; gap: 8px; }
.faq-row-fields input { font-weight: 600; }
.faq-row-tools { display: flex; flex-direction: column; gap: 4px; }
/* Connect → AI writer */
.ai-card.is-on { border-color: rgba(89,208,160,.35); }
.ai-card h2 .ic { width: 17px; height: 17px; color: var(--gold); vertical-align: -3px; }
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; margin: 10px 0 8px; }
.ai-model-row { display: flex; gap: 6px; }
.ai-model-row input { flex: 1; min-width: 0; }
.ai-form .field .lbl { font-size: .8rem; font-weight: 600; }
/* Status word next to a number: icon + label, never colour alone */
.lvl { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: .78rem; }
.lvl-good { color: #3fcf6a; } .lvl-warn { color: #fab219; } .lvl-crit { color: #ff8b8b; }
:root[data-theme="light"] .lvl-good { color: #0a7d0a; } :root[data-theme="light"] .lvl-warn { color: #9a6700; } :root[data-theme="light"] .lvl-crit { color: #b42323; }

/* ---------------------------------------------------------------- Engine (4.0) */
.block { display: block; }
.right { text-align: right; }
.ell2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.in-sm { width: 92px; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card-actions, .page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-actions { margin-top: 12px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 12px; }
.inline-form .field { margin: 0; }
.inline-money { display: flex; align-items: center; gap: 4px; }
.inline-money span { color: var(--muted); font-size: .85rem; }
.codeblock { background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px;
             font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; line-height: 1.6; overflow-x: auto; }
.card.is-highlight { border-color: rgba(240,180,74,.45); background: rgba(240,180,74,.06); }
.eng-steps { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.55; color: var(--ink-2); font-size: .92rem; }
.eng-steps b { color: var(--ink); }
.eng-svc-table td { vertical-align: top; }
.eng-svc-table .check { margin: 0; }
tr.eng-svc-out td { border-top: 0; padding-top: 0; }
tr.eng-svc-out .conn-out { margin-bottom: 8px; }
.eng-svc-form + .conn-models { margin-top: 16px; }
@media (max-width: 560px) { .inline-form { flex-direction: column; align-items: stretch; } }

/* Long-video mode in the studio */
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 520px; margin: 0 auto 18px; }
.mode-tabs button { display: grid; justify-items: center; gap: 2px; padding: 12px 10px; border-radius: 14px;
                    background: var(--glass); border: 1px solid var(--line); color: var(--ink-2); transition: background .2s, border-color .2s, transform .2s var(--ease-out); }
.mode-tabs button svg { width: 17px; height: 17px; color: var(--gold); }
.mode-tabs button b { font-size: .95rem; font-weight: 700; }
.mode-tabs button small { font-size: .74rem; color: var(--ink-3); text-align: center; }
.mode-tabs button:hover { background: var(--glass-2); transform: translateY(-1px); }
.mode-tabs button.on { background: rgba(240,180,74,.16); border-color: rgba(240,180,74,.6); color: var(--gold-2); }
.mode-tabs button.on small { color: var(--gold-2); opacity: .85; }
#composerLong .options { display: grid; gap: 18px; max-height: none; opacity: 1; overflow: visible; padding-top: 18px; }
#composerLong .btn-generate.is-short { opacity: .65; }
#composerLong .conn-out { margin-top: 10px; }
.eng-running { display: grid; gap: 8px; max-width: 640px; margin: 0 auto 16px; }
.eng-running-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px;
                   background: var(--glass); border: 1px solid var(--line); color: inherit; }
.eng-running-row:hover { background: var(--glass-2); }
.eng-running-row .min0 { flex: 1; display: grid; gap: 1px; }
.eng-running-row small { font-size: .78rem; }

/* The long-video progress page */
.eng-progress { max-width: 720px; margin: 0 auto; display: grid; gap: 18px; }
.eng-progress .stage-steps span.on { color: var(--gold-2); opacity: .8; }
.eng-progress .stage-steps span.now { color: var(--gold); opacity: 1; font-weight: 700; }
.eng-explain { margin: 0; }
@media (max-width: 520px) { .mode-tabs { grid-template-columns: 1fr; } }
/* Grid forms: a wide table inside a section must scroll inside its own box, never widen the page. */
.form > * { min-width: 0; }
.tabs + .form, .tabs + .flash, .tabs + section, .tabs + .conn-grid, .tabs + .inline-form, .flash + .conn-grid, .inline-form + .tscroll, .inline-form + .empty { margin-top: 14px; }
.eng-steps + .eng-note { margin-top: 14px; }

/* 4.6 — storyboard check */
.storyboard { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.sb-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.sb-head > div { flex: 1 1 320px; min-width: 0; }
.sb-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.sb-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card, rgba(255,255,255,.02)); display: flex; flex-direction: column; }
.sb-pic { position: relative; aspect-ratio: 16 / 9; background: #0c0c12; }
.sb-pic img, .sb-pic video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .8rem; }
.sb-num { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.65); color: #fff; font-weight: 700; font-size: .72rem; border-radius: 999px; padding: 2px 8px; }
.sb-kind { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: .68rem; border-radius: 999px; padding: 2px 8px; }
.sb-words { font-size: .84rem; line-height: 1.45; margin: 10px 12px 6px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sb-edit { margin: 0 12px 12px; font-size: .8rem; }
.sb-edit summary { cursor: pointer; color: var(--gold); }
.sb-edit textarea { width: 100%; margin: 8px 0; font-size: .8rem; }
.sb-toggle { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 10px; line-height: 1.4; }
.stage-steps { flex-wrap: wrap; }
/* Guided admin and compact navigation. Native details work without JavaScript. */
.admin-next{display:flex;align-items:center;justify-content:space-between;gap:24px}.admin-next p{max-width:760px}.operation-chips{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0}.admin-pipeline{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.pipeline-part{display:flex;flex-direction:column;gap:8px;border:1px solid var(--line);border-radius:12px;padding:16px;min-width:0}.pipeline-part span{font-size:13px;opacity:.75}.pipeline-part.is-ready{border-color:rgba(83,224,194,.3)}.guide-defaults{margin-top:18px}.guide-defaults summary,.engine-advanced summary,.admin-nav-advanced summary{cursor:pointer;padding:12px 0;font-weight:600}.engine-navigation{margin-bottom:24px}.engine-navigation .tabs{margin-bottom:8px}.engine-advanced{padding:0 12px;border:1px solid var(--line);border-radius:12px}.engine-advanced .tabs{flex-wrap:wrap}.admin-nav-advanced{margin-top:14px;padding-top:10px;border-top:1px solid var(--line)}.admin-nav-advanced summary{display:list-item;padding:12px 16px;color:var(--ink-3)}.admin-nav-advanced a{display:flex;gap:12px;padding:11px 16px;border-radius:10px}.admin-nav-advanced a.on{color:var(--gold);background:rgba(246,191,79,.09)}.duration-choice-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0}.admin-guide :focus-visible,.admin-nav-advanced summary:focus-visible,.engine-advanced summary:focus-visible{outline:2px solid var(--gold);outline-offset:4px}
@media(max-width:900px){.admin-pipeline{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-next{align-items:flex-start;flex-direction:column}.duration-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.duration-choice-grid{grid-template-columns:1fr}.pipeline-part{padding:12px}.admin-next .btn{white-space:normal;max-width:100%}}

/* Optional, prompt-derived creative contract. */
.creative-brief{margin:12px 0;padding:18px;border:1px solid var(--border,rgba(255,255,255,.13));border-radius:16px;background:var(--card,rgba(255,255,255,.025));min-width:0}.creative-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.creative-top p{margin:6px 0 0;max-width:65ch}.creative-brief summary{cursor:pointer;padding:12px 0;font-size:13px}.creative-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:14px 0}.creative-field{display:flex;flex-direction:column;gap:6px;min-width:0}.creative-field>span{display:flex;justify-content:space-between;gap:8px;font-size:12px}.creative-field small{color:var(--muted,#aaa);font-size:10px}.creative-field textarea{min-height:78px;resize:vertical}.creative-field input[type=color]{width:100%;height:42px;padding:5px}.creative-actions{display:flex;gap:8px;flex-wrap:wrap}.creative-actions input{flex:1;min-width:140px}.creative-brief select,.creative-brief input{max-width:100%;min-width:0}.creative-brief [type=file]{font-size:12px}@media(max-width:600px){.creative-top{flex-direction:column}.creative-grid{grid-template-columns:1fr}.creative-brief{padding:14px}.creative-actions{flex-direction:column}}

/* 5.4.1: exact output choices remain visible while advanced controls stay optional. */
.composer-basics{margin:16px 0;background:var(--glass);border-color:var(--line-2)}
.basics-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px}
.composer-basics .osec-body{animation:none;padding-top:4px}
.composer-basics .seg button,.creative-brief .select,.creative-brief summary{min-height:44px}
.output-summary{display:block;font-size:.84rem;color:var(--ink);margin-bottom:6px;overflow-wrap:anywhere}
.creative-sections{display:grid;gap:16px;margin:16px 0;min-width:0}
.creative-section{margin:0;padding:10px 14px 0;border:1px solid var(--line);border-radius:12px;min-width:0}
.creative-section legend{padding:0 6px;font-size:.82rem;font-weight:700;color:var(--ink)}
.creative-section .creative-grid{margin:4px 0 14px}
.asset-selection{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-top:6px;font-size:.75rem;color:var(--ink-3)}
.asset-selection button{min-height:36px;text-align:left}
.composer-basics :focus-visible,.creative-brief :focus-visible{outline:2px solid var(--gold);outline-offset:3px}
@media(max-width:639px){.basics-heading{align-items:flex-start;flex-direction:column;gap:4px}.composer-basics .osec-sum{display:block;text-align:left;white-space:normal;font-size:.75rem}.creative-section{padding-left:10px;padding-right:10px}.creative-field>span{flex-wrap:wrap}.composer-foot .cost{width:100%}}

/* 5.6.1 Generation theatre */
.theatre { display: grid; gap: 14px; }
.th-screen { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #07061a; border: 1px solid rgba(240,180,74,.22); box-shadow: 0 30px 80px -40px rgba(106,76,255,.8), inset 0 0 0 1px rgba(255,255,255,.04); isolation: isolate; }
.theatre.portrait .th-screen { aspect-ratio: 4 / 5; max-height: 70vh; }
.th-aurora { position: absolute; inset: -20%; z-index: 0; filter: blur(40px); opacity: .9; }
.th-aurora i { position: absolute; width: 55%; height: 60%; border-radius: 50%; mix-blend-mode: screen; animation: thFloat 14s ease-in-out infinite; }
.th-aurora i:nth-child(1) { left: 5%; top: 10%; background: radial-gradient(circle, rgba(106,76,255,.75), transparent 65%); }
.th-aurora i:nth-child(2) { right: 0; top: 30%; background: radial-gradient(circle, rgba(240,180,74,.55), transparent 65%); animation-delay: -5s; animation-duration: 17s; }
.th-aurora i:nth-child(3) { left: 30%; bottom: 0; background: radial-gradient(circle, rgba(126,224,200,.45), transparent 65%); animation-delay: -9s; animation-duration: 20s; }
@keyframes thFloat { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(8%,-6%) scale(1.15); } 66% { transform: translate(-6%,7%) scale(.92); } }
.th-grain { position: absolute; inset: -10%; z-index: 1; opacity: .09; background-image: 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%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: thGrain .9s steps(3) infinite; pointer-events: none; mix-blend-mode: overlay; }
@keyframes thGrain { 0% { transform: translate(0,0); } 50% { transform: translate(-2%,1%); } 100% { transform: translate(1%,-2%); } }
.th-film { position: absolute; left: 0; right: 0; bottom: 20%; z-index: 2; display: flex; gap: 8px; padding: 0 5%; justify-content: center; perspective: 600px; }
.th-tile { position: relative; flex: 1 1 0; max-width: 92px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: linear-gradient(110deg, rgba(255,255,255,.04) 30%, rgba(255,255,255,.14) 50%, rgba(255,255,255,.04) 70%); background-size: 250% 100%; animation: thShimmer 1.8s linear infinite; border: 1px solid rgba(255,255,255,.08); transform: rotateX(18deg); transition: transform .6s var(--ease-out), border-color .4s; }
.th-tile em { position: absolute; left: 6px; top: 4px; z-index: 2; font-style: normal; font-size: .62rem; font-weight: 700; color: rgba(255,255,255,.55); }
.th-tile img, .th-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: thPop .7s var(--ease-out) both; }
.th-tile.ready { border-color: rgba(240,180,74,.65); animation: none; background: rgba(240,180,74,.18); transform: rotateX(0) translateY(-4px); }
.th-tile.ready::after { content: "✓"; position: absolute; right: 5px; bottom: 3px; z-index: 2; font-size: .7rem; color: #1a1205; background: var(--gold); border-radius: 50%; width: 15px; height: 15px; display: grid; place-items: center; font-weight: 800; }
@keyframes thShimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@keyframes thPop { from { opacity: 0; transform: scale(1.25); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.th-center { position: absolute; inset: 0 0 32% 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; padding: 0 16px; }
.th-orb { position: relative; width: 74px; height: 74px; display: grid; place-items: center; margin-bottom: 4px; }
.th-orb svg { width: 34px; height: 34px; color: var(--gold); stroke: var(--gold); fill: none; stroke-width: 1.75; filter: drop-shadow(0 0 18px rgba(240,180,74,.95)); animation: lampFloat 3s ease-in-out infinite; position: relative; z-index: 1; }
.th-orb i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(240,180,74,.55); animation: ripple 2.4s ease-out infinite; }
.th-orb i:nth-child(2) { animation-delay: .8s; } .th-orb i:nth-child(3) { animation-delay: 1.6s; }
.th-stage { font-family: var(--font-display); font-size: clamp(1.3rem, 3.6vw, 2rem); line-height: 1.1; color: #fff; letter-spacing: -.01em; text-shadow: 0 4px 30px rgba(0,0,0,.6); }
.th-line { min-height: 1.4em; font-size: .92rem; color: var(--gold-2); opacity: .95; }
.th-line.in { animation: thLine .6s var(--ease-out) both; }
@keyframes thLine { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: .95; transform: none; filter: none; } }
.th-now { position: absolute; left: 6%; right: 6%; bottom: 6%; z-index: 3; text-align: center; font-size: .8rem; font-style: italic; color: rgba(255,255,255,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-pct { position: absolute; right: 16px; top: 12px; z-index: 3; display: flex; align-items: baseline; gap: 2px; font-weight: 800; color: #fff; text-shadow: 0 2px 20px rgba(0,0,0,.6); }
.th-pct b { font-size: 1.9rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.th-pct span { font-size: .9rem; color: var(--gold-2); }
.th-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; z-index: 4; background: rgba(255,255,255,.08); }
.th-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--gold), var(--gold-2)); box-shadow: 0 0 18px rgba(240,180,74,.9); transition: width .5s var(--ease-out); }
.th-steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; position: relative; }
.th-steps li { display: grid; justify-items: center; gap: 6px; text-align: center; position: relative; }
.th-steps li::before { content: ""; position: absolute; top: 17px; right: 50%; width: 100%; height: 2px; background: rgba(255,255,255,.08); z-index: 0; }
.th-steps li:first-child::before { display: none; }
.th-steps li[data-state="done"]::before, .th-steps li[data-state="now"]::before { background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.th-dot { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink-3); transition: all .4s var(--ease-out); }
.th-dot svg { width: 16px; height: 16px; }
.th-steps li[data-state="done"] .th-dot { background: var(--gold); border-color: var(--gold); color: #1a1205; }
.th-steps li[data-state="now"] .th-dot { border-color: var(--gold); color: var(--gold-2); box-shadow: 0 0 0 5px rgba(240,180,74,.15), 0 0 24px rgba(240,180,74,.6); animation: thPulse 1.6s ease-in-out infinite; }
@keyframes thPulse { 50% { box-shadow: 0 0 0 9px rgba(240,180,74,.06), 0 0 30px rgba(240,180,74,.8); } }
.th-label { font-size: .72rem; font-weight: 700; color: var(--ink-3); letter-spacing: .02em; }
.th-steps li[data-state="now"] .th-label, .th-steps li[data-state="done"] .th-label { color: var(--ink); }
.th-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; font-size: .78rem; color: var(--ink-3); }
.th-meta [data-th-elapsed] { font-variant-numeric: tabular-nums; color: var(--gold-2); font-weight: 700; }
.theatre[data-state="wait"] .th-orb svg { color: var(--ember); stroke: var(--ember); filter: drop-shadow(0 0 14px rgba(242,107,78,.8)); }
.theatre[data-state="wait"] .th-line { color: #FFB4A3; }
.theatre[data-state="done"] .th-orb i, .theatre[data-state="done"] .th-grain { display: none; }
.theatre[data-state="done"] .th-tile { border-color: var(--gold); }
/* The classic stage parts stay in the DOM for compatibility but the theatre replaces them visually. */
.has-theatre .stage-top, .has-theatre > .bar, .has-theatre .stage-steps, .has-theatre .stage-meta { display: none !important; }
@media (max-width: 560px) { .th-screen, .theatre.portrait .th-screen { aspect-ratio: auto; min-height: 330px; } .th-center { inset: 0 0 30% 0; } .th-tile::after { width: 12px; height: 12px; font-size: .55rem; } .th-label { font-size: .62rem; } .th-dot { width: 30px; height: 30px; } .th-steps li::before { top: 14px; } .th-pct b { font-size: 1.4rem; } .th-film { gap: 5px; bottom: 22%; } .th-now { display: none; } }
@media (prefers-reduced-motion: reduce) { .th-aurora i, .th-grain, .th-tile, .th-orb svg, .th-orb i, .th-steps li[data-state="now"] .th-dot { animation: none !important; } }

/* 5.6.1 Studio: a calmer composer */
.composer .pstrength { display: none !important; }
.options .templates { padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--glass); }
.options .creative-brief { margin: 0; }

/* ---------- 5.6.2 generation theatre polish + phone layout ---------- */
.th-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-2); background: rgba(240,180,74,.12); border: 1px solid rgba(240,180,74,.3); }
.th-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: thPulse 1.6s ease-in-out infinite; }
.theatre[data-state="done"] .th-chip::before { animation: none; }
.theatre[data-state="wait"] .th-chip { color: #FFB4A3; background: rgba(242,107,78,.12); border-color: rgba(242,107,78,.35); }
.theatre[data-state="wait"] .th-chip::before { background: var(--ember); box-shadow: 0 0 10px var(--ember); }
.th-title { max-width: min(560px, 90%); font-size: .85rem; font-weight: 600; color: rgba(255,255,255,.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-notify { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font: inherit; font-size: .76rem; font-weight: 600; cursor: pointer; transition: border-color .2s, color .2s; }
.th-notify:hover { border-color: var(--gold); color: var(--gold-2); }
.th-notify.on { border-color: rgba(240,180,74,.5); color: var(--gold-2); }
.th-notify svg { width: 14px; height: 14px; }
.th-center .th-orb { margin-top: 2px; }
.th-title { margin-bottom: 8px; }
@media (max-width: 560px) {
  .stage-card.has-theatre { padding: 10px; border-radius: 22px; }
  .th-screen, .theatre.portrait .th-screen { aspect-ratio: auto; min-height: 0; max-height: none; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 46px 0 22px; border-radius: 18px; }
  .th-center { position: relative; inset: auto; padding: 0 18px; gap: 7px; order: 1; }
  .th-film { order: 2; }
  .th-title { margin-bottom: 2px; }
  .th-orb { width: 62px; height: 62px; }
  .th-orb svg { width: 28px; height: 28px; }
  .th-stage { font-size: 1.5rem; }
  .th-line { font-size: .86rem; }
  .th-chip { position: absolute; left: 14px; top: -34px; }
  .th-pct { top: 10px; right: 14px; }
  .th-pct b { font-size: 1.5rem; }
  .th-film { position: relative; left: auto; right: auto; bottom: auto; justify-content: flex-start; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; gap: 8px; padding: 6px 18px 4px; perspective: none; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent); }
  .th-film::-webkit-scrollbar { display: none; }
  .th-tile { flex: 0 0 112px; max-width: none; transform: none; scroll-snap-align: center; border-radius: 10px; }
  .theatre.portrait .th-tile { flex-basis: 66px; aspect-ratio: 9 / 16; }
  .th-tile.ready { transform: translateY(-2px); }
  .th-tile.ready::after { width: 17px; height: 17px; font-size: .62rem; right: 5px; bottom: 5px; }
  .th-tile em { font-size: .66rem; }
  .th-steps { gap: 2px; padding: 4px 2px 0; }
  .th-steps li::before { top: 15px; }
  .th-dot { width: 31px; height: 31px; }
  .th-dot svg { width: 14px; height: 14px; }
  .th-label { font-size: .6rem; }
  .th-steps li[data-state="next"] .th-label { opacity: .6; }
  .th-meta { flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 2px 8px 6px; }
  .th-meta > span:nth-child(2) { font-size: .72rem; max-width: 260px; }
}
@media (max-width: 360px) { .th-label { display: none; } .th-steps li[data-state="now"] .th-label { display: block; } }
@media (max-width: 560px) {
  /* Studio on phones: three formats side by side, idea chips in one swipeable row. */
  .seg-orient { grid-template-columns: repeat(3, 1fr); }
  .seg-orient button { padding: 10px 4px; }
  .ideas { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-right: -16px; padding-right: 16px; }
  .ideas::-webkit-scrollbar { display: none; }
  .ideas .idea, .ideas-label { flex: 0 0 auto; white-space: nowrap; }
}
/* 5.6.2: generation screen on the video page; a busy vertical player never collapses to a thin line. */
.lib-theatre { margin-bottom: 4px; }
.lib-theatre:empty { display: none; }
.lib-theatre-link { margin: 6px 0 0; text-align: center; }
.video-page[data-busy="1"] .player.tall { width: min(100%, 420px); max-height: none; }

/* 16.1 two-step sign-in */
.totp-setup { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.totp-qr[hidden] { display: none; }
.totp-qr { background: #fff; padding: 10px; border-radius: 12px; width: 196px; height: 196px; display: grid; place-items: center; }
.totp-qr img, .totp-qr canvas { display: block; }
.totp-key { font-size: 1rem; letter-spacing: .06em; word-break: break-all; }
.steps-list { padding-left: 1.2em; margin: 8px 0; }
.steps-list li { margin: 4px 0; }
pre.codes { font-size: .95rem; line-height: 1.7; letter-spacing: .05em; }
.totp-confirm { max-width: 320px; }
.code-input { font-size: 1.4rem; letter-spacing: .25em; text-align: center; }

/* 16.1 install card (PWA) */
.install-sheet { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateY(24px); opacity: 0; transition: transform .3s var(--ease-out, ease), opacity .3s; pointer-events: none; }
.install-sheet.show { transform: none; opacity: 1; pointer-events: auto; }
.install-card { position: relative; max-width: 420px; margin: 0 auto; padding: 18px 18px 16px; border-radius: 20px; background: linear-gradient(180deg, rgba(40,32,88,.98), rgba(22,18,52,.98)); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0,0,0,.45); color: var(--ink); }
[data-theme="light"] .install-card { background: #fff; box-shadow: 0 18px 50px rgba(20,16,60,.18); }
.install-head { display: flex; gap: 14px; align-items: center; padding-right: 22px; }
.install-head img { border-radius: 14px; flex: none; }
.install-head strong { display: block; font-size: 1.02rem; margin-bottom: 2px; }
.install-head span { display: block; color: var(--ink-2); font-size: .86rem; line-height: 1.4; }
.install-steps { margin: 14px 0 4px; padding-left: 1.3em; font-size: .9rem; line-height: 1.5; }
.install-steps li { margin: 6px 0; display: list-item; }
.install-steps b { display: inline; }
.install-steps .ios-share { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin: 0 2px; color: #3a8bff; }
.install-actions { display: flex; gap: 8px; margin-top: 14px; }
.install-actions .btn { flex: 1; justify-content: center; }
.install-x { position: absolute; top: 8px; right: 10px; width: 32px; height: 32px; border: 0; background: none; color: var(--ink-3); font-size: 1.4rem; line-height: 1; cursor: pointer; border-radius: 50%; }
@media (min-width: 1024px) { .install-sheet { left: auto; right: 24px; bottom: 24px; width: 380px; } }

/* 16.1 studio on a phone: the prompt box is reached sooner (compact greeting, smaller style cards, tighter lengths) */
@media (max-width: 639px) {
  .studio .greet { gap: 8px; padding-top: 2px; }
  .studio .greet .lamp { display: none; }
  .studio .greet h1 { font-size: 1.42rem; }
  .studio .greet-stats { gap: 6px; }
  .studio .greet-stats span { font-size: .72rem; padding: 4px 10px; }
  .studio .composer-wrap { gap: 16px; }
  .studio .styles-head small { display: none; }
  .studio .styles-row .style-card { flex-basis: 156px; }
  .studio .style-card .sc-text { padding: 7px 10px 9px; }
  .studio .style-card .sc-text small, .studio .style-card .sc-text span:not(:first-child) { display: none; }
  .seg-dur { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .seg-dur button { padding: 8px 4px; font-size: .86rem; }
  .seg-dur button small { font-size: .64rem; }
}
/* 16.1: "23 min 30 sec" stays on one line in the sidebar */
.mc-top { flex-wrap: wrap; gap: 2px 8px; }
.mc-top strong { font-size: 1.32rem; white-space: nowrap; }

/* 16.1: read the script before the voice-over */
.script-check { margin: 18px 0; border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 16px; background: var(--glass); }
.script-check .sc-title { max-width: 560px; margin-bottom: 12px; }
.sc-parts { display: grid; gap: 12px; }
.sc-part { display: block; }
.sc-head { display: flex; gap: 8px; align-items: center; font-size: .9rem; margin-bottom: 6px; color: var(--ink-3); }
.sc-head b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 99px; background: var(--gold); color: #1a1405; font-size: .75rem; }
.sc-part textarea { width: 100%; line-height: 1.55; resize: vertical; overflow: hidden; min-height: 96px; }
.sc-foot { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 14px; }
.sc-foot .danger { color: var(--ember); font-weight: 600; }
.sc-btns { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 639px) { .sc-btns { width: 100%; } .sc-btns .btn { flex: 1 1 auto; justify-content: center; } }

/* 16.1: free trial + sign-up bot check */
.trial-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px auto 14px; max-width: 760px; padding: 10px 14px; border: 1px solid rgba(240,180,74,.35); border-radius: var(--r); background: rgba(240,180,74,.08); font-size: .92rem; }
.trial-strip > .ic { color: var(--gold); flex: none; }
.trial-strip > span { flex: 1 1 auto; min-width: 0; }
.trial-link { color: var(--gold); font-weight: 600; white-space: nowrap; }
@media (max-width: 639px) { .trial-strip { padding: 7px 12px; font-size: .84rem; gap: 8px; flex-wrap: nowrap; margin-bottom: 10px; } .trial-wm { display: none; } }
.trial-pill { display: flex; gap: 8px; align-items: center; justify-content: center; margin: -4px 0 14px; padding: 8px 12px; border-radius: 99px; background: rgba(240,180,74,.10); color: var(--gold-2); font-size: .88rem; }
.hp-field { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.turnstile-box { margin: 4px 0 12px; min-height: 65px; }

/* 16.2: offers — free plan with WhatsApp + invites, views challenge */
.offer-pill { display: inline-block; padding: 3px 9px; border-radius: 99px; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #1a1405; font-size: .7rem; font-weight: 800; letter-spacing: .08em; }
.offer-strip { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 10px; font-size: .84rem; color: var(--ink-2); }
.offer-strip b, .offer-timer b { font-variant-numeric: tabular-nums; color: var(--gold-2); }
.offer-timer { display: flex; gap: 8px; align-items: center; color: var(--ink-2); margin: 10px 0 0; }
.pw-plan .offer-earn { margin: 6px 0; }
.locked-note { font-size: .84rem; color: var(--ink-2); margin: 4px 0 8px; }
.locked-note a, .mc-locked { color: var(--gold); }
.mc-locked { display: block; font-size: .78rem; margin: 2px 0 6px; text-decoration: none; }
.offer-page { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.offer-hero { text-align: center; background: radial-gradient(120% 140% at 50% 0%, rgba(240,180,74,.16), transparent 60%), var(--glass); }
.offer-hero .offer-timer { justify-content: center; }
.offer-hero h1 { margin: 10px 0 4px; }
.offer-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.offer-steps > li { opacity: .55; transition: opacity .2s; }
.offer-steps > li.is-now, .offer-steps > li.is-done { opacity: 1; }
.offer-steps > li.is-now { border-color: rgba(240,180,74,.45); }
.offer-steps .btn-lg { margin-top: 6px; }
.step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 99px; background: var(--glass-2); margin-right: 6px; font-size: .85rem; }
.is-now .step-n { background: var(--gold); color: #1a1405; }
.is-done .step-n { background: rgba(80,200,120,.25); }
.phone-verify .pv-row { display: flex; gap: 8px; }
.phone-verify .pv-row input { flex: 1 1 auto; min-width: 0; font-size: 1.05rem; letter-spacing: .02em; }
.phone-verify [data-pv-code-input] { letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.phone-verify [data-pv-msg] { margin: 8px 0 0; }
.phone-verify [data-pv-msg].danger { color: var(--ember); }
.phone-verify.is-verified [data-pv-msg] { color: #6fd39a; font-weight: 600; }
.offer-rules { padding-left: 1.4em; display: grid; gap: 6px; list-style: decimal; }
.offer-rules li { display: list-item; }
.offer-code { font-size: 1rem; padding: 2px 8px; border-radius: 6px; background: var(--glass-2); color: var(--gold-2); }
.entry-rejected { border-color: rgba(242,107,78,.4); }
.entry-approved { border-color: rgba(80,200,120,.4); }
.invite-share { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.offer-plan .card-head small { font-weight: 400; margin-left: 6px; }
.offer-box { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.offer-box > summary { cursor: pointer; list-style: none; }
.offer-box > summary::-webkit-details-marker { display: none; }
.offer-box[open] > summary { margin-bottom: 12px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.review-card.is-pending { border-color: rgba(240,180,74,.45); }
.review-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.review-grid p { margin: 4px 0; }
.review-shot { max-width: 100%; max-height: 320px; border-radius: 10px; border: 1px solid var(--line); }
@media (min-width: 900px) { .review-grid { grid-template-columns: 1fr 260px; } }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.reject-form { display: flex; gap: 6px; flex: 1 1 280px; }
.reject-form input { flex: 1 1 auto; min-width: 0; }
.steps-list { padding-left: 1.4em; display: grid; gap: 6px; list-style: decimal; }
.steps-list li { display: list-item; }
fieldset.otp-meta, fieldset.otp-http { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 12px 0; }
fieldset legend { padding: 0 6px; font-weight: 600; }
@media (max-width: 639px) { .phone-verify .pv-row { flex-direction: column; } .phone-verify .pv-row .btn { width: 100%; justify-content: center; } }

/* 16.2: install bar above the header (sticky; the header moves down under it) */
.install-bar { position: sticky; top: 0; z-index: 31; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 12px;
  background: linear-gradient(90deg, rgba(240,180,74,.22), rgba(124,92,255,.20) 60%, rgba(240,180,74,.14)), var(--bg-2);
  border-bottom: 1px solid rgba(240,180,74,.35); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transform: translateY(-100%); opacity: 0; transition: transform .25s var(--ease-out), opacity .25s; }
.install-bar.show { transform: none; opacity: 1; }
.install-bar img { border-radius: 7px; flex: none; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.install-bar .ib-text { flex: 1 1 auto; min-width: 0; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.install-bar .ib-text b { color: var(--ink); }
.install-bar .ib-go { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 14px; border: 0; border-radius: 99px; cursor: pointer;
  font: inherit; font-size: .84rem; font-weight: 700; color: #1a1405; background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: var(--shadow-gold); }
.install-bar .ib-go .ic { width: 15px; height: 15px; }
.install-bar .ib-x { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 99px; background: transparent; color: var(--ink-3); cursor: pointer; }
.install-bar .ib-x:hover { background: var(--glass-2); color: var(--ink); }
.install-bar .ib-x .ic { width: 16px; height: 16px; }
.has-ibar .topbar { top: 44px; }
@media (max-width: 639px) { .install-bar .ib-more { display: none; } }
:root[data-theme="light"] .install-bar { background: linear-gradient(90deg, rgba(217,154,43,.20), rgba(124,92,255,.14) 60%, rgba(217,154,43,.12)), #fff; }

/* 17.1: edit the scenes of a finished video */
.scene-edit .se-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.scene-edit .se-bar p { margin: 4px 0 0; }
.scene-edit .se-scene { margin-bottom: 16px; }
.scene-edit .se-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.scene-edit .se-words { margin: 0; line-height: 1.45; }
.scene-edit .se-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.scene-edit .se-photo { position: relative; display: block; border-radius: 10px; overflow: hidden; border: 2px solid transparent; cursor: pointer; aspect-ratio: 4 / 3; background: rgba(127,127,127,.12); }
.scene-edit .se-photo.on, .scene-edit .se-photo:has(input:checked) { border-color: var(--gold, #d6a84a); }
.scene-edit .se-photo input { position: absolute; opacity: 0; pointer-events: none; }
.scene-edit .se-photo img, .scene-edit .se-photo video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene-edit .se-photo button { all: unset; display: block; width: 100%; height: 100%; cursor: pointer; }
.scene-edit .se-tag, .scene-edit .se-credit { position: absolute; left: 4px; bottom: 4px; right: 4px; font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-edit .se-row { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; align-items: end; }
.scene-edit .se-search .se-row { grid-template-columns: 1fr auto; }
.scene-edit .se-search summary { cursor: pointer; margin-top: 8px; }
@media (max-width: 640px) { .scene-edit .se-row { grid-template-columns: 1fr; } }
