/* Studio — "the morning edition". Newsprint ground, carbon ink, one masthead red for things you can press.
   Contrast (WCAG AA) checked for every text/ground pair below; see DESIGN.md. */

@font-face {
  font-family: 'Franklin';
  src: url('/static/fonts/LibreFranklin-latin.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Franklin';
  src: url('/static/fonts/LibreFranklin-latin-ext.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #f4f4f0;
  --sheet: #ffffff;
  --wash: #ebebe5;
  --ink: #141413;
  --ink-2: #45453f;
  --ink-3: #66665f;
  --rule: #d5d5cd;
  --rule-2: #b4b4ab;
  --spot: #c8102e;
  --spot-hover: #a50d26;
  --spot-ink: #ffffff;
  --spot-text: #b00e28;
  --ok: #1d6a3b;
  --ok-soft: #e2efe6;
  --warn: #7f4d00;
  --warn-soft: #f6ead6;
  --err-soft: #f7e1e4;
  --focus: #1f56a8;
  --font: 'Franklin', 'Libre Franklin', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --r: 3px;
  --gutter: 16px;
  --tabbar: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131312;
    --sheet: #1c1c1a;
    --wash: #222220;
    --ink: #ededE7;
    --ink-2: #c5c5bd;
    --ink-3: #9e9e96;
    --rule: #33332f;
    --rule-2: #4c4c46;
    --spot: #d42339;
    --spot-hover: #b81c30;
    --spot-text: #ff7f8c;
    --ok: #6cc58f;
    --ok-soft: #1c2b21;
    --warn: #e2b062;
    --warn-soft: #2d2517;
    --err-soft: #331b1e;
    --focus: #7fb0ff;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font);
  font-feature-settings: 'kern', 'liga';
  -webkit-font-smoothing: antialiased;
  caret-color: var(--spot);
  accent-color: var(--ink);
  scrollbar-color: var(--rule-2) transparent;
}
::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
img, video { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
small { font-size: .8125rem; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap.wide { max-width: 1480px; }
main { padding-top: 20px; padding-bottom: calc(var(--tabbar) + 32px + env(safe-area-inset-bottom)); min-height: 60vh; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.meta { color: var(--ink-3); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.late { color: var(--spot-text); font-weight: 650; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.pre { white-space: pre-line; }
.i { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.2em; }
.spin { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- masthead ---------------------------------------------------------------------------------- */
.masthead { background: var(--paper); border-bottom: 3px solid var(--ink); position: relative; }
.masthead::after { content: ''; position: absolute; left: 0; right: 0; bottom: -7px; border-bottom: 1px solid var(--ink); }
.mast-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding-top: 12px; padding-bottom: 10px; }
.wordmark { font-weight: 900; font-size: 1.625rem; letter-spacing: -0.035em; text-transform: uppercase; text-decoration: none; line-height: 1; }
.folio { display: flex; flex-wrap: wrap; order: 3; width: 100%; gap: 0; color: var(--ink-2); font-size: .75rem; font-variant-numeric: tabular-nums; }
.folio span + span::before { content: ''; display: inline-block; width: 1px; height: .9em; background: var(--rule-2); margin: 0 10px; vertical-align: -0.1em; }
@media (max-width: 759px) { .folio span:nth-child(n+3) { flex-basis: 100%; } .folio span:nth-child(n+3)::before { content: none; } }
.who { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.who form { margin: 0; }
.who-name, .link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px; min-height: 40px; font: 600 .875rem/1 var(--font); color: var(--ink-2); text-decoration: none; background: none; border: 0; cursor: pointer; border-radius: var(--r); }
.who-name span, .link-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.who-name:hover, .link-btn:hover { background: var(--wash); color: var(--ink); }
.sections { display: none; gap: 26px; padding-bottom: 0; }
.sections a { padding: 10px 0 11px; font-weight: 600; font-size: .9375rem; text-decoration: none; color: var(--ink-2); }
.sections a:hover { color: var(--ink); }
.sections a[aria-current] { color: var(--ink); font-weight: 800; box-shadow: inset 0 -3px 0 var(--ink); }
.sections .sec-aux { margin-left: auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--sheet); border-top: 1px solid var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: var(--tabbar); text-decoration: none; color: var(--ink-3); font-size: .6875rem; font-weight: 600; position: relative; }
.tabbar a .i { width: 22px; height: 22px; }
.tabbar a[aria-current] { color: var(--ink); font-weight: 800; }
.tabbar a[aria-current]::before { content: ''; position: absolute; top: -1px; left: 22%; right: 22%; height: 3px; background: var(--ink); }

@media (min-width: 760px) {
  :root { --gutter: 28px; }
  .folio { order: 0; width: auto; font-size: .8125rem; }
  .who-name span, .link-btn span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .sections { display: flex; }
  .tabbar { display: none; }
  main { padding-top: 28px; padding-bottom: 64px; }
  .wordmark { font-size: 1.875rem; }
}

/* ---- type ---------------------------------------------------------------------------------------- */
.page-head { margin: 8px 0 22px; }
.page-head h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; }
.page-head .lede { margin-top: 8px; color: var(--ink-2); max-width: 70ch; }
.lede { font-size: 1.0625rem; line-height: 1.55; color: var(--ink-2); max-width: 68ch; }
.lede.small { font-size: .875rem; }
.crumbs { font-size: .8125rem; color: var(--ink-3); margin-bottom: 6px; }
.section-rule { font-size: 1.0625rem; font-weight: 800; margin: 32px 0 6px; padding-top: 10px; border-top: 3px solid var(--ink); }
.mini-head { font-size: .875rem; font-weight: 750; color: var(--ink-2); margin: 18px 0 6px; }
.panel h2, .panel-head h2 { font-size: 1.1875rem; font-weight: 800; letter-spacing: -0.01em; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 small, .side-head small { font-weight: 600; color: var(--ink-3); font-size: .8125rem; margin-left: 6px; }
@media (min-width: 760px) { .page-head h1 { font-size: 2rem; } }

/* ---- buttons, fields ------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--ink); border-radius: var(--r);
  background: var(--sheet); color: var(--ink);
  font: 650 .9375rem/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease-out, color .15s ease-out, border-color .15s ease-out, transform .1s ease-out;
}
.btn:hover { background: var(--wash); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--spot); border-color: var(--spot); color: var(--spot-ink); }
.btn-primary:hover { background: var(--spot-hover); border-color: var(--spot-hover); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--wash); color: var(--ink); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: .8125rem; gap: 6px; }
.btn-block { width: 100%; }
.danger { color: var(--spot-text); }
@media (pointer: coarse) { .btn { min-height: 44px; } .btn-sm { min-height: 40px; } }
form.inline { display: inline; margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.compact { gap: 3px; }
.label { font-weight: 650; font-size: .875rem; }
.hint { font-size: .8125rem; color: var(--ink-3); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule-2); border-radius: var(--r);
  padding: 9px 11px; min-height: 44px; width: 100%; max-width: 100%;
  transition: border-color .15s ease-out;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--ink); }
textarea { line-height: 1.5; resize: vertical; min-height: 64px; }
.script-area { font-size: 1.0625rem; line-height: 1.65; min-height: 320px; }
::placeholder { color: var(--ink-3); opacity: 1; }
input[type='number'] { font-variant-numeric: tabular-nums; }
.stack > * + * { margin-top: 14px; }
.grid-form { display: grid; gap: 14px; }
.two, .four { display: grid; gap: 14px; }
@media (min-width: 760px) {
  .grid-form { grid-template-columns: 1fr 1fr; align-items: end; }
  .grid-form > :is(.field:has(textarea), .four, button, .two) { grid-column: 1 / -1; }
  .grid-form > button { justify-self: start; }
  .two { grid-template-columns: 1fr 1fr; }
  .four { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 759px) { .four { grid-template-columns: 1fr 1fr; } }

/* ---- flash, empty, panels ------------------------------------------------------------------------- */
.flash { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--rule); background: var(--sheet); margin: 0 0 16px; }
.flash-ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ink); }
.flash-error { border-color: var(--spot-text); background: var(--err-soft); }
.flash-info { background: var(--wash); }
.empty { border: 1.5px dashed var(--rule-2); border-radius: 4px; padding: 24px; max-width: 70ch; }
.empty p + p { margin-top: 6px; color: var(--ink-2); }
.empty .btn { margin-top: 14px; }
.empty-title { font-weight: 800; font-size: 1.125rem; }
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; padding: 18px; margin: 22px 0; overflow-x: auto; }
.panel > h2 { margin-bottom: 12px; }
.panel.narrow { max-width: 520px; }
.notice { padding: 40px 0; }
.notice h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: 8px; }

/* ---- stamps, cells, chips ------------------------------------------------------------------------- */
.stamp {
  display: inline-block; font: 800 .6875rem/1 var(--font); text-transform: uppercase; letter-spacing: .06em;
  padding: 4px 7px 3px; border: 1.5px solid currentColor; border-radius: 2px; transform: rotate(-1.5deg);
  white-space: nowrap; color: var(--ink-3);
}
.stamp-ok { color: var(--ok); }
.stamp-spot { color: var(--spot-text); }
.stamp-warn { color: var(--warn); }
.stamp-ink { color: var(--ink-2); }
.stamp-quiet { color: var(--ink-3); border-style: dashed; }
:target .stamp, .stamp.fresh { animation: stamp-in .32s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes stamp-in { from { transform: rotate(-9deg) scale(1.7); opacity: 0; } to { transform: rotate(-1.5deg) scale(1); opacity: 1; } }

.cells { display: inline-grid; grid-template-columns: repeat(10, 7px); gap: 2px; vertical-align: middle; }
.cells i { width: 7px; height: 12px; border: 1px solid var(--rule-2); border-radius: 1px; }
.cells i.f { background: var(--ink); border-color: var(--ink); }
.cells i.h { background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); border-color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule-2); border-radius: 999px; padding: 7px 13px; min-height: 36px; text-decoration: none; font-weight: 650; font-size: .875rem; }
.chip:hover { border-color: var(--ink); }
.chip[aria-current] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-n { font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 600; font-size: .8125rem; }
.chip[aria-current] .chip-n { color: inherit; opacity: .75; }

/* ---- front page (radar) --------------------------------------------------------------------------- */
.edition-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; margin: -6px 0 10px; }
.edition-old { font-weight: 750; font-size: .9375rem; }
.edition-nav { display: flex; gap: 4px; }
.front { display: grid; gap: 28px; }
.front-main { min-width: 0; }
.front-side { min-width: 0; }
.front-learn-desktop { display: none; }
@media (min-width: 1080px) {
  .front { grid-template-columns: minmax(0, 1fr) 330px; gap: 40px; }
  .front-side { border-left: 1px solid var(--rule); padding-left: 28px; }
  .front-learn-mobile { display: none; }
  .front-learn-desktop { display: block; }
}

.lead { display: grid; gap: 22px; padding-bottom: 26px; border-bottom: 1px solid var(--ink); }
.lead-title { font-size: 1.75rem; font-weight: 850; letter-spacing: -0.025em; line-height: 1.08; }
.lead-title a, .story-title a, .idea-title a { text-decoration: none; }
.lead-title a:hover, .story-title a:hover, .idea-title a:hover { text-decoration: underline; }
.lead .lede { margin-top: 12px; font-size: 1.125rem; color: var(--ink); }
.lead .story-actions { margin: 16px 0 4px; }
.lead-phone-score { margin-top: 14px; }
.lead-score-mobile { font-variant-numeric: tabular-nums; }
.lead-score-mobile b { font-size: 1.75rem; font-weight: 850; letter-spacing: -0.03em; }
.lead-score-mobile span { color: var(--ink-3); font-weight: 650; font-size: .875rem; }
@media (min-width: 760px) { .lead-phone-score { display: none; } }
@media (min-width: 760px) {
  .lead { grid-template-columns: minmax(0, 1fr) 290px; gap: 32px; }
  .lead-title { font-size: 2.375rem; }
  .lead-score { border-left: 1px solid var(--rule); padding-left: 24px; }
}
.story-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin-top: 8px; color: var(--ink-3); font-size: .8125rem; font-weight: 600; }
.story-meta > span:not(.stamp) + span:not(.stamp)::before, .story-meta > span:not(.stamp) + .stamp::before { content: none; }
.story-meta > span:not(.stamp)::after { content: '·'; margin: 0 8px; color: var(--rule-2); }
.story-meta > span:not(.stamp):last-child::after, .story-meta > span:not(.stamp):has(+ .stamp)::after { content: none; }
.story-meta .stamp { margin-left: 10px; }

.facts { margin: 16px 0 0; display: grid; gap: 10px; }
.facts div { display: grid; gap: 2px; }
.facts dt { font-size: .8125rem; font-weight: 750; color: var(--ink-2); }
.facts dd { margin: 0; max-width: 68ch; }
@media (min-width: 760px) { .facts div { grid-template-columns: 150px 1fr; gap: 14px; } }

.evidence { margin: 0; padding: 0; list-style: none; counter-reset: ev; }
.evidence li { counter-increment: ev; display: grid; grid-template-columns: 26px 1fr; padding: 7px 0; border-bottom: 1px dotted var(--rule-2); }
.evidence li::before { content: counter(ev); font-weight: 800; font-size: .8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; padding-top: 2px; }
.evidence a { font-weight: 600; overflow-wrap: anywhere; }
.evidence .meta { grid-column: 2; display: block; margin-top: 2px; }

.story-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.story .story-actions { gap: 8px; grid-column: 1 / -1; margin-top: 4px; flex-wrap: nowrap; }
@media (min-width: 760px) { .story .story-actions { grid-column: 2 / 3; } }
.story .story-actions .votes { flex: 1 1 auto; }
.story .story-actions .row-actions { gap: 4px; flex-wrap: nowrap; }
.story .vote-others .muted { display: none; }
@media (max-width: 420px) { .story .vote span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .story .vote { padding: 8px 11px; } }
.votes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; }
.vote-group { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.vote { display: inline-flex; align-items: center; gap: 6px; border: 0; border-right: 1px solid var(--ink); background: var(--sheet); color: var(--ink); padding: 8px 12px; min-height: 40px; font: 650 .875rem/1 var(--font); cursor: pointer; transition: background-color .15s ease-out, color .15s ease-out; }
.vote:last-child { border-right: 0; }
.vote:hover:not(.on) { background: var(--wash); }
.vote.on { background: var(--ink); color: var(--paper); }
.vote[aria-busy='true'] { opacity: .6; }
@media (pointer: coarse) { .vote { min-height: 44px; } }
.vote-others { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8125rem; color: var(--ink-2); }

.score-box { border-top: 3px solid var(--ink); padding-top: 10px; font-variant-numeric: tabular-nums; }
.score-total { display: flex; align-items: baseline; gap: 3px; margin-bottom: 8px; }
.score-n { font-weight: 850; font-size: 2.25rem; line-height: 1; letter-spacing: -0.035em; }
.score-of { color: var(--ink-3); font-weight: 650; font-size: .875rem; }
.score-rows { margin: 0; }
.score-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0 2px; border-top: 1px solid var(--rule); }
.score-row:first-child { border-top: 0; }
.score-row dt { font-weight: 750; font-size: .875rem; }
.score-row dt small { font-weight: 600; color: var(--ink-3); font-size: .75rem; margin-left: 4px; }
.score-row dd { margin: 0; display: flex; align-items: center; gap: 8px; }
.score-row dd b { min-width: 2.2em; text-align: right; font-size: .9375rem; }
.score-row.learn dd { font-size: .875rem; }
.score-sub { display: flex; flex-wrap: wrap; gap: 0 4px; padding: 0 0 6px; font-size: .75rem; color: var(--ink-3); }
.score-sub dt { font-weight: 600; }
.score-sub dd { margin: 0 8px 0 0; font-weight: 700; color: var(--ink-2); }
.why-box { margin-top: 10px; font-size: .875rem; }
.why-box summary, .story-more summary, .scene-edit summary, .cut-script summary { cursor: pointer; font-weight: 700; color: var(--ink-2); padding: 6px 0; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.why-box > summary, .story-more > summary, .cut-script > summary, .jobs details > summary { display: inline-flex; align-items: center; gap: 6px; }
.why-box > summary::before, .story-more > summary::before, .cut-script > summary::before, .jobs details > summary::before {
  content: ''; width: 13px; height: 13px; flex-shrink: 0; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .15s ease-out;
}
details[open] > summary::before { transform: rotate(90deg); }
.why-box ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.why-box li + li { margin-top: 5px; }

.stories { margin-top: 2px; }
.story { display: grid; grid-template-columns: 26px minmax(0, 1fr) 40px; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.rank { font-weight: 850; font-size: 1.125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; line-height: 1.3; }
.story-title { font-size: 1.1875rem; font-weight: 800; letter-spacing: -0.012em; line-height: 1.25; }
.story-angle { margin-top: 6px; color: var(--ink-2); max-width: 68ch; }
.story-score { font-weight: 850; font-size: 1.375rem; text-align: right; font-variant-numeric: tabular-nums; line-height: 1.2; }
.mini-score { display: grid; grid-template-columns: max-content max-content; align-items: center; gap: 5px 10px; margin: 10px 0 0; font-size: .75rem; color: var(--ink-3); font-weight: 650; }
.mini-score div { display: contents; }
@media (min-width: 760px) {
  .mini-score { display: flex; flex-wrap: wrap; gap: 6px 18px; }
  .mini-score div { display: flex; align-items: center; gap: 6px; }
}
.mini-score dd { margin: 0; }
.story-more { margin-top: 8px; }
.story-top { border-bottom: 2px solid var(--ink); }
.story-compact .story-title { font-size: 1.0625rem; font-weight: 650; }
.story-compact .story-angle { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.story-compact .story-score { font-size: 1.125rem; font-weight: 750; color: var(--ink-2); }
.story-more-grid { display: grid; gap: 18px; padding: 8px 0; }
@media (min-width: 760px) { .story { grid-template-columns: 34px minmax(0, 1fr) 52px; gap: 16px; } .story-more-grid { grid-template-columns: 260px 1fr; } }

.side-box { border-top: 3px solid var(--ink); padding: 12px 0 18px; }
.side-box + .side-box { margin-top: 10px; }
.side-head { font-size: 1.125rem; font-weight: 850; letter-spacing: -0.01em; }
.learn-box { background: var(--sheet); border: 1px solid var(--rule); border-top: 3px solid var(--ink); padding: 12px 16px 16px; margin-bottom: 18px; }
.learn-note { margin-top: 8px; }
.learn-note p + p { margin-top: 6px; }
.changes { margin: 10px 0 8px; padding-left: 18px; font-size: .875rem; color: var(--ink-2); }
.changes li + li { margin-top: 4px; }
.trend-list, .signal-list { margin: 0; padding: 0; list-style: none; font-size: .875rem; }
.trend-list li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dotted var(--rule-2); }
.signal-list li { padding: 6px 0; border-bottom: 1px dotted var(--rule-2); }
.signal-list a { font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.signal-list .meta { display: block; }

/* ---- ideas ---------------------------------------------------------------------------------------- */
.idea-list, .video-list, .comment-list { list-style: none; margin: 0; padding: 0; }
.idea-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 10px 14px; padding: 16px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.idea-row .votes, .idea-row .idea-c { grid-column: 1 / -1; }
.idea-title { font-size: 1.0625rem; font-weight: 750; line-height: 1.3; }
.idea-score { font-weight: 850; font-size: 1.25rem; text-align: right; font-variant-numeric: tabular-nums; }
.idea-c { justify-self: start; }
@media (min-width: 1000px) {
  .idea-row { grid-template-columns: minmax(0, 1fr) 50px auto auto; }
  .idea-row .votes, .idea-row .idea-c { grid-column: auto; }
  .idea-row .vote-others { display: none; }
}
.idea-grid { display: grid; gap: 28px; }
@media (min-width: 900px) { .idea-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; } }

.comments { margin-top: 26px; max-width: 760px; }
.comment-list li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.comment-meta { font-size: .8125rem; color: var(--ink-3); }
.comment-meta b { color: var(--ink); }
.comment-body { margin-top: 4px; white-space: pre-line; }
.comment-form { margin-top: 16px; display: grid; gap: 10px; }
.comment-form .btn { justify-self: start; }

/* ---- studio --------------------------------------------------------------------------------------- */
.video-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.next-inline { margin-top: 6px; font-size: .875rem; color: var(--ink-2); }
.video-head h1 { font-size: 1.75rem; }
@media (min-width: 760px) { .video-head h1 { font-size: 2.125rem; } }
.meta-form { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 14px; }
.meta-form .field { width: auto; }
.meta-form select, .meta-form input { min-height: 40px; padding: 6px 10px; width: auto; min-width: 150px; }
.next-step { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; margin: 0 0 18px; max-width: 900px; }
.next-step .i { margin-top: 2px; }
.next-step.warn { background: var(--warn-soft); border-color: var(--warn); }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--ink); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 0 11px; text-decoration: none; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.tabs a[aria-current] { color: var(--ink); font-weight: 800; box-shadow: inset 0 -3px 0 var(--ink); }
@media (max-width: 759px) {
  .tabs { gap: 18px; padding-right: 28px; scroll-snap-type: x mandatory; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
  .tabs a { scroll-snap-align: start; }
  .tabs.is-scrolled { -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 36px), transparent); }
}

.scenes { display: grid; gap: 0 32px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); margin: 6px 0 16px; }
.scene { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 0 10px; padding: 16px 0 18px; border-top: 1px solid var(--rule); min-width: 0; scroll-margin-top: 16px; }
.scene:target { border-top: 2px solid var(--ink); }
.scene-body { min-width: 0; }
.scene-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.scene-head h3 { font-size: 1rem; font-weight: 800; line-height: 1.3; min-width: 0; }
.scene-n { display: inline-grid; place-items: center; width: 28px; height: 28px; background: var(--ink); color: var(--paper); font-weight: 800; font-size: .875rem; font-variant-numeric: tabular-nums; border-radius: 2px; }
.frame { position: relative; margin: 10px 0 8px; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.frame a, .frame img, .frame video { display: block; width: 100%; height: 100%; }
.frame img, .frame video { object-fit: cover; }
.frame-slot { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; padding: 9px 12px; border: 1.5px dashed var(--rule-2); color: var(--ink-3); font-size: .8125rem; font-weight: 600; }
.play { position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%; border: 0; background: rgba(20, 20, 19, .72); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background-color .15s ease-out, transform .15s ease-out; }
.play:hover { background: rgba(20, 20, 19, .9); transform: scale(1.04); }
.play .i { width: 24px; height: 24px; margin-left: 3px; }
.play[hidden] { display: none; }
.clip-links { margin: 0 0 6px; }
.scene-text { display: grid; gap: 6px; }
.scene-text .narr { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.scene-text .vis { font-size: .875rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scene-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 12px; }
.scene-edit summary { display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; }
.regen { flex: 1 1 100%; }
.regen summary { list-style: none; display: inline-flex; }
.regen summary::-webkit-details-marker { display: none; }
.regen[open] form { margin-top: 10px; padding: 12px; background: var(--wash); border-radius: var(--r); }
.scene-edit { margin-top: 12px; border-top: 1px solid var(--rule); padding-top: 4px; }
.scene-edit form { margin-top: 8px; }
.scene-tools { margin-top: 10px; }
.add-scene { display: block; margin-top: 6px; }

.cutdowns { display: grid; gap: 16px; margin-top: 14px; }
.cutdown { background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; padding: 16px; }
.cut-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cut-head h3 { font-size: 1.0625rem; font-weight: 800; }
.cut-hook { margin-top: 10px; }
.platforms { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 900px) { .platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.platform { border-top: 1px solid var(--rule); padding-top: 10px; }
.platform h4 { font-size: .875rem; font-weight: 800; }
.platform .pre, .pf-title { margin-top: 4px; font-size: .9375rem; }
.pf-title { font-weight: 700; }
.tags { margin: 6px 0 8px; color: var(--ink-2); font-size: .875rem; overflow-wrap: anywhere; }

.downloads { list-style: none; margin: 0; padding: 0; }
.dl { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.dl a, .dl > span:first-child { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.dl.off { color: var(--ink-3); }
.dl .meta { flex: 1 1 260px; text-align: right; }
@media (max-width: 640px) { .dl .meta { text-align: left; flex-basis: 100%; padding-left: 28px; } }

.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .9375rem; }
.table th { text-align: left; font-size: .8125rem; color: var(--ink-3); font-weight: 700; border-bottom: 2px solid var(--ink); padding: 8px; white-space: nowrap; }
.table td { border-bottom: 1px solid var(--rule); padding: 10px 8px; vertical-align: top; }
.table .num { text-align: right; }
.clip-text { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num-input { width: 110px; min-height: 36px; padding: 4px 8px; display: inline-block; }
.views-form { display: inline-flex; gap: 4px; align-items: center; }
.log { white-space: pre-wrap; font-size: .75rem; max-height: 240px; overflow: auto; background: var(--wash); padding: 8px; border-radius: var(--r); }
.jobs td { font-size: .875rem; }
.table-scroll { overflow-x: auto; max-width: 100%; }
.job-buttons { margin-bottom: 8px; }

/* ---- board ---------------------------------------------------------------------------------------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; margin-top: 4px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter); scroll-padding: 0 var(--gutter); }
.col { scroll-snap-align: start; padding: 0 0 12px; min-height: 220px; }
/* Absolutely positioned (visually hidden) labels inside cards must be clipped by the board's own scroll. */
.board, .card { position: relative; }
.col + .col { border-left: 1px solid var(--rule); padding-left: 14px; }
.col-head { font-size: 1rem; font-weight: 850; border-bottom: 3px solid var(--ink); padding-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; }
.cards { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 10px; min-height: 90px; transition: outline-color .15s; outline: 2px dashed transparent; outline-offset: 4px; }
.cards.over { outline-color: var(--ink-2); }
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px; padding: 10px 12px; }
.card[draggable='true'] { cursor: grab; }
.card.dragging { opacity: .45; }
.card-title { font-weight: 750; text-decoration: none; display: block; line-height: 1.3; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 8px; font-size: .75rem; color: var(--ink-3); font-weight: 600; }
.card-meta .i { width: 13px; height: 13px; margin-right: 3px; }
.avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: .625rem; font-weight: 800; }
.card-move { margin-top: 8px; }
.card-move select { min-height: 34px; padding: 4px 8px; font-size: .8125rem; }
.card-idea { border-style: dashed; background: transparent; }
@media (min-width: 1100px) { .board { grid-auto-flow: initial; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; padding-left: 0; padding-right: 0; } }

/* ---- earnings ------------------------------------------------------------------------------------- */
.ledger { display: grid; gap: 0 22px; }
@media (min-width: 900px) { .ledger { grid-template-columns: 1fr 1fr; } }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.funnels { display: grid; gap: 14px; margin: 14px 0; }
@media (min-width: 900px) { .funnels { grid-template-columns: 1fr 1fr; } }
.funnel { background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; padding: 16px; }
.funnel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.funnel-head h3 { font-size: 1.0625rem; font-weight: 800; }
.funnel-steps { list-style: none; margin: 10px 0; padding: 0; }
.funnel-steps li { padding: 5px 0; border-bottom: 1px dotted var(--rule-2); }
.funnel-steps span { display: inline-block; min-width: 72px; font-weight: 750; font-size: .8125rem; color: var(--ink-2); }
.funnel-nums, .review-nums { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .875rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.funnel details { margin-top: 10px; }
.funnel details summary, .add-funnel > summary { list-style: none; display: inline-flex; }
.add-funnel[open] > summary { margin-bottom: 14px; }
.review { border-top: 1px solid var(--rule); padding: 14px 0; max-width: 820px; }
.review h3 { font-size: 1.0625rem; font-weight: 800; }
.review-text { margin-top: 8px; }
.review-text p + p { margin-top: 6px; }

/* ---- login ---------------------------------------------------------------------------------------- */
body.out main { display: grid; place-items: center; min-height: 100vh; padding: 24px var(--gutter); }
.login { width: 100%; max-width: 400px; }
.login-mark { font-weight: 900; font-size: 2.75rem; letter-spacing: -0.04em; text-transform: uppercase; line-height: 1; border-bottom: 3px solid var(--ink); padding-bottom: 8px; box-shadow: 0 4px 0 var(--paper), 0 5px 0 var(--ink); margin-bottom: 26px; }
.login-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 16px; }
.login .muted { margin-top: 18px; }

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