/* Dalo Content Studio. Brand: black, white, Dodger Blue. Neue Montreal.
   Quiet amber for warnings and quiet red for flags and errors only. */

@font-face { font-family: "Neue Montreal"; src: url("fonts/NeueMontreal-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Montreal"; src: url("fonts/NeueMontreal-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Montreal"; src: url("fonts/NeueMontreal-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Montreal Fallback"; src: local("Helvetica Neue"), local("Arial"); size-adjust: 98%; ascent-override: 92%; descent-override: 22%; line-gap-override: 0%; }

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-2: #161616;
  --well: #000000;
  --ink: #ffffff;
  --ink-muted: rgba(255, 255, 255, 0.72);
  --ink-subtle: rgba(255, 255, 255, 0.50);
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.14);
  --blue: #1E90FF;
  --blue-soft: rgba(30, 144, 255, 0.14);
  --blue-line: rgba(30, 144, 255, 0.45);
  --warn: #E9B44C;
  --warn-soft: rgba(233, 180, 76, 0.10);
  --warn-line: rgba(233, 180, 76, 0.40);
  --bad: #FF8A9A;
  --bad-soft: rgba(255, 138, 154, 0.10);
  --bad-line: rgba(255, 138, 154, 0.40);
  --ok: #3DD68C;

  --font: "Neue Montreal", "Neue Montreal Fallback", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-xs: 6px; --r-sm: 8px; --r-md: 16px; --r-lg: 24px; --r-pill: 9999px;
  --fast: 150ms; --base: 250ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: 20px;
  --max: 1200px;
}
@media (min-width: 768px) { :root { --gutter: 40px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-muted);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (min-width: 768px) { body { font-size: 1.0625rem; } }

h1, h2, h3, h4 { color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.875rem, 1.4rem + 1.6vw, 2.75rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 1.25rem + 0.9vw, 2rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
h4 { font-size: 1.0625rem; font-weight: 500; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--ink); text-decoration-color: var(--blue); text-underline-offset: 4px; }
a:hover { color: var(--blue); }
img { max-width: 100%; display: block; }
strong { color: var(--ink); font-weight: 500; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: #0a0a0a; padding: 10px 16px; border-radius: var(--r-pill); text-decoration: none; font-weight: 500; }
.skip:focus { top: 12px; }
.muted { color: var(--ink-subtle); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }
.bad-text { color: var(--bad); }
.noscript { padding: 24px; color: var(--ink); }

.icon { display: inline-flex; width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.icon svg { width: 100%; height: 100%; }
.icon-blue { color: var(--blue); }

/* ---------- Top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(10, 10, 10, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--hairline); }
.top-in { max-width: var(--max); margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.wordmark { width: 88px; height: auto; }
.brand-sub { font-size: 0.875rem; color: var(--ink-subtle); padding-left: 12px; border-left: 1px solid var(--hairline-strong); white-space: nowrap; }
.mock-tag { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--warn); border: 1px solid var(--warn-line); border-radius: var(--r-pill); padding: 3px 10px; white-space: nowrap; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.who { color: var(--ink); font-weight: 500; font-size: 0.9375rem; }
.linkish { white-space: nowrap; background: none; border: 0; padding: 6px 2px; font: inherit; font-size: 0.9375rem; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: transparent; }
.linkish:hover { text-decoration-color: var(--blue); }

.health-wrap { position: relative; }
.health-btn { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); color: var(--ink-muted); font: inherit; font-size: 0.875rem; padding: 6px 12px; cursor: pointer; min-height: 36px; transition: border-color var(--fast) var(--ease); }
.health-btn:hover { border-color: var(--blue); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; background: var(--ink-subtle); }
.dot-ok { background: var(--ok); }
.dot-bad { background: var(--bad); }
.dot-wait { background: var(--ink-subtle); }
.health-panel { position: absolute; right: 0; top: calc(100% + 10px); width: 340px; max-width: calc(100vw - 2 * var(--gutter)); background: var(--surface); border: 1px solid var(--hairline-strong); border-radius: var(--r-md); padding: 18px; z-index: 30; display: grid; gap: 12px; }
.health-panel[hidden] { display: none; }
.panel-title { font-size: 1.0625rem; font-weight: 500; letter-spacing: 0; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check { display: grid; grid-template-columns: 10px 1fr; gap: 10px; align-items: start; }
.check .dot { margin-top: 7px; }
.check-name { color: var(--ink); font-size: 0.9375rem; }
.check-detail { font-size: 0.875rem; }
.check-at { font-size: 0.8125rem; color: var(--ink-subtle); }

@media (max-width: 560px) {
  .brand-sub { display: none; }
  .health-word { display: none; }
  .health-btn { padding: 6px 10px; }
  .top-in { gap: 10px; }
  .top-right { gap: 12px; }
  .who { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wordmark { width: 72px; }
  .mock-tag { font-size: 0.6875rem; padding: 2px 8px; }
}

/* ---------- Page ---------- */
.main { max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) 96px; display: grid; gap: 24px; min-width: 0; }
.main > * { min-width: 0; }
.main-narrow { max-width: 520px; padding-top: 64px; }
.boot { padding: 64px var(--gutter); }
.boot-line, .loading { color: var(--ink-subtle); }
.lede { color: var(--ink-muted); max-width: 64ch; }
.eyebrow { font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }
.eyebrow a.crumb { color: var(--blue); text-decoration: none; }
.eyebrow a.crumb:hover { text-decoration: underline; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head .lede { margin-top: 8px; }
.project-head { display: grid; gap: 4px; }
.screen-head { display: grid; gap: 8px; padding-top: 8px; }

.panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 24px; display: grid; gap: 16px; min-width: 0; }
@media (max-width: 560px) { .panel { padding: 18px; } }

.auth { display: grid; gap: 16px; }
.auth .form { margin-top: 8px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--r-pill); font: inherit; font-size: 1rem; font-weight: 500; line-height: 1; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: box-shadow var(--fast) var(--ease), border-color var(--fast) var(--ease), background var(--fast) var(--ease), transform var(--fast) var(--ease); white-space: nowrap; }
.btn .icon { width: 18px; height: 18px; vertical-align: 0; }
.btn-primary { background: var(--ink); color: #0a0a0a; }
.btn-primary:hover { color: #0a0a0a; box-shadow: 0 0 0 2px var(--blue-line); }
.btn-secondary { background: transparent; color: var(--blue); border-color: var(--blue-line); }
.btn-secondary:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--hairline-strong); }
.btn-quiet:hover { border-color: var(--blue); color: var(--ink); }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 0.9375rem; }
.btn-big { min-height: 60px; padding: 0 44px; font-size: 1.125rem; }
.btn-wide { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: var(--r-pill); }
.icon-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--hairline-strong); background: transparent; color: var(--ink-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.icon-btn:hover { border-color: var(--blue); color: var(--blue); }
.icon-btn:focus-visible { border-radius: 50%; }
.icon-btn .icon { width: 18px; height: 18px; vertical-align: 0; }
.link { color: var(--ink); }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 20px; }
.form-wide { max-width: 720px; }
.field { display: grid; gap: 6px; }
label { color: var(--ink); font-weight: 500; }
.hint { font-size: 0.9375rem; color: var(--ink-subtle); }
input[type="text"], input[type="email"], input[type="password"], textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--well); border: 1px solid var(--hairline-strong); border-radius: var(--r-xs); padding: 12px 14px; min-height: 48px; transition: border-color var(--fast) var(--ease);
}
textarea { resize: vertical; line-height: 1.5; }
input:hover, textarea:hover { border-color: rgba(255, 255, 255, 0.24); }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); border-radius: var(--r-xs); }
::placeholder { color: rgba(255, 255, 255, 0.34); }
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--blue); cursor: pointer; margin: 0; }
input[type="checkbox"]:disabled { cursor: not-allowed; opacity: 0.35; }

.msg { font-size: 0.9375rem; }
.msg[hidden] { display: none; }
.msg-error { color: var(--bad); }

/* ---------- Notes and empty states ---------- */
.note { border: 1px solid var(--hairline-strong); border-radius: var(--r-md); padding: 16px 18px; display: grid; gap: 6px; background: var(--surface); }
.note-title { color: var(--ink); font-weight: 500; }
.note-info { border-color: var(--blue-line); background: var(--blue-soft); }
.note-warn { border-color: var(--warn-line); background: var(--warn-soft); }
.note-warn .note-title { color: var(--warn); }
.note-bad { border-color: var(--bad-line); background: var(--bad-soft); color: var(--ink); }
.note .bar { margin: 6px 0 2px; }
.empty { border: 1px dashed var(--hairline-strong); border-radius: var(--r-md); padding: 32px 24px; display: grid; gap: 10px; justify-items: start; }
.empty p { max-width: 60ch; }
.empty-line { color: var(--ink-subtle); }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 500; line-height: 1; padding: 6px 10px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); color: var(--ink-muted); white-space: nowrap; }
.chip-blue { color: var(--blue); border-color: var(--blue-line); }
.chip-grey { color: var(--ink-muted); background: rgba(255, 255, 255, 0.05); }
.chip-bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-soft); }
.chip-warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }

/* ---------- Project cards ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { display: grid; gap: 6px; align-content: start; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 22px; text-decoration: none; color: var(--ink-muted); height: 100%; transition: border-color var(--fast) var(--ease); }
.card-link:hover { border-color: var(--blue); color: var(--ink-muted); }
.card-link:focus-visible { border-radius: var(--r-md); }
.card-title { font-size: 1.375rem; font-weight: 500; letter-spacing: -0.015em; }
.card-meta { color: var(--ink-muted); }
.card-foot { font-size: 0.875rem; color: var(--ink-subtle); }
.card .chip { justify-self: start; margin-top: 6px; }

/* ---------- Step bar ---------- */
.steps-wrap { min-width: 0; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
@media (max-width: 900px) {
  .steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .step-arrow { display: none !important; }
  .steps .step { width: 100%; border-color: var(--hairline); }
  .steps .step-label { overflow: hidden; text-overflow: ellipsis; }
}
@media (min-width: 600px) and (max-width: 900px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.step { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: var(--r-pill); color: var(--ink-muted); text-decoration: none; font-size: 0.9375rem; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
a.step:hover { color: var(--ink); border-color: var(--hairline-strong); }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.875rem; border: 1px solid var(--hairline-strong); color: var(--ink-muted); flex: none; }
.step-n .icon { width: 16px; height: 16px; vertical-align: 0; }
.step.is-done .step-n { color: var(--ink); border-color: var(--ink-subtle); }
.step.is-current { color: var(--blue); border-color: var(--blue-line); background: var(--blue-soft); }
.step.is-current .step-n { border-color: var(--blue); color: var(--blue); }
.step.is-off { opacity: 0.45; }
.step-arrow { color: var(--ink-subtle); display: inline-flex; }
.step-arrow .icon { width: 14px; height: 14px; vertical-align: 0; }

.next { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; border-top: 1px solid var(--hairline); padding-top: 24px; }

/* ---------- Style sheet ---------- */
.summary { font-size: 1.1875rem; line-height: 1.5; color: var(--ink); max-width: 70ch; }
.ref-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ref-head h3 { margin-top: 2px; }
.traits { list-style: none; margin: 0; padding: 0; display: grid; }
.trait { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: start; padding: 14px 0; border-top: 1px solid var(--hairline); }
.trait:first-child { border-top: 0; }
.trait-label { font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-subtle); font-weight: 500; }
.trait-value { color: var(--ink); margin-top: 2px; }
.trait-at { font-size: 0.875rem; color: var(--blue); margin-top: 2px; }
.frame { width: 54px; height: 96px; object-fit: cover; border-radius: var(--r-xs); border: 1px solid var(--hairline-strong); background: var(--well); }
.trait-edit { grid-column: 1 / -1; display: grid; gap: 10px; }
@media (max-width: 560px) {
  .trait { grid-template-columns: 1fr auto; }
  .trait .frame { grid-row: 1; grid-column: 2; }
  .trait .icon-btn { grid-column: 2; }
}
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
.facts dt { color: var(--ink-subtle); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: 8px; } }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.plain a { overflow-wrap: anywhere; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--r-sm); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline-offset: 2px; border-radius: var(--r-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th, .table td { text-align: left; padding: 12px 14px; border-top: 1px solid var(--hairline); vertical-align: top; }
.table thead th { border-top: 0; font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-subtle); background: rgba(255, 255, 255, 0.02); white-space: nowrap; }
.table tfoot th, .table tfoot td { border-top: 1px solid var(--hairline-strong); color: var(--ink); }
.table .num { text-align: right; }
.table td.wide { min-width: 240px; }
.table td a { color: var(--ink); }
.table td a:hover { color: var(--blue); }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.chan { display: grid; gap: 8px; padding-top: 8px; }
.chan + .chan { border-top: 1px solid var(--hairline); padding-top: 20px; margin-top: 8px; }
.chan h4 .muted { font-weight: 400; }
.median { color: var(--ink-muted); }
.ratio { display: inline-block; font-weight: 500; color: var(--ink); }
.ratio-hi { color: var(--blue); }
.ratio-lo { color: var(--ink-subtle); }

.table-moments { min-width: 960px; }
.table-moments td.tick { width: 48px; padding-right: 0; }
.tick-box { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; margin: -9px 0 0 -9px; cursor: pointer; }
.table-moments td.src { min-width: 220px; }
.table-moments td.hookcell { min-width: 200px; color: var(--ink); }
.table-moments td.why { min-width: 240px; }
.table-moments td.flags { min-width: 180px; }
.table-moments td.flags .chip + .chip { margin-left: 6px; }
.table-moments td.flags .small { margin-top: 6px; }
.table-moments tr.is-blocked td.hookcell, .table-moments tr.is-blocked td.why, .table-moments tr.is-blocked td.src { opacity: 0.55; }

.action-bar { position: sticky; bottom: 12px; z-index: 10; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: rgba(17, 17, 17, 0.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--hairline-strong); border-radius: var(--r-md); padding: 12px 12px 12px 20px; }
.bar-text { color: var(--ink); }
@media (max-width: 560px) { .action-bar { padding: 12px; } .action-bar .btn { width: 100%; } }

/* ---------- Progress ---------- */
.bar { height: 6px; background: rgba(255, 255, 255, 0.08); border-radius: var(--r-pill); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--blue); border-radius: var(--r-pill); transition: width var(--base) var(--ease); }

/* ---------- Quote ---------- */
.sum { font-size: 1.0625rem; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.stats > div { border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 14px 16px; }
.stats dt { font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-subtle); }
.stats dd { margin: 4px 0 0; font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }
.approve-box { display: grid; gap: 10px; justify-items: start; padding-top: 8px; border-top: 1px solid var(--hairline); }
.approve-line { color: var(--ink); }
@media (max-width: 560px) { .approve-box .btn-big { width: 100%; } }
.done-box { display: grid; gap: 8px; border: 1px solid var(--blue-line); background: var(--blue-soft); border-radius: var(--r-sm); padding: 14px 16px; color: var(--ink); }
.done-box-warn { border-color: var(--warn-line); background: var(--warn-soft); }
.done-box .icon { width: 18px; height: 18px; }
.quote-note { overflow-wrap: anywhere; }
.older { border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 0 20px; background: var(--surface); }
.older summary { cursor: pointer; padding: 16px 0; color: var(--ink); font-weight: 500; }
.older summary:focus-visible { outline-offset: 2px; }
.older-item { display: grid; gap: 8px; padding: 16px 0; border-top: 1px solid var(--hairline); }

/* ---------- Jobs ---------- */
.jobs { list-style: none; margin: 0; padding: 0; display: grid; }
.job { display: grid; gap: 8px; padding: 16px 0; border-top: 1px solid var(--hairline); }
.job:first-child { border-top: 0; padding-top: 0; }
.job-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.job-stage { color: var(--ink); }
.job-done .bar-fill { background: var(--ink-subtle); }
.job-failed .bar-fill { background: var(--bad); }
.log { list-style: none; margin: 0; padding: 10px 12px; background: var(--well); border-radius: var(--r-xs); font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-muted); display: grid; gap: 2px; overflow-wrap: anywhere; }

/* ---------- Review ---------- */
.count-line { color: var(--ink); }
.clip { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 820px) { .clip { grid-template-columns: 1fr; } .clip-phone { justify-self: center; width: 100%; max-width: 300px; } }
.clip-info { display: grid; gap: 16px; min-width: 0; }
.clip-hook { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); font-weight: 500; }
.caption-box { border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 12px 14px; display: grid; gap: 8px; background: var(--well); }
.caption-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.caption-tools { display: inline-flex; gap: 12px; align-items: center; }
.label { font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-subtle); font-weight: 500; }
.caption { white-space: pre-wrap; color: var(--ink); overflow-wrap: anywhere; }
.score { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; }
.score-big { font-size: 1.75rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.links { gap: 6px; }
.versions { display: grid; gap: 8px; }
.ver-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.ver { min-width: 52px; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--hairline-strong); background: transparent; color: var(--ink-muted); font: inherit; font-size: 0.9375rem; font-weight: 500; cursor: pointer; }
.ver:hover { border-color: var(--blue); }
.ver.is-on { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.ver:focus-visible { border-radius: var(--r-pill); }
.verdict { display: grid; gap: 12px; border-top: 1px solid var(--hairline); padding-top: 16px; }
.redo-form { display: grid; gap: 10px; }
.redo-form[hidden] { display: none; }

/* The phone */
.phone { position: relative; width: 100%; max-width: 320px; aspect-ratio: 9 / 19; background: #000; border: 1px solid var(--hairline-strong); border-radius: 44px; padding: 10px; box-sizing: border-box; }
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 84px; height: 22px; background: #000; border-radius: var(--r-pill); z-index: 6; }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: #0a0a0a; color: #fff; }
.player, .player-video, .mock-player .cover { position: absolute; inset: 0; width: 100%; height: 100%; }
.player-video, .mock-player .cover { object-fit: cover; background: #000; }
.mock-note { position: absolute; left: 50%; top: 44%; transform: translateX(-50%); font-size: 0.75rem; background: rgba(0, 0, 0, 0.7); padding: 6px 10px; border-radius: var(--r-pill); white-space: nowrap; opacity: 0; transition: opacity var(--base) var(--ease); }
.mock-player.is-playing .mock-note { opacity: 1; }
.shade { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.12); pointer-events: none; }
.ig-top, .rail, .ig-cap { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
.rail .icon, .ig-top .icon { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)); }
.ig-top { position: absolute; top: 44px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 1.0625rem; pointer-events: none; }
.ig-top .icon { width: 22px; height: 22px; }
.rail { position: absolute; right: 10px; bottom: 92px; display: grid; gap: 16px; justify-items: center; pointer-events: none; }
.rail-item { display: grid; justify-items: center; gap: 2px; font-size: 0.6875rem; font-weight: 500; }
.rail-item .icon { width: 26px; height: 26px; vertical-align: 0; }
.ig-cap { position: absolute; left: 14px; right: 58px; bottom: 18px; display: grid; gap: 6px; pointer-events: none; font-size: 0.8125rem; line-height: 1.35; }
.ig-user { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.ig-avatar { width: 26px; height: 26px; border-radius: 50%; background: #2a2a2a; border: 1px solid rgba(255, 255, 255, 0.5); flex: none; }
.ig-handle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-follow { border: 1px solid rgba(255, 255, 255, 0.6); border-radius: var(--r-xs); padding: 2px 8px; font-size: 0.75rem; }
.ig-text { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #fff; }
.ig-audio { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; opacity: 0.9; }
.ig-audio .icon { width: 14px; height: 14px; vertical-align: 0; }
.sound-tag { position: absolute; right: 14px; top: 80px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); display: inline-flex; align-items: center; justify-content: center; pointer-events: none; }
.sound-tag .icon { width: 16px; height: 16px; vertical-align: 0; }
.clip-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.2); pointer-events: none; }
.clip-progress > span { display: block; height: 100%; width: 0; background: #fff; }
.mock-player.is-playing ~ .clip-progress > span { animation: fakeplay 15s linear infinite; }
@keyframes fakeplay { from { width: 0; } to { width: 100%; } }
.tap { position: absolute; inset: 0; background: transparent; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; z-index: 5; border-radius: 34px; }
.tap:focus-visible { outline: 2px solid var(--blue); outline-offset: -4px; border-radius: 34px; }
.tap-icon { width: 72px; height: 72px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.5); display: inline-flex; align-items: center; justify-content: center; color: #fff; transition: opacity var(--base) var(--ease), transform var(--fast) var(--ease); }
.tap-icon .icon { width: 32px; height: 32px; vertical-align: 0; }
.tap:hover .tap-icon { transform: scale(1.04); }
.phone-screen.is-playing .tap-icon { opacity: 0; }
.phone-screen.is-playing .tap:hover .tap-icon, .phone-screen.is-playing .tap:focus-visible .tap-icon { opacity: 1; }
.video-error { position: absolute; left: 16px; right: 16px; top: 40%; background: rgba(0, 0, 0, 0.8); color: #fff; font-size: 0.875rem; padding: 10px 12px; border-radius: var(--r-sm); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 16px; right: 16px; bottom: 24px; margin: 0 auto; max-width: 440px; display: grid; gap: 8px; z-index: 60; pointer-events: none; }
.toast { background: var(--ink); color: #0a0a0a; padding: 12px 18px; border-radius: var(--r-md); font-weight: 500; font-size: 0.9375rem; transition: opacity var(--base) var(--ease), transform var(--base) var(--ease); }
.toast-error { background: #2a1216; color: var(--bad); border: 1px solid var(--bad-line); }
.toast.out { opacity: 0; transform: translateY(8px); }

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