/* app.css: OScreenplay ("Projection Room"): tokens (light + dark), the design kit, the shared pieces, the engine's look
   (night panels, chips, posters, script paper, the project tabs), each page's styles, and at the end the role layer that
   gives Anvil components (Button, Label, TextBox, notifications, dialogs, RepeatingPanel grids) the same look.
   Facelifted with APP_MAKER/design (2026-11-05): python -I APP_MAKER/tools/design_check.py oscreenplay.
   Fonts are the user's choice (Fraunces, Inter, Courier Prime) and the warm paper page is the brand: both kept. */
/* Projection Room: warm paper on a screening-room black, one tally-red light, tungsten highlights. */
:root {
  --c-bg: #f3eee4;          /* design-ok: cream-background (the brand's projection-screen paper) */          /* page: warm projection-screen paper */
  --c-surface: #fffdf8;     /* cards, menus, inputs */
  --c-surface-2: #ebe4d6;   /* subtle fills, hovers */
  --c-ink: #17140f;         /* text */
  --c-muted: #5f574a;       /* secondary text */
  --c-faint: #6c6456;       /* hints, placeholders, small print (4.5:1 on every surface) */
  --c-line: #ddd4c3;        /* borders */
  --c-brand: #c8102e;       /* tally red: primary buttons, links, focus */
  --c-brand-ink: #ffffff;   /* text on brand */
  --c-brand-soft: #f8dfe1;  /* brand tints */
  --c-accent: #865e13;      /* tungsten as text (deep enough for 4.5:1 on its soft fill); bright tungsten #e0a526 for fills */
  --c-accent-soft: #f4e6c6;
  --c-night: #0e0d0c;       /* the screening room: always dark panels */
  --c-night-2: #1d1a17;
  --c-night-ink: #efe8da;
  --c-paper: #fffdf6;       /* script pages */
  --c-paper-ink: #1b1813;
  --c-good: #2e764d; --c-good-soft: #e1efe3;
  --c-warn: #9a6300; --c-warn-soft: #f6ead0;
  --c-bad: #b3261e;  --c-bad-soft: #f7e1de;
  --c-on-status: #fff;      /* text on good/bad/warn fills */
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(23, 20, 15, .06), 0 10px 30px rgba(23, 20, 15, .08);
  --shadow-lg: 0 24px 60px rgba(23, 20, 15, .2);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;  /* design-ok: overused-font (the user's choice) */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-script: "Courier Prime", "Courier New", Courier, monospace;
  --maxw: 1180px;
  --header-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #0e0d0c; --c-surface: #1a1816; --c-surface-2: #24211d; --c-ink: #efe8da; --c-muted: #aea493; --c-faint: #948a7b;
    --c-line: #2f2b26; --c-brand: #ef3b4f; --c-brand-ink: #160406; --c-brand-soft: #3a1418; --c-accent: #e8b547; --c-accent-soft: #33280f;
    --c-night: #080706; --c-night-2: #151310; --c-night-ink: #efe8da; --c-paper: #f4eee0; --c-paper-ink: #1b1813;
    --c-good: #6fcf97; --c-good-soft: #14261b; --c-warn: #f0b34f; --c-warn-soft: #2d2311; --c-bad: #ff8a80; --c-bad-soft: #321a19; --c-on-status: #0e0d0c;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset; --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --c-bg: #0e0d0c; --c-surface: #1a1816; --c-surface-2: #24211d; --c-ink: #efe8da; --c-muted: #aea493; --c-faint: #948a7b;
  --c-line: #2f2b26; --c-brand: #ef3b4f; --c-brand-ink: #160406; --c-brand-soft: #3a1418; --c-accent: #e8b547; --c-accent-soft: #33280f;
  --c-night: #080706; --c-night-2: #151310; --c-night-ink: #efe8da; --c-paper: #f4eee0; --c-paper-ink: #1b1813;
  --c-good: #6fcf97; --c-good-soft: #14261b; --c-warn: #f0b34f; --c-warn-soft: #2d2311; --c-bad: #ff8a80; --c-bad-soft: #321a19; --c-on-status: #0e0d0c;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset; --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6); color-scheme: dark;
}


/* Design kit: motion tokens, browser surfaces, wrapping, press feedback, reduced motion (APP_MAKER/design/kit.css). */
/* design-kit:start */
:root {
  /* easing: never ease-in on UI */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);      /* entering, exiting, most UI */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);  /* moving across the screen */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);   /* sheets, drawers */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);      /* one authored entrance */
  /* durations: UI stays under 300ms, exits faster than entrances */
  --dur-press: 140ms; --dur-fast: 180ms; --dur-base: 220ms; --dur-slow: 320ms; --dur-hero: 640ms;
  /* 4px spacing scale */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --measure: 65ch;
}

/* browser surfaces: the parts nobody draws */
::selection { background: color-mix(in srgb, var(--c-brand) 26%, transparent); color: inherit; }
html {
  accent-color: var(--c-brand); caret-color: var(--c-brand);
  scrollbar-color: color-mix(in srgb, var(--c-ink) 26%, transparent) transparent;
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { text-underline-offset: .2em; text-decoration-thickness: from-font; }
h1, h2, h3, h4, [role="heading"], .anvil-role-page-title { text-wrap: balance; }
p, li, dd, blockquote, figcaption { text-wrap: pretty; }
td, th, time, output, progress, .num, .tabular, [data-num] { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--c-brand) 60%, transparent); outline-offset: 2px; }

/* press feedback: pressable things answer the moment they're pressed */
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn, .kit-press) {
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) ease,
              border-color var(--dur-fast) ease, color var(--dur-fast) ease, opacity var(--dur-fast) ease,
              box-shadow var(--dur-fast) ease;
}
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn, .kit-press):active:not(:disabled) { transform: scale(.97); }

/* entrances: content is visible by default; these only add the arrival */
@keyframes kit-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes kit-pop { from { opacity: 0; transform: scale(.96); } }
@keyframes kit-fade { from { opacity: 0; } }
.kit-in { animation: kit-in var(--dur-slow) var(--ease-out) both; }
.kit-stagger > * { animation: kit-in var(--dur-slow) var(--ease-out) both; }
.kit-stagger > :nth-child(2) { animation-delay: 40ms; } .kit-stagger > :nth-child(3) { animation-delay: 80ms; }
.kit-stagger > :nth-child(4) { animation-delay: 120ms; } .kit-stagger > :nth-child(5) { animation-delay: 160ms; }
.kit-stagger > :nth-child(n+6) { animation-delay: 200ms; }

/* reduced motion = fewer and gentler, not none: movement goes, short fades that confirm a state stay */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .kit-in, .kit-stagger > * { animation-name: kit-fade; animation-delay: 0ms !important; }
  :is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn, .kit-press):active:not(:disabled) { transform: none; }
}
/* design-kit:end */


/* The app owns the page (not Anvil's theme). */
html, body { background: var(--c-bg) !important; color: var(--c-ink); }
body { margin: 0; font: 16px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html.ui-modal-open { overflow: hidden; }

.ui, .ui *, .ui *::before, .ui *::after { box-sizing: border-box; }
.ui { font: 16px/1.55 var(--font-body); color: var(--c-ink); }
.ui h1, .ui h2, .ui h3, .ui h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.015em; font-weight: 700; color: var(--c-ink); }
.ui h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
.ui h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
.ui h3 { font-size: 1.2rem; }
.ui h4 { font-size: 1rem; }
.ui p { margin: 0 0 .8em; }
.ui :is(p, ul, ol, blockquote, figure) + :is(h2, h3) { margin-top: 1.4em; }  /* more space above a heading than below it */
.ui a { color: var(--c-brand); text-underline-offset: 3px; }
.ui [hidden] { display: none !important; }
.ui img { max-width: 100%; }
.ui .muted { color: var(--c-muted); }
.ui .faint { color: var(--c-faint); }
.ui .small { font-size: .875rem; }
.ui-ic, .ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

/* layout */
.ui-wrap { max-width: var(--maxw); margin: 0 auto; padding: 32px 24px 72px; }
.ui-narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.ui-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ui-row.end { justify-content: flex-end; }
.ui-row.between { justify-content: space-between; }
.ui-row.top { align-items: flex-start; }
.ui-spacer { flex: 1; }
.ui-stack > * + * { margin-top: 14px; }
.ui-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ui-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ui-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ui-page-head h1 { margin: 0; font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.ui-page-head p { margin: 6px 0 0; }

/* cards */
.ui-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.ui-card.flat { box-shadow: none; }
.ui-card.tight { padding: 14px 16px; }
.ui-card > :last-child { margin-bottom: 0; }

/* buttons */
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn) { font: 600 .95rem/1.2 var(--font-body); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; min-height: 44px; border-radius: 999px; border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-ink);
  cursor: pointer; text-decoration: none; white-space: nowrap; }  /* transitions + press scale: design kit */
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn):hover { border-color: var(--c-ink); }
:is(.ui-btn.primary, .anvil-role-btn.anvil-role-btn-primary > button, a.anvil-role-btn.anvil-role-btn-primary) { background: var(--c-brand); border-color: var(--c-brand); color: var(--c-brand-ink); }
:is(.ui-btn.primary, .anvil-role-btn.anvil-role-btn-primary > button, a.anvil-role-btn.anvil-role-btn-primary):hover { opacity: .92; }
:is(.ui-btn.ghost, .anvil-role-btn.anvil-role-btn-ghost > button, a.anvil-role-btn.anvil-role-btn-ghost) { background: transparent; border-color: transparent; color: var(--c-muted); }
:is(.ui-btn.ghost, .anvil-role-btn.anvil-role-btn-ghost > button, a.anvil-role-btn.anvil-role-btn-ghost):hover { background: var(--c-surface-2); color: var(--c-ink); }
:is(.ui-btn.danger, .anvil-role-btn.anvil-role-btn-danger > button, a.anvil-role-btn.anvil-role-btn-danger) { color: var(--c-bad); }
:is(.ui-btn.danger, .anvil-role-btn.anvil-role-btn-danger > button, a.anvil-role-btn.anvil-role-btn-danger):hover { border-color: var(--c-bad); }
:is(.ui-btn.danger.solid, .anvil-role-btn.anvil-role-btn-danger.anvil-role-btn-solid > button, a.anvil-role-btn.anvil-role-btn-danger.anvil-role-btn-solid) { background: var(--c-bad); border-color: var(--c-bad); color: var(--c-on-status); }
:is(.ui-btn.sm, .anvil-role-btn.anvil-role-btn-sm > button, a.anvil-role-btn.anvil-role-btn-sm) { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
:is(.ui-btn.lg, .anvil-role-btn.anvil-role-btn-lg > button, a.anvil-role-btn.anvil-role-btn-lg) { min-height: 54px; padding: 14px 26px; font-size: 1.05rem; }
:is(.ui-btn.icon, .anvil-role-btn.anvil-role-btn-icon > button, a.anvil-role-btn.anvil-role-btn-icon) { width: 40px; min-height: 40px; padding: 0; }
:is(.ui-btn.block, .anvil-role-btn.anvil-role-btn-block > button, a.anvil-role-btn.anvil-role-btn-block) { width: 100%; }
:is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn):disabled { opacity: .5; cursor: not-allowed; transform: none; }
:is(.ui-btn.is-busy, .anvil-role-btn.anvil-role-btn-is-busy > button, a.anvil-role-btn.anvil-role-btn-is-busy) { position: relative; color: transparent !important; }
:is(.ui-btn.is-busy, .anvil-role-btn.anvil-role-btn-is-busy > button, a.anvil-role-btn.anvil-role-btn-is-busy)::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor;
  border-color: var(--c-muted) transparent var(--c-muted) transparent; animation: ui-spin .8s linear infinite; }
:is(.ui-btn.primary.is-busy, .anvil-role-btn.anvil-role-btn-primary.anvil-role-btn-is-busy > button, a.anvil-role-btn.anvil-role-btn-primary.anvil-role-btn-is-busy)::after { border-color: var(--c-brand-ink) transparent var(--c-brand-ink) transparent; }
@keyframes ui-spin { to { transform: rotate(360deg); } }
.ui :focus-visible { outline: 3px solid color-mix(in srgb, var(--c-brand) 55%, transparent); outline-offset: 2px; }

/* forms */
.ui-field { display: block; }
.ui-field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.ui-field > span em { font-style: normal; font-weight: 400; color: var(--c-muted); }
.ui input[type=text], .ui input[type=email], .ui input[type=password], .ui input[type=search], .ui input[type=number], .ui input[type=url],
.ui input[type=tel], .ui input[type=date], .ui input[type=time], .ui input[type=datetime-local], .ui select, .ui textarea {
  font: inherit; font-size: 1rem; color: var(--c-ink); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  padding: 11px 13px; width: 100%; min-height: 46px; margin: 0; box-shadow: none; transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease; }
.ui textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
/* tick boxes and radios keep the focus ring above; typed-in fields swap it for the border + glow */
.ui input:not([type=checkbox]):not([type=radio]):focus, .ui select:focus, .ui textarea:focus { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 3px var(--c-brand-soft); }
.ui ::placeholder { color: var(--c-faint); }
.ui-hint { font-size: .85rem; color: var(--c-muted); margin: 6px 0 0; }
.ui-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .95rem; }
.ui-check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--c-brand); flex: none; }
.ui-error { background: var(--c-bad-soft); color: var(--c-bad); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .92rem; }
.ui-note { background: var(--c-brand-soft); color: var(--c-ink); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .92rem; }
.ui-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.ui-choice input { position: absolute; opacity: 0; pointer-events: none; }
.ui-choice span { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; background: var(--c-surface); }
.ui-choice input:checked + span { border-color: var(--c-brand); background: var(--c-brand-soft); }
.ui-choice input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--c-brand) 55%, transparent); }

/* small pieces */
.ui-badge { display: inline-flex; align-items: center; gap: 5px; font: 600 .75rem/1.3 var(--font-body); padding: 4px 10px; border-radius: 999px;
  background: var(--c-surface-2); color: var(--c-muted); white-space: nowrap; }
.ui-badge.brand { background: var(--c-brand-soft); color: var(--c-brand); }
.ui-badge.good { background: var(--c-good-soft); color: var(--c-good); }
.ui-badge.warn { background: var(--c-warn-soft); color: var(--c-warn); }
.ui-badge.bad { background: var(--c-bad-soft); color: var(--c-bad); }
.ui-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--c-surface-2); border-radius: 999px; border: 1px solid var(--c-line); }
.ui-seg button { font: 500 .85rem/1 var(--font-body); border: 0; background: none; color: var(--c-muted); padding: 8px 13px; border-radius: 999px; cursor: pointer; }
.ui-seg button.on { background: var(--c-surface); color: var(--c-ink); box-shadow: var(--shadow); }
.ui-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.ui-tabs a, .ui-tabs button { font: 600 .92rem/1 var(--font-body); border: 0; background: none; color: var(--c-muted); padding: 12px 14px; border-bottom: 2px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; margin-bottom: -1px; }
.ui-tabs .on { color: var(--c-ink); border-bottom-color: var(--c-brand); }
.ui-tabs .count { font-size: .75rem; background: var(--c-surface-2); border-radius: 999px; padding: 2px 7px; }
.ui-empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--c-line); border-radius: var(--radius); color: var(--c-muted); }
.ui-empty :is(.ui-ic, .ic) { width: 34px; height: 34px; color: var(--c-faint); margin-bottom: 8px; }
.ui-empty :is(h2, h3) { color: var(--c-ink); font-size: 1.15rem; margin-top: 0; }
.ui-avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--c-brand-soft); color: var(--c-brand); font: 700 .85rem/1 var(--font-body); }
.ui-list { display: grid; gap: 10px; }
.ui-item { display: flex; gap: 14px; align-items: flex-start; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 16px 18px; }
.ui-item .grow { flex: 1; min-width: 0; }
.ui-item h3 { margin: 0 0 4px; font-size: 1.05rem; }
.ui-item p { margin: 0; overflow-wrap: anywhere; }
.ui-skel { border-radius: var(--radius); background: linear-gradient(90deg, var(--c-surface-2), var(--c-surface), var(--c-surface-2)); background-size: 200% 100%;
  animation: ui-skel 1.4s linear infinite; min-height: 80px; }
@keyframes ui-skel { to { background-position: -200% 0; } }
.ui-stat { display: block; }
.ui-stat b { display: block; font: 800 2rem/1.1 var(--font-display); }
.ui-stat span { color: var(--c-muted); font-size: .9rem; }

/* header */
.ui-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--c-bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--c-line); }
.ui-header-in { max-width: var(--maxw); margin: 0 auto; height: var(--header-h); padding: 0 24px; display: flex; align-items: center; gap: 22px; }
.ui-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--c-ink) !important; font: 800 1.15rem/1 var(--font-display); letter-spacing: -.01em; }
.ui-brand img { width: 32px; height: 32px; border-radius: 9px; }
.ui-nav { display: flex; gap: 2px; }
.ui-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border-radius: 999px; color: var(--c-muted); text-decoration: none; font-weight: 600; font-size: .93rem; }
.ui-nav a:hover { color: var(--c-ink); background: var(--c-surface-2); }
.ui-nav a.on { color: var(--c-ink); background: var(--c-surface-2); }
.ui-header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; position: relative; }
.ui-avatar-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; background: var(--c-brand); color: var(--c-brand-ink); font: 700 .85rem/1 var(--font-body); }
.ui-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 280px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px; z-index: 60; transform-origin: top right; animation: ui-pop var(--dur-fast) var(--ease-out); }
.ui-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--c-line); margin-bottom: 6px; display: grid; gap: 2px; overflow-wrap: anywhere; }
.ui-menu > a, .ui-menu > button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); border: 0; background: none;
  font: 500 .95rem/1.2 var(--font-body); color: var(--c-ink); text-decoration: none; cursor: pointer; text-align: left; }
.ui-menu > a:hover, .ui-menu > button:hover { background: var(--c-surface-2); }
.ui-menu-block { padding: 8px 12px 10px; display: grid; gap: 8px; }
@keyframes ui-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* main + footer */
.ui-shell { min-height: 100vh; display: flex; flex-direction: column; }
.ui-main { flex: 1; }
.ui-shell.no-chrome .ui-header, .ui-shell.no-chrome .ui-footer, .ui-shell.no-chrome .ui-tabbar { display: none; }
.ui-footer { border-top: 1px solid var(--c-line); background: var(--c-surface); }
.ui-footer-in { max-width: var(--maxw); margin: 0 auto; padding: 32px 24px 40px; display: grid; grid-template-columns: 1fr auto; gap: 18px 24px; align-items: start; }
.ui-footer-brand p { margin: 8px 0 0; }
.ui-footer-links { display: flex; gap: 6px 18px; flex-wrap: wrap; justify-content: flex-end; }
.ui-footer-links a, .ui-footer-links button { font: 500 .92rem/1.4 var(--font-body); color: var(--c-muted); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
.ui-footer-links a:hover, .ui-footer-links button:hover { color: var(--c-ink); }
.ui-footer-legal { grid-column: 1 / -1; margin: 0; }

/* phone tab bar (shown on small screens when signed in) */
.ui-tabbar { display: none; }
.ui-tabbar:empty { display: none !important; }

/* toasts + modals */
.ui-toasts { position: fixed; z-index: 1000; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.ui-toast { display: flex; gap: 10px; align-items: center; background: var(--c-ink); color: var(--c-bg); padding: 13px 16px; border-radius: 14px; box-shadow: var(--shadow-lg);
  font-weight: 500; animation: ui-pop var(--dur-base) var(--ease-out); transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.ui-toast.error { background: var(--c-bad); color: var(--c-on-status); }
.ui-toast.ok { background: var(--c-good); color: var(--c-on-status); }
.ui-toast.out { opacity: 0; transform: translateY(8px); }
.ui-modal-wrap { position: fixed; inset: 0; z-index: 900; background: rgba(10, 12, 20, .5); display: grid; place-items: center; padding: 16px; overflow-y: auto; animation: ui-fade var(--dur-fast) ease; }
.ui-modal { position: relative; width: min(100%, 520px); background: var(--c-surface); border-radius: calc(var(--radius) + 4px); padding: 28px; box-shadow: var(--shadow-lg); animation: kit-pop var(--dur-base) var(--ease-out); outline: none; }
.ui-modal.wide { width: min(100%, 760px); }
.ui-modal h2 { padding-right: 40px; }
.ui-modal-x { position: absolute; top: 14px; right: 14px; }
@keyframes ui-fade { from { opacity: 0; } }

@media (max-width: 720px) {
  .ui-wrap { padding: 22px 16px 56px; }
  .ui-header-in { padding: 0 16px; gap: 12px; }
  .ui-nav { display: none; }
  .ui-brand span { font-size: 1.05rem; }
  .ui-header-right :is(.ui-btn, .anvil-role-btn > button, a.anvil-role-btn) { padding: 9px 13px; min-height: 40px; font-size: .9rem; }
  .ui-shell.signed-in .ui-tabbar { display: flex; position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; background: var(--c-surface); border-top: 1px solid var(--c-line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .ui-tabbar a { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; color: var(--c-muted); text-decoration: none; font: 600 .75rem/1 var(--font-body); }
  .ui-tabbar a :is(.ui-ic, .ic) { width: 22px; height: 22px; }
  .ui-tabbar a.on { color: var(--c-brand); }
  .ui-shell.signed-in:has(.ui-tabbar:not(:empty)) .ui-footer { padding-bottom: 72px; }
  .ui-footer-in { grid-template-columns: 1fr; }
  .ui-footer-links { justify-content: flex-start; }
  .ui-grid.two { grid-template-columns: 1fr; }
  .ui-menu { position: fixed; left: 12px; right: 12px; top: calc(var(--header-h) + 6px); width: auto; }
  .ui-modal { padding: 24px 18px; }
}
@media (max-width: 380px) {
  .ui-header-right :is(.ui-btn.ghost, .anvil-role-btn.anvil-role-btn-ghost > button, a.anvil-role-btn.anvil-role-btn-ghost) { display: none; }
}
@media (prefers-reduced-motion: reduce) {  /* drop movement, keep the fades (design/README.md 6) */
  .ui-menu, .ui-toast, .ui-modal { animation-name: kit-fade; }
  .ui-toast.out { transform: none; }
  .ui-skel { animation: none; }
}


/* OScreenplay skin on the shared pieces: Fraunces headings, the italic O in the brand, film-style buttons */
.ui h1, .ui h2, .ui h3, .ui h4 { line-height: 1.12; letter-spacing: -.02em; font-weight: 600; font-optical-sizing: auto; }
.ui h3, .ui h4 { letter-spacing: -.01em; }
.ui-stat b { font: 600 2.1rem/1.1 var(--font-display); }
.ui-brand { font: 600 1.22rem/1 var(--font-display); letter-spacing: -.02em; }
.ui-brand span b { font-style: italic; font-weight: 600; color: var(--c-brand); margin-right: 1px; }

/* ===== auth ===== */
.au-wrap { min-height: calc(100vh - var(--header-h) - 160px); display: grid; place-items: center; padding: 40px 16px 64px; }
.au-card { width: min(100%, 440px); padding: 30px; }
.au-card h1 { font-size: 1.8rem; margin-bottom: 4px; }
.au-card .ui-seg { width: 100%; margin: 18px 0 20px; }
.au-card .ui-seg button { flex: 1; padding: 10px; }
.au-pw { position: relative; }
.au-pw input { padding-right: 70px; }
.au-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: .9rem; flex-wrap: wrap; }
.au-links a { cursor: pointer; }
.au-card .lk-consent, .au-card [class*="consent"] { font-size: .9rem; }
.au-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--c-muted); font-size: .85rem; }
.au-or::before, .au-or::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }
.au-google svg { width: 18px; height: 18px; flex: none; }
@media (max-width: 480px) { .au-card { padding: 24px 18px; } }

/* ===== profile ===== */
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pf-head { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.pf-head .ui-avatar { width: 64px; height: 64px; font-size: 1.3rem; }
.pf-head h1 { margin: 0; font-size: 1.8rem; }
.pf-links { display: grid; gap: 4px; }
.pf-links button, .pf-links a { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: var(--radius-sm); border: 0; background: none;
  font: 500 .97rem/1.2 var(--font-body); color: var(--c-ink); cursor: pointer; text-decoration: none; text-align: left; width: 100%; }
.pf-links button:hover, .pf-links a:hover { background: var(--c-surface-2); }
@media (max-width: 720px) { .pf-grid { grid-template-columns: 1fr; } }

/* ===== admin ===== */
.ad-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.ad-fb { display: grid; gap: 10px; }
.ad-fb .ui-item { display: block; }
.ad-fb .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .85rem; color: var(--c-muted); margin-bottom: 8px; }
.ad-fb .msg { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 10px; }
.ad-fb .ctx { font-size: .8rem; color: var(--c-faint); overflow-wrap: anywhere; margin-bottom: 10px; }
.ad-fb textarea { min-height: 60px; font-size: .92rem; }
.ad-users { width: 100%; border-collapse: collapse; font-size: .93rem; }
.ad-users th, .ad-users td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.ad-users th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); }
.ad-users td.email { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .ad-users thead { display: none; }
  .ad-users tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--c-line); }
  .ad-users td { border: 0; padding: 0; }
  .ad-users td.joined { display: none; }
}


/* ===== engine (old _engine.html): night panels, chips, posters, paper ===== */
html, body { background: var(--c-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 0 0.4 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") repeat !important; }
.ui-brand span b { font-style: italic; color: var(--c-brand); font-weight: 600; margin-right: 1px; }
.ui-btn { border-radius: 10px; letter-spacing: .005em; }
.ui-btn.primary { box-shadow: 0 6px 20px color-mix(in srgb, var(--c-brand) 28%, transparent); }
:is(.ui-btn.night, .anvil-role-btn.anvil-role-btn-night > button, a.anvil-role-btn.anvil-role-btn-night) { background: var(--c-night-2); color: var(--c-night-ink); border-color: rgba(239, 232, 218, .16); }
:is(.ui-btn.night, .anvil-role-btn.anvil-role-btn-night > button, a.anvil-role-btn.anvil-role-btn-night):hover { border-color: var(--c-night-ink); }
:is(.ui-btn.tungsten, .anvil-role-btn.anvil-role-btn-tungsten > button, a.anvil-role-btn.anvil-role-btn-tungsten) { background: #e0a526; border-color: #e0a526; color: #1b1406; }
.ui-card { border-radius: var(--radius); }
.ui-tabs .on { border-bottom-color: var(--c-brand); }
.ui-seg button.on { box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.ui-badge.tung { background: var(--c-accent-soft); color: var(--c-accent); }
.os-tc { font: 700 .72rem/1.2 var(--font-script); letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); }
.os-tc .rec { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c-brand); margin-right: 7px; vertical-align: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-brand) 25%, transparent); }
@keyframes os-rec { 50% { opacity: .35; } }
.os-script { font-family: var(--font-script); }
.os-serif { font-family: var(--font-display); }
.os-italic { font-family: var(--font-display); font-style: italic; }

/* the screening room: always-dark panels, in light mode too */
.os-night { background: var(--c-night); color: var(--c-night-ink); border-radius: calc(var(--radius) + 6px); position: relative; overflow: hidden; }
.os-night > * { position: relative; z-index: 1; }
.os-night h1, .os-night h2, .os-night h3 { color: #f6efe0; }
.os-night .muted { color: #b5aa97; }
.os-night .os-tc { color: #c9bca5; }
.os-sprocket { height: 16px; background: radial-gradient(circle at 50% 50%, var(--c-bg) 0 3.5px, transparent 4px) 0 0 / 22px 16px repeat-x, var(--c-night); }  /* design-ok: radial-glow (sprocket holes) */

/* spark chips: the swappable words */
.os-chip { font: inherit; color: inherit; cursor: pointer; background: color-mix(in srgb, #e0a526 18%, transparent); border: 0; border-bottom: 2px solid #e0a526; border-radius: 6px 6px 2px 2px;
  padding: 0 .28em; margin: 0 .04em; cursor: pointer; transition: background var(--dur-fast) ease; line-height: inherit; display: inline; text-align: left; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.os-chip:hover, .os-chip.open { background: color-mix(in srgb, #e0a526 40%, transparent); }
.os-chip.locked { background: color-mix(in srgb, #ef3b4f 22%, transparent); border-bottom-color: #ef3b4f; }
.os-chip.locked::before { content: ""; display: inline-block; width: .6em; height: .6em; margin-right: .22em; vertical-align: .05em; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat; }
.os-chip.echo { background: transparent; border-bottom-style: dotted; }
.os-chip.flash { animation: os-flash .5s ease-out; }
@keyframes os-flash { from { background: rgba(239, 59, 79, .55); } }
.os-pop { position: absolute; z-index: 80; width: min(340px, calc(100vw - 24px)); background: var(--c-surface); color: var(--c-ink); border: 1px solid var(--c-line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 12px; transform-origin: top left; animation: ui-pop var(--dur-fast) var(--ease-out); }
.os-pop h4 { font: 700 .72rem/1.2 var(--font-script); letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); margin: 2px 4px 8px; }
.os-pop .opts { display: grid; gap: 3px; max-height: 280px; overflow-y: auto; }
.os-pop .opts button { text-align: left; border: 0; background: none; color: var(--c-ink); padding: 8px 10px; border-radius: 8px; font: 500 .93rem/1.3 var(--font-body); cursor: pointer; }
.os-pop .opts button:hover { background: var(--c-surface-2); }
.os-pop .tools { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.os-pop form { display: flex; gap: 6px; margin-top: 8px; }
.os-pop form input { min-height: 38px !important; padding: 7px 10px !important; font-size: .92rem !important; }

/* posters: 9:16 covers, like a reel */
.os-posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 16px; }
.ui .os-poster, .ui .os-poster:hover { color: #f6efe0; }
.os-poster { position: relative; aspect-ratio: 9 / 14; border-radius: 16px; overflow: hidden; color: #f6efe0; text-decoration: none; display: flex; flex-direction: column;
  justify-content: flex-end; padding: 16px; cursor: pointer; border: 0; text-align: left; font: inherit; isolation: isolate;
  background: linear-gradient(170deg, var(--p1) -10%, var(--p2) 62%, #070605 100%); box-shadow: 0 14px 34px rgba(0, 0, 0, .22); transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .os-poster:hover { transform: translateY(-3px); box-shadow: 0 20px 44px rgba(0, 0, 0, .3); } }
.os-poster::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55; mix-blend-mode: overlay;
  background: linear-gradient(160deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 45%); }
.os-poster .segs { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; gap: 3px; }
.os-poster .segs i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .28); }
.os-poster .segs i.on { background: #fff; }
.os-poster .gen { position: absolute; top: 24px; left: 14px; font: 700 0.72rem/1.2 var(--font-script); letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.os-poster .tag { position: absolute; top: 22px; right: 12px; }
.os-poster h3 { color: #fff; font: italic 600 1.45rem/1.05 var(--font-display); margin: 0 0 8px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.os-poster p { font-size: .8rem; line-height: 1.4; opacity: .82; margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.os-poster .meta { margin-top: 10px; font: 700 0.72rem/1.2 var(--font-script); letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.os-poster.new { background: transparent; border: 2px dashed var(--c-line); color: var(--c-muted); box-shadow: none; justify-content: center; align-items: center; text-align: center; gap: 8px; }
.os-poster.new::before { display: none; }
.os-poster.new:hover { border-color: var(--c-brand); color: var(--c-brand); }
.os-poster.new .ui-ic { width: 34px; height: 34px; }
.os-poster.new b { font: italic 600 1.2rem/1.2 var(--font-display); }

/* script paper */
.os-paper { background: var(--c-paper); color: var(--c-paper-ink); font: 12pt/1.25 var(--font-script); border-radius: 4px; box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 18px 50px rgba(23, 20, 15, .16); }
.os-scr .scene { font-weight: 700; text-transform: uppercase; margin-top: 1.25em; }
.os-scr .action { margin-top: 1em; }
.os-scr .character { text-transform: uppercase; margin: 1em 0 0 37%; }
.os-scr .paren { margin: 0 0 0 30%; max-width: 40%; }
.os-scr .dialogue { margin: 0 0 0 20%; max-width: 58%; }
.os-scr .transition { text-transform: uppercase; text-align: right; margin-top: 1em; }

/* small shared parts */
.os-dice { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 9px; flex: none; }
.os-meter { height: 6px; border-radius: 4px; background: var(--c-surface-2); overflow: hidden; }
.os-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--c-brand), #e0a526); border-radius: 4px; }
.os-ring { --v: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c-brand) calc(var(--v) * 1%), var(--c-surface-2) 0); }
.os-ring b { width: 60px; height: 60px; border-radius: 50%; background: var(--c-surface); display: grid; place-items: center; font: 600 1.25rem/1 var(--font-display); }
.os-wheel text { font-family: var(--font-body); }
.os-wheel .seg { cursor: pointer; transition: opacity .15s; }
.os-wheel .seg:hover { opacity: .85; }
.os-svg-wrap { width: 100%; overflow-x: auto; }
.os-svg-wrap svg { display: block; width: 100%; height: auto; }
.os-help { font-size: .82rem; color: var(--c-muted); margin: 4px 0 0; }

/* ===== studio (old _studio.html): fields, editors, the project bar ===== */
.pj-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.pj-dot { width: 46px; height: 60px; border-radius: 8px; flex: none; background: linear-gradient(170deg, var(--p1), var(--p2) 70%, #070605); box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.pj-title { flex: 1; min-width: 200px; }
.pj-title input { font: italic 600 clamp(1.5rem, 3vw, 2.1rem)/1.1 var(--font-display) !important; border: 0 !important; background: transparent !important; padding: 2px 0 !important; min-height: 0 !important; box-shadow: none !important; letter-spacing: -.02em; }
.pj-title input:focus { box-shadow: 0 2px 0 var(--c-brand) !important; }
.pj-title .os-tc { display: block; }
.pj-save { font-size: .8rem; color: var(--c-muted); display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.pj-save i { width: 8px; height: 8px; border-radius: 50%; background: var(--c-good); display: inline-block; }
.pj-save.dirty i { background: var(--c-warn); } .pj-save.err i { background: var(--c-bad); } .pj-save.busy i { background: var(--c-accent); animation: os-rec 1s infinite; }
.pj-score { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; color: inherit; font-size: .82rem; }
.pj-score .os-ring { width: 40px; height: 40px; } .pj-score .os-ring b { width: 31px; height: 31px; font-size: .78rem; font-family: var(--font-body); font-weight: 700; }
.pj-tabs { position: sticky; top: var(--header-h); z-index: 30; background: color-mix(in srgb, var(--c-bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); margin-bottom: 20px !important; }
.pj-ro { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--c-accent-soft); margin: 8px 0 14px; font-size: .92rem; }
.pj-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.pj-cols > aside { position: sticky; top: calc(var(--header-h) + 64px); display: grid; gap: 14px; }
.pj-sec-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pj-sec-title h2, .pj-sec-title h3 { margin: 0; }
.os-f { display: block; }
.os-f > .lab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.os-f > .lab b { font-size: .86rem; font-weight: 600; }
.os-f > .lab small { font-size: .76rem; color: var(--c-faint); text-align: right; }
.os-f .row { display: flex; gap: 6px; align-items: flex-start; }
.os-f .row > :first-child { flex: 1; min-width: 0; }
.os-f textarea { min-height: 70px !important; }
.os-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.os-fields .wide { grid-column: 1 / -1; }
.os-pick-list { display: grid; gap: 4px; max-height: 56vh; overflow-y: auto; margin-top: 12px; }
.os-pick-list button { text-align: left; border: 1px solid transparent; background: none; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--c-ink); font: inherit; }
.os-pick-list button:hover { background: var(--c-surface-2); border-color: var(--c-line); }
.os-pick-list b { display: block; font-size: .95rem; }
.os-pick-list span { font-size: .84rem; color: var(--c-muted); display: block; }
.os-pick-list i { font-size: .82rem; color: var(--c-accent); display: block; font-style: normal; margin-top: 2px; }
.os-av { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; color: #fff; font: 700 .82rem/1 var(--font-body); }
.os-av.sm { width: 26px; height: 26px; font-size: 0.72rem; }
.os-av.lg { width: 64px; height: 64px; font-size: 1.25rem; }
.os-avs { display: inline-flex; }
.os-avs .os-av { margin-left: -6px; box-shadow: 0 0 0 2px var(--c-surface); }
.os-avs .os-av:first-child { margin-left: 0; }
.os-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.os-checks label { display: inline-flex; gap: 7px; align-items: center; padding: 6px 10px 6px 6px; border: 1px solid var(--c-line); border-radius: 999px; cursor: pointer; font-size: .86rem; background: var(--c-surface); }
.os-checks label:has(input:checked) { border-color: var(--c-brand); background: var(--c-brand-soft); }
.os-checks input { width: 15px; height: 15px; accent-color: var(--c-brand); margin: 0; }
.os-charge { display: inline-flex; gap: 4px; align-items: center; font: 700 .74rem/1 var(--font-script); padding: 4px 8px; border-radius: 999px; background: var(--c-surface-2); white-space: nowrap; }
.os-charge .p { color: var(--c-good); } .os-charge .n { color: var(--c-bad); } .os-charge .z { color: var(--c-muted); }
.os-head3 { display: grid; grid-template-columns: 130px 1fr 150px; gap: 8px; }
@media (max-width: 980px) { .pj-cols { grid-template-columns: 1fr; } .pj-cols > aside { position: static; } }
@media (max-width: 600px) { .os-fields { grid-template-columns: 1fr; } .os-head3 { grid-template-columns: 1fr 1fr; } .os-head3 > :nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
  .pj-dot { width: 34px; height: 46px; } .pj-title { min-width: 0; flex: 1 1 calc(100% - 60px); } .pj-title input { width: 100% !important; }
  .pj-title .os-tc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
@media print {
  .ui-header, .ui-footer, .ui-tabbar, .pj-bar, .pj-tabs, .pj-ro, .pg-tools, .pg-side, .pg-under, .ui-toasts { display: none !important; }
  html, body { background: #fff !important; }
  .ui-wrap { padding: 0 !important; max-width: none !important; }
  .pg-layout { display: block !important; }
  .pg-paper { box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; width: auto !important; background: #fff !important; }
  .pg-b:empty::before { content: none !important; }
  .pg-b.note { display: none !important; }
}

/* ===== project tabs (old _tab_*.html) ===== */
/* ---- _tab_cast.html */
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cs-card { padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; text-align: left; font: inherit; color: inherit; border: 1px solid var(--c-line); background: var(--c-surface); transition: transform .15s, border-color .15s; }
.cs-card:hover { border-color: var(--c-ink); }
@media (hover: hover) and (pointer: fine) { .cs-card:hover { transform: translateY(-2px); } }
.cs-card .top { display: flex; gap: 12px; align-items: center; }
.cs-card h3 { font: 600 1.15rem/1.2 var(--font-display); margin: 0; overflow-wrap: anywhere; }
.cs-card .want { font-size: .88rem; color: var(--c-muted); margin: 0; }
.cs-card .want b { color: var(--c-ink); font-weight: 600; }
.cs-traits { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.cs-traits div { text-align: center; font: 700 0.72rem/1 var(--font-script); color: var(--c-muted); }
.cs-traits i { display: block; height: 4px; border-radius: 2px; background: var(--c-surface-2); margin-top: 4px; overflow: hidden; }
.cs-traits i b { display: block; height: 100%; background: var(--c-brand); }
.cs-add { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.cs-missing { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border: 1px dashed var(--c-line); border-radius: var(--radius-sm); margin-bottom: 18px; font-size: .92rem; }
.ce-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.ce-head .name { flex: 1; min-width: 220px; }
.ce-head .name input { font: 600 1.7rem/1.1 var(--font-display) !important; border: 0 !important; background: transparent !important; padding: 0 !important; min-height: 0 !important; box-shadow: none !important; }
.ce-sec { padding: 20px; }
.ce-sec + .ce-sec { margin-top: 16px; }
.ce-sec h3 { display: flex; gap: 8px; align-items: center; }
.ce-chain { font-size: .84rem; color: var(--c-muted); margin: -4px 0 14px; }
.ce-slider { display: grid; grid-template-columns: 1fr; gap: 2px; margin-bottom: 12px; }
.ce-slider .l { display: flex; justify-content: space-between; font-size: .85rem; }
.ce-slider .l b { font-weight: 600; }
.ce-slider .ends { display: flex; justify-content: space-between; font-size: .72rem; color: var(--c-faint); gap: 10px; }
.ce-slider input { width: 100%; accent-color: var(--c-brand); }
.ce-persona { display: grid; grid-template-columns: 1fr 200px; gap: 16px; align-items: center; }
.ce-read { font: italic 500 1rem/1.45 var(--font-display); margin: 6px 0 0; }
.ce-events { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ce-events button { border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-ink); border-radius: 999px; padding: 7px 12px; font: 500 .84rem/1 var(--font-body); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.ce-events button.on { background: var(--c-night); color: var(--c-night-ink); border-color: var(--c-night); }
.ce-events .ui-ic { width: 14px; height: 14px; }
.ce-react { display: grid; gap: 10px; }
.ce-react .r { display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--c-surface-2); }
.ce-react .r:first-child { background: var(--c-night); color: var(--c-night-ink); }
.ce-react .r:first-child .why { color: #b5aa97; }
.ce-react .pct { font: 600 1.3rem/1 var(--font-display); }
.ce-react .t { font-weight: 600; }
.ce-react .why { font-size: .8rem; color: var(--c-muted); margin-top: 3px; }
.ce-rels { display: grid; gap: 8px; }
.ce-rel { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); cursor: pointer; background: var(--c-surface); text-align: left; font: inherit; color: inherit; width: 100%; }
.ce-rel .sw { width: 6px; align-self: stretch; border-radius: 3px; }
.ce-rel .grow { flex: 1; min-width: 0; font-size: .88rem; }
.ce-rel .grow b { display: block; font-size: .93rem; }
.ce-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ce-chips a { font: 700 .74rem/1 var(--font-script); padding: 6px 9px; border-radius: 7px; background: var(--c-surface-2); color: var(--c-ink); text-decoration: none; }
@media (max-width: 600px) { .ce-persona { grid-template-columns: 1fr; } .ce-persona svg { max-width: 220px; margin: 0 auto; } .ce-sec { padding: 18px 16px; } }

/* ---- _tab_chrono.html */
.ch-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.ch-line { position: relative; padding-left: 34px; display: grid; gap: 10px; }
.ch-line::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--c-line); }
.ch-ev { position: relative; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; }
.ch-ev::before { content: ""; position: absolute; left: -29px; top: 18px; width: 14px; height: 14px; border-radius: 50%; background: var(--c-ink); border: 3px solid var(--c-bg); box-shadow: 0 0 0 2px var(--c-ink); }
.ch-ev.backstory::before { background: var(--c-bg); }
.ch-ev.offscreen::before { background: var(--c-accent); box-shadow: 0 0 0 2px var(--c-accent); }
.ch-ev .when { font: 700 .72rem/1.2 var(--font-script); letter-spacing: .1em; text-transform: uppercase; color: var(--c-brand); }
.ch-ev h3 { margin: 4px 0; font-size: 1.05rem; font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }
.ch-ev p { margin: 0; font-size: .9rem; color: var(--c-muted); }
.ch-ev .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.ch-ev .shown a { font: 700 .72rem/1 var(--font-script); padding: 5px 8px; border-radius: 6px; background: var(--c-brand-soft); color: var(--c-brand); text-decoration: none; }
.ch-ev .moves { display: grid; gap: 4px; }
.ch-ev .moves .ui-btn { width: 32px; min-height: 30px; height: 30px; padding: 0; border-radius: 8px; }
.ch-ev .no { font: 700 0.72rem/1 var(--font-script); color: var(--c-faint); }
.ch-lanes { overflow-x: auto; border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-surface); }
.ch-lanes table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .86rem; }
.ch-lanes th, .ch-lanes td { padding: 8px 10px; border-bottom: 1px solid var(--c-line); text-align: center; }
.ch-lanes th:first-child, .ch-lanes td:first-child { text-align: left; position: sticky; left: 0; background: var(--c-surface); min-width: 200px; }
.ch-lanes thead th { font-size: .76rem; vertical-align: bottom; }
.ch-lanes .dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.ch-lanes td .w { font: 700 0.72rem/1 var(--font-script); color: var(--c-brand); display: block; margin-bottom: 2px; }

/* ---- _tab_overview.html */
.ov-card { padding: 22px; }
.ov-card + .ov-card { margin-top: 16px; }
.ov-builder { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; background: var(--c-surface-2); border-radius: var(--radius-sm); padding: 14px; margin: 12px 0; }
.ov-builder span { font: 700 0.72rem/1 var(--font-script); letter-spacing: .1em; text-transform: uppercase; color: var(--c-muted); text-align: right; }
.ov-builder input { min-height: 38px !important; padding: 7px 10px !important; font-size: .93rem !important; }
.ov-preview { font: italic 500 1.08rem/1.5 var(--font-display); margin: 0 0 10px; }
.ov-checks { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ov-structs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.ov-structs button { text-align: left; border: 1px solid var(--c-line); background: var(--c-surface); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; color: var(--c-ink); font: inherit; }
.ov-structs button b { display: block; font-size: .92rem; }
.ov-structs button small { color: var(--c-muted); font-size: .76rem; }
.ov-structs button.on { border-color: var(--c-brand); background: var(--c-brand-soft); }
.ov-viz { max-width: 420px; margin: 0 auto; }
.ov-viz.bar { max-width: none; }
.ov-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.ov-swatches button { width: 34px; height: 44px; border-radius: 7px; border: 2px solid transparent; cursor: pointer; background: linear-gradient(170deg, var(--p1), var(--p2)); }
.ov-swatches button.on { border-color: var(--c-ink); box-shadow: 0 0 0 2px var(--c-bg) inset; }
.ov-doc .head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.ov-doc .head h3 { margin: 0 0 2px; }
.ov-doc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ov-doc li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; font-size: .88rem; align-items: start; }
.ov-doc li .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.ov-doc li.bad .dot { background: var(--c-bad); } .ov-doc li.warn .dot { background: var(--c-warn); } .ov-doc li.tip .dot { background: var(--c-accent); } .ov-doc li.good .dot { background: var(--c-good); }
.ov-doc li a { font-weight: 600; font-size: .82rem; margin-left: 4px; white-space: nowrap; }
.ov-doc li .area { font: 700 0.72rem/1 var(--font-script); letter-spacing: .1em; text-transform: uppercase; color: var(--c-faint); margin-right: 4px; }
.ov-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ov-stats div b { display: block; font: 600 1.5rem/1.1 var(--font-display); }
.ov-stats div span { font-size: .78rem; color: var(--c-muted); }
@media (max-width: 600px) { .ov-structs { grid-template-columns: 1fr 1fr; } .ov-builder { grid-template-columns: 1fr; } .ov-builder span { text-align: left; } .ov-card { padding: 18px 16px; } }

/* ---- _tab_pages.html */
.pg-tools { position: sticky; top: calc(var(--header-h) + 50px); z-index: 25; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px; margin-bottom: 14px;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pg-types { display: flex; gap: 2px; flex-wrap: wrap; }
.pg-types button { border: 0; background: none; color: var(--c-muted); padding: 7px 9px; border-radius: 8px; cursor: pointer; font: 600 .78rem/1 var(--font-body); }
.pg-types button:hover { background: var(--c-surface-2); color: var(--c-ink); }
.pg-types button.on { background: var(--c-ink); color: var(--c-bg); }
.pg-tools .grow { flex: 1; }
.pg-sugg { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 30px; margin: -4px 0 12px; font-size: .8rem; color: var(--c-muted); }
.pg-sugg button { border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-ink); border-radius: 999px; padding: 5px 10px; cursor: pointer; font: 700 .74rem/1 var(--font-script); }
.pg-sugg button:hover { border-color: var(--c-brand); color: var(--c-brand); }
.pg-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
.pg-side { position: sticky; top: calc(var(--header-h) + 120px); max-height: calc(100vh - var(--header-h) - 140px); overflow-y: auto; font-size: .84rem; }
.pg-side h4 { font: 700 0.72rem/1.2 var(--font-script); letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); margin: 0 0 8px; }
.pg-side a { display: block; padding: 6px 8px; border-radius: 7px; color: var(--c-ink); text-decoration: none; font: 700 .72rem/1.3 var(--font-script); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-side a:hover { background: var(--c-surface-2); }
.pg-side a span { color: var(--c-faint); margin-right: 6px; }
.pg-paper { max-width: 720px; margin: 0 auto; padding: 64px 70px 80px 96px; min-height: 60vh; position: relative; }
.pg-titlepage { text-align: center; padding: 10px 0 40px; margin-bottom: 30px; border-bottom: 1px dashed rgba(0,0,0,.15); }
.pg-titlepage b { display: block; font-size: 1.15em; text-transform: uppercase; text-decoration: underline; margin-bottom: 14px; }
.pg-b { position: relative; outline: none; border-radius: 3px; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.25em; padding: 0 2px; margin-left: -2px; caret-color: #c8102e; }
.pg-b:focus { background: rgba(224, 165, 38, .14); }
.pg-b:empty::before { content: attr(data-ph); color: rgba(27, 24, 19, .32); pointer-events: none; }
.pg-b:focus::after { content: attr(data-label); position: absolute; left: -92px; top: 1px; width: 80px; text-align: right; font: 700 9px/1.6 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: #b7811a; pointer-events: none; }
.pg-b.scene { font-weight: 700; text-transform: uppercase; margin-top: 1.6em; }
.pg-b.scene:first-of-type { margin-top: 0; }
.pg-b.action { margin-top: 1em; }
.pg-b.character { text-transform: uppercase; margin: 1em 0 0 38%; }
.pg-b.paren { margin-left: 30%; max-width: 38%; }
.pg-b.dialogue { margin-left: 17%; max-width: 62%; }
.pg-b.transition { text-transform: uppercase; text-align: right; margin-top: 1em; }
.pg-b.shot { text-transform: uppercase; margin-top: 1em; }
.pg-b.note { margin: .8em 0 0; font: 500 .82rem/1.45 var(--font-body); background: rgba(224, 165, 38, .2); padding: 6px 10px; border-radius: 6px; color: #5a4310; }
.pg-b.note:focus { background: rgba(224, 165, 38, .26); }
.pg-under { max-width: 720px; margin: 18px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pg-under table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.pg-under td { padding: 5px 0; border-bottom: 1px solid var(--c-line); }
.pg-under td:last-child { text-align: right; color: var(--c-muted); }
.pg-stat { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--c-muted); align-items: center; }
.pg-stat b { color: var(--c-ink); font: 600 1rem/1 var(--font-display); margin-right: 3px; }
.pg-blank { text-align: center; padding: 30px 10px; font-family: var(--font-body); }
.pg-blank h3 { font: italic 600 1.6rem/1.2 var(--font-display); color: var(--c-paper-ink); }
.pg-blank p { color: #6d6455; }
@media (max-width: 1000px) { .pg-layout { grid-template-columns: 1fr; } .pg-side { display: none; } }
@media (max-width: 700px) {
  .pg-paper { padding: 30px 16px 40px; font-size: 10.5pt; }
  .pg-b:focus::after { display: none; }
  .pg-b.character { margin-left: 30%; } .pg-b.paren { margin-left: 18%; max-width: 64%; } .pg-b.dialogue { margin-left: 8%; max-width: 84%; }
  .pg-tools { top: calc(var(--header-h) + 46px); } .pg-types button { padding: 6px 7px; font-size: .72rem; }
  .pg-under { grid-template-columns: 1fr; }
}

/* ---- _tab_story.html */
.st-viz { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-bottom: 18px; }
.st-viz .ui-card { padding: 16px 18px; }
.st-viz h3 { font-size: 1rem; margin-bottom: 2px; }
.st-shape { font: italic 600 1.15rem/1.2 var(--font-display); color: var(--c-brand); }
.st-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .76rem; color: var(--c-muted); margin-top: 6px; }
.st-legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.st-bar { margin-bottom: 18px; }
.st-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.st-beat { margin-bottom: 14px; border-radius: var(--radius); padding: 14px; border: 1px solid var(--c-line); background: color-mix(in srgb, var(--c-surface) 55%, transparent); scroll-margin-top: calc(var(--header-h) + 60px); }
.st-beat.over { border-color: var(--c-brand); background: var(--c-brand-soft); }
.st-beat.focus { box-shadow: 0 0 0 3px var(--c-brand); }
.st-beat > header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.st-beat > header h3 { margin: 0; font-size: 1.12rem; }
.st-beat > header .os-tc { display: block; margin-bottom: 3px; }
.st-beat > header p { margin: 3px 0 0; font-size: .85rem; color: var(--c-muted); }
.st-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.st-card { position: relative; padding: 12px 14px 12px; border-radius: 12px; background: var(--c-surface); border: 1px solid var(--c-line); cursor: pointer; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.st-card:hover { border-color: var(--c-ink); }
.st-card.dragging { opacity: .4; }
.st-card.drop { box-shadow: -4px 0 0 var(--c-brand); }  /* design-ok: hard-offset-shadow (drop marker while dragging) */
.st-card .n { font: 700 0.72rem/1 var(--font-script); color: var(--c-muted); display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.st-card .hd { font: 700 .78rem/1.3 var(--font-script); text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; }
.st-card .sm { font-size: .86rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.st-card .ft { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; padding-top: 4px; }
.st-card .flags { display: flex; gap: 4px; flex-wrap: wrap; }
.st-card .flag { font: 700 0.72rem/1 var(--font-script); letter-spacing: .06em; text-transform: uppercase; padding: 4px 6px; border-radius: 5px; background: var(--c-brand-soft); color: var(--c-brand); }
.st-card .flag.ff { background: color-mix(in srgb, #7b4bd6 18%, transparent); color: color-mix(in srgb, #7b4bd6 60%, var(--c-ink)); }
.st-card .flag.ok { background: var(--c-good-soft); color: var(--c-good); }
.st-card .mv { display: flex; gap: 2px; }
.st-card .mv button { border: 0; background: none; color: var(--c-muted); width: 24px; height: 22px; border-radius: 6px; cursor: pointer; padding: 0; display: grid; place-items: center; }
.st-card .mv button:hover { background: var(--c-surface-2); color: var(--c-ink); }
.st-card .mv .ui-ic { width: 15px; height: 15px; }
.st-empty { border: 1px dashed var(--c-line); border-radius: 12px; padding: 12px 14px; font-size: .86rem; color: var(--c-muted); }
.st-empty .ideas { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.st-add { border: 1px dashed var(--c-line); background: none; border-radius: 12px; color: var(--c-muted); cursor: pointer; font: 600 .86rem/1 var(--font-body); display: flex; gap: 6px; align-items: center; justify-content: center; min-height: 64px; }
.st-add:hover { border-color: var(--c-brand); color: var(--c-brand); }
.st-plants { display: grid; gap: 10px; }
.st-plant { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px 10px; padding: 12px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-surface); align-items: end; }
.st-plant label { display: grid; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--c-muted); }
.st-plant input, .st-plant select { min-height: 38px !important; padding: 7px 10px !important; font-size: .9rem !important; }
@media (max-width: 860px) { .st-viz { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .st-plant { grid-template-columns: 1fr; } .st-cards { grid-template-columns: 1fr; } .st-beat { padding: 12px 10px; } }

/* ---- _tab_web.html */
.wb-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.wb-tools .ui-btn.on { background: var(--c-brand); color: var(--c-brand-ink); border-color: var(--c-brand); }
.wb-canvas { position: relative; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden;
  background-image: radial-gradient(var(--c-line) 1px, transparent 1px); background-size: 22px 22px; touch-action: none; }
.wb-canvas svg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.wb-canvas .node { cursor: grab; }
.wb-canvas .node.drag { cursor: grabbing; }
.wb-canvas .node text { pointer-events: none; }
.wb-canvas .edge { cursor: pointer; }
.wb-canvas .edge:hover .ln { stroke-opacity: 1; }
.wb-hint { position: absolute; left: 12px; bottom: 10px; font-size: .78rem; color: var(--c-muted); background: var(--c-surface); padding: 4px 8px; border-radius: 6px; }
.wb-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: .8rem; color: var(--c-muted); }
.wb-legend span { display: inline-flex; gap: 6px; align-items: center; }
.wb-legend i { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }
.wb-list { display: grid; gap: 8px; }
.wb-row { display: grid; grid-template-columns: 6px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px 10px 0; border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-surface); cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; overflow: hidden; }
.wb-row .sw { align-self: stretch; }
.wb-row b { font-size: .93rem; }
.wb-row .feel { display: block; font-size: .82rem; color: var(--c-muted); }
.wb-hot { display: grid; gap: 8px; }
.wb-hot div { display: flex; gap: 10px; align-items: center; font-size: .88rem; }
.wb-hot .m { flex: 1; }

/* ===== pages (native Forms, 2026-11-05 facelift: no labels above headings, ruled lists instead of card walls,
   one authored moment on the landing page: the live spark reel) ===== */
.os-meta { font: 700 .74rem/1.3 var(--font-script); letter-spacing: .12em; text-transform: uppercase; color: var(--c-muted); }
.os-night .os-meta { color: #c9bca5; }
.os-tally { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c-brand); margin-right: 7px; vertical-align: 1px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-brand) 25%, transparent); }
.os-label { font: 700 .78rem/1.3 var(--font-script); letter-spacing: .12em; text-transform: uppercase; color: var(--c-muted); margin: 0 0 6px; }
.os-night .os-label { color: #c9bca5; }
.os-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.os-head h1 { margin: 0 0 6px; font-size: clamp(2rem, 4vw, 2.9rem); letter-spacing: -.03em; }
.os-head h1 em { font-style: italic; color: var(--c-brand); font-weight: 500; }
.os-head p { margin: 0; max-width: 60ch; }

/* the spark machine (landing reel + Spark page) */
.sk-title { font: italic 600 clamp(1.7rem, 3.4vw, 2.4rem)/1.08 var(--font-display); margin: 0 0 16px; color: #fff; }
.ui .os-night .sk-title { color: #fff; }
.sk-title .os-chip, .sk-abs .os-chip { color: #fff; }
.sk-abs { font: 400 clamp(1.12rem, 2vw, 1.4rem)/1.65 var(--font-display); color: #efe8da; margin: 0; }
.sk-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 0; font: 700 .74rem/1.3 var(--font-script);
  letter-spacing: .12em; text-transform: uppercase; color: #c9bca5; }
.sk-host.swap .sk-title, .sk-host.swap .sk-abs { animation: sk-swap var(--dur-slow) var(--ease-out); }
@keyframes sk-swap { from { opacity: .25; filter: blur(2px); } }

/* ---- landing */
.page-landing .ui-main { overflow-x: clip; }
.lp-hero { position: relative; padding: 56px 0 40px; }
.lp-hero .ui-wrap { display: grid; grid-template-columns: 1.02fr .98fr; gap: 52px; align-items: center; padding-top: 0; padding-bottom: 0; }
.ui .lp-hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.3rem); line-height: 1.0; margin: 0 0 20px; letter-spacing: -.035em; font-weight: 600; }
.lp-hero h1 em { font-style: italic; color: var(--c-brand); font-weight: 500; }
.lp-lead { font-size: 1.16rem; color: var(--c-muted); max-width: 33em; margin-bottom: 28px; }
.lp-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.lp-proof { margin: 22px 0 0; padding: 0; list-style: none; display: flex; gap: 8px 18px; flex-wrap: wrap; color: var(--c-muted); font-size: .92rem; }
.lp-proof li { display: inline-flex; gap: 6px; align-items: center; }
.lp-proof .ic { color: var(--c-brand); }
.lp-reel { max-width: 470px; margin-left: auto; width: 100%; animation: kit-in var(--dur-hero) var(--ease-expo) both; }
.lp-reel .os-night { padding: 0 26px 22px; box-shadow: 0 30px 60px rgba(14, 13, 12, .3); }
.lp-reel .os-sprocket { margin: 0 -26px 18px; background: radial-gradient(circle at 50% 50%, #0e0d0c 0 3.5px, transparent 4px) 0 0 / 22px 16px repeat-x, #1d1a17; }  /* design-ok: radial-glow (sprocket holes) */
.lp-reel .segs { display: flex; gap: 4px; margin-bottom: 18px; }
.lp-reel .segs i { flex: 1; height: 3px; border-radius: 2px; background: rgba(239, 232, 218, .2); }
.lp-reel .segs i.on { background: #efe8da; }
.lp-reel .segs i.now { background: linear-gradient(90deg, #efe8da 45%, rgba(239, 232, 218, .2) 45%); }
.lp-reel .sk-abs { min-height: 9.5em; font-size: 1.16rem; }
.lp-reel-act { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.lp-reel .hint { font-size: .82rem; color: #b5aa97; margin: 12px 0 0; }
.lp-section { padding: 64px 0; }
.lp-section .ui-wrap { padding-top: 0; padding-bottom: 0; }
.lp-head { max-width: 680px; margin: 0 0 32px; }
.lp-head.c { text-align: center; margin: 0 auto 34px; }
.ui .lp-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -.025em; margin-top: 0; }
.lp-head p { color: var(--c-muted); font-size: 1.08rem; margin: 0; }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: step; }
.lp-steps li { counter-increment: step; padding: 18px; border-top: 3px solid var(--c-brand); background: var(--c-surface); border-radius: 0 0 var(--radius) var(--radius); }
.lp-steps li::before { content: "0" counter(step); display: block; font: 700 .78rem/1 var(--font-script); letter-spacing: .12em; color: var(--c-brand); margin-bottom: 12px; }
.ui .lp-steps h3 { font-size: 1.1rem; margin: 0 0 6px; }
.lp-steps p { color: var(--c-muted); font-size: .93rem; margin: 0; }
.lp-split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 44px; align-items: center; }
.lp-split > .os-night { padding: 26px; }
.lp-wheel { max-width: 380px; margin: 0 auto; }
.lp-quote { font: italic 500 1.32rem/1.45 var(--font-display); margin: 0 0 12px; max-width: 34em; }
.lp-list { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.lp-list li { display: flex; gap: 10px; align-items: flex-start; }
.lp-list .ic { color: var(--c-brand); margin-top: 3px; }
.lp-numbers { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 22px; }
.lp-numbers > div { display: grid; gap: 2px; }
.anvil-role-lp-num, .anvil-role-lp-num .anvil-label-text { font: 600 2rem/1 var(--font-display); color: var(--c-ink); }
.lp-numbers span { font-size: .88rem; color: var(--c-muted); }
.lp-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 44px; }
.lp-feature { display: grid; grid-template-columns: 30px 1fr; gap: 4px 14px; padding: 20px 0; border-top: 1px solid var(--c-line); }
.lp-feature .ic { width: 22px; height: 22px; color: var(--c-brand); grid-row: span 2; margin-top: 4px; }
.ui .lp-feature h3 { margin: 0; font-size: 1.12rem; }
.lp-feature p { color: var(--c-muted); margin: 0; font-size: .95rem; }
.lp-faq { max-width: 780px; margin: 0 auto; display: grid; gap: 10px; }
.lp-faq details { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 4px 20px; }
.lp-faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: "+"; color: var(--c-brand); font-size: 1.3rem; line-height: 1; }
.lp-faq details[open] summary::after { content: "\2013"; }
.lp-faq details p { color: var(--c-muted); margin: 0 0 16px; }
.lp-band { padding: 46px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.ui .lp-band h2 { margin: 0 0 6px; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.lp-band p { margin: 0; color: #c9bca5; }
/* Watch section (the app's YouTube video; nothing loads from YouTube before the click) */
.ytf .ytf-in { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 40px; align-items: center; max-width: 1040px; margin: 0 auto; }
.ui .ytf h2 { margin: 0 0 10px; display: flex; gap: 12px; align-items: center; }
.ytf .ytf-copy p { color: var(--c-muted); margin: 0 0 16px; }
.ytf .ytf-link { font-weight: 700; }
.ytf .ytf-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius, 16px); overflow: hidden; background: #000; border: 1px solid var(--c-line); box-shadow: var(--shadow-lg); }
.ytf .ytf-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ytf .ytf-cover { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: inherit; font: inherit; cursor: pointer; display: block; }
.ytf .ytf-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-slow) var(--ease-out), filter var(--dur-base) ease; }
.ytf .ytf-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); line-height: 0; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35)); transition: transform var(--dur-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .ytf .ytf-cover:hover img { transform: scale(1.02); filter: brightness(.92); }
  .ytf .ytf-cover:hover .ytf-play { transform: translate(-50%, -50%) scale(1.08); }
}
.ytf .ytf-cover:focus-visible { outline: 3px solid var(--c-brand); outline-offset: -3px; }
.ytf .ytf-len { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .78); color: #fff; font-size: .78rem; font-weight: 700; line-height: 1.3; padding: 3px 7px; border-radius: 5px; }
.ytf .ytf-note { font-size: .82rem; color: var(--c-muted); margin: 10px 2px 0; }

/* ---- desk (home) */
.dk-top { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; margin-bottom: 36px; }
.dk-prompt { padding: 24px 26px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 200px; }
.anvil-role-dk-quote { font: italic 500 1.35rem/1.4 var(--font-display); color: #f6efe0; }
.dk-continue { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 18px; align-items: center; padding: 18px; }
.ui .dk-continue .dk-h3 { font: italic 600 1.45rem/1.15 var(--font-display); margin: 0 0 4px; letter-spacing: -.01em; }
.dk-next { display: flex; gap: 8px; align-items: flex-start; background: var(--c-surface-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: .9rem; margin: 12px 0; }
.dk-next .ic { color: var(--c-brand); margin-top: 2px; }
.dk-sec { margin-top: 40px; }
.ui .dk-sec h2 { margin: 0; font-size: 1.6rem; }
.dk-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dk-sec-head p { margin: 4px 0 0; }
.anvil-role-os-posters > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 16px; }
.anvil-role-dk-strip > div { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(178px, 210px); gap: 16px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.anvil-role-dk-sparks > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.dk-spark { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; height: 100%; }
.ui .dk-spark h3 { font: italic 600 1.12rem/1.2 var(--font-display); margin: 0; }
.anvil-role-clamp3 { font-size: .9rem; color: var(--c-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dk-continue .os-poster { aspect-ratio: 9 / 14; padding: 10px; }
.dk-continue .os-poster h3 { font-size: 1rem; }
.dk-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
.dk-links a { display: grid; grid-template-columns: 26px 1fr; gap: 2px 12px; padding: 16px 0; border-top: 1px solid var(--c-line); text-decoration: none; color: inherit; }
.dk-links a .ic { width: 22px; height: 22px; color: var(--c-brand); grid-row: span 2; margin-top: 2px; }
.dk-links b { font-weight: 600; }
.dk-links span { font-size: .88rem; color: var(--c-muted); }
@media (hover: hover) and (pointer: fine) { .dk-links a:hover b { color: var(--c-brand); } }
.anvil-role-np-structs > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.anvil-role-np-start > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.np-choice { display: grid; gap: 2px; text-align: left; width: 100%; padding: 11px 13px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-surface);
  color: var(--c-ink); cursor: pointer; font: 500 .95rem/1.3 var(--font-body); min-height: 44px; }
.np-choice small { color: var(--c-muted); font-weight: 400; font-size: .8rem; line-height: 1.3; }
.np-choice.on { border-color: var(--c-brand); background: var(--c-brand-soft); }
.np-field-label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: 6px; }

/* posters as Forms (Items/Poster): the same .os-poster look; Labels inside keep the poster's typography */
.os-poster .anvil-label, .os-poster .anvil-label-text { color: inherit; }
.anvil-role-ps-title { color: #fff; font: italic 600 1.45rem/1.05 var(--font-display); margin: 0 0 8px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.anvil-role-ps-line { font-size: .82rem; line-height: 1.4; opacity: .85; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.anvil-role-ps-meta { margin-top: 10px; font: 700 .72rem/1.2 var(--font-script); letter-spacing: .12em; text-transform: uppercase; opacity: .78; }
.anvil-role-ps-gen { position: absolute; top: 24px; left: 14px; font: 700 .72rem/1.2 var(--font-script); letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.os-poster .ps-sample { position: absolute; top: 22px; right: 12px; background: rgba(255, 255, 255, .18); color: #fff; }
.os-poster.new { width: 100%; }

/* ---- spark */
.sk-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sk-machine { padding: 30px 32px 26px; }
.sk-act { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; align-items: center; }
.sk-act .grow { flex: 1; }
.sk-ctrl { display: grid; gap: 16px; }
.sk-weird { display: grid; gap: 6px; }
.sk-weird > span { display: flex; justify-content: space-between; font-weight: 600; font-size: .9rem; }
.sk-weird input[type=range] { width: 100%; accent-color: var(--c-brand); min-height: 28px; }
.sk-weird .ends { display: flex; justify-content: space-between; font-size: .82rem; color: var(--c-muted); font-style: italic; }
.anvil-role-sk-shapes > div { display: flex; flex-wrap: wrap; gap: 6px; }
.sk-slot { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--c-line); }
.anvil-role-sk-slots > div > :last-child .sk-slot { border-bottom: 0; }
.anvil-role-sk-k { font: 700 .72rem/1.2 var(--font-script); letter-spacing: .12em; text-transform: uppercase; color: var(--c-muted); }
.anvil-role-sk-v { font-size: .92rem; overflow-wrap: anywhere; min-width: 0; }
.sk-become { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.ui h2.sk-h { font: 700 .82rem/1.3 var(--font-script); letter-spacing: .12em; text-transform: uppercase; color: var(--c-muted); margin: 0 0 8px; }
.ui h2.sk-h.sk-theme-h { margin-top: 18px; }
.ui .os-night h2.sk-h { color: #c9bca5; }
.anvil-role-sk-logline { font: italic 500 1.05rem/1.5 var(--font-display); margin-bottom: 10px; }
.sk-circle-li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; font-size: .92rem; padding: 3px 0; }
.sk-circle-li .n { font: 700 .82rem/1.5 var(--font-script); color: var(--c-brand); }
.sk-who { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.sk-who .ui-avatar { color: #fff; }
.sk-who-line { font-size: .88rem; color: var(--c-muted); }
.anvil-role-sk-history > div { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.sk-hist { flex: none; max-width: 220px; text-align: left; border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-ink); border-radius: 12px; padding: 10px 12px; cursor: pointer; font: 500 .86rem/1.3 var(--font-body); }
.sk-hist em { display: block; font: italic 600 .95rem/1.2 var(--font-display); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anvil-role-sk-vault > div { display: grid; gap: 10px; }
.ui .sk-vault-item h3 { font: italic 600 1.15rem/1.2 var(--font-display); margin: 0 0 4px; }
.sk-vault-item .acts { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.anvil-role-btn-on > button { background: var(--c-brand-soft) !important; color: var(--c-brand) !important; border-color: var(--c-brand) !important; }
.anvil-role-btn-chip > button { min-height: 34px; padding: 7px 12px; font: 500 .86rem/1 var(--font-body); border-radius: 999px; }
.anvil-role-btn-chip.anvil-role-btn-on > button { background: var(--c-ink) !important; color: var(--c-bg) !important; border-color: var(--c-ink) !important; }
.anvil-role-btn-sq > button { width: 34px; min-height: 34px; height: 34px; padding: 0; border-radius: 8px; }

/* ---- ideas */
.id-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.id-nav { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 14px; }
.ui .id-nav h2 { font: 700 .78rem/1.2 var(--font-script); letter-spacing: .12em; text-transform: uppercase; color: var(--c-muted); margin: 0 0 4px 10px; }
.id-deck { display: flex; gap: 9px; align-items: center; padding: 8px 10px; border-radius: 9px; text-decoration: none; color: var(--c-ink); font-size: .93rem; font-weight: 500; }
.id-deck:hover { background: var(--c-surface-2); }
.id-deck.on { background: var(--c-ink); color: var(--c-bg); }
.id-deck .n { margin-left: auto; font-size: .78rem; opacity: .65; }
.id-deck .ic { width: 16px; height: 16px; }
.id-select { display: none; margin-bottom: 14px; }
.id-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.id-tools .anvil-role-id-q { max-width: 340px; flex: 1 1 220px; }
.anvil-role-id-cards > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.id-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; height: 100%; }
.ui .id-card h3 { font: 600 1.06rem/1.25 var(--font-display); margin: 0; padding-right: 34px; }
.anvil-role-id-d { font-size: .92rem; color: var(--c-muted); }
.anvil-role-id-x { font: italic .9rem/1.4 var(--font-script); color: var(--c-ink); background: var(--c-surface-2); border-radius: 8px; padding: 8px 10px; margin-top: 4px; }
.anvil-role-id-tags { font-size: .78rem; color: var(--c-muted); margin-top: auto; padding-top: 6px; }
.anvil-role-id-deckname { font: 700 .74rem/1.3 var(--font-script); letter-spacing: .1em; text-transform: uppercase; color: var(--c-brand); }
.id-card .anvil-role-btn-copy { position: absolute; top: 10px; right: 10px; }
.id-draw { text-align: center; padding: 18px 8px 6px; animation: id-flip var(--dur-slow) var(--ease-out); }
.ui .id-draw h2 { font: italic 600 2rem/1.15 var(--font-display); margin: 6px 0 14px; padding-right: 0; }
@keyframes id-flip { from { transform: perspective(800px) rotateY(24deg) scale(.97); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .id-draw { animation-name: kit-fade; } .sk-host.swap .sk-title, .sk-host.swap .sk-abs { animation-name: kit-fade; } }

/* ---- learn */
.ln-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 36px; align-items: start; }
.ln-toc { position: sticky; top: calc(var(--header-h) + 18px); display: grid; gap: 2px; }
.ln-toc a { padding: 7px 10px; border-radius: 8px; color: var(--c-muted); text-decoration: none; font-size: .92rem; font-weight: 500; }
.ln-toc a:hover { color: var(--c-ink); background: var(--c-surface-2); }
.ln-toc a.on { color: var(--c-ink); background: var(--c-surface-2); box-shadow: inset 0 -2px 0 var(--c-brand); }
.ln-art { max-width: 780px; }
.ln-sec { padding: 4px 0 48px; scroll-margin-top: calc(var(--header-h) + 14px); }
.ui .ln-sec > h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); letter-spacing: -.025em; margin-top: 0; }
.ln-sec > p, .ln-sec li { font-size: 1.03rem; }
.ln-sec li { margin-bottom: 6px; }
.ui .ln-sec h3 { margin-top: 28px; }
.ln-el { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--c-line); align-items: start; }
.ui .ln-el h4 { margin: 0 0 4px; font-size: 1rem; }
.ln-el p { margin: 0; font-size: .93rem; color: var(--c-muted); }
.ln-page { padding: 26px 30px; font-size: 11pt; max-width: 620px; }
.ln-page .action:first-child, .ln-page .scene:first-child { margin-top: 0; }
.ln-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin: 12px 0 16px; }
.ln-rules div { border-top: 1px solid var(--c-line); padding: 12px 0; font-size: .95rem; }
.ln-rules b { display: block; margin-bottom: 2px; }
.ln-circle { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 26px; align-items: start; }
.ln-circle > .os-night { padding: 18px; }
.ln-step { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--c-line); background: var(--c-surface); }
.anvil-role-ln-step-n { font: italic 600 1.4rem/1.2 var(--font-display); margin: 0 0 4px; }
.ln-struct { margin: 14px 0; padding: 0; }
.ln-struct summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 16px 18px; }
.ln-struct summary::-webkit-details-marker { display: none; }
.ui .ln-struct summary h3 { margin: 0; font-size: 1.2rem; }
.ln-struct summary span { font-size: .88rem; color: var(--c-muted); }
.ln-struct-beats { padding: 0 18px 18px 18px; }
.ln-beat { font-size: .95rem; padding: 4px 0; }
.ln-beat em { color: var(--c-muted); font-style: normal; }
.ln-lesson { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--c-line); }
.ln-lesson .no { font: italic 600 2rem/1 var(--font-display); color: var(--c-brand); }
.ui .ln-lesson h4 { font-size: 1.1rem; margin: 0 0 6px; }
.ln-lesson p { margin: 0 0 8px; font-size: .98rem; }
.ln-lesson .take { font-size: .93rem; background: var(--c-accent-soft); border-radius: 8px; padding: 8px 12px; margin: 0; }
.ln-chain { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
.ln-chain span { padding: 10px 14px; border-radius: 10px; background: var(--c-surface); border: 1px solid var(--c-line); font-weight: 600; }
.ln-chain span small { display: block; font-weight: 400; color: var(--c-muted); font-size: .8rem; }
.ln-chain i { color: var(--c-brand); font-style: normal; font-weight: 700; }
.ln-gloss { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.ln-gloss div { padding: 10px 0; border-bottom: 1px solid var(--c-line); font-size: .95rem; }
.ln-gloss b { display: block; }
.ln-flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: f; }
.ln-flow li { counter-increment: f; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--c-line); }
.ln-flow li::before { content: counter(f); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--c-ink); color: var(--c-bg); font: 700 .95rem/1 var(--font-script); }
.ln-flow b { display: block; }
.ln-flow span { color: var(--c-muted); font-size: .93rem; }

/* ---- project (the workspace shell; the tabs' own look is in the engine section above) */
.pj-tabs a { position: relative; }
.pj-tabs .anvil-role-count { font-size: .75rem; background: var(--c-surface-2); border-radius: 999px; padding: 2px 7px; }
.pj-tabs .anvil-role-count:empty { display: none; }
.anvil-role-pj-title-box { font: italic 600 clamp(1.4rem, 3vw, 2rem)/1.15 var(--font-display) !important; border: 0 !important; background: transparent !important;
  padding: 2px 0 !important; min-height: 0 !important; box-shadow: none !important; width: 100%; color: var(--c-ink); }
.anvil-role-pj-title-box:focus { box-shadow: 0 2px 0 var(--c-brand) !important; }

/* ---- page layouts on phones */
@media (max-width: 980px) { .sk-grid { grid-template-columns: minmax(0, 1fr); } .sk-become { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 960px) { .lp-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .ln-layout { grid-template-columns: minmax(0, 1fr); }
  .ln-toc { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .ln-toc a { white-space: nowrap; }
  .ln-circle { grid-template-columns: minmax(0, 1fr); } .ln-circle > .os-night { max-width: 380px; }
}
@media (max-width: 860px) {
  .lp-hero { padding-top: 30px; }
  .lp-hero .ui-wrap { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .lp-reel { margin: 0 auto; }
  .lp-split { grid-template-columns: minmax(0, 1fr); }
  .lp-band { padding: 30px 22px; }
  .lp-section { padding: 44px 0; }
  .dk-top { grid-template-columns: minmax(0, 1fr); }
  .dk-links { grid-template-columns: minmax(0, 1fr); }
  .id-layout { grid-template-columns: minmax(0, 1fr); } .id-nav { display: none; } .id-select { display: block; }
}
@media (max-width: 800px) { .ytf .ytf-in { grid-template-columns: minmax(0, 1fr); gap: 22px; } }
@media (max-width: 600px) {
  .ln-el { grid-template-columns: minmax(0, 1fr); gap: 8px; } .ln-rules, .ln-gloss { grid-template-columns: minmax(0, 1fr); } .ln-page { padding: 18px 14px; font-size: 10pt; }
  .ln-lesson { grid-template-columns: 38px minmax(0, 1fr); } .ln-lesson .no { font-size: 1.6rem; }
}
@media (max-width: 560px) {
  .lp-steps, .lp-feats { grid-template-columns: minmax(0, 1fr); }
  .lp-reel .os-night { padding: 0 18px 18px; }
  .lp-reel .os-sprocket { margin: 0 -18px 16px; }
  .lp-reel .sk-abs { font-size: 1.06rem; }
  .sk-machine { padding: 22px 18px 18px; } .sk-act > * { flex: 1; } .sk-slot { grid-template-columns: 76px minmax(0, 1fr) auto auto; }
  .anvil-role-np-structs > div, .anvil-role-np-start > div { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .anvil-role-os-posters > div { grid-template-columns: 1fr 1fr; gap: 12px; } .os-poster { padding: 12px; } .anvil-role-ps-title { font-size: 1.15rem; }
  .dk-continue { grid-template-columns: 92px minmax(0, 1fr); gap: 14px; } .anvil-role-dk-strip > div { grid-auto-columns: 46%; }
}

/* ---- contrast fixes on the engine's pieces (WCAG AA, axe) */
.os-av[style*="c-faint"] { color: var(--c-surface); }
.st-card .flag:not(.ff):not(.ok):not([style]) { color: color-mix(in srgb, var(--c-brand) 75%, var(--c-ink)); }

/* ---- design check fixes (design.js, 2026-11-06) */
.lp-faq details p, .ln-sec > p, .ln-sec > ul, .ln-sec > ol:not(.ln-flow) { max-width: 68ch; }
.pj-work .os-help, .pj-work p.small, .pj-work p.muted { max-width: 72ch; }
/* Storyline beats: the beat's letter and position go under its name, not above it */
.st-beat > header > div:first-child { display: flex; flex-direction: column; }
.st-beat > header > div:first-child h3 { order: 0; }
.st-beat > header > div:first-child .os-tc { order: 1; margin: 4px 0 0; }
.st-beat > header > div:first-child p { order: 2; }
.st-card .mv button { width: 28px; height: 28px; }
.pg-types button { min-height: 30px; }
.ui-footer-links a, .ui-footer-links button { padding: 4px 0; }
/* Anvil's own notifications animate everything (transition: all): only fade and move */
.anvil-notification, [data-notify="container"] { transition-property: opacity, transform !important; }
.ytf .ytf-link { display: inline-block; padding: 4px 0; }
.ln-flow b a { display: inline-block; padding: 3px 0; }
.pj-work a.small { display: inline-block; padding: 3px 0; }
.au-links a, .au-card a { display: inline-block; padding: 3px 0; }
.anvil-notification .anvil-close, [data-notify="dismiss"] { min-width: 24px; min-height: 24px; }
.ln-lesson p { max-width: 68ch; }
.dk-start { grid-template-columns: minmax(0, 1fr); }
.os-poster:not(.new) { padding-top: 46px; }
/* line clamp: the Label wrapper is the box, its text must be inline for the clamp to bite */
.anvil-role-ps-line .anvil-label-text, .anvil-role-clamp3 .anvil-label-text { display: inline; }
.anvil-role-ps-line { -webkit-line-clamp: 3; }

/* =====================================================================================================
   Anvil components: the same look through roles (prop:role='["btn", "btn-primary", "ic-wand"]').
   Button = .anvil-button wrapper > button; Link = a; TextBox = input; TextArea = textarea; DropDown = wrapper > select;
   RepeatingPanel = root > items container > item forms (grid rules go on "> div").
   ===================================================================================================== */

/* Anvil buttons: the wrapper is inline, the button inside resets Anvil's own padding and margins */
.anvil-role-btn { display: inline-block; }
.anvil-role-btn > button { margin: 0; }
.anvil-role-btn-block, .anvil-role-btn-block > button { display: flex; width: 100%; }
.anvil-role-btn-icon > button > span, .anvil-role-btn-icon > button .anvil-button-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* the round account button in the header */
.anvil-role-avatar > button { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; background: var(--c-brand);
  color: var(--c-brand-ink); font: 700 .85rem/1 var(--font-body); padding: 0; margin: 0; }

/* text from Label components */
.anvil-role-menu-name { font-weight: 800; }
.anvil-role-menu-email { color: var(--c-muted); font-size: .875rem; }
.anvil-role-fine-print { color: var(--c-muted); font-size: .875rem; }
.anvil-label { padding: 0; margin: 0; }

/* notifications (state.toast) look like the old toasts */
.anvil-notification { background: var(--c-ink); color: var(--c-bg); border: 0; border-radius: 14px; box-shadow: var(--shadow-lg);
  font: 600 1rem/1.4 var(--font-body); }
.anvil-notification.anvil-role-ok { background: var(--c-good); color: var(--c-on-status); }
.anvil-notification.anvil-role-error { background: var(--c-bad); color: var(--c-on-status); }
.anvil-notification .anvil-notification-title { font-weight: 800; }

/* dialogs (alert / confirm with a Form inside) look like the old modals */
.anvil-modal-content { background: var(--c-surface); color: var(--c-ink); border: 1px solid var(--c-line); border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-lg); font: 16px/1.55 var(--font-body); }
.anvil-modal-header { border-bottom: 0; padding: 22px 26px 0; }
.anvil-modal-title { font: 800 1.6rem/1.1 var(--font-display); color: var(--c-ink); }
.anvil-modal-body { padding: 18px 26px 24px; }
.anvil-modal-footer { border-top: 0; padding: 0 26px 22px; }
.anvil-modal-header .anvil-close { color: var(--c-muted); opacity: 1; text-shadow: none; }
@media (max-width: 720px) { .anvil-modal-body { padding: 16px 18px 20px; } .anvil-modal-header { padding: 18px 18px 0; } }

/* ---- shared helpers for the component version */
.anvil-role-contents, .anvil-role-contents > div { display: contents; }
.anvil-role-page-title { font: 800 clamp(1.7rem, 3.4vw, 2.3rem)/1.08 var(--font-display); color: var(--c-ink); margin: 0; letter-spacing: -.005em; }
.anvil-role-sec-title { font: 800 1.6rem/1.08 var(--font-display); color: var(--c-ink); margin: 0; }
.anvil-role-card-title { font: 800 1.3rem/1.08 var(--font-display); color: var(--c-ink); margin: 4px 0 0; }
.anvil-role-faint { color: var(--c-faint); }
.anvil-role-sh-stars { color: #f0a500; letter-spacing: 1px; font-size: .95rem; }
.anvil-role-sh-stars.anvil-role-faint { color: var(--c-faint); letter-spacing: 0; }
.lp-signup { margin: 14px 0 0; }
@media (max-width: 720px) { .anvil-role-sh-shelf > div { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; } }
.ui-empty > .ic { width: 34px; height: 34px; color: var(--c-faint); margin-bottom: 8px; }

/* ---- reading pages, dialogs, profile, admin (component version) */
.anvil-role-bk-title { font: 800 clamp(1.6rem, 3.6vw, 2.3rem)/1.08 var(--font-display); color: var(--c-ink); margin: 2px 0 6px; }
.anvil-role-bk-intro { color: var(--c-muted); margin: 0; }
.anvil-modal-content .ui h2.dlg-h, .anvil-role-dlg-title { font: 800 1.6rem/1.1 var(--font-display); color: var(--c-ink); margin: 0 0 .5em; padding-right: 36px; }
.anvil-modal-content .ui { font: 16px/1.55 var(--font-body); }
.anvil-role-seg > button { font: 800 .85rem/1 var(--font-body); border: 0; background: none; color: var(--c-muted); padding: 8px 13px; border-radius: 999px; cursor: pointer; margin: 0; box-shadow: none; }
.anvil-role-seg.anvil-role-on > button { background: var(--c-accent); color: #2b2350; }
.anvil-role-pf-avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--c-brand-soft); color: var(--c-brand);
  font: 700 1.3rem/1 var(--font-body); }
.anvil-role-pf-title { font: 800 1.8rem/1.08 var(--font-display); color: var(--c-ink); }
.pf-pw { margin-top: 22px; }
.pf-more { margin-top: 16px; }
.anvil-role-strong { font-weight: 800; }
.anvil-role-stat-num { font: 800 2rem/1.1 var(--font-display); color: var(--c-ink); }
.ad-stat { text-decoration: none; color: inherit !important; }
.ad-stat span, .ad-stat .anvil-role-fine-print { color: var(--c-muted); font-size: .9rem; }
.anvil-role-ad-demo-line { margin-top: 18px; }
.ad-filter, .ad-search { margin-bottom: 16px; }
.ad-search .anvil-role-ad-search-box { max-width: 360px; }
.ad-table { display: grid; gap: 8px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--c-line); font-size: .93rem; }
.ad-users-head, .ad-user-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) 90px 90px 90px; }
.ad-lib-head, .ad-lib-row { grid-template-columns: minmax(0, 3fr) 70px 70px 70px; }
.ad-users-head b, .ad-lib-head b { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); }
.anvil-role-ad-email { overflow-wrap: anywhere; }
.ad-fb-actions { margin-top: 10px; }
@media (max-width: 720px) {
  .ad-users-head { display: none; }
  .ad-user-row { grid-template-columns: 1fr 1fr; }
  .ad-lib-head, .ad-lib-row { grid-template-columns: minmax(0, 1fr) 50px 50px 50px; }
}
.anvil-notification.alert-success, .anvil-notification.anvil-notification-success { background: var(--c-good); color: var(--c-on-status); }
.anvil-notification.alert-danger, .anvil-notification.anvil-notification-danger { background: var(--c-bad); color: var(--c-on-status); }

/* The open-source runtime (App Server 1.18) wraps named elements and components in <anvil-dropzone> tags; hosted Anvil
   has dropped them. Make them invisible to layout so child selectors and grids behave the same on both. */
anvil-dropzone { display: contents; }
/* Notifications on the open-source runtime (1.18): Bootstrap-style alerts. Same look as .anvil-notification above. */
[data-notify="container"].anvil-alert { background: var(--c-ink); color: var(--c-bg); border: 2.5px solid var(--c-line); border-radius: 14px;
  box-shadow: var(--shadow); font: 700 1rem/1.4 var(--font-body); padding: 12px 40px 12px 16px; }
[data-notify="container"].anvil-alert-success { background: var(--c-good); color: var(--c-on-status); }
[data-notify="container"].anvil-alert-danger { background: var(--c-bad); color: var(--c-on-status); }
[data-notify="container"].anvil-alert .anvil-close, [data-notify="container"].anvil-alert [data-notify="dismiss"] { color: inherit; opacity: .8; text-shadow: none; }
/* header: the guest buttons stay on one line, the logo never shrinks */
.ui-brand img { flex: none; }
.ui-header-right .ui-row { flex-wrap: nowrap; gap: 8px; }
@media (max-width: 480px) {
  .ui-brand span { font-size: .98rem; line-height: 1.05; }
  .ui-header-right .ui-btn { padding: 8px 11px; min-height: 38px; font-size: .86rem; }
}
.pf-pw { margin-top: 22px !important; }
/* Toast colours win over the plain rule above on both runtimes (hosted: anvil-role-ok/error; App Server 1.18: alert-success/danger). */
:is(.anvil-notification, [data-notify="container"]):is(.anvil-role-ok, .anvil-alert-success) { background: var(--c-good); color: var(--c-on-status); }
:is(.anvil-notification, [data-notify="container"]):is(.anvil-role-error, .anvil-alert-danger) { background: var(--c-bad); color: var(--c-on-status); }
/* Our dialogs: Anvil's normal alert is a 300 px "small" modal; give them the old modal's width. */

/* ---- template pages (component version) */
.lp-art-card { position: relative; display: grid; gap: 12px; padding: 22px; max-width: 460px; margin: 0 auto; }
.lp-art-bar { display: flex; gap: 6px; margin-bottom: 6px; }
.lp-art-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--c-line); display: block; }
.lp-art-row { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius-sm); background: var(--c-surface-2); }
.lp-art-row b { display: block; } .lp-art-row small { color: var(--c-muted); }
.anvil-role-item-list > div { display: grid; gap: 10px; }
.item-title { gap: 8px; }
.anvil-role-item-body { overflow-wrap: anywhere; margin-top: 2px; }
.anvil-role-initials { font: 700 .85rem/1 var(--font-body); color: inherit; }
.nav-link { display: inline-flex; align-items: center; gap: 7px; }
.ui-tabbar .nav-link { display: grid; }
.ui-nav .nav-link.on, .ui-tabbar a.on { }
.anvil-role-dlg-title, .anvil-modal-content .ui h2.dlg-h { font: 700 1.5rem/1.15 var(--font-display); color: var(--c-ink); margin: 0 0 .5em; padding-right: 36px; }

.anvil-modal-content .ui-row.end { margin-top: 18px; }
.anvil-modal-content textarea { width: 100%; }
/* Our dialogs: Anvil's normal alert is a 300 px "small" modal; give them a comfortable width. */
.anvil-modal-dialog.anvil-role-app-dialog.anvil-modal-sm, .anvil-modal-dialog.anvil-role-app-dialog:not(.anvil-modal-lg) { width: min(calc(100vw - 24px), 540px); max-width: none; }
.anvil-modal-dialog.anvil-role-app-dialog.anvil-modal-lg { width: min(calc(100vw - 24px), 780px); max-width: none; }/* badges from Label components: prop:role='["badge"]' (+ "badge-brand", "badge-good", "badge-warn", "badge-bad") */
.anvil-role-badge { display: inline-flex; align-items: center; gap: 5px; font: 600 .75rem/1.3 var(--font-body); padding: 4px 10px; border-radius: 999px;
  background: var(--c-surface-2); color: var(--c-muted); white-space: nowrap; }
.anvil-role-badge.anvil-role-badge-brand { background: var(--c-brand-soft); color: var(--c-brand); }
.anvil-role-badge.anvil-role-badge-good { background: var(--c-good-soft); color: var(--c-good); }
.anvil-role-badge.anvil-role-badge-warn { background: var(--c-warn-soft); color: var(--c-warn); }
.anvil-role-badge.anvil-role-badge-bad { background: var(--c-bad-soft); color: var(--c-bad); }
/* auth page parts made of components */
.anvil-role-au-title { font: 700 1.8rem/1.1 var(--font-display); margin-bottom: 4px; color: var(--c-ink); }
.anvil-role-au-sub { color: var(--c-muted); margin-bottom: 4px; }
.au-pw { position: relative; display: block; }
.au-pw input { padding-right: 70px; }
.anvil-role-au-show { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.anvil-role-au-show > button { border: 0; background: none; color: var(--c-muted); font: 600 .8rem/1 var(--font-body); padding: 8px; cursor: pointer; margin: 0; box-shadow: none; }
.anvil-role-au-google img, .anvil-role-au-google .anvil-component-icon { width: 18px; height: 18px; flex: none; }
.anvil-role-msg-error { background: var(--c-bad-soft); color: var(--c-bad); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .92rem; }
.anvil-role-msg-note { background: var(--c-brand-soft); color: var(--c-ink); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .92rem; }

/* Screen-reader-only text (Label role "sr", or class ui-sr): read out, not shown */
.anvil-role-sr, .ui-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ===== 2026-11-20: PDF export, table read, sprints, writing week, the pages safety net ===== */
/* toasts with an action (Undo) */
.ui-toast.has-act { pointer-events: auto; }
.ui-toast-act { margin-left: auto; flex: none; border: 1px solid currentColor; background: transparent; color: inherit; border-radius: 999px; padding: 6px 12px; min-height: 32px;
  font: 600 .85rem/1 var(--font-body); cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out); }
.ui-toast-act:hover { background: rgba(255, 255, 255, .16); }
.ui-toast-act:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Pages toolbar: labels go icon-only on phones; the sprint chip; the earlier-pages notice; the line being read */
.pg-tools .ui-btn[aria-pressed="true"] { background: var(--c-ink); color: var(--c-bg); border-color: var(--c-ink); }
.pg-sprint { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 3px 4px 3px 12px; border-radius: 999px; background: var(--c-night); color: var(--c-night-ink);
  font: 600 .85rem/1 var(--font-body); font-variant-numeric: tabular-nums; }
.pg-sprint b { font: 700 .95rem/1 var(--font-script); color: #e8b547; min-width: 3.4em; }
.pg-sprint span { color: #c9bca5; }
.pg-sprint button { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 999px; background: rgba(239, 232, 218, .1); color: inherit; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out); }
.pg-sprint button:hover { background: rgba(239, 232, 218, .22); }
.pg-sprint button .ui-ic, .pg-sprint button svg { width: 15px; height: 15px; }
.pg-backup { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: 720px; margin: 0 auto 14px; padding: 10px 12px 10px 14px; border-radius: var(--radius-sm);
  background: var(--c-accent-soft); color: var(--c-ink); font-size: .9rem; }
.pg-backup > svg { flex: none; color: var(--c-accent); }
.pg-backup > span { flex: 1 1 260px; }
.pg-blind { display: block; font: 500 .8rem/1.4 var(--font-body); color: #6d6455; }
.pg-b.reading { background: rgba(200, 16, 46, .09); box-shadow: -10px 0 0 rgba(200, 16, 46, .09), 10px 0 0 rgba(200, 16, 46, .09); }  /* design-ok: hard-offset-shadow (widens the highlight band) */
@media (max-width: 700px) {
  .pg-tools .ui-btn { padding: 6px 9px; }
  .pg-lbl { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Table read: the player bar (fixed; above the phone tab bar) and the Voices dialog */
.tr-bar { position: fixed; z-index: 60; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(calc(100vw - 32px), 640px); display: flex; align-items: center; gap: 6px;
  padding: 8px; border-radius: 18px; background: var(--c-night); color: var(--c-night-ink); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); animation: tr-in var(--dur-base) var(--ease-out); }
@keyframes tr-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.tr-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; min-width: 40px; height: 40px; padding: 0 10px; border: 0; border-radius: 12px;
  background: rgba(239, 232, 218, .08); color: inherit; font: 600 .85rem/1 var(--font-body); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-press) var(--ease-out); }
.tr-btn:hover { background: rgba(239, 232, 218, .18); }
.tr-btn:active { transform: scale(.96); }
.tr-btn:focus-visible, .tr-rate select:focus-visible { outline: 2px solid #e8b547; outline-offset: 2px; }
.tr-btn.tr-main { background: #ef3b4f; color: #160406; min-width: 46px; }
.tr-btn.tr-main:hover { background: #ff5466; }
.tr-btn svg { width: 18px; height: 18px; }
.tr-now { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 0 6px; }
.tr-now b { font: 700 .82rem/1.2 var(--font-script); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-now span { font-size: .78rem; color: #c9bca5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-rate select { height: 40px; min-height: 40px; width: auto; padding: 0 8px; border-radius: 12px; border: 1px solid rgba(239, 232, 218, .2); background: var(--c-night-2); color: var(--c-night-ink);
  font: 600 .85rem/1 var(--font-body); }
.tr-bar .sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.tr-open .ui-footer { padding-bottom: 96px; }
@media (max-width: 720px) {
  .tr-bar { bottom: calc(76px + env(safe-area-inset-bottom)); gap: 4px; padding: 6px; }
  .tr-btn.tr-txt span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tr-btn { min-width: 40px; padding: 0 8px; }
  html.tr-open .ui-footer { padding-bottom: 170px; }
}
@media (prefers-reduced-motion: reduce) { .tr-bar { animation: kit-fade var(--dur-fast) ease; } }
.tr-donly { margin: 4px 0 14px; }
.tr-cast { display: grid; gap: 8px; }
.tr-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) minmax(0, .9fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--c-line);
  border-radius: var(--radius-sm); background: var(--c-surface); }
.tr-who { display: grid; gap: 2px; min-width: 0; }
.tr-who b { font: 700 .85rem/1.2 var(--font-script); letter-spacing: .04em; text-transform: uppercase; overflow-wrap: anywhere; }
.tr-who span { font-size: .8rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-pick select { min-height: 40px; padding: 8px 10px; font-size: .85rem; }
.tr-pitch { display: grid; gap: 2px; font-size: .75rem; color: var(--c-muted); }
.tr-pitch input { width: 100%; accent-color: var(--c-brand); }
.tr-fine { margin-top: 12px; }
.tr-cast .sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 600px) {
  .tr-row { grid-template-columns: minmax(0, 1fr) auto; }
  .tr-row .tr-pick { grid-column: 1 / -1; grid-row: 2; }
  .tr-row .tr-pitch { grid-column: 1 / -1; grid-row: 3; }
}

/* Sprints: the length picker and the "Cut." card */
.sp-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.sp-min { display: grid; gap: 4px; justify-items: center; padding: 18px 8px; border-radius: var(--radius); border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-ink);
  cursor: pointer; transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-press) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }
.sp-min:hover { border-color: var(--c-brand); background: var(--c-brand-soft); }
.sp-min:active { transform: scale(.97); }
.sp-min b { font: 600 2rem/1 var(--font-display); font-variant-numeric: lining-nums; }
.sp-min span { font-size: .85rem; color: var(--c-muted); }
.sp-cut { text-align: center; }
.sp-cut .ui-row { justify-content: center; margin-top: 18px; }
.sp-slate { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--c-night); color: #e8b547; margin-bottom: 8px;
  animation: sp-clap var(--dur-slow) var(--ease-out); }
.sp-slate svg { width: 34px; height: 34px; }
@keyframes sp-clap { from { transform: rotate(-8deg) scale(.9); } to { transform: none; } }
.ui .sp-cut h2 { font: italic 600 2.2rem/1.1 var(--font-display); margin: 0 0 6px; padding-right: 0; }
.sp-sum { font-size: 1.1rem; font-weight: 600; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .sp-slate { animation: none; } }

/* The Export dialog */
.ui-modal.wide.ex-dialog { width: min(100%, 980px); }
.ex-lead { margin-top: -4px; }
.ex-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; margin-top: 16px; align-items: start; }
.ex-form textarea { resize: vertical; min-height: 76px; }
.ex-form .off { opacity: .55; }
.ex-opts { display: grid; gap: 10px; padding-top: 4px; }
.ex-paper { border: 0; padding: 0; margin: 2px 0 0; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.ex-paper legend { float: left; padding: 0; margin-right: 6px; font-weight: 600; font-size: .9rem; }
.ex-paper label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-size: .95rem; }
.ex-paper input { width: 18px; height: 18px; accent-color: var(--c-brand); }
.ex-side { display: grid; gap: 10px; min-width: 0; }
.ex-count { margin: 0; color: var(--c-muted); }
.ex-count b { font: 600 2.2rem/1 var(--font-display); color: var(--c-ink); font-variant-numeric: lining-nums proportional-nums; margin-right: 4px; }
.ui .ex-h { font-size: 1rem; margin: 4px 0 0; }
.ex-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 300px; overflow-y: auto; position: relative; }
.ex-c { display: flex; gap: 9px; align-items: flex-start; font-size: .88rem; line-height: 1.45; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--c-surface-2); }
.ex-c > svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.ex-c.good > svg { color: var(--c-good); }
.ex-c.tip > svg { color: var(--c-accent); }
.ex-c.warn { background: var(--c-warn-soft); } .ex-c.warn > svg { color: var(--c-warn); }
.ex-c.bad { background: var(--c-bad-soft); } .ex-c.bad > svg { color: var(--c-bad); }
.ex-prev { --k: .2; display: flex; gap: 12px; flex-wrap: wrap; padding: 14px; border-radius: var(--radius); background: var(--c-night); justify-content: center; }
.ex-sheet { width: calc(8.5in * var(--k)); height: calc(11in * var(--k)); overflow: hidden; flex: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); background: #fff; }
.ex-sheet > .pr-sheet { transform: scale(var(--k)); transform-origin: 0 0; }
.ex-sheet:has(.pr-a4) { width: calc(210mm * var(--k)); height: calc(297mm * var(--k)); }
.ex-foot { margin-top: 18px; align-items: center; }
.ex-foot .fine-print { margin: 0; flex: 1 1 260px; color: var(--c-muted); font-size: .85rem; }
@media (max-width: 760px) { .ex-grid { grid-template-columns: minmax(0, 1fr); } .ex-checks { max-height: none; } }
@media (max-width: 420px) { .ex-prev { --k: .17; padding: 10px; gap: 8px; } }

/* The printed sheets: Courier 12 pt on 12 pt lines (6 a inch), 1 in top and right, 1.5 in left. Used by the
   export preview and by #os-print, which only exists while the browser prints. */
.pr-sheet { box-sizing: border-box; width: 8.5in; height: 11in; padding: 1in 1in 0 1.5in; position: relative; overflow: hidden; background: #fff; color: #000;
  font: 400 12pt/12pt "Courier Prime", "Courier New", Courier, monospace; font-variant-ligatures: none; text-align: left; }  /* design-ok: overused-font (screenplay pages are Courier by rule) */
.pr-sheet.pr-a4 { width: 210mm; height: 297mm; padding-right: calc(210mm - 7.5in); }
.pr-l { height: 12pt; white-space: pre; position: relative; }
.pr-character, .pr-more { padding-left: 2.2in; }
.pr-dialogue { padding-left: 1in; }
.pr-paren { padding-left: 1.6in; }
.pr-transition { text-align: right; }
.pr-num { position: absolute; top: .5in; right: 1in; }
.pr-a4 .pr-num { right: calc(210mm - 7.5in); }
.pr-sn { position: absolute; top: 0; }
.pr-sn.l { left: -.75in; }
.pr-sn.r { right: -.6in; }
.pr-tt { position: absolute; left: 1.5in; right: 1in; top: 3.5in; text-align: center; }
.pr-a4 .pr-tt { right: calc(210mm - 7.5in); }
.pr-tt div { min-height: 12pt; }
.pr-tt-name { margin-bottom: 24pt; }
.pr-tt-by { margin-bottom: 12pt; }
.pr-tt-contact { position: absolute; left: 1.5in; bottom: 1in; max-width: 3.4in; }
.pr-tt-draft { position: absolute; right: 1in; bottom: 1in; text-align: right; max-width: 3in; }
.pr-a4 .pr-tt-draft { right: calc(210mm - 7.5in); }
#os-print { display: none; }
@media print {
  html.os-printing, html.os-printing body { background: #fff !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; height: auto !important; min-height: 0 !important; }
  html.os-printing body > *:not(#os-print) { display: none !important; }
  html.os-printing #os-print { display: block !important; }
  #os-print .pr-sheet { break-after: page; page-break-after: always; height: 10.98in; }
  #os-print .pr-sheet.pr-a4 { height: 296.5mm; }
  #os-print .pr-sheet:last-child { break-after: auto; page-break-after: auto; }
}

/* The Desk: "Your writing week" (a 28-frame film strip, goal chips, streak) */
.hb-card { margin-bottom: 36px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 28px; align-items: start; }
.ui .hb-card h2 { margin: 0 0 4px; font-size: 1.35rem; }
.hb-card .hb-sub { margin: 0; color: var(--c-muted); font-size: .92rem; }
.hb-stats { grid-column: 1 / -1; display: flex; gap: 22px 32px; flex-wrap: wrap; align-items: baseline; }
.hb-stat { display: grid; gap: 2px; }
.hb-stat b { font: 600 1.9rem/1 var(--font-display); font-variant-numeric: lining-nums proportional-nums; color: var(--c-ink); }
.hb-stat span { font-size: .82rem; color: var(--c-muted); }
.hb-stat.hot b { color: var(--c-brand); }
.hb-film { grid-column: 1 / -1; background: var(--c-night); border-radius: 12px; padding: 0 10px; overflow: hidden; }
.hb-film .os-sprocket { margin: 0 -10px; height: 14px; background: radial-gradient(circle at 50% 50%, var(--c-bg) 0 3px, transparent 3.5px) 0 0 / 18px 14px repeat-x, var(--c-night); }  /* design-ok: radial-glow (sprocket holes) */
.anvil-role-hb-strip > div { display: grid; grid-template-columns: repeat(28, minmax(0, 1fr)); gap: 4px; padding: 6px 0; }
.anvil-role-hb-strip > div > * { width: 100%; min-width: 0; }
.hb-cell { display: block; }
.hb-frame { display: block; aspect-ratio: 3 / 4; border-radius: 3px; border: 1px solid rgba(239, 232, 218, .14);
  background: linear-gradient(to top, rgba(224, 165, 38, .62) calc(var(--f, 0) * 100%), #24201c 0); position: relative; }  /* design-ok: gradient (exposure level of the frame) */
.hb-frame.lv2 { background: #e0a526; border-color: #e0a526; }
.hb-frame.today { outline: 2px solid #ef3b4f; outline-offset: 1px; }
.hb-frame.sp::after { content: ""; position: absolute; top: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #efe8da; }
.hb-frame.lv2.sp::after { background: #160406; }
.hb-legend { grid-column: 1 / -1; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--c-muted); margin-top: -6px; }
.hb-legend i { display: inline-block; width: 10px; height: 13px; border-radius: 2px; vertical-align: -2px; margin-right: 5px; background: #24201c; border: 1px solid var(--c-line); }
.hb-legend i.some { background: linear-gradient(to top, rgba(224, 165, 38, .62) 50%, #24201c 0); }  /* design-ok: gradient (legend swatch) */
.hb-legend i.met { background: #e0a526; border-color: #e0a526; }
.hb-goal { display: grid; gap: 8px; justify-items: end; }
.hb-goal .hb-goal-l { font-size: .82rem; color: var(--c-muted); }
.hb-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.hb-foot { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.hb-foot p { margin: 0; font-size: .9rem; color: var(--c-muted); max-width: 60ch; }
@media (max-width: 720px) {
  .hb-card { grid-template-columns: minmax(0, 1fr); }
  .hb-goal { justify-items: start; } .hb-chips { justify-content: flex-start; }
  .anvil-role-hb-strip > div { grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; }
  .hb-stats { gap: 18px; }
}
