/* Take One: the design system.
   One set of tokens (shared with the shot planner and its drawings), light and
   dark. Display type is condensed and set in capitals, like a slate; interface
   text is IBM Plex Sans; anything that is script is Courier Prime.
   Printed pages (.sheet) are always white paper with black ink. */

/* ---- tokens ------------------------------------------------------------- */
:root {
  --bg: #F3F3F1; --surface: #FFFFFF; --surface-2: #EAEAE6; --surface-3: #E0E0DB;
  --ink: #14161B; --ink-2: #3A3F4A; --muted: #646B78; --line: #D9DBDF; --line-2: #C6C9CF;
  --accent: #B98A00; --accent-strong: #946E00; --accent-soft: #F6E7A8; --accent-ink: #4A3800;
  --frame-bg: #E3E6EB; --frame-line: #8F97A3; --fig: #4A5568; --fig-2: #9AA3B1; --silhouette: #1B1F27;
  --done: #2F7D4F; --done-soft: #DDF0E3; --danger: #B4232C; --danger-soft: #F8DEDF;
  --info: #2B5F9E; --info-soft: #DCE8F6; --violet: #5B4A9E; --violet-soft: #E6E1F5;
  --focus: #2B6CB0;
  --shadow: 0 1px 2px rgba(20, 24, 32, .06), 0 1px 1px rgba(20, 24, 32, .04);
  --shadow-2: 0 4px 12px rgba(20, 24, 32, .08), 0 1px 3px rgba(20, 24, 32, .06);
  --shadow-3: 0 18px 48px rgba(20, 24, 32, .16), 0 4px 12px rgba(20, 24, 32, .08);
  --paper: var(--surface);            /* where script is read and written */
  --hl: #FCEBB0; --hl-line: #E2BD47;  /* note highlights */
  --display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Courier Prime", "Courier New", Courier, monospace;
  --code: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --r-1: 4px; --r-2: 6px; --r-3: 10px; --r-4: 16px;
  --bar-h: 58px;
  /* names kept from the earlier stylesheet */
  --gold: var(--accent); --accent-dark: var(--accent-strong);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E1014; --surface: #16191F; --surface-2: #1E222A; --surface-3: #272C36;
    --ink: #EEF0F3; --ink-2: #C9CED6; --muted: #98A1AF; --line: #2A2F39; --line-2: #3A404C;
    --accent: #F0C232; --accent-strong: #FFD557; --accent-soft: #3A3210; --accent-ink: #F6E7A8;
    --frame-bg: #0F1114; --frame-line: #5C6472; --fig: #B8C0CC; --fig-2: #6F7987; --silhouette: #05070A;
    --done: #5FC98A; --done-soft: #14301F; --danger: #F07178; --danger-soft: #3A1A1D;
    --info: #7FB3F5; --info-soft: #14263C; --violet: #B3A4F0; --violet-soft: #231E3C;
    --focus: #7FB3F5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 4px 14px rgba(0, 0, 0, .45);
    --shadow-3: 0 18px 48px rgba(0, 0, 0, .6);
    --hl: #4A3F12; --hl-line: #8C7420;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1014; --surface: #16191F; --surface-2: #1E222A; --surface-3: #272C36;
  --ink: #EEF0F3; --ink-2: #C9CED6; --muted: #98A1AF; --line: #2A2F39; --line-2: #3A404C;
  --accent: #F0C232; --accent-strong: #FFD557; --accent-soft: #3A3210; --accent-ink: #F6E7A8;
  --frame-bg: #0F1114; --frame-line: #5C6472; --fig: #B8C0CC; --fig-2: #6F7987; --silhouette: #05070A;
  --done: #5FC98A; --done-soft: #14301F; --danger: #F07178; --danger-soft: #3A1A1D;
  --info: #7FB3F5; --info-soft: #14263C; --violet: #B3A4F0; --violet-soft: #231E3C;
  --focus: #7FB3F5;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 4px 14px rgba(0, 0, 0, .45);
  --shadow-3: 0 18px 48px rgba(0, 0, 0, .6);
  --hl: #4A3F12; --hl-line: #8C7420;
}

/* ---- base --------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 var(--body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.08; letter-spacing: .015em; text-transform: uppercase; text-wrap: balance; margin: 0; }
h1 { font-size: 2.5rem; margin: .1rem 0 .5rem; }
h2 { font-size: 1.5rem; margin: 2.2rem 0 .7rem; }
h3 { font-size: 1.2rem; margin: .2rem 0 .4rem; }
h4 { font-size: 1.05rem; }
p { margin: .6rem 0; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2.5px; }
code, kbd { font-family: var(--code); font-size: .88em; background: var(--surface-2); padding: .08rem .38rem; border-radius: var(--r-1); border: 1px solid var(--line); }
kbd { border-bottom-width: 2px; }
hr { border: none; border-top: 1px solid var(--line); margin: 1.5rem 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.nomargin { margin: 0; }
.inline { display: inline; }
.error { background: var(--danger-soft); color: var(--danger); padding: .6rem .9rem; border-radius: var(--r-2); border-left: 3px solid var(--danger); font-weight: 500; }
.lede { color: var(--ink-2); font-size: 1.06rem; max-width: 38rem; }
.lede.center { margin-inline: auto; }
.kicker { margin: 0; font-family: var(--display); font-size: .95rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.eyebrow { font-family: var(--display); font-size: .82rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---- the bar ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--bar-h);
  display: flex; align-items: center; gap: 1.4rem; padding: 0 1.4rem;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
/* the mark: a clapperboard, arm raised */
.mark { position: relative; width: 26px; height: 18px; border: 2px solid var(--ink); border-radius: 2px; margin-top: 6px; flex: 0 0 auto; }
.mark::before { content: ""; position: absolute; left: -2px; top: -9px; width: 30px; height: 6px; background: var(--accent); transform-origin: 0 100%; transform: rotate(-9deg) skewX(-20deg); transition: transform .18s ease; }
.brand:hover .mark::before { transform: rotate(0deg) skewX(-20deg); }
.brand-word { font-family: var(--display); font-weight: 700; font-size: 1.45rem; letter-spacing: .05em; text-transform: uppercase; line-height: 1; }
.mainnav { display: flex; align-items: center; gap: .2rem; min-width: 0; }
.mainnav a { font-family: var(--display); font-size: 1.02rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; text-decoration: none; color: var(--muted); padding: .35rem .7rem; border-radius: var(--r-2); white-space: nowrap; }
.mainnav a:hover { color: var(--ink); background: var(--surface-2); }
.mainnav a.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: var(--r-2) var(--r-2) 0 0; }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: .7rem; min-width: 0; }
.bar-side, .bar-left { display: contents; }
.navlink { font-weight: 500; text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.navlink:hover { color: var(--ink); }
.adminlink { font-family: var(--display); font-size: .92rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent) !important; text-decoration: none; white-space: nowrap; }
.userchip { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 1.95rem; height: 1.95rem; border-radius: 50%;
  background: var(--ink); color: var(--bg); font-family: var(--display); font-weight: 700; font-size: 1rem;
}
.avatar.sm { width: 1.7rem; height: 1.7rem; font-size: .85rem; }
.who { color: var(--ink-2); font-size: .9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 11rem; }
.logout-form { border-left: 1px solid var(--line); padding-left: .7rem; }
.logout { color: var(--muted); font-size: .86rem; text-decoration: none; }
.logout:hover { color: var(--ink); text-decoration: underline; }
.zoom { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; background: var(--surface); }
.zoom button { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; padding: .1rem 0; line-height: 1.3; }
.zoom button:hover { background: var(--surface-2); color: var(--ink); }
.zoom-btn { width: 1.7rem; font-size: 1rem; }
.zoom-level { min-width: 3rem; font-size: .76rem; font-variant-numeric: tabular-nums; border-left: 1px solid var(--line) !important; border-right: 1px solid var(--line) !important; }
.themebtn { width: 2rem; height: 2rem; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); color: var(--muted); cursor: pointer; padding: 0; }
.themebtn:hover { color: var(--ink); border-color: var(--line-2); }
.themebtn svg { width: 16px; height: 16px; }

main { max-width: 780px; margin: 1.8rem auto 3.5rem; padding: 0 1.4rem; zoom: var(--zoom, 1); }
main.wide { max-width: 1080px; }
main.full { max-width: none; margin: 0; padding: 0; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.5rem 1rem 2.5rem; }
footer a { color: var(--muted); }

/* ---- buttons, forms ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  background: var(--ink); color: var(--bg) !important; border: 1px solid var(--ink);
  border-radius: var(--r-2); padding: .5rem 1rem; margin-top: .4rem;
  font: inherit; font-weight: 600; font-size: .94rem; line-height: 1.25; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; box-shadow: var(--shadow-2); background: color-mix(in srgb, var(--ink) 88%, var(--accent)); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .3rem .7rem; font-size: .84rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1.05rem; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #17130a !important; }
.btn.accent:hover { background: var(--accent-strong); }
.btn.ghost { background: var(--surface); color: var(--ink) !important; border-color: var(--line); font-weight: 500; }
.btn.ghost:hover { border-color: var(--line-2); background: var(--surface-2); box-shadow: none; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff !important; }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.link { background: none; border: none; color: inherit; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.link:hover { text-decoration-thickness: 2px; }
.danger-link { background: none; border: none; padding: 0; cursor: pointer; font: inherit; font-size: .86rem; color: var(--danger); text-decoration: underline dotted; text-underline-offset: 3px; }
.danger-link:hover { text-decoration-style: solid; }

label { display: block; margin: .7rem 0; font-size: .86rem; font-weight: 500; color: var(--ink-2); }
input, textarea, select {
  display: block; width: 100%; margin-top: .3rem; padding: .52rem .65rem;
  font: inherit; font-size: .95rem; font-weight: 400; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-2);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:hover, textarea:hover, select:hover { border-color: var(--muted); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); }
input[type=file] { padding: .35rem; font-size: .86rem; }
.radio { display: flex; align-items: flex-start; gap: .55rem; margin: .5rem 0; cursor: pointer; font-weight: 400; }
.radio input { width: auto; margin: .22rem 0 0; flex: 0 0 auto; }
.radio span { color: var(--ink); }
.radio span span { color: var(--muted); }
.fieldhint { margin: -.2rem 0 .6rem; }

/* ---- surfaces ------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 1.15rem 1.3rem; margin: 1rem 0; box-shadow: var(--shadow); }
.narrow { max-width: 27rem; margin-inline: auto; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.cards .card { margin: 0; }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .twocol { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); min-width: 0; }
.panel h2 { margin: 0; font-size: 1.2rem; }
.panel-sub { margin: 1rem 0 .5rem; font-family: var(--display); font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; box-shadow: var(--shadow); }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-3); }
.tablewrap table { min-width: 34rem; }
th, td { text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--display); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
tbody tr:not(.acthead):hover td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
tr.acthead td { background: var(--surface-2); font-family: var(--display); font-weight: 700; font-size: .95rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); padding-block: .4rem; }
td a { text-decoration: none; }
td a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.cell-num, .cell-date { white-space: nowrap; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; font-family: var(--display); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; padding: .1rem .55rem; border-radius: 999px; white-space: nowrap; vertical-align: middle; }
.badge-planning, .badge-outline { background: var(--violet-soft); color: var(--violet); }
.badge-drafting, .badge-draft { background: var(--accent-soft); color: var(--accent-ink); }
.badge-rehearsal { background: var(--done-soft); color: var(--done); }
.badge-production { background: var(--danger-soft); color: var(--danger); }
.badge-archived, .badge-locked { background: var(--surface-3); color: var(--ink-2); }
.badge-restricted { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge-reader { background: var(--info-soft); color: var(--info); }
.badge-film { background: var(--ink); color: var(--bg); }
.linecount { font-size: .74rem; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); border-radius: 20px; padding: .08rem .55rem; vertical-align: middle; white-space: nowrap; }
.lock-tag, .open-tag { font-size: .8rem; margin-left: .4rem; white-space: nowrap; color: var(--muted); }

/* ---- page head, crumbs, tabs ---------------------------------------------- */
.pagehead { display: flex; justify-content: space-between; align-items: start; gap: 1.2rem; flex-wrap: wrap; }
.pagehead h1 { margin-top: .35rem; }
.script-head { align-items: center; margin-bottom: 1rem; }
.crumbs { color: var(--muted); font-size: .84rem; margin: 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.headactions { display: flex; align-items: center; gap: .55rem; position: relative; flex-wrap: wrap; }
.headactions .btn { margin-top: 0; }
.invite { color: var(--muted); font-size: .9rem; }
.pagecount { margin: .35rem 0 0; }
.pagecount strong { color: var(--ink); }

/* the stage rail: a film moves left to right through its stages */
.tabs { display: flex; align-items: stretch; gap: .25rem; margin-top: 1.2rem; padding: .3rem; background: var(--surface-2); border-radius: var(--r-3); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: baseline; gap: .45rem; padding: .5rem .95rem; border-radius: var(--r-2); font-family: var(--display); font-size: 1.05rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; text-decoration: none; color: var(--muted); white-space: nowrap; }
.tabs a:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.tabs a.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.tabs a.active::before { content: ""; align-self: center; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.tabs .count { font-family: var(--body); font-size: .74rem; font-weight: 500; letter-spacing: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.tabs .tab-split { margin-left: auto; }
.tabs .tab-go::after { content: "→"; font-family: var(--body); margin-left: .1rem; color: var(--accent); }
@media (max-width: 640px) { .tabs .tab-split { margin-left: 0; } }
nav.tabs[role="tablist"] ~ section > h2 { display: none; }
nav.tabs[role="tablist"] ~ section { margin-top: 1.5rem; }
.subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 1.8rem 0 .7rem; }
.subhead h3 { margin: 0; font-size: 1.15rem; }
.subhead:first-child { margin-top: 0; }
#beats, #outline { margin-top: 2.4rem; }

/* ---- lists: beats, characters, credits -------------------------------------- */
.beats { list-style: none; padding: 0; margin: 0; }
.beat { display: flex; justify-content: space-between; gap: .8rem; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-2); padding: .65rem .95rem; margin: .5rem 0; box-shadow: var(--shadow); }
.beat strong { font-weight: 600; }
.beat p { margin: .2rem 0 0; color: var(--ink-2); font-size: .92rem; }
.chars .card { border-top: 3px solid var(--ink); }
.chars .card h3 a, .chars .card strong a { text-decoration: none; }
.char .notes { background: var(--surface-2); border-radius: var(--r-2); padding: .5rem .6rem; font-size: .9rem; }
.creditlist { list-style: none; padding: 0; }
.creditlist li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: .45rem .8rem; margin: .4rem 0; box-shadow: var(--shadow); display: flex; align-items: center; gap: .4rem; }
.creditlist form { margin-left: auto; }
.credits-block { margin: 1rem 0; }
.credit { margin: .15rem 0; }

/* row actions, popovers, menus */
.rowactions { display: flex; gap: .25rem; align-items: start; position: relative; flex-shrink: 0; }
.icon { background: none; border: 1px solid transparent; border-radius: var(--r-1); cursor: pointer; font-size: .95rem; color: var(--muted); padding: .1rem .38rem; list-style: none; display: inline-block; }
.icon:hover { border-color: var(--line); color: var(--ink); background: var(--surface-2); }
.icon:disabled { opacity: .3; cursor: default; }
.icon.danger:hover { color: var(--danger); }
details > summary { cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.popform { position: absolute; right: 0; z-index: 10; width: 21rem; max-width: 84vw; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: .9rem 1rem 1rem; box-shadow: var(--shadow-3); text-align: left; }
.popform .sep { margin: .8rem 0 .7rem; border-top: 1px solid var(--line); }
.menu { position: relative; }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: var(--r-2); cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 1.2rem; line-height: 1; list-style: none; }
.menu-btn:hover { border-color: var(--line-2); background: var(--surface-2); color: var(--ink); }
.menu-btn::-webkit-details-marker { display: none; }
.menu-pop { top: calc(100% + 6px); }
.menu-label { margin: 0 0 .45rem; font-family: var(--display); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.menu-link { display: block; padding: .42rem .55rem; margin: 0 -.5rem; border-radius: var(--r-2); color: var(--ink); font-size: .92rem; text-decoration: none; }
.menu-link:hover { background: var(--surface-2); text-decoration: none; }
button.menu-link { width: calc(100% + 1rem); text-align: left; background: none; border: none; font: inherit; font-size: .92rem; cursor: pointer; }
.menu-pop .danger-link { padding: .3rem .5rem; margin: 0 -.5rem; display: inline-block; }
.menu-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.noteswrap details { display: inline-block; margin-left: .3rem; }

/* the "add new" row */
.addform { display: flex; gap: .55rem; margin-top: 1rem; flex-wrap: wrap; align-items: stretch; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--r-3); padding: .65rem .75rem; }
.addform::before { content: '+'; flex: 0 0 auto; align-self: center; display: flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 1.1rem; line-height: 1; }
.addform input { margin-top: 0; width: auto; flex: 1 1 10rem; }
.addform input[type=number] { flex: 0 0 4.5rem; }
.addform input[type=date], .addform input[type=time] { flex: 0 0 auto; width: auto; }
.addform .btn { margin-top: 0; flex: 0 0 auto; }
.inlinefield { margin: 0; flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem; color: var(--ink-2); }
.importlink { margin-top: .7rem; }
.arcnote { margin-top: .6rem; }
.fwpick { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-top: .9rem; }
.fwpick label { display: flex; align-items: center; gap: .5rem; margin: 0; }
.fwpick select { width: auto; max-width: 100%; margin: 0; }
.fwpick .btn { margin: 0; }
.seedednote { margin: .7rem 0 0; padding: .55rem .8rem; border-radius: var(--r-2); background: var(--accent-soft); color: var(--accent-ink); }
.seedednote a { color: inherit; }

/* dialogs */
dialog { color: var(--ink); }
#confirm, #newchar { border: 1px solid var(--line); border-radius: var(--r-3); padding: 1.3rem 1.4rem; background: var(--surface); box-shadow: var(--shadow-3); }
#confirm { max-width: 25rem; }
#newchar { width: min(27rem, 92vw); }
#confirm::backdrop, #newchar::backdrop { background: rgba(10, 12, 16, .55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
#confirm p { margin: 0 0 1.1rem; line-height: 1.5; }
#newchar h3 { margin: 0 0 .6rem; }
#newchar label { display: block; margin-bottom: .6rem; }
.confirm-actions { display: flex; gap: .6rem; justify-content: flex-end; }
.confirm-actions .btn { margin-top: 0; }
.newchar-actions button[value="ok"] { order: 2; }

/* ---- scene editor ------------------------------------------------------------ */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.4rem; align-items: start; margin-top: .6rem; }
@media (max-width: 860px) { .editor { grid-template-columns: 1fr; } }
.editmeta { display: flex; gap: .8rem; }
.editmeta .grow { flex: 1; }
.editmeta label { margin-top: 0; }
textarea.script { font: 15px/1.6 var(--mono); background: var(--paper); tab-size: 8; resize: vertical; }
.scriptlabel { display: flex; justify-content: space-between; align-items: baseline; margin-top: .7rem; gap: 1rem; }
.scriptlabel label { margin: 0; }
.scriptmodes { display: flex; gap: .2rem; padding: .2rem; background: var(--surface-2); border-radius: var(--r-2); }
.scriptmodes .link { text-decoration: none; font-family: var(--display); font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: .12rem .6rem; border-radius: var(--r-1); }
.scriptmodes .link:hover { color: var(--ink); }
.scriptmodes .link[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.scriptwrap { position: relative; margin-top: .3rem; border-radius: var(--r-3); box-shadow: var(--shadow-2); }
.scriptwrap[hidden] { display: none; }
.scriptwrap textarea.script { position: relative; z-index: 1; margin-top: 0; background: transparent; caret-color: var(--ink); border-radius: var(--r-3); padding: 1.1rem 1.3rem; border-color: var(--line); min-height: 60vh; }
.scriptwrap.enhanced textarea.script { color: transparent; }
.scriptwrap.enhanced textarea.script::placeholder { color: var(--muted); }
.script-backdrop { position: absolute; inset: 0; overflow: hidden; border-radius: var(--r-3); background: var(--paper); pointer-events: none; }
.script-render { padding: 1.1rem 1.3rem; border: 1px solid transparent; font: 15px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: break-word; color: var(--ink); tab-size: 8; }
.script-render .hl-mention { font-weight: 700; color: var(--ink-2); }
.script-render .hl-direction { text-decoration: underline dashed color-mix(in srgb, var(--muted) 60%, transparent); text-underline-offset: 3px; }
.script-render .hl-cue { border-radius: 4px; font-weight: 700; }
.script-render .hl-cue-lx { color: var(--accent-ink); background: var(--accent-soft); }
.script-render .hl-cue-sfx { color: var(--info); background: var(--info-soft); }
.script-render .hl-slug { font-weight: 700; }
.script-render .hl-paren { color: var(--muted); }
.script-render .hl-transition, .script-render .hl-centered { color: var(--info); }
.script-render .hl-lyric { font-style: italic; }
.script-render .hl-section { color: var(--accent-strong); font-weight: 700; }
.script-render .hl-synopsis { color: var(--muted); font-style: italic; }
.script-render .hl-note, .script-render .hl-boneyard, .script-render .hl-fnote, .script-render .hl-pagebreak { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.script-render .hl-fmk { color: color-mix(in srgb, var(--muted) 55%, transparent); }
.script-render .hl-fi { font-style: italic; }
.script-render .hl-fb { font-weight: 700; }
.script-render .hl-fbi { font-weight: 700; font-style: italic; }
.script-render .hl-fu { text-decoration: underline; }
.editactions { display: flex; align-items: center; gap: 1rem; margin-top: .4rem; }
.editactions .back { margin-left: auto; }
.autosave { font-size: .84rem; color: var(--muted); transition: color .2s; }
.autosave.saving { color: var(--accent); }
.autosave.ok::before { content: '✓ '; color: var(--done); }
.autosave.ok { color: var(--done); }
.autosave.err { color: var(--danger); }
.sp-preview { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-3); padding: 1.4rem 1.6rem; margin-top: .3rem; min-height: 12rem; box-shadow: var(--shadow-2); }
.sp-preview.screenplay { margin-left: auto; margin-right: auto; }
/* focus mode */
.editor.focus { grid-template-columns: 1fr; }
.editor.focus .editor-side { display: none; }
.editor.focus .editform { max-width: 78ch; margin: 0 auto; width: 100%; }
.editor.focus textarea.script { min-height: 78vh; }
.editor.focus .editmeta, .editor.focus .editform > label:not([for="script-ta"]) { display: none; }

.mention-menu[hidden] { display: none; }
.mention-menu { position: absolute; z-index: 6; min-width: 180px; max-width: 280px; display: flex; flex-direction: column; padding: .3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-3); }
.mention-menu button { text-align: left; background: none; border: none; font: inherit; padding: .35rem .65rem; border-radius: var(--r-1); cursor: pointer; color: var(--ink); }
.mention-menu button.active, .mention-menu button:hover { background: var(--surface-2); }
.mention-menu button.menu-add { border-top: 1px solid var(--line); border-radius: 0 0 var(--r-1) var(--r-1); margin-top: .2rem; padding-top: .45rem; color: var(--accent-strong); font-weight: 500; }

.editor-side { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: calc(var(--bar-h) + 16px); }
@media (max-width: 860px) { .editor-side { position: static; } }
.editor-side .card { margin: 0; }
.editor-side h3 { font-size: 1rem; letter-spacing: .08em; color: var(--ink-2); }
.castlist ul { list-style: none; padding: 0; margin: .4rem 0 0; }
.castlist li { margin: .35rem 0; font-size: .92rem; padding-left: .9rem; position: relative; }
.castlist li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--done); }
.castlist li.off-scene { opacity: .5; }
.castlist li.off-scene::before { background: var(--line-2); }
.castlist li a { text-decoration: none; }
.scenehint summary { cursor: pointer; }
.scenehint p { margin: .5rem 0 .1rem; }
.cheat { border: none; box-shadow: none; background: none; margin-top: .4rem; border-radius: 0; }
.cheat td { padding: .18rem .5rem .18rem 0; border: none; vertical-align: top; background: none !important; }
.cheat code { white-space: nowrap; }
.crail-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.hl-toggle { display: inline-flex; align-items: center; gap: .3rem; margin: 0; cursor: pointer; white-space: nowrap; }
.hl-toggle input { width: auto; margin: 0; }

/* locked or read-only scene */
.lockbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: .55rem .9rem; margin-bottom: 1rem; }
.lockbar > span { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; }
.locked-script { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-3); padding: 1rem 1.3rem; box-shadow: var(--shadow); }
.locked-script .scripttext { margin: 0; }

/* ---- notes ------------------------------------------------------------------- */
.commented { background: var(--hl); border-radius: 2px; box-shadow: 0 1px 0 var(--hl-line); cursor: pointer; }
.commented.flash { background: color-mix(in srgb, var(--hl) 60%, var(--accent)); }
sup.cnum { color: var(--accent-strong); font-family: var(--body); font-weight: 600; }
.comments-rail .composer { border: 1px solid var(--line); border-radius: var(--r-2); padding: .6rem .7rem; margin-bottom: .8rem; background: var(--surface-2); }
.composer-quote { margin: 0 0 .4rem; font-size: .85rem; }
.composer-quote q { color: var(--ink-2); }
.composer textarea { margin: 0; }
.composer-actions { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; }
.composer-actions .btn { margin-top: 0; }
.ccard { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-2); padding: .55rem .7rem; margin: .5rem 0; background: var(--surface); box-shadow: var(--shadow); font-size: .9rem; }
.ccard.resolved { opacity: .6; border-left-color: var(--line-2); }
.ccard.orphaned { border-left-color: var(--line-2); border-left-style: dashed; }
.ccard.active { box-shadow: 0 0 0 2px var(--accent), var(--shadow-2); }
.ccard-quote { color: var(--muted); font-size: .8rem; margin-bottom: .25rem; border-left: 2px solid var(--line); padding-left: .4rem; }
.ccard-quote q { quotes: '“' '”'; }
.ccard-body { line-height: 1.45; white-space: normal; }
.ccard-meta { color: var(--muted); font-size: .75rem; margin-top: .3rem; }
.ccard-actions { display: flex; gap: .7rem; margin-top: .4rem; }
.ccard-actions .link { font-size: .8rem; }
.ccard-actions .link.danger { color: var(--danger); }
.ccard-edit { width: 100%; margin: .3rem 0; }
.ccard-num { font-family: var(--display); font-weight: 700; color: var(--accent-strong); margin-right: .3rem; }
.reading { position: relative; max-width: 780px; margin: 0 auto; }
.reading.has-comments { max-width: none; padding-right: 300px; }
.reading.has-comments .promptbook { max-width: 720px; }
.comments-gutter { display: none; }
.ccard-abs { position: absolute; right: 0; width: 280px; margin: 0; }
.reading .comments-extras { position: static; width: 280px; margin-left: auto; margin-top: 1.5rem; }
.comments-extras h3 { margin: 0 0 .4rem; }
@media (max-width: 760px) {
  .reading.has-comments { padding-right: 0; }
  .reading .ccard-abs { position: static; width: auto; margin: .6rem 0; }
  .reading .comments-extras { width: auto; margin-left: 0; }
}

/* ---- character page ------------------------------------------------------------ */
.charpage { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 1.4rem; align-items: start; }
@media (max-width: 760px) { .charpage { grid-template-columns: 1fr; } }
.mentionlist { list-style: none; padding: 0; margin: .3rem 0; }
.mentionlist li { margin: .4rem 0; }
.mentionlist .small { display: block; }
.linestat { margin: 0 0 .5rem; }
.refhead { margin: .9rem 0 .25rem; font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; }
.tpl-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.hagen summary { cursor: pointer; }
.hagen-list { padding-left: 1.2rem; margin: .5rem 0 .3rem; }
.hagen-list li { margin: .15rem 0; }

/* ---- settings -------------------------------------------------------------------- */
.settings { max-width: 680px; margin: 0 auto; }
.settings-group { padding: 1.1rem 1.4rem 1.3rem; }
.settings-group h2 { margin-top: .2rem; }
.settings-note { margin: -.3rem 0 .2rem; }
.setting { display: grid; grid-template-columns: 8.5rem 1fr; gap: .3rem 1.4rem; padding: .95rem 0; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: none; padding-top: .4rem; }
.setting-name { font-weight: 600; font-size: .94rem; display: flex; flex-direction: column; gap: .25rem; }
.setting-hint { font-weight: 400; }
.setting-control { min-width: 0; }
.setting-control label { margin: 0; }
.setting-control .radio { margin: .1rem 0 .35rem; }
.setting-control input:not([type]) { max-width: 20rem; }
.setting-control p { margin: .3rem 0 0; }
.settings-actions { display: flex; align-items: center; gap: 1.2rem; margin: 1.1rem 0 .5rem; }
.settings-foot { text-align: center; margin: .6rem 0 0; }
.titlepage-ta { font: 13px/1.5 var(--code); }
@media (max-width: 560px) { .setting { grid-template-columns: 1fr; gap: .5rem; } }

/* ---- people ------------------------------------------------------------------------ */
.visibility { border: 1px solid var(--line); border-radius: var(--r-2); padding: .5rem .8rem .7rem; margin: .7rem 0; }
.visibility legend { font-family: var(--display); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 .3rem; }
.visibility .radio { display: flex; align-items: baseline; gap: .5rem; margin: .35rem 0; }
.visibility .radio input { width: auto; margin: 0; }
.visibility .radio > span span { display: block; }
.people-card { max-width: 36rem; }
.access-state { margin: 0 0 .9rem; }
.access-form { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .9rem; padding: .7rem .85rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-2); margin-bottom: 1rem; }
.access-form .af-label { flex-basis: 100%; }
.access-form .radio { display: inline-flex; align-items: center; gap: .35rem; margin: 0; }
.access-form .radio input { width: auto; margin: 0; }
.access-form .btn { margin: 0; }
.people-list, .member-roster { list-style: none; padding: 0; margin: 0; }
.people-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.people-list li:last-child { border-bottom: none; }
.person { display: inline-flex; align-items: center; gap: .55rem; min-width: 0; }
.person-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-list .link.add { color: var(--accent-strong); font-weight: 600; }
.addall { margin-top: .7rem; display: inline-block; }
.prow-actions { display: inline-flex; align-items: center; gap: .85rem; flex: 0 0 auto; }
.prole { font-family: var(--display); font-size: .8rem; color: var(--muted); font-weight: 600; min-width: 3.1rem; text-align: right; text-transform: uppercase; letter-spacing: .08em; }
.role-note { margin: -.3rem 0 .9rem; }
.private-note { margin: .7rem 0 1rem; }
.transfer { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.transfer-form { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: 0; }
.transfer-form .btn { margin: 0; }
.samplenote { margin-top: .8rem; }
.dup-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* ---- import ------------------------------------------------------------------------- */
.importform textarea { font: 13px/1.6 var(--code); min-height: 18rem; }
.importhelp { margin-top: 1rem; }
.importhelp summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.importhelp ul { color: var(--ink-2); font-size: .92rem; }
.imp-summary p { margin: .3rem 0; }
.imp-kind { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-bottom: .6rem; }
.imp-file { display: block; margin: .4rem 0; }
.imp-stage-only[hidden] { display: none; }
.imp-scene { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); margin-bottom: .5rem; box-shadow: var(--shadow); padding: .6rem .85rem; }
.imp-head { display: flex; align-items: center; gap: .6rem; }
.imp-actf { display: inline-flex; align-items: center; gap: .35rem; margin: 0; color: var(--muted); font-size: .85rem; flex: 0 0 auto; }
.imp-actf input { width: 3.4rem; margin: 0; display: inline-block; padding: .35rem .4rem; text-align: center; }
.imp-title { flex: 1; margin: 0; font-weight: 600; }
.imp-scene details summary { padding: .35rem 0 0; cursor: pointer; }
.imp-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.4rem; }
.imp-actions .btn { margin: 0; }
.imp-opt { margin: .8rem 0 .2rem; display: flex; gap: .5rem; align-items: baseline; }
.imp-opt input { width: auto; margin: 0; }
.imp-edit { font: 13px/1.7 var(--code); margin-top: .5rem; white-space: pre; overflow-x: auto; }

/* ---- the script, read ------------------------------------------------------------------ */
.promptbook { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-3); padding: 3rem 3.5rem; box-shadow: var(--shadow-2); }
@media (max-width: 760px) { .promptbook { padding: 1.5rem 1.2rem; } }
.titlepage { text-align: center; font-size: 2.4rem; margin-top: 1rem; }
.act { text-align: center; letter-spacing: .24em; margin-top: 2.5rem; }
.scenehead { font-size: 1.3rem; margin: 2.2rem 0 .55rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line); }
.scripttext { font: 15.5px/1.7 var(--mono); margin: .5rem 0 0; }
.sline { white-space: pre-wrap; overflow-wrap: break-word; min-height: 1.7em; }
.sline.indent, .pb-line.indent { text-indent: 2.8em; }
.mention { font-weight: 700; text-transform: uppercase; color: var(--ink-2); letter-spacing: .02em; }
.scripttext .direction { text-decoration: underline dashed color-mix(in srgb, var(--muted) 55%, transparent); text-underline-offset: 3px; }
.scripttext .cue { display: inline-block; border-radius: 4px; padding: 0 .4rem 0 .3rem; font-weight: 700; }
.scripttext .cue-lx { color: var(--accent-ink); background: var(--accent-soft); }
.scripttext .cue-sfx { color: var(--info); background: var(--info-soft); }

/* screenplay (Fountain) layout: a 58-character Courier line, standard indents */
.scripttext.screenplay { font: 14px/1.4 var(--mono); width: 58ch; max-width: 100%; margin: .5rem auto 0; }
.screenplay .sline { white-space: pre-wrap; min-height: 1.4em; }
.screenplay .sp-blank { min-height: 1.4em; }
.screenplay .sp-slug { text-transform: uppercase; position: relative; }
.screenplay .sp-slug[data-num]::before { content: attr(data-num); position: absolute; right: 100%; margin-right: 2ch; color: var(--muted); }
.screenplay .sp-slug[data-num]::after { content: attr(data-num); position: absolute; left: 100%; margin-left: 2ch; color: var(--muted); }
.screenplay .sp-cue { margin-left: 22ch; text-transform: none; }
.screenplay .sp-cue-bold, .screenplay .sp-cue-bold .mention { font-weight: 700; }
.scripttext.screenplay.has-dev { line-height: 1.9; }
.screenplay.has-dev .sline, .screenplay.has-dev .sp-blank { min-height: 1.9em; }
.screenplay .sp-paren { margin-left: 15ch; width: 25ch; }
.screenplay .sp-dialogue { margin-left: 10ch; width: 35ch; }
.screenplay .sp-lyric { margin-left: 10ch; width: 35ch; font-style: italic; }
.screenplay .sp-speech > .sp-lyric:first-child, .screenplay .sline > .sp-lyric { margin-left: 0; width: auto; }
.screenplay .sp-transition { text-align: right; text-transform: uppercase; }
.screenplay .sp-centered { text-align: center; }
.screenplay .sp-pagebreak { min-height: 2.8em; }
.sp-titlegap { height: 3rem; }
.screenplay .sp-section { color: var(--accent-strong); font-weight: 700; }
.screenplay .sp-h1 { font-size: 1.15em; margin-top: .4em; }
.screenplay .sp-synopsis { color: var(--muted); font-style: italic; }
.screenplay .sp-note, .screenplay .fnote { color: var(--muted); font-style: italic; }
.screenplay .sp-boneyard { display: none; }
.screenplay .fmk { display: inline-block; width: 0; overflow: hidden; vertical-align: top; white-space: pre; }
.screenplay .fi { font-style: italic; }
.screenplay .fb { font-weight: 700; }
.screenplay .fbi { font-weight: 700; font-style: italic; }
.screenplay .fu { text-decoration: underline; }
.screenplay .mention { font-weight: 400; text-transform: uppercase; color: inherit; letter-spacing: 0; font-size: inherit; }
.screenplay .sp-dual { display: flex; gap: 4ch; }
.screenplay .sp-dcol { flex: 1 1 0; min-width: 0; }
.screenplay .sp-dcol .sp-cue { margin-left: 6ch; }
.screenplay .sp-dcol .sp-paren { margin-left: 3ch; width: auto; }
.screenplay .sp-dcol .sp-dialogue, .screenplay .sp-dcol .sp-lyric { margin-left: 0; width: auto; }
.sp-scenemark { font-family: inherit; margin: 1.6rem 0 .2rem; }
.sp-scenemark a { color: var(--muted); }
.promptbook-sp { font-family: var(--mono); }
.sp-title { font: 14px/1.4 var(--mono); width: 58ch; max-width: 100%; margin: 0 auto; min-height: 60vh; display: flex; flex-direction: column; }
.sp-title p { margin: 0; }
.sp-tmain { text-align: center; padding-top: 18vh; flex: 1; }
.sp-tmain p { white-space: pre-wrap; }
.sp-tt { font-weight: 700; text-transform: uppercase; margin-bottom: 1.4em !important; }
.sp-tsource { margin-top: 1.4em !important; }
.sp-tfoot { display: flex; justify-content: space-between; align-items: flex-end; gap: 2ch; }
.sp-tright { text-align: right; }
.sp-tleft p, .sp-tright p { white-space: pre-wrap; }
.titlecard { margin: 0 0 1rem; }
.titlecard summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.titlecard summary strong { font-family: var(--display); font-size: 1.05rem; letter-spacing: .08em; text-transform: uppercase; }
.titlecard-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; margin-top: .9rem; align-items: start; }
@media (max-width: 760px) { .titlecard-body { grid-template-columns: 1fr; } }
.titlecard-preview { border: 1px solid #d9dbdf; border-radius: var(--r-2); background: #fff; color: #1a1a1a; padding: 1rem; width: auto; margin: 0; }
.titlecard-preview .sp-title { min-height: 22rem; width: auto; }
.titlecard-preview .sp-tmain { padding-top: 5rem; }
.titlecard-form label { display: block; margin-top: 0; }
.titlecard-form textarea { width: 100%; }
.outline { list-style: none; padding: 0; margin: 0 0 1rem; }
.outline-act { margin: 1.2rem 0 .4rem; letter-spacing: .14em; font-size: 1rem; color: var(--ink-2); }
.ol-scene { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: .6rem .95rem; margin: .4rem 0; box-shadow: var(--shadow); }
.ol-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ol-head a { text-decoration: none; }
.ol-scenesyn { margin-top: .15rem; }
.ol-items { list-style: none; padding: .3rem 0 0 .9rem; margin: 0; font: 13px/1.5 var(--mono); }
.ol-slug { text-transform: uppercase; }
.ol-section { color: var(--accent-strong); font-weight: 700; }
.ol-h1 { font-size: 1.05em; }
.ol-h3, .ol-h4, .ol-h5, .ol-h6 { font-weight: 400; }
.ol-synopsis { color: var(--muted); font-style: italic; }

/* ---- printed pages: always white paper, black ink -------------------------------------------- */
.printhint { text-align: center; margin: .2rem 0 1rem; }
.pageframe { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-3); padding: 1.8rem; display: flex; flex-direction: column; align-items: center; gap: 1.6rem; overflow-x: auto; }
.sheet {
  --ink: #1a1a1a; --ink-2: #333; --muted: #666; --line: #d8d8d8; --accent-strong: #7a5410; --hl: #FCEBB0; --hl-line: #E2BD47;
  position: relative; box-sizing: border-box; width: 210mm; height: 297mm; padding: 18mm;
  background: #fff; color: #1a1a1a; box-shadow: var(--shadow-3); flex: 0 0 auto;
}
.sheet-body { height: calc(297mm - 36mm); overflow: hidden; margin: 0; }
.sheet .scripttext, .sheet-body.scripttext { font: 15px/1.7 var(--mono); }
.sheet-num { position: absolute; bottom: 9mm; left: 0; right: 0; text-align: center; font: 9pt var(--mono); color: #666; }
.pb-block { break-inside: avoid; }
.pb-titleblock { padding-top: 1.4in; text-align: center; }
.pb-titleblock .titlepage { font-size: 2rem; margin: 0 0 .18in; }
.pb-titleblock .credits-block { margin: .2in 0; }
.pb-act { text-align: center; letter-spacing: .2em; font-weight: 700; font-family: var(--display); font-size: 1.2em; margin: .28in 0 .16in; }
.pb-scene-head { font-size: 1.15em; font-weight: 700; font-family: var(--display); letter-spacing: .04em; text-transform: uppercase; margin: .3in 0 .09in; padding-bottom: .04in; border-bottom: 1px solid #d8d8d8; }
.pb-sp-mark { border: none; margin: 0; padding: 0; min-height: 0; }
.pb-synopsis { color: #666; margin: 0 0 .05in; }
.pb-line { min-height: 1.7em; }
.pageframe.has-comments .sheet { padding-right: 58mm; }
.pageframe .sheet .ccard-abs { position: absolute; right: 6mm; width: 46mm; margin: 0; font-size: 8.5pt; box-shadow: none; background: #fff; color: #1a1a1a; border-color: #d8d8d8; border-left-color: #B98A00; }
.pageframe .sheet .ccard-abs .ccard-quote { font-size: 7.5pt; }
.sheet-sp { padding: 25mm 25mm 25mm 38mm; }
.sheet-sp .sheet-body { height: calc(297mm - 50mm); font: 12pt/1.06 var(--mono); }
.sheet-sp .sheet-num { top: 12mm; right: 25mm; left: auto; bottom: auto; text-align: right; font: 12pt var(--mono); color: #000; }
.sheet-sp .pb-line { min-height: 1.06em; }
.pageframe.has-dev .sheet-sp .sheet-body { line-height: 1.5; }
.pageframe.has-dev .sheet-sp .pb-line { min-height: 1.5em; }
.sheet-sp .pb-titleblock { padding-top: 0; text-align: left; height: calc(297mm - 50mm); display: flex; }
.sheet-sp .sp-title { width: 100%; font: inherit; min-height: 0; }
.sheet-sp .sp-tmain { padding-top: 62mm; }
.sheet-sp .sp-slug { text-transform: uppercase; position: relative; }
.sheet-sp .sp-slug[data-num]::before { content: attr(data-num); position: absolute; right: 100%; margin-right: 6mm; }
.sheet-sp .sp-slug[data-num]::after { content: attr(data-num); position: absolute; left: 100%; margin-left: 4mm; }
.sheet-sp .sp-cue { margin-left: 56mm; }
.sheet-sp .sp-cue-bold, .sheet-sp .sp-cue-bold .mention { font-weight: 700; }
.sheet-sp .sp-paren { margin-left: 38mm; width: 64mm; }
.sheet-sp .sp-dialogue, .sheet-sp .sp-lyric { margin-left: 25mm; width: 89mm; }
.sheet-sp .sp-lyric { font-style: italic; }
.sheet-sp .sp-transition { text-align: right; text-transform: uppercase; }
.sheet-sp .sp-centered { text-align: center; }
.sheet-sp .sp-dual { display: flex; gap: 8mm; }
.sheet-sp .sp-dcol { flex: 1 1 0; min-width: 0; }
.sheet-sp .sp-dcol .sp-cue { margin-left: 16mm; }
.sheet-sp .sp-dcol .sp-paren { margin-left: 8mm; width: auto; }
.sheet-sp .sp-dcol .sp-dialogue, .sheet-sp .sp-dcol .sp-lyric { margin-left: 0; width: auto; }
.sheet-sp .fmk { display: inline-block; width: 0; overflow: hidden; vertical-align: top; white-space: pre; }
.sheet-sp .fnote { display: none; }
.sheet-sp .fi { font-style: italic; }
.sheet-sp .fb { font-weight: 700; }
.sheet-sp .fbi { font-weight: 700; font-style: italic; }
.sheet-sp .fu { text-decoration: underline; }
.sheet-sp .mention { font-weight: 400; text-transform: uppercase; color: inherit; letter-spacing: 0; font-size: inherit; }
.sheet-sp .sp-speech .sline { white-space: pre-wrap; }
.pageframe-sp.has-comments .sheet { padding-right: 58mm; }

/* ---- help and long reading ---------------------------------------------------------------------- */
.prose { max-width: 46rem; }
.prose h2 { margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.prose li { margin: .3rem 0; }
.help-cta { margin-top: 2rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.helpexample, .helpmarks { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 1rem 1.2rem; font: 14px/1.7 var(--mono); box-shadow: var(--shadow); overflow-x: auto; }
.fw { margin: 1.4rem 0; padding: 1.1rem 1.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow); }
.fw h3 { margin-top: 0; font-size: 1.3rem; }
.fw-stages { padding-left: 1.3rem; }
.fw-stages li { margin: .35rem 0; }
.fw-examples { padding-left: 1.2rem; }
.fw-examples li { margin: .3rem 0; }

/* ---- admin ------------------------------------------------------------------------------------------ */
.admin-head { margin-bottom: 1.2rem; }
.admin-head h1 { margin-bottom: .2rem; }
.admin-h2 { margin-top: 2rem; font-size: 1.25rem; }
.kpis-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1.1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.kpi-val { font-family: var(--display); font-weight: 700; font-size: 2.2rem; line-height: 1; color: var(--ink); }
.kpi-label { margin-top: .35rem; font-family: var(--display); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi-sub { margin-top: .25rem; font-size: .82rem; color: var(--accent-strong); }
.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.barchart { display: flex; align-items: flex-end; gap: .5rem; height: 120px; margin-top: .8rem; }
.barcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .25rem; }
.bartrack { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.bar { width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.barval { font-size: .72rem; color: var(--muted); height: .9rem; line-height: .9rem; }
.barlab { font-size: .68rem; color: var(--muted); height: .8rem; }
.growth-mini { margin-top: 1.1rem; display: grid; gap: .6rem; }
.growth-mini > div { display: flex; align-items: center; gap: .6rem; }
.growth-mini .gm-k { flex: 0 0 5rem; font-size: .8rem; color: var(--muted); }
.growth-mini .barchart { height: 30px; flex: 1; margin: 0; gap: .2rem; }
.growth-mini .barval, .growth-mini .barlab { display: none; }
.distro { display: grid; gap: .4rem; }
.distro-row { display: grid; grid-template-columns: 5rem 1fr 2.5rem; align-items: center; gap: .6rem; font-size: .9rem; }
.distro-k { text-transform: capitalize; color: var(--ink-2); }
.distro-bar { background: var(--surface-2); border-radius: 5px; height: .55rem; overflow: hidden; }
.distro-bar > span { display: block; height: 100%; background: var(--ink); border-radius: 5px; }
.distro-v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.factrow { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin-top: 1rem; color: var(--ink-2); font-size: .92rem; }
.factrow.tall { flex-direction: column; gap: .7rem; }
.factrow b { color: var(--ink); font-size: 1.05em; }
.admin-table { width: 100%; border: none; box-shadow: none; border-radius: 0; font-size: .92rem; background: none; }
.admin-table th { background: none; padding: .4rem .6rem; border-bottom: 2px solid var(--line); }
.admin-table td { padding: .45rem .6rem; }
.admin-table th:not(:first-child), .admin-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.feeds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.feed { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); padding: 1rem 1.1rem; box-shadow: var(--shadow); min-width: 0; }
.feed h3 { margin: 0 0 .6rem; font-size: .9rem; letter-spacing: .1em; color: var(--muted); }
.feed ul { list-style: none; margin: 0; padding: 0; }
.feed li { padding: .45rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: .12rem; }
.feed li:last-child { border-bottom: none; }
.feed li b { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed li span { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed li time { font-size: .74rem; color: var(--accent-strong); }
.sysbar { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; margin-top: 1.6rem; padding: .9rem 1.1rem; background: var(--ink); color: var(--bg); border-radius: var(--r-3); font-size: .85rem; }
.sysbar span { display: inline-flex; align-items: center; gap: .4rem; }
@media (max-width: 900px) { .kpis-grid { grid-template-columns: repeat(2, 1fr); } .feeds { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .admin-cols { grid-template-columns: 1fr; } .feeds { grid-template-columns: 1fr; } }

/* ---- small screens ----------------------------------------------------------------------------------- */
@media (max-width: 760px) {
  h1 { font-size: 2rem; }
  .topbar { padding: 0 .9rem; gap: .6rem; }
  .zoom, .who { display: none; }
  .mainnav a { padding: .3rem .5rem; font-size: .95rem; }
  .brand-word { font-size: 1.2rem; }
  main { padding: 0 1rem; margin-top: 1.2rem; }
  .logout-form { border-left: none; padding-left: 0; }
  .pageframe { padding: .8rem; align-items: flex-start; }
  .pageframe .sheet { zoom: 0.55; }
}
@media (max-width: 430px) { .pageframe .sheet { zoom: 0.43; } .mainnav .nav-help { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- paper ---------------------------------------------------------------------------------------------- */
@media print {
  .topbar, footer, .site-footer, .noprint { display: none !important; }
  .promptbook { border: none; box-shadow: none; padding: 0; }
  body { background: #fff; color: #000; }
  .scripttext .direction { text-decoration: none; }
  .scripttext .cue { background: none; padding: 0; }
  nav.tabs { display: none; }
  section[role="tabpanel"][hidden] { display: block !important; }
  nav.tabs[role="tablist"] ~ section > h2 { display: block; }
  main { zoom: 1; margin: 0; padding: 0; max-width: none; }
  .pageframe { background: none; border: none; padding: 0; gap: 0; display: block; overflow: visible; }
  .sheet { box-shadow: none; margin: 0; }
  .sheet + .sheet { break-before: page; }
  .commented { background: none !important; box-shadow: none !important; text-decoration: underline; text-decoration-color: #b58900; }
  .ccard-abs { border: 1px solid #ccc; box-shadow: none; }
}

/* ==== the public site ========================================================================== */
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 1.4rem; }
.sec-title { font-size: 2.3rem; margin: .3rem 0 .8rem; }
.sec-lede { color: var(--ink-2); max-width: 44rem; margin: 0 auto 1.6rem; font-size: 1.04rem; }
.cta-row { display: flex; align-items: center; gap: .8rem; margin-top: 1.6rem; flex-wrap: wrap; }
.cta-row .btn { margin-top: 0; }

/* anything on the dark stage keeps dark tokens whatever the theme */
.on-dark {
  --bg: #0B0D11; --surface: #15181E; --surface-2: #1D2129; --surface-3: #272C36;
  --ink: #F2F3F5; --ink-2: #C9CED6; --muted: #98A1AF; --line: #2A2F39; --line-2: #3A404C;
  --accent: #F0C232; --accent-strong: #FFD557; --accent-soft: #3A3210; --accent-ink: #F6E7A8;
  --frame-bg: #0F1114; --frame-line: #5C6472; --fig: #B8C0CC; --fig-2: #6F7987; --silhouette: #05070A;
  --danger: #F07178; --focus: #7FB3F5;
  background: var(--bg); color: var(--ink);
}
.btn.onglass { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .22); color: #F2F3F5 !important; }
.btn.onglass:hover { background: rgba(255, 255, 255, .12); box-shadow: none; }

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(60rem 30rem at 85% -10%, rgba(240, 194, 50, .16), transparent 60%),
  radial-gradient(40rem 30rem at 0% 110%, rgba(127, 179, 245, .10), transparent 60%); pointer-events: none; }
.hero-in { position: relative; max-width: 1180px; margin: 0 auto; padding: 5rem 1.4rem 5.4rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 3.5rem; align-items: center; }
.hero h1 { font-size: clamp(3rem, 6.4vw, 5.2rem); line-height: .95; letter-spacing: .01em; margin: .6rem 0 1.1rem; }
.hero-lede { font-size: 1.14rem; line-height: 1.6; color: var(--ink-2); max-width: 34rem; margin: 0; }
.hero-note { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .88rem; margin-top: 1.4rem; }
.hero-note svg { width: 15px; height: 15px; flex: 0 0 auto; }
.hero-art { position: relative; min-height: 26rem; }
.art-page {
  --ink: #1a1a1a; --ink-2: #333; --muted: #666; --line: #d8d8d8; --accent-strong: #7a5410;
  background: #fff; color: #1a1a1a; border-radius: 4px; padding: 2rem 2.2rem; box-shadow: var(--shadow-3);
}
.art-page .scripttext.screenplay { width: auto; margin: 0; font-size: 12.5px; }
.art-page .screenplay .sp-cue { margin-left: 17ch; }
.art-page .screenplay .sp-paren { margin-left: 11ch; width: auto; }
.art-page .screenplay .sp-dialogue { margin-left: 7ch; width: 30ch; max-width: 100%; }
.hero-art .art-page { position: absolute; left: 0; top: 0; width: 66%; transform: rotate(-2.2deg); }
.art-board { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.hero-art .art-board { position: absolute; right: 0; bottom: 0; width: 62%; padding: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-3); transform: rotate(1.4deg); }
.art-frame { margin: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.art-board .art-frame .thumb { width: 100%; aspect-ratio: 16 / 9; background: var(--frame-bg); display: block; border-radius: 0; }
.art-board .art-frame .thumb svg { display: block; width: 100%; height: 100%; }
.art-frame figcaption { display: flex; align-items: baseline; gap: .5rem; padding: .35rem .55rem .45rem; font-size: .74rem; color: var(--muted); line-height: 1.3; }
.art-frame figcaption b { font-family: var(--display); font-size: 1.05rem; color: var(--ink); letter-spacing: .04em; }
.art-board.wide { grid-template-columns: 1fr 1fr; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-2); }
.art-warn { grid-column: 1 / -1; font-size: .84rem; line-height: 1.4; padding: .5rem .7rem; border-radius: var(--r-1); color: var(--danger); background: var(--danger-soft); border-left: 3px solid var(--danger); }
.art-page.flat { box-shadow: var(--shadow-2); border: 1px solid #e3e3e3; }

.band-stages { padding: 4.5rem 0 4rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.stages { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .9rem; counter-reset: st; }
.stage-card { position: relative; padding: 1.2rem 1.1rem 1.3rem; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--bg); }
.stage-card:not(:last-child)::after { content: ""; position: absolute; right: -.9rem; top: 2.3rem; width: .9rem; border-top: 2px dashed var(--line-2); }
.stage-n { position: absolute; right: .9rem; top: .7rem; font-family: var(--display); font-weight: 700; font-size: 2.2rem; line-height: 1; color: var(--surface-3); }
.stage-ic { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: var(--r-2); background: var(--ink); color: var(--accent); }
.on-dark .stage-ic, :root[data-theme="dark"] .stage-ic { color: var(--accent); }
.stage-ic svg { width: 20px; height: 20px; }
.stage-card h3 { margin: .9rem 0 .25rem; font-size: 1.3rem; }
.stage-card p { margin: 0; color: var(--ink-2); font-size: .92rem; line-height: 1.45; }

.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; padding-block: 4.5rem; }
.feature.flip .feature-copy { order: 2; }
.feature-copy p { color: var(--ink-2); font-size: 1.02rem; }
.ticks { list-style: none; padding: 0; margin: 1.1rem 0 0; display: grid; gap: .55rem; }
.ticks li { position: relative; padding-left: 1.6rem; color: var(--ink-2); font-size: .96rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .45em; width: .8rem; height: .45rem; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

.band-learn { padding: 4.5rem 0; background: var(--surface-2); border-block: 1px solid var(--line); }
.learn-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 0 0 1.8rem; }
.t1 .learn-card { transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.t1 .learn-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--accent); }
.t1 .learn-card .abbr { align-self: flex-start; }
.t1 .card .frame.type-thumb, .t1 .type-thumb { display: flex; flex-direction: column; justify-content: flex-end; gap: .1rem; padding: .9rem 1rem; background: var(--ink); color: var(--bg); aspect-ratio: 16 / 9; }
.t1 .type-thumb span { font-family: var(--display); font-weight: 700; font-size: 2.6rem; line-height: .9; color: var(--accent); }
.t1 .type-thumb b { font-family: var(--display); font-size: 1.15rem; letter-spacing: .08em; text-transform: uppercase; }

.faq { max-width: 46rem; margin: 1.4rem auto 0; padding-bottom: 4rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); margin-bottom: .6rem; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; padding: .9rem 1.2rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-family: var(--display); font-size: 1.6rem; line-height: 1; flex: 0 0 auto; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 1.2rem 1.1rem; color: var(--ink-2); }

.closing { padding: 5rem 0; border-top: 1px solid var(--line); background:
  radial-gradient(40rem 20rem at 50% 120%, rgba(240, 194, 50, .18), transparent 65%), var(--bg); }
.closing h2 { font-size: clamp(2.4rem, 5vw, 3.6rem); margin: 0 0 .5rem; }
.closing p { color: var(--ink-2); margin: 0 0 1.6rem; font-size: 1.05rem; }

.site-footer { background: #0B0D11; color: #98A1AF; border-top: 1px solid #2A2F39; text-align: left; padding: 0; font-size: inherit; }
.site-footer .brand, .site-footer .brand-word { color: #F2F3F5; }
.site-footer .mark { border-color: #F2F3F5; }
.site-footer .mark::before { background: #F0C232; }
.foot-inner { max-width: 1120px; margin: 0 auto; padding: 3rem 1.4rem 2rem; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1.8rem; }
.foot-brand p { margin: .9rem 0 0; max-width: 24rem; font-size: .9rem; }
.foot-col h4 { margin: 0 0 .8rem; color: #F2F3F5; font-size: .9rem; letter-spacing: .12em; }
.foot-col a { display: block; color: #C9CED6; padding: .22rem 0; font-size: .92rem; text-decoration: none; }
.foot-col a:hover { color: #fff; text-decoration: underline; text-decoration-color: #F0C232; }
.foot-bar { border-top: 1px solid #2A2F39; max-width: 1120px; margin: 0 auto; padding: 1rem 1.4rem 1.6rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .82rem; }

/* ---- learn ---- */
.learn-hero { padding: 3.6rem 0 2.6rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.learn-hero h1 { font-size: clamp(2.6rem, 5vw, 3.8rem); }
.learn-shelves { padding-block: 1rem 4rem; }
.shelf { padding-top: 2.6rem; scroll-margin-top: calc(var(--bar-h) + 10px); }
.shelf-head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.shelf-head h2 { margin: .1rem 0 .2rem; font-size: 2rem; }
.shelf-head p { margin: 0; max-width: 46rem; }
.learn-page { padding-bottom: 4rem; }
.t1 .side a.side-item { text-decoration: none; }
.t1 .side-back { font-family: var(--display); font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: var(--muted); padding: 0 10px 8px; }
.t1 .side-back:hover { color: var(--ink); }
.t1 .prevnext a { text-decoration: none; }
.wchapter { max-width: 44rem; }
.t1 .chapter header.wch-head { display: block; margin-bottom: 0; }
.t1 .chapter header.wch-head .eyebrow { max-width: none; }
.wch-head h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); margin: .2rem 0 .6rem; }
.t1 .wch-lede { font-size: 1.15rem; line-height: 1.55; color: var(--ink-2); margin: 0 0 1.4rem; }
.wsec h2 { font-size: 1.45rem; margin: 2rem 0 .5rem; }
.t1 .wsec p { margin: .7rem 0; font-size: 1.02rem; line-height: 1.7; }
.wexample, .wcompare { margin: 2.2rem 0; }
.wexample figcaption, .wcompare figcaption { color: var(--ink-2); font-size: .95rem; margin-bottom: .7rem; display: flex; flex-direction: column; gap: .2rem; }
.wcompare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: none; }
.wcompare figcaption { grid-column: 1 / -1; margin: .2rem 0 0; }
.t1 .wc-label { font-family: var(--display); font-size: .95rem; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 .4rem; }
.wc-label.weak { color: var(--danger); }
.wc-label.strong { color: var(--done); }
.art-page.snug { padding: 1.4rem 1.6rem; }
.habit { margin: 2rem 0 1.2rem; padding: 1rem 1.2rem; border-left: 4px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); border-radius: 0 var(--r-2) var(--r-2) 0; }
.habit .eyebrow { color: inherit; opacity: .75; margin: 0 0 .2rem; }
.t1 .habit p:last-child { font-size: 1.08rem; font-weight: 500; line-height: 1.5; }
.tryit { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--shadow); }
.t1 .tryit .btn { color: #17130a !important; background: var(--accent); border-color: var(--accent); font-weight: 600; padding: .5rem 1rem; }
.t1 .tryit-label { font-size: 1.05rem; font-weight: 600; }
.t1 .wsources { margin-top: 2rem; display: block; }
.t1 .btn svg, .btn svg { width: 15px; height: 15px; }
.stage-note { padding-block: 3rem 4rem; }

/* ---- sign in ---- */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: calc(100vh - var(--bar-h)); }
.auth-form { padding: 4rem 1.4rem; max-width: 27rem; width: 100%; margin: 0 auto; align-self: center; }
.auth-form h1 { font-size: 3rem; }
.auth-form .btn { width: 100%; margin-top: .8rem; }
.auth-side { display: grid; place-items: center; padding: 3rem; background:
  radial-gradient(40rem 26rem at 80% 0%, rgba(240, 194, 50, .18), transparent 60%), #0B0D11; }
.auth-side-in { max-width: 24rem; }
.auth-quote { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: clamp(2.6rem, 4.6vw, 4rem); line-height: .98; margin: .6rem 0 1.6rem; }

/* ---- welcome ---- */
.welcome { max-width: 52rem; margin: 1.5rem auto 0; }
.welcome h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; margin: 1.6rem 0 1.2rem; }
.choice { margin: 0; cursor: pointer; position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; padding: 0; }
.choice-card { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: 1.2rem; border: 2px solid var(--line); border-radius: var(--r-3); background: var(--surface); transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease; }
.choice-card b { font-family: var(--display); font-size: 1.35rem; letter-spacing: .04em; text-transform: uppercase; }
.choice-card > span:last-child { color: var(--ink-2); font-size: .92rem; font-weight: 400; }
.choice-ic { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: var(--r-2); background: var(--surface-2); color: var(--ink); margin-bottom: .3rem; }
.choice-ic svg { width: 20px; height: 20px; }
.choice:hover .choice-card { border-color: var(--line-2); transform: translateY(-1px); }
.choice input:checked + .choice-card { border-color: var(--ink); box-shadow: var(--shadow-2); }
.choice input:checked + .choice-card .choice-ic { background: var(--ink); color: var(--accent); }
.choice input:focus-visible + .choice-card { outline: 2px solid var(--focus); outline-offset: 2px; }
.welcome-film h2 { margin: 0 0 .1rem; font-size: 1.4rem; }
.welcome-actions { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-top: 1rem; }
.welcome-actions .btn { margin-top: 0; }

/* ---- films home ---- */
.films { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.filmcard { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: 1.1rem 1.2rem 1rem; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.filmcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-2); text-decoration: none; }
.filmcard-top { display: flex; align-items: center; gap: .4rem; }
.filmcard-when { margin-left: auto; color: var(--muted); font-size: .78rem; }
.filmcard h3 { font-size: 1.55rem; margin: .5rem 0 0; }
.filmcard p { margin: 0; color: var(--ink-2); font-size: .93rem; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.filmcard-meta { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.empty-state { text-align: center; padding: 3.5rem 1rem; border: 2px dashed var(--line-2); border-radius: var(--r-4); margin-top: 1.2rem; }
.empty-state h2 { margin: 0 0 .3rem; }
.empty-state p { color: var(--ink-2); margin: 0 0 1.2rem; }
.home-learn, .home-companies { margin-top: 3rem; }
.companylist { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.companylist a { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .7rem 1rem; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); }
.companylist a:hover { border-color: var(--line-2); }
.home-companies details summary { list-style: none; }
.home-companies details[open] summary { margin-bottom: .4rem; }
.narrow-page { max-width: 34rem; margin: 0 auto; }

/* ---- first steps ---- */
.firststeps { margin-top: 1.4rem; border-left: 4px solid var(--accent); }
.fs-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.fs-head h3 { margin: .1rem 0 0; }
.fs-bar { height: 5px; border-radius: 3px; background: var(--surface-2); margin: .7rem 0 .6rem; overflow: hidden; }
.fs-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.fs-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .1rem 1.4rem; }
.fs-list li { display: flex; align-items: center; gap: .55rem; padding: .3rem 0; }
.fs-tick { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 1.5px solid var(--line-2); font-size: .72rem; font-weight: 700; flex: 0 0 auto; }
.fs-list li.ok .fs-tick { background: var(--done); border-color: var(--done); color: #fff; }
.fs-list li.ok > a:first-of-type { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.fs-list li > a:first-of-type { text-decoration: none; font-weight: 500; }
.fs-list li > a:first-of-type:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.fs-learn { margin-left: auto; font-size: .78rem; color: var(--muted); white-space: nowrap; }

@media (max-width: 980px) {
  .hero-in { grid-template-columns: 1fr; gap: 2.4rem; padding: 3.4rem 1.4rem 3.6rem; }
  .hero-art { min-height: 0; display: grid; gap: 1rem; }
  .hero-art .art-page, .hero-art .art-board { position: static; width: auto; transform: none; }
  .stages { grid-template-columns: repeat(2, 1fr); }
  .stage-card::after { display: none; }
  .feature { grid-template-columns: 1fr; gap: 1.8rem; padding-block: 3rem; }
  .feature.flip .feature-copy { order: 0; }
  .learn-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-inner { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .choices { grid-template-columns: 1fr; }
  .wcompare { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stages, .learn-grid { grid-template-columns: 1fr; }
  .sec-title { font-size: 1.9rem; }
}

/* ---- the guide ---- */
.guide-home { padding-block: 2.4rem 4rem; }
.gtopics { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.gtopic { position: relative; display: flex; flex-direction: column; gap: .3rem; padding: 1.2rem 1.2rem 1.3rem; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.gtopic:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--accent); text-decoration: none; }
.gtopic-ic { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: var(--r-2); background: var(--ink); color: var(--accent); margin-bottom: .5rem; }
.gtopic-ic svg { width: 20px; height: 20px; }
.gtopic-n { position: absolute; right: 1rem; top: .8rem; font-family: var(--display); font-weight: 700; font-size: 1.8rem; line-height: 1; color: var(--surface-3); }
.gtopic strong { font-family: var(--display); font-size: 1.35rem; letter-spacing: .03em; text-transform: uppercase; line-height: 1.1; }
.gtopic > span:last-child { color: var(--ink-2); font-size: .93rem; }
.gpage { max-width: 50rem; }
.gpage h2 { font-size: 1.4rem; margin: 2.2rem 0 .6rem; }
.t1 .gpage > p { margin: .7rem 0; font-size: 1.02rem; line-height: 1.65; max-width: 44rem; }
.gsteps { list-style: none; padding: 0; margin: 1rem 0; counter-reset: g; display: grid; gap: .6rem; }
.gsteps li { counter-increment: g; display: grid; grid-template-columns: 2.4rem 1fr; column-gap: .9rem; align-items: start; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); }
.gsteps li::before { content: counter(g); grid-row: span 2; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--ink); color: var(--accent); font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.gsteps strong { font-size: 1.02rem; }
.gsteps span { color: var(--ink-2); font-size: .94rem; }
.gcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .7rem; margin: 1rem 0; }
.gcard { display: flex; flex-direction: column; gap: .2rem; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-2); text-decoration: none; }
a.gcard:hover { border-color: var(--accent); }
.gcard strong { font-size: .98rem; }
.gcard span { color: var(--ink-2); font-size: .9rem; line-height: 1.45; }
.typeget { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1rem; margin: 1.2rem 0; align-items: stretch; }
.tg-col { display: flex; flex-direction: column; min-width: 0; }
.t1 .tg-label, .tg-label { font-family: var(--display); font-size: .9rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 .4rem; }
.tg-src { flex: 1; margin: 0; padding: 1.2rem 1.3rem; background: var(--ink); color: var(--bg); border-radius: var(--r-2); font: 13px/1.6 var(--code); white-space: pre-wrap; overflow-wrap: anywhere; }
.typeget .art-page { flex: 1; }
table.marks { font-size: .93rem; }
table.marks code { white-space: nowrap; }
.t1 table.marks td, .t1 table.marks th { padding: .55rem .8rem; }
.gkeys { margin: 1rem 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; background: var(--surface); }
.gkeys > div { display: grid; grid-template-columns: 15rem 1fr; gap: 1rem; padding: .6rem 1rem; border-bottom: 1px solid var(--line); }
.gkeys > div:last-child { border-bottom: none; }
.gkeys dt { font-weight: 600; font-size: .93rem; }
.gkeys dd { margin: 0; color: var(--ink-2); font-size: .93rem; }
.gtip { margin: 1.4rem 0 !important; padding: .8rem 1rem; border-radius: var(--r-2); background: var(--accent-soft); color: var(--accent-ink); font-size: .96rem !important; }
.gtip a { color: inherit; font-weight: 600; }
.gmore { margin: 1.4rem 0; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); padding: 0 1rem; }
.gmore summary { padding: .9rem 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.gmore summary::after { content: "+"; color: var(--accent); font-family: var(--display); font-size: 1.5rem; line-height: 1; }
.gmore[open] summary::after { content: "−"; }
.gmore[open] { padding-bottom: 1rem; }
.gdraw { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin: 1rem 0; }
.gdraw figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.gdraw .frame { display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--frame-bg); }
.gdraw figcaption { padding: .5rem .7rem .6rem; font-size: .85rem; color: var(--ink-2); line-height: 1.35; }
/* ---- a framework, as a chapter ---- */
.fwfacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 1.2rem 0 .4rem; }
.fwfacts > div { padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); }
.t1 .fwfacts p:last-child { font-size: .93rem; line-height: 1.55; color: var(--ink-2); margin-top: .3rem; }
.wchapter:has(.fwfacts) { max-width: 54rem; }
.fwh { font-size: 1.4rem; margin: 2.2rem 0 .7rem; }
.fwstages { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.fwstages li { display: grid; grid-template-columns: 2.2rem 1fr; gap: .9rem; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); }
.fw-n { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--surface-2); font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.t1 .fwstages p, .t1 .fwfilms p { margin: .15rem 0 0; color: var(--ink-2); font-size: .95rem; line-height: 1.55; }
.fwfilms { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: .5rem; }
.fwfilms li { padding: .8rem 1rem; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--r-2) var(--r-2) 0; }
@media (max-width: 760px) {
  .typeget, .fwfacts { grid-template-columns: 1fr; }
  table.marks, table.marks tbody, table.marks tr, table.marks td { display: block; }
  table.marks thead { display: none; }
  table.marks tr { padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
  table.marks tr:last-child { border-bottom: none; }
  .t1 table.marks td { padding: .1rem 0; border: none; }
  table.marks code { white-space: normal; }
  .gdraw { grid-template-columns: 1fr 1fr; }
  .gkeys > div { grid-template-columns: 1fr; gap: .1rem; }
}
