/* Bonggis Studio. Tokens and rules: see DESIGN.md. Black, gold and red; large type; status is
   always a word, never colour alone. Red is used for text only where it passes 4.5:1. */
:root {
  --ground: #F7F5F0; --surface: #FFFFFF; --surface-2: #EFECE4; --ink: #141210; --ink-2: #3A3631; --muted: #5E5850; --line: #E2DED5; --control-border: #857E73; --focus: #141210;
  --accent: #9E1219; --btn: #141210; --btn-ink: #FFFFFF; --btn-hover: #2C2925; --accent-soft: #F8E6E5;
  --gold: #E3B341; --gold-ink: #141210; --gold-soft: #FBF1D6; --warn: #7A5A00;
  --danger: #B42318; --danger-soft: #FBE5E3; --success: #146C43; --success-soft: #E0F2E8;
  --brand-deep: #0A0A0A; --brand-red: #D71920;
  --shadow-sm: 0 2px 6px rgba(20, 18, 16, 0.07); --shadow-md: 0 8px 20px rgba(20, 18, 16, 0.10);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;
  --radius: 10px; --radius-lg: 14px; --ease: cubic-bezier(0.22, 1, 0.36, 1); --dur: 140ms;
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: Oswald, "Arial Narrow", "Roboto Condensed", Inter, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0A0A0A; --surface: #161514; --surface-2: #242220; --ink: #F4F1EA; --ink-2: #D5D0C6; --muted: #A8A196; --line: #2E2B28; --control-border: #77706A; --focus: #E3B341;
    --accent: #E3B341; --btn: #E3B341; --btn-ink: #0A0A0A; --btn-hover: #F0C65E; --accent-soft: #2B2412;
    --gold-soft: #2B2412; --warn: #F2CF6B; --danger: #F28B82; --danger-soft: #3A1D1B; --success: #7BD88F; --success-soft: #16301F;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 18px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
h1 { font-size: clamp(28px, 3vw, 34px); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 var(--s3); text-wrap: balance; }
h2 { font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 var(--s3); text-wrap: balance; }
h3 { font-size: 19px; margin: 0 0 var(--s2); }
p { margin: 0 0 var(--s3); max-width: 64ch; }
.lede { font-size: 20px; color: var(--ink-2); }
.muted { color: var(--muted); }
.small { font-size: 16px; }
code, .mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 15px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); padding: var(--s3); border-radius: var(--radius); font-size: 14px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: var(--s3) var(--s4); z-index: 10; }
.skip:focus { left: var(--s4); top: var(--s4); }

/* top bar */
.strip { height: 4px; background: linear-gradient(90deg, var(--brand-deep) 0 40%, var(--brand-red) 40% 70%, var(--gold) 70% 100%); }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: var(--s3) var(--s6); padding: var(--s3) var(--s6); background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: inline-flex; align-items: baseline; gap: var(--s3); text-decoration: none; color: var(--ink); min-height: 44px; align-items: center; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: 0.03em; line-height: 1; }
.wordmark .bang { color: var(--brand-red); }
.brand .tag { font-weight: 600; font-size: 14px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); padding-left: var(--s3); border-left: 1px solid var(--line); }
.env-badge { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; background: var(--gold); color: var(--gold-ink); padding: 2px 8px; border-radius: 999px; }
/* navigation: inline everyday links on wide screens, one Menu disclosure on phones (works
   without JavaScript). People, System and Sign out live in the menu on every size. */
.nav-main { display: flex; gap: var(--s1) var(--s4); align-items: center; flex-wrap: wrap; margin-left: auto; }
.nav-main a, .nav-panel a { color: var(--ink); text-decoration: none; font-weight: 500; min-height: 48px; display: inline-flex; align-items: center; gap: var(--s1); position: relative; font-size: 17px; padding: 0 var(--s1); }
.nav-main a[aria-current], .nav-panel a[aria-current] { color: var(--accent); font-weight: 700; }
.nav-main a[aria-current]::after { content: ""; position: absolute; left: var(--s1); right: var(--s1); bottom: 6px; height: 2px; background: var(--accent); }
.nav-panel a[aria-current] { text-decoration: underline; text-underline-offset: 6px; }
.nav-menu { position: relative; }
.nav-menu > summary { list-style: none; cursor: pointer; min-height: 48px; display: inline-flex; align-items: center; gap: var(--s2); padding: 0 var(--s4); border: 1.5px solid var(--control-border); border-radius: var(--radius); font-weight: 600; color: var(--ink); }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.nav-menu[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.nav-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 260px; background: var(--surface); border: 1px solid var(--control-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: var(--s3) var(--s4); z-index: 20; }
.nav-group { display: flex; flex-direction: column; }
.nav-who { font-size: 16px; margin: var(--s1) 0 var(--s2); }
.nav-panel form { margin: 0; }
.nav-panel button.linklike { min-height: 48px; font-size: 17px; }
.when-small { display: none; }
.top .n { background: var(--brand-red); color: #fff; border-radius: 999px; font-size: 13px; font-weight: 700; padding: 0 7px; line-height: 1.6; }
@media (max-width: 999px) {
  .nav-main, .when-wide { display: none; }
  .when-small { display: inline-flex; align-items: center; gap: var(--s2); }
  .nav-panel .when-small { display: flex; align-items: stretch; }
  .nav-utils { border-top: 1px solid var(--line); margin-top: var(--s2); padding-top: var(--s2); }
  .top { position: static; flex-wrap: nowrap; }
  .nav-menu { margin-left: auto; position: static; }
  .nav-panel { left: var(--s4); right: var(--s4); top: auto; margin-top: var(--s2); }
  html { scroll-padding-top: var(--s4); }
}
main { max-width: 1160px; margin: 0 auto; padding: var(--s8) var(--s6) 80px; }
footer { color: var(--muted); font-size: 15px; text-align: center; padding: var(--s6) var(--s4) var(--s8); }
@media (max-width: 560px) { main { padding: var(--s5) var(--s4) 64px; } .top { padding: var(--s2) var(--s4); } .brand .tag { display: none; } }

section { margin-bottom: var(--s10); }
.titlebar { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s6); }
.titlebar p { margin: 0; }
.eyebrow { font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.crumb { font-size: 16px; color: var(--muted); margin-bottom: var(--s2); }
.flash { background: var(--gold-soft); color: var(--ink); border-left: 5px solid var(--gold); padding: var(--s3) var(--s4); border-radius: var(--radius); margin-bottom: var(--s6); font-weight: 600; }
.errorbox { background: var(--danger-soft); border-left: 5px solid var(--danger); padding: var(--s3) var(--s4); border-radius: var(--radius); margin-bottom: var(--s5); }
.devbox { background: var(--gold-soft); border-left: 5px solid var(--gold); padding: var(--s3) var(--s4); border-radius: var(--radius); margin-top: var(--s5); overflow-wrap: anywhere; font-size: 16px; }

/* forms */
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: var(--s1); font-size: 17px; }
.help { color: var(--muted); font-size: 16px; margin-top: var(--s1); }
fieldset { border: 0; padding: 0; margin: 0; }
input[type=text], input[type=email], input[type=number], input[type=url], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; min-height: 48px; font: inherit; padding: var(--s3) 14px; border: 1.5px solid var(--control-border); border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.has-error input { border-color: var(--danger); border-width: 2px; }
.error { color: var(--danger); font-weight: 600; margin: var(--s2) 0 0; }
textarea { resize: vertical; min-height: 120px; }
label.check { display: flex; align-items: flex-start; gap: var(--s3); min-height: 48px; padding: var(--s2) 0; font-weight: 600; }
label.check input { width: 24px; height: 24px; margin-top: 2px; flex: none; accent-color: var(--btn); }
label.check .help { font-weight: 400; margin: 0; }
button, .button { font: inherit; font-weight: 600; min-height: 48px; padding: var(--s3) var(--s5); border-radius: var(--radius); border: 1.5px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
button:hover, .button:hover { background: var(--surface-2); }
button.primary, .button.primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
button.primary:hover, .button.primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
button.danger { border-color: var(--danger); color: var(--danger); }
button.danger:hover { background: var(--danger-soft); }
button.linklike { background: none; border: none; padding: var(--s2) 0; min-height: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* cards, lists, tables */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s5) var(--s6); box-shadow: var(--shadow-sm); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s5); margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: var(--s3); } }
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.list > li { padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: var(--s4); align-items: center; flex-wrap: wrap; }
.list > li:last-child { border-bottom: 0; }
.list .t { font-weight: 600; }
.list .m { color: var(--muted); font-size: 16px; }
.list > li.unread { border-left: 4px solid var(--gold); }
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { text-align: left; padding: var(--s3) 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); font-weight: 700; }
tr:last-child td { border-bottom: none; }
td.num { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  table.stack thead { display: none; }
  table.stack tr { display: block; border-bottom: 1px solid var(--line); padding: var(--s2) 0; }
  table.stack td { display: block; border: none; padding: var(--s1) 14px var(--s1) 120px; position: relative; min-height: 32px; }
  table.stack td::before { content: attr(data-label); position: absolute; left: 14px; top: 7px; width: 100px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
}

/* status pills: colour plus a word */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.pill.ok, .pill.s-done, .pill.s-published, .pill.s-approved { background: var(--success-soft); color: var(--success); }
.pill.warn, .pill.s-queued, .pill.s-in_review { background: var(--gold-soft); color: var(--warn); }
.pill.bad, .pill.s-dead, .pill.s-failed, .pill.s-changes_requested { background: var(--danger-soft); color: var(--danger); }
.pill.s-running { background: var(--accent-soft); color: var(--accent); }
.rolelist { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s4); margin-bottom: var(--s6); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s4) var(--s5); }
.stat-n { font-size: 32px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font-size: 16px; margin-top: var(--s2); }

/* sign-in: one frame for every sign-in state, styled after a film call sheet */
body.auth main { max-width: none; padding: 0; }
.callsheet { display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; min-height: 100vh; min-height: 100dvh; }
.callsheet > * { margin: 0; }
.masthead { background: #141210; color: #F4F1EA; padding: clamp(32px, 5vw, 64px); display: flex; align-items: center; }
.ms-frame { position: relative; width: 100%; max-width: 460px; padding: var(--s8) var(--s6); }
.ms-frame::before, .ms-frame::after { content: ""; position: absolute; width: 28px; height: 28px; border-color: var(--gold); border-style: solid; }
.ms-frame::before { top: 0; left: 0; border-width: 2px 0 0 2px; }
.ms-frame::after { bottom: 0; right: 0; border-width: 0 2px 2px 0; }
.ms-wordmark { font-family: var(--display); font-weight: 700; font-size: clamp(56px, 7vw, 96px); line-height: 0.92; letter-spacing: 0.01em; margin: 0; color: #F4F1EA; }
.ms-wordmark .bang { color: var(--brand-red); }
.ms-studio { font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); margin: var(--s3) 0 var(--s8); display: flex; gap: var(--s3); align-items: center; }
.ms-sheet { margin: 0 0 var(--s8); border-top: 1px solid rgba(227, 179, 65, 0.55); }
/* One label column shared by every row (subgrid), so the values line up; older browsers fall back
   to a fixed label width. */
.ms-sheet { display: grid; grid-template-columns: max-content minmax(10em, 1fr); column-gap: var(--s5); }
.ms-sheet > div { grid-column: 1 / -1; display: grid; grid-template-columns: 8.5em minmax(10em, 1fr); grid-template-columns: subgrid; row-gap: var(--s1); padding: var(--s2) 0; border-bottom: 1px solid rgba(244, 241, 234, 0.18); }
.ms-sheet dt { font-size: 16px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #C9C2B6; }
.ms-sheet dd { margin: 0; font-size: 17px; color: #F4F1EA; min-width: 0; }
.ms-line { font-family: var(--display); font-weight: 500; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; margin: 0; max-width: 18ch; color: #F4F1EA; }
.auth-panel { display: flex; align-items: center; padding: clamp(32px, 6vw, 80px) clamp(20px, 6vw, 96px); background: var(--ground); }
.auth-col { width: 100%; max-width: 440px; }
.auth-col h1 { font-size: clamp(32px, 3.4vw, 40px); margin-bottom: var(--s3); }
.auth-lede { font-size: 19px; color: var(--ink-2); margin-bottom: var(--s6); }
.auth-col .help { margin-top: var(--s2); }
.auth-aside { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line); color: var(--muted); font-size: 16px; }
.auth-actions { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s5); }
.auth-actions form { margin: 0; }
.status-note { background: var(--surface-2); color: var(--ink); border-left: 4px solid var(--ink-2); border-radius: var(--radius); padding: var(--s2) var(--s4); margin: 0 0 var(--s6); font-size: 16px; }
button.wide, .button.wide { width: 100%; min-height: 52px; }
.nowrap-any { overflow-wrap: anywhere; }
.signin-card { max-width: 620px; margin: var(--s8) auto; padding: var(--s8); }
@media (prefers-color-scheme: dark) {
  .masthead { background: #161514; border-right: 1px solid var(--line); }
}
/* Between the phone layout and wide desktops the masthead is narrow: less padding, and each
   call-sheet label sits above its value so nothing overflows or wraps into a thin column. */
@media (min-width: 861px) and (max-width: 1180px) {
  .masthead { padding: var(--s8) var(--s6); }
  .ms-frame { padding: var(--s6) var(--s4); }
  .ms-sheet, .ms-sheet > div { grid-template-columns: minmax(0, 1fr); }
  .ms-sheet > div { row-gap: 0; }
}
@media (max-width: 860px) {
  .callsheet { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .masthead { padding: var(--s4) var(--s5); border-right: 0; border-bottom: 3px solid var(--brand-red); }
  .ms-frame { padding: 0; display: flex; align-items: baseline; gap: var(--s3); max-width: none; }
  .ms-frame::before, .ms-frame::after, .ms-sheet, .ms-line { display: none; }
  .ms-wordmark { font-size: 32px; }
  .ms-studio { font-size: 16px; margin: 0; letter-spacing: 0.22em; }
  .auth-panel { align-items: flex-start; justify-content: center; padding: var(--s6) var(--s5) var(--s10); }
  .signin-card { margin: var(--s4); padding: var(--s6); }
}

/* page furniture */
.subnav { gap: var(--s5); margin: calc(-1 * var(--s3)) 0 var(--s6); }
.subnav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.subnav a[aria-current] { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 6px; }
a.statlink { text-decoration: none; color: inherit; }
a.statlink:hover { border-color: var(--ink-2); }
.remove-access { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }

/* filters */
.filters { align-items: flex-end; margin-bottom: var(--s6); }
.filters .field { min-width: 180px; flex: 1 1 180px; max-width: 280px; }
.filters label.check { min-height: 48px; padding: 0; align-items: center; }

/* item stages (words always shown with the colour) */
.pill.s-idea, .pill.s-in_production, .pill.s-captioning, .pill.s-draft { background: var(--surface-2); color: var(--ink-2); }
.pill.s-scheduled, .pill.s-manual_pending { background: var(--accent-soft); color: var(--accent); }
.pill.s-manual_done, .pill.s-published { background: var(--success-soft); color: var(--success); }
.pill.s-missed { background: var(--danger-soft); color: var(--danger); }
.pill.s-skipped { background: var(--surface-2); color: var(--muted); }

/* calendar week */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s3); }
@media (max-width: 1100px) { .week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .week { grid-template-columns: 1fr; } }
.day { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s3); min-width: 0; }
.day.today { border: 2px solid var(--gold); }
.day-head { font-size: 17px; margin: 0 0 var(--s3); display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; }
.day-head span { font-weight: 500; color: var(--muted); }
.entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.entry > a, .entry > div { display: flex; flex-direction: column; gap: 2px; padding: var(--s2) var(--s3); border-radius: var(--radius); border-left: 5px solid var(--pc); background: var(--surface-2); color: var(--ink); text-decoration: none; min-height: 48px; }
.entry > a:hover { outline: 2px solid var(--ink-2); }
.entry.open > a, .entry.open > div { background: transparent; border: 1.5px dashed var(--line); border-left: 5px solid var(--pc); color: var(--muted); }
.e-top { font-size: 14px; display: flex; gap: var(--s2); align-items: baseline; }
.e-time { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.e-pillar { font-weight: 700; }
.e-title { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.entry .pill { align-self: flex-start; font-size: 12px; padding: 1px 8px; }

/* post page */
.next-step { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); background: var(--gold-soft); border-color: transparent; }
.next-step p { margin: 0; }
.variant { margin-bottom: var(--s5); border-left: 5px solid var(--line); }
.variant.s-in_review { border-left-color: var(--gold); }
.variant.s-changes_requested, .variant.s-failed, .variant.s-missed { border-left-color: var(--danger); }
.variant.s-approved, .variant.s-scheduled, .variant.s-manual_done, .variant.s-published { border-left-color: var(--success); }
.variant.s-manual_pending { border-left-color: var(--accent); }
.v-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.v-head h2 { margin: 0; }
.variant details, .review-item details { margin-top: var(--s4); }
details > summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
details[open] > summary { margin-bottom: var(--s3); }
.variant .row input[type=url], .variant .row input[type=text], .variant .row input[type=datetime-local] { flex: 1 1 260px; width: auto; }
.problems { background: var(--danger-soft); border-radius: var(--radius); padding: var(--s3) var(--s3) var(--s3) var(--s8); margin: var(--s4) 0 0; font-size: 16px; }
.decide { display: flex; gap: var(--s4); align-items: flex-start; flex-wrap: wrap; margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--line); }
.decide details { flex: 1 1 260px; margin: 0; }
.caption-text { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 64ch; font-size: 18px; }
.tags { color: var(--accent); overflow-wrap: anywhere; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }
.plat-row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.plat-row label.check { flex: 0 0 160px; }
.plat-row select { flex: 1 1 200px; width: auto; }
.note-inline { background: var(--gold-soft); border-radius: var(--radius); padding: var(--s3) var(--s4); margin: 0; }
.review-version { padding-top: var(--s4); margin-top: var(--s4); border-top: 1px solid var(--line); }
.review-item { margin-bottom: var(--s5); }
.pill.big { font-size: 16px; padding: 6px 14px; }

/* one-tap approval page: phone first, big buttons */
.quick { max-width: 640px; margin: 0 auto; }
.quick h1 { margin-top: var(--s2); }
button.big { width: 100%; min-height: 56px; font-size: 19px; }
.approve-all { margin: var(--s5) 0; }
.review-version-card { margin-bottom: var(--s4); }
.review-version-card form { margin-top: var(--s4); }

/* Today: a daily production sheet. Fine rules, gold metadata, red only where something needs a person. */
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; padding-bottom: var(--s4); margin-bottom: var(--s5); border-bottom: 2px solid var(--ink); }
.sheet-date { font-size: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--warn); margin: 0 0 var(--s1); }
.sheet-title { font-family: var(--display); font-weight: 700; font-size: clamp(44px, 6vw, 64px); line-height: 1; letter-spacing: 0.01em; margin: 0 0 var(--s2); }
.sheet-head .small { margin: 0; }
.tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); margin-bottom: var(--s2); }
.tally-item { display: flex; align-items: baseline; gap: var(--s3); padding: var(--s3) var(--s4) var(--s3) 0; min-height: 56px; color: var(--ink); text-decoration: none; border-right: 1px solid var(--line); margin-right: var(--s4); }
.tally-item:last-child { border-right: 0; margin-right: 0; }
.tally-n { font-family: var(--display); font-weight: 600; font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; }
.tally-l { font-size: 16px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--control-border); text-underline-offset: 4px; }
.tally-item:hover .tally-l { text-decoration-color: currentColor; }
.tally-item.hot .tally-n { color: var(--danger); }
.tally-note { font-size: 15px; color: var(--muted); margin-bottom: var(--s8); }
@media (max-width: 760px) {
  .tally { grid-template-columns: 1fr 1fr; }
  .tally-item { margin-right: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .tally-item:nth-child(odd) { border-right: 1px solid var(--line); margin-right: var(--s3); }
  .tally-item:nth-last-child(-n+2) { border-bottom: 0; }
  .tally-n { font-size: 30px; }
}
.sheet-section { margin-bottom: var(--s10); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: var(--s2); margin-bottom: var(--s3); }
.section-head h2 { margin: 0; }
.section-head a { min-height: 44px; display: inline-flex; align-items: center; }
.sub-head { font-size: 18px; margin: var(--s6) 0 var(--s2); }
.work { list-style: none; margin: 0; padding: 0; }
.work-row { display: flex; justify-content: space-between; align-items: center; gap: var(--s3) var(--s5); padding: var(--s4) 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.work-row:last-child { border-bottom: 0; }
.work-main { flex: 1 1 320px; min-width: 0; }
.work-main .pill { margin-right: var(--s2); vertical-align: 2px; }
.work-title { font-weight: 700; font-size: 18px; color: var(--ink); overflow-wrap: anywhere; }
.work-meta { margin: var(--s1) 0 0; font-size: 16px; color: var(--muted); }
.work-why { margin: var(--s1) 0 0; font-size: 16px; color: var(--ink-2); }
.work.compact .work-row { padding: var(--s3) 0; }
.work-row.r-failed, .work-row.r-missed { border-left: 4px solid var(--danger); padding-left: var(--s3); }
.slot-time { font-weight: 700; font-variant-numeric: tabular-nums; margin-right: var(--s2); }
.empty-note { color: var(--ink-2); background: var(--surface-2); border-radius: var(--radius); padding: var(--s3) var(--s4); }
.empty-note.good { background: var(--success-soft); }
.view-all { margin: var(--s3) 0 0; font-weight: 600; }
.view-all a { min-height: 44px; display: inline-flex; align-items: center; }
.gap { border: 1.5px solid var(--gold); border-radius: var(--radius-lg); padding: var(--s4) var(--s5); background: var(--gold-soft); }
.gap-lead { font-size: 19px; margin-bottom: var(--s1); }
.slots { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.slots li { display: flex; align-items: center; gap: var(--s2) var(--s3); padding: var(--s2) 0; border-top: 1px solid rgba(122, 90, 0, 0.25); flex-wrap: wrap; }
.slot-what { flex: 1 1 220px; }

/* Phones: the first piece of work comes before the summary counts. */
@media (max-width: 760px) {
  .sheet-body { display: flex; flex-direction: column; }
  .sheet-body > #attention { order: 1; }
  .sheet-body > .tally-wrap { order: 2; margin-bottom: var(--s8); }
  .sheet-body > #today { order: 3; }
  .sheet-body > .mine-alerts { order: 4; }
  .sheet-head { margin-bottom: var(--s4); }
  .sheet-head .button.primary { min-height: 48px; }
}
/* Narrow phones: the header must fit on one line beside the menu button. */
@media (max-width: 420px) {
  .top .env-badge { display: none; }
  .top { gap: var(--s2); padding: var(--s2) var(--s3); }
  .nav-menu > summary { padding: 0 var(--s3); }
}

/* Desktop: a charcoal sidebar replaces the top bar for signed-in pages. Phones and tablets keep
   the compact header with its Menu. */
.sidebar { display: none; }
@media (min-width: 1000px) {
  body.signed-in { padding-left: 232px; }
  body.signed-in .top, body.signed-in .strip { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: var(--s5); position: fixed; inset: 0 auto 0 0; width: 232px; overflow-y: auto;
             background: #141210; color: #F4F1EA; padding: var(--s5) var(--s4) var(--s4); border-right: 3px solid var(--brand-red); z-index: 10; }
  .side-brand { display: flex; flex-direction: column; text-decoration: none; color: #F4F1EA; padding: var(--s1) var(--s2) var(--s4); border-bottom: 1px solid rgba(227, 179, 65, 0.45); }
  .side-brand .wordmark { font-size: 30px; color: #F4F1EA; }
  .side-studio { font-family: var(--display); font-weight: 500; font-size: 15px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); margin-top: var(--s1); display: flex; gap: var(--s2); align-items: center; }
  .side-group { display: flex; flex-direction: column; }
  .side-heading { font-size: 14px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #C9C2B6; margin: 0 var(--s2) var(--s1); }
  .side-group a { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 48px; padding: 0 var(--s3); border-radius: var(--radius);
                  color: #F4F1EA; text-decoration: none; font-weight: 500; font-size: 17px; border-left: 3px solid transparent; }
  .side-group a:hover { background: rgba(244, 241, 234, 0.08); }
  .side-group a[aria-current] { background: rgba(227, 179, 65, 0.14); border-left-color: var(--gold); color: #FFFFFF; font-weight: 700; }
  .side-group .n { background: var(--brand-red); color: #fff; border-radius: 999px; font-size: 13px; font-weight: 700; padding: 0 8px; line-height: 1.7; }
  .sidebar :focus-visible { outline-color: var(--gold); }
  .side-account { margin-top: auto; border-top: 1px solid rgba(244, 241, 234, 0.18); padding: var(--s3) var(--s2) 0; }
  .side-who { font-size: 16px; margin: 0 0 var(--s1); color: #F4F1EA; }
  .side-who span { color: #C9C2B6; font-size: 15px; }
  .side-account button.linklike { color: var(--gold); min-height: 48px; font-size: 17px; }
  html { scroll-padding-top: var(--s5); }
}
@media (min-width: 1000px) and (prefers-color-scheme: dark) { .sidebar { background: #161514; } }

/* Calendar: a month of compact daily summaries; the chosen date opens the day panel. */
body.wide main { max-width: none; }
.cal-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); align-items: start; }
.cal-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3) var(--s5); flex-wrap: wrap;
               border-bottom: 2px solid var(--ink); padding-bottom: var(--s3); margin-bottom: var(--s3); }
.cal-nav { display: flex; gap: var(--s2); flex-wrap: wrap; }
.cal-filters { margin-bottom: var(--s3); }
.cal-filters > summary { min-height: 48px; display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; font-weight: 600; color: var(--accent); }
.cal-filters .filters { margin: var(--s2) 0 var(--s3); }
.clear-link { min-height: 48px; display: inline-flex; align-items: center; font-weight: 600; }
.cal-legend { font-size: 15px; color: var(--muted); margin-bottom: var(--s3); max-width: none; }
.phone-only { display: none; }
.month { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); }
.month th { text-align: left; font-size: 14px; padding: var(--s2) var(--s2); background: var(--surface-2); }
.month td { padding: 0; border: 1px solid var(--line); vertical-align: top; height: 112px; }
.month td.outside { background: var(--ground); }
.month td.outside .cell-date { color: var(--muted); font-weight: 500; }
.cell { display: flex; flex-direction: column; gap: 2px; height: 100%; min-height: 112px; padding: var(--s2); color: var(--ink); text-decoration: none; }
.cell:hover { background: var(--surface-2); }
.cell-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s1); margin-bottom: var(--s1); }
.cell-date { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.today-tag { font-size: 13px; font-weight: 700; background: var(--ink); color: var(--surface); border-radius: 999px; padding: 0 8px; }
.cell-line { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.cell-line.open { color: var(--muted); }
.cell-line.hot, .hot-text { color: var(--danger); font-weight: 700; }
.tok { font-size: 13px; font-weight: 700; padding: 0 4px; border-radius: 4px; background: var(--surface-2); }
.tok.hot { color: var(--danger); }
.tok.short { display: none; }
td.is-today .cell-date { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; text-decoration-color: var(--gold); }
td.is-selected { outline: 3px solid var(--ink); outline-offset: -3px; }
td.is-selected .cell { background: var(--gold-soft); }
.day-panel { background: var(--surface); border: 1px solid var(--control-border); border-radius: var(--radius-lg); padding: var(--s5); }
.dp-head { border-bottom: 2px solid var(--ink); padding-bottom: var(--s3); margin-bottom: var(--s4); }
.dp-head h2 { font-size: 26px; margin: 0 0 var(--s3); }
.dp-nav { display: flex; gap: var(--s2); flex-wrap: wrap; }
.dp-summary { font-size: 17px; }
.dp-post { border-top: 1px solid var(--line); padding: var(--s4) 0; }
.dp-post h3 { font-size: 19px; margin: 0; }
.dp-post h3 a { color: var(--ink); }
.dp-media { font-size: 16px; margin: var(--s2) 0; }
.dp-versions { list-style: none; margin: 0 0 var(--s2); padding: 0; }
.dp-versions li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); padding: var(--s2) 0; border-top: 1px dashed var(--line); font-size: 16px; }
.dp-v-name { font-weight: 600; }
.dp-v-caption { color: var(--ink-2); }
.dp-v-why { color: var(--danger); font-weight: 700; }
.past-slots { margin-top: var(--s4); }
.past-slots > summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--accent); }
.day-panel .slots li { border-top-color: var(--line); }
.dp-add { margin-top: var(--s4); font-weight: 600; }
/* Wide desktops: dock the day panel beside the month. Narrower: the day becomes a full-width view
   with Close back to the month (no JavaScript needed). */
@media (min-width: 1440px) {
  .cal-page.has-day { grid-template-columns: minmax(0, 1fr) minmax(400px, 460px); }
  .cal-page.has-day .day-panel { position: sticky; top: var(--s5); max-height: calc(100vh - 40px); overflow-y: auto; }
}
@media (max-width: 1439px) {
  .cal-page.has-day .cal-main { display: none; }
}
/* Phones: compact cells with short labelled tokens; the legend explains them. */
@media (max-width: 700px) {
  .cell-line.full { display: none; }
  .tok.short { display: inline-block; align-self: flex-start; }
  .phone-only { display: inline; }
  .phone-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .dp-nav, .cal-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .day-panel .slots li { flex-wrap: nowrap; align-items: center; }
  .day-panel .slots .slot-what { flex: 1 1 auto; min-width: 0; font-size: 16px; }
  .day-panel .slots .button.small { flex: none; padding: var(--s2) var(--s3); }
  .month td { height: 76px; }
  .cell { min-height: 76px; padding: 4px 3px; }
  .cell-date { font-size: 16px; }
  .today-tag { display: none; }
  .month th { padding: var(--s1); font-size: 13px; text-align: center; }
  .day-panel { padding: var(--s4); border-radius: var(--radius); }
}

.day-panel { border-color: var(--line); }

/* A full-width day view keeps a readable line length. */
@media (max-width: 1439px) { .cal-page.has-day .day-panel { max-width: 780px; } }
