/* Reel Desk (redesigned 27 Nov 2026; the claymorphism page it replaced read as AI-made). A production ledger, not an app template:
   - ink on white, rules instead of cards, the footage itself carries the colour;
   - one accent with one meaning: tally red = "needs you" or "running now" (a camera's tally light);
   - the studio's own typefaces: Bricolage Grotesque (condensed for headings), Martian Mono for every number. */
:root {
  color-scheme: light;
  --paper: #FFFFFF;
  --shade: #F6F6F3;
  --ink: #161616;
  --ink-2: #4A4A46;
  --ink-3: #85857F;
  --rule: #E4E4E0;
  --rule-2: #CBCBC5;
  --frame: #E9E9E5;
  --tally: #D7261E;
  --tally-wash: #FCEDEB;

  --ui: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, Consolas, monospace;
  --deva: "Mukta", "Bricolage Grotesque", system-ui, sans-serif;
  --wrap: 1240px;
  --gut: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 14.5px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.mast :focus-visible { outline-color: #fff; }
::selection { background: var(--ink); color: #fff; }

.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.01em; color: var(--ink-3); line-height: 1.5; }
.meta { font-size: 13px; color: var(--ink-3); line-height: 1.4; }
.muted { color: var(--ink-3); }

/* ---------- masthead: the one dark surface, like an editor's chrome ---------- */
.mast { background: var(--ink); color: #EDEDE8; position: sticky; top: 0; z-index: 20; }
.mast-in { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); min-height: 58px; display: flex; align-items: center; gap: 30px; }
.word {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  font: 800 22px/1 var(--ui); font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.035em;
  color: #fff; text-decoration: none;
}
.word::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--tally); }
.tabs { display: flex; gap: 24px; align-self: stretch; }
.tabs button {
  background: none; border: 0; padding: 0; cursor: pointer; color: #9F9F99;
  font-weight: 500; font-size: 14.5px; display: flex; align-items: center; gap: 6px;
  border-bottom: 2px solid transparent; margin-bottom: -0px;
}
.tabs button:hover { color: #fff; }
.tabs button[aria-selected="true"] { color: #fff; border-bottom-color: #fff; }
.tabs .count { font: 400 10.5px var(--mono); color: #6F6F6A; }
.tabs button[aria-selected="true"] .count { color: #B7B7B1; }
.live {
  margin-left: auto; min-width: 0; display: flex; align-items: center; gap: 9px;
  font: 400 11.5px/1.3 var(--mono); color: #B4B4AE; white-space: nowrap;
}
.live .txt { overflow: hidden; text-overflow: ellipsis; }
.live .pct { color: #fff; }
.tally-dot { width: 8px; height: 8px; border-radius: 50%; background: #5A5A55; flex: none; }
.tally-dot.on { background: var(--tally); animation: tally 1.4s ease-in-out infinite; }
.tally-dot.off { background: transparent; border: 1.5px solid #8A8A84; }
@keyframes tally { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .tally-dot.on { animation: none; } }

/* ---------- buttons: one ink style, one quiet style, one text style ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
  font-weight: 600; font-size: 13.5px; line-height: 1; padding: 10px 14px; min-height: 38px;
  border-radius: 3px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--shade); }
.btn.ink { background: var(--ink); color: #fff; }
.btn.ink:hover { background: #333; }
.btn.tally { background: var(--tally); border-color: var(--tally); color: #fff; }
.btn.tally:hover { background: #B71F18; }
.btn.quiet { border-color: var(--rule-2); }
.btn.small { min-height: 32px; padding: 7px 11px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.add { background: #fff; color: var(--ink); border-color: #fff; flex: none; }
.btn.add:hover { background: #E4E4DF; }
.lnk {
  background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--rule-2);
}
.lnk:hover { text-decoration-color: var(--ink); }
.lnk.is-on { text-decoration: none; cursor: pointer; }
.lnk.you { color: var(--tally); text-decoration-color: currentColor; }
.icon-btn { background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); line-height: 0; border-radius: 3px; }
.icon-btn:hover { background: var(--shade); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- page ---------- */
main { max-width: var(--wrap); margin: 0 auto; padding: 34px var(--gut) 72px; outline: none; }
.loading, .empty { color: var(--ink-3); padding: 28px 0; }
.empty { border-top: 1px solid var(--rule); }
.foot {
  max-width: var(--wrap); margin: 0 auto; padding: 18px var(--gut) 36px; display: flex; flex-wrap: wrap; gap: 8px 22px;
  border-top: 1px solid var(--rule); font: 400 11.5px var(--mono); color: var(--ink-3);
}
.foot a { color: var(--ink-2); }

.page-h {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding-bottom: 14px; border-bottom: 2px solid var(--ink);
}
.page-h h2 { font: 800 44px/0.95 var(--ui); font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.005em; }
.page-h p { color: var(--ink-2); max-width: 430px; }

/* the reels page opens with one plain sentence instead of four counter tiles */
.sum { font: 300 36px/1.12 var(--ui); font-stretch: 85%; letter-spacing: -0.012em; max-width: 920px; margin: 4px 0 6px; }
.sum b { font-weight: 800; }
.sum .you { color: var(--tally); font-weight: 600; }
.sum-sub { color: var(--ink-2); margin-bottom: 6px; }
.sum-sub:last-of-type { margin-bottom: 30px; }
.sum-sub.drive-down { color: var(--tally); }

/* ---------- the ledger: one row per reel, grouped by who has to act ---------- */
.lh {
  display: flex; align-items: baseline; gap: 10px; margin-top: 34px; padding-bottom: 9px; border-bottom: 2px solid var(--ink);
  font: 800 12.5px/1 var(--ui); text-transform: uppercase; letter-spacing: 0.09em;
}
.lh .n { font: 400 11.5px var(--mono); letter-spacing: 0; color: var(--ink-3); }
.lh.you { color: var(--tally); border-bottom-color: var(--tally); }
.lh .hint { margin-left: auto; font: 400 13px var(--ui); letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 34px 36px minmax(0, 1fr) 96px 210px 140px 62px; gap: 0 18px; align-items: center;
  padding: 11px 6px 11px 0; border-bottom: 1px solid var(--rule); cursor: pointer;
}
.row:hover { background: var(--shade); }
.row .no { font: 500 13px var(--mono); color: var(--ink-3); text-align: right; }
.thumb { width: 36px; aspect-ratio: 9 / 16; background: var(--frame); overflow: hidden; border-radius: 2px; display: block; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.2s; }
.thumb img.ready { opacity: 1; }
.what { min-width: 0; }
.title { display: block; font-weight: 600; font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.what .meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.state { font-weight: 600; font-size: 13.5px; line-height: 1.3; display: flex; align-items: center; gap: 8px; min-width: 0; }
.state.you { color: var(--ink); }
.state.you::before { content: ""; width: 7px; height: 7px; background: var(--tally); flex: none; }
.state.studio { color: var(--ink-2); font-weight: 500; }
.state.done { color: var(--ink-3); font-weight: 500; }
.state.live { color: var(--ink); font: 600 13.5px/1.3 var(--ui); white-space: normal; margin-left: 0; } /* not the masthead's .live */
.state.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tally); flex: none; animation: tally 1.4s ease-in-out infinite; }
.steps { display: flex; gap: 3px; }
.steps i { flex: 1; height: 5px; background: var(--rule); }
.steps i.done { background: var(--ink); }
.steps i.skip { background: repeating-linear-gradient(90deg, var(--rule-2) 0 2px, transparent 2px 4px); }
.steps i.next { background: var(--tally); }
.cut { display: flex; flex-direction: column; min-width: 0; }
.cut .len { font: 500 12px/1.4 var(--mono); color: var(--ink-2); }
.cut .meta { font-size: 12px; }
.row .when { font: 400 11px var(--mono); color: var(--ink-3); text-align: right; white-space: nowrap; }
.key { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font: 400 11px var(--mono); color: var(--ink-3); }
.key span { display: inline-flex; align-items: center; gap: 7px; }
.key i { display: inline-block; width: 16px; height: 5px; background: var(--rule); }
.key i.done { background: var(--ink); } .key i.next { background: var(--tally); }
.key i.skip { background: repeating-linear-gradient(90deg, var(--rule-2) 0 2px, transparent 2px 4px); }

/* ---------- contact sheet: exports and references ---------- */
.esheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); column-gap: 44px; }
.ereel { padding: 22px 0 30px; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; }
.ereel-h { display: flex; gap: 12px; align-items: baseline; }
.ereel-h .no { font: 500 22px/1 var(--mono); color: var(--ink); flex: none; }
.ereel-h h3 { font-weight: 600; font-size: 16.5px; line-height: 1.25; }
.ereel .frames { margin-top: 6px; }
.frames { display: flex; flex-wrap: wrap; gap: 22px 20px; }
.frame { width: 138px; margin: 0; }
.poster {
  display: block; position: relative; width: 100%; aspect-ratio: 9 / 16; padding: 0; border: 0; cursor: pointer;
  background: var(--frame); overflow: hidden; border-radius: 2px;
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.25s; }
.poster img.ready { opacity: 1; }
.poster .dur {
  position: absolute; left: 6px; bottom: 6px; font: 500 10.5px/1 var(--mono); color: #fff;
  background: rgba(10, 10, 10, 0.62); padding: 4px 5px; border-radius: 2px;
}
.poster .play {
  position: absolute; inset: 0; display: grid; place-items: center; color: #fff; opacity: 0; transition: opacity 0.15s;
  background: rgba(10, 10, 10, 0.22);
}
.poster .play svg { width: 34px; height: 34px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)); }
.poster:hover .play, .poster:focus-visible .play { opacity: 1; }
.frame.kept .poster { outline: 3px solid var(--ink); outline-offset: 3px; }
.kept-tag {
  position: absolute; top: 6px; left: 6px; font: 600 10px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--ink); color: #fff; padding: 5px 6px; border-radius: 2px;
}
.frame figcaption { margin-top: 10px; }
.frame figcaption b { display: block; font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.frame figcaption .mono { display: block; margin-top: 2px; }
.frame .acts { display: flex; gap: 14px; margin-top: 7px; }
.refgroup { margin-top: 30px; }
.refgroup h3 { font: 800 12.5px/1 var(--ui); text-transform: uppercase; letter-spacing: 0.09em; padding-bottom: 9px; border-bottom: 2px solid var(--ink); display: flex; gap: 10px; align-items: baseline; }
.refgroup h3 .n { font: 400 11.5px var(--mono); letter-spacing: 0; color: var(--ink-3); }
.refgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 28px 22px; padding-top: 22px; }
.refgrid .frame { width: auto; }

/* ---------- styles ---------- */
.sty { display: grid; grid-template-columns: 250px minmax(0, 1fr) 230px; gap: 30px; padding: 26px 0; border-bottom: 1px solid var(--rule); }
.sty h3 { font: 800 30px/0.95 var(--ui); font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.01em; }
.sty .meta { margin-top: 8px; }
.sty .for { font-size: 15px; color: var(--ink); max-width: 560px; }
.sty .hint { color: var(--ink-2); margin-top: 8px; max-width: 560px; }
.sty .refs { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.sty .refs a, .sty .refs button { font: 400 11.5px var(--mono); color: var(--ink-2); }
.sty .side { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.sty .side .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.sty.retired { opacity: 0.6; }
.schange { margin-top: 14px; }

/* ---------- job, notes ---------- */
.job-sum { margin-top: 10px; color: var(--ink); }
.job-checks { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); }
.job-checks li { margin: 3px 0; }
.job-err { margin-top: 10px; color: var(--tally); }
.job-asked { margin-top: 8px; color: var(--ink-2); font-style: italic; }
.job-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.acts-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
textarea, .inp {
  width: 100%; border: 1px solid var(--rule-2); border-radius: 3px; background: var(--paper); padding: 10px 12px;
  font-size: 14.5px; line-height: 1.45; color: var(--ink); resize: vertical;
}
textarea { min-height: 92px; }
textarea:focus, .inp:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
textarea::placeholder, .inp::placeholder { color: #A5A59F; font-family: var(--deva); }
.note-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- drawer: a reel's full sheet ---------- */
.drawer-back { position: fixed; inset: 0; background: rgba(22, 22, 22, 0.32); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); z-index: 41; overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); border-left: 1px solid var(--rule-2); box-shadow: -30px 0 60px rgba(0, 0, 0, 0.1);
  padding: 22px 32px 56px; animation: slide 0.16s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }
.d-close { position: absolute; top: 14px; right: 16px; }
.d-h { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; padding: 18px 40px 22px 0; border-bottom: 2px solid var(--ink); }
.d-h .no { font: 500 34px/1 var(--mono); grid-row: span 3; }
.d-h h2 { font: 800 32px/1 var(--ui); font-stretch: 78%; letter-spacing: 0.002em; }
.d-h .state { margin-top: 8px; font-size: 15px; }
.d-sec { padding: 22px 0; border-bottom: 1px solid var(--rule); }
.d-sec:last-child { border-bottom: 0; }
.d-sec h4 { font: 800 12px/1 var(--ui); text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 14px; display: flex; gap: 10px; align-items: baseline; }
.d-sec h4 .n { font: 400 11px var(--mono); letter-spacing: 0; color: var(--ink-3); }
.check { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.check li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 0; border-top: 1px solid var(--rule); align-items: baseline; }
.check li:first-child { border-top: 0; padding-top: 0; }
.check .mk { font: 600 13px/1 var(--mono); color: var(--ink-3); text-align: center; }
.check .done .mk { color: var(--ink); }
.check .next .mk { color: var(--tally); }
.check b { font-weight: 600; font-size: 14.5px; }
.check .who { font: 400 10.5px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-left: 6px; }
.check .det { grid-column: 2; color: var(--ink-2); font-size: 13.5px; line-height: 1.4; }
.check .skip b, .check .skip .det, .check .todo b { color: var(--ink-3); }
.check .next b { color: var(--tally); }
.check .at { font: 400 11px var(--mono); color: var(--ink-3); white-space: nowrap; }
.clips { list-style: none; margin: 0 0 14px; padding: 0; }
.clips li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--rule); font-size: 13.5px; }
.clips li:first-child { border-top: 0; }
.clips .kind { font: 400 10.5px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-left: 8px; }
.drawer .frames { gap: 20px 18px; }
.drawer .frame { width: 132px; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(16, 16, 16, 0.6); display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.modal {
  position: relative; background: var(--paper); border-radius: 4px; width: min(980px, 100%); max-height: calc(100vh - 48px); overflow: auto;
  display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
}
.modal.text-only { grid-template-columns: minmax(0, 1fr); width: min(740px, 100%); }
.m-close { position: absolute; top: 10px; right: 10px; z-index: 2; background: var(--paper); }
.player { background: #000; display: grid; place-items: center; min-height: 100%; }
.player video { display: block; width: 100%; max-height: calc(100vh - 48px); aspect-ratio: 9 / 16; background: #000; }
.m-side { padding: 30px 30px 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.m-side h2 { font: 800 30px/1 var(--ui); font-stretch: 78%; }
.m-side .meta { margin-bottom: 6px; }
.facts { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 6px 14px; margin: 0; padding-top: 14px; border-top: 1px solid var(--rule); }
.facts dt { font: 400 11px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); padding-top: 2px; }
.facts dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.facts dd.mono { font-size: 12px; color: var(--ink-2); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.switch input { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }

/* add footage, new style */
.seg { display: flex; gap: 22px; border-bottom: 1px solid var(--rule); }
.seg button { background: none; border: 0; padding: 0 0 9px; cursor: pointer; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.seg button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.seg button:disabled { opacity: 0.4; cursor: default; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > span:first-child { font: 400 11px var(--mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-2); }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choices label { cursor: pointer; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices span { display: inline-block; padding: 7px 11px; border: 1px solid var(--rule-2); border-radius: 3px; font-size: 13.5px; font-weight: 500; }
.choices input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.choices input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.target { font: 600 13px var(--mono); }
.drop {
  display: flex; flex-direction: column; gap: 4px; padding: 22px 20px; border: 1px dashed var(--ink-3); border-radius: 3px;
  cursor: pointer; background: var(--paper);
}
.drop:hover, .drop.over { border-color: var(--ink); background: var(--shade); }
.drop b { font-weight: 600; font-size: 15px; }
.drop .muted { font-size: 13px; }
.files { list-style: none; margin: 0; padding: 0; }
.files:empty { display: none; }
.files li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 13.5px; }
.files .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .done .fname::before { content: "✓ "; font-weight: 700; }
.files .skip, .files .skip .mono { color: var(--ink-3); }
.files .fail .mono { color: var(--tally); }
.files .bar { grid-column: 1 / -1; height: 2px; background: var(--rule); }
.files .bar i { display: block; height: 100%; background: var(--ink); }
.auto { display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: 14px; }
.auto input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.m-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--rule); }
.af.busy .seg, .af.busy .form, .af.busy .field { pointer-events: none; }

/* markdown viewer (veto lists, breakdowns) */
.md { font-size: 14px; line-height: 1.55; color: var(--ink); }
.md h1, .md h2, .md h3, .md h4 { font-weight: 700; margin: 22px 0 8px; line-height: 1.2; }
.md h1 { font-size: 22px; } .md h2 { font-size: 18px; } .md h3 { font-size: 15.5px; } .md h4 { font-size: 14px; }
.md p { margin: 8px 0; }
.md ul, .md ol { padding-left: 20px; margin: 8px 0; }
.md li.l2 { margin-left: 18px; }
.md code { font: 400 12px var(--mono); background: var(--shade); padding: 1px 4px; border-radius: 2px; }
.md pre { background: var(--shade); padding: 12px; overflow: auto; border-radius: 3px; }
.md blockquote { margin: 10px 0; padding-left: 12px; border-left: 2px solid var(--rule-2); color: var(--ink-2); }
.md hr { border: 0; border-top: 1px solid var(--rule); margin: 18px 0; }
.md .tbl { overflow-x: auto; margin: 10px 0; }
.md table { border-collapse: collapse; width: 100%; font-size: 13px; }
.md th, .md td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.md th { font: 400 10.5px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); border-bottom-color: var(--ink); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; max-width: min(560px, calc(100vw - 32px));
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 3px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* ---------- smaller screens ---------- */
@media (max-width: 1040px) {
  .row { grid-template-columns: 30px 36px minmax(0, 1fr) 190px 110px; }
  .row .cut { display: none; }
  .row .when { display: none; }
  .sty { grid-template-columns: 200px minmax(0, 1fr); }
  .sty .side { grid-column: 2; }
}
@media (max-width: 760px) {
  :root { --gut: 16px; }
  .mast-in { flex-wrap: wrap; gap: 0 16px; padding-top: 12px; }
  .word { font-size: 20px; }
  .btn.add { margin-left: auto; min-height: 34px; padding: 8px 12px; }
  .tabs { order: 3; width: 100%; gap: 20px; overflow-x: auto; scrollbar-width: none; min-height: 44px; }
  .tabs::-webkit-scrollbar { display: none; }
  .live { order: 4; width: 100%; margin: 0; padding: 7px 0 9px; border-top: 1px solid #2C2C2A; }
  main { padding-top: 24px; }
  .sum { font-size: 27px; }
  .page-h h2 { font-size: 34px; }
  .lh .hint { display: none; }
  .row { grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "thumb what" "thumb state" "thumb steps"; gap: 3px 14px; padding: 12px 0; }
  .row .no, .row .cut { display: none; }
  .row .thumb { grid-area: thumb; width: 40px; align-self: start; }
  .row .what { grid-area: what; }
  .row .state { grid-area: state; }
  .row .steps { grid-area: steps; max-width: 220px; margin-top: 5px; }
  .row .title { white-space: normal; }
  .esheet { grid-template-columns: 1fr; }
  .frames { gap: 20px 14px; }
  .frame, .drawer .frame { width: calc(50% - 7px); }
  .refgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .sty { grid-template-columns: 1fr; gap: 14px; }
  .sty .side { grid-column: auto; }
  .drawer { padding: 14px 18px 48px; }
  .d-h h2 { font-size: 27px; }
  .modal-back { padding: 0; align-items: stretch; }
  .modal, .modal.text-only { grid-template-columns: 1fr; width: 100%; max-height: none; min-height: 100%; border-radius: 0; }
  .player video { max-height: 70vh; }
  .m-side { padding: 22px 18px 28px; }
  .form { grid-template-columns: 1fr; }
}
