/* App screens. The "BRUT." look (ADR-0020): white paper, black rules, square boxes, one brand colour (docs/11-ui-ux.md §1).
   The Brut layer at the end of this file sets the shared components; earlier rules give each screen its layout. */
/* `hidden` always wins over a layout class (.row, .title-box…) that sets display. */
[hidden] { display: none !important; }

/* Header */
#shell { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-top: var(--space-2); padding-bottom: var(--space-2); }
.wordmark { font-style: italic; font-size: 1.35rem; text-decoration: none; white-space: nowrap; flex-shrink: 0; color: var(--brand-fg); font-weight: 600; letter-spacing: -0.01em; }
.bar-right { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.langs { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); padding: 2px; }
.langs button { min-height: 30px; min-width: 38px; padding: 0 var(--space-2); border: 0; border-radius: var(--pill); font-size: 0.8rem; background: transparent; }
.langs button[aria-pressed='true'] { background: var(--brand); color: var(--brand-ink); }
.account { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--ink); max-width: 18ch; min-width: 0; text-decoration: none; }
.account .avatar { flex: none; }
.account .account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.4rem; }
.dev-btn { display: inline-flex; align-items: center; min-height: 30px; padding: 0 var(--space-2); border-radius: var(--pill); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-decoration: none;
  background: var(--ink); color: var(--paper); }
.dev-btn:hover, .dev-btn[aria-current='page'] { background: var(--brand); color: var(--brand-ink); }
@media (max-width: 560px) {
  .bar-right { gap: var(--space-1); }
  .langs button { min-width: 30px; padding: 0 4px; }
  .account .account-name { display: none; }
}
.project-bar { padding-top: 0; padding-bottom: 0; }
.project-head { display: flex; align-items: baseline; gap: var(--space-2) var(--space-3); flex-wrap: wrap; padding-top: var(--space-1); }
.project-title { font-size: 1.4rem; text-decoration: none; letter-spacing: -0.01em; }
.stage-badge { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; color: var(--brand-fg); }
.tabs { display: flex; gap: var(--space-4); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { text-decoration: none; color: var(--muted); padding: var(--space-2) 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current='page'] { color: var(--brand-fg); border-bottom-color: var(--brand-fg); }

main.wrap { padding-top: var(--space-4); padding-bottom: var(--space-6); }
/* Every project page is the same width (the widest), header and tabs included, so moving between tabs never changes
   their size; the scrollbar's space is always kept so a longer page doesn't shift them either. */
html { scrollbar-gutter: stable; }
main.wrap.wide, body:has(.project-bar) main.wrap, body:has(main.wide) #shell .wrap, body:has(.project-bar) #shell .wrap { max-width: 1240px; }
.lede { font-size: var(--text-lg); color: var(--muted); }
.lede.brand { color: var(--brand-fg); font-style: italic; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.head h1, .head h2 { margin: 0; }

/* Forms */
form { display: grid; gap: var(--space-3); max-width: 460px; }
label { display: grid; gap: var(--space-1); font-size: var(--text-sm); color: var(--muted); }
label.check { display: flex; align-items: center; gap: var(--space-2); color: var(--ink); font-size: var(--text-base); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  min-height: var(--tap); padding: 0 var(--space-3); width: 100%;
}
textarea { padding: var(--space-2) var(--space-3); min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-fg); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type=checkbox], input[type=radio] { width: 18px; min-height: 18px; accent-color: var(--brand); }
input.code { font-family: var(--font-script); font-size: var(--text-xl); letter-spacing: 0.4em; text-align: center; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3); margin: 0; display: grid; gap: var(--space-3); background: var(--surface); }
legend { padding: 0 var(--space-1); font-weight: 600; color: var(--ink); }
.hint { font-size: var(--text-sm); color: var(--muted); margin: 0; }
[data-field-error], [data-form-error] { color: var(--accent); font-size: var(--text-sm); min-height: 0; }
[data-form-error]:empty, [data-field-error]:empty { display: none; }

button.primary, .button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand-fg); box-shadow: none; }
button.primary:hover, .button.primary:hover { opacity: 0.9; color: var(--brand-ink); }
button.soft, .button.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-fg); }
button:disabled { opacity: 0.5; cursor: default; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); border-style: dashed; cursor: not-allowed; }
.button { display: inline-flex; cursor: pointer; background: var(--surface); color: inherit; font: inherit; align-items: center; gap: var(--space-1); min-height: var(--tap); padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; }
.button:hover { border-color: var(--brand-fg); }
button.link { border: 0; padding: 0; min-height: 0; background: none; text-decoration: underline; text-underline-offset: 3px; color: var(--muted); }
button.danger, .link.danger { color: var(--accent); }
.actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list > li { border-bottom: 1px solid var(--line); padding: var(--space-2) 0; }
.list a.item { display: block; text-decoration: none; }
/* Script versions (writers' room History / To review): one line each, the changes open underneath */
.rev-list > li.rev-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); padding: var(--space-1) var(--space-2); }
.rev-row.on { background: var(--brand-soft); }
.rev-row > .rev-acts { margin-left: auto; display: flex; gap: var(--space-2); align-items: baseline; }
.rev-row > .rev-changes { flex-basis: 100%; }
.item-main { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.item-title { font-size: var(--text-lg); }
.item-meta { color: var(--muted); font-size: var(--text-sm); }
.tag { font-size: 0.78rem; color: var(--muted); border: 1px solid var(--line); border-radius: var(--pill); padding: 0 var(--space-2); white-space: nowrap; background: var(--surface); }
.tag.strong { color: var(--brand-fg); border-color: transparent; background: var(--brand-soft); }
.group-title { font-size: 0.72rem; color: var(--brand-fg); text-transform: uppercase; letter-spacing: 0.14em; margin: var(--space-4) 0 var(--space-2); font-weight: 600; }

/* Panels: soft cards */
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3) var(--space-4); margin: var(--space-3) 0; background: var(--surface); box-shadow: var(--shadow); }
.panel h2, .panel h3 { margin-bottom: var(--space-2); }
.notice { border: 1px solid color-mix(in srgb, var(--brand-fg) 25%, transparent); border-left: 4px solid var(--brand-fg); background: var(--brand-soft); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); margin: var(--space-4) 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.share-url { font-family: var(--font-script); font-size: var(--text-sm); word-break: break-all; background: transparent; border: 1px dashed var(--line); padding: var(--space-2); border-radius: var(--radius-sm); }

/* Price cards on new-project */
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-2); }
.types label { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3); color: var(--ink); cursor: pointer; }
.types input { position: absolute; opacity: 0; width: 0; min-height: 0; }
.types label:has(input:checked) { border-color: var(--brand-fg); box-shadow: inset 0 0 0 1px var(--brand-fg); background: var(--brand-soft); }
.types label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.types .price { color: var(--muted); font-size: var(--text-sm); }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: var(--space-4); max-width: min(480px, calc(100vw - 32px)); box-shadow: var(--shadow-lift); }
dialog::backdrop { background: rgb(40 28 18 / 0.35); }
/* askConfirm / askText / tell (core/dialog.js): a small modal in place of the browser's alert, confirm and prompt. */
dialog.ask-dialog { width: min(440px, calc(100vw - 32px)); }
.ask-dialog form { display: grid; gap: var(--space-3); max-width: none; }
.ask-dialog .ask-message { margin: 0; font-size: var(--text-base); line-height: 1.5; white-space: pre-line; color: var(--ink); }
.ask-dialog .ask-head { display: flex; align-items: center; gap: var(--space-2); }
.ask-dialog .ask-title { margin: 0; font-size: var(--text-xl); }
.ask-dialog .ask-icon { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-weight: 700; font-size: 1.25rem;
  background: var(--brand-soft); color: var(--brand-fg); }
.ask-dialog .ask-warn .ask-icon { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }
.ask-dialog .ask-danger .ask-icon { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); color: var(--accent); }
.ask-dialog .ask-publish .ask-icon { background: var(--brand); color: var(--brand-ink); }
dialog.ask-dialog { padding: var(--space-4); border-radius: calc(var(--radius) + 4px); }
.ask-dialog .actions { padding-top: var(--space-2); border-top: 1px solid var(--line); }
.ask-dialog .actions { justify-content: flex-end; }
.ask-dialog .danger-button, button.danger-fill { background: var(--accent); border-color: var(--accent); color: var(--brand-ink); }
button.danger-fill:hover { filter: brightness(0.92); }
.cast-facts .danger-fill { margin-top: var(--space-2); }

@media (max-width: 480px) {
  .row { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: 0 0; }
  .facts dd { margin-bottom: var(--space-2); }
}

/* ---- Phase 2: scenes, days, locations ---- */
.nowrap { white-space: nowrap; }
.scene-no { display: inline-block; min-width: 2.5ch; font-family: var(--font-script); }
.scene-line { font-family: var(--font-script); font-size: 0.95rem; text-transform: uppercase; }
.strips > li, .scene-head { border-left: 4px solid var(--line); padding-left: var(--space-3); }
.strip-int-day { border-left-color: var(--strip-int-day) !important; }
.strip-ext-day { border-left-color: var(--strip-ext-day) !important; }
.strip-int-night { border-left-color: var(--strip-int-night) !important; }
.strip-ext-night { border-left-color: var(--strip-ext-night) !important; }
.strip-twilight { border-left-color: var(--strip-twilight) !important; }
.strip-banner { border-left: 4px dashed var(--muted) !important; }
.scene-head h1 { font-family: var(--font-script); font-size: var(--text-lg); font-weight: 700; text-transform: uppercase; }
.scene-head .scene-no { font-size: var(--text-xl); margin-right: var(--space-2); }

.pager { display: flex; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); font-size: var(--text-sm); }
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2); max-width: none; margin-bottom: var(--space-3); }
.filters input[type=search] { flex: 1 1 200px; }
.filters select { flex: 0 1 auto; width: auto; }
/* Compact filters (Master breakdown): one tight row of small controls. */
.compact-filters { gap: var(--space-1) var(--space-2); align-items: center; }
.compact-filters input, .compact-filters select { min-height: 34px; padding: 2px 8px; font-size: var(--text-sm); }
.compact-filters input[type=search] { flex: 1 1 180px; max-width: 280px; }
.compact-filters select { max-width: 170px; }
.compact-filters label.check { font-size: var(--text-sm); }
/* Stripboard: one compact bar (unit, highlights, then the actions), a day at a time with a pager, the boneyard and
   conflicts beside it. */
.board-bar select { width: auto; max-width: 190px; min-height: 34px; padding: 2px 8px; font-size: var(--text-sm); }
.board-bar .board-actions { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: var(--space-1); }
.board-sel { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-height: 34px; margin-bottom: var(--space-2); }
.board-sel select { width: auto; min-height: 32px; font-size: var(--text-sm); }
/* The days: one bordered panel (its top in line with the boneyard's) — filters, then the days as scrollable tabs,
   then the day. A 120-day shoot shows the days not shot yet, 30 at a time. */
.day-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; min-width: 0; }
.day-panel-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); padding: var(--space-1) var(--space-2); background: var(--surface-2); border-bottom: 1px solid var(--line); min-height: 40px; font-size: var(--text-sm); }
.day-panel-bar select { width: auto; min-height: 30px; font-size: var(--text-sm); }
.day-panel-bar .day-nav { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; }
.day-panel-bar .link.on { font-weight: 700; }
.day-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.day-tab { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0; min-width: 76px; min-height: 48px; padding: 4px var(--space-2);
  border: 0; border-radius: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: var(--text-sm); line-height: 1.2; }
.day-tab small { font-size: 0.7rem; }
.day-tab.on { background: var(--brand-soft); color: var(--ink); box-shadow: inset 0 -3px 0 var(--brand-fg); }
.day-tab.crit:not(.on) strong { color: var(--accent); }
.day-tab.shot { opacity: 0.6; }
.day-tab.over { outline: 2px dashed var(--brand-fg); outline-offset: -3px; }
.day-tab .tab-dot { position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.day-panel-body { padding: var(--space-2); }
.day-panel-body .bday { margin-bottom: 0; }
.day-panel-body .bday + .bday { margin-top: var(--space-3); }
/* The board changed since the Prelim: regenerate it */
.prelim-stale { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); justify-content: space-between; border: 1px solid var(--warn); border-left-width: 6px; border-radius: var(--radius); padding: var(--space-1) var(--space-3); margin-bottom: var(--space-3); background: var(--surface); font-size: var(--text-sm); }
.b-changed { color: var(--warn); font-weight: 700; }
.bstrip.since-prelim { box-shadow: inset -3px 0 0 var(--warn); }
.board-changes .changes-seg { margin-bottom: var(--space-2); display: flex; } .board-changes .changes-seg button { flex: 1; min-height: 30px; font-size: var(--text-sm); }
.change-list { list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); }
.change-list > li { display: flex; flex-direction: column; padding: 6px 0 6px var(--space-2); border-left: 3px solid var(--line); margin-bottom: 4px; }
.change-list > li.ch-moved, .change-list > li.ch-scheduled { border-left-color: var(--brand-fg); }
.change-list > li.ch-unscheduled, .change-list > li.ch-day_removed, .change-list > li.ch-removed { border-left-color: var(--warn); }
.change-list > li.ch-prelim, .change-list > li.ch-generated { border-left-color: var(--ok); font-weight: 600; }
.b-ep { display: inline-block; margin-right: 4px; padding: 0 4px; border-radius: 0; background: var(--brand-soft); color: var(--brand-fg); font-weight: 700; font-family: var(--font-ui); }
.board-side { display: flex; flex-direction: column; gap: var(--space-3); position: sticky; top: var(--space-3); max-height: calc(100vh - 2 * var(--space-3)); overflow: auto; }
.board-side .boneyard { position: static; max-height: 60vh; overflow: auto; }
/* Scheduler: every sub-tab (Master breakdown, Board, Prelim — and the day, call sheet and DOOD opened from them) starts
   with the same title and sub-tabs, then one bar: the page's name on the left (when it has its own), actions right. */
.sched-head .head { margin-bottom: 0; }
.tabs .tab-off { color: var(--muted); opacity: 0.5; cursor: not-allowed; padding: var(--space-2) 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.sched-head .inner-tabs { margin-bottom: var(--space-2); }
.sched-bar, .board-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: var(--space-2) 0 var(--space-3); min-height: 36px; }
.sched-bar > h2 { margin: 0; font-size: var(--text-lg); }
.sched-bar > .hint { margin: 0; flex: 1 1 280px; }
.sched-bar > .actions { margin-left: auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
/* Boneyard | Conflicts in one bordered panel */
.side-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.side-panel-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.side-panel-tabs > button { flex: 1; border: 0; border-radius: 0; min-height: 40px; background: transparent; font-weight: 600; color: var(--muted); }
.side-panel-tabs > button + button { border-left: 1px solid var(--line); }
.side-panel-tabs > button[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: inset 0 -3px 0 var(--brand-fg); }
.side-panel-tabs > button.has-crit .count-soft { color: var(--accent); font-weight: 700; }
.side-panel > [data-sidepanel] { padding: var(--space-2); }
.side-panel .boneyard { max-height: 65vh; }
/* After a move that runs into conflicts */
.move-alert { border: 1px solid var(--warn); border-left-width: 6px; border-radius: var(--radius); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); background: var(--surface); }
.move-alert.critical { border-color: var(--accent); }
.move-alert.critical > strong { color: var(--accent); }
.move-alert .conflicts { font-size: var(--text-sm); margin: var(--space-1) 0; }
.move-alert .actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
@media (max-width: 900px) { .board-side { position: static; max-height: none; } }
.board-conflicts h2 { font-size: var(--text-lg); margin: 0 0 var(--space-1); }
.board-conflicts .conflicts { font-size: var(--text-sm); }
.board-conflicts details summary { cursor: pointer; color: var(--muted); font-size: var(--text-sm); }
form.inline { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; max-width: none; margin-top: var(--space-2); }
form.inline input:not([type=checkbox]) { flex: 1 1 160px; width: auto; }
form.inline select { width: auto; }
form.wrap-row { align-items: end; }
form.wrap-row label { flex: 1 1 140px; }
input.qty { width: 7ch; flex: 0 0 auto !important; }

.chips { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { display: inline-flex; align-items: center; gap: var(--space-1); border: 1px solid var(--line); border-radius: var(--pill); padding: 2px var(--space-3); font-size: var(--text-sm); }
.chip button.link { font-size: var(--text-base); line-height: 1; }

.media { list-style: none; padding: 0; margin: var(--space-2) 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); }
.media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); display: block; }
.media .doc { display: grid; place-items: center; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); }
.file-btn { cursor: pointer; }
.upload-row { margin-bottom: var(--space-2); }

.rev-chip { display: inline-block; width: 10px; height: 10px; border-radius: 0; border: 1px solid var(--muted); margin-right: var(--space-2); vertical-align: middle; }
.rev-white, .rev-double_white { background: #ffffff; } .rev-blue, .rev-double_blue { background: #9ec5f0; } .rev-pink, .rev-double_pink { background: #f5b8c9; }
.rev-yellow, .rev-double_yellow { background: #f3e27a; } .rev-green, .rev-double_green { background: #a9d9a0; } .rev-goldenrod { background: #daa520; }
.rev-buff { background: #f0dc82; } .rev-salmon { background: #fa8072; } .rev-cherry { background: #de3163; }

.table-wrap { overflow-x: auto; margin: 0 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table-wrap table tr:last-child td { border-bottom: 0; }
table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; padding: var(--space-2); border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
td { padding: var(--space-1) var(--space-2); border-bottom: 1px solid var(--line); vertical-align: middle; }
table input, table select { min-height: 36px; padding: 0 var(--space-2); font-size: var(--text-sm); }
table.review td:nth-child(3) input, table.review td:nth-child(6) input { min-width: 14ch; }
tr.needs td:first-child input { border-color: var(--accent); }
form#rv { max-width: none; }
.warnings { color: var(--muted); font-size: var(--text-sm); padding-left: var(--space-4); }

.tag.warn, .totals.warn { color: var(--accent); border-color: var(--accent); }
.panel.hospital.warn { border-color: var(--accent); }
.panel.hospital form { max-width: none; }
.picker { list-style: none; padding: 0; margin: 0; max-height: 50vh; overflow-y: auto; border-top: 1px solid var(--line); }
.picker li { border-bottom: 1px solid var(--line); padding: var(--space-2) 0; }
.picker .check { font-size: var(--text-sm); }
.day-strips { counter-reset: none; }
.comments .comment-body { white-space: pre-wrap; margin: var(--space-1) 0 0; }
section { margin-top: var(--space-5); }
table.review select { min-width: 9ch; }
table.review td:nth-child(4) select { min-width: 11ch; }

/* Alerts (notification centre) */
.alerts { font-size: var(--text-sm); color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: var(--space-1); min-height: 36px; }
.alerts[aria-current='page'] { color: var(--ink); }
.alerts .count { background: var(--accent); color: var(--paper); border-radius: var(--pill); padding: 0 6px; font-size: 0.75rem; line-height: 1.5; }
.notifs > li { display: grid; gap: var(--space-1); }
.notifs > li.unread .item-title { font-weight: 600; }
.notifs > li { padding-left: var(--space-3); border-left: 2px solid transparent; }
.notifs > li.unread { border-left-color: var(--accent); }
.notifs a.item { color: inherit; }
.notifs .prio-critical .item-title { color: var(--accent); }
.steps-list { margin: var(--space-1) 0 0; padding-left: var(--space-4); color: var(--muted); font-size: var(--text-sm); }
.rule { display: grid; gap: var(--space-2); }
.ios-steps { margin: var(--space-2) 0 0; padding-left: var(--space-4); }

/* Tasks & flags */
.flagb { font-size: 0.85em; white-space: nowrap; }
.flagb small { font-size: 0.75em; margin-left: 1px; }
.flagb.critical { color: var(--accent); }
.flagb.warning { color: var(--warn); }
.flag-list > li { padding: var(--space-2) 0; }
.tasks > li.closed .item-title { color: var(--muted); text-decoration: line-through; }
.tag-picks { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.tag-picks label.check { font-size: var(--text-sm); }
.task-title { font-size: var(--text-xl); }
.task-body { white-space: pre-wrap; }
.mention { font-weight: 600; }
.mention-list { list-style: none; margin: 0; padding: var(--space-1) var(--space-2); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.mention-list li { padding: 2px 0; }
.mention-list small { color: var(--muted); }
.crit-flags { border-left-color: var(--accent); }
.comment-body { white-space: pre-wrap; }

/* ---- Script depth: breakdown highlights, tagging bar, revision diffs ---- */
#scripttext mark.bd { cursor: pointer; }
.bd { color: inherit; background: color-mix(in srgb, var(--bd-c, var(--bd-other)) 22%, transparent); border-bottom: 1px solid var(--bd-c, var(--bd-other)); border-radius: 0; padding: 0; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.bd-cast { --bd-c: var(--bd-cast); } .bd-stunts { --bd-c: var(--bd-stunts); } .bd-background { --bd-c: var(--bd-background); }
.bd-props { --bd-c: var(--bd-props); } .bd-vehicles { --bd-c: var(--bd-vehicles); } .bd-animals { --bd-c: var(--bd-animals); }
.bd-sfx { --bd-c: var(--bd-sfx); } .bd-sound { --bd-c: var(--bd-sound); } .bd-music { --bd-c: var(--bd-music); }
.bd-set_dressing { --bd-c: var(--bd-set-dressing); } .bd-weapons { --bd-c: var(--bd-weapons); } .bd-vfx { --bd-c: var(--bd-vfx); }
.bd-greenery { --bd-c: var(--bd-greenery); } .bd-other { --bd-c: var(--bd-other); }
.bd-wardrobe { --bd-c: var(--bd-wardrobe); } .bd-hmu { --bd-c: var(--bd-hmu); } .bd-special_equipment { --bd-c: var(--bd-special); }
mark.bd-wardrobe { background: color-mix(in srgb, var(--bd-c) 16%, transparent); border: 1px solid var(--ink); border-radius: 2px; padding: 0; }
mark.bd-hmu { background: none; border-bottom: 1px dotted var(--ink); }
mark.bd-hmu::after { content: '*'; font-weight: 700; }
mark.bd-special_equipment { background: color-mix(in srgb, var(--bd-c) 16%, transparent); border: 1px dashed var(--ink); border-radius: 0; padding: 0; }
.swatch { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 0; vertical-align: -0.05em; margin-right: var(--space-1); background: var(--bd-c, var(--bd-other)); }
.swatch.bd-wardrobe { background: none; border: 1.5px solid var(--ink); border-radius: 50%; }
.swatch.bd-hmu { background: none; width: auto; height: auto; }
.swatch.bd-hmu::before { content: '*'; font-weight: 700; }
.swatch.bd-special_equipment { background: none; border: 1.5px solid var(--ink); border-radius: 0; }
.chip.missing { border-style: dashed; }

.tagbar { position: fixed; top: 12px; left: 12px; z-index: 20; width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; background: var(--surface); color: var(--ink); border: var(--bw) solid var(--line); box-shadow: var(--shadow-lift); padding: var(--space-3); }
.tagbar .row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; max-width: none; margin: 0; }
.tagbar input[name=name] { flex: 1 1 16ch; min-width: 0; font-family: var(--font-script); }
.tagbar .cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: var(--space-2); }
.tagbar .cats button { display: flex; align-items: center; gap: 6px; justify-content: flex-start; min-height: 38px; padding: 6px 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; }
.tagbar .cats button:hover { background: var(--ink); color: var(--paper); }
.tagbar .cats button[aria-pressed='true'], .tagbar .cats button[aria-pressed='true']:hover { background: var(--brand-soft); border-color: var(--line); color: var(--ink); }
.tagbar-check { display: inline-grid; place-items: center; flex: 0 0 auto; width: 14px; height: 14px; border: 1px solid var(--line); font-size: 11px; line-height: 1; }
.tagbar .cats button[aria-pressed='true'] .tagbar-check::after { content: '✓'; font-weight: 700; }
.tagbar .cats button[aria-pressed='true'] kbd { margin-left: 0; color: var(--muted); }
.tagbar .cats button kbd { margin-left: auto; }
.tagbar .cats select { min-height: 38px; }
.tagbar .cats .hint { grid-column: 1 / -1; margin: 0; }
.tagbar-hint { color: var(--muted); }
.tagbar kbd { font-family: var(--font-ui); font-size: 0.75em; color: var(--muted); margin-left: 0; }

.diff { white-space: pre-wrap; }
.diff ins { text-decoration: underline; text-decoration-thickness: 2px; background: color-mix(in srgb, var(--ok) 16%, transparent); }
.diff del { color: var(--muted); text-decoration: line-through; }
.changes > li { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); list-style: none; }
.changes { padding: 0; margin: 0; }
table.review tr.preview td { background: color-mix(in srgb, var(--line) 35%, transparent); }
table.review td.match { white-space: nowrap; }
table.review td.match select { min-width: 12ch; }
.rev-head { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: end; }
.rev-head label { margin: 0; }
details.history summary { cursor: pointer; }
@media (max-width: 640px) {
  .tagbar { width: calc(100vw - 24px); padding: var(--space-2); }
  .tagbar .cats { grid-template-columns: 1fr 1fr; }
}
@media (pointer: coarse) { .tagbar kbd { display: none; } }

/* ---- Safety ---- */
.tag.sev-serious, .tag.sev-critical { color: var(--accent); border-color: var(--accent); }
.tag.sev-moderate { color: var(--warn); border-color: var(--warn); }
ul.checklist { list-style: none; padding: 0; margin: 0 0 var(--space-3); }
ul.checklist li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); border-bottom: 1px solid var(--line); padding: var(--space-1) 0; }
.incident-form textarea { width: 100%; }
.subnav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); border-bottom: 1px solid var(--line); margin: 0 0 var(--space-4); padding-bottom: var(--space-2); }
.subnav a { text-decoration: none; color: var(--muted); }
.subnav a[aria-current='page'] { color: var(--brand-fg); font-weight: 600; }

/* ---- Billing ---- */
.billing-bar { font-size: var(--text-sm); padding-top: var(--space-2); padding-bottom: var(--space-2); border-top: 1px solid var(--line); }
.billing-bar.read_only { color: var(--accent); }
ul.pricing { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
ul.pricing > li { margin: 0; }
ul.pricing > li.featured { border-color: var(--brand-fg); box-shadow: inset 0 3px 0 var(--brand-fg); }
ul.pricing .price { font-size: var(--text-xl); margin: var(--space-2) 0 0; }
ul.pricing ul { padding-left: var(--space-4); font-size: var(--text-sm); }
.error { color: var(--accent); font-size: var(--text-sm); }
.error:empty { display: none; }

/* Multi-unit: each unit's day side by side (project home) */
.units-overview { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
.units-overview > li { margin: 0; border-left: 4px solid var(--unit, var(--line)); }
.units-overview h3 { margin: 0 0 var(--space-1); font-size: inherit; }
.units-overview p { margin: 0; }
.notice.status-degraded, .notice.status-down { border-color: var(--accent); color: var(--accent); }
.type-details { border-top: 1px solid var(--line); padding: var(--space-2) 0; }
.type-details summary { cursor: pointer; }
.type-details textarea { width: 100%; }
form.inline input[type=color] { flex: 0 0 44px; width: 44px; height: 36px; padding: 2px; }
form.inline .item-meta { white-space: nowrap; }
form.inline input.short { flex: 0 1 90px; }

/* Theme picker (/me) */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-2); }
.swatch { display: flex; align-items: center; gap: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2); cursor: pointer; background: var(--surface); }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; border: 0; }
.swatch span:last-child { font-size: var(--text-sm); line-height: 1.3; }
.swatch:has(input:checked) { border-color: var(--brand-fg); box-shadow: inset 0 0 0 1px var(--brand-fg); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--brand-fg); outline-offset: 2px; }
.swatch .chip { width: 36px; height: 24px; border-radius: 0; border: 1px solid var(--line); flex: none;
  background: linear-gradient(90deg, var(--sw-paper) 0 50%, var(--sw-brand) 50% 75%, var(--sw-ink) 75%); }

/* Project navigation: main tabs (Dashboard, the stages, Settings — or the portal's flat row), then the sub-tabs */
.tabs.stages { gap: var(--space-1); padding: var(--space-2) 0; }
.tabs.stages a { padding: 6px var(--space-3); border: 1px solid transparent; border-radius: var(--pill); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-size: 0.95rem; }
.tabs.stages a:hover { color: var(--brand-fg); background: color-mix(in srgb, var(--brand-soft) 60%, transparent); }
.tabs.stages a[aria-current='true'], .tabs.stages a[aria-current='page'] { color: var(--brand-fg); background: var(--surface); border-color: var(--line); font-weight: 600; box-shadow: none; }
.tabs.stages .tab-off { padding: 6px var(--space-3); border: 1px solid transparent; border-radius: var(--pill); display: inline-flex; align-items: center; gap: 6px; font-size: 0.95rem; }
.tabs.stages .now { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-ink); background: var(--accent); border-radius: var(--pill); padding: 0 6px; font-weight: 600; }
.tabs.subtabs { background: var(--surface); margin: 0 calc(-1 * var(--space-3)); padding: 0 var(--space-3); border-top: 1px solid var(--line); gap: var(--space-4); }
.tabs.subtabs a { font-size: var(--text-sm); padding: 10px 0; }
.project-bar { padding-bottom: 0; }

/* Script totals */
.stat-tiles { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.stat-tiles li { flex: 1 1 120px; padding: var(--space-2) var(--space-3); display: flex; flex-direction: column; gap: 0; border-right: 1px solid var(--line); margin: 0; }
.stat-tiles li:last-child { border-right: 0; }
.stat-tiles strong { font-size: 1.6rem; font-weight: 500; color: var(--ink); line-height: 1.2; letter-spacing: -0.01em; }
.stat-label { font-size: var(--text-sm); color: var(--muted); }
.stat-sub { font-size: 0.8rem; color: var(--muted); }
.stat-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }
.stat-lists h3 { font-size: var(--text-base); margin-bottom: var(--space-2); }
table.mini { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.mini td { padding: 4px 0; border-bottom: 1px solid var(--line); }
table.mini td.num { text-align: right; color: var(--muted); white-space: nowrap; }
.mode-note { font-size: var(--text-sm); }

/* Starting a project: step bar */
ol.steps { list-style: none; counter-reset: step; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); padding: 0; margin: 0 0 var(--space-4); font-size: var(--text-sm); color: var(--muted); }
ol.steps li { counter-increment: step; display: flex; align-items: center; gap: var(--space-1); }
ol.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); font-size: 0.75rem; }
ol.steps li.now { color: var(--ink); font-weight: 600; }
ol.steps li.now::before { background: var(--brand); border-color: var(--brand-fg); color: var(--brand-ink); }
ol.steps li.done::before { content: ''; background: var(--brand-soft); border-color: var(--brand-fg); color: var(--brand-fg); }

/* Preview after sign-up: the budget lines with amounts locked */
.locked { position: relative; }
.locked .blurred { filter: blur(5px); user-select: none; color: var(--muted); }
.locked tbody tr:nth-last-child(-n+3) { opacity: 0.35; }
.locked-more { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-5) var(--space-3) var(--space-2); text-align: center;
  background: linear-gradient(transparent, var(--paper) 55%); }
.locked-more p { margin: 0; font-weight: 600; color: var(--brand-fg); }
/* Starting a project: a glimpse of what we read — the first rows, then rows fading out (step 2 scenes, step 3 lists) */
tr.fade { user-select: none; pointer-events: none; }
tr.fade-1 { opacity: 0.55; }
tr.fade-2 { opacity: 0.35; filter: blur(0.5px); }
tr.fade-3 { opacity: 0.2; filter: blur(1px); }
tr.fade-4 { opacity: 0.1; filter: blur(1.5px); }
.glimpse-more { margin: var(--space-2) 0 0; color: var(--muted); font-style: italic; }
.upload-step input[type=file] { max-width: 100%; }
.script-cell { font-family: var(--font-script); font-size: 0.9rem; }

/* Demo: who do you want to be? */
.role-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-3); }
.role-cards li { margin: 0; }
.role-cards a.panel { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; height: 100%; text-decoration: none; }
.role-cards a.panel:hover { border-color: var(--brand-fg); }
.role-cards strong { color: var(--brand-fg); }
.demo-login { margin-top: var(--space-5); padding-top: var(--space-4); border-top: var(--bw) solid var(--line); }
.demo-login h2 { margin: 0 0 var(--space-1); }
.demo-login > .hint { margin-top: 0; }
.reading-panel .head { align-items: center; }
.reading-questions { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-2) 0; }
.reading-q { padding: var(--space-2); border: 1px solid var(--hair); }
.reading-q blockquote { margin: var(--space-1) 0; padding-left: var(--space-2); border-left: 3px solid var(--line); }
.reading-q p { margin: var(--space-1) 0; }
.reading-q input { width: 100%; }
.reading-busy { opacity: 0.45; }
.reading-loading { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0; font-weight: 700; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--hair); border-top-color: var(--ink); border-radius: 50%; display: inline-block; animation: os-spin 0.9s linear infinite; }
@keyframes os-spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) {
  .tabs.stages { gap: 2px; }
  .tabs.stages a { padding: var(--space-1) var(--space-2); font-size: var(--text-sm); }
  .tabs.stages .now { display: none; }
  .project-title { font-size: var(--text-base); }
}

/* ---------- Pre-production depth & post-production (2026-10-15) ---------- */
ul.tight { list-style: none; padding: 0; margin: 0 0 var(--space-2); }
ul.tight > li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
ul.tight > li:last-child { border-bottom: 0; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.inline-label { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ink); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-4); }
dialog.wide-dialog { width: min(720px, calc(100vw - 32px)); max-width: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); padding: var(--space-4); }
dialog.wide-dialog form { max-width: none; }
dialog::backdrop { background: rgb(0 0 0 / 0.35); }
tr.done td { color: var(--muted); }
tr.late td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.muted td { opacity: 0.55; }
.tag.ok { color: var(--ok); border-color: var(--ok); }

/* Budget */
table.budget tr.cat th { background: var(--surface-2); color: var(--ink); font-weight: 600; text-transform: none; }
table.budget input, table.budget select { min-height: 32px; padding: 0 var(--space-2); }
table.budget input.short, form.inline input.short { width: 90px; flex: 0 0 90px; }

/* Reviews (approve / reject) */
.review-badge { font-size: 0.8rem; white-space: nowrap; }
.review-badge .ok { color: var(--ok); } .review-badge .no { color: var(--accent); }
.review-box { display: grid; gap: var(--space-2); margin: var(--space-2) 0; }
.review-vote { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.review-vote button { min-height: 34px; }
.review-vote button.ok[aria-pressed='true'] { border-color: var(--ok); color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.review-vote button.no[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.review-vote input { flex: 1 1 200px; width: auto; min-height: 34px; }
.review-list { list-style: none; padding: 0; margin: 0; font-size: var(--text-sm); }
.review-list .verdict { font-weight: 600; }
.review-list .verdict.approve { color: var(--ok); } .review-list .verdict.reject { color: var(--accent); }
details.discuss { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2) var(--space-3); margin: var(--space-3) 0; background: var(--surface); }
details.discuss > summary { cursor: pointer; font-weight: 600; }
tr[data-discuss-row] > td { background: var(--surface-2); }

/* Cast list */
.cast-list details > summary { cursor: pointer; list-style: none; }
.cast-list details > summary::-webkit-details-marker { display: none; }
table.candidates { margin-top: var(--space-2); }

/* Continuity & writers' room: a list on the left, the work on the right */
.split { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: var(--space-4); align-items: start; }
.side-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-height: 75vh; overflow-y: auto; position: sticky; top: var(--space-2); }
.side-list > a { padding: var(--space-1) var(--space-2); border-bottom: 1px solid var(--line); text-decoration: none; font-size: var(--text-sm); line-height: 1.35; }
.side-list > a[aria-current='true'] { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand-fg); }
.side-list > input, .side-list > button { margin: var(--space-2); width: auto; }
.side-head { padding: var(--space-1) var(--space-2); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-2); }
.brk { color: var(--accent); font-weight: 700; }
.cont-group { border-top: 1px solid var(--line); padding-top: var(--space-2); margin-top: var(--space-2); }
.cont-group h3 { font-size: var(--text-base); margin-bottom: var(--space-1); }
.cont-looks { margin-top: var(--space-1); }
.cont-looks .tag { font-weight: 500; }
ol.cont-track { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
ol.cont-track > li { padding: var(--space-2) 0 var(--space-2) var(--space-3); position: relative; }
ol.cont-track > li::before { content: ''; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
ul.carried li { color: var(--muted); font-style: italic; }
.script-line { font-family: var(--font-script); font-size: 1rem; text-transform: uppercase; }
/* Writers' room: search, hide and Add scene stay on top of the scene list; the list folds to a slim tab */
.side-list > .side-top { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: var(--space-1); padding: var(--space-2); background: var(--surface); border-bottom: 1px solid var(--line); }
.side-top > input { flex: 1; min-width: 0; width: auto; }
.side-top > .add-scene { flex-basis: 100%; }
/* A series: Scenes | Episodes over the side list; the Episodes tab orders the episodes */
.side-tabs { display: flex; gap: var(--space-1); align-items: center; padding: var(--space-2) var(--space-2) 0; background: var(--surface); }
.side-tabs .seg { flex: 1; display: flex; } .side-tabs .seg button { flex: 1; }
.side-note { margin: var(--space-2); font-size: 0.75rem; }
.ep-list { list-style: none; margin: 0; padding: 0; }
.ep-list > li { display: flex; align-items: center; gap: var(--space-1); border-bottom: 1px solid var(--line); }
.ep-list > li[aria-current='true'] { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand-fg); }
.ep-list > li[draggable='true'] { cursor: grab; }
.ep-list > li.dragging { opacity: 0.5; }
.ep-list > li > a { flex: 1; min-width: 0; padding: var(--space-1) var(--space-2); text-decoration: none; font-size: var(--text-sm); line-height: 1.35; }
.ep-list > li > a .item-meta { display: block; }
.ep-moves { display: flex; padding-right: var(--space-1); }
.context > .context-title { margin-top: 0; }
.writer.side-hidden { grid-template-columns: auto 1fr minmax(200px, 280px); }
.context-rail { align-self: start; }
.side-show { position: sticky; top: var(--space-2); writing-mode: vertical-rl; padding: var(--space-2) var(--space-1); min-height: 0; font-size: var(--text-sm); }
.writer { display: grid; grid-template-columns: minmax(200px, 260px) 1fr minmax(200px, 280px); gap: var(--space-3); align-items: start; }
textarea.script-input { font-family: var(--font-script); font-size: 12pt; line-height: 1.35; min-height: 50vh; width: 100%; }
.context { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3); background: var(--surface-2); position: sticky; top: var(--space-2); font-size: var(--text-sm); }
.context h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: var(--space-2) 0 var(--space-1); }
.script-quote { font-family: var(--font-script); font-size: 0.85rem; color: var(--muted); }
details.preview { margin-top: var(--space-3); }
@media (max-width: 900px) { .writer, .writer.side-hidden, .writer.context-hidden, .writer.side-hidden.context-hidden, .split { grid-template-columns: 1fr; } .side-list, .context { position: static; max-height: 40vh; } .side-show { position: static; writing-mode: horizontal-tb; justify-self: start; } }

/* AI suggestions */
details.ai > summary { cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
.chip-item { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; border: 1px solid var(--line); border-radius: var(--pill); padding: 1px 4px 1px 10px; background: var(--surface); }
.chip-item.cast { border-color: var(--bd-cast); } .chip-item.props { border-color: var(--bd-props); } .chip-item.stunts { border-color: var(--bd-stunts); }
.chip-item.vehicles, .chip-item.animals { border-color: var(--bd-vehicles); } .chip-item.sfx { border-color: var(--bd-sfx); } .chip-item.vfx { border-color: var(--bd-vfx); }
.chip-item.background { border-color: var(--bd-background); } .chip-item.weapons { border-color: var(--bd-weapons); } .chip-item.meta { border-style: dashed; }
.chip-item button { min-height: 22px; padding: 0 4px; border: 0; }
fieldset.methods .types { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }


/* Script tab: one-row import bar, the whole script with filters */
.import-bar, .filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); max-width: none; }
.import-bar select { width: auto; flex: 0 1 auto; }
.import-bar > strong { margin-right: var(--space-2); }
.import-bar input[type=file] { flex: 1 1 9rem; min-width: 0; width: auto; }
.import-bar textarea { flex: 1 0 100%; }
.import-bar [data-form-error]:empty { display: none; }
.revisions > summary { cursor: pointer; }
.revisions h3 { font-size: var(--text-base); margin: var(--space-3) 0 var(--space-1); }
.filter-bar { margin-bottom: var(--space-3); }
.filter-bar select, .filter-bar input { flex: 1 1 10rem; min-width: 0; }
.full-script-body { max-height: 75vh; overflow-y: auto; }
.full-scene + .full-scene { border-top: 1px dashed var(--line); margin-top: var(--space-3); padding-top: var(--space-2); }
.full-scene-head { display: flex; gap: var(--space-2); align-items: baseline; }
.full-scene-head .scene-no { font-weight: 700; }
.full-scene .script .slug { margin-top: var(--space-1); }
.script p.hl { background: var(--brand-soft); }
.script p.found { outline: 2px solid color-mix(in srgb, var(--brand-fg) 40%, transparent); outline-offset: 1px; }

/* Writers' room */
.inner-tabs { margin: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.count-soft { font-size: 0.75rem; color: var(--muted); background: var(--surface-2); border-radius: var(--pill); padding: 0 6px; }
.tabs a .count.new { margin-left: 4px; background: var(--brand); color: var(--brand-ink); border-radius: var(--pill); padding: 0 6px; font-size: 0.7rem; line-height: 1.5; vertical-align: 1px; }
.crumbs { font-size: var(--text-sm); color: var(--muted); margin: 0 0 var(--space-1); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg > button { border: 0; border-radius: 0; min-height: 36px; padding: 0 var(--space-3); background: var(--surface); }
.seg > button + button { border-left: 1px solid var(--line); }
.seg > button[aria-pressed='true'] { background: var(--brand-soft); color: var(--brand-fg); font-weight: 600; }
.row2 { display: flex; gap: var(--space-2); align-items: end; flex-wrap: wrap; }
.row2 > label { flex: 1 1 140px; }
form.jot, form.pitch { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-2); max-width: none; align-items: start; }
form.jot textarea, form.pitch textarea { grid-column: 1 / -1; }
form.pitch { grid-template-columns: 2fr 1.4fr 1fr auto; }
@media (max-width: 700px) { form.jot, form.pitch { grid-template-columns: 1fr; } }
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-3); }
.idea-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--space-2) var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); border-top: 3px solid var(--line); }
.idea-card.kind-idea { border-top-color: var(--brand-fg); }
.idea-card.kind-story { border-top-color: var(--ink-2); }
.idea-card.kind-plot { border-top-color: var(--ink-1); }
.idea-card h3, .idea-card h4 { font-size: var(--text-base); margin: 0; }
.idea-body { white-space: pre-wrap; margin: 0; font-size: var(--text-sm); }
.card-foot { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: auto; font-size: var(--text-sm); }
.card-foot .item-meta { flex: 1 1 auto; }
button.vote { min-height: 32px; padding: 0 var(--space-2); border-radius: var(--pill); }
button.vote[aria-pressed='true'] { background: var(--brand-soft); border-color: var(--brand-fg); color: var(--brand-fg); }
.talk { border-top: 1px dashed var(--line); padding-top: var(--space-2); }
.timeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-2); }
.lane { background: var(--surface-2); border-radius: var(--radius); padding: var(--space-2); }
.lane h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 var(--space-2); }
.beats { list-style: none; margin: 0; padding: 0; min-height: 60px; display: flex; flex-direction: column; gap: var(--space-2); }
.beat { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--brand-fg); border-radius: var(--radius); padding: var(--space-2); font-size: var(--text-sm); cursor: grab; }
.beat p { margin: var(--space-1) 0 0; }
.beat.dragging { opacity: 0.5; }
.beat-tools { display: inline-flex; gap: var(--space-1); float: right; }
/* Acts: each its own colour, in story order (tokens --act-1…6, cycling); beats not placed yet stay grey. */
.act-c1 { --act: var(--act-1); } .act-c2 { --act: var(--act-2); } .act-c3 { --act: var(--act-3); }
.act-c4 { --act: var(--act-4); } .act-c5 { --act: var(--act-5); } .act-c6 { --act: var(--act-6); }
.act-none { --act: var(--muted); }
.lane { border-top: 4px solid var(--act, var(--line)); }
.lane h3 { color: var(--act, var(--muted)); }
.lane .beat { border-left-color: var(--act, var(--brand-fg)); }
.beat.key { border-left-width: 6px; }
.beat .star { float: left; margin-right: var(--space-1); color: var(--act, var(--brand-fg)); font-size: var(--text-lg); line-height: 1; }
/* The story map: one line across the whole story, a coloured stretch per act, a dot per beat. Key moments are big
   dots with their label (alternating above and below the line); other beats are small dots (title on hover). */
.story-map { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3); margin-bottom: var(--space-3); }
.story-map-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 var(--space-2); }
.story-map > .hint:last-child { margin: var(--space-2) 0 0; }
.story-line { display: flex; overflow-x: auto; padding-bottom: var(--space-2); }
.story-act { --act-h: 220px; position: relative; flex: 1 1 0; min-width: 140px; height: var(--act-h); }
.story-act::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 8px; margin-top: -4px; background: var(--act); }
.story-act:first-child::before { border-radius: 4px 0 0 4px; }
.story-act:last-child::before { border-radius: 0 4px 4px 0; }
.story-act + .story-act { border-left: 2px dashed var(--line); }
.story-act-name { position: absolute; left: var(--space-2); top: 0; font-weight: 700; font-size: var(--text-sm); color: var(--act); }
.story-beats { list-style: none; margin: 0; padding: 0 var(--space-2); height: 100%; display: flex; justify-content: space-around; }
.story-beat { position: relative; flex: 1 1 0; min-width: 110px; display: flex; justify-content: center; }
.story-dot { position: absolute; top: 50%; width: 14px; height: 14px; min-height: 0; padding: 0; margin-top: -7px; border-radius: 50%;
  border: 3px solid var(--surface); background: var(--act); box-shadow: 0 0 0 1px var(--act); cursor: pointer; }
.story-beat.key .story-dot { width: 24px; height: 24px; margin-top: -12px; }
.story-label { position: absolute; left: 4px; right: 4px; text-align: center; font-size: var(--text-sm); line-height: 1.25;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.story-beat:not(.labelled) .story-label { display: none; }
.story-beat.key .story-label { font-weight: 700; }
.story-beat:nth-child(odd) .story-label { bottom: calc(50% + 18px); }
.story-beat:nth-child(even) .story-label { top: calc(50% + 18px); }
.story-label small { display: block; color: var(--muted); font-weight: 400; }
/* Writers' room characters: a compact list; each opens in a modal (.char-dialog). */
.char-table { width: 100%; }
.char-table tbody tr { cursor: pointer; }
.char-table tbody tr:hover { background: var(--brand-soft); }
.char-table tr.kiv td:first-child { box-shadow: inset 3px 0 0 var(--tomato); }
.char-table .char-open { font-weight: 700; text-align: left; }
.char-table .char-desc { max-width: 36ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.char-dialog .char-card h2 { display: inline; font-size: var(--text-xl); }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-3); }
.char-card h3 { display: inline; font-size: var(--text-lg); }
.char-card h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: var(--space-3) 0 var(--space-1); }
.char-card form.brief { max-width: none; gap: var(--space-2); }
.char-head .item-meta { display: block; }
.ref-images { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-2) 0; }
.ref-images img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.ref-add { width: 72px; height: 72px; font-size: 1.5rem; color: var(--muted); border-style: dashed; }
.arc { margin: 0; padding-left: 1.2em; font-size: var(--text-sm); }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: var(--space-3); overflow-x: auto; margin-top: var(--space-3); }
.kan-col { background: var(--surface-2); border-radius: var(--radius); padding: var(--space-2); display: flex; flex-direction: column; gap: var(--space-2); }
.kan-col h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0; }
pre.treatment { white-space: pre-wrap; font-size: 0.85rem; margin: var(--space-1) 0 0; max-height: 18em; overflow-y: auto; }
/* Ink */
.ink-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.ink-bar select { width: auto; min-height: 32px; }
.ink-legend { display: flex; flex-wrap: wrap; gap: var(--space-3); list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); }
.ink-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ink-chip { width: 12px; height: 12px; border-radius: 50%; display: inline-block; background: var(--ink); }
.ink-0 { --c: var(--ink-0); } .ink-1 { --c: var(--ink-1); } .ink-2 { --c: var(--ink-2); } .ink-3 { --c: var(--ink-3); }
.ink-4 { --c: var(--ink-4); } .ink-5 { --c: var(--ink-5); } .ink-6 { --c: var(--ink-6); } .ink-7 { --c: var(--ink-7); }
.ink-chip { background: var(--c, var(--ink)); }
.ink-chip.ink-none { background: var(--ink); }
.script p.ink { color: var(--c, var(--ink)); }
.whole-draft { max-height: none; }

.char-card { display: flex; flex-direction: column; gap: var(--space-1); }
.char-card .char-top { display: flex; gap: var(--space-2); justify-content: space-between; align-items: start; }
.char-card .ref-images { margin: 0; flex: 0 0 auto; max-width: 50%; justify-content: flex-end; }
.char-card .ref-images img, .char-card .ref-add { width: 48px; height: 48px; font-size: 1.1rem; }
.char-card form.inline { flex-wrap: nowrap; margin-top: var(--space-1); }
.char-card form.inline input.short, .char-card .row2 input { flex: 0 0 6em; width: 6em; }
.char-card .row2 { flex-wrap: nowrap; }
.char-card label > span { font-size: var(--text-sm); color: var(--muted); }
.char-card .row2 { align-items: end; gap: var(--space-3); }
.char-card .row2 .grow { flex: 1; } .char-card .row2 .grow input { flex: 1; width: 100%; }
.char-card .ref-images { align-items: center; }
.img-credits { font-size: 0.75rem; text-align: right; }
.rel-mine li { display: flex; justify-content: space-between; gap: var(--space-2); }
.char-card form.rel-add { flex-wrap: wrap; align-items: center; }
.char-card form.rel-add select { width: auto; flex: 0 1 auto; }
.char-card form.rel-add input { flex: 1 1 10em; }
.appearances li { line-height: 1.6; }
/* Unsplash search in the character modal: results shown from Unsplash, a click keeps one */
.unsplash { display: flex; flex-direction: column; gap: var(--space-2); }
.unsplash form.inline input { flex: 1; }
.unsplash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--space-2); max-height: 50vh; overflow-y: auto; }
.unsplash-grid figure { margin: 0; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.unsplash-pick { padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; min-height: 0; }
.unsplash-pick:hover, .unsplash-pick:focus-visible { border-color: var(--brand-fg); box-shadow: 0 0 0 2px var(--brand-soft); }
.unsplash-pick.busy { opacity: 0.5; }
.unsplash-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.unsplash-grid figcaption { font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
/* Add a reference picture: the device or an Unsplash search, in one dialog */
dialog.image-picker { width: min(640px, calc(100vw - 32px)); max-width: none; }
.image-picker form.inline { margin-bottom: var(--space-3); }
.image-picker form.inline input { flex: 1; }
.image-picker .notice { margin: 0 0 var(--space-2); }
.image-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-2); }
.image-source { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); min-height: 112px; padding: var(--space-3);
  border: var(--bw) solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; }
.image-source:hover, .image-source:focus-visible { border-color: var(--brand-fg); background: var(--brand-soft); }
.image-source .icon { width: 28px; height: 28px; }

/* Cast list: a row per character, option cards inside */
.cast-list > li > details > summary { list-style: none; cursor: pointer; }
.cast-list > li > details > summary::-webkit-details-marker { display: none; }
.cast-row { display: grid; grid-template-columns: 2.5rem minmax(0, 2fr) minmax(0, 1fr) 7.5rem 11.5rem; gap: var(--space-3); align-items: center; padding: 4px 0; line-height: 1.2; cursor: pointer; list-style: none; }
.cast-row::-webkit-details-marker { display: none; }
.cast-row .cast-no { color: var(--muted); font-size: var(--text-sm); text-align: right; }
.cast-row .cast-no::before { content: '▸'; float: left; color: var(--muted); transition: transform 0.15s; }
details[open] > .cast-row .cast-no::before { transform: rotate(90deg); }
.cast-row .cast-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast-row .cast-add { text-align: right; }
.cast-list li.is-cast .cast-name strong:first-child { color: var(--ok); }
.cast-facts { margin: 0 0 var(--space-3) calc(2.5rem + var(--space-3)); padding: var(--space-2) var(--space-3); border-left: 3px solid var(--line); }
.cast-facts dl { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: 0 0 var(--space-1); }
.cast-facts dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.cast-facts dd { margin: 0; font-weight: 600; }
.cast-list details > .option-grid, .cast-list details > .considered, .cast-list details > .hint { margin-left: calc(2.5rem + var(--space-3)); }
.considered > summary { cursor: pointer; color: var(--muted); font-size: var(--text-sm); margin-bottom: var(--space-2); }
.cast-counts { font-size: var(--text-sm); color: var(--muted); white-space: nowrap; }
.cast-desc { font-size: var(--text-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cast-state { text-align: right; font-size: var(--text-sm); }
details[open] > .cast-row .cast-desc { visibility: hidden; }
.cast-brief { font-size: var(--text-sm); margin: var(--space-1) 0 var(--space-2); max-width: 75ch; }
@media (max-width: 760px) { .cast-row { grid-template-columns: 2rem minmax(0, 1fr) auto; } .cast-row .cast-counts { grid-column: 2; } .cast-row .cast-add { grid-column: 2 / -1; } .cast-facts, .cast-list details > .option-grid, .cast-list details > .considered, .cast-list details > .hint { margin-left: 0; } }
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--space-3); margin: var(--space-2) 0 var(--space-3); }
.option-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--space-2) var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); }
.option-card.confirmed { border-color: var(--ok); box-shadow: inset 0 3px 0 var(--ok); }
.option-card.declined { opacity: 0.6; }
.option-card h3 { font-size: var(--text-lg); margin: 0; }
.option-head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.option-head select { width: auto; min-height: 32px; font-size: var(--text-sm); padding: 0 var(--space-2); }
.option-no { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-right: auto; }
.option-facts { display: grid; grid-template-columns: 4.5em 1fr; gap: 2px var(--space-2); margin: 0; font-size: var(--text-sm); }
.option-facts dt { color: var(--muted); }
.option-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.chips li { font-size: 0.75rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--pill); padding: 1px 8px; }
/* "+ Add option n": a small button at the right end of the character's row. */
.cast-row .option-add { justify-self: end; align-self: center; white-space: nowrap; }
button.small, a.button.small { min-height: 32px; padding: 0 var(--space-2); font-size: var(--text-sm); }
.option-talk { border-top: 1px dashed var(--line); padding-top: var(--space-2); }
.cast-form { max-width: none; }
.cast-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2) var(--space-3); display: grid; gap: var(--space-2); }
.cast-form legend { font-weight: 600; padding: 0 var(--space-1); }
.demand-pick summary { cursor: pointer; }
.demand-group h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: var(--space-2) 0 var(--space-1); }
.demand-group { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.demand-group h4 { flex: 1 0 100%; }
/* Day picker */
.daypick-nav { display: flex; align-items: center; gap: var(--space-2); }
.daypick-nav .item-meta { margin-right: auto; }
.daypick-nav button[data-step] { min-height: 32px; width: 32px; padding: 0; }
.daypick-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-3); margin-top: var(--space-1); }
.daypick-title { font-weight: 600; font-size: var(--text-sm); margin-bottom: 4px; }
.daypick-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.daypick-grid .dh { font-size: 0.7rem; color: var(--muted); text-align: center; }
.daypick-grid button { min-height: 30px; padding: 0; font-size: var(--text-sm); border-radius: 0; background: var(--surface); }
.daypick-grid button.shoot { background: var(--brand-soft); border-color: var(--brand-fg); color: var(--brand-fg); font-weight: 700; }
.daypick-grid button[data-state='off'] { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.daypick-grid button[data-state='tbc'] { background: color-mix(in srgb, var(--warn) 30%, var(--surface)); color: var(--ink); border: 1px dashed var(--warn); }
/* Not available (or TBC) on a shooting day: the clash keeps the shoot-day ring. */
.daypick-grid button.shoot[data-state='off'], .daypick-grid button.shoot[data-state='tbc'] { box-shadow: 0 0 0 2px var(--brand-fg); }
.daypick-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.daypick-key span { display: inline-block; width: 14px; height: 12px; border-radius: 0; }
.key-shoot { background: var(--brand-soft); border: 1px solid var(--brand-fg); }
.key-off { background: var(--accent); margin-left: var(--space-2); }
.key-tbc { background: color-mix(in srgb, var(--warn) 30%, var(--surface)); border: 1px dashed var(--warn); margin-left: var(--space-2); }
.key-clash { background: var(--accent); box-shadow: 0 0 0 2px var(--brand-fg); margin-left: var(--space-2); }

/* People: one table, a header row per department */
.people-panel { padding: 0; overflow: hidden; }
.people-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.people-table th, .people-table td { padding: 6px var(--space-2); border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.people-table thead th { background: var(--surface-2); font-weight: 600; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.people-table .dept-row th { background: var(--brand-soft); color: var(--ink); font-size: var(--text-sm); text-transform: none; letter-spacing: 0; padding-top: var(--space-2); }
.people-table td.num, .people-table th.num { text-align: right; }
.people-table .mini-input { min-height: 30px; padding: 0 6px; font-size: var(--text-sm); width: 7em; }
.people-table .mini-input.short { width: 4.5em; }
.people-table select.mini-input { width: auto; }
.people-table input[type=checkbox] { width: 18px; min-height: 18px; }
.people-table .row-actions { white-space: nowrap; text-align: right; }
.people-table .row-actions .link { margin-left: var(--space-2); }
.people-table tr.saved td { transition: background 1s; background: var(--brand-soft); }
.people-table tbody tr:not(.dept-row):hover td { background: var(--surface-2); }

.people-table .person-cell { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.people-table .person-cell .avatar { flex: none; width: 34px; height: 34px; font-size: 0.72rem; }
.people-table .person-cell-main { display: grid; gap: 0; line-height: 1.15; min-width: 0; }
.people-table .person-cell-main > .item-meta { font-size: 0.7rem; line-height: 1.2; margin-top: 0; }
.person-cell-main { min-width: 0; }
.person-cell .avatar.lg { width: 56px; height: 56px; font-size: 1rem; }
.person-name { border: 0; background: none; min-height: 0; padding: 0; font: inherit; font-weight: 700; letter-spacing: normal; color: var(--ink); text-align: left; cursor: pointer; }
button.person-name:hover:not(.story-scene), button.person-name:focus-visible { background: transparent; color: var(--ink); text-decoration: underline; box-shadow: none; }
.person-dialog-head { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-1) 0 var(--space-2); text-align: center; }
.person-dialog-head > [data-close] { position: absolute; top: 0; right: 0; }
.person-dialog-head .person-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); text-align: center; }
.person-dialog-head .person-cell-main { display: grid; justify-items: center; gap: var(--space-1); }
.person-dialog-head h2 { margin: 0; text-align: center; }
.person-dialog-head .avatar.lg { width: 96px; height: 96px; font-size: 1.6rem; }
.person-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); border-bottom: var(--bw) solid var(--line); margin: var(--space-2) 0 var(--space-3); }
.person-tabs > button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; min-height: 38px; padding: 0 var(--space-3); font-weight: 700; color: var(--muted); }
.person-tabs > button:hover { color: var(--ink); background: var(--surface-2); }
.person-tabs > button[aria-selected='true'] { color: var(--brand-fg); border-bottom-color: var(--brand-fg); }
.person-pane { display: grid; gap: var(--space-3); }
.person-pane > form, .person-pane .portfolio-support { gap: var(--space-3); }
.crew-search { margin: var(--space-3) 0; padding: var(--space-3); border: var(--bw) solid var(--line); background: var(--surface-2); }
.crew-search .field-label { display: block; font-weight: 700; margin-bottom: var(--space-1); }
.search-line { display: flex; gap: var(--space-2); align-items: stretch; }
.search-line input { flex: 1; }
.crew-results { display: grid; gap: var(--space-1); margin-top: var(--space-2); max-height: 230px; overflow: auto; }
.crew-result { display: flex; align-items: center; gap: var(--space-2); width: 100%; text-align: left; padding: var(--space-2); border: var(--bw) solid var(--line); background: var(--surface); color: var(--ink); }
.crew-result:hover, .crew-result.picked { border-color: var(--brand-fg); background: var(--brand-soft); }
.crew-result-main { flex: 1; display: grid; min-width: 0; }
.crew-result-main .item-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-table td.nowrap { white-space: nowrap; }
.people-table a.email { display: inline-block; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; padding: 2px 10px; border-radius: var(--radius); border: 1px solid transparent; font-weight: 700; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu[open] > summary, .row-menu > summary:hover { border-color: var(--line); background: var(--surface); }
.row-menu .menu { position: absolute; right: 0; top: 100%; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgb(0 0 0 / 0.12); padding: var(--space-1) 0; display: flex; flex-direction: column; min-width: 12rem; text-align: left; }
.row-menu .menu .link { margin: 0; padding: 6px var(--space-3); text-align: left; text-decoration: none; }
.row-menu .menu .link:hover { background: var(--surface-2); }

/* ---------- Founder's review (2026-10-15): dashboard, timeline, live call, offline, settings, portals ---------- */
/* Numbered cards, as in a design board: 01, 02… */
.dash-head { margin-bottom: var(--space-4); }
.dash-head h1 { margin-bottom: var(--space-1); }
/* The stage the project is in, big and bold: Pre-Production, Production (shooting: the "now" red) or Post. */
.stage-banner { --stage: var(--brand); display: grid; gap: var(--space-1); margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4);
  border: 2px solid var(--stage); border-left-width: 10px; border-radius: var(--radius); background: color-mix(in srgb, var(--stage) 10%, var(--surface)); }
.stage-banner.st-production { --stage: var(--accent); }
.stage-banner.st-post, .stage-banner.st-wrap { --stage: var(--tone-3); }
.stage-banner .eyebrow { color: var(--stage); }
.stage-banner .stage-name { font-size: var(--text-xxl); font-weight: 700; line-height: 1.1; text-transform: uppercase; letter-spacing: 0.02em; color: var(--stage); }
.stage-banner .stage-says { font-size: var(--text-lg); font-weight: 600; }
.stage-banner .stage-dates { color: var(--muted); }
@media (max-width: 600px) { .stage-banner { padding: var(--space-3); } .stage-banner .stage-name { font-size: var(--text-xl); } }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); align-items: start; }
.dash-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 820px) { .dash-grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--space-3) var(--space-4) var(--space-4); min-width: 0; }
.card-title { display: flex; align-items: center; gap: var(--space-2); font-size: 1.2rem; margin: 0 0 var(--space-3); }
.card-title .card-links { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; font-size: var(--text-sm); }
.card-title .n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 0.75rem; font-weight: 600; flex: none; }
.card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.card-list > li.panel { margin: 0; }
.ok-line { color: var(--ok); }
/* Ticks are drawn (the line icon as a mask, in the current colour), never a character. */
.ok-line::before { content: ''; display: inline-block; width: 1em; height: 1em; margin-right: 0.3em; vertical-align: -0.15em; background: var(--sig-ok); -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='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17.5 19.5 7'/%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='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17.5 19.5 7'/%3E%3C/svg%3E") center / contain no-repeat; }
ul.activity { list-style: none; padding: 0; margin: 0 0 var(--space-2); }
ul.activity li { display: flex; justify-content: space-between; gap: var(--space-3); padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: var(--text-sm); }
ul.activity li:last-child { border-bottom: 0; }
ul.activity .item-meta { white-space: nowrap; }

/* Live call */
.live-unit { border-left: 4px solid var(--unit, var(--brand-fg)); padding-left: var(--space-3); margin-bottom: var(--space-3); }
.live-unit-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.state-pill { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; border-radius: var(--pill); padding: 1px 8px; background: var(--surface-2); color: var(--muted); font-weight: 600; }
.state-pill.st-running { background: var(--accent); color: var(--brand-ink); }
.state-pill.st-wrapped { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.now-shooting { background: var(--brand-soft); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.now-shooting.shooting { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.now-shooting.shooting .eyebrow { color: var(--accent); }
.now-shooting.shooting .eyebrow::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; animation: pulse 1.6s infinite; vertical-align: 1px; }
.now-scene { font-size: var(--text-lg); margin: 0; }
@keyframes pulse { 50% { opacity: 0.35; } }
ul.issues { list-style: none; padding: 0; margin: 0 0 var(--space-2); }
ul.issues li { padding: 3px 0; font-size: var(--text-sm); }
ul.issues li.critical a { color: var(--accent); }
ul.issues li.warning a { color: var(--warn); }
.rundown summary { cursor: pointer; font-size: var(--text-sm); color: var(--muted); }
ol.rundown-list { list-style: none; padding: 0; margin: var(--space-2) 0; }
ol.rundown-list li { display: flex; align-items: baseline; gap: var(--space-2); padding: 4px 0; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
ol.rundown-list li.wrapped { color: var(--muted); }
ol.rundown-list li.wrapped .scene-line { text-decoration: line-through; }
.state-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--line); align-self: center; }
.ri.shooting .state-dot { background: var(--accent); }
.ri.prepping .state-dot { background: var(--warn); }
.ri.on_hold .state-dot { background: var(--tone-3); }
.ri.wrapped .state-dot { background: var(--ok); }

/* Timeline (Gantt) */
.gantt { display: grid; gap: 6px; font-size: var(--text-sm); }
.gantt-row { display: grid; grid-template-columns: minmax(90px, 140px) 1fr; gap: var(--space-2); align-items: center; }
.gantt-label { color: var(--ink); }
.gantt-track { position: relative; height: 26px; background: var(--surface-2); border-radius: var(--pill); }
.gantt-scale .gantt-track { background: none; height: 18px; }
.gantt-scale .tick { position: absolute; top: 0; font-size: 0.7rem; color: var(--muted); transform: translateX(-2px); border-left: 1px solid var(--line); padding-left: 3px; }
.gantt-bar { position: absolute; top: 3px; bottom: 3px; border-radius: var(--pill); background: color-mix(in srgb, var(--tone-1) 35%, var(--surface)); overflow: hidden; min-width: 18px; }
.gantt-fill { position: absolute; inset: 0 auto 0 0; background: var(--tone-1); }
.strand-casting .gantt-fill, .strand-schedule .gantt-fill { background: var(--tone-2); }
.strand-casting, .strand-schedule { background: color-mix(in srgb, var(--tone-2) 30%, var(--surface)); }
.strand-locations .gantt-fill, .strand-storyboard .gantt-fill { background: var(--tone-3); }
.strand-locations, .strand-storyboard { background: color-mix(in srgb, var(--tone-3) 30%, var(--surface)); }
.strand-shoot .gantt-fill { background: var(--brand); }
.strand-shoot { background: var(--brand-soft); }
.strand-post .gantt-fill { background: var(--tone-4); }
.strand-post { background: color-mix(in srgb, var(--tone-4) 30%, var(--surface)); }
.gantt-bar.late { box-shadow: inset 0 0 0 2px var(--accent); }
.gantt-pct { position: relative; z-index: 1; font-size: 0.7rem; padding: 0 8px; line-height: 20px; color: var(--ink); font-weight: 600; }
.today-line { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--accent); border-radius: 0; z-index: 2; }
@media (max-width: 560px) { .gantt-row { grid-template-columns: 76px 1fr; } }

/* Stage and first shoot day */
.stage-control { display: grid; gap: var(--space-3); }
.stage-control form.stage-start { margin: 0; }
.stage-control .seg button:disabled { opacity: 1; cursor: default; }
.stage-log summary { cursor: pointer; font-size: var(--text-sm); color: var(--muted); }

/* Offline: the header button and the sheet */
.offline-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 var(--space-2); border-radius: var(--pill); font-size: 0.78rem; background: var(--surface); }
.offline-btn .sig { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.offline-btn[data-state='offline'] { border-color: var(--accent); color: var(--accent); }
.offline-btn[data-state='offline'] .sig { background: var(--accent); }
.offline-btn[data-state='waiting'] .sig { background: var(--warn); }
@media (max-width: 560px) { .offline-btn .lbl { display: none; } }
dialog.offline-sheet { width: min(560px, calc(100vw - 32px)); max-width: none; }
dialog.offline-sheet progress { width: 100%; accent-color: var(--brand); }

/* Settings → Access */
.access-matrix { max-height: 70vh; }
.access-matrix table { min-width: max-content; }
.access-matrix th.matrix-role { writing-mode: vertical-rl; transform: rotate(180deg); height: 150px; vertical-align: bottom; font-size: 0.75rem; text-align: left; }
.access-matrix th.matrix-role .item-meta { display: block; margin-top: var(--space-1); }
.access-matrix tr.area-row th { background: var(--surface-2); color: var(--ink); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; }
.access-matrix tr.matrix-tab th { text-align: left; font-weight: 500; }
.access-matrix tr.matrix-tab.sub th { padding-left: var(--space-5); color: var(--muted); }
.access-matrix tr.matrix-tab td, .access-matrix tr.layout-row td { text-align: center; vertical-align: middle; }
.access-matrix tr.layout-row th { text-align: left; font-weight: 500; }
.access-matrix input[type='checkbox'] { width: 18px; height: 18px; }
.access-matrix select { min-height: 30px; font-size: 0.75rem; }
.access-role { margin-top: var(--space-4); }
.access-form { max-width: none; }
.tab-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
.tab-groups fieldset { gap: var(--space-1); }
.tab-groups label.check { font-size: var(--text-sm); flex-wrap: wrap; }
.tab-groups label.check .item-meta { flex: 1 0 100%; padding-left: 26px; font-size: 0.72rem; margin-top: -4px; }
details.caps summary { cursor: pointer; font-weight: 600; margin: var(--space-2) 0; }
.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-2) var(--space-3); }
.cap-grid label { grid-template-columns: 1fr 8.5em; align-items: center; font-size: 0.8rem; color: var(--ink); }
.cap-grid select { min-height: 32px; padding: 0 var(--space-2); font-size: 0.8rem; }
form.settings-form { max-width: 640px; }

/* People: crew list by section, then clients */
.people-section { margin-top: var(--space-5); }
/* The section is the heading people scan for (bigger, bolder, a rule under it); its table sits indented under it. */
.people-section > .section-head { align-items: center; padding-bottom: var(--space-2); border-bottom: 2px solid var(--brand-fg); margin-bottom: var(--space-3); }
.people-section > .section-head h2 { font-size: var(--text-xl); font-weight: 700; letter-spacing: 0.04em; color: var(--ink); text-transform: uppercase; }
.people-section > .section-head h2 .count-soft { font-size: var(--text-sm); vertical-align: middle; }
.people-section > .table-wrap, .people-section > .hint, .people-section > .empty-section { margin-left: var(--space-4); }
@media (max-width: 600px) { .people-section > .table-wrap, .people-section > .hint, .people-section > .empty-section { margin-left: var(--space-2); } }
.people-table .title-box, .title-box { display: grid; gap: var(--space-1); }
/* Script desk (/write/script): pickers, one tool row (prev/next, Preview|Edit, zoom, pages), the script in a paged view —
   a faint rule every 55 lines (68.75em at the script's 1.25 line-height) — and, in Edit, the writers' inks under the text. */
.desk-pickers { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.desk-pickers select { width: auto; min-height: 34px; }
.desk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: var(--space-2) 0; position: sticky; top: 0; z-index: 2; background: var(--paper); padding: var(--space-1) 0; }
.desk-tools .zoom, .desk-tools .pages { display: inline-flex; align-items: center; gap: 4px; }
.desk-tools .page-btn { min-width: 30px; min-height: 28px; padding: 0 6px; }
.desk-tools .page-btn.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand-fg); }
.page-view { --zoom: 1; font-size: calc(var(--zoom) * 12pt); max-height: 72vh; overflow: auto; padding: var(--space-3);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(68.75em - 1px), var(--line) calc(68.75em - 1px), var(--line) 68.75em);
  background-attachment: local; background-origin: content-box; }
.page-view.whole { max-height: 78vh; }
.page-view .script { font-size: 1em; }
.ink-edit { position: relative; max-width: 72ch; }
.ink-mirror, .ink-input { font-family: var(--font-script); font-size: 1em; line-height: 1.25; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: 0; border: 0; letter-spacing: normal; tab-size: 4; }
.ink-mirror { color: var(--ink); min-height: 12em; }
.ink-mirror .ink-line.ink-0, .ink-mirror .ink-line.ink-1, .ink-mirror .ink-line.ink-2, .ink-mirror .ink-line.ink-3,
.ink-mirror .ink-line.ink-4, .ink-mirror .ink-line.ink-5, .ink-mirror .ink-line.ink-6, .ink-mirror .ink-line.ink-7 { color: var(--c); }
.ink-input { position: absolute; inset: 0; width: 100%; height: 100%; resize: none; overflow: hidden; background: transparent; color: transparent; caret-color: var(--ink); outline: none; min-height: 0; }
.ink-input::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); color: transparent; }
.scene-moves { display: flex; gap: var(--space-3); margin-top: var(--space-2); font-size: var(--text-sm); }
/* The scene flow beside the script: the scene before → THIS SCENE → the next one, joined by dotted arrows. */
.scene-flow { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: 26px; }
.flow-box { position: relative; border: 2px dashed var(--line); border-radius: var(--radius); padding: var(--space-2); background: var(--surface); font-size: var(--text-sm); }
.flow-box:not(:last-child)::after { content: ''; position: absolute; left: 50%; top: 100%; height: 22px; border-left: 2px dotted var(--brand-fg); transform: translateX(-1px); }
.flow-box:not(:last-child)::before { content: '▼'; position: absolute; left: 50%; top: calc(100% + 15px); transform: translateX(-50%); font-size: 10px; line-height: 1; color: var(--brand-fg); }
.flow-this { border: 2px solid var(--brand-fg); background: var(--brand-soft); box-shadow: var(--shadow); }
.flow-this .flow-label { color: var(--brand-fg); }
.flow-label { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 2px; }
.flow-no { font-family: var(--font-script); }
.flow-head { font-family: var(--font-script); font-size: 0.8rem; }
.flow-sum { display: block; color: var(--muted); margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.flow-none { color: var(--muted); font-style: italic; }
.flow-this { text-align: center; }
.flow-this-label { display: block; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand-fg); }
.last-seen > li { margin-bottom: var(--space-2); }
.last-seen .link { display: block; text-align: left; }
/* Writers' room → Characters → Relationships */
.rel-wrap { overflow: auto; padding: var(--space-2); }
.rel-map { display: block; margin: 0 auto; max-width: none; }
.rel-node rect { fill: var(--surface); stroke: var(--brand-fg); stroke-width: 1.5; }
.rel-node { cursor: pointer; }
.rel-node:hover rect, .rel-node:focus rect { fill: var(--brand-soft); }
.rel-node:focus { outline: none; }
.rel-name { font-family: var(--font-script); font-size: 13px; font-weight: 700; fill: var(--ink); }
.rel-sub { font-size: 11px; fill: var(--muted); }
.rel-dead rect { stroke: var(--muted); stroke-dasharray: 4 3; }
.rel-dead .rel-name { fill: var(--muted); }
.rel-line { fill: none; stroke: var(--muted); stroke-width: 2; }
.rel-label { font-size: 11px; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.rel-arrow { fill: var(--rel-enemy); }
.rel-k-parent, .rel-k-sibling { stroke: var(--ink); }
.rel-k-spouse, .rel-k-partner { stroke: var(--rel-love); }
.rel-k-ex { stroke: var(--rel-love); stroke-dasharray: 6 4; }
.rel-k-friend { stroke: var(--rel-friend); }
.rel-k-mentor, .rel-k-boss { stroke: var(--brand-fg); }
.rel-k-rival { stroke: var(--rel-rival); stroke-dasharray: 6 4; }
.rel-k-enemy, .rel-k-killed { stroke: var(--rel-enemy); }
.rel-legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); padding: 0; margin: var(--space-2) 0; font-size: var(--text-sm); color: var(--muted); }
.rel-swatch { display: inline-block; width: 22px; height: 0; border-top: 3px solid; border-color: inherit; margin-right: 6px; vertical-align: middle; }
.rel-swatch.rel-k-parent, .rel-swatch.rel-k-sibling { border-color: var(--ink); } .rel-swatch.rel-k-spouse, .rel-swatch.rel-k-partner { border-color: var(--rel-love); }
.rel-swatch.rel-k-ex { border-color: var(--rel-love); border-top-style: dashed; } .rel-swatch.rel-k-friend { border-color: var(--rel-friend); }
.rel-swatch.rel-k-mentor, .rel-swatch.rel-k-boss { border-color: var(--brand-fg); } .rel-swatch.rel-k-rival { border-color: var(--rel-rival); border-top-style: dashed; }
.rel-swatch.rel-k-enemy, .rel-swatch.rel-k-killed { border-color: var(--rel-enemy); }
.rel-form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: var(--space-3); }
.rel-form select, .rel-form input { width: auto; flex: 1 1 140px; }
.rel-list > li { display: flex; justify-content: space-between; gap: var(--space-2); padding: var(--space-1) 0; }
.story-form.reading label > span { font-weight: 700; }
.flow-btn { display: block; width: 100%; min-height: 0; padding: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.flow-btn:hover .flow-head { text-decoration: underline; }
/* A draft scene's comments: two lines, Post beside the label. */
.comment-form.compact { gap: 4px; max-width: none; }
.comment-form.compact .compact-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: var(--text-sm); color: var(--muted); }
.comment-form.compact textarea { min-height: 0; font-size: var(--text-sm); }
.scene-talk .group-title { margin-bottom: 4px; }
.desk-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.desk-head h2 { margin: 0; }
.episode-pick { display: inline-flex; align-items: center; gap: var(--space-1); }
.write-pane .desk-tools { position: static; margin-top: 0; }
/* Writers' room: synopsis, comments, a draft scene's discussion. */
.story-form { display: grid; gap: var(--space-3); max-width: none; }
.story-text { white-space: pre-line; margin: var(--space-1) 0 0; color: var(--ink); }
.episode-stories { display: grid; gap: var(--space-2); margin-left: var(--space-4); }
.episode-story > summary { cursor: pointer; }
.episode-story form { margin-top: var(--space-2); max-width: none; }
.room-comments .comment-body { white-space: pre-line; margin: var(--space-1) 0; }
.scene-talk { margin: var(--space-3) 0; padding-top: var(--space-2); border-top: 1px solid var(--line); }
.episode-drafts .section-head { flex-wrap: wrap; }
.episode-drafts .section-head .item-meta { margin-left: auto; }
.people-section > .list { margin-left: var(--space-4); }
/* Master breakdown: a table per episode; the strip colour on the left edge, flags in their own column. */
.bd-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.bd-bar .seg { display: inline-flex; align-items: center; gap: var(--space-1); }
.breakdown-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); table-layout: fixed; min-width: 900px; }
.breakdown-table th:nth-child(1) { width: 4.5%; } .breakdown-table th:nth-child(2) { width: 25%; } .breakdown-table th:nth-child(3) { width: 6%; }
.breakdown-table th:nth-child(4) { width: 12%; } .breakdown-table th:nth-child(5) { width: 14%; } .breakdown-table th:nth-child(6) { width: 9%; }
.breakdown-table th:nth-child(7) { width: 13%; } .breakdown-table th:nth-child(8) { width: 16.5%; }
/* A series: E1, E2… first */
.breakdown-table.has-ep th:nth-child(1) { width: 3.5%; } .breakdown-table.has-ep th:nth-child(2) { width: 4.5%; } .breakdown-table.has-ep th:nth-child(3) { width: 24%; }
.breakdown-table.has-ep th:nth-child(4) { width: 5.5%; } .breakdown-table.has-ep th:nth-child(5) { width: 12%; } .breakdown-table.has-ep th:nth-child(6) { width: 13%; }
.breakdown-table.has-ep th:nth-child(7) { width: 9%; } .breakdown-table.has-ep th:nth-child(8) { width: 12.5%; } .breakdown-table.has-ep th:nth-child(9) { width: 16%; }
.breakdown-table .ep-cell { color: var(--muted); font-weight: 600; white-space: nowrap; }
.breakdown-table th, .breakdown-table td { padding: 6px var(--space-2); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.breakdown-table thead th { background: var(--surface-2); color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; position: sticky; top: 0; }
.breakdown-table .num { text-align: right; }
.breakdown-table tbody tr { cursor: pointer; }
.breakdown-table tbody tr:hover td { background: var(--brand-soft); }
.breakdown-table tr.omitted td { opacity: 0.55; text-decoration: line-through; }
.breakdown-table tr.saved td { transition: background 1s; background: var(--brand-soft); }
.breakdown-table tr.strip-int-day td:first-child { box-shadow: inset 5px 0 0 var(--strip-int-day); }
.breakdown-table tr.strip-ext-day td:first-child { box-shadow: inset 5px 0 0 var(--strip-ext-day); }
.breakdown-table tr.strip-int-night td:first-child { box-shadow: inset 5px 0 0 var(--strip-int-night); }
.breakdown-table tr.strip-ext-night td:first-child { box-shadow: inset 5px 0 0 var(--strip-ext-night); }
.breakdown-table tr.strip-twilight td:first-child { box-shadow: inset 5px 0 0 var(--strip-twilight); }
.breakdown-table .scene-no { font-family: var(--font-script); font-weight: 700; text-decoration: none; }
.breakdown-table .scene-line { font-family: var(--font-script); }
.breakdown-table .cast-cell { min-width: 6em; }
.cast-chip { display: inline-block; padding: 0 6px; margin: 1px 2px 1px 0; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); white-space: nowrap; }
.breakdown-table .remark-cell input { width: 100%; min-width: 10ch; border-color: transparent; background: transparent; }
.breakdown-table .remark-cell input:hover, .breakdown-table .remark-cell input:focus { border-color: var(--line); background: var(--surface); }
.breakdown-table .flag-cell { min-width: 9em; }
/* Scene page: the script on the left, everything about it beside it (stacked on a phone). */
.scene-split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: var(--space-4); align-items: start; }
.scene-split .scene-script { position: sticky; top: var(--space-2); max-height: calc(100vh - var(--space-4)); overflow-y: auto; }
.scene-split .script-panel { padding: var(--space-3); }
.scene-side > section { margin-top: var(--space-3); }
.scene-side .facts dt { display: flex; align-items: center; gap: 6px; }
/* The scene's side: one panel with tabs (Summary · Shots · Risk · Tasks & flags), the discussion under it */
.scene-tabs { padding: 0; overflow: hidden; }
.scene-tabbar { display: flex; border-bottom: 1px solid var(--line); background: var(--surface-2); overflow-x: auto; }
.scene-tabbar > button { flex: 1 0 auto; border: 0; border-radius: 0; min-height: 40px; padding: 0 var(--space-3); background: transparent; color: var(--muted); font-weight: 600; white-space: nowrap; }
.scene-tabbar > button + button { border-left: 1px solid var(--line); }
.scene-tabbar > button[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: inset 0 -3px 0 var(--brand-fg); }
.scene-tabpanel { padding: var(--space-3); }
.scene-tabpanel > .group-title, .scene-tabpanel h3.group-title { margin-top: var(--space-3); }
.scene-tabpanel > section > h2.group-title:first-child { display: none; }
.shot-list { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.shot-list > li { display: grid; grid-template-columns: 72px 1fr; gap: var(--space-2); align-items: start; border-bottom: 1px solid var(--line); padding-bottom: var(--space-2); }
.shot-list img, .shot-list .shot-no { width: 72px; height: 48px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; background: var(--surface-2); }
.shot-list .item-meta { display: block; }
.shot-desc { margin: 2px 0 0; font-size: var(--text-sm); }
/* Scene page: the discussion right under the tabs */
.scene-side > .scene-talk { margin: 0; border-top: 0; padding-top: var(--space-2); }
/* What each tab is for, at its top */
.tab-info { background: var(--surface-2); border-radius: var(--radius); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); font-size: var(--text-sm); color: var(--muted); }
.tab-info p { margin: 0 0 4px; } .tab-info ul { margin: 0; padding-left: 1.2em; }
/* Props by category: a coloured edge per category (props, wardrobe, HMU…), no swatches */
.prop-groups { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.prop-group { border-left: 4px solid var(--bd-c, var(--bd-other)); padding: 2px 0 2px var(--space-2); }
.prop-group .prop-cat { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bd-c, var(--muted)); }
/* Shots: a checklist */
.shot-list > li { grid-template-columns: auto 72px 1fr auto; }
.shot-list > li.done strong, .shot-list > li.done .shot-desc { text-decoration: line-through; color: var(--muted); }
.shot-add { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
.shot-add select { width: auto; } .shot-add input { flex: 1 1 12em; }
/* Revision colours on the script: lines changed by a revision carry its colour */
.rev-note { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin-bottom: var(--space-2); font-size: var(--text-sm); }
.rev-edit { display: inline-flex; align-items: center; }
.script p.rev-l { background: color-mix(in srgb, var(--rv) 32%, transparent); box-shadow: -8px 0 0 var(--rv); border-radius: 0; }
.rev-l-blue, .rev-l-double_blue { --rv: #9ec5f0; } .rev-l-pink, .rev-l-double_pink { --rv: #f5b8c9; } .rev-l-yellow, .rev-l-double_yellow { --rv: #f3e27a; }
.rev-l-green, .rev-l-double_green { --rv: #a9d9a0; } .rev-l-goldenrod { --rv: #daa520; } .rev-l-buff { --rv: #f0dc82; } .rev-l-salmon { --rv: #fa8072; }
.rev-l-cherry { --rv: #de3163; } .rev-l-white, .rev-l-double_white { --rv: #c9c9c9; }
@media (max-width: 960px) { .scene-split { grid-template-columns: 1fr; } .scene-split .scene-script { position: static; max-height: none; } }
/* Budget: the same section heading as People, its total on the right, tables indented under it. */
.budget-section .section-total { font-size: var(--text-lg); }
/* Same column widths in every section, so the amounts line up down the page. */
.budget-section table.budget { table-layout: fixed; width: 100%; }
.budget-section table.budget th:nth-child(1) { width: 38%; } .budget-section table.budget th:nth-child(2) { width: 11%; }
.budget-section table.budget th:nth-child(3) { width: 7%; } .budget-section table.budget th:nth-child(4) { width: 11%; }
.budget-section table.budget th:nth-child(5) { width: 18%; } .budget-section table.budget th:nth-child(6) { width: 11%; }
.budget-section table.budget th:nth-child(7) { width: 4%; }
.budget-section table.budget input, .budget-section table.budget select { width: 100%; max-width: 100%; }
/* Name and role stack like a Team row; the figures are centred under their headings. */
.budget-section table.budget th, .budget-section table.budget td { text-align: center; }
.budget-section table.budget th:first-child, .budget-section table.budget td:first-child { text-align: left; }
.budget-section table.budget .num { text-align: center; }
.budget-section table.budget td input, .budget-section table.budget td select { text-align: center; }
.budget-section table.budget .adjust-box { display: flex; gap: var(--space-1); }
.budget-section table.budget .adjust-box select { flex: 0 0 55%; } .budget-section table.budget .adjust-box input { flex: 1 1 auto; min-width: 0; }
.budget-section table.budget td.line-item input { text-align: left; }
.budget-section table.budget .line-role { margin-top: 1px; }
.budget-section table.budget tr.needs td { color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.budget-section table.budget tr.needs td input, .budget-section table.budget tr.needs td select { border-color: var(--accent); color: var(--accent); }
@media (max-width: 760px) { .budget-section table.budget { table-layout: auto; min-width: 640px; } }
.people-section > form.add-line, .people-section > form.inline, .people-section > p, .people-section > .notice { margin-left: var(--space-4); }
form.add-line { margin-top: var(--space-3); }
.totals-table { max-width: 520px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.section-head h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--brand-fg); font-weight: 600; margin: 0; }
.people-section .people-table td:first-child { width: 38%; }
.people-section .people-table td:nth-child(2) { width: 18%; }
.people-table input.remark { width: 100%; min-width: 12ch; border-color: transparent; background: transparent; }
.people-table input.remark:hover, .people-table input.remark:focus { border-color: var(--line); background: var(--surface); }
.people-table select.status[data-status='onboard'], .status-chip.onboard { color: var(--ok); }
.people-table select.status[data-status='negotiating'], .status-chip.negotiating { color: var(--warn); }
.status-chip { font-size: 0.8rem; font-weight: 600; }
.empty-section { border: 1px dashed var(--line); border-radius: var(--radius); padding: var(--space-2) var(--space-3); }
.people-section.clients { margin-top: 0; padding-top: 0; border-top: 0; }
.client-wrap { max-width: none; width: 100%; }
.clients-table .client-main { display: grid; gap: 0; line-height: 1.2; }
.clients-table .client-main .item-meta { font-size: 0.7rem; line-height: 1.2; }
.clients-table .person-cell .avatar { width: 30px; height: 30px; font-size: 0.68rem; }
.clients-table th:first-child, .clients-table td:first-child { width: 26%; }
.clients-table th:nth-child(2), .clients-table td:nth-child(2) { width: 20%; }
.clients-table th:nth-child(5), .clients-table td:nth-child(5) { width: 30%; }
.clients-table td:nth-child(5) input.remark { min-width: 100%; }

/* Locations: cards per place */
.loc-grid { list-style: none; padding: 0; margin: var(--space-3) 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.loc-grid > li { margin: 0; }
.loc-card { display: flex; flex-direction: column; gap: var(--space-1); height: 100%; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3); box-shadow: var(--shadow); transition: box-shadow 0.15s, border-color 0.15s; }
a.loc-card:hover { border-color: var(--brand-fg); box-shadow: var(--shadow-lift); color: inherit; }
.loc-name { font-size: var(--text-lg); }
.loc-foot { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: auto; padding-top: var(--space-2); }
.set-card { align-items: flex-start; }
details.more-sets summary { cursor: pointer; font-size: var(--text-sm); color: var(--brand-fg); }
details.more-sets .tag-picks { max-height: 30vh; overflow-y: auto; padding: var(--space-2) 0; }

/* Portal: actor and crew dashboard */
.next-call .big { font-size: 2rem; margin: 0; letter-spacing: -0.01em; }
ul.prep-list { list-style: none; padding: 0; margin: 0 0 var(--space-2); }
ul.prep-list li { display: flex; gap: var(--space-2); padding: var(--space-2) 0; border-bottom: 1px dashed var(--line); }
ul.prep-list li:last-child { border-bottom: 0; }
.prep-icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); }
.empty-state { text-align: center; padding: var(--space-5) var(--space-3); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.split-wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: var(--space-4); align-items: start; }
.split-wide .ask { position: sticky; top: var(--space-2); }
@media (max-width: 900px) { .split-wide { grid-template-columns: 1fr; } .split-wide .ask { position: static; } }
ol.sched-days { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.sched-day { display: grid; grid-template-columns: 150px 1fr; gap: var(--space-3); }
.sched-day.mine { border-left: 4px solid var(--brand-fg); }
.sched-date { display: flex; flex-direction: column; gap: 2px; }
.sched-day li.mine { font-weight: 600; }
@media (max-width: 560px) { .sched-day { grid-template-columns: 1fr; } }

/* Chat */
.chat { display: flex; flex-direction: column; gap: var(--space-2); }
.chat-reminder { margin: 0; font-size: var(--text-sm); color: var(--brand-fg); background: var(--brand-soft); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-style: italic; }
ol.chat-log { list-style: none; margin: 0; padding: var(--space-2); display: flex; flex-direction: column; gap: var(--space-2); max-height: 50vh; min-height: 120px; overflow-y: auto; background: var(--surface-2); border-radius: var(--radius-sm); }
.msg { max-width: 80%; align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 6px 12px; }
.msg.mine { align-self: flex-end; background: var(--brand-soft); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.msg.pending { opacity: 0.65; }
.msg-meta { font-size: 0.72rem; color: var(--muted); }
.msg-meta .link { margin-left: 4px; text-decoration: none; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-empty { align-self: center; margin: auto; }
form.chat-compose { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2); max-width: none; }
form.chat-compose select { grid-column: 1 / -1; min-height: 34px; }
form.chat-compose textarea { min-height: 44px; }
form.chat-compose .error { grid-column: 1 / -1; }

/* Gear check, prop & set check */
.check-tiles li.ok strong { color: var(--ok); }
.check-tiles li.bad strong { color: var(--accent); }
.filter-seg { margin: var(--space-2) 0 var(--space-3); }
form.check-add { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
form.check-add select { flex: 0 1 auto; }
ul.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.check-item { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); }
.check-item.st-ready { border-left-color: var(--ok); }
.check-item.st-missing, .check-item.st-broken { border-left-color: var(--accent); }
.check-item.st-replace { border-left-color: var(--warn); }
.check-main { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); align-items: center; }
.status-seg button { min-height: 32px; font-size: 0.8rem; padding: 0 10px; }
.status-seg button[aria-pressed='true'][data-set='ready'] { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); color: var(--ok); }
.status-seg button[aria-pressed='true'][data-set='missing'], .status-seg button[aria-pressed='true'][data-set='broken'] { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }
.status-seg button[aria-pressed='true'][data-set='replace'] { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); color: var(--warn); }
.state-pill.st-ready { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.state-pill.st-missing, .state-pill.st-broken { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.state-pill.st-replace { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.check-meta { margin-top: 4px; }
.check-thread { margin-top: var(--space-2); }

/* Wardrobe looks */
.look-char { margin-top: var(--space-4); }
ul.look-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-3); }
.look-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.look-pics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; background: var(--surface-2); aspect-ratio: 4 / 3; }
.look-pics a:only-child { grid-column: 1 / -1; grid-row: 1 / span 2; }
.look-pics img { width: 100%; height: 100%; object-fit: cover; display: block; }
.look-empty { grid-column: 1 / -1; display: grid; place-items: center; color: var(--muted); font-size: var(--text-sm); }
.look-body { padding: var(--space-2) var(--space-3) var(--space-3); display: grid; gap: var(--space-1); }
.look-body p { margin: 0; }
.look-status { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; color: var(--muted); }
.look-status.st-approved { color: var(--ok); }
.look-status.st-fitted { color: var(--brand-fg); }
.look-add { width: 100%; min-height: 220px; }
.look-body select.small { min-height: 32px; width: auto; font-size: var(--text-sm); }
.scene-picks { max-height: 30vh; overflow-y: auto; }

/* Storyboard */
ol.frame-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--space-2); display: flex; flex-direction: column; gap: var(--space-1); }
.frame[draggable='true'] { cursor: grab; }
.frame.dragging { opacity: 0.45; }
.frame-pic { position: relative; aspect-ratio: 16 / 9; background: var(--sketch-paper); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; display: grid; place-items: center; }
.frame-pic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.frame-empty { color: var(--sketch-grey); font-size: var(--text-sm); }
.frame-label { position: absolute; top: 6px; left: 6px; background: var(--brand); color: var(--brand-ink); border-radius: var(--pill); padding: 0 8px; font-size: 0.75rem; font-weight: 600; }
.frame-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.sb-mark { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-fg); text-decoration: none; vertical-align: middle; }
.sb-mark .icon { width: 14px; height: 14px; }
.frame-desc { margin: 0; font-size: var(--text-sm); }
.frame-dlg { margin: 0; }
.frame-actions { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: var(--space-1); }
.frame-actions .sb-draw { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--sb-draw); border-color: var(--sb-draw); color: var(--sb-draw-ink); }
.frame-actions .sb-draw:hover { background: var(--sb-draw); color: var(--sb-draw-ink); filter: brightness(1.08); }
.frame-actions-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.frame-actions-row .small { display: inline-flex; align-items: center; gap: 4px; }
.frame-actions-row .sb-add { margin-left: auto; }
@keyframes sb-bubble { from { opacity: 0; transform: translateX(-22px) scale(0.96); } to { opacity: 1; transform: none; } }
.frame.sb-new { animation: sb-bubble 0.35s ease-out; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2) var(--space-3); }
@media (max-width: 560px) { .row3 { grid-template-columns: 1fr 1fr; } }
textarea.script-input-sm { font-family: var(--font-script); }

/* Storyboard maker */
dialog.sketch-dialog { width: min(1800px, calc(100vw - 16px)); max-width: none; height: auto; max-height: calc(100dvh - 16px); padding: var(--space-3); display: flex; flex-direction: column; overflow: hidden; }
.sketch-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); flex-wrap: wrap; flex: 0 0 auto; }
.sketch-head h2 { margin: 0; font-size: var(--text-lg); }
.sketch-head-end { display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.sketch-body { display: flex; flex: 0 0 auto; min-height: 0; gap: var(--space-3); align-items: flex-start; }
.sketch-board { flex: 1 1 auto; min-width: 0; min-height: 0; display: grid; place-items: start center; }
.sketch-script { flex: 0 0 340px; height: 100%; overflow: auto; padding: var(--space-2) var(--space-3); }
.sketch-script .script { font-size: 0.86rem; }
.sketch-script-title { font-family: var(--font-script); font-size: 0.95rem; margin: var(--space-1) 0 var(--space-2); }
.sketch-opacity input[type=range] { width: 100px; margin-left: 6px; }
@media (max-width: 860px) {
  dialog.sketch-dialog { height: calc(100dvh - 12px); }
  .sketch-body { flex: 1 1 auto; flex-direction: column; align-items: stretch; }
  .sketch-script { flex: 0 0 auto; height: 24vh; width: 100%; }
}
.sketch-tools { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: var(--space-2) 0; flex: 0 0 auto; }
.sketch-pick { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); }
.sketch-pick select { min-height: 34px; }
.sketch-tools .seg button { min-height: 36px; min-width: 40px; padding: 0 8px; }
.ink-dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: middle; }
.ink-dot.ink-ink { background: var(--sketch-ink); } .ink-dot.ink-grey { background: var(--sketch-grey); }
.ink-dot.ink-red { background: var(--sketch-red); } .ink-dot.ink-blue { background: var(--sketch-blue); }
.ink-dot.ink-green { background: var(--sketch-green); } .ink-dot.ink-orange { background: var(--sketch-orange); }
.ink-dot.ink-purple { background: var(--sketch-purple); } .ink-dot.ink-brown { background: var(--sketch-brown); }
.sketch-stage { position: relative; max-width: 100%; max-height: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--sketch-paper); touch-action: none; }
.sketch-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sketch-overlay { pointer-events: none; }
.sketch-canvas { cursor: crosshair; }
.sketch-objectbar { position: absolute; z-index: 5; display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--surface); border: 2px solid var(--line); }
.sketch-objectbar[hidden], .sketch-obj-colors[hidden] { display: none; }
.sketch-objectbar button, .sketch-obj-colors button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; background: transparent; border: 0; border-radius: 0; color: var(--ink); cursor: pointer; }
.sketch-objectbar button:hover, .sketch-obj-colors button:hover { background: var(--brand-soft); color: var(--brand-fg); }
.sketch-objectbar button[hidden] { display: none; }
.sketch-objectbar button[data-obj="drag"] { cursor: grab; }
.sketch-objectbar button[data-obj="drag"]:active { cursor: grabbing; }
.sketch-objectbar button.danger { color: var(--accent); }
.sketch-objectbar button.danger:hover { background: var(--accent); color: var(--paper); }
.sketch-objectbar .icon { width: 20px; height: 20px; }
.sketch-objectbar .ink-dot, .sketch-obj-colors .ink-dot { width: 20px; height: 20px; border: 1px solid var(--line); }
.sketch-obj-colors { position: absolute; z-index: 6; display: flex; gap: 2px; padding: 3px; background: var(--surface); border: 2px solid var(--line); }
.sketch-obj-colors button { width: 30px; height: 30px; }
.sketch-linkbar { position: sticky; bottom: calc(-1 * var(--space-2)); margin: var(--space-2) calc(-1 * var(--space-3)) calc(-1 * var(--space-2)); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--old-paper-muted); background: var(--old-paper); }
.sketch-linkbar .hint { margin: 0 0 var(--space-1); }
.sketch-linkbar .actions { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.sketch-links { list-style: none; margin: 0 0 var(--space-1); padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 132px; overflow: auto; }
.sketch-links li { display: flex; align-items: center; gap: 4px; }
.sketch-links .script-quote { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sketch-links button { flex: 0 0 auto; }
.sketch-linkbar .small { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; }

/* A shot number in the script: superscript, small, clickable; the words the shot covers are faintly tinted. */
.script .shot-anchor { background: color-mix(in srgb, var(--brand) 26%, transparent); }
.script sup.shot-refs { line-height: 0; }
.shot-ref { display: inline-block; margin-left: 2px; padding: 0 3px; border: 1px solid var(--brand-fg); background: var(--brand-soft); color: var(--brand-fg); font-family: var(--font-ui); font-size: 0.62rem; font-weight: 700; line-height: 1.15; text-decoration: none; vertical-align: super; }
a.shot-ref:hover, a.shot-ref:focus-visible { background: var(--brand); color: var(--brand-ink); }

/* A scene's storyboard, opened from a shot number in the script. */
dialog.shot-dialog { width: min(1200px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow: auto; padding: var(--space-3); }
.shot-gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-3); }
.shot-card { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-2); border: var(--bw) solid var(--line); background: var(--surface); }
.shot-card.is-target { outline: 3px solid var(--brand-fg); outline-offset: 2px; }
.shot-pic { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); background: var(--sketch-paper); }
.shot-pic img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* Scene heading suggestions (writers' room) */
ul.slug-suggest { position: absolute; z-index: 60; list-style: none; margin: 0; padding: 4px 0; min-width: 220px; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); font-family: var(--font-script); font-size: 0.9rem; }
ul.slug-suggest li { padding: 4px 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
ul.slug-suggest li[aria-selected='true'], ul.slug-suggest li:hover { background: var(--brand-soft); color: var(--brand-fg); }
/* Characters and places look different in the list: a character has a filled dot, a place an outline. */
ul.slug-suggest li.kind-character::before, ul.slug-suggest li.kind-set::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
ul.slug-suggest li.kind-character::before { background: var(--brand); }
ul.slug-suggest li.kind-set::before { border: 1.5px solid var(--muted); border-radius: 0; }

/* Profile */
.profile-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.profile-head h1 { margin: 0; }
.profile-head .lede { margin: 0; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); align-items: start; }
.profile-grid .span-2 { grid-column: 1 / -1; }
.profile-grid form { max-width: none; }
@media (max-width: 760px) { .profile-grid { grid-template-columns: 1fr; } }
ul.device-list { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: grid; gap: var(--space-2); }
ul.device-list li { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
ul.device-list li.current { border-color: color-mix(in srgb, var(--brand-fg) 40%, transparent); background: var(--brand-soft); }
.device-icon { font-size: 1.4rem; flex: none; }
.device-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pager-mini { display: flex; align-items: center; justify-content: center; gap: var(--space-2); }
.pager-mini button { min-height: 32px; min-width: 36px; padding: 0; border-radius: var(--pill); }
.signout { text-align: center; margin-top: var(--space-4); }
table.budget tr.section th { background: var(--brand-soft); color: var(--brand-fg); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; padding-top: var(--space-3); }
table.budget tr.cat th { padding-left: var(--space-3); }
.line-note { max-width: 60ch; white-space: normal; }
ol.prep-days { list-style: none; padding: 0; margin: 0; }
/* Prep calendar: a month grid. Each kind of event its colour (writers' ink and act tones, so every theme has them);
   shooting days in the brand colour, the production's dates tinted. On a phone the cells show dots; tap a day. */
.ev-table_read { --ev: var(--ink-0); } .ev-fitting { --ev: var(--ink-4); } .ev-look_test { --ev: var(--act-5); }
.ev-acting_class { --ev: var(--ink-2); } .ev-stunt_class { --ev: var(--act-6); } .ev-rehearsal { --ev: var(--ink-3); }
.ev-photoshoot { --ev: var(--ink-5); } .ev-interview { --ev: var(--ink-6); } .ev-press { --ev: var(--ink-7); }
.ev-meeting { --ev: var(--tone-3); } .ev-recce { --ev: var(--act-4); } .ev-medical { --ev: var(--warn); }
.ev-dubbing { --ev: var(--act-1); } .ev-other { --ev: var(--muted); }
.prep-cal { padding: var(--space-3); margin-bottom: var(--space-4); }
.cal-nav { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.cal-nav .cal-title { margin: 0 var(--space-2); font-size: var(--text-xl); min-width: 9em; text-align: center; }
.cal-nav button[data-step] { width: 40px; padding: 0; }
.cal-nav #today { margin-left: auto; }
.cal-legend { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); padding: 0; margin: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--muted); }
.cal-legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 0; background: var(--ev, var(--line)); flex: none; }
.sw.shoot { background: var(--brand); }
.sw.prod { background: var(--brand-soft); border: 1px solid var(--brand-fg); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-dh { padding: 4px 6px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-cell { min-height: 110px; padding: 4px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); min-width: 0; }
.cal-cell.empty { background: var(--surface-2); }
.cal-cell.in-prod { background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); }
.cal-cell.past { opacity: 0.7; }
.cal-cell.today .cal-day { background: var(--brand); color: var(--brand-ink); }
.cal-day { align-self: flex-start; min-height: 0; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent; font-weight: 600; font-size: var(--text-sm); }
.cal-shoot { display: block; font-size: 0.75rem; font-weight: 700; color: var(--brand-ink); background: var(--brand); border-radius: 0; padding: 1px 6px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev { display: block; width: 100%; min-height: 0; text-align: left; font-size: 0.75rem; line-height: 1.3; padding: 2px 6px; border: 0; border-left: 3px solid var(--ev); border-radius: 0;
  background: color-mix(in srgb, var(--ev) 16%, var(--surface)); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ev:hover { background: color-mix(in srgb, var(--ev) 28%, var(--surface)); }
.ev-time { font-weight: 700; }
.ev-more { font-size: 0.75rem; align-self: flex-start; min-height: 0; padding: 0 2px; }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cal-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ev); }
.ev-tag { background: color-mix(in srgb, var(--ev) 18%, var(--surface)); border-color: var(--ev); color: var(--ink); }
.ev-line { display: flex; align-items: center; gap: var(--space-2); text-align: left; }
.prep-notes { white-space: pre-line; }
@media (max-width: 700px) {
  .cal-cell { min-height: 56px; padding: 2px; }
  .cal-cell .ev, .cal-cell .ev-more, .cal-shoot { display: none; }
  .cal-cell.shoot .cal-day { box-shadow: 0 0 0 2px var(--brand-fg); }
  .cal-dots { display: flex; }
  .cal-nav .cal-title { font-size: var(--text-lg); min-width: 0; }
}
.prep-card { border-left: 4px solid var(--tone-1); }
.prep-card.kind-fitting { border-left-color: var(--tone-4); }
.prep-card.kind-table_read, .prep-card.kind-rehearsal { border-left-color: var(--brand-fg); }
.prep-card.kind-stunt_class, .prep-card.kind-acting_class { border-left-color: var(--tone-2); }
.prep-card.kind-medical { border-left-color: var(--accent); }
.prep-card p { margin: 4px 0 0; }

/* Writers' room: characters to complete (KIV), and the nudge towards the room's ideas */
.char-card form.inline[data-arc] { display: grid; grid-template-columns: minmax(0, 1fr) 4.5em auto; flex-wrap: unset; }
.char-card form.inline[data-arc] input { min-width: 0; width: 100%; }
.char-card form.brief .row2 { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.char-card form.brief .row2 input { width: 100%; }
.char-card.kiv { border-color: color-mix(in srgb, var(--tomato) 45%, var(--line)); }
.kiv-tag { color: var(--tomato); border-color: color-mix(in srgb, var(--tomato) 55%, transparent); background: color-mix(in srgb, var(--tomato) 10%, var(--surface)); font-weight: 800; }
.notice.kiv-note { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.nudge { display: flex; gap: var(--space-3); align-items: flex-start; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand-fg) 25%, transparent); border-radius: var(--radius); padding: var(--space-2) var(--space-3); margin: var(--space-2) 0 var(--space-3); }
.nudge p { margin: 2px 0 0; font-size: var(--text-sm); }
.nudge-icon { font-size: 1.3rem; line-height: 1.4; }
ul.nudge-list { margin: 4px 0 0; padding-left: 1.1em; font-size: var(--text-sm); color: var(--muted); }
.nudge.small { padding: var(--space-2); margin-top: 0; }

/* ------------------------------------------------------------------------------------------------ spacing standard
   (founder's review, 2026-10-16). One rhythm for the Scheduler and the Writers' room: 16px under tabs, toolbars and
   help lines; 24px between groups; panels pad 16px; a page's first block has nothing above it; empty blocks take no
   room; content lines up with the page edge (no indents under group headings). */
section:empty { display: none; }
#pane, .board > section, .board-side section, .scene-tabpanel section, .scene-side > section, .day-panel { margin-top: 0; }
#pane > :first-child, .scene-tabpanel > :first-child, .tab-info + section > :first-child { margin-top: 0; }
#pane > .hint:first-child { margin-bottom: var(--space-3); }
.hint + .lede, .hint + .notice { margin-top: var(--space-2); }
.inner-tabs { margin: var(--space-3) 0; }
.sched-head .inner-tabs { margin-bottom: 0; }
.sched-bar, .board-bar { margin: var(--space-3) 0; }
.board-sel { margin: 0 0 var(--space-3); min-height: 0; }
.board-sel:empty { display: none; }
.filters, .filter-bar, .compact-filters { margin: 0 0 var(--space-3); }
.bd-bar { margin: 0 0 var(--space-3); }
.people-section { margin-top: var(--space-4); }
.bd-bar + .people-section, .hint + .people-section, .notice + .people-section { margin-top: var(--space-3); }
.people-section > .table-wrap, .people-section > .list, .people-section > .hint, .people-section > .empty-section,
.people-section > form.add-line, .people-section > form.inline, .people-section > p, .people-section > .notice { margin-left: 0; }
.people-section > .section-head { margin-bottom: var(--space-2); }
/* Tab buttons with a count keep it on the same line */
.side-panel-tabs > button, .side-tabs .seg > button, .scene-tabbar > button { white-space: nowrap; }
.side-panel-tabs > button { padding: 0 var(--space-2); font-size: var(--text-sm); }
.side-tabs .seg > button { padding: 0 var(--space-2); font-size: var(--text-sm); }
/* Pickers inside a help line stay their own width */
.hint select { width: auto; display: inline-block; min-height: 30px; margin-right: var(--space-1); }
/* Timeline: the arc picker doesn't stretch across the bar */
.filter-bar #arc { flex: 0 1 240px; }
/* Writers' room desk: list, page and context start on one line */
.writer { margin-top: var(--space-3); }
.desk-head { margin-bottom: var(--space-2); }
/* Scene page: panels start level; the script panel's title sits like the tab bar opposite */
.scene-split { margin-top: var(--space-3); }
.scene-split .script-panel > .group-title:first-child { margin-top: 0; }
.sched-head + .pager { margin-top: var(--space-3); }
#pane > .story-map, #pane .story-map { margin-top: 0; }

/* Scheduler: "How it works" — the four steps under the sub-tabs, the current one highlighted */
.sched-guide { margin: 0 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.sched-guide > summary { cursor: pointer; padding: var(--space-2) var(--space-3); font-size: var(--text-sm); font-weight: 600; color: var(--brand-fg); }
.sched-steps { list-style: none; margin: 0; padding: 0 var(--space-3) var(--space-2); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.sched-steps > li { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-2) var(--space-3); background: var(--paper); }
.sched-steps > li:not(:last-child)::after { content: '→'; position: absolute; right: calc(-1 * var(--space-2) - 2px); top: 50%; transform: translate(50%, -50%); color: var(--brand-fg); font-size: 0.9rem; }
.sched-steps > li.on { border-color: var(--brand-fg); background: var(--brand-soft); }
.sched-steps a { display: flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--ink); }
.sched-steps .step-no { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand); color: var(--brand-ink); font-size: 0.75rem; font-weight: 700; }
.sched-steps p { margin: 4px 0 0; font-size: var(--text-sm); color: var(--muted); line-height: 1.4; }
.sched-guide-foot { margin: 0; padding: 0 var(--space-3) var(--space-2); font-size: var(--text-sm); color: var(--muted); }
@media (max-width: 900px) { .sched-steps { grid-template-columns: 1fr 1fr; } .sched-steps > li::after { display: none; } }
@media (max-width: 520px) { .sched-steps { grid-template-columns: 1fr; } }

/* Prelim: filters, day cards, and one day's sheet in call sheet layout */
.prelim-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); font-size: var(--text-sm); }
.prelim-bar select { width: auto; min-height: 32px; font-size: var(--text-sm); }
.prelim-bar .prelim-help { margin-left: auto; }
.prelim-days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
.prelim-day { width: 100%; height: 100%; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: var(--space-3); border: 1px solid var(--line); border-left: 4px solid var(--brand-fg);
  border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.prelim-day:hover, .prelim-day:focus-visible { border-color: var(--brand-fg); box-shadow: none; }
.prelim-day.shot { border-left-color: var(--line); opacity: 0.7; }
.prelim-day .pd-top { display: flex; align-items: baseline; gap: var(--space-1); font-size: var(--text-lg); }
.prelim-day .pd-top .tag { margin-left: auto; }
.prelim-day .pd-of { color: var(--muted); font-size: var(--text-sm); }
.prelim-day .pd-date { font-weight: 600; }
.prelim-day .pd-call { color: var(--brand-fg); font-size: var(--text-sm); font-weight: 600; }
.prelim-day .pd-meta, .prelim-day .pd-loc { color: var(--muted); font-size: var(--text-sm); }
.prelim-empty { padding: var(--space-4) 0; }
.prelim-tools { gap: var(--space-2) var(--space-3); }
.prelim-tools .day-nav { display: inline-flex; align-items: center; gap: 4px; }
.prelim-tools select { width: auto; min-height: 32px; }

.prelim-sheet { background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3); font-size: 0.85rem; }
.prelim-sheet p { margin: 0; }
.ps-top { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: var(--space-2); align-items: stretch; margin-bottom: var(--space-2); }
.ps-company { padding: var(--space-1) var(--space-2); }
.ps-colabel { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; }
.ps-co { font-weight: 700; text-transform: uppercase; margin-bottom: var(--space-2) !important; }
.ps-people { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--space-2); margin: 0; font-size: 0.8rem; }
.ps-people dt { font-weight: 600; } .ps-people dd { margin: 0; }
.ps-centre { display: flex; flex-direction: column; border: 1.5px solid var(--ink); text-align: center; }
.ps-kind { font-size: 0.75rem; letter-spacing: 0.2em; font-weight: 700; text-transform: uppercase; padding-top: 4px; }
.ps-title { font-size: 1.7rem; letter-spacing: 0.04em; text-transform: uppercase; margin: 2px 0 4px; padding: 0 var(--space-2); }
.ps-versions { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border-top: 1px solid var(--ink); font-size: 0.75rem; }
.ps-versions dt { text-align: right; padding: 1px 6px; font-weight: 600; } .ps-versions dd { text-align: left; margin: 0; padding: 1px 6px; text-transform: uppercase; }
.ps-crewcall { flex: 1; display: flex; flex-direction: column; justify-content: center; border-top: 1px solid var(--ink); background: var(--brand-soft); padding: var(--space-2);
  font-size: 1.1rem; font-weight: 700; text-transform: uppercase; }
.ps-crewcall strong { font-size: 1.8rem; }
.ps-day { border: 1.5px solid var(--ink); display: flex; flex-direction: column; }
.ps-date { text-align: center; font-size: 1.05rem; font-weight: 700; padding: 4px; border-bottom: 1px solid var(--ink); }
.ps-dayno { text-align: center; font-size: 1.3rem; font-weight: 800; padding: 4px; border-bottom: 1px solid var(--ink); text-transform: uppercase; }
.ps-times { display: grid; grid-template-columns: 1fr auto; margin: 0; border-bottom: 1px solid var(--ink); }
.ps-times dt { font-size: 0.72rem; text-transform: uppercase; font-weight: 600; padding: 2px 6px; text-align: right; border-bottom: 1px solid var(--line); }
.ps-times dd { margin: 0; padding: 2px 8px; font-weight: 700; border-bottom: 1px solid var(--line); }
.ps-weather { text-align: center; padding: 4px; }
.ps-wtitle { font-weight: 700; text-transform: uppercase; font-size: 0.8rem; }
.ps-wsky { font-style: italic; font-weight: 600; }
.ps-sun { font-size: 0.75rem; }
.ps-grid { width: 100%; border-collapse: collapse; margin-bottom: var(--space-2); }
.ps-grid th, .ps-grid td { border: 1px solid var(--ink); padding: 3px 6px; vertical-align: top; }
.ps-grid thead th { background: var(--surface-2); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; text-align: center; }
.ps-grid td.c { text-align: center; } .ps-grid td.r { text-align: right; font-weight: 600; }
.ps-places td { font-family: var(--font-script); font-size: 0.95rem; text-align: center; width: 25%; }
.ps-places td small { font-family: var(--font-ui); }
.ps-missing { color: var(--accent); font-family: var(--font-ui); }
.ps-notes { border: 1px solid var(--ink); margin-bottom: var(--space-2); font-size: 0.78rem; font-style: italic; text-align: center; }
.ps-notes p { padding: 3px 6px; border-bottom: 1px solid var(--line); } .ps-notes p:last-child { border-bottom: 0; }
.ps-scenes .w-desc { width: 42%; text-align: left; }
.ps-scenes td.w-desc strong { display: block; text-transform: uppercase; font-size: 0.8rem; }
.ps-scenes td.w-desc small { display: block; font-style: italic; font-size: 0.72rem; }
.ps-banner td { background: var(--surface-2); font-weight: 600; }
.ps-total td { border-left: 0; border-right: 0; border-bottom: 0; }
.ps-cast td { font-size: 0.8rem; }
.ps-bottom { display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--space-2); align-items: start; }
.ps-depts th[scope=row], .ps-advance th[scope=row] { width: 22%; background: var(--surface-2); font-size: 0.75rem; text-align: center; vertical-align: middle; }
.ps-item { display: inline-block; margin: 0 var(--space-2) 2px 0; } .ps-item small { color: var(--muted); }
@media screen and (max-width: 900px) { .ps-top, .ps-bottom { grid-template-columns: 1fr; } .prelim-sheet { overflow-x: auto; } }
/* Read-script button beside each scene number; call times editable in place (call sheet editors); the viewer's own rows. */
.ps-read { padding: 0 2px; vertical-align: middle; }
.ps-read svg { width: 1em; height: 1em; }
.prelim-sheet .ps-time { width: 6em; min-height: 0; height: 1.7em; padding: 0 2px; margin: 0; font: inherit; font-weight: 700; text-align: center; border: 1px solid var(--line); border-radius: 0; background: var(--paper); box-shadow: none; }
.prelim-sheet .ps-time::-webkit-calendar-picker-indicator { margin: 0; padding: 0; width: 0.9em; }
.ps-crew td { padding-top: 1px; padding-bottom: 1px; }
.prelim-sheet tr.me td { background: var(--brand-soft); font-weight: 700; }
.ps-crew .ps-dept th { background: var(--surface-2); text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.ps-crew td:first-child { width: 34%; }
.cs-notes { margin-top: var(--space-3); }
.cs-notes label { display: block; margin-top: var(--space-2); }
.mine.no-print { margin: 0 0 var(--space-2); }
@media print {
  body:has(.prelim-sheet) #shell, body:has(.prelim-sheet) .sched-head, body:has(.prelim-sheet) .prelim-tools { display: none !important; }
  /* On paper: the same layout as on screen, on one A4 page, white, with the shaded cells kept. */
  @page { size: A4 portrait; margin: 8mm; }
  body:has(.prelim-sheet), body:has(.prelim-sheet) main.wrap { background: var(--paper) !important; margin: 0; padding: 0; max-width: none; }
  .prelim-sheet { background: transparent; border: 0; border-radius: 0; padding: 0; font-size: 7.5pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .prelim-sheet .ps-top { grid-template-columns: 1fr 1.4fr 1fr; }
  .prelim-sheet .ps-bottom { grid-template-columns: 1fr 1.6fr; }
  .prelim-sheet .ps-title { font-size: 16pt; }
  .prelim-sheet .ps-crewcall strong { font-size: 16pt; }
  .prelim-sheet .ps-crewcall { font-size: 10pt; }
  .prelim-sheet .ps-dayno { font-size: 12pt; }
  .prelim-sheet .ps-places td { font-size: 8pt; }
  .prelim-sheet .ps-grid th, .prelim-sheet .ps-grid td { padding: 2px 4px; }
  .prelim-sheet .ps-grid tr { break-inside: avoid; }
  .prelim-sheet .ps-read, .cs-notes { display: none !important; }
  .prelim-sheet .ps-time { border: 0; padding: 0; width: auto; }
  .prelim-sheet tr.me td { background: transparent; }
}

/* Writers' room tidy-up (2026-10-16) */
/* Character modal: one neat form — Age beside Protagonist / Antagonist */
.char-card form.brief .row2 { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-4); }
.char-card form.brief .row2 > label:not(.check) { flex: 0 1 12em; }
.char-card form.brief .row2 > label.grow { flex: 1 1 16em; }
.char-card form.brief .row2 input:not([type=checkbox]) { width: 100%; flex: none; }
.char-card form.brief .row2 > label.check { flex: 0 0 auto; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
.char-card form.brief .row2 input[type=checkbox], .char-card .row2 input[type=checkbox] { width: auto; flex: none; }
.char-card form.brief .actions { margin-top: var(--space-1); }
.char-card .ref-images { align-self: flex-start; max-width: none; justify-content: flex-start; margin: var(--space-1) 0; }
.char-card h4 { margin: var(--space-4) 0 var(--space-1); }
.char-card form.rel-add { margin-top: var(--space-2); }
/* Synopsis: episodes line up with the page edge, a small even gap between them */
.episode-stories { margin-left: 0; gap: var(--space-2); }
.episode-stories > .panel { margin: 0; }
/* Ideas: the title box and the detail box end on the same line */
form.jot { grid-template-columns: auto minmax(0, 1fr); }
form.jot > button { grid-column: 1 / -1; justify-self: start; }
/* Timeline: the form's buttons sit level with "+ Add act"; the act lanes follow the help line closely */
.filter-bar form.inline { margin-top: 0; }
.timeline > section { margin-top: 0; }
.story-map + .hint { margin: 0 0 var(--space-2); }

/* Pre-Production tidy-up (2026-10-16): every page = title (+ actions) → one help line → its content, boxed */
.head + .page-hint, .head + .hint { margin: calc(-1 * var(--space-2)) 0 var(--space-3); }
.page-hint { margin: 0 0 var(--space-3); }
.boxed-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 var(--space-3); }
.boxed-list > li:last-child { border-bottom: 0; }
.list.boxed-list { border-top: 1px solid var(--line); }
.split > section, .split > div > section:first-child { margin-top: 0; }

/* Scripts desk side list: folder tabs (Scenes · Episodes · Characters · Arcs); folded away, a rail of the same tabs */
.side-list > .folder-tabs { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-end; gap: 2px; padding: var(--space-2) var(--space-1) 0;
  background: var(--surface-2); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.folder-tabs > button[role=tab] { flex: 0 0 auto; margin-bottom: -1px; padding: 4px 8px; min-height: 30px; border: 1px solid var(--line); border-bottom-color: var(--line);
  border-radius: 8px 8px 0 0; background: color-mix(in srgb, var(--surface-2) 70%, var(--line)); color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.folder-tabs > button[role=tab][aria-selected='true'] { background: var(--surface); color: var(--ink); font-weight: 700; border-bottom-color: var(--surface); }
.folder-tabs > button[role=tab] .count-soft { font-size: 0.68rem; }
.folder-tabs > .fold-btn { margin: 0 0 4px auto; flex: 0 0 auto; min-height: 26px; padding: 0 8px; font-size: 0.8rem; background: transparent; border: 1px solid var(--line); border-radius: var(--radius); }
.side-list > .side-top { top: 39px; }
.side-list .side-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; width: 100%; text-align: left; padding: var(--space-1) var(--space-2);
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font: inherit; font-size: var(--text-sm); color: var(--ink); cursor: pointer; }
.side-list .side-item:hover { background: var(--brand-soft); }
.side-list .side-item .item-meta { flex-basis: 100%; }
.arc-group { border-bottom: 1px solid var(--line); }
.arc-group .side-item.arc-name { border-bottom: 0; font-weight: 700; }
.arc-beats { margin: 0; padding: 0 var(--space-2) var(--space-2) calc(var(--space-2) + 1.2em); font-size: var(--text-sm); }
.arc-beats li { margin: 2px 0; }
.arc-beats .tag { text-decoration: none; }
.char-link { font-weight: 700; padding: 0; text-align: left; }
.writer.side-hidden { grid-template-columns: auto 1fr minmax(200px, 280px); }
.context-rail { align-self: start; }
.side-rail { position: sticky; top: var(--space-2); display: flex; flex-direction: column; gap: 2px; }
.rail-tab { writing-mode: vertical-rl; padding: var(--space-2) 6px; min-height: 0; font-size: var(--text-sm); border: 1px solid var(--line); border-left: 0;
  border-radius: 0 8px 8px 0; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.rail-tab.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--brand-fg); }
@media (max-width: 900px) { .side-rail { position: static; flex-direction: row; flex-wrap: wrap; } .rail-tab { writing-mode: horizontal-tb; border-radius: 8px 8px 0 0; border-left: 1px solid var(--line); } }
.side-list > * { flex-shrink: 0; }
.side-list .side-item { height: auto; min-height: 0; line-height: 1.35; }
.writer:not(.side-hidden) { grid-template-columns: minmax(240px, 310px) 1fr minmax(200px, 280px); }
.folder-tabs > button[role=tab] { padding: 3px 6px; font-size: 0.74rem; }
.folder-tabs > .fold-btn { padding: 0 6px; }

/* Scripts desk: the episode and its version on one line; one tool bar under it — filters left, actions right */
.icon { display: inline-block; vertical-align: -3px; flex: 0 0 auto; }
.desk-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-2); }
.desk-title h2 { margin: 0; }
.desk-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3);
  padding: var(--space-2); margin: 0 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.desk-filters, .desk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.desk-filters select { width: auto; max-width: 240px; min-height: 36px; font-size: var(--text-sm); }
.desk-actions button, .desk-actions .button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; padding: 0 8px !important; }
.icon-btn.danger { color: var(--accent); }
.icon-seg > button { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; padding: 0 10px; }
.ink-menu { position: relative; }
.ink-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--space-3); cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: var(--text-sm); }
.ink-menu > summary::-webkit-details-marker { display: none; }
.ink-menu[open] > summary { border-color: var(--brand-fg); color: var(--brand-fg); }
.ink-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 240px; padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lift); }
.ink-pop .ink-picker { flex-direction: column; gap: var(--space-1); }
.ink-pop select { width: auto; min-height: 32px; font-size: var(--text-sm); }

/* Character card: in boxes — the header (name, images) across, then Profile · Relationships · Arc, Appearances across */
dialog.char-dialog { width: min(980px, calc(100vw - 32px)); padding: var(--space-3); }
.char-card.char-boxes { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.char-boxes > .char-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--space-3); margin: 0; min-width: 0; }
.char-boxes > .char-box-head, .char-boxes > .char-box-wide { grid-column: 1 / -1; }
.char-boxes > .char-box-head { background: var(--surface-2); }
.char-boxes > .char-box:nth-of-type(2) { grid-row: span 2; }
.char-boxes .char-box > h4 { margin: 0 0 var(--space-2); padding-bottom: var(--space-1); border-bottom: 1px solid var(--line); }
.char-boxes .char-box form.brief { gap: var(--space-2); }
.char-boxes .char-box form.inline { margin-top: var(--space-2); }
.char-boxes .char-box form.rel-add { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.char-boxes .char-box form.rel-add > .script-line { grid-column: 1 / -1; }
.char-boxes .char-box form.rel-add > input, .char-boxes .char-box form.rel-add > button { grid-column: auto; }
.char-boxes .char-box form.rel-add > select { width: 100%; }
@media (max-width: 760px) { .char-card.char-boxes { grid-template-columns: 1fr; } .char-boxes > .char-box:nth-of-type(2) { grid-row: auto; } }
.char-table tfoot td { border-top: 2px solid var(--line); font-weight: 700; background: var(--surface-2); padding-top: var(--space-2); padding-bottom: var(--space-2); }
.char-table tfoot td.item-meta { font-weight: 400; }
/* Storyboard: a compact filter on top of the scene list */
.sb-filter { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: var(--space-1); padding: var(--space-2); background: var(--surface); border-bottom: 1px solid var(--line); }
.sb-filter select, .sb-filter input { flex: 1 1 100%; width: 100%; min-height: 34px; font-size: var(--text-sm); }
.sb-filter #sb-count:empty { display: none; }
.split > .side-list > a[hidden], .split > .side-list > .side-head[hidden] { display: none; }

/* Locations: cards with the set first and the real place under it, a tick once approved; the location page in boxes */
.loc-card { position: relative; }
.loc-set { display: block; font-size: 0.85rem; color: var(--muted); margin: 0 0 2px; }
.loc-card .loc-set { padding-right: 28px; }
.loc-approved { position: absolute; top: var(--space-2); right: var(--space-2); width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ok); color: var(--paper); font-weight: 800; font-size: 0.85rem; }
.loc-approved.inline { position: static; vertical-align: middle; margin-left: var(--space-1); width: 26px; height: 26px; }
.loc-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.loc-head { align-items: flex-start; }
.loc-head h1 { margin: 0; }
.loc-head .loc-set { font-size: 0.95rem; }
.box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--space-3); margin: 0 0 var(--space-3); min-width: 0; }
.box > .box-title, .box > section > h2:first-child, #tasks.box > h2:first-child { margin: 0 0 var(--space-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.box-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-3); align-items: start; }
.box-grid > .box { margin: 0; }
.loc-form { max-width: none; display: block; }
.loc-form .box label { margin-bottom: var(--space-2); display: block; }
.empty-box { text-align: center; padding: var(--space-4); }
.photo-box { padding: var(--space-2); }
.carousel { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); aspect-ratio: 16 / 7; }
.carousel-main, .carousel-main img { display: block; width: 100%; height: 100%; object-fit: cover; }
.carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; padding: 0; font-size: 1.4rem; line-height: 1;
  background: color-mix(in srgb, var(--paper) 85%, transparent); border: 1px solid var(--line); }
.carousel-nav.prev { left: var(--space-2); } .carousel-nav.next { right: var(--space-2); }
.carousel-count { position: absolute; right: var(--space-2); bottom: var(--space-2); padding: 2px 8px; border-radius: var(--pill); font-size: 0.75rem; background: color-mix(in srgb, var(--ink) 65%, transparent); color: var(--paper); }
.carousel-strip { display: flex; gap: var(--space-1); overflow-x: auto; padding-top: var(--space-2); }
.carousel-strip .thumb { flex: 0 0 auto; width: 84px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 0; overflow: hidden; }
.carousel-strip .thumb.on { border-color: var(--brand-fg); }
.carousel-strip .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel-empty { display: flex; align-items: center; justify-content: center; min-height: 140px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); }
.photo-add { padding-top: var(--space-2); }
.set-table { width: 100%; }
.set-table td { vertical-align: top; }
.set-table td.r { text-align: right; }
.scene-nums { display: flex; flex-wrap: wrap; gap: 4px; }
.scene-num { min-width: 34px; min-height: 28px; padding: 0 8px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; font-size: 0.8rem; }
.scene-num:hover { border-color: var(--brand-fg); color: var(--brand-fg); }
.read-script { max-height: 70vh; overflow-y: auto; padding: var(--space-2); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.dialog-top h2 { margin: 0; }
/* Close X in edit/debug modals: top right, slightly red; hover fills red. */
.dialog-x, .icon-btn.dialog-x { color: color-mix(in srgb, var(--accent) 55%, var(--ink)); }
button.icon-btn.dialog-x:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.loc-sets { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 var(--space-1); }
.loc-sets .tag { font-size: 0.72rem; }

/* Locations, compact (2026-10-16): three columns of boxes, schedule-style set tables, icon buttons */
.box { padding: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.box > .box-title { margin-bottom: var(--space-1); }
.box label { margin-bottom: 6px; }
.box input, .box select, .box textarea { min-height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: var(--text-sm); }
.box .row { gap: var(--space-2); }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-1); }
.box-head .box-title { margin: 0; }
.add-inline { margin: 0; flex-wrap: nowrap; gap: 4px; }
.add-inline select { max-width: 280px; min-height: 32px; font-size: var(--text-sm); }
.loc-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); align-items: start; }
.loc-col > .box { margin-bottom: var(--space-2); }
@media (max-width: 1000px) { .loc-cols { grid-template-columns: 1fr; } }
.save-row { margin: 0 0 var(--space-3); }
.icon-text { display: inline-flex; align-items: center; gap: 6px; }
.loc-approvals { display: block; font-size: 0.78rem; color: var(--ok); font-weight: 600; margin-top: 2px; }
.sched-table { width: 100%; font-size: var(--text-sm); border-collapse: collapse; }
.sched-table th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); text-align: left; padding: 6px 8px; background: var(--surface-2); }
.sched-table td { padding: 4px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.sched-table td.c, .sched-table th:first-child { text-align: center; width: 1%; white-space: nowrap; }
.sched-table td.r { text-align: right; width: 1%; white-space: nowrap; }
.sched-table td.scene-line { font-size: 0.8rem; }
.sched-table tr.set-row td { background: var(--surface-2); font-weight: 700; padding-top: 6px; padding-bottom: 6px; }
.sched-table .icon-btn { min-width: 30px; min-height: 30px; padding: 0 4px !important; }
.icon-btn.danger { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.loc-card.set-card { width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.loc-grid { gap: var(--space-2); }
.loc-card { padding: var(--space-2) var(--space-3); }
.box-head > .box-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* Pre-Production → Props & Atmosphere */
.props-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.props-filter input[type=search] { flex: 1 1 220px; min-height: 34px; font-size: var(--text-sm); }
.props-filter select { width: auto; max-width: 220px; min-height: 34px; font-size: var(--text-sm); }
.props-filter label.check { font-size: var(--text-sm); }
.props-table .prop-row { cursor: pointer; }
.props-table .prop-row:hover, .props-table .prop-row.on { background: var(--brand-soft); }
.props-table .chips { display: flex; flex-wrap: wrap; gap: 3px; }
.props-table .chip-item { padding: 0 6px; font-size: 0.72rem; }
.chip-item.has-cond { border-color: var(--warn); }
.prop-card-row > td { background: var(--surface-2); padding: var(--space-2) !important; }
.prop-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-2); align-items: start; }
.prop-card > .box { margin: 0; }
.prop-card > .box:last-child { grid-column: 1 / -1; }
.prop-card form { max-width: none; gap: var(--space-2); }
.who-uses { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); border: 0; padding: 0; margin: 0; }
.who-uses legend { font-size: var(--text-sm); color: var(--muted); margin-bottom: 4px; }
.cond-input { min-height: 30px; font-size: var(--text-sm); width: 100%; }
.pst-needed { background: var(--surface-2); } .pst-sourcing { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); }
.pst-ready { background: color-mix(in srgb, var(--ok) 20%, var(--surface)); } .pst-issue { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.dispute-list { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.dispute-list > li { border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--radius); padding: var(--space-1) var(--space-2); }
.dispute-list > li.resolved { border-left-color: var(--ok); opacity: 0.8; }
.dispute-list p { margin: 2px 0; }
.day-props .box-head select { width: auto; min-height: 32px; font-size: var(--text-sm); }
@media (max-width: 900px) { .prop-card { grid-template-columns: 1fr; } }
.props-table td:first-child, .day-props .sched-table td:first-child { min-width: 170px; }
.props-table td:first-child strong, .day-props .sched-table td:first-child strong { white-space: nowrap; }

/* ---- Props & Set Dressing: omitted items, set builds; looks (wardrobe, make-up, effects); sign-off (2026-10-16) */
.pst-omitted { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); color: var(--accent); }
.props-table tr.omitted > td, .prop-card-row.omitted > td { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.props-table tr.omitted strong { color: color-mix(in srgb, var(--accent) 70%, var(--ink)); }
.nowrap { white-space: nowrap; }
.page-hint-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.page-hint-row .page-hint { flex: 1; }
.sign-off { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.sign-off .sign { display: inline-flex; align-items: center; gap: 2px; font-size: 0.72rem; border: 1px solid var(--line); border-radius: var(--pill); padding: 0 8px; color: var(--muted); background: var(--surface); }
.sign-off .sign .icon { width: 12px; height: 12px; }
.sign-off .sign.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.sign-off .sign.no { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); text-decoration: line-through; }
.pic-strip + .pic-strip { margin-top: var(--space-3); }
.pic-strip-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.pic-strip-head h4 { margin: 0; font-size: var(--text-sm); }
.pic-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--space-1); }
.pic-row img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.build-list { display: grid; gap: var(--space-3); }
.build-card { padding: 0; overflow: hidden; }
.build-card.on { box-shadow: var(--shadow-lift); }
.build-head { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-3); }
.build-head:hover { background: var(--surface-2); }
.build-head:focus-visible { outline: 2px solid var(--brand-fg); outline-offset: -2px; }
.build-name { flex: 1 1 220px; }
.build-body { padding: 0 var(--space-3) var(--space-3); border-top: 1px solid var(--line); }
.build-body > .box-grid { margin-top: var(--space-3); }
.meter { appearance: none; width: 90px; height: 6px; border: 0; border-radius: var(--pill); background: var(--surface-2); overflow: hidden; vertical-align: middle; accent-color: var(--brand); }
.meter::-webkit-progress-bar { background: var(--surface-2); border-radius: var(--pill); }
.meter::-webkit-progress-value { background: var(--brand); border-radius: var(--pill); }
.meter::-moz-progress-bar { background: var(--brand); border-radius: var(--pill); }
.bst-ready { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.bst-building, .bst-finishing { color: var(--brand-fg); background: var(--brand-soft); }
.bst-struck { text-decoration: line-through; }
tr.bstate-damaged > td { background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
tr.bstate-collapses > td, tr.bstate-destroyed > td { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.warn-box { margin-top: var(--space-3); }
.warn-box ul { margin: var(--space-1) 0 0; padding-left: 1.2em; }
.add-scene { margin-top: var(--space-2); flex-wrap: wrap; }
.add-scene select:first-child { flex: 1 1 280px; }
.look-open { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; width: 100%; height: 100%; }
.look-open:focus-visible { outline: 2px solid var(--brand-fg); outline-offset: -2px; }
.look-card.on { border-color: var(--brand-fg); box-shadow: var(--shadow-lift); }
.look-pics img:only-child { grid-column: 1 / -1; grid-row: 1 / span 2; }
.look-add { min-height: 120px; height: 100%; }
.look-detail { margin-top: var(--space-3); background: var(--paper); }
.uncovered { margin: calc(-1 * var(--space-1)) 0 var(--space-2); color: var(--warn); }
tr.has-change > td { background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.fitting-form { flex-wrap: wrap; }
.fitting-form input[name=place] { flex: 1 1 220px; }
label.narrow { max-width: 150px; }
.tabs.subtabs { flex-wrap: wrap; row-gap: 0; }
ul.look-grid > li:only-child .look-add { min-height: 56px; }
.look-add-cell { display: grid; gap: var(--space-2); align-content: start; }
.look-add-cell .look-add { height: auto; min-height: 56px; }

/* =====================================================================================================================
   Brut layer (2026-10-16, ADR-0020): the shared components in the reference board's language — black frames, square
   corners, Anton titles, small bold capitals for labels and buttons, black (--brand, Mono) for actions and the current place,
   red (--accent) only for now-shooting and critical. Later in the file on purpose: it wins over the per-screen rules.
   ===================================================================================================================== */

/* Header: a row of boxes — wordmark | tools — then the project's title and its tabs as boxes */
#shell { background: var(--paper); border-bottom: var(--bw) solid var(--line); }
#shell > .bar { padding-top: 0; padding-bottom: 0; align-items: stretch; min-height: 60px; }
.wordmark { font-family: var(--font-display); font-style: normal; font-weight: 400; font-size: 2rem; line-height: 1; text-transform: uppercase; color: var(--ink);
  letter-spacing: -0.005em; display: flex; align-items: center; padding: var(--space-2) var(--space-3) var(--space-2) 0; border-right: var(--bw) solid var(--line); }
.wordmark:hover { color: var(--brand-ink); background: var(--brand); }
.bar-right { align-items: stretch; gap: 0; }
.bar-right > * { display: flex; align-items: center; padding: 0 var(--space-3); border-left: var(--bw) solid var(--line); }
.bar-right > :empty { display: none; }
.langs { background: transparent; border: 0; border-left: var(--bw) solid var(--line); border-radius: 0; padding: 0 var(--space-2); gap: 0; }
.langs button { min-height: 30px; min-width: 36px; border: var(--bw) solid var(--line); margin-left: -2px; font-size: 0.7rem; background: var(--paper); }
.langs button[aria-pressed='true'] { background: var(--brand); color: var(--brand-ink); }
.alerts, .account { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); min-height: 0; }
.alerts:hover, .account:hover { background: var(--ink); color: var(--paper); }
.alerts[aria-current='page'], .account[aria-current='page'] { background: var(--brand); color: var(--brand-ink); }
.count, .alerts .count { background: var(--accent); color: var(--accent-ink); border-radius: 0; padding: 0 5px; font-size: 0.7rem; font-weight: 800; line-height: 1.5; }
.avatar { border-radius: 0; background: var(--ink); color: var(--paper); font-weight: 800; }
.account:hover .avatar { background: var(--brand); color: var(--brand-ink); }
.dev-btn { border-radius: 0; background: var(--ink); color: var(--paper); }
#shell .project-bar { border-top: var(--bw) solid var(--line); padding-top: 0; }
/* The project's title, centred like a title card: "{company} presents" small above it (founder, 2026-10-17). */
.project-head { padding: var(--space-3) 0 var(--space-2); display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-1); }
.project-head .presents { margin: 0; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.project-title { font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; text-transform: uppercase; overflow-wrap: anywhere; }
.project-title:hover { color: var(--brand-ink); background: var(--brand); }
.stage-badge { color: var(--brand-ink); background: var(--brand); padding: 1px 6px; font-weight: 800; border: var(--bw) solid var(--line); }

/* Tabs */
.tabs { gap: 0; }
.tabs a, .tabs .tab-off { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.tabs.stages { gap: 0; padding: 0; margin: var(--space-1) 0 0; border: var(--bw) solid var(--line); border-bottom: 0; width: max-content; max-width: 100%; }
.tabs.stages a, .tabs.stages .tab-off { border: 0; border-right: var(--bw) solid var(--line); border-radius: 0; padding: 10px var(--space-3); color: var(--ink); font-size: 0.75rem; }
.tabs.stages > :last-child { border-right: 0; }
.tabs.stages a:hover { background: var(--ink); color: var(--paper); }
.tabs.stages a[aria-current='true'], .tabs.stages a[aria-current='page'] { background: var(--brand); color: var(--brand-ink); border-color: var(--line); box-shadow: none; font-weight: 800; }
.tabs.stages .tab-off { color: var(--muted); opacity: 0.55; }
.tabs.stages .now { border-radius: 0; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.tabs.subtabs { margin: 0 calc(-1 * var(--space-3)); padding: 0 var(--space-3); border-top: var(--bw) solid var(--line); background: var(--paper); gap: var(--space-4); }
.tabs.subtabs a { padding: 11px 0 8px; border-bottom: 4px solid transparent; color: var(--muted); }
.tabs.subtabs a:hover { color: var(--ink); }
.tabs.subtabs a[aria-current='page'] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs .count.new { margin-left: 4px; }
.subnav { border-bottom: var(--bw) solid var(--line); gap: 0; padding: 0; }
.subnav a { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; padding: 10px var(--space-3); border-right: var(--bw) solid var(--line); }
.subnav a[aria-current='page'] { background: var(--brand); color: var(--brand-ink); }
.inner-tabs a[aria-current='page'] { background: var(--brand); color: var(--brand-ink); }

/* Page heads: Anton */
main.wrap { padding-top: var(--space-4); }
.head { border-bottom: var(--bw) solid var(--line); padding-bottom: var(--space-2); margin-bottom: var(--space-4); align-items: flex-end; }
.head h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); line-height: 0.95; }
.lede { color: var(--ink); font-size: var(--text-base); }
.lede.brand { color: var(--ink); font-style: normal; font-weight: 700; text-transform: uppercase; font-size: 0.9rem; letter-spacing: 0.02em; }
.group-title, .side-head, .box > .box-title, .box-head > .box-title, .context h3, .stat-label { color: var(--ink); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.group-title { border-bottom: var(--bw) solid var(--line); padding-bottom: 4px; }
.eyebrow { color: var(--ink); }
.eyebrow::before { content: ''; display: inline-block; width: 10px; height: 10px; background: var(--brand); border: 2px solid var(--line); margin-right: 8px; vertical-align: -1px; }

/* Buttons */
.button { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; border: var(--bw) solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); }
.button:hover, button:hover:not(.story-scene) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.primary, .button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--line); box-shadow: none; }
button.primary:hover, .button.primary:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); opacity: 1; }
/* Saving is the same dark green in every theme: it commits the form, wherever it sits. */
button[data-i18n$=".save"], button[data-i18n="script.saveChanges"], button[data-i18n="sb.saveDraw"] { background: var(--ok); color: var(--paper); border-color: var(--line); }
button[data-i18n$=".save"]:hover, button[data-i18n="script.saveChanges"]:hover, button[data-i18n="sb.saveDraw"]:hover { background: color-mix(in srgb, var(--ok) 82%, #000); color: var(--paper); border-color: var(--line); }
button.soft, .button.soft { background: var(--brand-soft); color: var(--ink); border-color: var(--line); }
button.link { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: inherit; color: var(--ink); text-decoration-thickness: 1.5px; }
button.link:hover { background: none; color: var(--ink); text-decoration-color: var(--brand); text-decoration-thickness: 3px; }
button.danger, .link.danger { color: var(--accent); }
.ask-dialog .danger-button, button.danger-fill { background: var(--accent); border-color: var(--line); color: var(--accent-ink); }
button:disabled, button:disabled:hover { opacity: 0.4; background: var(--surface); color: var(--ink); border-color: var(--line); }
/* Icon buttons: a framed square with the icon; the bin is red; links-as-icons have no frame */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0; min-width: var(--tap); min-height: var(--tap); padding: 0 !important; }
.icon-btn .icon, .icon-text .icon { width: 20px; height: 20px; stroke-width: 2; }
.icon-btn.primary { min-width: calc(var(--tap) + 8px); }
.icon-btn.danger { color: var(--accent); border-color: var(--line); }
.icon-btn.danger:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--line); }
button.link.icon-btn, .link.icon-btn { min-width: 32px; min-height: 32px; border: var(--bw) solid transparent; text-decoration: none; vertical-align: middle; }
button.link.icon-btn:hover { border-color: var(--line); background: var(--ink); color: var(--paper); }
button.link.icon-btn.danger:hover { background: var(--accent); color: var(--accent-ink); }
.icon-text { display: inline-flex; align-items: center; gap: 8px; }
.sched-table .icon-btn, table .icon-btn { min-width: 32px; min-height: 32px; }
.actions .icon-btn + .icon-btn { margin-left: calc(-1 * var(--space-2) - var(--bw)); }

/* Forms */
label { color: var(--ink); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
label.check, .inline-label { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: var(--text-sm); }
input, select, textarea { border: var(--bw) solid var(--line); border-radius: 0; background: var(--surface); font-size: var(--text-base); }
label > input, label > select, label > textarea { text-transform: none; letter-spacing: 0; font-weight: 400; }
input:focus, select:focus, textarea:focus { border-color: var(--line); box-shadow: 4px 4px 0 var(--brand); }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); border-width: 1px; box-shadow: none !important; }
input:disabled, select:disabled, textarea:disabled { border-style: dashed; }
fieldset { border: var(--bw) solid var(--line); border-radius: 0; }
legend { font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.8rem; background: var(--ink); color: var(--paper); padding: 2px 8px; }
.hint { color: var(--muted); }

/* Boxes: panels, notices, side lists, cards */
.panel, .box, .day-panel, .side-panel, .side-list, .desk-bar, .context, details.discuss, .char-boxes > .char-box, .table-wrap, .stat-tiles, .read-script, .mention-list, .ink-pop {
  border: var(--bw) solid var(--line); border-radius: 0; box-shadow: none; }
.panel h2, .panel h3, .box h2 { line-height: 1.05; }
.panel h2 { font-size: 1.7rem; }
.notice { border: var(--bw) solid var(--line); border-left-width: 10px; border-left-color: var(--brand); background: var(--brand-soft); border-radius: 0; color: var(--ink); }
.notice.status-degraded, .notice.status-down, .move-alert.critical, .prelim-stale { border-color: var(--line); border-left-color: var(--accent); }
.move-alert, .prelim-stale { border: var(--bw) solid var(--line); border-left: 10px solid var(--warn); border-radius: 0; }
.side-list > a[aria-current='true'], .ep-list > li[aria-current='true'] { background: var(--brand); color: var(--brand-ink); box-shadow: none; }
.side-list > a, .side-list .side-item, .ep-list > li { border-bottom-color: var(--hair); }
.side-head { background: var(--ink); color: var(--paper); }
.side-panel-tabs, .day-panel-bar { background: var(--paper); border-bottom: var(--bw) solid var(--line); }
.side-panel-tabs > button { text-transform: uppercase; font-size: 0.72rem; }
.side-panel-tabs > button + button { border-left: var(--bw) solid var(--line); }
.side-panel-tabs > button[aria-selected='true'] { background: var(--brand); color: var(--brand-ink); box-shadow: none; }
.day-tab { border-right: var(--bw) solid var(--line); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.03em; }
.day-tab.on { background: var(--brand); color: var(--brand-ink); box-shadow: none; }
.day-tabs { border-bottom: var(--bw) solid var(--line); }
.folder-tabs > button[role=tab] { border-radius: 0; text-transform: uppercase; }
.folder-tabs > button[role=tab][aria-selected='true'] { background: var(--brand); color: var(--brand-ink); }
.rail-tab { border-radius: 0; border: var(--bw) solid var(--line); text-transform: uppercase; font-size: 0.72rem; }
.rail-tab.on { background: var(--brand); color: var(--brand-ink); box-shadow: none; }
.loc-approved { border-radius: 0; }
.role-cards a.panel:hover, .loc-card:hover { background: var(--brand-soft); border-color: var(--line); }
.role-cards strong { color: var(--ink); text-transform: uppercase; }
.build-card.on, .look-card.on { box-shadow: var(--shadow-lift); border-color: var(--line); }
.carousel, .carousel-empty, .media img, .media .doc, .pic-row img { border-radius: 0; }
.carousel-nav { border-radius: 0; border: var(--bw) solid var(--line); background: var(--paper); }

/* Numbers: Anton */
.stat-tiles li { border-right: var(--bw) solid var(--line); }
.stat-tiles strong { font-family: var(--font-display); font-weight: 400; font-size: 2.4rem; line-height: 1; letter-spacing: 0; }
.stat-label { font-size: 0.7rem; }
ul.pricing .price { font-family: var(--font-display); font-weight: 400; color: var(--ink); }
ul.pricing > li.featured { background: var(--brand); color: var(--brand-ink); box-shadow: none; }
ol.steps li::before { border-radius: 0; border: var(--bw) solid var(--line); font-weight: 800; }
ol.steps li { text-transform: uppercase; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.04em; }
ol.steps li.now::before { background: var(--brand); color: var(--brand-ink); border-color: var(--line); }
ol.steps li.done::before { content: ''; background: var(--sig-ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17.5 19.5 7'/%3E%3C/svg%3E") center / 70% no-repeat; border-color: var(--line); }

/* Tables: a black frame, a heavy rule under the head, light rows; the row you point at is tinted */
.table-wrap { background: var(--surface); }
th { color: var(--ink); background: var(--surface-2); font-weight: 800; font-size: 0.7rem; letter-spacing: 0.06em; border-bottom: var(--bw) solid var(--line); }
td { border-bottom: 1px solid var(--hair); }
.sched-table th { color: var(--ink); font-weight: 800; border-bottom: var(--bw) solid var(--line); }
.sched-table td { border-top-color: var(--hair); }
tbody tr:hover > td { background: color-mix(in srgb, var(--brand-soft) 55%, transparent); }
table.budget tr.cat th, .sched-table tr.set-row td { background: var(--ink); color: var(--paper); }
table.mini td { border-bottom-color: var(--hair); }
.list { border-top: var(--bw) solid var(--line); }
.list > li { border-bottom-color: var(--hair); }
ul.checklist li, .changes > li, .picker li { border-bottom-color: var(--hair); }

/* Tags and chips: square, framed, small capitals */
.tag, .chip, .chip-item, .sign-off .sign, .scene-num { border-radius: 0; border: 1.5px solid var(--line); text-transform: uppercase; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ink); }
.tag.strong { background: var(--brand); color: var(--brand-ink); border-color: var(--line); }
.tag.warn, .tag.sev-serious, .tag.sev-critical { background: var(--accent); color: var(--accent-ink); border-color: var(--line); }
.tag.ok { color: var(--ok); border-color: var(--ok); }
.b-ep { border-radius: 0; background: var(--ink); color: var(--paper); }
.scene-num:hover { background: var(--ink); color: var(--paper); }

/* Modals: framed, square, a hard block shadow */
dialog, dialog.ask-dialog, dialog.wide-dialog { border: var(--bw) solid var(--line); border-radius: 0; background: var(--paper); box-shadow: var(--shadow-lift); }
dialog::backdrop { background: rgb(0 0 0 / 0.55); }
.ask-dialog .ask-title, dialog h2 { font-family: var(--font-display); text-transform: uppercase; font-weight: 400; }
.ask-dialog .ask-icon { border-radius: 0; border: var(--bw) solid var(--line); background: var(--brand); color: var(--brand-ink); }
.ask-dialog .ask-warn .ask-icon { background: var(--warn); color: var(--paper); }
.ask-dialog .ask-danger .ask-icon { background: var(--accent); color: var(--accent-ink); }
.ask-dialog .actions, .dialog-top { border-color: var(--line); }
.ask-dialog .actions { border-top-width: var(--bw); }
/* A modal's buttons sit at its bottom right, so Save is always in the same place. */
dialog .actions { justify-content: flex-end; }
.dialog-top { border-bottom: var(--bw) solid var(--line); padding-bottom: var(--space-2); }

/* The "view as" bar, theme swatches, misc */
.swatch { border: var(--bw) solid var(--line); border-radius: 0; }
.swatch:has(input:checked) { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--line); }
.swatch .chip { border-radius: 0; border: var(--bw) solid var(--line); }
.billing-bar { border-top: var(--bw) solid var(--line); font-weight: 700; text-transform: uppercase; font-size: 0.75rem; }
.billing-bar.read_only { background: var(--accent); color: var(--accent-ink); }

@media (max-width: 560px) {
  .wordmark { font-size: 1.5rem; }
  .bar-right > * { padding: 0 var(--space-2); }
  .project-title { font-size: 2rem; }
  .tabs.stages { width: auto; }
  .tabs.stages a, .tabs.stages .tab-off { padding: 8px var(--space-2); font-size: 0.7rem; }
}
/* Inner tabs (a page's own sections) and segmented buttons: a framed row of boxes, the current one filled */
.tabs.subtabs { column-gap: var(--space-4); row-gap: 0; }
.tabs.inner-tabs { gap: 0; border: var(--bw) solid var(--line); width: max-content; max-width: 100%; margin-bottom: var(--space-3); }
.tabs.inner-tabs > a, .tabs.inner-tabs > .tab-off { padding: 8px var(--space-3); border: 0; border-right: var(--bw) solid var(--line); color: var(--ink); }
.tabs.inner-tabs > :last-child { border-right: 0; }
.tabs.inner-tabs > a:hover { background: var(--ink); color: var(--paper); }
.tabs.inner-tabs > a[aria-current='page'] { background: var(--brand); color: var(--brand-ink); border-bottom: 0; }
.seg { border: var(--bw) solid var(--line); border-radius: 0; }
.seg > button { border: 0; }
.seg > button + button { border-left: var(--bw) solid var(--line); }
.seg > button[aria-pressed='true'] { background: var(--brand); color: var(--brand-ink); font-weight: 800; }

/* Header and tab rows that don't fit (founder's review 2026-10-16): the boxes wrap onto a second row instead of
   being cut at the edge; a tab's word, "Now" and count stay on one line; on a phone the tools get their own row. */
.tabs.stages, .tabs.inner-tabs { flex-wrap: wrap; overflow: visible; border: 0; width: auto; padding-right: var(--bw); }
.tabs.stages > a, .tabs.stages > .tab-off, .tabs.inner-tabs > a, .tabs.inner-tabs > .tab-off {
  flex: 0 0 auto; flex-wrap: nowrap; white-space: nowrap; border: var(--bw) solid var(--line) !important; margin: 0 calc(-1 * var(--bw)) calc(-1 * var(--bw)) 0; }
.tabs.stages { padding-bottom: var(--bw); margin-bottom: calc(-1 * var(--bw)); }
.tabs.inner-tabs { padding-bottom: var(--bw); }
.button, .tag, button, .count, .count-soft { font-family: var(--font-ui); }
h1 .button, h2 .button, h3 .button, h2 .tag, h3 .tag { line-height: 1.2; letter-spacing: 0.04em; }
@media (max-width: 700px) {
  #shell > .bar { flex-wrap: wrap; }
  #shell > .bar > .wordmark { flex: 1 1 auto; border-right: 0; }
  #shell .bar-right { flex: 1 1 100%; margin: 0 calc(-1 * var(--space-3)); border-top: var(--bw) solid var(--line); overflow-x: auto; scrollbar-width: none; }
  #shell .bar-right > * { min-height: 46px; flex: 0 0 auto; }
  #shell .bar-right > :first-child, #shell .bar-right > :empty + * { border-left: 0; }
  #shell .bar-right > .account { margin-left: auto; border-right: 0; }
  #shell .account .account-name { display: none; }
}
.tabs .now { margin: 0; }
#shell .bar-right, #shell .bar-right * { white-space: nowrap; }

/* Script reader on old paper, whatever the theme (founder's review 2026-10-16); "Highlight my lines" like a highlighter pen. */
dialog.script-dialog { background: var(--old-paper); color: var(--old-paper-ink); border-color: var(--old-paper-ink); }
dialog.script-dialog .dialog-top, dialog.script-dialog .dialog-top * { color: var(--old-paper-ink); }
dialog.script-dialog .hint, dialog.script-dialog .my-lines span { color: var(--old-paper-muted); }
dialog.script-dialog .dialog-top { gap: var(--space-3); border-bottom-color: var(--old-paper-ink); }
dialog.script-dialog .my-lines { margin-left: auto; white-space: nowrap; font-weight: 700; }
dialog.script-dialog .my-lines input { accent-color: var(--old-paper-ink); }
.read-script.old-paper { background: var(--old-paper); color: var(--old-paper-ink); border-color: var(--old-paper-ink); }
.read-script.old-paper .script, .read-script.old-paper .script p { color: var(--old-paper-ink); }
.read-script.old-paper .script p.hl { background: var(--old-paper-hl); }
.my-lines { font-weight: 700; }
.filter-bar label.my-lines { display: inline-flex; flex-direction: row; align-items: center; gap: var(--space-2); white-space: nowrap; width: auto; grid-column: auto; }
.filter-bar label.my-lines input { width: auto; margin: 0; }

/* Full script (founder, 2026-10-17): a tools row above the script — title, count, Filter (folds the filter bar
   open, outside the script box) and one full-screen button. Full screen has its own bar with "Highlight my lines". */
.script-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.script-tools h2 { margin: 0; }
.script-tools-end { margin-left: auto; display: inline-flex; gap: var(--space-2); align-items: center; }
.filter-toggle { display: inline-flex; align-items: center; gap: var(--space-2); }
.filter-toggle[aria-expanded='true'] { background: var(--brand); color: var(--brand-ink); }
.filter-toggle .count[hidden] { display: none; }
.filter-bar.panel { padding: var(--space-3); }
.filter-bar[hidden] { display: none; }
.full-script .fs-bar { display: none; }
.full-script:fullscreen, .full-script.is-full { display: flex; flex-direction: column; background: var(--paper); margin: 0; padding: 0; overflow: hidden; }
.full-script.is-full { position: fixed; inset: 0; z-index: 1000; border: 0; }
.full-script:fullscreen .fs-bar, .full-script.is-full .fs-bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-bottom: var(--bw) solid var(--line); flex: none; }
.fs-bar .fs-title { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: 1.4rem; line-height: 1; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fs-bar .my-lines { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.fs-bar .my-lines input { width: auto; margin: 0; }
.full-script:fullscreen .full-script-body, .full-script.is-full .full-script-body { flex: 1 1 auto; max-height: none; border-top: 0; padding: var(--space-3) max(var(--space-3), calc((100% - 46rem) / 2)); }
html.no-scroll, html.no-scroll body { overflow: hidden; }

/* Ask the director's department: beside the script on wide screens; on phones a button pinned to the bottom opens
   the question box as a sheet over the script. */
.ask-toggle, .ask-close { display: none; }
.ask-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
@media (max-width: 900px) {
  .split-wide:has(.ask) { padding-bottom: 72px; }
  .split-wide .ask { border: 0; padding: 0; background: none; }
  .ask-toggle { display: flex; align-items: center; justify-content: center; gap: var(--space-2); position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 900;
    background: var(--brand); color: var(--brand-ink); border: var(--bw) solid var(--line); font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; min-height: 48px; }
  .ask:not(.open) .ask-sheet { display: none; }
  .ask.open .ask-toggle { display: none; }
  .ask.open .ask-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 950; max-height: 85vh; overflow-y: auto; background: var(--paper);
    border-top: var(--bw) solid var(--line); padding: var(--space-3) 16px calc(var(--space-3) + env(safe-area-inset-bottom)); }
  .ask-close { display: inline-grid; }
}

/* Signal icons instead of emoji (founder, 2026-10-17): red stop = critical, yellow triangle = warning, green tick = OK. */
.icon.sig { vertical-align: -0.2em; flex: none; }
.icon.sig-crit { color: var(--sig-crit); }
.icon.sig-crit .shape { fill: var(--sig-crit); stroke: var(--sig-crit); }
.icon.sig-crit .mark { stroke: #ffffff; stroke-width: 2.4; }
.icon.sig-warn { color: #0b0b0b; }
.icon.sig-warn .shape { fill: var(--sig-warn); stroke: #0b0b0b; }
.icon.sig-warn .mark { stroke: #0b0b0b; stroke-width: 2.4; }
.icon.sig-ok { color: var(--sig-ok); stroke-width: 2.6; }
.with-icon { display: inline-flex; align-items: center; gap: 0.35em; }
div.with-icon, p.with-icon, li.with-icon { display: flex; }

/* Header (founder, 2026-10-17): no empty framed box between the wordmark and the tools; the account is its avatar;
   the project title in double quotes; the Prep calendar stands alone at the far right of the stage row. */
#shell > .bar > .wordmark { border-right: 0; }
.project-title::before { content: '“'; }
.project-title::after { content: '”'; }
.stage-row { display: flex; align-items: flex-end; gap: var(--space-3); }
.stage-row > .tabs.stages { flex: 1 1 auto; min-width: 0; }
.stage-tools { margin-left: auto; display: flex; flex: none; margin-bottom: calc(-1 * var(--bw)); }
.stage-tools a { display: inline-grid; place-items: center; padding: 10px var(--space-3); line-height: 1; border: var(--bw) solid var(--line); color: var(--ink); text-decoration: none; }
.stage-tools a + a { margin-left: calc(-1 * var(--bw)); }
.stage-tools a:hover, .stage-tools a[aria-current='page'] { background: var(--brand); color: var(--brand-ink); }
@media (max-width: 560px) { .stage-tools a { padding: 8px var(--space-2); } }

/* Actors' questions, the answering side (core/thread-inbox.js): beside the script (director's department) and under
   Continuity (wardrobe, props, HMU, script). One box per actor; "Needs a reply" when the actor wrote last. */
.inbox-list { list-style: none; padding: 0; margin: 0; }
.inbox-row { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: var(--space-3); text-align: left; padding: var(--space-2) var(--space-3);
  border: var(--bw) solid var(--line); margin-bottom: calc(-1 * var(--bw)); background: var(--paper); color: var(--ink); font: inherit; min-height: 0; text-transform: none; letter-spacing: 0; }
.inbox-row:hover { background: var(--brand-soft); }
.inbox-who, .inbox-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inbox-meta { align-items: flex-end; text-align: right; flex: none; }
.inbox-thread-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin-bottom: var(--space-2); }
.inbox-thread-head [data-back] { display: inline-flex; align-items: center; gap: var(--space-1); }
.cont-inbox { margin-top: var(--space-5); margin-bottom: var(--space-5); }
@media (min-width: 901px) { .split-wide .ask { max-height: calc(100vh - 2 * var(--space-2)); overflow-y: auto; } }
.ask-toggle .count[hidden] { display: none; }
.inbox-row:hover, .inbox-row:focus, .inbox-row:active { color: var(--ink); background: var(--brand-soft); }
.inbox-row strong { color: inherit; }
.tag.need { background: var(--sig-warn); color: #0b0b0b; border-color: var(--line); }


/* Script boxes read as paper: the writers' desk, the whole script, the scene page and the read-scene modal all share
   the same faintly yellow sheet. Themes keep their ink; only the paper changes. */
.page-view, .scene-split .script-panel, .full-script, .full-script .full-script-body, .read-script { background-color: var(--script-paper); }

/* Plot & Timeline: one arc per episode, straight from the published scenes (every episode in the series). */
.ep-arcs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3); margin-bottom: var(--space-3); }
.ep-arc + .ep-arc { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--hair); }
.ep-arc > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); margin-bottom: var(--space-1); }
.ep-arc-line { list-style: none; display: flex; gap: var(--space-2); margin: 0; padding: 0 0 var(--space-1); overflow-x: auto; }
.ep-arc-line > li { flex: 0 0 auto; }
.ep-arc.ep-c1 { --ep: var(--act-1); } .ep-arc.ep-c2 { --ep: var(--act-2); } .ep-arc.ep-c3 { --ep: var(--act-3); }
.ep-arc.ep-c4 { --ep: var(--act-4); } .ep-arc.ep-c5 { --ep: var(--act-5); } .ep-arc.ep-c6 { --ep: var(--act-6); }
.ep-arc > header { border-left: 6px solid var(--ep, var(--brand-fg)); padding-left: var(--space-2); }
.ep-arc-scene { display: grid; gap: 2px; width: 200px; min-height: 88px; padding: var(--space-2); border: 1px solid var(--line); border-left: 3px solid var(--ep, var(--brand-fg)); background: var(--script-paper); color: var(--ink); text-decoration: none; font-size: var(--text-sm); }
.ep-arc-scene:hover, .ep-arc-scene:focus-visible { background: var(--brand-soft); }
.ep-arc-no { font-family: var(--font-display); font-size: 1.2rem; line-height: 1; }
.ep-arc-head { font-family: var(--font-script); font-size: 0.8rem; text-transform: uppercase; }
.ep-arc-sum { color: var(--muted); font-size: 0.75rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ep-arc-cast { color: var(--muted); font-size: 0.7rem; }
/* The writers' desk with the continuity panel folded away: the script takes the space, a slim rail stays. */
.writer.context-hidden { grid-template-columns: minmax(240px, 310px) 1fr auto; }
.writer.side-hidden.context-hidden { grid-template-columns: auto 1fr auto; }
@media (max-width: 900px) { .writer.context-hidden, .writer.side-hidden.context-hidden { grid-template-columns: 1fr; } }

/* More colour where it carries meaning: creative actions, roles, idea kinds, episodes. Mono keeps its paper and ink,
   but these accents still tell one kind of thing from another. */
button.ok, .button.ok { background: var(--ok); border-color: var(--ok); color: var(--paper); }
button.info, .button.info { background: var(--info); border-color: var(--info); color: #fff; }
button.ok:hover, .button.ok:hover { background: color-mix(in srgb, var(--ok) 82%, #000); }
button.info:hover, .button.info:hover { background: color-mix(in srgb, var(--info) 82%, #000); }
.tag.role-protagonist { border-color: var(--ok); color: var(--ok); }
.tag.role-antagonist { border-color: var(--accent); color: var(--accent); }
.tag.role-background { border-color: var(--hair); color: var(--muted); background: var(--surface-2); }
.idea-card.kind-story { border-top-color: var(--ok); }
.idea-card.kind-plot { border-top-color: var(--info); }

/* Synopsis reads as a document: a strong underlined label, then comfortably set text. */
.story-form.reading { gap: 0; }
.story-form.reading > label { display: block; padding: var(--space-3) 0; border-top: 1px solid var(--hair); }
.story-form.reading > label:first-child { border-top: 0; padding-top: 0; }
.story-form.reading > .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); border-top: 1px solid var(--hair); padding: var(--space-3) 0; }
.story-form.reading .row > label { display: block; }
.story-form.reading > label > span, .story-form.reading .row > label > span {
  display: block; margin-bottom: var(--space-1); font-family: var(--font-ui); font-size: 1rem; font-weight: 700;
  line-height: 1.25; letter-spacing: 0; text-transform: uppercase; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.story-form.reading .story-text { max-width: 72ch; font-family: var(--font-ui); font-size: 1rem; font-weight: 200; line-height: 1.65; text-transform: none; }
.story-form.reading .row .story-text, .story-form.reading .row p { max-width: 46ch; }
.episode-story { padding: var(--space-3) var(--space-4); }
.episode-story > summary { font-size: 1rem; }
.episode-story > summary strong { font-family: var(--font-ui); font-size: 1rem; font-weight: 700; letter-spacing: 0; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.episode-story .story-text { font-weight: 200; text-transform: none; }
.episode-story p > strong { display: inline-block; font-family: var(--font-ui); font-size: 1rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
@media (max-width: 700px) { .story-form.reading > .row { grid-template-columns: 1fr; gap: var(--space-3); } }

/* Characters: background / extras are compact and visually quieter, and sit at the bottom. */
.char-table tbody tr.background td { padding-top: 2px; padding-bottom: 2px; color: var(--muted); font-size: 0.82rem; }
.char-table tbody tr.background .char-open { font-weight: 500; }
.char-table tbody tr.background .char-desc { max-width: 28ch; }

/* Relationship map: fewer labels, more space, a highlighted line under the pointer. */
.rel-wrap { padding: var(--space-3); background-image: radial-gradient(var(--hair) 0.7px, transparent 0.7px); background-size: 18px 18px; }
.rel-line { transition: stroke-width 0.12s; }
.rel-line:hover { stroke-width: 5; }
.rel-node rect { fill: var(--surface); }

/* Writers' story map: one wide diagram of every published scene, episode by episode. */
.story-map-panel { padding: var(--space-3); }
.story-map-panel .section-head { margin-bottom: var(--space-2); }
.story-map-panel .section-head h3 { margin: 0; }
.story-map-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.story-map-bar .hint { margin: 0; max-width: 86ch; }
/* The connection inspector: what a line means, edited in place above the map. */
.story-link-editor { margin-bottom: var(--space-2); padding: var(--space-2); border: var(--bw) solid var(--line); background: var(--surface); }
.story-link-editor[hidden] { display: none; }
.story-link-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-1); }
.story-link-head strong { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.03em; }
.story-link-close { display: inline-flex; }
.story-link-editor form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); margin: 0; }
.story-link-editor label { flex: 1 1 160px; margin: 0; }
.story-link-editor .actions { flex: 0 0 auto; margin: 0; }
.story-link-meta { margin: 0; }
.story-map-scroll { overflow: auto; border: var(--bw) solid var(--line); background: var(--script-paper); max-height: 74vh; }
.story-map-canvas { position: relative; background-image: radial-gradient(var(--hair) 0.8px, transparent 0.8px); background-size: 20px 20px; }
.story-map-links { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.ep-c1 { --ep: var(--act-1); } .ep-c2 { --ep: var(--act-2); } .ep-c3 { --ep: var(--act-3); }
.ep-c4 { --ep: var(--act-4); } .ep-c5 { --ep: var(--act-5); } .ep-c6 { --ep: var(--act-6); }
.story-link { fill: none; stroke: var(--ep, var(--brand-fg)); stroke-width: 2.5; pointer-events: stroke; cursor: pointer; }
/* The line style carries the meaning: solid causes, dashed sets up, dash-dot pays off, dotted echoes, broken mirrors. */
.story-link.kind-sets_up { stroke-dasharray: 9 4; }
.story-link.kind-pays_off { stroke-dasharray: 13 3 3 3; }
.story-link.kind-echoes { stroke-dasharray: 2 5; }
.story-link.kind-mirrors { stroke-dasharray: 11 3 2 3; }
.story-link.kind-contradicts { stroke-dasharray: 4 3; stroke-width: 3.5; }
.story-link.kind-related { opacity: 0.85; }
/* An open connection always reads as unfinished, whatever its kind. */
.story-link.open { stroke-dasharray: 7 5; }
.story-link:hover { stroke-width: 5; }
.story-link.story-temp { stroke-dasharray: 4 4; stroke-width: 2; pointer-events: none; }
.story-arrow { fill: var(--ep, var(--brand-fg)); }
.story-episode { position: absolute; display: flex; align-items: baseline; gap: var(--space-2); border-left: 6px solid var(--ep, var(--brand-fg)); padding-left: var(--space-2); pointer-events: none; }
.story-ep-name { font-family: var(--font-display); font-size: 1.25rem; line-height: 1; }
.story-ep-title { font-family: var(--font-ui); font-size: var(--text-sm); font-weight: 700; }
.story-ep-count { margin-left: auto; color: var(--muted); font-size: 0.72rem; }
.story-row-line { position: absolute; height: 0; border-top: 2px solid color-mix(in srgb, var(--line) 35%, transparent); pointer-events: none; }
.story-scene { position: absolute; transform: translate(-50%, -50%); width: 62px; height: 46px; padding: 0; border: 0; background: none; cursor: grab; touch-action: none; }
.story-scene:hover, .story-scene:focus-visible { background: none; color: inherit; border-color: transparent; }
.story-dot { display: block; width: 16px; height: 16px; margin: 0 auto; border-radius: 50%; background: var(--ep, var(--brand)); border: 2px solid var(--line); transition: transform 0.12s; }
.story-scene:hover .story-dot, .story-scene:focus-visible .story-dot { transform: scale(1.45); }
.story-scene-no { display: block; margin-top: 2px; font-family: var(--font-display); font-size: 0.72rem; line-height: 1; text-align: center; color: var(--muted); }
/* A beat pinned to a scene: a small diamond, or the star of a key moment with its title above the dot. */
.story-pins { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); display: grid; place-items: center; pointer-events: none; }
.story-pin-dot { width: 7px; height: 7px; background: var(--ink); transform: rotate(45deg); }
.story-pin-label { position: absolute; left: 50%; top: -36px; transform: translateX(-50%); max-width: 160px; padding: 0;
  border: 0; background: none; color: var(--ink); font-size: 0.64rem; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
  text-shadow: 0 0 3px var(--script-paper), 0 0 3px var(--script-paper); }
.story-pins .icon { width: 14px; height: 14px; }
.story-pending { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; border: 2px dashed var(--brand-fg); border-radius: 50%; background: var(--surface); font-family: var(--font-display); font-size: 1.1rem; cursor: grab; touch-action: none; }
.story-bin { position: absolute; transform: translate(-50%, -50%); width: 44px; height: 44px; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: 50%; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); color: var(--accent); font-family: var(--font-display); font-size: 1.4rem; }
/* Hover card: the old card, with its paper background. The scene button no longer inherits the black button hover. */
.story-bubble { position: absolute; z-index: 6; width: min(300px, calc(100vw - 60px)); padding: var(--space-2) var(--space-3);
  background: var(--surface); border: var(--bw) solid var(--line); box-shadow: var(--shadow-lift); pointer-events: none; }
.story-bubble-scene { display: block; font-family: var(--font-display); font-weight: 400; letter-spacing: 0.04em; }
.story-bubble-head { display: block; font-family: var(--font-script); font-size: 0.9rem; text-transform: uppercase; }
.story-bubble p { margin: var(--space-1) 0 0; font-size: var(--text-sm); line-height: 1.4; }
.story-bubble-tension, .story-bubble-cast { display: block; color: var(--muted); font-size: 0.75rem; }
.story-bubble-beats { display: block; margin-top: var(--space-1); }
.story-bubble-beat { display: block; font-size: 0.75rem; line-height: 1.35; }
.story-bubble-beat .icon { width: 12px; height: 12px; vertical-align: -2px; }
.story-bubble-hint { display: block; margin-top: var(--space-1); color: var(--muted); font-size: 0.7rem; }
.story-map-foot { margin-top: var(--space-2); }
/* A one-click explanation of the Plot & Timeline tab: the working routine, not a feature list. */
.story-howto { margin-bottom: var(--space-3); border: var(--bw) solid var(--line); background: var(--surface); }
.story-howto > summary { padding: var(--space-2); cursor: pointer; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; }
.story-howto ol { margin: 0; padding: 0 var(--space-3) var(--space-2) 2.2em; display: grid; gap: var(--space-1); font-size: var(--text-sm); }
.story-howto li::marker { font-family: var(--font-display); }
.story-howto .hint { margin: 0; padding: 0 var(--space-3) var(--space-2); }
/* Story arcs: a wide translucent ribbon through an arc's scenes, with role markers. */
.arc-c1 { --arc: var(--act-1); } .arc-c2 { --arc: var(--act-2); } .arc-c3 { --arc: var(--act-3); }
.arc-c4 { --arc: var(--act-4); } .arc-c5 { --arc: var(--act-5); } .arc-c6 { --arc: var(--act-6); }
.story-arc-ribbon { fill: none; stroke: var(--arc); stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; opacity: 0.18; pointer-events: none; }
.story-arc-ribbon.focused { opacity: 0.32; stroke-width: 20; }
.story-arc-ribbon.dim { opacity: 0.05; }
.story-arc-node { fill: var(--surface); stroke: var(--arc); stroke-width: 2.5; pointer-events: none; }
.story-arc-node.dim { opacity: 0.15; }
.story-arc-node.role-setup { stroke-dasharray: 2 2; }
.story-arc-node.role-payoff { fill: var(--arc); }
.story-arc-name { font-family: var(--font-ui); font-size: 11px; font-weight: 700; fill: var(--arc); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; pointer-events: none; }
.story-arcs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin-bottom: var(--space-2); }
.story-arcs-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.story-arc-chip { display: inline-flex; align-items: baseline; gap: 6px; min-height: 30px; padding: 0 var(--space-2); border: 1px solid var(--line);
  border-left: 5px solid var(--arc, var(--brand-fg)); background: var(--surface); color: var(--ink); font-size: 0.78rem; cursor: pointer; }
.story-arc-chip.active { background: var(--brand-soft); border-color: var(--brand-fg); }
.story-arc-chip small { color: var(--muted); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em; }
.story-arc-assigning { margin: 0 0 var(--space-2); }
.story-map-canvas.assigning .story-scene { cursor: crosshair; }
/* Tension: a dashed curve under each episode row; click scenes to cycle 1–5, then off. */
.story-tension-line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 3; opacity: 0.55; pointer-events: none; }
.story-tension-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; opacity: 0.8; pointer-events: none; }
.story-map-canvas.tension .story-scene { cursor: ns-resize; }
.story-tension-toggle[aria-pressed='true'] { background: var(--brand-soft); border-color: var(--brand-fg); }
.story-tension-hint { margin: 0 0 var(--space-2); }
/* Story doctor: the gaps the map can prove, with a way to jump to each one. */
.story-doctor { margin-bottom: var(--space-2); border: var(--bw) solid var(--line); background: var(--surface); }
.story-doctor > summary { display: flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-2); cursor: pointer; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.story-doctor.doctor-crit { border-left: 6px solid var(--accent); }
.story-doctor ul { list-style: none; margin: 0; padding: 0 var(--space-2) var(--space-2); display: grid; gap: var(--space-1); }
.story-doctor li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); font-size: var(--text-sm); }
.story-doctor li.doctor-crit { color: var(--accent); }
.story-doctor li .link { margin-left: auto; }
.story-doctor .icon { width: 16px; height: 16px; }
.story-arc-editor [hidden] { display: none; }
.story-arc-nodes { margin-top: var(--space-2); }
.story-arc-nodes-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-1); }
.story-arc-nodes-head strong { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.story-arc-node-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.story-arc-node-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.story-arc-node-list li > span { flex: 1 1 220px; }
.story-arc-node-list select { width: auto; min-height: 28px; }
.story-arc-node-list .link { margin-left: auto; }
.ep-arc-scene { font: inherit; text-align: left; cursor: pointer; }
.episode-story .story-text { max-width: 74ch; font-size: 1.02rem; line-height: 1.65; }
.episode-story > summary { padding: var(--space-1) 0; }
.context-idea-form { display: flex; gap: 4px; margin-top: var(--space-1); }
.context-idea-form select { width: auto; max-width: 7.5em; min-height: 30px; padding: 0 4px; font-size: 0.75rem; }
.context-idea-form input { flex: 1; min-width: 0; min-height: 30px; font-size: 0.8rem; }
.context-idea-form button { min-height: 30px; min-width: 30px; padding: 0 6px; }
.episode-story .story-label { display: block; margin: var(--space-2) 0 var(--space-1); font-family: var(--font-ui); font-size: 1rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Edit / save / cancel: edit is a plain white button, save is green, cancel sits top-right in red. */
button.cancel, .button.cancel { background: var(--surface); border-color: var(--accent); color: var(--accent); }
button.cancel:hover, .button.cancel:hover { background: var(--accent); color: var(--accent-ink); }
.story-form.editing, .episode-edit { position: relative; }
.story-form.editing { padding-top: var(--space-4); }
.story-form .story-cancel, .episode-edit .episode-cancel { position: absolute; top: var(--space-2); right: var(--space-2); z-index: 1; min-height: 32px; padding: 0 var(--space-2); }
.episode-edit { padding-top: var(--space-4); }

/* The right sidebar is the same folder-tab list as the left scene list: Continuity | Ideas. */
.context.side-list { padding: 0; background: var(--surface); }
.context-body { padding: var(--space-3); }
.context-body > .context-title { margin-top: 0; }
.context-idea-list { list-style: none; margin: 0 0 var(--space-2); padding: 0; }
.context-idea-list > li { padding: var(--space-2); border-bottom: 1px solid var(--hair); border-left: 4px solid var(--line); }
.context-idea-list > li.kind-idea { border-left-color: var(--info); }
.context-idea-list > li.kind-story { border-left-color: var(--ok); }
.context-idea-list > li.kind-plot { border-left-color: var(--brand-fg); }
.context-idea-list strong { display: inline; }
.context-idea-list p { margin: var(--space-1) 0 0; font-size: var(--text-sm); line-height: 1.4; white-space: pre-line; }
.context-idea-form { display: flex; flex-wrap: wrap; gap: 4px; margin-top: var(--space-2); }
.context-idea-form select { width: auto; min-height: 32px; padding: 0 4px; font-size: 0.78rem; }
.context-idea-form input { flex: 1 1 100%; min-width: 0; min-height: 32px; font-size: 0.85rem; }
.context-idea-form button { min-height: 32px; width: 36px; padding: 0 6px; }
/* Scripts desk uses the full width on a wide monitor, with both side lists open. */
body.script-desk-wide main.wrap.wide, body.script-desk-wide #shell .wrap { max-width: min(1720px, calc(100vw - 16px)); }
.writer .write-pane { min-width: 0; }
@media (min-width: 1300px) {
  .writer:not(.side-hidden) { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(240px, 300px); }
  .writer.side-hidden { grid-template-columns: auto minmax(0, 1fr) minmax(240px, 300px); }
  .writer.context-hidden { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) auto; }
  .writer.side-hidden.context-hidden { grid-template-columns: auto minmax(0, 1fr) auto; }
  .writer .script { max-width: 78ch; }
  .writer .ink-edit { max-width: 90ch; }
}
/* Ideas tab: edit and delete side by side, with a light border. */
.context-idea-actions { display: flex; gap: 4px; margin-top: var(--space-1); }
.context-idea-actions .idea-action { min-height: 28px; padding: 0 var(--space-2); border: 1px solid var(--hair); background: var(--surface); color: var(--ink); font-size: 0.75rem; }
.context-idea-actions .idea-action.danger { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--hair)); }
.context-idea-actions .idea-action:hover { border-color: var(--line); background: var(--brand-soft); }

/* Project sidebar (2026-10-18): one collapsible rail for the whole project, replacing the stage tabs and their
   sub-tabs. The sidebar holds the workspaces (Script, Plan, People, Department work, Shoot, Post, Admin); each group
   expands to the pages the person may open. Brut: black frames, square corners, brand black (Mono) for the current page. */
body.with-side { --side-w: 272px; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); min-height: 100vh; }
body.with-side.side-collapsed { --side-w: 72px; }
body.with-side #shell { grid-column: 2; grid-row: 1; position: sticky; top: 0; z-index: 60; }
/* .wrap.bar outranks the old top-tab caps (body:has(main.wide) #shell .wrap, body.script-desk-wide #shell .wrap). */
body.with-side #shell > .wrap.bar, body.with-side #shell > .wrap.billing-bar { max-width: none; }
body.with-side main#main { grid-column: 2; grid-row: 2; min-width: 0; margin-left: 0; margin-right: auto; }
body.with-side main#main.wrap, body.with-side main#main.wrap.wide, body.with-side.script-desk-wide main#main.wrap.wide { max-width: none; width: 100%; }
.project-side { grid-column: 1; grid-row: 1 / span 2; align-self: stretch; min-height: 100vh; display: flex; flex-direction: column; border-right: var(--bw) solid var(--line); background: var(--paper); z-index: 45; }
.side-toggle { display: none; align-items: center; justify-content: center; flex: none; min-height: 100%; padding: 0 var(--space-3); border: 0; border-right: var(--bw) solid var(--line); background: var(--paper); color: var(--ink); }
.side-toggle:hover { background: var(--brand); color: var(--brand-ink); }
.side-toggle svg { width: 20px; height: 20px; }
#shell .bar.has-project { display: flex; flex-wrap: nowrap; align-items: stretch; }
.bar-hello { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; padding: 0 var(--space-3); font-size: 1.25rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#shell .bar.has-project .bar-right { flex: 0 1 auto; min-width: 0; }
.top-project { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; max-width: min(42vw, 520px); min-width: 0; overflow: hidden; white-space: nowrap; font-family: var(--font-display); font-size: clamp(1rem, 1.45vw, 1.4rem); font-weight: 400; line-height: 1; letter-spacing: 0; text-transform: uppercase; text-decoration: none; color: var(--ink); padding: 0 var(--space-3); }
/* The person's role above the title: small, white on black. */
.top-role { flex: none; padding: 2px 5px; background: var(--ink); color: var(--paper); font-family: var(--font-ui); font-size: 0.56rem; font-weight: 800; letter-spacing: 0.06em; line-height: 1.2; text-transform: uppercase; }
.top-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* On a desktop the greeting gives way (it ellipsises) before the project title does. */
@media (min-width: 901px) { #shell .bar.has-project .bar-right, #shell .bar-right > .top-project { flex-shrink: 0; } }
.project-side .side-head { display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--space-3) var(--space-2); background: var(--paper); color: var(--ink); }
.side-wordmark { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; text-align: center; font-size: 2.3rem; line-height: 1; border: 0; padding: 0; color: var(--ink); background: transparent; }
/* Collapse handle: a slim tab inside the sidebar's bottom, its right side on the sidebar's border; fixed so it stays
   put while the page scrolls. Round on the inner side only, a little taller and narrower than before. */
.side-collapse { --handle-w: 14px; position: fixed; top: auto; bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px)); left: calc(var(--side-w) - var(--bw) - var(--handle-w)); z-index: 70; width: var(--handle-w); height: 44px; min-height: 0; padding: 0; display: inline-grid; place-items: center; background: var(--ink); color: var(--paper); border: 0; border-radius: 8px 0 0 8px; }
.side-collapse:hover { background: var(--brand); color: var(--brand-ink); }
.side-collapse svg { width: 12px; height: 12px; transition: transform 0.15s; }
body.side-collapsed .side-collapse svg { transform: rotate(180deg); }
.side-stage { padding: var(--space-2) var(--space-3); border-bottom: var(--bw) solid var(--line); }
.side-stage .stage-badge { display: inline-block; }
.side-nav { padding: var(--space-2) 0 var(--space-4); }
.side-item { display: flex; align-items: center; gap: var(--space-2); padding: 9px var(--space-3); border-left: 4px solid transparent; color: var(--ink); text-decoration: none; font-size: 0.9rem; line-height: 1.25; }
.side-item svg { width: 18px; height: 18px; flex: none; }
.side-item:hover { background: var(--surface-2); color: var(--ink); }
.side-item[aria-current='page'] { background: var(--brand); color: var(--brand-ink); border-left-color: var(--line); font-weight: 800; }
/* Project State reads like the group headings (SCRIPT, PLAN…): same type, padding and left edge. */
.side-home { padding: 10px var(--space-3); border-left: 0; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.side-home:hover { color: var(--ink); }
.side-home[aria-current='page'] { padding-left: var(--space-3); }
.side-home + .side-group { border-top: 1px solid var(--hair); }
.side-group { border: 0; }
.side-group + .side-group { border-top: 1px solid var(--hair); }
.side-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--space-2); padding: 10px var(--space-3); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary:hover { color: var(--ink); background: var(--surface-2); }
.side-group > summary svg { width: 18px; height: 18px; flex: none; }
.side-group.is-current > summary { color: var(--ink); }
.side-group > summary .count.new { margin-left: auto; }
.side-items { padding: 0 0 var(--space-2); }
.side-items .side-item { padding-left: calc(var(--space-3) + 26px); font-size: 0.86rem; }
.side-items .side-item[aria-current='page'] { padding-left: calc(var(--space-3) + 22px); }
.side-scrim { display: none; }
@media (min-width: 901px) {
  body.side-collapsed .side-wordmark, body.side-collapsed .side-label, body.side-collapsed .side-items { display: none; }
  body.side-collapsed .project-side .side-head { display: none; }
  body.side-collapsed .side-group > summary { justify-content: center; padding: 12px 0; }
  body.side-collapsed .side-home { justify-content: center; padding: 12px 0; }
  body.side-collapsed .side-home svg { width: 20px; height: 20px; }
  body.side-collapsed .side-group > summary svg { width: 20px; height: 20px; }
}
@media (max-width: 900px) {
  body.with-side { display: block; }
  body.with-side #shell { position: sticky; top: 0; }
  body.with-side main#main { display: block; }
  .side-toggle { display: inline-flex; padding: 0 var(--space-2); }
  #shell .bar.has-project { flex-wrap: nowrap; }
  #shell .bar.has-project .bar-right { flex: 0 1 auto; margin: 0; border-top: 0; overflow: visible; }
  .bar-hello { padding: 0 var(--space-1); font-size: var(--text-sm); }
  .top-role { display: none; }
  .top-project { max-width: 38vw; font-size: clamp(0.9rem, 3.2vw, 1.15rem); padding: 0 var(--space-2); }
  .project-side { position: fixed; top: 0; bottom: 0; left: 0; width: min(84vw, 320px); height: 100vh; transform: translateX(-100%); transition: transform 0.18s ease; z-index: 90; border-top: 0; }
  body.side-open .project-side { transform: none; }
  /* In the drawer (transformed, so fixed children follow it) the handle sits inside its right edge, only while open. */
  .side-collapse { left: auto; right: 0; }
  body:not(.side-open) .side-collapse { display: none; }
  .side-scrim { display: none; position: fixed; inset: 0; z-index: 80; width: 100%; min-height: 100%; border: 0; background: rgb(11 11 11 / 0.42); }
  body.side-open .side-scrim { display: block; }
}
@media print {
  body.with-side { display: block; }
  body.with-side #shell { position: static; }
  .project-side, .side-toggle, .side-scrim, .top-project, .side-collapse { display: none !important; }
}

/* One page head on every tab (2026-10-18): title on the left, actions on the right, same baseline and rule.
   The head itself does not wrap on a desktop; only its actions may. */
.head { flex-wrap: nowrap; align-items: flex-end; min-height: calc(var(--tap) + 10px); }
.head > .actions { margin-left: auto; justify-content: flex-end; }
.head > h1, .head > div { min-width: 0; }
@media (max-width: 600px) { .head { flex-wrap: wrap; } }

/* Header slots are reserved before their async content arrives, so the title and tools never jump between tabs. */
#shell .bar-right > #offline-slot { display: flex; align-items: center; justify-content: center; flex: 0 0 184px; width: 184px; padding: 0 var(--space-3); border-left: var(--bw) solid var(--line); overflow: hidden; }
#shell .bar-right > #offline-slot:empty { display: flex; }
#shell .bar-right > #offline-slot .offline-btn { width: 100%; justify-content: center; overflow: hidden; }
#shell .bar-right > #offline-slot .offline-btn .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#shell .bar-right > .alerts { flex: 0 0 132px; width: 132px; min-width: 0; overflow: hidden; justify-content: center; }
#shell .bar-right > .account { min-width: 66px; justify-content: center; }
@media (max-width: 900px) {
  #shell .bar-right > #offline-slot { flex-basis: 150px; width: 150px; padding: 0 var(--space-2); }
  #shell .bar-right > .alerts { flex-basis: 110px; width: 110px; }
}
@media (max-width: 560px) {
  #shell .bar-right > #offline-slot { flex-basis: 52px; width: 52px; padding: 0 var(--space-2); }
  #shell .bar-right > .alerts { flex-basis: 92px; width: 92px; }
}

/* Profile (/me, founder 2026-10-19): top tabs; the picture is a square photo (or initials); the account button carries
   the unread-alerts count; on Profile the header shows Back to project instead. */
img.avatar { object-fit: cover; padding: 0; background: var(--surface-2); }
.avatar.xl { width: 120px; height: 120px; font-size: 2.6rem; }
#shell .account { position: relative; }
#shell .account .count { position: absolute; top: 4px; right: 4px; min-width: 18px; text-align: center; }
#shell .bar-right > .back-project { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 0; border: 0; border-left: var(--bw) solid var(--line);
  padding: 0 var(--space-3); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; background: var(--brand); color: var(--brand-ink); text-decoration: none; white-space: nowrap; }
#shell .bar-right > .back-project:hover { background: var(--ink); color: var(--paper); }
#shell .bar-right > .back-project svg { width: 14px; height: 14px; }
.profile-tabs { margin-top: 0; }
.profile-tabs .count { margin-left: 4px; }
.profile .stack { display: grid; gap: var(--space-3); align-content: start; }
.avatar-edit { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); flex-wrap: wrap; }
.avatar-edit .actions { margin: 0; }
.avatar-edit label.button { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; }
.avatar-edit label.button svg { width: 18px; height: 18px; }
dialog.crop-dialog { width: min(360px, calc(100vw - 32px)); padding: var(--space-3); }
dialog.crop-dialog form { max-width: none; display: grid; gap: var(--space-2); justify-items: center; }
dialog.crop-dialog .ask-title, dialog.crop-dialog .hint { justify-self: stretch; margin: 0; }
.crop-view { border: var(--bw) solid var(--line); cursor: grab; touch-action: none; max-width: 100%; height: auto !important; aspect-ratio: 1; background: var(--surface-2); }
.crop-view:active { cursor: grabbing; }
.crop-zoom { justify-self: stretch; }
.crop-zoom input { width: 100%; accent-color: var(--brand); }
.record-table td .item-meta { display: block; }

/* Profile (founder, 2026-10-19): the picture has a plus badge, the work status sits under it, usual roles are a
   multi-select, the password shows its rules, and the Portfolio tab is a structured CV with work pictures. */
.avatar-stack { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.avatar-plus { position: relative; display: inline-block; cursor: pointer; line-height: 0; }
.avatar-plus-btn { position: absolute; right: -8px; bottom: -8px; width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink); border: var(--bw) solid var(--line); border-radius: 50%; }
.avatar-plus:hover .avatar-plus-btn { background: var(--ink); color: var(--paper); }
.avatar-plus-btn .icon { width: 18px; height: 18px; }
.work-status { min-height: 32px; width: auto; padding: 0 var(--space-3); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; border: var(--bw) solid var(--line); background: var(--surface); color: var(--ink); }
.work-status.ongoing { border-color: var(--accent); color: var(--accent); }
.work-status.finishing_soon { border-color: var(--warn); color: var(--warn); }
.work-status.available { border-color: var(--ok); color: var(--ok); }
.status-chip.ongoing { color: var(--accent); }
.status-chip.finishing_soon { color: var(--warn); }
.status-chip.available { color: var(--ok); }
.profile-tabs .tab-logout { margin-left: auto; display: inline-flex; align-items: center; gap: var(--space-1); border: 0; background: transparent;
  color: var(--accent); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; padding: 0 var(--space-1); }
.profile-tabs .tab-logout:hover { background: var(--accent); color: var(--paper); }
.profile-tabs .tab-logout .icon { width: 14px; height: 14px; }
select.roles-select { height: auto; min-height: 150px; padding: var(--space-1); }
select.roles-select option { padding: 5px var(--space-2); }
.contact-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.contact-row span { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
form.inline-contact { border-top: 1px solid var(--hair); padding-top: var(--space-3); margin-top: var(--space-3); }
.pw-meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: var(--space-1) 0; }
.pw-meter span { height: 5px; background: var(--hair); }
.pw-meter[data-score='1'] span:nth-child(-n+1),
.pw-meter[data-score='2'] span:nth-child(-n+2),
.pw-meter[data-score='3'] span:nth-child(-n+3) { background: var(--accent); }
.pw-meter[data-score='4'] span:nth-child(-n+4) { background: var(--warn); }
.pw-meter[data-score='5'] span { background: var(--ok); }
.pw-rules { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px var(--space-3); font-size: var(--text-sm); color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: var(--space-2); }
.pw-dot { width: 8px; height: 8px; border: 1px solid currentColor; border-radius: 50%; flex: none; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok .pw-dot { background: currentColor; }
fieldset.portfolio-group { border: var(--bw) solid var(--line); padding: var(--space-3); margin: 0 0 var(--space-3); }
fieldset.portfolio-group legend { padding: 0 var(--space-2); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.portfolio-row { border-top: 1px solid var(--hair); padding: var(--space-3) 0; display: grid; gap: var(--space-2); }
.portfolio-row:first-child { border-top: 0; padding-top: 0; }
.portfolio-dates { align-items: end; }
.portfolio-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); margin: var(--space-2) 0; }
.portfolio-image { margin: 0; border: var(--bw) solid var(--line); background: var(--surface); padding: var(--space-1); display: flex; flex-direction: column; gap: var(--space-1); }
.portfolio-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-2); }
.portfolio-image figcaption { font-size: var(--text-sm); overflow-wrap: anywhere; }
.portfolio-dialog-head { display: flex; justify-content: space-between; align-items: start; gap: var(--space-3); }
.portfolio-dialog-head h2 { margin: 0; }
.portfolio-dialog-side { display: flex; align-items: center; gap: var(--space-2); }
.portfolio-bio { white-space: pre-wrap; max-width: 70ch; }
.portfolio-block { border-top: 1px solid var(--hair); margin: 0; padding-top: var(--space-2); }
.portfolio-block h3, .portfolio-support h3 { margin: 0 0 var(--space-1); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.portfolio-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.portfolio-list li { margin: 0; }
.portfolio-list p { margin: 2px 0; white-space: pre-wrap; }
.portfolio-support { border-top: var(--bw) solid var(--line); margin-top: var(--space-3); padding-top: var(--space-3); }

/* Team (founder review 2026-10-20): one hint under the title; the owner's own name is plain; Portfolio sits with Save;
   availability is a list of Not available dates only; fees fit rate · unit · quantity. */
.person-name-static { font-weight: 700; color: var(--ink); text-transform: uppercase; }
.person-pane .actions .portfolio-btn { margin-right: auto; }
.person-pane .hint.avail-none { margin-top: calc(-1 * var(--space-2)); }
.head .actions .button, .head .actions button { min-height: 38px; padding: 0 var(--space-3); }
.head .actions .find-btn, button.find-btn { background: var(--brand); color: var(--brand-ink); border-color: var(--line); }
.head .actions .invite-btn, button.invite-btn { background: var(--ok); color: var(--paper); border-color: var(--line); }
.head .actions .find-btn:hover, .head .actions .invite-btn:hover, button.find-btn:hover, button.invite-btn:hover { background: var(--ink); color: var(--paper); }
.crew-result { align-items: flex-start; }
.crew-result .crew-name { border: 0; background: none; padding: 0; min-height: 0; font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; text-transform: none; }
.crew-result .crew-name:hover { background: none; color: var(--brand-fg); text-decoration: underline; }
.crew-result .crew-line { text-transform: none; letter-spacing: 0; color: var(--muted); white-space: normal; }
.crew-search label { display: grid; gap: var(--space-1); margin-bottom: var(--space-3); }
.crew-search .search-line { margin-top: var(--space-1); }
.avail-row { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: var(--space-2); margin-bottom: var(--space-2); }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.deal-advanced { border-top: 1px solid var(--hair); padding-top: var(--space-2); }
.deal-advanced > summary { cursor: pointer; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75rem; margin-bottom: var(--space-2); }
.xlsx-drop { display: grid; place-items: center; border: var(--bw) dashed var(--line); padding: var(--space-4); margin-bottom: var(--space-3); }
.xlsx-pick { display: grid; justify-items: center; gap: var(--space-2); text-align: center; cursor: pointer; }
@media (max-width: 560px) { .row.three { grid-template-columns: 1fr; } .avail-row { grid-template-columns: 1fr 1fr auto; } }
.kiv-dot { color: var(--tomato); font-weight: 800; }
.char-head-actions { display: inline-flex; align-items: center; gap: var(--space-1); flex: none; }
.char-card .ref-image { position: relative; display: inline-flex; }
.char-card .ref-del { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; min-height: 0; padding: 0; display: inline-grid; place-items: center; border: var(--bw) solid var(--line); background: var(--paper); color: var(--accent); }
.char-card .ref-del svg { width: 12px; height: 12px; }
.char-card .ref-del:hover { background: var(--accent); color: var(--paper); }
.form-note { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--accent); }
.full-script { position: relative; }
.script-overlay-tools { position: absolute; top: 6px; right: 6px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; opacity: 0.42; transition: opacity 0.15s; }
.script-overlay-tools:hover, .script-overlay-tools:focus-within { opacity: 1; }
.script-overlay-tools .filter-toggle, .script-overlay-tools .icon-btn { min-height: 26px; padding: 0 6px; font-size: 0.72rem; }
.script-overlay-tools .filter-toggle svg, .script-overlay-tools .icon-btn svg { width: 14px; height: 14px; }
.full-script:fullscreen .script-overlay-tools, .full-script.is-full .script-overlay-tools { display: none; }
.sb-filter .seg { width: 100%; }
.sb-filter .seg > button { flex: 1; min-height: 30px; font-size: var(--text-sm); }
.side-episodes { display: flex; flex-direction: column; }
.side-episodes .side-item { display: grid; justify-items: start; gap: 2px; width: 100%; text-align: left; border: 0; border-left: 4px solid transparent; background: transparent; }
.side-episodes .side-item:hover { background: var(--surface-2); }
.side-episodes .side-item[aria-current='true'] { background: var(--brand-soft); border-left-color: var(--line); }
.wardrobe-table th:first-child, .wardrobe-table td:first-child { width: 38%; min-width: 320px; text-align: left; }
.wardrobe-table th:last-child, .wardrobe-table td:last-child { width: 96px; text-align: right; }
.wardrobe-table td:first-child strong { white-space: nowrap; }
.prop-card.wardrobe-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
.prop-card.wardrobe-card > .box:nth-child(2) { grid-column: auto; }
.prop-card.wardrobe-card > .box:last-child { grid-column: 1 / -1; }
.wardrobe-card .wardrobe-scenes { max-height: 340px; overflow: auto; }
@media (max-width: 900px) { .prop-card.wardrobe-card > .box:nth-child(2) { grid-column: auto; } }
.clients-table a.email { max-width: none; }
.clients-table td:nth-child(5) input.remark { text-overflow: clip; }

/* Script tab: the reader and the actors' questions start on the same line */
.full-script-wrap { margin-top: 0; }
.full-script-wrap > .panel.full-script { margin: 0; }

/* Side lists: the current scene stays white on the black band, including its meta, heading and quote */
.side-list > a[aria-current='true'],
.side-list > a[aria-current='true'] .item-meta,
.side-list > a[aria-current='true'] .script-quote,
.side-list > a[aria-current='true'] .tag,
.ep-list > li[aria-current='true'] > a,
.ep-list > li[aria-current='true'] .item-meta,
.side-episodes .side-item[aria-current='true'],
.side-episodes .side-item[aria-current='true'] .item-meta { color: var(--brand-ink); }
.side-list > a[aria-current='true'] .tag { border-color: var(--brand-ink); background: transparent; }

/* Character card: a neat head (name + age, type, scenes; three images), then type, profile and its tabs */
.char-boxes > .char-box:nth-of-type(2) { grid-row: auto; }
.char-box-head { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-2); text-align: left; }
.char-head-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--space-3) var(--space-4); width: 100%; }
.char-head-identity { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.char-name-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.char-name { font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1; margin: 0; }
.char-age-inline { display: inline-flex; align-items: baseline; gap: 3px; color: var(--muted); font-size: var(--text-base); }
.char-age-inline input { width: 3.6em; min-height: 30px; padding: 0 4px; text-align: center; font-size: var(--text-sm); }
.char-head-types { display: flex; flex-wrap: wrap; gap: 4px; }
.char-head-images { display: grid; grid-template-columns: repeat(3, 72px); grid-auto-rows: 72px; gap: var(--space-2); justify-content: end; align-content: start; }
.char-head-images .char-image-slot { width: 72px; height: 72px; }
.char-head-images img { width: 72px; height: 72px; object-fit: cover; border: var(--bw) solid var(--line); display: block; }
.char-head-images .ref-add { border-radius: 0; }
.char-unsplash { align-self: flex-start; }
.char-type-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-1) var(--space-4); }
.char-type-grid label.check { min-height: 34px; transition: opacity 0.15s; }
.char-type-grid label.check.dim { opacity: 0.35; }
.char-type-grid label.check.dim:hover, .char-type-grid label.check.dim:focus-within { opacity: 0.7; }
.char-profile-box form.brief { max-width: none; }
.char-profile-line { margin-top: var(--space-2); }
.char-tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 var(--space-2); border-bottom: var(--bw) solid var(--line); }
.char-tabs > button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; min-height: 36px; padding: 0 var(--space-3); color: var(--muted); font-weight: 700; }
.char-tabs > button[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--brand-fg); }
.char-tab-panel { min-height: 4rem; }
.char-dialog-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding-top: var(--space-3); border-top: var(--bw) solid var(--line); }
.char-dialog-buttons { display: flex; align-items: center; gap: 0; margin-left: auto; }
.char-dialog-buttons > button + button { border-left: 0; }
.char-dialog-actions .char-delete { display: inline-flex; align-items: center; gap: 6px; }
.char-type-box, .char-profile-box, .char-tabs-box { grid-column: 1 / -1; }
.char-profile-box form.brief { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
@media (max-width: 760px) { .char-head-main { grid-template-columns: 1fr; } .char-head-images { justify-content: start; } .char-profile-box form.brief { grid-template-columns: 1fr; } }

/* ---- Wardrobe lookbook (2026-10-21): a character rail, their scenes as a strip with the look worn and Continuity's
   notes, the opened scene below it, and look cards with the main picture large beside what the look is. Tighter than
   the rest of the app: this page is a reference people read while dressing. */
.lb { grid-template-columns: minmax(170px, 210px) minmax(0, 1fr); gap: 6px; }
.lb-rail > a { display: grid; gap: 1px; padding: 6px var(--space-2); }
.lb-rail .tag { padding: 0 4px; }
.lb-rail-meta { font-size: 0.75rem; color: var(--muted); }
.lb-short { color: var(--warn); font-weight: 700; }
.lb-full { color: var(--ok); font-weight: 700; }
.lb-main > .box { margin: 0; padding: 6px var(--space-2); }
.lb-main > .box + .box { margin-top: calc(-1 * var(--bw)); }
.lb-char-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); margin-bottom: 6px; }
.lb-name { margin: 0; font-family: var(--font-display); font-size: var(--text-xl); text-transform: uppercase; line-height: 1.1; font-weight: 400; }
.lb-name .item-meta { font-family: var(--font-ui); font-size: var(--text-sm); text-transform: none; }
.lb-add { margin-left: auto; }
ol.lb-strip { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 3px; }
.lb-ep { align-self: stretch; display: grid; place-items: center; padding: 0 6px; font-family: var(--font-display); background: var(--ink); color: var(--paper); }
.lb-sc { display: grid; grid-template-rows: auto auto 14px; justify-items: center; min-width: 52px; min-height: 0; padding: 3px 4px; gap: 1px;
  border: var(--bw) solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); line-height: 1.1; }
.lb-sc-n { font-family: var(--font-script); font-size: 0.75rem; }
.lb-sc-l { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.04em; }
.lb-sc-m { display: inline-flex; gap: 2px; font-size: 0.75rem; color: var(--muted); }
.lb-sc-m .icon { width: 12px; height: 12px; }
.lb-sc.gap { border-style: dashed; color: var(--warn); }
.lb-sc.brk { box-shadow: inset 4px 0 0 var(--muted); }
.lb-sc.hl { background: var(--brand-soft); }
.lb-sc[aria-pressed='true'] { background: var(--brand); color: var(--brand-ink); }
.lb-sc[aria-pressed='true'] .lb-sc-m { color: inherit; }
.lb-legend { display: flex; flex-wrap: wrap; gap: 2px var(--space-2); margin-top: 4px; }
.lb-key { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 6px 0 0; border: 0; background: none; font-size: var(--text-sm); color: var(--ink); }
.lb-key.on { text-decoration: underline; text-decoration-thickness: 2px; }
.lb-letter { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 3px; border: var(--bw) solid var(--line); background: var(--surface);
  font-family: var(--font-display); font-size: 0.95rem; line-height: 1; color: var(--ink); }
button.lb-letter { min-height: 24px; border-radius: 0; cursor: pointer; }
.lb-pick { margin-top: 4px; }
.lb-scene { margin-top: 6px; border: var(--bw) solid var(--line); background: var(--surface-2); }
.lb-scene-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--space-2); padding: 4px var(--space-2); border-bottom: var(--bw) solid var(--line); background: var(--surface); }
.lb-scene-act { margin-left: auto; display: inline-flex; }
.lb-scene-act .icon-btn { min-width: 30px; min-height: 30px; }
.lb-scene-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.lb-scene-body > div { padding: 6px var(--space-2); min-width: 0; }
.lb-scene-body > div + div { border-left: var(--bw) solid var(--line); }
.lb-scene-body h4 { margin: 0 0 4px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
ul.lb-worn { list-style: none; margin: 0 0 var(--space-1); padding: 0; display: grid; gap: 4px; }
ul.lb-worn > li { display: grid; grid-template-columns: auto minmax(6rem, auto) minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.lb-worn-name { font-weight: 600; }
.lb-wear { gap: 4px; }
.lb-wear select { min-height: 30px; width: auto; font-size: var(--text-sm); }
.lb-cont ul.tight { margin: 0; }
.lb-cont-pics { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.lb-cont-pics img { width: 64px; height: 64px; object-fit: cover; display: block; border: 1px solid var(--line); }

/* A look: a small picture column (click to enlarge), then the look; editing puts the details and Advanced (tabs) side
   by side. Looks stack flush, sharing their frames. */
.lk { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 0; padding: 0 !important; }
.lk.on { grid-template-columns: 104px minmax(0, 1fr) minmax(0, 1.45fr); background: var(--paper); position: relative; z-index: 1; outline: var(--bw) solid var(--line); }
.lk-pics { border-right: var(--bw) solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; }
.lk-pics button, .lk-results button, .lb-cont-pics button { display: block; padding: 0; min-height: 0; min-width: 0; border: 0; border-radius: 0; background: none; cursor: zoom-in; }
.lk-hero { width: 100%; aspect-ratio: 3 / 4; overflow: hidden; }
.lk-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lk-empty { display: grid; place-items: center; aspect-ratio: auto; min-height: 72px; padding: 4px; text-align: center; color: var(--muted); font-size: 0.75rem; }
.lk-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; border-top: var(--bw) solid var(--line); }
.lk-thumbs img, .lk-results img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.lk-addpic { aspect-ratio: 1; display: grid !important; place-items: center; border: 1px dashed var(--line) !important; background: var(--surface) !important; cursor: pointer !important; }
.lk-addpic .icon { width: 16px; height: 16px; }
.lk-info { padding: 6px var(--space-2); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lk-info p { margin: 0; }
.lk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); }
.lk-head h3 { margin: 0; font-size: var(--text-base); line-height: 1.2; min-width: 0; text-transform: uppercase; }
.lk-nums { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.lk-sc { min-height: 22px; padding: 0 5px; border: 1.5px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); font-family: var(--font-script); font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.lk-sc.has-cond { background: var(--brand-soft); }
.lk-toggle { margin-left: auto; min-width: 30px !important; min-height: 30px !important; }
.lk-notes { white-space: pre-line; font-size: var(--text-sm); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
ul.lk-changes { list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); display: grid; gap: 1px; }
.lk-ch-sc { font-family: var(--font-script); font-weight: 700; }
.lk-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); }
.lk-form { display: grid; gap: 4px; }
.lk-form label, .lk-adv label { margin: 0 !important; }
.lk-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr); gap: 4px; }
.lk-row .lk-name { grid-column: 1 / -1; }
.lk-row:not(:has([name=pieces])) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.lk-form textarea { min-height: 60px; }
.lk-actions { display: flex; align-items: center; gap: 4px; }
.lk-actions button[data-i18n] { min-width: 34px; min-height: 34px; }
/* Advanced: a column of its own beside the details, its sections as tabs. */
.lk-adv { border-left: var(--bw) solid var(--line); display: flex; flex-direction: column; min-width: 0; background: var(--surface); }
.lk-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; align-items: stretch; border-bottom: var(--bw) solid var(--line); background: var(--surface-2); }
.lk-adv-title { padding: 2px var(--space-2); font-family: var(--font-display); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.3; background: var(--ink); color: var(--paper); }
.lk-tabs > button { flex: 1 0 auto; min-height: 32px; padding: 0 5px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--muted); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0; }
.lk-tabs > button[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: inset 0 -3px 0 var(--ink); }
.lk-pane { padding: 6px var(--space-2); display: grid; gap: 6px; align-content: start; max-height: 420px; overflow-y: auto; }
.lk-pane p { margin: 0; }
.lk-adv .scene-picks { gap: 0 var(--space-2); }
.lk-adv input[type=checkbox] { min-height: 0; }
.lk-adv .scene-picks label.check { min-height: 24px; font-family: var(--font-script); font-size: var(--text-sm); }
.lk-adv label.check { min-height: 28px; }
.lk-fit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; }
.lk-fit .lk-actions { grid-column: 1 / -1; flex-wrap: wrap; }
.lk-fit input { min-height: 32px; font-size: var(--text-sm); }
.lk-sub { margin: 2px 0 0; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.lk-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 2px; }
.lk-pane .dispute-list { margin: 0; }
.lk-pane form.inline { gap: 4px; }
.lk-pane .comments, .lk-pane [data-comments] { min-width: 0; }
/* Scenes & Conditions: one row per scene — the number (and shoot days), the heading, the condition from there on, and
   what Continuity noted on set. A row where the look changes has a heavy left edge. */
table.lk-cond { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.lk-cond tr { border-bottom: 1px solid var(--hair); }
table.lk-cond tr:last-child { border-bottom: 0; }
table.lk-cond tr.has-change { box-shadow: inset 3px 0 0 var(--ink); }
table.lk-cond th, table.lk-cond td { padding: 4px 4px; vertical-align: top; text-align: left; }
table.lk-cond th { width: 1%; white-space: nowrap; padding-left: 6px; font-weight: 400; }
table.lk-cond td.r { width: 1%; }
table.lk-cond .icon-btn { min-width: 28px !important; min-height: 28px !important; }
.lk-days { display: block; font-size: 0.7rem; color: var(--muted); margin-top: 2px; }
.lk-slug { display: block; font-family: var(--font-script); font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; margin-bottom: 2px; }
table.lk-cond td:nth-child(2) { max-width: 0; width: 100%; }
table.lk-cond .cond-input { min-height: 28px; }
.lk-onset { display: grid; gap: 2px; margin-top: 3px; padding-left: 6px; border-left: 2px solid var(--hair); }
.lk-onset-k { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.lk-onset .lb-cont-pics img { width: 40px; height: 40px; }
details.lk-pick { border-top: var(--bw) solid var(--line); padding-top: 4px; }
details.lk-pick > summary { cursor: pointer; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 0; }
details.lk-pick form { display: grid; gap: 4px; margin-top: 4px; }
/* Costume continuity (2026-10-21): a change set on a scene is solid, carried on is grey; red marks what can't work. */
.lb-sc-l { display: inline-flex; gap: 3px; }
.lb-sc-l .auto { color: var(--muted); opacity: 0.55; }
.lb-letter.auto { color: var(--muted); border-color: var(--muted); border-style: dashed; }
.lb-sc[aria-pressed='true'] .lb-sc-l .auto { color: inherit; opacity: 0.6; }
.lb-sc.bad { border-color: var(--accent); box-shadow: inset 0 -4px 0 var(--accent); }
.lb-key-help { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 0.72rem; color: var(--muted); }
.lb-key-help .lb-letter { min-width: 18px; height: 18px; font-size: 0.75rem; }
.lb-key-help .lb-letter + * { margin-right: 4px; }
.lb-mode { display: block; font-size: 0.7rem; font-weight: 400; color: var(--muted); }
ul.lb-conflicts { list-style: none; margin: 0 0 6px; padding: 4px var(--space-2); border: var(--bw) solid var(--accent); display: grid; gap: 2px; font-size: var(--text-sm); }
ul.lb-conflicts li { display: flex; gap: 6px; align-items: flex-start; }
ul.lb-conflicts .icon { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; }
ul.lb-garms { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 2px; font-size: var(--text-sm); }
ul.lb-garms li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.lb-switch { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; border-bottom: var(--bw) solid var(--line); background: var(--surface); }
.lb-switch > button { min-width: 0; min-height: 32px; padding: 0 4px; border: 0; border-radius: 0; background: var(--surface-2); color: var(--muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-rail { overflow-x: hidden; }
.lb-switch > button + button { border-left: var(--bw) solid var(--line); }
.lb-switch > button[aria-selected='true'] { background: var(--ink); color: var(--paper); }
.lb-bad { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; background: var(--accent); color: var(--accent-ink); font-size: 0.7rem; }
.lb-bad-i .icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.lb-rail > .lb-newg { margin: 6px var(--space-2); }
.lk-auto { align-self: center; font-size: 0.72rem; color: var(--muted); border: 1.5px dashed var(--muted); padding: 0 5px; line-height: 20px; }
.lk-garms { display: flex; flex-wrap: wrap; gap: 3px; }
.lk-garm { display: inline-flex; align-items: center; gap: 2px; min-height: 22px; padding: 0 6px; border: 1px solid var(--line); background: var(--surface-2); font-size: 0.8rem; color: var(--ink); border-radius: 0; }
button.lk-garm { cursor: pointer; }
.lk-garm > button { min-width: 0; min-height: 0; padding: 0 0 0 4px; border: 0; background: none; line-height: 1; }
.lk-garm > button .icon { width: 12px; height: 12px; }
.lk-gedit { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.lk-gedit-k { width: 100%; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.lk-gedit select { width: auto; min-height: 26px !important; font-size: 0.8rem; padding-top: 0; padding-bottom: 0; }
table.lk-cond tr.auto th .lk-sc { border-style: dashed; color: var(--muted); }
table.lk-cond tr.bad { box-shadow: inset 4px 0 0 var(--accent); }
/* A garment: pictures beside its details, then where it is worn. */
.gm { padding: 0 !important; }
.gm-top { display: grid; grid-template-columns: 104px minmax(0, 1fr); border-bottom: var(--bw) solid var(--line); }
.gm-form { padding: 6px var(--space-2); }
.gm-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 70px minmax(0, 1fr); gap: 4px; }
.gm > .lb-conflicts { margin: 6px var(--space-2) 0; }
.gm-title { margin: 6px var(--space-2) 2px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.gm-table { margin: 0 0 4px; }
.gm-who { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; margin-bottom: 2px; font-size: var(--text-sm); }
td.gm-destroy { width: 1%; white-space: nowrap; }
td.gm-destroy label.check { min-height: 28px; font-size: 0.78rem; }
.gm-addscene { margin: 4px var(--space-2) 8px; gap: 4px; }
.gm-addscene select { min-height: 30px; font-size: var(--text-sm); max-width: 380px; }
@media (max-width: 640px) { .gm-row { grid-template-columns: 1fr 1fr; } .gm-row .lk-name { grid-column: 1 / -1; } }
/* The picture modal. */
dialog.pic-dialog { width: min(1000px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: var(--space-2); }
.pic-stage { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); }
.pic-stage img { grid-column: 2; width: 100%; max-height: calc(100dvh - 120px); object-fit: contain; display: block; background: var(--surface-2); }
.pic-stage:not(:has(.pic-nav)) { grid-template-columns: minmax(0, 1fr); }
.pic-stage:not(:has(.pic-nav)) img { grid-column: 1; }
@media (max-width: 1100px) {
  .lk.on { grid-template-columns: 104px minmax(0, 1fr); }
  .lk.on .lk-adv { grid-column: 1 / -1; border-left: 0; border-top: var(--bw) solid var(--line); }
}
@media (max-width: 900px) {
  .lb-rail { flex-direction: row; overflow-x: auto; max-height: none; }
  .lb-rail > a { flex: 0 0 auto; border-bottom: 0; border-right: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .lk, .lk.on { grid-template-columns: 84px minmax(0, 1fr); }
  .lb-scene-body { grid-template-columns: 1fr; }
  .lb-scene-body > div + div { border-left: 0; border-top: var(--bw) solid var(--line); }
  ul.lb-worn > li { grid-template-columns: auto minmax(0, 1fr); }
  ul.lb-worn > li > .cond-input { grid-column: 1 / -1; }
}

/* ---- Talk on an item, and the Inbox (2026-10-21): handover, problems, discussion in one panel; one inbox per person. */
.item-talk { display: grid; gap: 8px; }
.talk-sec { display: grid; gap: 4px; }
.talk-sec + .talk-sec { border-top: 1px solid var(--hair); padding-top: 6px; }
.talk-sec > h4 { margin: 0; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.talk-ho { border: var(--bw) solid var(--line); padding: 6px var(--space-2); background: var(--surface-2); display: grid; gap: 4px; }
.talk-ho p { margin: 0; }
.talk-note { margin: 2px 0; padding-left: 6px; border-left: 2px solid var(--hair); font-size: var(--text-sm); white-space: pre-line; }
.talk-act { display: flex; flex-wrap: wrap; gap: 4px; }
.talk-hoform { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; }
.talk-hoform > input { grid-column: 1 / -1; grid-row: 2; }
.talk-hoform select, .talk-hoform input, .talk-raise input { min-height: 32px; font-size: var(--text-sm); }
ul.talk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
ul.talk-list > li { border: 1px solid var(--line); border-left: 4px solid var(--warn); padding: 4px var(--space-2); display: grid; gap: 2px; font-size: var(--text-sm); }
ul.talk-list > li.warning, ul.talk-list > li.critical { border-left-color: var(--accent); }
ul.talk-list > li > button { justify-self: start; }
.talk-closed ul.talk-list > li { border-left-color: var(--ok); opacity: 0.8; }
.talk-closed > summary { cursor: pointer; font-size: 0.75rem; color: var(--muted); }
.talk-raise { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; align-items: center; }
.talk-raise > input { grid-column: 1 / -1; }
.talk-raise > button { justify-self: end; }
.talk-raise label.check { min-height: 30px; font-size: 0.78rem; margin: 0 !important; }
.item-talk .comments { margin: 0; }
.gm-talk { padding: 4px var(--space-2) var(--space-2); border-top: var(--bw) solid var(--line); }
.gm-name { margin: 2px 0; font-size: var(--text-lg); text-transform: uppercase; }
.lb-rail > .side-head { margin-top: 4px; }
.prop-talk { grid-column: 1 / -1; }
.ib-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 6px; align-items: start; }
.ib-box { margin: 0 !important; }
.ib-sub { margin: 6px 0 2px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
ul.ib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
li.ib-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: start; padding: 5px 0; border-bottom: 1px solid var(--hair); }
li.ib-row:last-child { border-bottom: 0; }
li.ib-row.unread strong { text-decoration: underline; text-decoration-thickness: 2px; }
.ib-main { display: grid; gap: 1px; min-width: 0; font-size: var(--text-sm); }
.ib-main p { margin: 0; }
.ib-item { font-size: 0.8rem; }
.ib-act { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.side-inbox .count { margin-left: auto; }
@media (max-width: 640px) { .talk-hoform { grid-template-columns: 1fr; } }
.item-talk form { margin: 0; max-width: none; }
.item-talk p { margin: 0; }
.item-talk .comments + * { margin-top: 4px; }
.item-talk > section, .item-talk .talk-sec { margin: 0; }

/* ---- The AD's breakdown check (2026-10-21): every change to what scenes need, Checked or Undo. */
.bdlog { margin-bottom: 6px !important; }
.bdlog-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-2); margin-bottom: 4px; }
.bdlog-head .box-title { margin: 0 !important; }
.bdlog-head select { width: auto; min-height: 30px; font-size: var(--text-sm); }
.bdlog-all { margin-left: auto; }
table.bdlog-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.bdlog-table tr { border-bottom: 1px solid var(--hair); }
table.bdlog-table td { padding: 4px; vertical-align: top; }
td.bdlog-sc { width: 1%; white-space: nowrap; }
td.bdlog-act { width: 1%; white-space: nowrap; text-align: right; }
td.bdlog-act .icon-btn { min-width: 30px !important; min-height: 30px !important; }
.bdlog-what { text-transform: uppercase; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); }
table.bdlog-table tr.ai .bdlog-what { color: var(--info); }
table.bdlog-table tr.checked { opacity: 0.6; }
table.bdlog-table tr.undone td:nth-child(2) > strong { text-decoration: line-through; }
#bdchanges .count { margin-left: 4px; }
/* Props continuity: a row where the condition changes or the prop is destroyed has a heavy edge; red where it can't work. */
table.prop-scenes tr.has-change > td:first-child { box-shadow: inset 3px 0 0 var(--ink); }
table.prop-scenes tr.bad > td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
table.prop-scenes input[type=checkbox] { min-height: 0; }
.prop-card .lb-conflicts { margin: 0 0 6px; }
.prop-card:not(.wardrobe-card) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); }
table.prop-scenes td.scene-line { font-size: 0.8rem; }
@media (max-width: 900px) { .prop-card:not(.wardrobe-card) { grid-template-columns: 1fr; } }

/* Department views (2026-10-22, core/dept-views.js): the view switcher, Continuity's notice, by scene, the picture wall. */
.head .dview { margin-left: auto; }
.head .dview + select { margin-left: var(--space-2); }
.dview > button { min-height: 32px; padding: 0 var(--space-2); font-size: var(--text-sm); }
.cont-unchecked { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); }
.cont-unchecked .icon { width: 16px; height: 16px; }
.gm-row.gm-row3 { grid-template-columns: repeat(2, minmax(0, 1fr)) 80px; }
.gm-name { margin: 0 0 4px; font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: var(--text-lg); line-height: 1.15; }
.gm-name .item-meta, .gm-name .tag { font-family: var(--font-ui); text-transform: none; font-size: var(--text-sm); }
.gm.omitted { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.lb-rail > a.omitted strong { text-decoration: line-through; color: var(--accent); }
.pst-text.pst-ready { color: var(--ok); background: none; } .pst-text.pst-issue, .pst-text.pst-omitted { color: var(--accent); background: none; }
.pst-text.pst-sourcing { color: var(--warn); background: none; } .pst-text.pst-needed { background: none; }
.gm-addscene { margin: 4px var(--space-2) 6px; gap: 4px; }
.gm-addscene select { width: auto; max-width: 100%; }
.by-scene { display: grid; gap: 0; }
.by-scene-box { margin: 0; padding: 0 !important; }
.by-scene-box + .by-scene-box { margin-top: calc(-1 * var(--bw)); }
.by-scene-items { list-style: none; margin: 0; padding: 4px var(--space-2) 6px; display: grid; gap: 2px; }
.by-scene-items > li { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(0, 2fr) auto; gap: var(--space-2); align-items: baseline; font-size: var(--text-sm); }
.by-scene-items > li.omitted { text-decoration: line-through; color: var(--muted); }
.by-scene-look { display: inline-flex; align-items: baseline; gap: 4px; margin-right: var(--space-2); }
.by-scene-look .lb-letter { min-height: 0; cursor: pointer; }
.change-table .lb-letter { min-height: 0; }
.pic-wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0; }
.pic-wall > li { border: var(--bw) solid var(--line); margin: 0 calc(-1 * var(--bw)) calc(-1 * var(--bw)) 0; background: var(--surface); }
.pic-wall button { display: block; width: 100%; padding: 0; border: 0; border-radius: 0; background: none; text-align: left; min-height: 0; cursor: pointer; }
.pic-wall img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-bottom: var(--bw) solid var(--line); }
.pic-wall-cap { display: grid; gap: 1px; padding: 4px 6px; font-size: var(--text-sm); line-height: 1.25; }
.pic-wall-kind { margin: 0; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.pic-wall button:hover .pic-wall-cap, .pic-wall button:focus-visible .pic-wall-cap { background: var(--brand); color: var(--brand-ink); }
.pic-detail { width: min(860px, calc(100vw - 32px)); }
.pic-detail-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); }
.pic-detail-img { padding: 0; border: var(--bw) solid var(--line); border-radius: 0; background: var(--surface-2); min-height: 0; cursor: zoom-in; }
.pic-detail-img img { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
.pic-detail-rows { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--space-2); margin: 0 0 var(--space-2); font-size: var(--text-sm); }
.pic-detail-rows dt { color: var(--muted); }
.pic-detail-rows dd { margin: 0; }
@media (max-width: 640px) {
  .pic-detail-body { grid-template-columns: 1fr; }
  .by-scene-items > li { grid-template-columns: 1fr; gap: 0; }
  .head .dview { margin-left: 0; width: 100%; overflow-x: auto; }
  .gm-row.gm-row3 { grid-template-columns: 1fr 1fr; }
}

/* Continuity's story-day board (2026-10-22). */
.cb-ep { margin: 0 0 var(--space-3); padding: 0 !important; }
.cb-ep-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); padding: 6px var(--space-2); border-bottom: var(--bw) solid var(--line); }
.cb-ep-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: var(--text-lg); }
.cb-ep-head button { margin-left: auto; }
.cb-days { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; padding: var(--space-2); }
.cb-day { flex: 1 1 220px; max-width: 360px; border: var(--bw) solid var(--line); margin: 0 calc(-1 * var(--bw)) calc(-1 * var(--bw)) 0; background: var(--surface); min-height: 80px; }
.cb-day.none { background: var(--surface-2); }
.cb-day.over, .cb-new.over { background: var(--brand-soft); outline: var(--bw) dashed var(--brand-fg); outline-offset: -4px; }
.cb-day-new { display: grid; place-items: center; border-style: dashed; flex: 0 1 140px; }
.cb-day-head { padding: 3px 6px; border-bottom: var(--bw) solid var(--line); font-size: var(--text-sm); }
.cb-chips { display: flex; flex-direction: column; }
.cb-chip { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 6px; align-items: baseline; text-align: left; min-height: 0; padding: 3px 6px; border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; background: none; font-size: var(--text-sm); cursor: pointer; }
.cb-chip[draggable='true'] { cursor: grab; }
.cb-chip strong { font-family: var(--font-script); }
.cb-chip-h { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-script); font-size: 0.75rem; }
.cb-chip .tag { grid-column: 2; justify-self: start; }
.cb-chip.brk { box-shadow: inset 4px 0 0 var(--muted); }
.cb-chip.unchecked strong { color: var(--warn); }
.cb-chip.on { background: var(--brand); color: var(--brand-ink); }
.cb-new { align-self: stretch; display: grid; place-items: center; width: 26px; margin-right: calc(-1 * var(--bw)); border: var(--bw) dashed var(--line); color: var(--muted); }
.cb-new .icon { width: 14px; height: 14px; }
.cb-edit { position: sticky; bottom: 0; z-index: 2; padding: 6px var(--space-2) !important; background: var(--paper); }
.cb-edit h2 { margin: 0 0 4px; font-size: var(--text-base); }
.cb-edit form { gap: 4px var(--space-2); align-items: end; }
.cb-edit select { max-width: 280px; }

/* Budget by shoot day and Hot Cost (2026-10-22). */
.daily-row { cursor: pointer; }
.daily-row:hover > * { background: var(--brand-soft); }
.daily-lines { margin: 0; padding: 0; list-style: none; }
.daily-lines > li { display: flex; justify-content: space-between; gap: var(--space-2); border-bottom: 1px solid var(--hair); padding: 2px 0; font-size: var(--text-sm); }
.hot-split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0; margin-bottom: var(--space-3); }
.hot-split > .box { margin: 0; }
.hot-split > .box + .box { margin-left: calc(-1 * var(--bw)); }
.hot-entries input { width: 100%; }
.hot-entries .num.bad, td.bad { color: var(--accent); font-weight: 700; }
.hot-entries .num.ok, td.ok { color: var(--ok); font-weight: 700; }
.review tr.on > td { background: var(--brand-soft); }
@media (max-width: 760px) { .hot-split { grid-template-columns: 1fr; } .hot-split > .box + .box { margin: calc(-1 * var(--bw)) 0 0; } }

/* Colour, lightly (founder's review 2026-10-22). Selection is dark blue, not black; Save, Cancel and Delete are told
   apart by colour wherever they are (the icon's class, core/icons.js); what is important but not done yet is tomato
   and pulses slowly; containers have light fills so they read apart. */
.side-list > a[aria-current='true'], .ep-list > li[aria-current='true'], .side-episodes .side-item[aria-current='true'] { background: var(--select); color: var(--select-ink); box-shadow: none; }
.lb-sc[aria-pressed='true'], .cb-chip.on, .cb-moon .cb-chip.on { background: var(--select); color: var(--select-ink); }
.lb-sc.hl { background: var(--select-soft); }
.cb-chip.on .tag, .lb-sc[aria-pressed='true'] .tag { color: inherit; border-color: currentColor; background: transparent; }
.props-table .prop-row.on, .review tr.on > td, .rev-row.on { background: var(--select-soft); }

button:has(> .icon-save), .button:has(> .icon-save) { background: var(--surface); color: var(--save); border-color: var(--save); }
button:has(> .icon-save):hover, .button:has(> .icon-save):hover { background: var(--save); color: var(--save-ink); border-color: var(--save); }
button:has(> .icon-noEntry) { background: var(--surface); color: var(--cancel); border-color: var(--cancel); }
button:has(> .icon-noEntry):hover { background: color-mix(in srgb, var(--cancel) 10%, var(--surface)); color: var(--cancel); }
button:has(> .icon-trash), button.icon-btn:has(> .icon-trash), button.icon-btn.link.danger:has(> .icon-trash) { background: var(--danger-fill); color: var(--danger-ink); border-color: var(--danger-fill); }
button:has(> .icon-trash):hover, button.icon-btn:has(> .icon-trash):hover { background: color-mix(in srgb, var(--danger-fill) 85%, var(--ink)); color: var(--danger-ink); border-color: var(--danger-fill); }

@keyframes need-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.need-pulse, .kiv-dot, .kiv-tag, .tag.need-tag, .cb-unknown.need > .cb-day-head, .cont-unchecked > .icon, .budget tr.needs .line-name { animation: need-pulse 2.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .need-pulse, .kiv-dot, .kiv-tag, .tag.need-tag, .cb-unknown.need > .cb-day-head, .cont-unchecked > .icon, .budget tr.needs .line-name { animation: none; } }
.tag.need-tag { color: var(--tomato); border-color: var(--tomato); background: var(--tomato-soft); font-weight: 800; }
.kiv-dot { color: var(--tomato); }
.lb-short, .cb-chip.unchecked strong { color: var(--tomato); }
.lb-sc.gap { border-color: var(--tomato); color: var(--tomato); }
.cont-unchecked { background: var(--tomato-soft); border-color: var(--tomato); }
.cont-unchecked > .icon { color: var(--tomato); }

/* Containers: a title band and a light fill each (Prep, Scenes & conditions, Talk; a scene's panel). */
.gm-top { background: var(--shade-prep); }
.gm-title { margin: 0; padding: 4px var(--space-2); background: var(--shade-head); border-top: var(--bw) solid var(--line); border-bottom: 1px solid var(--hair); color: var(--ink); }
.gm-top + .gm-title, .gm > .lb-conflicts + .gm-title { border-top: 0; }
.gm-table { background: var(--shade-scenes); margin: 0; }
.gm-addscene { margin: 0; padding: 4px var(--space-2) 6px; background: var(--shade-scenes); }
.gm-talk { background: var(--shade-talk); }
.gm-talk > .gm-title { border-top: var(--bw) solid var(--line); }
.gm-talk > div { padding: 4px var(--space-2) 6px; }
.lb-scene { background: var(--shade-scenes); }
.lb-scene-head, .by-scene-box > .lb-scene-head, .cb-ep-head { background: var(--shade-head); }
.lk-pane { background: var(--shade-scenes); }
.hot-split > .box:first-child { background: var(--shade-prep); }
.hot-split > .box + .box { background: var(--shade-scenes); }

/* "Who uses it": white on the black label, a size smaller. */
.who-uses legend { color: var(--paper); font-size: 0.68rem; padding: 1px 6px; margin-bottom: 2px; }
.who-uses .check { font-size: var(--text-sm); }

/* Continuity's board: a story day's day scenes in sun, its night below in the dark (same 24 hours), flashbacks
   purple, dreams teal, no story day tomato. A scene seen again in another one carries the echo mark. */
.cb-day { display: flex; flex-direction: column; }
.cb-half { border-top: 1px solid var(--hair); }
.cb-half-k { display: flex; align-items: center; gap: 4px; padding: 2px 6px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.cb-half-k .icon { width: 14px; height: 14px; }
.cb-sun { background: var(--day-soft); }
.cb-sun .cb-half-k { color: var(--day-mark); }
.cb-moon { background: var(--night); color: var(--night-ink); border-top-color: var(--night); }
.cb-moon .cb-half-k { color: var(--night-ink); opacity: 0.85; }
.cb-moon .cb-chip { color: var(--night-ink); border-bottom-color: var(--night-hair); }
.cb-moon .cb-chip .tag { color: var(--night-ink); border-color: var(--night-hair); background: transparent; }
.cb-moon .cb-chip.unchecked strong { color: #ff9a85; }
.cb-asides { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 0 var(--space-2) var(--space-2); }
.cb-aside { border: var(--bw) solid var(--line); margin-right: calc(-1 * var(--bw)); min-height: 64px; }
.cb-flash { background: var(--flash-soft); }
.cb-flash > .cb-day-head { color: var(--flash-line); }
.cb-dream { background: var(--dream-soft); }
.cb-dream > .cb-day-head { color: var(--dream-line); }
.cb-unknown { background: var(--tomato-soft); }
.cb-unknown > .cb-day-head { color: var(--tomato); }
.cb-empty { margin: 0; padding: 4px 6px; }
.cb-aside.over { outline: var(--bw) dashed var(--select); outline-offset: -4px; }
.echo { display: inline-flex; vertical-align: middle; margin-left: 3px; color: var(--flash-line); }
.echo .icon { width: 14px; height: 14px; }
.cb-moon .echo, .cb-chip.on .echo, .lb-sc[aria-pressed='true'] .echo { color: inherit; }
.echo-note { border-color: var(--flash-line); background: var(--flash-soft); display: flex; gap: 6px; align-items: center; }
.cb-chip .echo { grid-column: 2; justify-self: start; margin-left: 0; }
@media (max-width: 640px) { .cb-asides { grid-template-columns: 1fr; } .cb-aside { margin: 0 0 calc(-1 * var(--bw)); } }

/* Actors' questions to the director or the departments: a tab on the right edge opens a panel that slides in from the
   right (core/ask-panel.js, 2026-10-22). */
.ask-tab { position: fixed; right: 0; top: 50%; z-index: 900; transform: translateY(-50%); writing-mode: vertical-rl; display: flex; align-items: center; gap: 6px;
  padding: var(--space-3) 6px; min-height: 0; border: var(--bw) solid var(--line); border-right: 0; background: var(--select); color: var(--select-ink); font-weight: 800; letter-spacing: 0.04em; }
.ask-tab .icon { transform: rotate(90deg); }
.ask-tab[aria-expanded='true'] { display: none; }
.ask-shade { position: fixed; inset: 0; z-index: 940; background: rgb(0 0 0 / 0.25); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.ask-shade.open { opacity: 1; pointer-events: auto; }
.ask-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 950; width: min(440px, 100vw); display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); background: var(--paper); border-left: var(--bw) solid var(--line); box-shadow: var(--shadow-lift); overflow-y: auto;
  transform: translateX(100%); transition: transform 0.25s ease; visibility: hidden; }
.ask-panel.open { transform: none; visibility: visible; }
.ask-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding-bottom: var(--space-2); border-bottom: var(--bw) solid var(--line); }
.ask-panel-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: var(--text-lg); }
.ask-panel-body { flex: 1; min-height: 0; }
@media (prefers-reduced-motion: reduce) { .ask-panel, .ask-shade { transition: none; } }
@media (max-width: 640px) { .ask-tab { top: auto; bottom: 96px; } }
.ask-tab[hidden] { display: none; }
.ask-tab .count { writing-mode: horizontal-tb; min-width: 20px; padding: 0 5px; background: var(--tomato); color: var(--paper); font-size: 0.75rem; text-align: center; }
.ask-tab .count[hidden] { display: none; }

/* Script and Plan, shaded like the department pages (founder's review 2026-10-22): each container gets a title band and
   a light fill, table heads a band, long tables faint zebra rows — light, so the pages stay calm. The area comes from
   the sidebar (body[data-area], core/project.js). */
:is(body[data-area='script'], body[data-area='plan']) .section-head { background: var(--shade-head); border: var(--bw) solid var(--line); padding: 5px var(--space-2); margin-bottom: calc(-1 * var(--bw)); }
:is(body[data-area='script'], body[data-area='plan']) .group-title { background: var(--shade-head); padding: 4px 6px; }
:is(body[data-area='script'], body[data-area='plan']) :is(.breakdown-table, .sched-table, .review, .people-table, .dood-table, .ps-grid) thead th { background: var(--shade-head); color: var(--ink); }
:is(body[data-area='script'], body[data-area='plan']) :is(.breakdown-table, .sched-table, .review:not(.budget)) tbody tr:nth-child(even) > td { background: color-mix(in srgb, var(--shade-scenes) 70%, transparent); }
:is(body[data-area='script'], body[data-area='plan']) .box-head, :is(body[data-area='script'], body[data-area='plan']) .box > .box-title:first-child {
  margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-3)) var(--space-2); padding: 4px var(--space-3); background: var(--shade-head); border-bottom: 1px solid var(--hair); }
:is(body[data-area='script'], body[data-area='plan']) .card-title { background: var(--shade-head); padding: 4px 6px; }
/* Script: the writers' room panels warm, character boxes cool, the story flow warm; the script itself stays on its paper. */
body[data-area='script'] .panel:not(.script-panel):not(.full-script) { background: var(--shade-prep); }
body[data-area='script'] .char-box { background: var(--shade-scenes); }
body[data-area='script'] .flow-box { background: var(--shade-prep); }
body[data-area='script'] .side-note { background: var(--shade-talk); }
/* Plan: board days and Prelim days, locations in three columns, the prep calendar, the budget's category rows. */
body[data-area='plan'] .bday-head, body[data-area='plan'] .day-panel-bar { background: var(--shade-head); padding: 4px var(--space-2); }
body[data-area='plan'] .day-panel { background: var(--shade-scenes); }
body[data-area='plan'] .prelim-day { background: var(--shade-prep); }
body[data-area='plan'] .loc-col:nth-child(1) > .box { background: var(--shade-prep); }
body[data-area='plan'] .loc-col:nth-child(2) > .box { background: var(--shade-scenes); }
body[data-area='plan'] .loc-col:nth-child(3) > .box { background: var(--shade-talk); }
body[data-area='plan'] :is(.loc-card, .set-card) { background: var(--shade-prep); }
body[data-area='plan'] .card { background: var(--shade-prep); }
body[data-area='plan'] .budget tr.cat > * { background: var(--shade-scenes); }
body[data-area='plan'] .scene-side .panel { background: var(--shade-scenes); }

/* Department pages: the "n changes" line on a selected (dark blue) rail item is white, like its name. */
.lb-rail > a[aria-current='true'] .lb-rail-meta, .lb-rail > a[aria-current='true'] .lb-rail-meta * { color: var(--select-ink); }
.lb-rail > a[aria-current='true'] .lb-short { color: #ffb3a6; }

/* Spans of a scene in another time (2026-10-22): on the scene's script, Continuity's scene view and Wardrobe. */
.script .in-seg { box-shadow: inset 4px 0 0 var(--flash-line); background: var(--flash-soft); padding-left: var(--space-2); }
.script .in-seg.seg-dream { box-shadow: inset 4px 0 0 var(--dream-line); background: var(--dream-soft); }
.script .seg-label { margin: var(--space-2) 0 0; font-family: var(--font-ui); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--flash-line); }
.script .seg-label.seg-dream { color: var(--dream-line); }
.tag.seg-flashback, .tag.seg-memory, .tag.seg-flashforward { color: var(--flash-line); border-color: var(--flash-line); background: var(--flash-soft); }
.tag.seg-dream { color: var(--dream-line); border-color: var(--dream-line); background: var(--dream-soft); }
.cont-segs { margin: var(--space-2) 0; padding: 6px var(--space-2); background: var(--flash-soft); border: 1px solid var(--hair); }
.cont-segs h3 { margin: 0 0 4px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.cont-segs form { gap: 4px; }
.cont-segs select { max-width: 220px; }
.seg-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 6px 0 0; font-size: var(--text-sm); }
.seg-note .lb-letter { min-height: 0; }
.ai-list .chip-item.time { border-color: var(--flash-line); background: var(--flash-soft); }

/* Fixing the reading from a department's page (2026-10-22). */
.fix-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); background: var(--select-soft); border-color: var(--select); }
.fix-bar select { width: auto; min-height: 32px; }
.fix-hint { margin: 4px 0; }
.fix-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px var(--space-2); border-top: 1px solid var(--hair); background: var(--select-soft); }
.fix-item select { width: auto; min-height: 30px; max-width: 220px; }
.props-table td.c > input[type='checkbox'], .props-table th.c > input[type='checkbox'] { width: 18px; height: 18px; }

/* Billing: monthly term, coupon, quote (project billing + the start steps) */
.billing-term { align-items: end; }
.billing-term label { flex: 1 1 160px; }
.quote-box { border: var(--bw) solid var(--line); background: var(--surface-2); padding: var(--space-2) var(--space-3); margin: var(--space-2) 0 var(--space-3); }
.quote-box p { margin: 0 0 2px; font-size: var(--text-sm); }
.quote-box .quote-total { margin-top: var(--space-2); padding-top: var(--space-2); border-top: var(--bw) solid var(--line); font-size: 1.05rem; }

/* Dev → Role access: the matrix keeps its role header and tab names in view */
.access-matrix { overflow: auto; }
.access-matrix thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); }
.access-matrix tbody th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.access-matrix tr.area-row th { position: sticky; left: 0; z-index: 2; background: var(--surface-2); }
.project-history summary { cursor: pointer; font-size: var(--text-sm); color: var(--muted); margin-top: var(--space-1); }
.project-history .list { margin-top: var(--space-2); }
