/* Acting Scripts Official - cinematic theme */

:root {
  --black: #0b0b0d;
  --black-2: #131316;
  --black-3: #1c1c21;
  --ink: #f4f1ea;
  --ink-soft: #d9d5cc;
  --ink-muted: #a8a49b;
  --line: #2a2a31;
  --gold: #c9a227;
  --gold-light: #e2c35a;
  --gold-dim: rgba(201, 162, 39, 0.16);
  --red: #b3121f;
  --red-bright: #e0242f;
  --red-dim: rgba(179, 18, 31, 0.18);
  --white: #ffffff;
  --serif: "Playfair Display", "Georgia", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Courier Prime", "Courier New", monospace;
  --radius: 4px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: clamp(48px, 7vw, 88px);
  --measure: 62ch;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0;
  background: var(--black);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(201, 162, 39, 0.10), transparent 60%),
    radial-gradient(ellipse 40% 30% at 100% 100%, rgba(179, 18, 31, 0.10), transparent 60%);
  z-index: 0;
}
main, header, footer { position: relative; z-index: 1; }
main { flex: 1; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.12; margin: 0 0 0.5em; color: var(--white); text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold); font-family: var(--sans); font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--gold-light); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--white); }
img, svg { max-width: 100%; }
ul, ol { padding-left: 1.2em; }
code { font-family: var(--mono); background: var(--black-3); padding: 0.1em 0.4em; border-radius: 3px; font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.wrap { width: min(var(--wrap), 100% - var(--gutter) * 2); margin-inline: auto; }
.narrow { max-width: 720px; }
.muted { color: var(--ink-muted); }
.small { font-size: 0.85rem; }
.gold { color: var(--gold-light); }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--black); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.eyebrow { font-size: 0.76rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 0.9em; }
.eyebrow a { color: inherit; }
.lead { font-size: 1.12rem; line-height: 1.6; color: var(--ink-soft); max-width: var(--measure); text-wrap: pretty; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.72em 1.25em; border-radius: var(--radius); border: 1px solid transparent;
  font: 600 0.86rem var(--sans); letter-spacing: 0.05em; text-transform: uppercase;
  cursor: pointer; transition: transform 0.12s, background 0.15s, color 0.15s, border-color 0.15s; line-height: 1.1;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-bright); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--black); }
.btn-gold:hover { background: var(--gold-light); color: var(--black); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-light); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.5em 0.9em; font-size: 0.76rem; }
.btn.danger, .link-btn.danger { color: var(--red-bright); }
.btn.danger:hover { border-color: var(--red-bright); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 11, 13, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header::after {
  content: ""; display: block; height: 2px;
  background: linear-gradient(90deg, var(--red) 0 30%, var(--gold) 30% 70%, var(--red) 70%);
  opacity: 0.85;
}
.header-inner { display: flex; align-items: center; gap: var(--space-3); height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--white); white-space: nowrap; flex: none; }
.brand-mark { width: 36px; height: 36px; flex: none; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6)); }
.brand-small .brand-mark { width: 30px; height: 30px; }
.brand-text { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; letter-spacing: 0.01em; }
.brand-text em { font-style: italic; color: var(--gold-light); font-weight: 500; }
.brand-small .brand-text { font-size: 1.05rem; }
.site-nav { display: flex; gap: 2px; margin-left: auto; min-width: 0; }
.site-nav a {
  white-space: nowrap; padding: 8px 10px; border-radius: var(--radius); font-size: 0.84rem; font-weight: 500; color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.site-nav a:hover, .site-nav a.active { color: var(--white); background: var(--black-3); }
.site-nav a.active { box-shadow: inset 0 -2px 0 var(--gold); }
.nav-admin { color: var(--gold-light) !important; }
.search-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--gold); width: 40px; height: 40px; border-radius: var(--radius); align-items: center; justify-content: center; cursor: pointer; flex: none; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--ink); width: 40px; height: 40px; border-radius: var(--radius); align-items: center; justify-content: center; cursor: pointer; flex: none; }
.nav-toggle[aria-expanded="true"] { border-color: var(--gold); color: var(--gold-light); }

.header-search { position: relative; display: flex; align-items: center; flex: none; }
.header-search input {
  width: 190px; background: var(--black-2); border: 1px solid var(--line); color: var(--ink);
  padding: 8px 36px 8px 14px; border-radius: 999px; font: 0.88rem var(--sans); transition: width 0.2s, border-color 0.2s;
}
.header-search input:focus { outline: none; border-color: var(--gold); width: 250px; }
.header-search button { position: absolute; right: 6px; background: none; border: 0; color: var(--gold); padding: 4px; cursor: pointer; display: flex; }

/* Live search dropdown */
.live-results {
  position: absolute; top: calc(100% + 6px); right: 0; left: auto; width: min(420px, calc(100vw - var(--gutter) * 2));
  background: var(--black-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  z-index: 60; overflow: hidden;
}
.hero-search .live-results { left: 0; right: 0; width: auto; top: calc(100% + 4px); }
.live-results a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.live-results a:last-child { border-bottom: 0; }
.live-results a:hover, .live-results a.is-active { background: var(--black-3); }
.live-results strong { display: block; font-family: var(--serif); font-size: 1rem; color: var(--white); }
.live-results span { font-size: 0.78rem; color: var(--ink-muted); }
.live-results .live-empty { padding: 12px 14px; color: var(--ink-muted); font-size: 0.85rem; }

/* Flash */
.flash { padding: 10px 0; font-size: 0.9rem; font-weight: 500; }
.flash-success { background: rgba(201, 162, 39, 0.14); color: var(--gold-light); border-bottom: 1px solid var(--gold); }
.flash-error { background: var(--red-dim); color: #ffb3b8; border-bottom: 1px solid var(--red); }
.admin .flash { padding: 10px 16px; border-radius: var(--radius); margin-bottom: 20px; border: 1px solid; }

/* Hero */
.hero {
  padding: var(--space-5) 0 clamp(40px, 6vw, 72px);
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 46px, rgba(255, 255, 255, 0.025) 46px 48px);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 80%);
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: 50%; width: min(520px, 55vw); aspect-ratio: 1;
  transform: translateY(-50%) rotate(6deg);
  background: url("/static/logo.svg") center / contain no-repeat;
  opacity: 0.09; pointer-events: none; filter: saturate(0.6);
}
.hero-inner { max-width: 760px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.6rem, 6.5vw, 4.6rem); margin-bottom: 0.3em; }
.hero .lead { font-size: 1.18rem; }
.hero-search { position: relative; display: flex; gap: 10px; margin: 28px 0 20px; max-width: 620px; }
.hero-search input {
  flex: 1; min-width: 0; background: var(--black-2); border: 1px solid var(--line); color: var(--ink);
  padding: 14px 18px; border-radius: var(--radius); font: 1rem var(--sans);
}
.hero-search input:focus { outline: none; border-color: var(--gold); }
.hero-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; color: var(--ink-muted); font-size: 0.9rem; list-style: none; padding: 0; margin: 0; }
.hero-stats li { display: inline-flex; align-items: center; }
.hero-stats li + li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--red-bright); margin: 0 14px; }
.hero-stats strong { color: var(--gold-light); font-family: var(--serif); font-size: 1.15rem; margin-right: 0.35em; }

/* Sections */
.section-block { padding: clamp(40px, 6vw, 72px) 0; }
.section-block + .section-block { padding-top: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px var(--space-2); margin-bottom: var(--space-3); border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: 12px; }
.section-head h2::before { content: ""; display: inline-block; width: 5px; height: 0.8em; background: var(--red); flex: none; }
.link-more { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; white-space: nowrap; }

.section-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }
.section-tile {
  display: flex; flex-direction: column; gap: 6px; padding: var(--space-3);
  background: var(--black-2); border: 1px solid var(--line); border-top: 2px solid var(--line); border-radius: var(--radius); color: var(--ink);
  transition: border-color 0.2s, transform 0.2s;
}
.section-tile:hover { border-color: var(--gold); transform: translateY(-3px); color: var(--ink); }
.tile-number { font-family: var(--serif); color: var(--red-bright); font-size: 0.9rem; letter-spacing: 0.1em; }
.tile-name { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; color: var(--white); line-height: 1.15; }
.tile-desc { color: var(--ink-muted); font-size: 0.9rem; flex: 1; text-wrap: pretty; }
.tile-count { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); font-weight: 600; margin-top: 6px; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--space-2); }
.card {
  background: var(--black-2); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3);
  display: flex; flex-direction: column; gap: 8px; transition: border-color 0.2s, transform 0.2s; position: relative;
}
.card:hover { border-color: rgba(201, 162, 39, 0.6); transform: translateY(-2px); }
.card-top { display: flex; align-items: center; gap: 8px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; position: relative; z-index: 1; }
.card-section { color: var(--red-bright); }
.card-section:hover { color: var(--white); }
.card-title { margin: 2px 0 0; font-size: 1.3rem; text-wrap: balance; }
.card-title a { color: var(--white); }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card-title a:hover { color: var(--gold-light); }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; font-size: 0.82rem; color: var(--ink-muted); margin: 0; }
.card-meta .meta-genre { color: var(--gold-light); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.72rem; }
.card-meta .meta-genre + .meta-length::before { content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--ink-muted); margin: 0 10px; vertical-align: middle; }
.card-synopsis { color: #cfcbc2; font-size: 0.93rem; line-height: 1.55; flex: 1; margin: 4px 0 6px; text-wrap: pretty; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; line-height: 1.6; }
.badge-gold { background: var(--gold-dim); color: var(--gold-light); border: 1px solid rgba(201, 162, 39, 0.5); }
.badge-red { background: var(--red-dim); color: #ff8b93; border: 1px solid rgba(179, 18, 31, 0.5); }
.badge-muted { background: var(--black-3); color: var(--ink-muted); border: 1px solid var(--line); }

/* Cast tags */
.cast-tags { display: flex; flex-wrap: wrap; gap: 6px; position: relative; z-index: 1; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.03em; border: 1px solid var(--line); background: var(--black-3); color: var(--ink);
  line-height: 1.4; white-space: nowrap;
}
.tag-cast { border-color: rgba(201, 162, 39, 0.5); color: var(--gold-light); }
.tag-gender .times { opacity: 0.6; margin: 0 -2px; }
.tag-f { border-color: rgba(224, 36, 47, 0.55); color: #ff9aa1; }
.tag-m { border-color: rgba(255, 255, 255, 0.35); color: var(--white); }
.tag-any { border-color: rgba(201, 162, 39, 0.4); color: #e6dcb8; }
.tag-topic { background: transparent; color: var(--ink-muted); text-transform: lowercase; font-weight: 500; }
.tag-topic:hover { border-color: var(--gold); color: var(--gold-light); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }

/* Quote band */
.quote-band { background: linear-gradient(180deg, var(--black-2), var(--black)); border-block: 1px solid var(--line); padding: clamp(40px, 6vw, 72px) 0; text-align: center; }
.quote-band blockquote { margin: 0 auto 12px; max-width: 720px; }
.quote-band p { font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 2.6vw, 1.8rem); line-height: 1.35; color: var(--white); margin-bottom: 0.5em; text-wrap: balance; }
.quote-band cite, .footer-quote cite, .quote-card cite { font-style: normal; font-size: 0.76rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.quote-band cite::before, .quote-card cite::before { content: "\2014\00a0"; }

.quote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--space-2); }
.quote-card { margin: 0; padding: var(--space-3); background: var(--black-2); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: var(--radius); }
.quote-card.quote-funny { border-left-color: var(--red-bright); }
.quote-card.quote-craft { border-left-color: var(--white); }
.quote-card p { font-family: var(--serif); font-size: 1.15rem; line-height: 1.45; color: var(--white); text-wrap: pretty; }

/* Lists */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4) clamp(32px, 5vw, 64px); }
.list-titles { list-style: none; padding: 0; margin: 0; }
.list-titles li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-titles a { display: block; font-family: var(--serif); font-size: 1.15rem; color: var(--white); line-height: 1.3; }
.list-titles a:hover { color: var(--gold-light); }
.list-titles .muted { display: block; font-size: 0.8rem; margin-top: 2px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 10px 0 10px 48px; color: var(--ink-soft); text-wrap: pretty; }
.steps li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 10px;
  font-family: var(--serif); color: var(--red-bright); font-size: 1.2rem; font-weight: 700;
}
.steps strong { color: var(--white); }

/* Page head */
.page-head { padding: clamp(36px, 6vw, 72px) 0 clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--black-2), transparent); }
.page-head h1 { margin-bottom: 0.35em; max-width: 30ch; }
.page-head .lead { margin-bottom: 0; }
.page-head .lead + * { margin-top: 1em; }
.result-count { margin: 10px 0 0; font-size: 0.9rem; }

/* Browse */
.browse-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); padding: var(--space-4) 0 var(--space-5); align-items: start; }
.filters { position: sticky; top: 88px; }
.filters-toggle { display: none; width: 100%; margin-bottom: var(--space-2); }
.filter-form { display: flex; flex-direction: column; gap: 14px; background: var(--black-2); border: 1px solid var(--line); padding: 20px; border-radius: var(--radius); }
.filter-group label { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold); font-weight: 600; margin-bottom: 6px; }
.filter-form input, .filter-form select {
  width: 100%; background: var(--black); border: 1px solid var(--line); color: var(--ink); padding: 9px 10px; border-radius: var(--radius); font: 0.9rem var(--sans);
}
.filter-form input:focus, .filter-form select:focus { outline: none; border-color: var(--gold); }
.filter-actions { display: flex; gap: 8px; }
.filter-actions .btn { flex: 1; }
.browse-results .card-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.empty { text-align: center; padding: 60px 20px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h2 { margin-bottom: 0.3em; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: var(--space-4); font-size: 0.9rem; }
.pagination a { font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }

/* Script page */
.script-head .lead { max-width: 66ch; }
.script-facts { display: flex; flex-wrap: wrap; gap: 14px 32px; margin: 20px 0 0; font-size: 0.95rem; }
.script-facts > span > strong { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--gold); margin-bottom: 5px; }
.script-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.script-layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); padding: var(--space-4) 0 var(--space-2); align-items: start; }
.script-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: var(--space-2); }
.side-block { background: var(--black-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.side-block h2 { font-family: var(--sans); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--gold); margin-bottom: 10px; }
.side-block p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.side-tip { border-left: 3px solid var(--red); }
.char-list { list-style: none; padding: 0; margin: 0; }
.char-list li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.char-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.char-list li:first-child { padding-top: 0; }
.char-list strong { display: block; color: var(--white); letter-spacing: 0.04em; }
.char-list span { color: var(--ink-muted); }

/* The paper. A single centered column keeps cues, dialogue, and directions on one rail. */
.script-body {
  --col: 58ch;
  font-family: var(--mono); font-size: 1.05rem; line-height: 1.65;
  background: #f7f3e8; color: #1a1a1a; padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 64px);
  border-radius: var(--radius); box-shadow: var(--shadow); position: relative; max-width: 860px;
}
.script-body::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, var(--red), var(--gold)); border-radius: var(--radius) 0 0 var(--radius);
}
.script-body.large { font-size: 1.25rem; }
.script-body p { margin: 0; }
.script-body .speech, .script-body .sd { width: min(100%, var(--col)); margin-inline: auto; }
.script-body .sd { font-style: italic; color: #555; margin-block: 1.1em; padding-left: 4ch; text-wrap: pretty; }
.script-body .speech { margin-block: 1.4em; }
.script-body .speech + .speech { margin-top: 1.2em; }
.script-body .cue { text-align: center; font-weight: 700; letter-spacing: 0.08em; color: #000; margin-bottom: 0.1em; }
.script-body .paren { text-align: center; font-style: italic; color: #555; margin: 0.05em 0; }
.script-body .line + .line { margin-top: 0.6em; }
.script-body .line + .paren { margin-top: 0.4em; }
.script-end { text-align: center; font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; color: #888; margin-top: 3em !important; }

/* Read as mode and saved scripts */
.script-main { min-width: 0; }
.read-as { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; font-size: 0.86rem; color: var(--ink-soft); }
.read-as label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold); font-weight: 600; }
.read-as select { background: var(--black-2); border: 1px solid var(--line); color: var(--ink); padding: 8px 10px; border-radius: var(--radius); font: 0.9rem var(--sans); min-width: 160px; }
.read-as-check { display: inline-flex; align-items: center; gap: 6px; text-transform: none !important; letter-spacing: 0 !important; color: var(--ink-soft) !important; font-weight: 500 !important; font-size: 0.86rem !important; cursor: pointer; }
.read-as-check input { accent-color: var(--gold); }
.script-body.has-focus .speech { opacity: 0.45; transition: opacity 0.15s; }
.script-body.has-focus .speech.is-mine { opacity: 1; }
.script-body.has-focus .speech.is-mine .cue { color: var(--red); }
.script-body.has-focus .speech.is-mine .cue::after { content: "\00a0\25C0"; color: var(--gold); font-size: 0.7em; }
.script-body.hide-mine .speech.is-mine .line { background: #e8e2d2; color: transparent; border-radius: 3px; cursor: pointer; user-select: none; }
.script-body.hide-mine .speech.is-mine .line.peek { color: inherit; background: #fff3c4; }
.btn-save[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-light); }
.nav-saved span:not(:empty)::before { content: "("; }
.nav-saved span:not(:empty)::after { content: ")"; }
.card-remove { margin-left: auto; background: none; border: 0; color: var(--ink-muted); font: inherit; cursor: pointer; position: relative; z-index: 1; }
.card-remove:hover { color: var(--red-bright); }

/* Submit page */
.submit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(24px, 4vw, 48px); align-items: start; }
.submit-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 6px; margin: 0 0 20px; background: var(--black-2); }
.submit-form legend { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--gold); font-weight: 600; padding: 0 8px; }
.submit-form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.submit-form .field label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold); font-weight: 600; }
.submit-form .field label .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.submit-form input, .submit-form select, .submit-form textarea { width: 100%; background: var(--black); border: 1px solid var(--line); color: var(--ink); padding: 10px 12px; border-radius: var(--radius); font: 0.95rem var(--sans); line-height: 1.5; }
.submit-form textarea.mono { font-family: var(--mono); }
.submit-form input:focus, .submit-form select:focus, .submit-form textarea:focus { outline: none; border-color: var(--gold); }
.submit-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.submit-form .cast-row { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.submit-form .check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.92rem; color: var(--ink-soft); margin: 0 0 18px; cursor: pointer; }
.submit-form .check input { margin-top: 4px; accent-color: var(--gold); flex: none; }
.submit-form .hp { position: absolute; left: -9999px; }
.submit-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: var(--space-2); }
.submit-side ul { margin: 0; padding-left: 1.1em; font-size: 0.9rem; color: var(--ink-soft); }
.submit-side li { margin-bottom: 4px; }
.byline { color: var(--ink-soft); margin: -0.2em 0 0.9em; font-size: 0.95rem; }
.byline strong { color: var(--gold-light); font-weight: 600; }
.editor-card { border-left: 3px solid var(--gold); padding: 4px 0 4px 18px; margin: 0 0 8px; }
.editor-name { font-family: var(--serif); font-size: 1.3rem; color: var(--white); margin-bottom: 0.3em; }
.about-simple p { color: var(--ink-soft); font-size: 1.05rem; max-width: var(--measure); text-wrap: pretty; }
.about-simple .editor-card { margin: 28px 0; }
.about-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.cta-line { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.95rem; }

/* Courses */
.outline li { padding-bottom: 14px; }

/* Prose pages */
.prose h2 { margin-top: 1.5em; font-size: 1.45rem; }
.prose > h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-soft); max-width: var(--measure); text-wrap: pretty; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 8px; }
.prose .tag { vertical-align: middle; margin: 0 2px; }

/* Error page */
.error-page { border-bottom: 0; padding-bottom: var(--space-5); }
.error-page .btn + .btn { margin-left: 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--black-2); margin-top: var(--space-4); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 0.8fr 0.8fr 1.4fr; gap: var(--space-4) var(--space-3); padding: var(--space-5) 0 var(--space-4); }
.site-footer .muted { max-width: 34ch; text-wrap: pretty; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; font-size: 0.9rem; }
.site-footer li a { color: var(--ink-soft); }
.site-footer li a:hover { color: var(--gold-light); }
.footer-quote blockquote { margin: 0; border-left: 2px solid var(--gold); padding-left: 16px; }
.footer-quote p { font-family: var(--serif); font-style: italic; color: var(--white); margin-bottom: 0.4em; text-wrap: pretty; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 16px 0 24px; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--ink-muted); }

/* Forms (shared) */
.form-error { background: var(--red-dim); border: 1px solid var(--red); color: #ffb3b8; padding: 10px 14px; border-radius: var(--radius); font-size: 0.9rem; }

/* Admin login */
.admin-login { display: grid; place-items: center; padding: 24px; }
.login-box { width: min(400px, 100%); background: var(--black-2); border: 1px solid var(--line); border-top: 3px solid var(--red); padding: 36px; border-radius: var(--radius); box-shadow: var(--shadow); }
.login-box h1 { font-size: 1.7rem; margin: 20px 0 16px; }
.login-box .brand-mark { width: 48px; height: 48px; }
.login-box label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold); font-weight: 600; margin: 14px 0 6px; }
.login-box input { width: 100%; background: var(--black); border: 1px solid var(--line); color: var(--ink); padding: 11px 12px; border-radius: var(--radius); font: 1rem var(--sans); }
.login-box input:focus { outline: none; border-color: var(--gold); }
.login-box .btn { margin-top: 22px; }
.login-box .small { margin: 18px 0 0; text-align: center; }

/* Responsive */
@media (max-width: 1200px) {
  .site-nav a { padding: 8px 8px; font-size: 0.8rem; }
  .header-search input { width: 150px; }
  .header-search input:focus { width: 200px; }
}
@media (max-width: 1100px) {
  .section-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; width: 100%; flex-direction: column; order: 3; border-top: 1px solid var(--line); padding: 8px 0; margin: 0; }
  .site-nav.open { display: flex; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 12px; }
  .header-search { order: 1; margin-left: auto; }
  .nav-toggle { order: 2; margin-left: 0; }
}
@media (max-width: 960px) {
  .browse-layout, .script-layout { grid-template-columns: 1fr; }
  .filters, .script-side { position: static; }
  .filters-toggle { display: inline-flex; }
  .filters.is-collapsed .filter-form { display: none; }
  .script-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .script-side .side-tip { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .submit-layout { grid-template-columns: 1fr; }
  .submit-side { position: static; }
}
/* Phone layer. One column, compact spacing, big touch targets, edge-to-edge reading. */
@media (max-width: 720px) {
  :root { --space-3: 20px; --space-4: 32px; }
  body { font-size: 15.5px; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.35rem; }
  .btn { min-height: 44px; }

  /* Header: single sticky row. Search opens under it on demand. */
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 8px; }
  .brand-text { font-size: 1.1rem; }
  .brand-mark { width: 32px; height: 32px; }
  .search-toggle { display: inline-flex; margin-left: auto; order: 1; }
  .nav-toggle { order: 2; }
  .site-nav a { padding: 12px 10px; font-size: 0.95rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a.active { box-shadow: inset 3px 0 0 var(--gold); }
  .header-search { display: none; width: 100%; order: 4; margin: 0; }
  .header-search.open { display: flex; }
  .header-search input, .header-search input:focus { width: 100%; min-height: 44px; border-radius: var(--radius); }
  .live-results { width: 100%; }

  /* Hero */
  .hero { padding: 36px 0 32px; }
  .hero h1 { font-size: 2.5rem; }
  .hero .lead { font-size: 1.02rem; }
  .hero::after { width: 70vw; right: -25vw; opacity: 0.06; }
  .hero-search { flex-direction: column; margin: 22px 0 16px; }
  .hero-search input { min-height: 48px; }
  .hero-stats { font-size: 0.85rem; }
  .hero-stats { gap: 6px 16px; }
  .hero-stats li + li::before { display: none; }

  /* Section tiles become compact rows */
  .section-block { padding: 32px 0; }
  .section-head { margin-bottom: var(--space-2); }
  .section-grid { grid-template-columns: 1fr; gap: 10px; }
  .section-tile { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "num name count" "num desc desc"; column-gap: 14px; row-gap: 2px; align-items: center; padding: 14px 16px; border-top-width: 1px; border-left: 3px solid var(--red); }
  .tile-number { grid-area: num; font-size: 0.85rem; }
  .tile-name { grid-area: name; font-size: 1.2rem; }
  .tile-count { grid-area: count; margin: 0; font-size: 0.7rem; }
  .tile-desc { grid-area: desc; font-size: 0.85rem; }

  /* Cards */
  .card-grid, .browse-results .card-grid { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 18px; gap: 6px; }
  .card-title { font-size: 1.2rem; }
  .card-synopsis { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .two-col { gap: var(--space-4); }

  /* Quote band */
  .quote-band { padding: 36px 0; }

  /* Page heads */
  .page-head { padding: 28px 0 22px; }
  .page-head .lead { font-size: 1rem; }

  /* Browse */
  .browse-layout { padding: 20px 0 48px; gap: 16px; }

  /* Script page */
  .script-facts { gap: 12px 22px; font-size: 0.9rem; }
  .script-actions { margin-top: 20px; gap: 8px; }
  .script-actions .btn { flex: 1 1 calc(50% - 4px); padding-inline: 0.6em; }
  .script-layout { padding: 20px 0 8px; gap: 16px; }
  .script-side { grid-template-columns: 1fr; gap: 10px; }
  .side-block { padding: 14px 16px; }
  .side-block p { font-size: 0.88rem; }
  .char-list li { padding: 6px 0; font-size: 0.86rem; }
  .side-tip { display: none; }
  .script-body { --col: 100%; font-size: 0.92rem; line-height: 1.6; padding: 24px 18px 28px 20px; margin-inline: calc(var(--gutter) * -1); border-radius: 0; max-width: none; }
  .script-body::before { border-radius: 0; width: 4px; }
  .script-body.large { font-size: 1.08rem; }
  .script-body .sd { padding-left: 2ch; margin-block: 0.9em; }
  .script-body .speech { margin-block: 1.1em; }

  .submit-form .field-row, .submit-form .cast-row { grid-template-columns: 1fr 1fr; }
  .submit-form fieldset { padding: 16px 14px 2px; }

  /* Courses and prose */
  .steps li { padding-left: 40px; }

  /* Footer */
  .site-footer { margin-top: var(--space-3); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px 16px; padding: 32px 0 20px; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .footer-quote { display: none; }
  .footer-bottom { flex-direction: column; gap: 4px; padding: 14px 0 20px; }

  .error-page .btn { display: flex; margin: 8px 0 0 !important; }
  .admin-login { padding: 16px; }
  .login-box { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
