:root {
  --bg: #0F1013; --panel: #17191E; --panel2: #1E2128; --line: #2A2E37; --text: #ECEEF2; --muted: #A1A8B5;
  --amber: #FFB224; --amber-text: #FFB224; --ink: #1A1205; --blue: #7DBDFF; --blue-bg: rgba(108,180,255,.14);
  --green: #5BD49A; --lane: #14161A; --code: #0B0C0F; --link: #6CB4FF; --link-hover: #9CCBFF;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --panel-hi: #1B1E24; --hair: rgba(255,255,255,.055); --soft-line: #23262E; --red: #F2555A;
  --shadow: 0 1px 2px rgba(0,0,0,.25), 0 22px 44px -30px rgba(0,0,0,.9);
  --glow: 0 14px 32px -14px rgba(255,178,36,.6);
  --dots: rgba(255,255,255,.05); --leak: rgba(255,178,36,.12); --leak2: rgba(70,150,170,.07);
  --k-video: #7AA2D6; --k-text: #FF8F6B; --k-overlay: #4FC1B8; --k-audio: #5BD49A; --k-caption: #7DBDFF; --k-color: #A1A8B5;
  --ease: cubic-bezier(.2,.75,.15,1);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  /* The editor stays dark in both schemes, like an edit suite: the light tokens skip its page. */
  :root:not(:has(.shell.editor)) {
    --bg: #F4F2EE; --panel: #FFFFFF; --panel2: #F0EEE9; --line: #DDD9D1; --text: #17181B; --muted: #596070;
    --amber: #FFB224; --amber-text: #8F5400; --ink: #1A1205; --blue: #1F5FBF; --blue-bg: rgba(31,95,191,.10);
    --green: #12784A; --lane: #F7F5F1; --code: #FBFAF7; --link: #1F5FBF; --link-hover: #174A94;
    --panel-hi: #FFFFFF; --hair: rgba(255,255,255,.9); --soft-line: #E7E3DC; --red: #D93036;
    --shadow: 0 1px 2px rgba(23,24,27,.05), 0 18px 40px -28px rgba(23,24,27,.35);
    --glow: 0 14px 30px -14px rgba(201,133,0,.55);
    --dots: rgba(23,24,27,.075); --leak: rgba(255,178,36,.17); --leak2: rgba(70,150,170,.08);
    --k-video: #3F6FB0; --k-text: #D2603A; --k-overlay: #1F8F86; --k-audio: #12784A; --k-caption: #1F5FBF; --k-color: #596070;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); }
html { scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
body { min-height: 100vh; overflow-x: hidden; }
.shell:not(.signin-page) { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: rgba(255,178,36,.32); }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* build.sh writes the build stamp into <body data-build>; it shows below the app without a DOM node for Jaspr to own. */
:root { --stamp: 24px; }
body::after { content: attr(data-build); display: block; height: var(--stamp); line-height: var(--stamp); text-align: center; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.shell { position: relative; min-height: calc(100vh - var(--stamp)); display: flex; flex-direction: column; }

/* The editing-suite room behind every app screen. The sign-in page draws its own. */
.shell:not(.signin-page) { isolation: isolate; }
.shell:not(.signin-page)::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 45% at 100% 0%, var(--leak), transparent 70%),
    radial-gradient(40% 45% at 0% 100%, var(--leak2), transparent 70%),
    radial-gradient(var(--dots) 1px, transparent 1.5px) 0 0 / 22px 22px; }
.shell:not(.signin-page)::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--grain); opacity: .045; }

.topbar { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 4px; padding: 6px 20px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 84%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: inset 0 1px 0 var(--hair), 0 12px 30px -26px rgba(0,0,0,.7); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent 2%, rgba(255,178,36,.65) 14%, rgba(255,178,36,.12) 36%, transparent 60%); }
.topbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.topbar-row.sub { border-top: 1px solid var(--soft-line); padding-top: 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: var(--text); text-decoration: none; min-height: 44px; }
.brand:hover { color: var(--text); }
.brand-sub { font-weight: 500; font-size: 13px; letter-spacing: 0; color: var(--muted); }
@media (max-width: 560px) { .brand-sub { display: none; } }
.brand-mark { width: 26px; height: 26px; border-radius: 6px; background: var(--amber); display: flex; align-items: center; justify-content: center; }
.topbar .brand-mark { border-radius: 7px; box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 0 rgba(143,84,0,.25), 0 6px 16px -6px rgba(255,178,36,.75); transition: transform .3s var(--ease); }
.topbar .brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); }
.topbar .brand-name { font-size: 17px; letter-spacing: -0.03em; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; }
.nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 13px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s, background-color .2s; }
.nav a:hover { color: var(--text); background: color-mix(in srgb, var(--panel2) 70%, transparent); }
.nav a.on { background: var(--panel2); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--soft-line), inset 0 1px 0 var(--hair); }
.nav a.on::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 5px; height: 2px; border-radius: 2px; background: var(--amber); box-shadow: 0 0 10px rgba(255,178,36,.8); }
.crumbs { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; transition: color .2s; }
.crumbs a:hover { color: var(--text); }
.crumbs strong { font-weight: 700; font-size: 15px; letter-spacing: -0.015em; }
.pill { font-family: var(--mono); font-size: 12px; padding: 3px 9px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--amber) 38%, var(--line)); background: color-mix(in srgb, var(--amber) 9%, transparent); color: var(--amber-text); }
.unsaved { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--amber-text); }
.unsaved::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(255,178,36,.2), 0 0 10px rgba(255,178,36,.8); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.btn { min-height: 44px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-hi), var(--panel)); color: var(--text); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  box-shadow: inset 0 1px 0 var(--hair), 0 1px 2px rgba(0,0,0,.14); transition: transform .2s var(--ease), border-color .2s, background .2s, box-shadow .2s, filter .2s; }
.btn:hover { background: var(--panel2); color: var(--text); border-color: color-mix(in srgb, var(--line) 55%, var(--muted)); }
.btn:active { transform: translateY(1px); }
.btn.on { background: var(--panel2); border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); box-shadow: inset 0 0 0 1px rgba(255,178,36,.18), inset 0 1px 0 var(--hair); }
.btn.primary { border: none; background: linear-gradient(180deg, #FFC24F, #FFB224 55%, #F7A714); color: var(--ink); font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -2px 0 rgba(143,84,0,.26), 0 1px 2px rgba(26,18,5,.22), var(--glow); }
.btn.primary:hover { transform: translateY(-1px); filter: brightness(1.04); background: linear-gradient(180deg, #FFC24F, #FFB224 55%, #F7A714); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -2px 0 rgba(143,84,0,.26), 0 2px 4px rgba(26,18,5,.2), 0 20px 40px -16px rgba(255,178,36,.8); }
.btn.primary:active { transform: none; }
.btn:disabled { opacity: .5; cursor: default; transform: none; filter: none; }
.btn:disabled:hover { background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border-color: var(--line); }
.btn.primary:disabled, .btn.primary:disabled:hover { background: linear-gradient(180deg, #FFC24F, #FFB224 55%, #F7A714); box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.btn.dashed { border-style: dashed; color: var(--muted); width: 100%; background: transparent; box-shadow: none; }
.btn.dashed:hover { color: var(--amber-text); border-color: color-mix(in srgb, var(--amber) 60%, var(--line)); background: color-mix(in srgb, var(--amber) 6%, transparent); }

h1 { margin: 0; font-size: clamp(34px, 3vw, 44px); font-weight: 700; line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance; }
.label-caps { margin: 0; display: flex; align-items: center; gap: 9px; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.label-caps::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 1.5px; background: var(--amber); box-shadow: 0 0 9px rgba(255,178,36,.7); }
.row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.row-between > .label-caps { align-self: center; }
.small { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* The editor: one bar over a workspace that fills the window. The timeline row is the splitter's height. */
.shell.editor { height: calc(100vh - var(--stamp)); height: calc(100dvh - var(--stamp)); min-height: 0; }
.editor-body {
  flex: 1 1 auto; min-height: 0; display: grid;
  grid-template-columns: 288px minmax(0, 1fr) 300px;
  grid-template-rows: minmax(0, 1fr) 8px var(--tl-h, 240px);
  grid-template-areas: "vars stage props" "split split split" "tl tl tl";
}
.side { min-width: 0; min-height: 0; overflow-y: auto; padding: 0 12px 12px; background: linear-gradient(180deg, var(--panel-hi), var(--panel)); display: flex; flex-direction: column; gap: 9px; scrollbar-width: thin; scrollbar-color: #3A3F4A transparent; }
.side.left { grid-area: vars; border-right: 1px solid var(--line); }
.side.left > .row-between:first-child { position: sticky; top: 0; z-index: 2; margin: 0 -12px; padding: 11px 12px 8px; background: var(--panel-hi); }
.side.right { grid-area: props; border-left: 1px solid var(--line); padding-top: 12px; padding-bottom: 0; }
.side.right > .help { margin-top: 0; }
.insp-foot { position: sticky; bottom: 0; z-index: 2; margin: auto -12px 0; padding: 10px 12px 12px; background: var(--panel); border-top: 1px solid var(--soft-line); box-shadow: 0 -14px 20px -10px rgba(0,0,0,.6); }
.insp-foot .btn { width: 100%; }
/* The viewer is dark in both themes, like a program monitor: the tokens are reset for everything inside it. */
.stage { grid-area: stage; min-width: 0; min-height: 0; overflow-y: auto; padding: 10px 16px 8px; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 8px;
  --text: #ECEEF2; --muted: #8E95A2; --panel: #15171C; --panel-hi: #1A1D23; --panel2: #1F2229; --line: #2A2E37; --soft-line: #23262E; --code: #08090B; --hair: rgba(255,255,255,.06);
  --blue: #7DBDFF; --blue-bg: rgba(108,180,255,.14); --amber-text: #FFB224; color-scheme: dark; color: var(--text);
  position: relative; isolation: isolate; scrollbar-width: thin;
  background:
    radial-gradient(rgba(255,255,255,.06) 1px, transparent 1.5px) 0 0 / 22px 22px,
    radial-gradient(42% 52% at 50% 44%, rgba(255,178,36,.12), transparent 72%),
    radial-gradient(28% 34% at 100% 0%, rgba(255,110,50,.18), transparent 70%),
    radial-gradient(34% 40% at 0% 100%, rgba(70,150,170,.14), transparent 72%),
    #0A0B0D; }
.stage::before { content: ""; position: absolute; inset: 8px; z-index: -1; pointer-events: none; --c: rgba(255,255,255,.28);
  background:
    linear-gradient(var(--c), var(--c)) top left / 16px 1.5px no-repeat, linear-gradient(var(--c), var(--c)) top left / 1.5px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 16px 1.5px no-repeat, linear-gradient(var(--c), var(--c)) top right / 1.5px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 16px 1.5px no-repeat, linear-gradient(var(--c), var(--c)) bottom left / 1.5px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 16px 1.5px no-repeat, linear-gradient(var(--c), var(--c)) bottom right / 1.5px 16px no-repeat; }
.stage::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--grain); opacity: .12; mix-blend-mode: overlay; }
.timeline { grid-area: tl; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #3A3F4A transparent; }

.var-list { display: flex; flex-direction: column; gap: 7px; }
.var-card { display: flex; flex-direction: column; gap: 6px; padding: 9px 10px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--soft-line); box-shadow: inset 0 1px 0 var(--hair); transition: border-color .2s, box-shadow .2s; }
.var-card:hover { border-color: var(--line); }
.var-card.bound { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg), 0 12px 26px -18px rgba(108,180,255,.7); }
.var-head { display: flex; align-items: center; gap: 8px; }
.var-chip { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--blue); background: var(--blue-bg); padding: 2px 7px; border-radius: 5px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 22%, transparent); }
.var-type { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.var-usage { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.test-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.test-row input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); font-family: var(--mono); font-size: 12px; box-shadow: inset 0 1px 2px rgba(0,0,0,.12); transition: border-color .2s, box-shadow .2s; }
/* Thumbnails take the media's own shape: a fixed height, the width from the picture. */
.test-row img, .test-row video { width: auto; height: 32px; max-width: 56px; object-fit: contain; border-radius: 4px; box-shadow: 0 0 0 1px var(--line); }
.test-row .val { font-family: var(--mono); font-size: 12px; color: var(--text); }

.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.asset-btn { display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 9px; border: 1px solid transparent; background: transparent; min-width: 0; min-height: 44px; transition: border-color .2s, background .2s, box-shadow .2s, transform .2s var(--ease); }
.asset-btn:hover { background: var(--panel2); border-color: var(--line); }
.asset-btn.picked { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 8%, transparent); box-shadow: 0 0 0 1px var(--amber), 0 10px 24px -14px rgba(255,178,36,.8); }
.asset-btn img, .asset-btn video { align-self: center; width: auto; height: 72px; max-width: 100%; object-fit: contain; border-radius: 5px; display: block; box-shadow: 0 6px 16px -10px rgba(0,0,0,.7); }
.asset-btn .ph { height: 72px; }
.asset-btn span { font-family: var(--mono); font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }

/* Overlay geometry is the renderer's 236x420 layout (worker templatefilm/layout.go) as fractions of the frame. */
.fit { flex: 1 1 0; min-height: 0; width: 100%; container-type: size; display: flex; align-items: center; justify-content: center; }
.frame { position: relative; width: min(100cqw, 100cqh * var(--ar)); aspect-ratio: var(--ar); container-type: size; border-radius: 10px; overflow: hidden; background: #000; flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 40px 80px -30px rgba(0,0,0,.95), 0 0 130px -24px rgba(255,178,36,.32); }
.frame .base { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 50%; }
.frame .shade { position: absolute; left: 0; right: 0; top: 0; height: 38.095%; background: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,0)); }
.frame .caption { position: absolute; left: 6.78%; right: 6.78%; color: #fff; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; text-shadow: 0 1px 3px rgba(0,0,0,.5); outline-offset: 4px; border-radius: 2px; overflow-wrap: anywhere; }
.frame .caption.top { top: 6.667%; }
.frame .caption.bottom { bottom: 15.238%; }
.frame .logo { position: absolute; left: 6.78%; bottom: 3.81%; width: 24.407%; height: 5.786%; border-radius: 2px; outline-offset: 3px; }
.frame .logo img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: left bottom; }
.frame .logo.empty { display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.7); color: #fff; font-family: var(--mono); font-size: 11px; }
/* Caption pages: font size, lines and edges are the renderer's (templatefilm caption.go), lines centred. */
.frame .cap-layer { position: absolute; left: 6.78%; right: 6.78%; font-weight: 700; line-height: 1.1; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.5); outline-offset: 4px; border-radius: 2px; pointer-events: none; }
.frame .cap-layer.top { top: 6.667%; }
.frame .cap-layer.bottom { bottom: 15.238%; }
.frame .cap-line { white-space: pre; }
.sel-outline { outline: 2px solid #FFB224; }
.transport { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 10px; padding: 4px 14px 4px 4px; border-radius: 16px; font-family: var(--mono); font-size: 13px; color: var(--muted);
  background: rgba(18,20,24,.84); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px #2A2E37, inset 0 1px 0 rgba(255,255,255,.06), 0 26px 50px -26px rgba(0,0,0,.95); }
.transport .now { color: var(--amber); font-weight: 500; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); display: flex; align-items: center; justify-content: center; }
.transport .round-btn { border: none; background: linear-gradient(180deg, #FFC24F, #FFB224 60%, #F7A714); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -2px 0 rgba(143,84,0,.28), 0 8px 22px -8px rgba(255,178,36,.85); transition: transform .2s var(--ease), filter .2s; }
.transport .round-btn:hover { transform: scale(1.06); filter: brightness(1.05); }
.transport .round-btn:active { transform: scale(.97); }
.round-btn svg { pointer-events: none; }
.tag-soft { padding: 3px 8px; border-radius: 6px; background: var(--panel2); }
.transport .tag-soft { background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); font-size: 12px; }

.json-view { width: 100%; max-width: 680px; display: flex; flex-direction: column; gap: 10px; }
.json-view .note { font-size: 13px; color: var(--muted); }
.code-box { max-height: 470px; overflow: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--code); scrollbar-width: thin; box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 30px 60px -36px rgba(0,0,0,.9); }
pre.code { margin: 0; padding: 14px 16px; font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--text); white-space: pre; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .field .label { font-size: 12px; font-weight: 500; color: var(--muted); }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1 1 0; }
.control { min-height: 44px; width: 100%; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line); background-color: var(--panel2); color: var(--text); font-family: var(--mono); font-size: 13px; box-shadow: inset 0 1px 2px rgba(0,0,0,.12); transition: border-color .2s, box-shadow .2s; }
.control:hover, .input:hover, .test-row input:hover { border-color: color-mix(in srgb, var(--line) 55%, var(--muted)); }
.control:focus-visible, .input:focus-visible, .test-row input:focus-visible, .color-box:focus-within { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,178,36,.22); }
.color-box input:focus-visible { outline: none; }
select.control { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238E95A2' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; }
select.control.bind { color: var(--blue); }
input[type="color"].control { padding: 4px; cursor: pointer; }
input[type="range"] { accent-color: #FFB224; min-height: 44px; width: 100%; }
.field.switch-row { flex-direction: row; align-items: center; justify-content: space-between; min-height: 44px; }
.field.switch-row label { cursor: pointer; }
input.switch { appearance: none; -webkit-appearance: none; flex: 0 0 auto; position: relative; width: 40px; height: 24px; margin: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; transition: background-color .2s, border-color .2s; }
input.switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background-color .2s; }
input.switch:checked { background: #FFB224; border-color: #FFB224; }
input.switch:checked::before { transform: translateX(16px); background: #fff; }
input.switch:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255,178,36,.22); }
.help { margin-top: auto; padding: 11px 12px 11px 14px; border-radius: 10px; background: var(--blue-bg); font-size: 13px; line-height: 1.5; box-shadow: inset 3px 0 0 var(--blue); }

/* Track colours: each clip kind and its lane head share one accent. */
.clip.video, .clip.image { --clip: var(--k-video); }
.clip.text { --clip: var(--k-text); }
.clip.overlay { --clip: var(--k-overlay); }
.clip.audio { --clip: var(--k-audio); }
.clip.caption { --clip: var(--k-caption); }
.clip.color { --clip: var(--k-color); }
.tl-row:has(> .lane .clip.video, > .lane .clip.image) { --track: var(--k-video); }
.tl-row:has(> .lane .clip.text) { --track: var(--k-text); }
.tl-row:has(> .lane .clip.overlay) { --track: var(--k-overlay); }
.tl-row:has(> .lane .clip.audio) { --track: var(--k-audio); }
.tl-row:has(> .lane .clip.caption) { --track: var(--k-caption); }

.timeline { background: linear-gradient(180deg, var(--panel-hi), var(--panel)); padding: 6px 14px 8px; display: flex; flex-direction: column; gap: 4px; user-select: none; -webkit-user-select: none; touch-action: pan-y;
  box-shadow: inset 0 1px 0 var(--hair), 0 -18px 40px -30px rgba(0,0,0,.6); }
.tl-row { display: flex; gap: 10px; align-items: stretch; }
.tl-label { position: relative; flex: 0 0 64px; display: flex; flex-direction: column; justify-content: center; padding-left: 9px; font-family: var(--mono); font-size: 12px; font-weight: 500; }
.tl-label::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 2px; background: var(--track, var(--line)); box-shadow: 0 0 10px color-mix(in srgb, var(--track, transparent) 60%, transparent); }
.tl-label .k { color: var(--muted); font-size: 11px; font-weight: 400; }
.tl-hint { flex: 0 0 64px; font-size: 11px; color: var(--muted); display: flex; align-items: center; }
.ruler { position: relative; flex: 1 1 auto; height: 26px; padding: 0; border: none; border-radius: 7px; background: linear-gradient(180deg, var(--panel2), var(--lane)); box-shadow: inset 0 0 0 1px var(--soft-line), inset 0 -1px 0 var(--line); font-family: var(--mono); font-size: 11px; color: var(--muted); cursor: pointer; touch-action: none; }
.ruler span { position: absolute; top: 40%; transform: translate(-50%, -50%); pointer-events: none; }
.ruler span:first-child { transform: translate(0, -50%); }
.ruler span:last-child { transform: translate(-100%, -50%); }
.ruler .ticks span::after { content: ""; position: absolute; left: 50%; top: calc(100% + 1px); width: 1px; height: 5px; background: currentColor; opacity: .55; }
.ruler .ticks span:first-child::after { left: 0; }
.ruler .ticks span:last-child::after { left: auto; right: 0; }
.lanes { --lab: 74px; position: relative; display: flex; flex-direction: column; gap: 4px; }
.lane { position: relative; flex: 1 1 auto; border-radius: 8px; background: var(--lane); height: 36px; box-shadow: inset 0 0 0 1px var(--soft-line), inset 0 1px 3px rgba(0,0,0,.14); }
.clip { position: absolute; top: 2px; bottom: 2px; padding: 0; border-radius: 6px; overflow: hidden; display: flex; align-items: center; text-align: left; color: var(--text);
  background-color: var(--panel2);
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--clip, var(--muted)) 26%, transparent), color-mix(in srgb, var(--clip, var(--muted)) 13%, transparent));
  border: 1px solid color-mix(in srgb, var(--clip, var(--line)) 42%, var(--line));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 4px 10px -6px rgba(0,0,0,.5); transition: border-color .15s, box-shadow .15s; }
.clip::before { content: ""; position: absolute; z-index: 1; left: 0; top: 0; bottom: 0; width: 3px; background: var(--clip, var(--line)); pointer-events: none; }
.clip:hover { border-color: color-mix(in srgb, var(--clip, var(--line)) 75%, var(--line)); }
.clip.color { background-image: linear-gradient(180deg, rgba(255,255,255,.06), transparent); }
.clip.sel { border: 2px solid var(--amber); z-index: 1; box-shadow: 0 0 0 3px rgba(255,178,36,.2), 0 10px 24px -10px rgba(255,178,36,.7); }
/* No pointer events: a press on an img starts the browser's own image drag, which cancels the clip drag. */
.clip img, .clip video { flex: none; height: 100%; width: auto; max-width: 50%; object-fit: contain; pointer-events: none; }
.clip .wave { position: absolute; inset: 6px 8px; display: flex; align-items: center; gap: 2px; }
.clip .wave i { flex: 1 1 0; background: linear-gradient(180deg, var(--k-audio), color-mix(in srgb, var(--k-audio) 55%, transparent)); opacity: .5; border-radius: 1.5px; }
.clip.caption.has-words { align-items: flex-start; }
.clip.caption.has-words .txt { padding-top: 4px; }
.clip.caption.has-words .txt small { display: none; }
.clip .words { position: absolute; left: 0; right: 0; bottom: 4px; height: 16px; pointer-events: none; }
.clip .words i { position: absolute; top: 0; height: 16px; overflow: hidden; white-space: nowrap; font-style: normal; font-family: var(--mono); font-size: 10px; line-height: 16px; padding-left: 2px; border-left: 1px solid var(--blue); color: var(--muted); }
.clip .txt { position: relative; padding: 0 10px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.clip .txt b { font-family: var(--mono); font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 0 color-mix(in srgb, var(--panel) 60%, transparent); }
.clip .txt small { font-size: 10.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Only the head grabs the playhead: the line over the lanes lets presses through to the clips under it. */
.playhead { position: absolute; z-index: 2; top: -30px; bottom: 0; width: 14px; margin-left: -6px; cursor: grab; touch-action: none; pointer-events: none; }
.playhead::before { pointer-events: auto; }
.playhead:active { cursor: grabbing; }
.playhead::before { content: ""; position: absolute; top: 0; left: 0; width: 14px; height: 12px; background: linear-gradient(180deg, #FFC24F, #FFB224); clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%); }
.playhead::after { content: ""; position: absolute; top: 0; bottom: 0; left: 6px; width: 2px; background: var(--amber); box-shadow: 0 0 10px rgba(255,178,36,.75), 0 0 2px rgba(255,178,36,.9); }
.clip { cursor: grab; touch-action: none; }
.timeline.dragging, .timeline.dragging .clip { cursor: grabbing; }
.timeline.edge-hover, .timeline.edge-hover .clip { cursor: ew-resize; }
/* The edge is picked from the pointer x (hitClip), so the grip is only a picture and lets presses through. */
.clip-edge { position: absolute; z-index: 3; top: 0; bottom: 0; width: min(12px, 33%); pointer-events: none; background: rgba(255,178,36,.28); opacity: 0; transition: opacity .12s; }
.clip-edge::before { content: ""; position: absolute; top: 50%; left: 50%; width: 2px; height: 14px; max-height: 60%; transform: translate(-50%, -50%); border-left: 2px solid var(--amber); border-right: 2px solid var(--amber); }
.clip-edge.l { left: 0; }
.clip-edge.r { right: 0; }
.clip:hover .clip-edge, .clip.sel .clip-edge { opacity: 1; }
.snap-guide { position: absolute; z-index: 3; top: -30px; bottom: 0; width: 1px; margin-left: 1px; background: var(--blue); box-shadow: 0 0 8px var(--blue); pointer-events: none; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 12px 18px 12px 36px; border-radius: 12px; background: rgba(18,20,24,.94); color: #ECEEF2; font-size: 14px; font-weight: 600; z-index: 10;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 0 0 1px #2A2E37, inset 0 1px 0 rgba(255,255,255,.06), 0 24px 50px -18px rgba(0,0,0,.75); }
.toast::before { content: ""; position: absolute; left: 16px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px rgba(255,178,36,.9); }

.page { padding: 30px 32px 40px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-direction: column; gap: 8px; }
.page-head::before { content: ""; width: 28px; height: 3px; margin-bottom: 6px; border-radius: 2px; background: var(--amber); box-shadow: 0 0 14px rgba(255,178,36,.75); }
.page-head p { margin: 0; font-size: 15.5px; line-height: 1.5; color: var(--muted); max-width: 660px; text-wrap: pretty; }
.cols { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.col-form { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.col-code { flex: 2 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.card { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 16px; background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--hair), var(--shadow); }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field > label, .form-field > .label { font-size: 13px; font-weight: 600; }
.form-field .key { font-family: var(--mono); font-weight: 400; color: var(--blue); }
.input { min-height: 44px; width: 100%; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 15px; box-shadow: inset 0 1px 2px rgba(0,0,0,.12); transition: border-color .2s, box-shadow .2s; }
.input.over { border-color: #E5484D; }
.hint { font-size: 12px; color: var(--muted); }
.hint.over { color: #E5484D; }
.asset-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--soft-line); box-shadow: inset 0 1px 0 var(--hair); }
.asset-row img, .asset-row video { width: auto; height: 54px; max-width: 96px; object-fit: contain; border-radius: 6px; flex: 0 0 auto; box-shadow: 0 0 0 1px var(--line), 0 6px 14px -8px rgba(0,0,0,.6); }
.asset-row .meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.asset-row .btn { margin-left: auto; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--lane); }
.inline-row { display: flex; gap: 12px; flex-wrap: wrap; }
.inline-row > .grow2 { flex: 2 1 180px; }
.inline-row > .grow1 { flex: 1 1 120px; }
.color-box { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel2); box-shadow: inset 0 1px 2px rgba(0,0,0,.12); transition: border-color .2s, box-shadow .2s; }
.color-box .sw { width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto; border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 3px 10px -3px rgba(0,0,0,.4); }
.color-box input { border: none; background: transparent; font-family: var(--mono); font-size: 14px; width: 100%; min-width: 0; min-height: 40px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.chips span { padding: 4px 10px; border-radius: 99px; background: var(--panel2); box-shadow: inset 0 0 0 1px var(--soft-line); }
.error { margin: 0; padding: 10px 12px 10px 15px; border-radius: 9px; background: rgba(229,72,77,.12); color: var(--text); font-size: 14px; box-shadow: inset 3px 0 0 var(--red); }
.btn.big { position: relative; overflow: hidden; min-height: 52px; border-radius: 13px; font-size: 16px; letter-spacing: -0.01em; }
.btn.primary.big::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,.5) 50%, transparent 65%); transform: translateX(-110%); pointer-events: none; }
.btn.primary.big:hover:not(:disabled)::after { transform: translateX(110%); transition: transform .9s var(--ease); }
.status-row { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.status-row .dot { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--ink); flex: 0 0 auto; border: 2px solid var(--line); }
.status-row.done .dot { border: none; background: var(--green); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 0 12px -2px color-mix(in srgb, var(--green) 80%, transparent); }
.status-row.active .dot { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(255,178,36,.16); }
.status-row .lbl { flex: 1 1 auto; }
.status-row.waiting .lbl { color: var(--muted); }
.status-row .t { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.state { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 9px; border-radius: 99px; background: color-mix(in srgb, currentColor 12%, transparent); font-size: 12.5px; font-weight: 600; color: var(--amber-text); }
.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.state.succeeded { color: var(--green); }
.bar { height: 6px; border-radius: 99px; background: var(--panel2); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.18); }
.bar > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #F7A714, #FFC24F); box-shadow: 0 0 12px rgba(255,178,36,.7); }
/* The code cards are dark in both themes, like the call card on the sign-in page. */
.code-card { --text: #ECEEF2; --muted: #8E95A2; --line: #262A32; --panel: #15171C; --code: #0B0C0F; --blue: #7DBDFF; --blue-bg: rgba(108,180,255,.15); --green: #5BD49A; --amber-text: #FFB224;
  color-scheme: dark; color: var(--text); border-radius: 16px; background: #0B0C0F; overflow: hidden;
  box-shadow: 0 0 0 1px #23262D, inset 0 1px 0 rgba(255,255,255,.05), 0 34px 64px -38px rgba(0,0,0,.85); }
.code-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #181A20, #131519); }
.code-head .title { font-size: 14px; font-weight: 600; }
.code-head .note { margin-left: auto; font-size: 12px; color: var(--muted); }
.tag { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .03em; padding: 2px 8px; border-radius: 5px; }
.tag.rest { background: var(--blue-bg); color: var(--blue); box-shadow: inset 0 0 0 1px rgba(125,189,255,.25); }
.tag.mcp { background: var(--amber); color: var(--ink); box-shadow: 0 0 12px -2px rgba(255,178,36,.6); }
.tag.result { background: rgba(91,212,154,.16); color: var(--green); box-shadow: inset 0 0 0 1px rgba(91,212,154,.25); }
.code-scroll { overflow-x: auto; scrollbar-width: thin; }
.code-scroll pre.code { font-size: 13px; line-height: 1.65; padding: 16px 18px; color: #C9CED8; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.tpl-card { display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 16px; border-radius: 18px; background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--hair), var(--shadow);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s; }
.tpl-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); box-shadow: inset 0 1px 0 var(--hair), 0 30px 60px -34px rgba(0,0,0,.8), 0 18px 50px -30px rgba(255,178,36,.5); }
/* Each template's media runs as a strip of film on a small dark viewer. */
.tpl-thumbs { position: relative; display: flex; justify-content: center; gap: 6px; height: 214px; padding: 17px 14px; border-radius: 11px; overflow: hidden;
  background:
    radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.5px) 0 0 / 16px 16px,
    radial-gradient(60% 80% at 85% 10%, rgba(255,178,36,.24), transparent 70%),
    radial-gradient(50% 70% at 0% 100%, rgba(70,150,170,.18), transparent 70%),
    #0C0D10;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.tpl-thumbs::before, .tpl-thumbs::after { content: ""; position: absolute; left: 6px; right: 6px; height: 5px; border-radius: 1px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 7px, transparent 7px 14px); pointer-events: none; }
.tpl-thumbs::before { top: 6px; }
.tpl-thumbs::after { bottom: 6px; }
.tpl-thumbs:empty { display: none; }
.tpl-thumbs img, .tpl-thumbs video { flex: 0 1 auto; min-width: 0; height: 100%; width: auto; object-fit: contain; background: var(--panel2); border-radius: 5px; box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 14px 30px -14px rgba(0,0,0,.9); transition: transform .5s var(--ease); }
.tpl-card:hover .tpl-thumbs img, .tpl-card:hover .tpl-thumbs video { transform: translateY(-2px) scale(1.015); }
.tpl-card h2 { margin: 4px 2px 0; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.tpl-meta { margin: 0 2px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tpl-card .actions { margin: 4px 2px 0; }
.center-note { position: relative; padding: 52px 24px 48px; text-align: center; color: var(--muted); font-size: 15px; border-radius: 18px; border: 1px dashed var(--line);
  background: radial-gradient(var(--dots) 1px, transparent 1.5px) 0 0 / 18px 18px; }
.center-note::before { content: ""; display: block; width: 52px; height: 36px; margin: 0 auto 16px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 36' fill='none'><rect x='1' y='1' width='50' height='34' rx='6' stroke='%23FFB224' stroke-opacity='.55' stroke-width='1.5'/><path d='M22 12.5v11l9-5.5z' fill='%23FFB224'/><path d='M1 8h50M1 28h50' stroke='%23FFB224' stroke-opacity='.25' stroke-dasharray='3 4'/></svg>") center / contain no-repeat;
  filter: drop-shadow(0 6px 14px rgba(255,178,36,.35)); }
.center-note p { margin: 0 0 6px; color: var(--text); }
.card > p.small:only-child { padding: 14px 0 10px; text-align: center; font-size: 14px; }
.shell > .center-note { margin: 28px 32px; }
@media (max-width: 860px) { .shell > .center-note { margin: 20px 16px; } }

@media (max-width: 860px) {
  .page { padding: 22px 16px 32px; }
  .topbar { padding: 8px 16px; }
  h1 { font-size: 30px; }
}

.account { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.account .who { color: var(--text); font-weight: 500; }
.btn.small { min-height: 36px; padding: 0 11px; border-radius: 9px; font-size: 13px; }
.btn.danger { border-color: color-mix(in srgb, #E5484D 70%, var(--line)); color: var(--red); background: color-mix(in srgb, #E5484D 5%, transparent); }
.btn.danger:hover { background: rgba(229,72,77,.13); border-color: #E5484D; color: var(--red); }
.btn.disabled { opacity: .55; pointer-events: none; }
label.btn { cursor: pointer; }
.linklike { background: none; border: none; padding: 0; min-height: 44px; color: var(--link); text-decoration: underline; font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.page.narrow { max-width: 960px; }
.notice { margin: 0; padding: 10px 12px 10px 15px; border-radius: 9px; background: rgba(91,212,154,.13); font-size: 14px; box-shadow: inset 3px 0 0 var(--green); }
.warn { margin: 0; padding: 10px 12px 10px 15px; border-radius: 9px; background: rgba(255,178,36,.15); color: var(--text); font-size: 14px; font-weight: 600; box-shadow: inset 3px 0 0 var(--amber); }
.state.queued, .state.rendering { color: var(--amber-text); }
.state.failed { color: var(--red); }
.bar.indeterminate > div { width: 35% !important; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { from { margin-left: -35%; } to { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .bar.indeterminate > div { animation: none; width: 100% !important; opacity: .5; } }
.ph { display: flex; align-items: center; justify-content: center; height: 40px; border-radius: 5px; background: var(--panel2); font-family: var(--mono); font-size: 11px; color: var(--muted); }

.asset-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.lib-card { display: flex; flex-direction: column; gap: 11px; padding: 10px 10px 12px; border-radius: 16px; background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--line); min-width: 0; box-shadow: inset 0 1px 0 var(--hair), var(--shadow);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s; }
.lib-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--amber) 40%, var(--line)); box-shadow: inset 0 1px 0 var(--hair), 0 30px 56px -34px rgba(0,0,0,.8), 0 16px 44px -30px rgba(255,178,36,.45); }
.lib-thumb { height: 164px; padding: 12px; display: flex; align-items: center; justify-content: center; border-radius: 10px;
  background: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.5px) 0 0 / 14px 14px, radial-gradient(60% 80% at 80% 0%, rgba(255,178,36,.16), transparent 70%), #0C0D10;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.lib-thumb img, .lib-thumb video { width: auto; height: 100%; max-width: 100%; object-fit: contain; border-radius: 6px; display: block; filter: drop-shadow(0 10px 14px rgba(0,0,0,.55)); }
.kind-big { align-self: stretch; flex: 1 1 auto; display: flex; align-items: center; justify-content: center; border-radius: 7px; font-family: var(--mono); font-size: 13px; font-weight: 500; color: #FFB224; text-transform: uppercase; letter-spacing: .22em;
  background: repeating-linear-gradient(90deg, rgba(91,212,154,.2) 0 2px, transparent 2px 6px) center / 100% 34% no-repeat; text-shadow: 0 0 14px rgba(255,178,36,.6); }
.lib-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 0 2px; }
.lib-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-meta .chips { font-size: 12px; gap: 6px; margin: 2px 0; }
.lib-meta .chips span { padding: 2px 8px; font-family: var(--mono); font-size: 11px; }
.lib-card > .actions { padding: 0 2px; }
.confirm { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; background: rgba(229,72,77,.10); box-shadow: inset 0 0 0 1px rgba(229,72,77,.3); }
.upload-card .bar { height: 8px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, var(--panel-hi), var(--panel)); box-shadow: inset 0 1px 0 var(--hair), var(--shadow); scrollbar-width: thin; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: color-mix(in srgb, var(--panel2) 55%, transparent); }
table.list td { padding: 8px 14px; border-bottom: 1px solid var(--soft-line); vertical-align: middle; white-space: nowrap; transition: background-color .15s; }
table.list tr:last-child td { border-bottom: none; }
table.list td.mono { font-family: var(--mono); font-size: 13px; }
table.list a.mono { font-family: var(--mono); display: inline-flex; align-items: center; min-height: 44px; color: var(--text); font-weight: 500; text-decoration-color: color-mix(in srgb, var(--muted) 45%, transparent); }
table.list a.mono:hover { color: var(--amber-text); text-decoration-color: currentColor; }
table.list .right { text-align: right; }
table.list tr.revoked td { color: var(--muted); }
table.list tr.revoked td:first-child { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
table.list .btn.primary { min-height: 36px; }
.actions.end { justify-content: flex-end; }

.secret-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
code.secret { flex: 1 1 260px; min-width: 0; padding: 12px 13px; border-radius: 9px; background: var(--code); border: 1px solid var(--line); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; user-select: all; box-shadow: inset 0 1px 3px rgba(0,0,0,.14); }
.card.once { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,178,36,.16), inset 0 1px 0 var(--hair), 0 26px 60px -32px rgba(255,178,36,.55); }
.card.once code.secret { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0 16px; margin: 0; font-size: 14px; }
dl.facts dt, dl.facts dd { padding: 8px 0; border-bottom: 1px solid var(--soft-line); }
dl.facts dt:last-of-type, dl.facts dd:last-of-type { border-bottom: none; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-family: var(--mono); font-size: 13px; }

.signin { align-items: center; justify-content: center; padding: 24px 16px; }
.signin-box { width: 100%; max-width: 400px; }
.signin-box h1 { font-size: 26px; }
.signin-box .btn.big { width: 100%; }
.signin-box .fine { margin: 0; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.5; }

@media (max-width: 860px) {
  table.list th, table.list td { padding: 8px 10px; }
}
.render-id { margin: 0; font-size: 14px; font-weight: 600; }
@media (max-width: 600px) {
  table.list thead { display: none; }
  table.list, table.list tbody { display: block; }
  table.list tr { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; padding: 10px 12px; border-bottom: 1px solid var(--soft-line); }
  table.list tr:last-child { border-bottom: none; }
  table.list td { display: block; padding: 0; border: none; white-space: normal; }
  table.list td:first-child { flex-basis: 100%; }
  table.list td.right { margin-left: auto; text-align: right; }
}

/* A finished render plays at its own shape: --ar is the video's width / height, read from its metadata,
   and the box is the largest of that shape that fits, so the video is never cropped or letterboxed. */
.player { --player-h: min(60vh, 560px); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border-radius: 13px;
  background: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.5px) 0 0 / 18px 18px, radial-gradient(50% 60% at 50% 45%, rgba(255,178,36,.16), transparent 72%), #0C0D10;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.player video { display: block; width: min(100%, var(--player-h) * (var(--ar))); aspect-ratio: var(--ar); height: auto; border-radius: 10px; background: #000;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 30px 60px -28px rgba(0,0,0,.95), 0 0 100px -30px rgba(255,178,36,.4); }
.player.pending video { width: 1px; height: 1px; opacity: 0; }
.player.pending::before { content: ""; display: block; width: 100%; height: 120px; border-radius: 10px; background: rgba(255,255,255,.04); }
.player.failed video { display: none; }
.player.failed::before { display: none; }
table.list tr.playable { cursor: pointer; }
table.list tr.playable:hover td { background: color-mix(in srgb, var(--amber) 7%, transparent); }
table.list tr.playable:hover td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.player-dialog { padding: 0; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, var(--panel-hi), var(--panel)); color: var(--text); max-width: calc(100vw - 32px); max-height: calc(100vh - 32px);
  box-shadow: inset 0 1px 0 var(--hair), 0 40px 100px -30px rgba(0,0,0,.8), 0 0 120px -40px rgba(255,178,36,.4); }
.player-dialog::backdrop { background: rgba(6,7,9,.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.player-panel { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px 20px; }
.player-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.player-dialog .player { --player-h: calc(100vh - 272px); }
.player-dialog .player video { width: min(calc(100vw - 104px), var(--player-h) * (var(--ar)), 1280px); }
.player-dialog .player.pending::before { width: 320px; max-width: calc(100vw - 104px); height: 320px; }

.list-field { gap: 10px; }
.list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.list-head .label { font-size: 13px; font-weight: 600; }
.item-card { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--soft-line); background: var(--lane); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--blue) 55%, transparent); }
.item-card.has-error { border-color: #E5484D; box-shadow: inset 3px 0 0 #E5484D; }
.item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.item-head strong { font-size: 14px; }
.item-actions { display: flex; gap: 6px; }
.btn.icon { width: 44px; padding: 0; font-size: 18px; }
.film-length { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding-top: 12px; border-top: 1px solid var(--soft-line); font-size: 14px; color: var(--muted); }
.film-length .mono { font-family: var(--mono); font-size: 17px; font-weight: 500; color: var(--text); }

/* Editor timeline with a list: the section band and its handles on the ruler, item edges over the lanes, ghost copies. */
.tl-head { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 30px; }
.tl-head .tl-note { flex: 1 1 220px; min-width: 0; font-family: var(--mono); font-size: 11.5px; }
.tl-head .btn.small { min-height: 28px; padding: 0 10px; border-radius: 7px; font-size: 12.5px; gap: 7px; }
.kbd { font-family: var(--mono); font-size: 10px; line-height: 1; padding: 2px 4px; border-radius: 4px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.btn.primary .kbd { color: rgba(26,18,5,.7); box-shadow: inset 0 0 0 1px rgba(26,18,5,.3); }
.sec-tag { font-family: var(--mono); font-size: 12px; color: var(--blue); background: var(--blue-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 25%, transparent); }
.ruler .ticks { position: absolute; inset: 0; pointer-events: none; }
.sec-band { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--blue); border-right: 2px solid var(--blue); border-radius: 4px; background: var(--blue-bg); pointer-events: none; }
.sec-band.live { border-color: var(--amber); background: rgba(255,178,36,.16); box-shadow: 0 0 18px -4px rgba(255,178,36,.6); }
.sec-handle { position: absolute; z-index: 1; top: 0; bottom: 0; width: 18px; margin-left: -9px; cursor: ew-resize; touch-action: none; }
.sec-handle::before { content: ""; position: absolute; left: 6px; right: 6px; top: 9px; bottom: 9px; border-radius: 3px; background: var(--blue); box-shadow: 0 0 8px color-mix(in srgb, var(--blue) 70%, transparent); }
.mark, .mark-span { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.mark { width: 2px; margin-left: -1px; background: var(--amber); box-shadow: 0 0 8px rgba(255,178,36,.7); }
.mark::after { position: absolute; top: 2px; padding: 0 3px; border-radius: 2px; background: var(--amber); color: var(--ink); font-family: var(--mono); font-size: 10px; font-weight: 700; line-height: 14px; }
.mark.in::after { content: "IN"; left: 2px; }
.mark.out::after { content: "OUT"; right: 2px; }
.mark-span { background: rgba(255,178,36,.14); }
.item-edge { position: absolute; z-index: 1; top: 0; bottom: 0; width: 1px; background: var(--blue); opacity: .4; pointer-events: none; }
.item-edge.sec { width: 2px; margin-left: -1px; opacity: .9; box-shadow: 0 0 8px color-mix(in srgb, var(--blue) 70%, transparent); }
.clip.ghost { cursor: pointer; border-style: dashed; opacity: .6; background-image: repeating-linear-gradient(135deg, rgba(127,127,127,.2) 0 6px, transparent 6px 12px); }

/* The list block in the variables panel. */
.list-block { gap: 8px; border-color: var(--soft-line); }
.list-block.bound { border-color: var(--blue); }
.var-chip.name-edit { min-width: 4ch; max-width: 100%; min-height: 32px; border: 1px dashed transparent; }
.var-chip.name-edit:hover, .var-chip.name-edit:focus { border-color: var(--blue); }
.list-fields { display: flex; flex-direction: column; gap: 4px; }
.list-field-row { display: flex; align-items: center; gap: 8px; padding: 2px 4px; border-radius: 7px; border: 1px solid transparent; }
.list-field-row.bound { border-color: var(--blue); background: var(--blue-bg); }
.btn.icon.small { width: 36px; font-size: 16px; }
.add-field { display: flex; gap: 8px; }
.add-field .control { flex: 1 1 auto; min-width: 0; min-height: 36px; }
.add-field .btn { white-space: nowrap; }
.limits .control { min-height: 36px; }
.preview-items { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.preview-items > span { margin-right: auto; color: var(--muted); }
.test-item { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 8px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--soft-line); }
.test-item strong { font-size: 12px; }

/* Load-in: the suite assembles once per screen. Only containers that persist across rebuilds animate. */
@media (prefers-reduced-motion: no-preference) {
  .editor-body > .side.left { animation: ed-left .65s var(--ease) both; }
  .editor-body > .side.right { animation: ed-right .65s var(--ease) .06s both; }
  .editor-body > .stage { animation: ed-fade .9s ease-out .04s both; }
  .editor-body > .timeline { animation: ed-up .7s var(--ease) .12s both; }
  .stage .frame { animation: ed-frame 1s var(--ease) .22s both; }
  .stage .transport { animation: ed-up .7s var(--ease) .4s both; }
  .stage .json-view { animation: ed-up .5s var(--ease) both; }
  .page > * { animation: ed-up .7s var(--ease) both; }
  .page > :nth-child(2) { animation-delay: .07s; }
  .page > :nth-child(3) { animation-delay: .14s; }
  .page > :nth-child(n+4) { animation-delay: .2s; }
  .tpl-grid > *, .asset-lib > * { animation: ed-up .65s var(--ease) both; }
  .tpl-grid > :nth-child(2), .asset-lib > :nth-child(2) { animation-delay: .05s; }
  .tpl-grid > :nth-child(3), .asset-lib > :nth-child(3) { animation-delay: .1s; }
  .tpl-grid > :nth-child(4), .asset-lib > :nth-child(4) { animation-delay: .15s; }
  .tpl-grid > :nth-child(5), .asset-lib > :nth-child(5) { animation-delay: .2s; }
  .tpl-grid > :nth-child(6), .asset-lib > :nth-child(6) { animation-delay: .25s; }
  .tpl-grid > :nth-child(n+7), .asset-lib > :nth-child(n+7) { animation-delay: .3s; }
  .col-code > * { animation: ed-up .7s var(--ease) both; }
  .col-code > :nth-child(2) { animation-delay: .1s; }
  .col-code > :nth-child(3) { animation-delay: .2s; }
  .center-note::before { animation: ed-breathe 2.6s ease-in-out infinite alternate; }
  .toast { animation: ed-toast .4s var(--ease) both; }
  .player-dialog[open] { animation: ed-pop .45s var(--ease) both; }
  .unsaved::before, .state.queued::before, .state.rendering::before { animation: ed-pulse 1.6s ease-in-out infinite; }
  .status-row.active .dot { animation: ed-ring 1.6s ease-out infinite; }
}
@keyframes ed-left { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes ed-right { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes ed-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ed-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ed-frame { from { opacity: 0; transform: translateY(22px) scale(.965); } to { opacity: 1; transform: none; } }
@keyframes ed-toast { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes ed-pop { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ed-breathe { from { opacity: .7; transform: translateY(0); } to { opacity: 1; transform: translateY(-3px); } }
@keyframes ed-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ed-ring { 0% { box-shadow: 0 0 0 0 rgba(255,178,36,.45); } 100% { box-shadow: 0 0 0 9px rgba(255,178,36,0); } }

/* Sign-in page: the panel on the theme surface, beside a viewer that plays the real render of the
   landing page's POST /v1/renders call. The viewer is dark in both themes, like the landing call strip. */
.signin-page {
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --stage: #0C0D10; --stage-line: rgba(255,255,255,.07); --chip-ring: rgba(26,18,5,.14);
  --glow: 0 18px 40px -14px rgba(255,178,36,.65);
  --ease: cubic-bezier(.2,.75,.15,1);
  position: relative; isolation: isolate; flex-direction: row; align-items: stretch; gap: 16px;
  height: calc(100vh - var(--stamp)); height: calc(100dvh - var(--stamp)); min-height: 600px; padding: 16px;
}
@media (prefers-color-scheme: light) {
  .signin-page { --stage: #111216; --stage-line: rgba(255,255,255,.08); --glow: 0 18px 40px -14px rgba(201,133,0,.55); }
}
.signin-page::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--grain); opacity: .07; pointer-events: none; }

.signin-panel { flex: 0 0 clamp(400px, 38vw, 540px); min-width: 0; display: flex; flex-direction: column; padding: 4px clamp(16px, 2.6vw, 40px) 8px clamp(8px, 2.6vw, 40px); }
.signin-main { margin: auto 0; padding: 24px 0 32px; max-width: 432px; display: flex; flex-direction: column; }
.signin-free { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; padding: 6px 13px 6px 11px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; color: var(--muted); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.signin-free b { font-weight: 600; color: var(--text); }
.signin-free-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: 0 0 auto; }
.signin-free-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--amber); opacity: 0; }

.signin-page .signin-title { margin: 26px 0 0; font-size: clamp(44px, 4.6vw, 64px); font-weight: 700; line-height: .98; letter-spacing: -0.045em; text-wrap: balance; }
.signin-title .w { display: inline-block; padding: 0 .07em .04em; margin: 0 -.07em; border-radius: .13em; }
.signin-title .w4 { margin-left: -.02em; padding: 0 .12em .05em; background: var(--amber); color: var(--ink); box-shadow: 0 .06em 0 rgba(143,84,0,.35); transform: rotate(-1.5deg); }
.signin-why { margin: 20px 0 0; max-width: 30em; font-size: 17px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }

.signin-google { position: relative; overflow: hidden; margin-top: 32px; width: 100%; min-height: 60px; padding: 8px 20px 8px 8px; display: flex; align-items: center; gap: 14px; border: 0; border-radius: 15px; background: var(--amber); color: var(--ink); font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -2px 0 rgba(143,84,0,.28), 0 1px 2px rgba(26,18,5,.22), var(--glow);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .25s; }
.signin-google::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%); transform: translateX(-110%); pointer-events: none; }
.signin-google:hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -2px 0 rgba(143,84,0,.28), 0 2px 4px rgba(26,18,5,.2), 0 26px 50px -16px rgba(255,178,36,.8); }
.signin-google:hover::after { transform: translateX(110%); transition: transform .9s var(--ease); }
.signin-google:active { transform: translateY(0); }
.signin-google:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.signin-google:disabled { cursor: progress; filter: saturate(.7); opacity: .75; transform: none; }
.g-chip { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: #FFFFFF; box-shadow: 0 0 0 1px var(--chip-ring), 0 1px 3px rgba(26,18,5,.25); }
.g-chip svg { width: 22px; height: 22px; display: block; }
.g-label { flex: 1 1 auto; padding-right: 44px; text-align: center; }
.signin-main .fine { margin: 0; text-align: center; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.signin-google + .fine { margin-top: 16px; }
.signin-main .error { margin-top: 16px; }

/* The viewer. A size container, so the phone and the call card scale with it. */
.signin-stage { flex: 1 1 auto; min-width: 0; position: relative; overflow: hidden; isolation: isolate; container-type: size; border-radius: 26px; background: radial-gradient(rgba(255,255,255,.075) 1px, transparent 1.5px) 0 0 / 22px 22px, var(--stage); color: #ECEEF2; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--stage-line), 0 30px 80px -40px rgba(0,0,0,.6); }
.signin-stage::before { content: ""; position: absolute; inset: -20%; z-index: -1;
  background:
    radial-gradient(44% 56% at 70% 52%, rgba(255,178,36,.38), transparent 72%),
    radial-gradient(26% 30% at 100% 0%, rgba(255,110,50,.55), transparent 70%),
    linear-gradient(118deg, transparent 52%, rgba(255,150,60,.10) 62%, transparent 74%),
    radial-gradient(36% 40% at 0% 100%, rgba(70,150,170,.22), transparent 72%); }
.signin-stage::after { content: ""; position: absolute; inset: -40px; z-index: 3; background: var(--grain); opacity: .16; mix-blend-mode: overlay; }
.crop { position: absolute; z-index: 2; width: 18px; height: 18px; border: 0 solid rgba(255,255,255,.32); }
.crop.tl { top: 20px; left: 20px; border-top-width: 1.5px; border-left-width: 1.5px; }
.crop.tr { top: 20px; right: 20px; border-top-width: 1.5px; border-right-width: 1.5px; }
.crop.bl { bottom: 20px; left: 20px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.crop.br { bottom: 20px; right: 20px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

.stage-phone { --ph: min(84cqh, 660px, (62cqw - 14px) * 16 / 9); position: absolute; z-index: 1; top: 50%; right: clamp(28px, 8cqw, 120px); width: calc(var(--ph) * 9 / 16 + 14px); padding: 7px; border-radius: calc(var(--ph) * .075); background: #0B0C0F; translate: 0 -50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 0 0 1px #2A2E37, 0 50px 90px -30px rgba(0,0,0,.9), 0 0 140px -10px rgba(255,178,36,.28); }
.stage-phone .screen { position: relative; overflow: hidden; aspect-ratio: 9 / 16; border-radius: calc(var(--ph) * .062); background: #000; isolation: isolate; }
.stage-phone .screen::before { content: ""; position: absolute; z-index: 2; top: 2.2%; left: 50%; width: 30%; height: 3%; border-radius: 99px; background: #0B0C0F; translate: -50% 0; }
/* The scan runs in step with si-reveal on the video, so it reads as the frame being rendered. */
.stage-phone .screen::after { content: ""; position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 2px; background: var(--amber); box-shadow: 0 0 18px 4px rgba(255,178,36,.7); opacity: 0; }
.stage-phone video, .stage-phone img { display: block; width: 100%; height: 100%; object-fit: cover; }

.stage-call { position: absolute; z-index: 2; left: clamp(28px, 6cqw, 80px); bottom: clamp(28px, 10cqh, 110px); width: min(360px, 58cqw); border-radius: 16px; background: rgba(18,20,24,.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); font-family: var(--mono); font-feature-settings: normal;
  box-shadow: 0 0 0 1px #2A2E37, inset 0 1px 0 rgba(255,255,255,.06), 0 40px 70px -24px rgba(0,0,0,.85); }
.stage-call .hd { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #2A2E37; font-size: 14px; font-weight: 500; }
.stage-call .verb { padding: 1px 7px; border-radius: 5px; background: var(--amber); color: var(--ink); font-size: .84em; font-weight: 600; letter-spacing: .03em; }
.stage-call .body { display: block; padding: 14px 18px 16px; font-size: 13.5px; font-weight: 500; line-height: 1.7; color: #838A97; }
.stage-call .l { display: block; padding-left: calc(var(--i, 0) * 2ch + 2ch); text-indent: -2ch; white-space: nowrap; }
.stage-call .i1 { --i: 1; } .stage-call .i2 { --i: 2; }
.stage-call .k { color: #A1A8B5; } .stage-call .s { color: #ECEEF2; } .stage-call .v { color: #FFC35A; }
.stage-call .hl { border-radius: 4px; }
.stage-call .th { width: 26px; height: 36px; margin: -10px 0 -8px 12px; object-fit: cover; border-radius: 5px; vertical-align: middle; box-shadow: 0 0 0 2px var(--amber); text-indent: 0; }

@media (prefers-reduced-motion: no-preference) {
  .signin-panel .brand { animation: si-rise .7s var(--ease) both; }
  .signin-main > * { animation: si-rise .8s var(--ease) both; }
  .signin-main > :nth-child(1) { animation-delay: .05s; }
  .signin-main > :nth-child(2) { animation-delay: .12s; }
  .signin-main > :nth-child(3) { animation-delay: .22s; }
  .signin-main > :nth-child(4) { animation-delay: .32s; }
  .signin-main > :nth-child(n+5) { animation-delay: .42s; }
  .signin-title .w1, .signin-title .w2, .signin-title .w3 { animation: si-word .36s ease-out both; }
  .signin-title .w1 { animation-delay: .55s; }
  .signin-title .w2 { animation-delay: .82s; }
  .signin-title .w3 { animation-delay: 1.09s; }
  .signin-title .w4 { animation: si-land .62s var(--ease) 1.36s both; }
  .signin-free-dot::after { animation: si-ping 2.8s ease-out 1.8s infinite; }
  .signin-google::after { animation: si-shine 1.1s var(--ease) 2s 1 both; }
  .signin-google:hover::after { animation: none; }

  .signin-stage { animation: si-fade 1s ease-out .1s both; }
  .signin-stage::before { animation: si-drift 16s ease-in-out infinite alternate; }
  .signin-stage::after { animation: si-grain .9s steps(1) infinite; }
  .stage-phone { animation: si-phone 1.1s var(--ease) .35s both; }
  .stage-phone video { animation: si-reveal 1.1s cubic-bezier(.6,0,.3,1) 1.15s both; }
  .stage-phone .screen::after { animation: si-scan 1.1s cubic-bezier(.6,0,.3,1) 1.15s both; }
  .stage-call { animation: si-card .9s var(--ease) .55s both, si-float 7s ease-in-out 1.6s infinite alternate; }
  .stage-call .l { animation: si-type .35s ease-out both; animation-delay: calc(.8s + var(--n) * .07s); }
  .stage-call .hl { animation: si-flash 1.2s ease-out 1.4s both; }
}
@keyframes si-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes si-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes si-word { 0% { background: transparent; } 20%, 75% { background: var(--amber); color: var(--ink); } 100% { background: transparent; } }
@keyframes si-land {
  0% { background: transparent; color: inherit; box-shadow: none; transform: none; }
  45% { background: var(--amber); color: var(--ink); transform: scale(1.08) rotate(-3deg); }
  100% { background: var(--amber); color: var(--ink); box-shadow: 0 .06em 0 rgba(143,84,0,.35); transform: rotate(-1.5deg); }
}
@keyframes si-ping { 0% { opacity: .9; transform: scale(.6); } 70%, 100% { opacity: 0; transform: scale(1.6); } }
@keyframes si-shine { from { transform: translateX(-110%); } to { transform: translateX(110%); } }
@keyframes si-drift { from { transform: translate3d(-2%, 1%, 0) scale(1); } to { transform: translate3d(3%, -2%, 0) scale(1.06); } }
@keyframes si-grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-14px, 9px); } 50% { transform: translate(11px, -16px); } 75% { transform: translate(-7px, -5px); } }
@keyframes si-phone { from { opacity: 0; transform: translateY(40px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes si-reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes si-scan { 0% { opacity: 1; top: 0; } 99.9% { opacity: 1; top: calc(100% - 2px); } 100% { opacity: 0; top: calc(100% - 2px); } }
@keyframes si-card { from { opacity: 0; transform: translate(-24px, 18px); } to { opacity: 1; transform: none; } }
@keyframes si-float { from { transform: none; } to { transform: translateY(-8px); } }
@keyframes si-type { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes si-flash { 0% { background: transparent; } 25% { background: rgba(255,178,36,.28); } 100% { background: transparent; } }

/* Phones: the viewer becomes a short strip under the panel, so the Google button stays on the first screen. */
@media (max-width: 760px) {
  .signin-page { flex-direction: column; height: auto; min-height: calc(100dvh - var(--stamp)); padding: 12px; gap: 8px; }
  .signin-panel { flex: none; padding: 0 8px; }
  .signin-main { padding: 18px 0 16px; max-width: none; }
  .signin-page .signin-title { margin-top: 20px; font-size: clamp(38px, 11vw, 48px); }
  .signin-why { margin-top: 14px; font-size: 16px; }
  .signin-google { margin-top: 24px; }
  .signin-stage { flex: 1 0 300px; max-height: 420px; border-radius: 20px; }
  .stage-phone { --ph: 86cqh; right: 7cqw; }
  .stage-call { left: 16px; bottom: 22px; width: min(300px, 64cqw); border-radius: 12px; }
  .stage-call .hd { padding: 8px 12px; font-size: 11.5px; }
  .stage-call .body { padding: 8px 12px 10px; font-size: 10.5px; line-height: 1.6; }
  .stage-call .th { width: 18px; height: 25px; margin: -6px 0 -6px 8px; }
  .crop { display: none; }
}

/* Billing: the plan sits on a program-monitor surface, dark in both themes like the sign-in viewer. */
.billing { --mon: #0C0D10; --mon-line: rgba(255,255,255,.08); }
@media (prefers-color-scheme: light) { .billing { --mon: #111216; } }
.bill-meter { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 18px; padding: 30px 34px 30px; border-radius: 22px; color: #ECEEF2;
  background: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.5px) 0 0 / 22px 22px, var(--mon);
  box-shadow: inset 0 0 0 1px var(--mon-line), 0 30px 70px -40px rgba(0,0,0,.7); }
.bill-meter::before { content: ""; position: absolute; inset: -30%; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 55% at 92% 8%, rgba(255,178,36,.30), transparent 70%), radial-gradient(34% 50% at 0% 100%, rgba(70,150,170,.20), transparent 72%); }
.bill-meter::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--grain); opacity: .12; mix-blend-mode: overlay; }
.bill-meter .crop { border-color: rgba(255,255,255,.26); }
.bill-meter-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.bill-plan { display: flex; flex-direction: column; gap: 10px; }
.bill-kicker { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: #8B93A1; }
.bill-plan-name { align-self: flex-start; padding: 0 .14em .04em; border-radius: .12em; background: var(--amber); color: var(--ink); font-size: clamp(44px, 5vw, 64px); font-weight: 700; line-height: 1; letter-spacing: -0.045em;
  box-shadow: 0 .06em 0 rgba(143,84,0,.4), 0 18px 44px -18px rgba(255,178,36,.7); transform: rotate(-1.5deg); }
.bill-meter .btn.bill-manage { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: #ECEEF2; box-shadow: inset 0 1px 0 rgba(255,255,255,.07); }
.bill-meter .btn.bill-manage:hover { background: rgba(255,255,255,.11); border-color: rgba(255,178,36,.6); color: #fff; }
.bill-status, .bill-confirm { margin: 0; font-size: 15px; line-height: 1.5; color: #C3C8D1; }
.bill-status.bad { color: #FF8F8F; }
.bill-confirm { display: inline-flex; align-items: center; gap: 11px; align-self: flex-start; padding: 7px 14px 7px 12px; border-radius: 99px; background: rgba(255,178,36,.12); box-shadow: inset 0 0 0 1px rgba(255,178,36,.35); color: #FFD58A; font-weight: 600; }
.bill-confirm-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px rgba(255,178,36,.9); }
.bill-confirm-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--amber); opacity: 0; }
.bill-usage { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.bill-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 12px; background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.bill-stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 12px 16px 13px; }
.bill-stat + .bill-stat { box-shadow: inset 1px 0 0 rgba(255,255,255,.08); }
.bill-num { font-family: var(--mono); font-size: 26px; font-weight: 600; line-height: 1.15; letter-spacing: -0.03em; color: #ECEEF2; font-variant-numeric: tabular-nums; }
.bill-left .bill-num { color: #FFC24F; text-shadow: 0 0 18px rgba(255,178,36,.35); }
.bill-unit { font-size: 12.5px; color: #A1A8B5; }
.bill-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bill-meter .btn.bill-manage.quiet { background: transparent; border-color: rgba(255,255,255,.12); color: #C3C8D1; box-shadow: none; }
/* A timeline lane: minute ticks, the used span in amber and a playhead at its end. */
.bill-track { position: relative; height: 34px; border-radius: 8px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.10) 0 1px, transparent 1px 10%) 0 0 / 100% 7px no-repeat, #17191E;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), inset 0 2px 6px rgba(0,0,0,.4); }
.bill-fill { position: absolute; left: 0; top: 9px; bottom: 9px; min-width: 3px; border-radius: 4px; background: linear-gradient(180deg, #FFC24F, #F7A714); box-shadow: 0 0 16px -2px rgba(255,178,36,.7); }
.bill-fill::after { content: ""; position: absolute; right: -1px; top: -9px; bottom: -9px; width: 2px; border-radius: 2px; background: #FFF3DA; box-shadow: 0 0 10px rgba(255,178,36,.9); }

.bill-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bill-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 22px 20px 20px; border-radius: 18px; background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--hair), var(--shadow);
  transition: transform .3s var(--ease), border-color .2s, box-shadow .3s; }
.bill-card:hover { border-color: color-mix(in srgb, var(--amber) 40%, var(--line)); }
.bill-card.current { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,178,36,.16), inset 0 1px 0 var(--hair), 0 26px 60px -32px rgba(255,178,36,.55); }
.bill-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; }
.bill-card-name { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.bill-badge { font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--amber); color: var(--ink); }
.bill-price { margin: 4px 0 0; display: flex; align-items: baseline; }
.bill-amount { font-size: 46px; font-weight: 700; line-height: 1; letter-spacing: -0.05em; }
.bill-per { font-size: 14px; color: var(--muted); }
.bill-mins { margin: 0; font-size: 14px; color: var(--muted); }
.bill-mins b { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--text); }
/* The plan's minutes as a share of the largest plan, drawn as clips on a lane. */
.bill-scale { position: relative; height: 12px; border-radius: 4px; background: var(--lane); box-shadow: inset 0 0 0 1px var(--soft-line); overflow: hidden; }
.bill-scale::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: calc(var(--share) * 100%); min-width: 6px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 22px, transparent 22px 25px); opacity: .9; }
.bill-choose { margin-top: auto; width: 100%; }
.bill-fine { margin: 0; text-align: center; font-size: 12.5px; color: var(--muted); }

@media (max-width: 760px) {
  .bill-plans { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .bill-meter { padding: 22px 20px; border-radius: 18px; gap: 14px; }
  .bill-actions { width: 100%; }
  .bill-actions .btn.bill-manage { flex: 1 1 160px; width: auto; }
  .bill-stat { padding: 10px 12px 11px; }
  .bill-num { font-size: 21px; }
  .bill-unit { font-size: 11.5px; }
  .bill-meter .btn.bill-manage { width: 100%; }
  .bill-amount { font-size: 40px; }
}
@media (prefers-reduced-motion: no-preference) {
  .billing-body > * { animation: si-rise .7s var(--ease) both; }
  .billing-body > :nth-child(2) { animation-delay: .08s; }
  .billing-body > :nth-child(3) { animation-delay: .16s; }
  .billing-body > :nth-child(n+4) { animation-delay: .24s; }
  .bill-plan-name { animation: si-land .62s var(--ease) .2s both; }
  .bill-fill { animation: bill-grow 1s var(--ease) .3s both; }
  .bill-confirm-dot::after { animation: si-ping 1.8s ease-out infinite; }
  .bill-card:hover { transform: translateY(-2px); }
}
@keyframes bill-grow { from { clip-path: inset(-20px 100% -20px 0); } to { clip-path: inset(-20px 0 -20px 0); } }
.bill-per { margin-left: 6px; }

/* Plan and minutes chips: readouts in the bar, mono like the timecodes. */
.account a.plan-chip, .account a.minutes-chip { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 11px; border-radius: 99px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; white-space: nowrap; text-decoration: none; transition: color .2s, background-color .2s, box-shadow .2s; }
.account a.plan-chip { padding-left: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-text);
  background: color-mix(in srgb, var(--amber) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 36%, var(--line)); }
.account a.plan-chip::before { content: ""; width: 6px; height: 6px; border-radius: 1.5px; background: var(--amber); box-shadow: 0 0 8px rgba(255,178,36,.7); }
.account a.plan-chip:hover { color: var(--amber-text); background: color-mix(in srgb, var(--amber) 17%, transparent); }
.account a.minutes-chip { --chip: var(--green); overflow: hidden; padding-bottom: 2px; color: var(--text); font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--panel2) 70%, transparent); box-shadow: inset 0 0 0 1px var(--soft-line); }
.account a.minutes-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--chip); box-shadow: 0 0 8px var(--chip); }
/* A hairline gauge of the minutes left along the chip's foot. */
.account a.minutes-chip::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--chip) calc(var(--left, 0) * 100%), color-mix(in srgb, var(--muted) 22%, transparent) 0); opacity: .8; }
.account a.minutes-chip:hover { color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chip) 55%, var(--soft-line)); }
.account a.minutes-chip.low { --chip: var(--amber); color: var(--amber-text); background: color-mix(in srgb, var(--amber) 10%, transparent); }
.account a.minutes-chip.out { --chip: var(--red); color: var(--red); background: color-mix(in srgb, var(--red) 11%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 40%, var(--line)); }
.account a.minutes-chip.low:hover { color: var(--amber-text); }
.account a.minutes-chip.out:hover { color: var(--red); }
@media (max-width: 860px) {
  .account { margin-left: 0; width: 100%; justify-content: flex-start; }
  .account .who { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 40vw; }
}
@media (max-width: 560px) {
  .topbar-row { column-gap: 12px; }
  .nav a { padding: 0 9px; font-size: 13.5px; }
  .nav a.on::after { left: 9px; right: 9px; }
}

/* Boot shell: the bar and a quiet skeleton of a page while the session starts. */
.account-wait { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sk { display: block; border-radius: 8px; --sk: color-mix(in srgb, var(--muted) 13%, transparent); --sk-hi: color-mix(in srgb, var(--muted) 24%, transparent); background: var(--sk); }
.sk-chip { width: 72px; height: 30px; border-radius: 99px; }
.sk-chip.wide { width: 108px; }
.boot-skeleton { display: flex; flex-direction: column; gap: 28px; }
.sk-head { display: flex; flex-direction: column; gap: 12px; }
.sk-head .sk-kicker { width: 28px; height: 3px; border-radius: 2px; background: var(--amber); box-shadow: 0 0 14px rgba(255,178,36,.6); opacity: .8; }
.sk-title { width: min(360px, 72%); height: 40px; border-radius: 10px; }
.sk-line { width: min(540px, 92%); height: 13px; }
.sk-line.short { width: 46%; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.sk-card { display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 18px; border-radius: 18px; border: 1px solid var(--soft-line); background: color-mix(in srgb, var(--panel) 55%, transparent); }
.sk-media { height: 214px; border-radius: 11px; }
.sk-card .sk-line { width: 64%; height: 15px; }
.sk-card .sk-line.short { width: 40%; height: 11px; }
.boot-error { display: flex; flex-direction: column; align-items: center; gap: 12px; }
@media (max-width: 860px) { .sk-media { height: 170px; } .sk-grid { grid-template-columns: minmax(0, 1fr); } .sk-card:nth-child(n+2) { display: none; } }
/* One fixed gradient sweeps every block at once, so the skeleton shimmers as one surface. */
@media (prefers-reduced-motion: no-preference) {
  .sk:not(.sk-kicker) { background: linear-gradient(100deg, var(--sk) 40%, var(--sk-hi) 50%, var(--sk) 60%) 0 0 / 300% 100% fixed; animation: sk-sweep 1.9s ease-in-out infinite; }
}
@keyframes sk-sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* This month's renders: a daily strip in amber over a ledger of what used the minutes. */
.usage { display: flex; flex-direction: column; gap: 18px; padding: 24px 26px 18px; border-radius: 20px; background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--hair), var(--shadow); }
.usage-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; }
.usage-title { display: flex; flex-direction: column; gap: 8px; }
.usage h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.025em; }
.usage-count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.usage-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 104px auto; gap: 6px 10px; }
.usage-scale { display: flex; flex-direction: column; justify-content: space-between; padding: 0 0 1px; font-family: var(--mono); font-size: 10.5px; line-height: 1; color: var(--muted); text-align: right; }
.usage-bars { display: flex; align-items: flex-end; gap: 3px; height: 104px; padding: 0 1px; border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0 25px, var(--soft-line) 25px 26px); }
.usage-bar { position: relative; flex: 1 1 0; min-width: 0; height: 100%; }
.usage-bar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 26%, transparent); }
.usage-bar.on::before { height: max(4px, calc(var(--h) * 100%)); border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, #FFC24F, #F7A714); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 0 14px -4px rgba(255,178,36,.75); transform-origin: bottom; }
.usage-bar.on:hover::before { filter: brightness(1.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 18px -2px rgba(255,178,36,.9); }
.usage-axis { grid-column: 2; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.usage-list { display: flex; flex-direction: column; }
.usage-cols, .usage-row { display: grid; grid-template-columns: 12.5rem minmax(0, 1fr) 6rem 6.5rem; align-items: center; gap: 16px; padding: 0 10px; }
.usage-cols { min-height: 32px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.usage-cols .num, .usage-length, .usage-charged { text-align: right; }
.usage-row { min-height: 46px; border-top: 1px solid var(--soft-line); color: var(--text); font-size: 14px; text-decoration: none; transition: background-color .2s; }
.usage-row:hover { color: var(--text); background: color-mix(in srgb, var(--amber) 7%, transparent); }
.usage-row:hover .usage-template { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--amber) 70%, transparent); text-underline-offset: 3px; }
.usage-when, .usage-length { font-family: var(--mono); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.usage-template { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.usage-template.gone { font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--muted); }
.usage-charged { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--amber-text); font-variant-numeric: tabular-nums; }
.usage-fine { margin: 0; padding: 0 10px; font-size: 12.5px; color: var(--muted); }
.usage-list + .usage-fine { padding-top: 12px; border-top: 1px solid var(--soft-line); }
.usage-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: 14px; border: 1px dashed var(--line);
  background: radial-gradient(var(--dots) 1px, transparent 1.5px) 0 0 / 18px 18px; }
.usage-empty p { margin: 0; color: var(--muted); font-size: 14.5px; }
@media (max-width: 600px) {
  .usage { padding: 18px 16px 14px; border-radius: 18px; gap: 16px; }
  .usage-bars { gap: 2px; }
  .usage-cols { display: none; }
  .usage-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tpl charged" "when length"; gap: 3px 12px; padding: 10px 4px; }
  .usage-template { grid-area: tpl; }
  .usage-charged { grid-area: charged; }
  .usage-when { grid-area: when; font-size: 11.5px; }
  .usage-length { grid-area: length; font-size: 11.5px; }
  .usage-fine { padding: 0 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  .usage-bar.on::before { animation: usage-rise .8s var(--ease) .35s both; }
}
@keyframes usage-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Editor bar: the logo opens the site menu, then the breadcrumb, the chips and every action on one 48 px row. */
.ed-bar { position: relative; z-index: 5; flex: none; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 10px 0 6px; min-width: 0; background: #121418; border-bottom: 1px solid var(--line); }
.ed-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none; background: linear-gradient(90deg, transparent 1%, rgba(255,178,36,.6) 10%, rgba(255,178,36,.1) 30%, transparent 55%); }
.site { position: relative; flex: none; }
.menu-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 5px; border-radius: 9px; border: 1px solid transparent; background: transparent; font-weight: 700; font-size: 15.5px; letter-spacing: -0.03em; color: var(--text); transition: background-color .2s, border-color .2s; }
.menu-btn:hover, .menu-btn.open { background: var(--panel2); border-color: var(--soft-line); }
.menu-btn .brand-mark { flex: none; border-radius: 7px; box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 0 rgba(143,84,0,.25), 0 6px 16px -6px rgba(255,178,36,.75); }
.menu-btn .chev { color: var(--muted); margin-left: -2px; transition: transform .2s var(--ease); }
.menu-btn.open .chev { transform: rotate(180deg); }
.vsep { flex: none; width: 1px; height: 22px; background: var(--line); }
.ed-bar .crumbs { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; gap: 9px; white-space: nowrap; font-size: 13px; }
.ed-bar .crumbs a { flex: none; min-height: 36px; }
.ed-bar .crumbs strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.ed-bar .pill { flex: none; padding: 2px 8px; font-size: 11.5px; }
.ed-bar .unsaved { flex: none; }
.ed-bar .account { flex: none; width: auto; margin-left: 0; flex-wrap: nowrap; gap: 6px; }
.ed-bar .account a.plan-chip, .ed-bar .account a.minutes-chip { min-height: 26px; font-size: 11px; padding-right: 10px; }
.ed-bar .actions { flex: none; flex-wrap: nowrap; align-items: center; gap: 6px; }
.ed-bar .btn { min-height: 32px; height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; white-space: nowrap; }
.ed-bar .btn.ic { width: 32px; padding: 0; background: transparent; border-color: transparent; box-shadow: none; }
.ed-bar .btn.ic:hover:not(:disabled) { background: var(--panel2); border-color: var(--soft-line); }
.ed-bar .btn.ic:disabled { opacity: .42; }
.ed-bar .btn.ic svg { pointer-events: none; }

.site-menu { position: absolute; z-index: 20; left: 0; top: calc(100% + 8px); width: 240px; padding: 6px; border-radius: 12px; display: flex; flex-direction: column; gap: 1px;
  background: #17191E; box-shadow: 0 0 0 1px #2A2E37, 0 24px 50px -16px rgba(0,0,0,.9); }
.site-menu .sm-head { margin-bottom: 4px; padding: 8px 10px 9px; border-bottom: 1px solid var(--soft-line); font-size: 12px; color: var(--muted); }
.site-menu a { display: flex; align-items: center; min-height: 36px; padding: 0 10px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: background-color .15s, color .15s; }
.site-menu a:hover, .site-menu a:focus-visible { background: var(--panel2); color: var(--text); }
.site-menu a.on { background: var(--panel2); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--amber); }
.site-menu .sm-acct { margin-top: 4px; padding: 8px 4px 2px 10px; border-top: 1px solid var(--soft-line); display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; font-size: 12px; }
.site-menu .sm-acct span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.site-menu .btn.small { min-height: 30px; }
@media (prefers-reduced-motion: no-preference) { .site-menu { animation: ed-pop .18s var(--ease) both; } }

/* The transport under the frame: frame step either side of play, then the timecode and the format tags. */
.stage .transport { flex: none; gap: 6px 8px; min-height: 40px; padding: 3px 12px 3px 5px; border-radius: 13px; font-size: 12.5px; }
.stage .transport .tag-soft { font-size: 11.5px; padding: 3px 7px; }
.transport .round-btn { width: 34px; height: 34px; }
.t-btn { width: 30px; height: 30px; border-radius: 8px; border: none; background: transparent; color: #C9CED6; display: flex; align-items: center; justify-content: center; transition: background-color .15s; }
.t-btn:hover { background: rgba(255,255,255,.07); }
.t-btn svg { pointer-events: none; }
.t-sep { width: 1px; height: 18px; background: var(--line); }
.transport .clock { white-space: nowrap; }

.split { grid-area: split; position: relative; background: #0E0F12; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: row-resize; touch-action: none; }
.split::before { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 3px; transform: translate(-50%, -50%); border-radius: 2px; background: #4A505C; box-shadow: 0 0 0 3px #0E0F12; transition: background-color .15s; }
.split::after { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; }
.split:hover::before, .split.drag::before, .split:focus-visible::before { background: var(--amber); box-shadow: 0 0 10px rgba(255,178,36,.7); }
.split:focus-visible { outline: none; }
.timeline > * { flex: none; }

.ed-tabs { display: none; }
.ed-tab { flex: 1 1 0; position: relative; border: none; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.ed-tab.on { color: var(--text); }
.ed-tab.on::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--amber); box-shadow: 0 0 10px rgba(255,178,36,.8); }

/* Compact controls in the side panels: the workspace trades the 44 px page targets for room. */
.editor-body .control { min-height: 34px; border-radius: 7px; padding: 0 10px; }
.editor-body .test-row input { min-height: 30px; padding: 0 8px; border-radius: 6px; }
.editor-body .var-card { padding: 8px 9px; gap: 6px; }
.editor-body .btn { min-height: 34px; }
.editor-body .btn.small { min-height: 30px; }
.editor-body .help { padding: 10px 11px 10px 13px; font-size: 12.5px; }
.editor-body .asset-btn img, .editor-body .asset-btn video, .editor-body .asset-btn .ph { height: 64px; }

@media (max-width: 899.98px) {
  .ed-bar { flex-wrap: wrap; height: auto; gap: 0 8px; }
  .ed-bar .site, .ed-bar .crumbs, .ed-bar .account { height: 48px; display: flex; align-items: center; }
  .ed-bar .crumbs { flex: 1 1 0; }
  .ed-bar .crumbs strong { min-width: 3ch; }
  .menu-btn > span:not(.brand-mark) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ed-bar .vsep.end { display: none; }
  .ed-bar .actions { order: 3; flex: 1 0 100%; height: 44px; margin: 0 -10px 0 -6px; padding: 0 10px; border-top: 1px solid var(--soft-line); }
  .ed-bar .actions .btn:not(.ic) { flex: 1 1 auto; min-width: 0; padding: 0 8px; }
  .editor-body { display: flex; flex-direction: column; }
  .stage { order: 1; flex: none; height: 52vh; height: 52dvh; padding: 8px 8px 6px; }
  .split { display: none; }
  .ed-tabs { order: 2; flex: none; display: flex; height: 42px; background: #121418; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .side, .timeline { order: 3; flex: 1 1 0; min-height: 0; border: none; }
  .editor-body:not(.tab-variables) > .side.left, .editor-body:not(.tab-clip) > .side.right, .editor-body:not(.tab-timeline) > .timeline { display: none; }
  .timeline { padding: 8px 12px 12px; }
  .tl-label, .tl-hint { flex-basis: 48px; }
  .tl-label { padding-left: 7px; }
  .lanes { --lab: 58px; }
}
