/* PulseCut design system, style 5: black, glass, white glow. docs/DESIGN_SYSTEM.md explains the rules; this file is the single source of the values.
   The look: a cutting bench at night. One cool, almost grey ramp for every surface, hairlines instead of shadows, ink buttons,
   and one violet accent that means "the cut": the mark in the logo, the chosen tab, a selection, progress.
   Timecodes and figures are set in mono. Colour lives in the content: the clips. No gradients between hues, no glows.
   Layers: 1) tokens  2) base  3) layout (bar, page, sub-tabs)  4) primitives  5) patterns (landing, auth, plans, stats, charts)  6) screens. */

/* 1. tokens ------------------------------------------------------------------------------------------------ */
:root {
  color-scheme: dark;
  /* surfaces: black page, glass panels (white at 4.5% / 6%), raised = an opaque near-black for sheets and menus. Lines are white at 9% and 20%. */
  --bg: #000; --panel: rgba(255,255,255,.045); --panel-2: rgba(255,255,255,.07); --raised: #0e0e11; --line: rgba(255,255,255,.09); --line-strong: rgba(255,255,255,.2);
  --text: #f5f5f7; --muted: rgba(245,245,247,.64); --faint: rgba(245,245,247,.42);
  /* the accent (the cut) and the white button */
  --accent: #9d8bff; --accent-hover: #b0a2ff; --accent-ink: #08080a; --accent-soft: rgba(157,139,255,.15); --accent-text: #c6bbff;
  --primary: #f5f5f7; --primary-hover: #ffffff; --primary-ink: #08080a;
  /* status */
  --green: #4ade80; --amber: #fbbf24; --red: #fb7185; --blue: #74a5ff;
  /* glass: the rim is a hairline plus a lit top edge; glow is the white halo of the main button */
  --glass-rim: inset 0 0 0 .67px rgba(255,255,255,.14), inset 0 1px 0 rgba(255,255,255,.2);
  --glass-blur: blur(24px) saturate(1.6);
  --btn-bg: linear-gradient(180deg, #ffffff, #dcdce2);
  --btn-glow: inset 0 -1px 0 rgba(0,0,0,.12), 0 0 0 1px rgba(255,255,255,.35), 0 0 20px rgba(255,255,255,.24), 0 0 56px rgba(255,255,255,.1);
  /* shape, depth, motion */
  --r-s: 8px; --r-m: 10px; --r-l: 14px; --r-xl: 20px; --radius: var(--r-l);
  --shadow-1: none;
  --shadow-2: 0 20px 50px -16px rgba(0,0,0,.9);
  --shadow-3: 0 40px 100px -20px rgba(0,0,0,.95);
  --ease: cubic-bezier(.22,1,.36,1); --fast: .15s; --slow: .3s;
  /* spacing scale: 4 8 12 16 24 32 48 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  /* type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --bar-h: 56px; --tab-h: 56px; --page-w: 1280px; --side-w: 248px;
}

/* 2. base -------------------------------------------------------------------------------------------------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; overscroll-behavior-y: contain; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); text-decoration: none; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 500; margin: 0; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 500; margin: 0; }
h3 { font-size: 15px; font-weight: 500; margin: 0; }
p { margin: 0; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .mono, .tc { font-family: var(--mono); font-variant-numeric: tabular-nums; } .grow { flex: 1; min-width: 0; } .num { font-variant-numeric: tabular-nums; }
.tc { font-size: 12px; color: var(--faint); }
.row { display: flex; align-items: center; gap: 12px; } .wrap { flex-wrap: wrap; } .col { display: flex; flex-direction: column; gap: 12px; } .between { justify-content: space-between; } .center { justify-content: center; text-align: center; }
.gap-s { gap: 8px; } .gap-l { gap: 20px; } .stack { display: flex; flex-direction: column; gap: var(--s5); }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid { display: grid; gap: var(--s4); } .grid.c2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } .grid.c3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } .grid.c4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.rows { display: flex; flex-direction: column; } .rows > * { padding: 8px 0; border-top: 1px solid var(--line); } .rows > *:first-child { border-top: 0; }

/* 3. layout: a glass sidebar on wide screens; on a phone a glass bar on top and floating glass tabs at the bottom --- */
.shell { min-height: 100dvh; }
.brand { display: inline-flex; align-items: center; color: var(--text); flex: none; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--text); flex: none; }
.logo svg { width: 20px; height: 20px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.logo-pulse { stroke: currentColor; } .logo-cut { stroke: var(--accent); }
.logo b { font-size: 16px; font-weight: 600; }
.logo.lg svg { width: 40px; height: 40px; }
.boot { min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
.bar-tools { display: flex; align-items: center; gap: var(--s2); margin-left: auto; flex: none; }
.side { display: none; }
.m-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s3); height: var(--bar-h); padding: env(safe-area-inset-top) var(--s4) 0; box-sizing: content-box;
  background: rgba(0,0,0,.55); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-bottom: 1px solid var(--line); }
.tabs { position: fixed; z-index: 20; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; padding: 4px; border-radius: 22px;
  background: rgba(22,22,26,.6); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-rim), var(--shadow-2); }
.tabs a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; padding: 0 2px; border-radius: 18px; color: var(--muted); font-size: 11px; font-weight: 500; transition: color var(--fast), background var(--fast); }
.tabs a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs a.on { color: var(--text); background: rgba(255,255,255,.1); box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.main { width: 100%; max-width: var(--page-w); margin: 0 auto; padding: var(--s4) var(--s4) calc(var(--tab-h) + 96px + env(safe-area-inset-bottom)); }
.main.narrow { max-width: 760px; }
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .m-top, .tabs { display: none; }
  .side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 20px 12px 16px;
    background: rgba(255,255,255,.025); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-right: 1px solid var(--line); }
  .side > .brand { padding: 4px 10px 24px; }
  .main { padding: var(--s6) var(--s6) 96px; }
}
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 10px; border-radius: var(--r-s); color: var(--muted); font-size: 14px; font-weight: 500; transition: background var(--fast), color var(--fast); }
.side-nav a svg.i { width: 18px; height: 18px; flex: none; }
.side-nav a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav a:hover { background: rgba(255,255,255,.05); color: var(--text); }
.side-nav a.on { background: rgba(255,255,255,.1); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 0 0 .67px rgba(255,255,255,.14), 0 0 24px -6px rgba(255,255,255,.25); }
.side-sec { padding: 24px 10px 8px; font-size: 13px; color: var(--faint); font-weight: 500; }
.side-end { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.side-credits { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r-l); background: var(--panel); box-shadow: var(--glass-rim); color: var(--muted); font-size: 13px; }
.side-credits b { color: var(--text); font-weight: 500; }
.side-credits .bar i { background: linear-gradient(90deg, #c6bbff, #fff); box-shadow: 0 0 12px rgba(255,255,255,.4); }
.side-me { display: flex; align-items: center; gap: 10px; padding: 4px 2px; min-width: 0; }
.side-me a.grow { display: flex; flex-direction: column; color: var(--text); min-width: 0; }
.side-me b { font-size: 13px; font-weight: 500; } .side-me small { font-size: 12px; color: var(--faint); }
/* language: two letters, the chosen one in ink */
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; flex: none; }
.lang button { border: 0; background: none; padding: 0 8px; height: 30px; font-size: 12px; font-weight: 500; color: var(--faint); cursor: pointer; transition: color var(--fast), background var(--fast); }
.lang button:hover { color: var(--text); } .lang button.on { background: var(--panel-2); color: var(--text); }
/* sub-tabs of a group (account, admin) */
.subnav { display: flex; gap: var(--s5); border-bottom: 1px solid var(--line); margin: 0 0 var(--s5); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; padding: 0 0 12px; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; transition: color var(--fast); }
.subnav a:hover { color: var(--text); } .subnav a.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
/* first steps: three linked steps over the clips list */
.setup { display: grid; grid-template-columns: 1fr; gap: var(--s2); margin: 0 0 var(--s5); }
.setup a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--panel); color: var(--muted); font-weight: 500; transition: border-color var(--fast); }
.setup a:hover { border-color: var(--line-strong); }
.setup a.next { color: var(--text); border-color: var(--line-strong); } .setup a.done { color: var(--faint); background: none; }
.setup-n { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font: 500 12px var(--mono); flex: none; }
.setup a.next .setup-n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .setup-n svg.i { width: 14px; height: 14px; }
@media (min-width: 760px) { .setup { grid-template-columns: repeat(3, 1fr); gap: var(--s3); } }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: var(--s5); min-height: 40px; }
.head .back { margin-left: -8px; }
.head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; font-weight: 400; }
.section { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s6); }
.section > .section-head { display: flex; align-items: baseline; gap: 12px; }
.section > .section-head p { color: var(--muted); font-size: 14px; }

/* 4. primitives -------------------------------------------------------------------------------------------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); }
.card.pad-l { padding: var(--s5); }
.card.tap { display: block; color: inherit; cursor: pointer; transition: border-color var(--fast); }
.card.tap:hover { border-color: var(--line-strong); }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; gap: 12px; align-items: center; color: inherit; min-width: 0; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
a.item:hover, .item.tap:hover { border-color: var(--line-strong); }
.hint { color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty b { display: block; color: var(--text); font-size: 18px; font-weight: 500; }
.empty .empty-art { width: 56px; height: 56px; border-radius: var(--r-l); background: var(--panel-2); color: var(--muted); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.empty .empty-art svg.i { width: 24px; height: 24px; }
.skel { display: flex; flex-direction: column; gap: 8px; }
.skel i { display: block; height: 72px; border-radius: var(--radius); background: var(--panel-2); }
.skel i:nth-child(2) { opacity: .7; } .skel i:nth-child(3) { opacity: .45; }
/* motion: a page fades and rises once; presses shrink a little; nothing loops. Keyframes end in the natural state (no "forwards"),
   so no transform is left on .main to trap the fixed sheets and the editor that live inside it. */
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
.main > *:not(.sheet-back, .editor-overlay) { animation: enter .32s var(--ease) backwards; }
.main > *:nth-child(2):not(.sheet-back, .editor-overlay) { animation-delay: .04s; } .main > *:nth-child(n+3):not(.sheet-back, .editor-overlay) { animation-delay: .08s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r-s); border: 1px solid var(--line-strong); background: var(--panel); cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap; transition: background var(--fast), border-color var(--fast), transform var(--fast); }
.btn:hover { background: var(--panel-2); } .btn:active { transform: scale(.98); }
.btn.primary, .btn.brand { background: var(--primary); border-color: transparent; color: var(--primary-ink); }
.btn.primary:hover, .btn.brand:hover { background: var(--primary-hover); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--panel-2); }
.btn.danger { color: var(--red); } .btn.sm { min-height: 32px; padding: 0 12px; font-size: 14px; } .btn.lg { min-height: 48px; padding: 0 24px; font-size: 16px; border-radius: var(--r-m); } .btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
a.btn:not(.primary):not(.brand) { color: var(--text); }
.icon-btn { width: 36px; height: 36px; border-radius: var(--r-s); border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); transition: background var(--fast), color var(--fast); }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.fab { position: fixed; right: 16px; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); z-index: 15; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-2); display: flex; align-items: center; justify-content: center; cursor: pointer; }
@media (min-width: 760px) { .fab { bottom: 28px; right: 32px; } }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.chip.green { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.chip.amber { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.chip.red { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.chip.blue { color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.chip.accent { color: var(--accent-text); background: var(--accent-soft); }
.chip.pro { color: var(--text); background: var(--panel-2); }
.chip svg.i { width: 14px; height: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; } .dot.green { background: var(--green); } .dot.amber { background: var(--amber); } .dot.red { background: var(--red); }
.seg { display: flex; background: var(--panel-2); border-radius: 10px; padding: 2px; gap: 2px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.seg::-webkit-scrollbar { display: none; }
.seg.inline { display: inline-flex; margin: 0; }
.seg button, .seg .seg-btn { flex: 1 0 auto; border: 0; background: transparent; padding: 6px 12px; border-radius: var(--r-s); font-weight: 500; color: var(--muted); cursor: pointer; font-size: 14px; white-space: nowrap; text-align: center; scroll-snap-align: start; transition: color var(--fast), background var(--fast); }
.seg button.on, .seg .seg-btn.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow-1); }
.pills { display: flex; gap: 8px; margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; padding: 4px 12px; border-radius: var(--r-s); border: 1px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; background: transparent; }
.pill.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.fold { margin-bottom: 12px; padding: 0; }
.fold > summary { list-style: none; cursor: pointer; padding: 16px; display: flex; flex-direction: column; gap: 2px; position: relative; padding-right: 40px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform var(--fast); }
.fold[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.fold-body { padding: 0 16px 16px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.puberr { margin-top: 8px; font-size: 13px; color: var(--red); display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.puberr details summary { cursor: pointer; color: var(--muted); }
.puberr pre { white-space: pre-wrap; margin: 8px 0 0; max-height: 180px; overflow: auto; font-size: 12px; color: var(--muted); background: var(--panel-2); padding: 8px; border-radius: var(--r-s); }
.bar { height: 4px; border-radius: 2px; background: var(--panel-2); overflow: hidden; } .bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: transform var(--slow); }

label.f, div.f { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); align-items: stretch; }
div.f > .seg { align-self: flex-start; }
input.in, select.in, textarea.in { width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--r-s); border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); font-size: 16px; transition: border-color var(--fast), box-shadow var(--fast); }
input.in:hover, select.in:hover, textarea.in:hover { border-color: var(--faint); }
input.in:focus, select.in:focus, textarea.in:focus { outline: 0; border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 12%, transparent); }
input.in::placeholder, textarea.in::placeholder { color: var(--faint); }
textarea.in { min-height: 120px; font-family: var(--mono); font-size: 13px; line-height: 1.5; resize: vertical; }
textarea.in.plain { font-family: var(--font); font-size: 15px; min-height: 84px; }
.sw { display: flex; align-items: center; gap: 12px; min-height: 40px; cursor: pointer; }
.sw input { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 12px; background: var(--line-strong); position: relative; cursor: pointer; flex: none; transition: background var(--fast); margin: 0; }
.sw input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform var(--fast) var(--ease); }
.sw input:checked { background: var(--accent); } .sw input:checked::after { transform: translateX(16px); }

.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(12,12,14,.5); display: flex; align-items: flex-end; justify-content: center; animation: fade var(--fast) ease-out; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--raised); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-3); animation: rise var(--slow) var(--ease); }
.sheet.wide { max-width: 860px; }
.sheet .banner, .auth-form .banner { margin: 0; }
@media (min-width: 760px) { .sheet-back { align-items: center; } .sheet { border-radius: var(--r-xl); padding: 24px; } }
@keyframes fade { from { opacity: 0; } } @keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.toasts { position: fixed; z-index: 60; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--primary); color: var(--primary-ink); padding: 8px 16px; border-radius: var(--r-m); font-size: 14px; font-weight: 500; max-width: 520px; box-shadow: var(--shadow-2); animation: rise var(--slow) var(--ease); }
.toast.error { background: var(--red); color: #111113; } .toast.ok { background: var(--green); color: #111113; }
.banner { background: color-mix(in srgb, var(--amber) 12%, transparent); color: var(--amber); border-radius: var(--r-s); padding: 8px 12px; font-size: 14px; margin-bottom: 16px; }
.banner.red { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.banner.info { background: var(--panel-2); color: var(--text); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 13px; font-weight: 500; color: var(--faint); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; } .table tbody tr:hover td { background: var(--panel-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; font-weight: 500; font-size: 13px; flex: none; text-transform: uppercase; border: 1px solid var(--line); }
.avatar.on { border-color: var(--accent); }

/* 5. patterns ---------------------------------------------------------------------------------------------- */
/* landing: the product in one picture, then three plain lists */
.land { max-width: var(--page-w); margin: 0 auto; padding: 0 var(--s4); }
.land-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s3); height: var(--bar-h); margin: 0 calc(-1 * var(--s4)); padding: 0 var(--s4); background: var(--bg); border-bottom: 1px solid var(--line); }
.land-top .icon-btn { display: none; }
.land-nav { display: none; gap: var(--s5); margin-left: var(--s4); } .land-nav a, .land-login, .land-foot a { color: var(--muted); font-size: 14px; transition: color var(--fast); }
.land-nav a:hover, .land-login:hover, .land-foot a:hover { color: var(--text); }
.land-login { padding: 0 4px; }
.hero { display: grid; grid-template-columns: 1fr; gap: 48px; padding: 48px 0 64px; align-items: center; }
.hero-text { display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.hero h1 { font-size: 36px; line-height: 1.08; letter-spacing: -.02em; font-weight: 500; max-width: 12em; }
.hero h1 span { display: block; } .hero h1 span + span { color: var(--faint); }
.hero p { font-size: 18px; line-height: 28px; color: var(--muted); max-width: 32em; }
.hero-note { font-size: 13px; color: var(--faint); }
/* the one rich place: an episode on a timeline, three cuts marked in the accent, and the clips they became */
.cutview { display: flex; flex-direction: column; gap: 24px; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; min-width: 0; box-shadow: var(--shadow-2); }
.cut-source { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.cut-strip { position: relative; height: 40px; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--panel-2) 0 23px, transparent 23px 24px); }
.cut-strip i { position: absolute; top: -4px; bottom: -4px; border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.cut-clips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cut-clip { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cut-frame { position: relative; aspect-ratio: 9 / 16; border-radius: 8px; color: #fff; display: flex; align-items: flex-end; justify-content: center; padding: 0 8px 24%; text-align: center; overflow: hidden; }
.cut-clip:nth-child(1) .cut-frame { background: radial-gradient(120% 80% at 30% 20%, #e8a06a, transparent 60%), linear-gradient(160deg, #8c4a3a, #1d1418); }
.cut-clip:nth-child(2) .cut-frame { background: radial-gradient(120% 80% at 70% 25%, #7fa6d8, transparent 60%), linear-gradient(160deg, #2f4d7a, #10151f); }
.cut-clip:nth-child(3) .cut-frame { background: radial-gradient(120% 80% at 35% 30%, #9ccf9a, transparent 60%), linear-gradient(160deg, #2f6b52, #0f1915); }
.cut-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(0,0,0,.5)); pointer-events: none; }
.cut-frame b { position: relative; z-index: 1; font-size: 14px; line-height: 1.15; font-weight: 700; text-transform: uppercase; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.cut-frame .tc { position: absolute; z-index: 1; top: 8px; left: 8px; color: #fff; background: rgba(0,0,0,.5); padding: 0 4px; border-radius: 4px; font-size: 12px; }
.cut-slot { font: 400 12px var(--mono); color: var(--muted); display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cut-slot::before { content: ""; width: 2px; height: 12px; background: var(--accent); flex: none; }
.land-sec { padding: 64px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr; gap: 32px; scroll-margin-top: calc(var(--bar-h) + 16px); }
.land-sec h2 { font-size: 24px; line-height: 1.15; }
.land-steps, .land-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.land-steps li, .land-list > div { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 4px 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.land-steps li:first-child, .land-list > div:first-child { border-top: 0; padding-top: 0; }
.land-steps .tc { grid-row: span 2; color: var(--accent-text); font-size: 13px; line-height: 24px; }
.land-steps h3, .land-list h3 { font-size: 16px; line-height: 24px; }
.land-steps p, .land-list p { color: var(--muted); font-size: 14px; line-height: 20px; max-width: 36em; }
.land-list > div { grid-template-columns: 1fr; }
.land-cta { padding: 64px 0 80px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.land-cta h2 { font-size: 28px; line-height: 1.15; max-width: 16em; }
.land-foot { display: flex; align-items: center; gap: var(--s4); padding: var(--s5) 0 var(--s6); border-top: 1px solid var(--line); }
@media (min-width: 760px) { .land { padding: 0 var(--s5); } .land-top { gap: var(--s4); margin: 0 calc(-1 * var(--s5)); padding: 0 var(--s5); } .land-top .icon-btn { display: inline-flex; } .land-nav { display: flex; }
  .land-sec { grid-template-columns: 240px minmax(0, 1fr); gap: 48px; padding: 80px 0; } .land-sec.wide { grid-template-columns: 1fr; gap: 32px; } .land-sec h2 { font-size: 28px; }
  .land-list > div { grid-template-columns: 200px minmax(0, 1fr); } .land-cta h2 { font-size: 36px; } }
@media (min-width: 960px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; padding: 104px 0 128px; } .hero h1 { font-size: 56px; letter-spacing: -.03em; } }
/* sign-in: one card in the middle */
.auth { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s5); padding: var(--s5) var(--s4); }
.auth-form { display: flex; flex-direction: column; gap: var(--s4); width: 100%; max-width: 400px; padding: var(--s5); }
.auth-form .seg { margin: 0; }
.auth .bar-tools { margin: 0; }
/* plans */
.plans { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 16px; padding: var(--s5); border-radius: var(--r-xl); background: var(--panel); border: 1px solid var(--line); }
.plan.current { border-color: var(--text); }
.plan .price { font-size: 32px; font-weight: 500; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 8px; } .plan .price small { font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; flex: 1; }
.plan li { display: flex; gap: 8px; align-items: flex-start; } .plan li svg.i { width: 14px; height: 14px; margin-top: 4px; color: var(--text); } .plan li.off { color: var(--faint); } .plan li.off svg.i { color: var(--faint); }
/* stat tiles and meters */
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat .label { font-size: 13px; color: var(--muted); } .stat .value { font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 13px; color: var(--muted); } .stat .delta.up { color: var(--green); } .stat .delta.down { color: var(--red); }
.meter { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
/* locked (plan) controls */
.locked { position: relative; opacity: .5; pointer-events: none; }
.lock-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); background: var(--panel-2); border-radius: 6px; padding: 2px 8px; cursor: pointer; border: 0; }
.lock-note:hover { color: var(--text); } .lock-note svg.i { width: 14px; height: 14px; }
/* charts (inline SVG) */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { stroke: var(--line); stroke-width: 1; } .chart .tick { fill: var(--faint); font-size: 12px; font-family: var(--mono); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; } .chart .area { fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: none; }
.chart .pt { fill: var(--panel); stroke: var(--accent); stroke-width: 2; }
.spark { width: 84px; height: 26px; flex: none; } .spark path { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* dropzone */
.drop { border: 1px dashed var(--line-strong); border-radius: var(--r-l); padding: 28px 16px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color var(--fast), background var(--fast); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.drop:hover, .drop.over { border-color: var(--text); background: var(--panel-2); color: var(--text); }
/* thumbnails grid for clips */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { position: relative; aspect-ratio: 9/16; border-radius: var(--r-l); overflow: hidden; background: #000; border: 1px solid var(--line); cursor: pointer; display: block; color: #fff; transition: border-color var(--fast); }
.tile:hover { border-color: var(--faint); }
.tile img, .tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .tile-top { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.tile .tile-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 12px 12px; background: linear-gradient(transparent, rgba(0,0,0,.82)); font-size: 13px; font-weight: 500; line-height: 1.3; }
/* editor workspace: preview on the left, one panel of settings on the right */
.editor { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
.editor-stage { position: relative; }
.editor-panel { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
@media (min-width: 1000px) { .editor { grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); align-items: start; } .editor-stage { position: sticky; top: 24px; } }
.qr { width: 240px; height: 240px; border-radius: var(--r-l); background: #fff; padding: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto; border: 1px solid var(--line); }
.qr img { width: 100%; height: 100%; image-rendering: pixelated; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.steps li { counter-increment: step; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { content: counter(step); width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--muted); font: 500 12px var(--mono); display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* 6. screens (they use the tokens above) ------------------------------------------------------------------- */
/* review deck: the clip on top (whole frame, subtitles visible), its text below, the three buttons always on screen */
.deck-hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 6px; }
@media (hover: none), (max-width: 600px) { .deck-hint { display: none; } }
.icon-btn.sm { width: 34px; height: 34px; }
.deck { position: relative; height: clamp(400px, calc(100dvh - 250px), 780px); margin: 0 auto; max-width: 420px; touch-action: pan-y; user-select: none; }
.clip { position: absolute; inset: 0; border-radius: var(--r-xl); overflow: hidden; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; box-shadow: var(--shadow-2); will-change: transform; }
.clip-media { position: relative; flex: 1; min-height: 0; background: #000; }
.clip-media video, .clip-media .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.clip-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; pointer-events: none; }
.clip-sound { position: absolute; right: 10px; bottom: 10px; pointer-events: none; }
.pill-dark { background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 99px; }
.clip-meta { flex: none; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.clip-meta h3 { font-size: 16px; line-height: 1.3; }
.stamp { position: absolute; z-index: 3; top: 48px; padding: 4px 16px; border: 3px solid; border-radius: 10px; font-weight: 500; font-size: 24px; opacity: 0; transform: rotate(-10deg); pointer-events: none; background: rgba(0,0,0,.35); }
.stamp.yes { left: 18px; color: #3ccf7a; } .stamp.no { right: 18px; color: #ff6b6b; transform: rotate(10deg); }
.deck-actions { position: sticky; z-index: 6; bottom: calc(var(--tab-h) + 10px + env(safe-area-inset-bottom)); display: flex; justify-content: center; align-items: center; gap: 24px; width: max-content; margin: 16px auto 0; padding: 8px 16px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); }
@media (min-width: 760px) { .deck-actions { bottom: 16px; } }
.round { width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .1s; }
.round:active { transform: scale(.92); } .round[disabled] { opacity: .4; }
.round.yes { color: var(--green); border-color: var(--green); } .round.no { color: var(--red); border-color: var(--red); } .round.mid { width: 46px; height: 46px; color: var(--muted); }
.round svg.i { width: 24px; height: 24px; }
.range { width: 100%; accent-color: var(--accent); }

.ep { display: flex; flex-direction: column; gap: 8px; }
.story { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; display: flex; flex-direction: column; gap: 6px; }
.ch { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kv .stat b { display: block; font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; } .kv .stat span { color: var(--muted); font-size: 13px; }

/* caption studio */
.sheet.wide { max-width: 980px; }
.cap-studio { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.cap-stage { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; }
.cap-stage canvas { width: 100%; max-height: 64vh; aspect-ratio: 9 / 16; object-fit: contain; border-radius: var(--radius); background: #000; }
.cap-controls { max-height: 62vh; overflow: auto; padding-right: 6px; }
.cap-section { font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 8px; }
.cap-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.cap-field > span { display: flex; justify-content: space-between; color: var(--muted); } .cap-field b { color: var(--text); font-variant-numeric: tabular-nums; }
.cap-field input[type=range] { width: 100%; accent-color: var(--accent); }
.cap-field.cap-color { flex-direction: row; align-items: center; justify-content: space-between; }
.cap-color input[type=color], .cap-colors input[type=color] { width: 38px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.cap-sub { display: flex; flex-direction: column; gap: 10px; padding-left: 12px; border-left: 2px solid var(--line); }
.cap-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px; }
.cap-preset { text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; }
.cap-preset small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; } .cap-preset.active { border-color: var(--accent); }
.cap-colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.cap-colors label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
@media (max-width: 860px) { .cap-studio { grid-template-columns: 1fr; } .cap-stage { position: static; align-items: center; } .cap-stage canvas { max-width: 240px; } .cap-controls { max-height: none; } }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.lib-media { position: relative; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; }
.lib-media video, .lib-media canvas { max-width: 100%; max-height: 100%; object-fit: contain; }
.lib-media.checker { background: repeating-conic-gradient(#3a3a3a 0 25%, #2a2a2a 0 50%) 0 0/16px 16px; }
.lib-media .dur { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; }

/* live run log, transcript with a moving highlight */
.runlog { overflow: auto; background: var(--panel-2); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.logline { display: grid; grid-template-columns: 62px minmax(0, 120px) 1fr; gap: 8px; line-height: 1.35; }
.logline > :nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .logline { grid-template-columns: 56px 1fr; } .logline > :nth-child(2) { display: none; } }
.txline { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 4px 6px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.txline:hover { background: var(--panel-2); } .txline.now { background: var(--accent-soft); }

/* visual frame editor (frame.js) */
.fx-stage { position: relative; width: min(100%, 320px); aspect-ratio: 9 / 16; background: #000; border-radius: 14px; overflow: hidden; touch-action: none; user-select: none; box-shadow: 0 0 0 1px var(--line, #333); }
.fx-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.fx-layer { position: absolute; cursor: grab; outline: 1px dashed transparent; }
.fx-layer:hover { outline-color: rgba(255, 255, 255, .35); }
.fx-layer.on { outline: 2px solid var(--accent, #ff4d4d); cursor: grabbing; }
.fx-handle { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent, #ff4d4d); border: 2px solid #fff; cursor: nwse-resize; z-index: 2; }
.fx-tag { position: absolute; left: 4px; top: 4px; max-width: calc(100% - 8px); font-size: 12px; line-height: 1.3; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; z-index: 3; }
.fx-empty { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 12px calc(50% - 72px); font-size: 12px; color: #aaa; background: repeating-linear-gradient(45deg, #1b1b1f 0 12px, #222228 12px 24px); }
.fx-caps { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 20; }
.fx-title { position: absolute; z-index: 19; transform: translate(-50%, -50%); text-align: center; pointer-events: none; overflow-wrap: break-word; width: max-content; }
.fx-capband { position: absolute; left: 0; right: 0; height: 44px; z-index: 21; cursor: ns-resize; border-top: 1px dashed transparent; border-bottom: 1px dashed transparent; }
.fx-capband:hover, .fx-capband.on { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .04); }

/* approved / posted clip card: thumbnail, state, two main buttons, the rest under "Ещё" */
.clipcard { display: grid; grid-template-columns: auto 92px 1fr; gap: 10px 12px; align-items: start; }
.clipcard-pick { padding-top: 4px; }
.clipcard-thumb { position: relative; width: 92px; aspect-ratio: 9/16; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--panel-2, #1b1b22); cursor: pointer; }
.clipcard-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clipcard-len { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; padding: 1px 4px; border-radius: 6px; }
.clipcard-body { min-width: 0; }
.clipcard-reason { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clipcard-more { position: relative; }
.clipcard-more summary { list-style: none; cursor: pointer; }
.clipcard-more summary::-webkit-details-marker { display: none; }
.clipcard-menu { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.clipcard-more[open] { flex-basis: 100%; }
@media (max-width: 480px) { .clipcard { grid-template-columns: auto 72px 1fr; } .clipcard-thumb { width: 72px; } }
.words-list { gap: 6px; max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.word-row { gap: 8px; } .word-row > .mono { width: 38px; flex: none; text-align: right; } .word-row select.in { width: 104px; flex: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }

/* analytics section */
.an-body { display: flex; flex-direction: column; gap: var(--s4); transition: opacity var(--slow); } .an-body > .pills { margin: 0; } .an-body.an-stale { opacity: .72; }
.an-refresh { position: relative; overflow: hidden; padding-bottom: 16px; } .an-note { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.an-problems { display: flex; flex-direction: column; gap: var(--s1); } .an-problems a { font-weight: 500; white-space: nowrap; }
.an-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 40%; background: var(--accent); border-radius: 3px; animation: an-slide 1.4s var(--ease) infinite; }
@keyframes an-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.an-spin svg { animation: an-turn .9s linear infinite; } @keyframes an-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .an-progress { animation: none; width: 100%; opacity: .5; } .an-spin svg { animation: none; } }
.an-status { margin: 0 0 var(--s3); } .an-ok { color: var(--green); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; } .an-ok svg.i { width: 14px; height: 14px; }
.an-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); } .an-stats > .stat:last-child { grid-column: span 2; }
@media (min-width: 700px) { .an-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s4); } .an-stats > .stat:last-child { grid-column: auto; } }
.an-chart { display: flex; flex-direction: column; gap: var(--s3); } .an-chart .seg { max-width: 100%; }
.an-listhead { margin-top: var(--s2); } .an-count { font-weight: 500; font-size: 15px; } select.in.an-sort { width: auto; min-height: 38px; padding: 6px 12px; font-size: 14px; }
.an-thumb { flex: none; width: 36px; aspect-ratio: 9/16; border-radius: 6px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); display: block; } .an-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.an-title { border: 0; background: transparent; padding: 0; text-align: left; font-weight: 500; font-size: 14px; line-height: 1.35; color: var(--text); cursor: pointer; max-width: 100%; }
.an-views { display: inline-flex; align-items: center; gap: var(--s2); } .an-views .spark { width: 64px; }
.an-table th.r, .an-table td.r { text-align: right; } .an-table .an-main { min-width: 240px; max-width: 360px; } .an-tr { cursor: pointer; } .an-table .an-views { justify-content: flex-end; }
.an-desktop { display: none; } .an-mobile { display: flex; }
@media (min-width: 1100px) { .an-desktop { display: block; } .an-mobile { display: none; } }
.card.an-card { display: flex; gap: var(--s3); align-items: flex-start; width: 100%; text-align: left; } .an-card .an-thumb { width: 56px; }
.an-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); font-size: 14px; font-variant-numeric: tabular-nums; } .an-counts span { display: flex; flex-direction: column; min-width: 0; } .an-counts i { font-style: normal; font-size: 12px; color: var(--faint); }
.an-mini .stat { padding: var(--s3); } .an-mini .stat .value { font-size: 20px; }

/* schedule section */
.sch-status { display: flex; align-items: center; gap: var(--s3); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--s3) var(--s4); margin: 0 0 var(--s4); font-weight: 500; }
.sch-status .btn { flex: none; }
.sch-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); align-items: start; }
.sch-card { gap: var(--s4); min-width: 0; }
.sch-two { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.sch-time { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 8px 0 12px; border-radius: var(--r-s); border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); font-family: var(--mono); font-weight: 500; font-size: 15px; cursor: pointer; }
.sch-time svg.i { width: 14px; height: 14px; }
.sch-time:hover:not([disabled]) { border-color: var(--accent); }
.sch-time[disabled] { cursor: default; padding-right: 16px; } .sch-time[disabled] svg.i { display: none; }
input.in.sch-clock { width: 130px; flex: none; }
.sch-day { min-width: 44px; min-height: 40px; padding: 0 10px; border-radius: var(--r-m); border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted); font-weight: 500; font-size: 14px; cursor: pointer; }
.sch-day.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sch-day[disabled] { opacity: .6; }
.sch-pro { display: flex; flex-direction: column; gap: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); }
.sch-next { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.sch-fold { border-top: 1px solid var(--line); margin: 0; }
.sch-fold > summary { padding: var(--s3) 40px var(--s3) 0; } .sch-fold > summary::after { right: 4px; }
.sch-fold .fold-body { padding: var(--s2) 0 var(--s2); }
.sch-settings { gap: var(--s4); }
.sch-auto { gap: var(--s3); padding: var(--s3); border-radius: var(--r-m); background: var(--panel-2); }
.sch-day-title { font-size: 14px; color: var(--muted); text-transform: capitalize; }
.sch-row { align-items: flex-start; }
.sch-clock-label { width: 48px; flex: none; padding-top: 2px; font-size: 15px; }
.sch-thumb { width: 44px; aspect-ratio: 9 / 16; border-radius: var(--r-s); overflow: hidden; background: var(--panel-2); color: var(--faint); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sch-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 480px) { .sch-clock-label { width: 42px; font-size: 14px; } }
.sch-empty > .empty { padding: var(--s6) var(--s4); }

/* clips section */
.hint.warn { color: var(--amber); } .bad { color: var(--red); }
.up-steps { margin-top: -8px; }
.up-ico { width: 36px; height: 36px; border-radius: var(--r-s); background: var(--panel-2); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.up-item { padding: 10px 12px; }
.opt-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: stretch; }
.opt-grid > div { display: flex; flex-direction: column; } .opt-grid > div > .col { flex: 1; }
.opt { width: 100%; height: 100%; text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: var(--s4); border-radius: var(--r-l); border: 1.5px solid var(--line); background: var(--panel); cursor: pointer; transition: border-color var(--fast), background var(--fast); }
.opt:hover { border-color: var(--line-strong); } .opt.on { border-color: var(--text); }
.opt b { font-size: 15px; }
.opt-icon { width: 36px; height: 36px; border-radius: var(--r-s); background: var(--panel-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.opt.on .opt-icon { background: var(--panel); }
.welcome { display: flex; flex-direction: column; gap: var(--s5); padding: var(--s4) 0; }
.welcome-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.welcome-grid .card { align-items: flex-start; } .welcome-grid .btn { align-self: stretch; }
.empty-art-lg { width: 64px; height: 64px; border-radius: var(--r-l); background: var(--panel-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; margin-bottom: var(--s2); }
.empty-art-lg svg.i { width: 24px; height: 24px; }
.series-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.series-card, a.series-card.card.tap { display: flex; gap: var(--s4); align-items: center; min-width: 0; }
.series-body { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; flex: 1; }
.series-cover { width: 64px; aspect-ratio: 9 / 16; border-radius: var(--r-m); overflow: hidden; background: var(--panel-2); color: var(--faint); display: flex; align-items: center; justify-content: center; flex: none; }
.series-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
button.series-card.new { flex-direction: column; justify-content: center; align-items: center; gap: var(--s1); min-height: 132px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-l); background: transparent; cursor: pointer; color: var(--text); transition: border-color var(--fast), background var(--fast); }
button.series-card.new:hover { border-color: var(--text); }
.tile.dim img { opacity: .45; }
.tile .chip { background: rgba(14,14,22,.72); color: #fff; white-space: normal; text-align: left; line-height: 1.25; padding: 4px 8px; }
.tile .chip.green { background: color-mix(in srgb, var(--green) 82%, #000); } .tile .chip.red { background: color-mix(in srgb, var(--red) 85%, #000); }
.tile .chip.amber { background: color-mix(in srgb, var(--amber) 88%, #000); } .tile .chip.blue { background: color-mix(in srgb, var(--blue) 85%, #000); }
.tile .chip.accent { background: color-mix(in srgb, var(--accent) 85%, #000); }
.tile-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6a6a7e; background: #1c1c20; }
.tile-empty svg.i { width: 24px; height: 24px; }
.tile-len { font-size: 12px; font-weight: 500; opacity: .8; margin-top: 2px; }
.tile-bar { margin-top: 6px; background: rgba(255,255,255,.25); }
.tile:focus-visible { outline-offset: 3px; }
.clip-sheet { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
.clip-view { background: #000; border-radius: var(--r-l); overflow: hidden; aspect-ratio: 9 / 16; max-height: 46dvh; justify-self: center; width: auto; height: 46dvh; position: relative; }
.clip-view video, .clip-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.clip-side { min-width: 0; }
@media (max-width: 599px) { .hide-s { display: none; } }
a.btn:not(.primary):not(.brand) { color: var(--text); }
.clip-foot { display: flex; justify-content: flex-start; margin-top: var(--s1); }
@media (min-width: 700px) { .clip-sheet { grid-template-columns: 280px minmax(0, 1fr); align-items: start; } .clip-view { height: auto; max-height: 68dvh; width: 100%; } }

/* editor */
/* The editor lives on its own full-screen layer: a header, one scroll, and inside it the preview and the settings panel (see scene.js). */
.editor-overlay { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; }
.editor-head { flex: none; display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s4); padding-top: max(var(--s2), env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--panel); min-height: 56px; }
.editor-head h2 { font-size: 16px; }
.editor-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.editor-wrap { max-width: 1240px; margin: 0 auto; padding: var(--s4); }
.editor-stage { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: 0 0 var(--s2); display: flex; flex-direction: column; align-items: center; }
.editor-stage .fx-stage { width: min(100%, 168px, calc((100dvh - 430px) * 9 / 16)); min-width: 120px; }
.editor-stage-body > .col > .row { display: none; }
@media (max-width: 700px) { .editor-foot > .small { display: none; } .editor-wrap { padding: var(--s3); } }
.editor-stage .hint { display: none; }
.stage-toggle { align-self: stretch; }
.editor-stage-body.off { display: none; }
.editor-panel { max-width: 760px; }
@media (min-width: 1000px) {
  .editor { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: var(--s5); }
  .editor-stage { top: var(--s2); padding: 0; z-index: 1; background: none; }
  .editor-stage .fx-stage { width: min(100%, 360px, calc((100dvh - 230px) * 9 / 16)); }
  .editor-stage .hint { display: block; }
  .stage-toggle { display: none; }
  .editor-stage-body > .col > .row { display: flex; }
  .editor-stage-body.off { display: block; }
  .editor-wrap { padding: var(--s5) var(--s5) var(--s6); }
}
/* collapsible groups */
.egroup { padding: 0; overflow: hidden; }
.egroup-head { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 60px; padding: var(--s3) var(--s4); background: none; border: 0; text-align: left; cursor: pointer; color: var(--text); }
.egroup-head:hover { background: var(--panel-2); }
.egroup-head > .grow { display: flex; flex-direction: column; min-width: 0; }
.egroup-head b { font-size: 16px; font-weight: 500; }
.egroup-sum { font-size: 13px; color: var(--muted); display: block; }
.egroup-chev { flex: none; width: 8px; height: 8px; margin: 0 4px 4px 0; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--fast); }
.egroup.open .egroup-chev { transform: rotate(-135deg); margin-bottom: -3px; }
.egroup-body { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s4); border-top: 1px solid var(--line); }
.efold { border: 1px solid var(--line); border-radius: var(--r-m); }
.efold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 44px; padding: 0 var(--s3); font-weight: 500; font-size: 14px; }
.efold > summary::-webkit-details-marker { display: none; }
.efold > summary::after { content: ""; flex: none; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform var(--fast); }
.efold[open] > summary::after { transform: rotate(-135deg); }
.efold-body { padding: var(--s1) var(--s3) var(--s3); }
.editor-foot { position: sticky; bottom: 0; z-index: 7; display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s2); padding: var(--s3); padding-bottom: calc(var(--s3) + env(safe-area-inset-bottom)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-2); }
.editor-foot .btn.primary { flex: none; min-width: 140px; }
.editor-foot > .row { justify-content: flex-end; }
/* frame layouts */
.laygrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: var(--s2); }
.laytile { display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s3) var(--s2); border: 1.5px solid var(--line); border-radius: var(--r-m); background: var(--panel); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 500; line-height: 1.25; text-align: center; transition: border-color var(--fast), background var(--fast); }
.laytile:hover { border-color: var(--line-strong); }
.laytile.on { border-color: var(--accent); background: var(--accent-soft); }
.lay { position: relative; width: 32px; aspect-ratio: 9 / 16; border-radius: 5px; background: #0b0b10; overflow: hidden; flex: none; }
.lay i { position: absolute; left: 0; right: 0; display: block; }
.lay-main { background: var(--accent); } .lay-sa { background: var(--green); opacity: .85; }
.lay-full .lay-main { top: 0; bottom: 0; } .lay-full .lay-sa, .lay-fit .lay-sa { display: none; }
.lay-fit { background: linear-gradient(160deg, var(--line-strong), var(--faint)); } .lay-fit .lay-main { top: 34%; bottom: 34%; }
.lay-split_50 .lay-main { top: 0; height: 50%; } .lay-split_50 .lay-sa { top: 50%; bottom: 0; }
.lay-split_60 .lay-main { top: 0; height: 60%; } .lay-split_60 .lay-sa { top: 60%; bottom: 0; }
/* subtitle look chips and fonts */
.lookchips { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--s2); }
.lookchip { display: flex; flex-direction: column; gap: 6px; padding: 6px 6px 8px; border: 1.5px solid var(--line); border-radius: var(--r-m); background: var(--panel); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 500; text-align: center; transition: border-color var(--fast), background var(--fast); }
.lookchip:hover { border-color: var(--line-strong); } .lookchip.on { border-color: var(--accent); background: var(--accent-soft); }
.lookthumb { display: block; width: 100%; aspect-ratio: 240 / 150; border-radius: var(--r-s); background: #26262b; }
.fontgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: var(--s2); max-height: 288px; overflow-y: auto; padding: 2px; }
.fonttile { position: relative; }
.fonttile-pick { width: 100%; min-height: 66px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 4px; padding: 10px 10px 8px; border: 1.5px solid var(--line); border-radius: var(--r-m); background: var(--panel); color: var(--text); cursor: pointer; text-align: left; transition: border-color var(--fast), background var(--fast); }
.fonttile-pick:hover { border-color: var(--line-strong); }
.fonttile.on .fonttile-pick { border-color: var(--accent); background: var(--accent-soft); }
.fonttile.off .fonttile-pick { opacity: .55; }
.fonttile-sample { font-size: 20px; line-height: 1.15; max-width: 100%; white-space: nowrap; overflow: hidden; }
.fonttile-name { font-size: 12px; color: var(--muted); max-width: 100%; }
.fonttile-lock { position: absolute; top: 8px; right: 8px; color: var(--accent); display: flex; } .fonttile-lock svg.i { width: 14px; height: 14px; }
.fonttile-del { position: absolute; top: 2px; right: 2px; }
.pill svg.i { width: 14px; height: 14px; vertical-align: -1px; }
/* video tiles for the second screen and banners */
.tiles.sm { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--s2); }
.tiles.sm .tile { aspect-ratio: 3 / 4; border-radius: var(--r-m); }
.tile.pick.on { outline: 3px solid var(--accent); outline-offset: -3px; }
.tile.checker { background: repeating-conic-gradient(#3a3a3a 0 25%, #2a2a2a 0 50%) 0 0 / 16px 16px; }
.tile-check { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-1); z-index: 2; }
.tile-check svg.i { width: 14px; height: 14px; }
.tile.add, .tile.none { background: var(--panel); border: 1.5px dashed var(--line-strong); color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); padding: var(--s2); font-size: 13px; font-weight: 500; text-align: center; line-height: 1.25; }
.tile.add:hover, .tile.none:hover { border-color: var(--accent); color: var(--text); transform: none; box-shadow: none; }
.tile.none.on { border: 1.5px solid var(--accent); background: var(--accent-soft); color: var(--accent); }
.tile.add.busy { cursor: default; }
.swatch { width: 38px; height: 34px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-s); background: none; cursor: pointer; }
/* tiny drawing of a preset in the list */
.pthumb { position: relative; width: 54px; height: 96px; flex: none; border-radius: var(--r-s); overflow: hidden; background: #000; border: 1px solid var(--line); }
.pthumb.blur { background: #2c2c33; }
.pthumb i { position: absolute; display: block; }
.pt-main { background: color-mix(in srgb, var(--accent) 80%, #fff); } .pt-sa { background: var(--green); } .pt-ban { background: var(--amber); opacity: .85; }
.pt-cap { position: absolute; left: 20%; right: 20%; height: 6px; border-radius: 3px; background: #fff; }
.tiles.sm .tile-top .chip { font-size: 12px; padding: 1px 8px; }

/* storage screen and episode lines */
.stor-bar { display: flex; height: 10px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.stor-bar i { display: block; height: 100%; }
.p-originals { background: var(--accent); } .p-clips { background: var(--green); } .p-own { background: var(--blue); } .p-other { background: var(--faint); }
.stor-bar.amber .p-originals, .stor-bar.amber .p-clips, .stor-bar.amber .p-own, .stor-bar.amber .p-other { background: var(--amber); }
.stor-bar.red .p-originals, .stor-bar.red .p-clips, .stor-bar.red .p-own, .stor-bar.red .p-other { background: var(--red); }
.stor-legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: 13px; }
.sw-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.stor-ep { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; padding: var(--s3) var(--s4); background: var(--panel-2); border-radius: var(--r-m); }
.warn-text { color: var(--amber); font-weight: 500; }
.lines { display: flex; flex-direction: column; gap: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); }
.line { display: flex; flex-direction: column; gap: var(--s3); }
.lines .tiles { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: var(--s2); }
.lines .tile { border-radius: var(--r-m); }

.tt-window { display: block; width: 100%; max-width: 520px; margin: 0 auto; border: 1px solid var(--line, rgba(128,128,128,.3)); border-radius: var(--r-m); cursor: pointer; user-select: none; touch-action: manipulation; }

/* 7. style 5: black, glass and white glow -------------------------------------------------------------------
   Cards are flat glass (a white tint and a lit rim, no backdrop-filter: a filter on a card would trap the fixed sheets inside it).
   Real blur only on chrome that holds nothing fixed: the sidebar, the top bars, the tabs, sheets and toasts.
   One white glow per screen: the main button. The pointer carries a soft light; leaf cards lean toward it. */
@property --spec { syntax: "<number>"; inherits: false; initial-value: 0; }
body::after { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(560px circle at var(--px, 50%) var(--py, 20%), rgba(255,255,255,.06), transparent 60%); }
body::before { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(60% 45% at 50% -8%, rgba(255,255,255,.14), transparent 70%), radial-gradient(40% 30% at 60% 105%, rgba(255,255,255,.05), transparent 70%); }
#root { position: relative; z-index: 1; }
.card, .item, .stat, .plan, .table-wrap, .cutview, .setup a, .land-steps li { box-shadow: var(--glass-rim); border-color: transparent; }
.card.tap:hover, a.item:hover, .item.tap:hover, .setup a:hover { border-color: transparent; background: rgba(255,255,255,.07); }
.btn.primary, .btn.brand { position: relative; overflow: hidden; background: var(--btn-bg); color: var(--primary-ink); box-shadow: var(--btn-glow); }
.btn.primary:hover, .btn.brand:hover { background: var(--btn-bg); box-shadow: inset 0 -1px 0 rgba(0,0,0,.12), 0 0 0 1px rgba(255,255,255,.5), 0 0 28px rgba(255,255,255,.4), 0 0 80px rgba(255,255,255,.16); }
.btn.primary::before { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.9) 50%, transparent 65%); mix-blend-mode: overlay; transform: translateX(-120%); transition: transform .8s var(--ease); pointer-events: none; }
.btn.primary:hover::before { transform: translateX(120%); }
.btn.primary:disabled, .btn.primary[disabled] { box-shadow: none; }
.sheet { background: rgba(18,18,22,.82); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-rim), var(--shadow-3); }
.sheet-back { background: rgba(0,0,0,.6); }
.toast { box-shadow: var(--glass-rim), var(--shadow-2); }
.land-top { background: rgba(0,0,0,.55); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.plan.current { box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), 0 0 60px -10px rgba(255,255,255,.18); }
.bar i { background: linear-gradient(90deg, #c6bbff, #fff); }
.chart .line { stroke: #fff; filter: drop-shadow(0 0 8px rgba(255,255,255,.55)); }
.chart .pt { fill: #000; stroke: #fff; }
.chart .area { fill: rgba(255,255,255,.06); }
.cut-strip i { border-color: #fff; background: rgba(255,255,255,.1); box-shadow: 0 0 20px rgba(255,255,255,.3); }
.cut-slot::before { background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.6); }
.hero h1 span:first-child { background: linear-gradient(100deg, #fff 20%, #a5a5b2 90%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 24px rgba(255,255,255,.22)); }

/* tilt: transform only while the pointer is on the card, so nothing else ever carries one */
.plan, .stat, .card.tap, .land-steps li { transition: transform .6s var(--ease), box-shadow .3s, --spec .4s; }
.tilting { --spec: 1; transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .12s linear, box-shadow .3s, --spec .4s;
  background-image: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,calc(var(--spec) * .12)), transparent 55%);
  box-shadow: var(--glass-rim), 0 30px 60px -20px rgba(0,0,0,.6); }

/* hero: three phones on a 3D stage, two glass chips; the stage turns with the pointer (or the scroll on a phone) */
.stage { position: relative; height: 460px; perspective: 1100px; --sx: 0; --sy: 0; }
.phone { position: absolute; top: 50%; left: 50%; width: 180px; aspect-ratio: 9 / 19.2; margin: -192px 0 0 -90px; border-radius: 34px; padding: 7px;
  background: linear-gradient(160deg, #3a3a40, #0c0c0e 40%, #222226);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.16), inset 0 1px 1px rgba(255,255,255,.35), 0 50px 100px -30px rgba(0,0,0,.95), 0 0 80px -20px rgba(255,255,255,.25);
  transform-style: preserve-3d; transition: transform .9s var(--ease); animation: bob 7s ease-in-out infinite; animation-delay: calc(var(--d) * -2.3s); }
@keyframes bob { 50% { translate: 0 -12px; } }
.phone-in { position: relative; height: 100%; border-radius: 28px; overflow: hidden; }
.phone-in .cut-frame { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; padding: 0 12px 26%; }
.phone-in .cut-frame b { font-size: 15px; }
.phone-in .cut-frame .tc { top: 14px; left: 14px; }
.p0 .cut-frame { background: radial-gradient(120% 80% at 30% 20%, #e8a06a, transparent 60%), linear-gradient(160deg, #8c4a3a, #1d1418); }
.p1 .cut-frame { background: radial-gradient(120% 80% at 70% 25%, #7fa6d8, transparent 60%), linear-gradient(160deg, #2f4d7a, #10151f); }
.p2 .cut-frame { background: radial-gradient(120% 80% at 35% 30%, #9ccf9a, transparent 60%), linear-gradient(160deg, #2f6b52, #0f1915); }
.p1 { z-index: 3; transform: translate3d(0, calc(var(--sy) * -20px), 80px) rotateX(calc(var(--sy) * 12deg)); }
.p0 { z-index: 2; transform: translate3d(-110px, 30px, -60px) rotateY(calc(26deg + var(--sy) * 10deg)) rotateZ(-4deg); }
.p2 { z-index: 1; transform: translate3d(110px, 30px, -60px) rotateY(calc(-26deg - var(--sy) * 10deg)) rotateZ(4deg); }
.float { position: absolute; z-index: 5; display: none; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 20px; font-size: 13px; line-height: 18px;
  background: rgba(255,255,255,.06); -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8); box-shadow: var(--glass-rim), var(--shadow-2);
  transform: translate3d(calc(var(--sx) * -40px), calc(var(--sy) * -30px), 0); transition: transform .9s var(--ease); animation: bob 6s ease-in-out infinite; }
.float svg.i { width: 36px; height: 36px; padding: 8px; border-radius: 12px; background: rgba(255,255,255,.1); color: #fff; flex: none; }
.float b { display: block; font-size: 15px; font-weight: 500; } .float small { color: var(--muted); }
.f1 { display: flex; left: 0; top: 2%; animation-delay: -1s; }
.f2 { right: -4%; top: 6%; animation-delay: -3s; }
@media (min-width: 960px) {
  .stage { height: 600px; perspective: 1600px; }
  .phone { width: 236px; margin: -252px 0 0 -118px; border-radius: 42px; padding: 9px; }
  .phone-in { border-radius: 34px; }
  .p1 { transform: translate3d(calc(var(--sx) * 36px), calc(var(--sy) * 24px), 80px) rotateY(calc(var(--sx) * 24deg)) rotateX(calc(var(--sy) * -16deg)); }
  .p0 { transform: translate3d(calc(-178px + var(--sx) * 20px), calc(34px + var(--sy) * 14px), -60px) rotateY(calc(28deg + var(--sx) * 22deg)) rotateX(calc(var(--sy) * -14deg)) rotateZ(-4deg); }
  .p2 { transform: translate3d(calc(178px + var(--sx) * 20px), calc(34px + var(--sy) * 14px), -60px) rotateY(calc(-28deg + var(--sx) * 22deg)) rotateX(calc(var(--sy) * -14deg)) rotateZ(4deg); }
  .f1 { left: -2%; top: 14%; } .f2 { display: flex; }
}
@media (prefers-reduced-motion: reduce) { .phone, .float { animation: none; } .tilting { transform: none; } }
