/* Movie Musical Generator - one stylesheet, two themes, no inline styles anywhere.
   The palette is deliberately theatrical without being a pastiche: a deep house
   colour, a brass accent for anything that costs money, and a paper tone for the
   pages of text. */

:root {
  --bg: #12100f;
  --panel: #1b1917;
  --panel2: #232019;
  --ink: #f2ece1;
  --ink-dim: #b6ab9a;
  --ink-faint: #8a8072;
  --line: #322d27;
  --brass: #d9a441;
  --brass-dim: #8c6c2c;
  --rose: #c76b6b;
  --sage: #7fa07a;
  --shadow: 0 1px 0 rgba(255,255,255,0.03), 0 10px 30px rgba(0,0,0,0.35);
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: Iowan Old Style, Palatino Linotype, Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

html[data-theme="light"] {
  --bg: #f6f1e7;
  --panel: #fffdf8;
  --panel2: #f2ebdc;
  --ink: #201c17;
  --ink-dim: #5b5245;
  --ink-faint: #857b6c;
  --line: #ddd3c1;
  --brass: #9a6f16;
  --brass-dim: #c9a45c;
  --rose: #a34a4a;
  --sage: #4f7048;
  --shadow: 0 1px 0 rgba(255,255,255,0.6), 0 8px 24px rgba(60,45,20,0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

a { color: var(--brass); }
a:hover { color: var(--ink); }

/* ---- header --------------------------------------------------------------- */

.top {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.brand .back { text-decoration: none; }
.brand .sep { color: var(--ink-faint); }
.brand .name { color: var(--ink); font-weight: 600; letter-spacing: 0.01em; }
.acct { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pill {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-dim); background: var(--bg);
  white-space: nowrap;
}
.pill.link { text-decoration: none; color: var(--brass); }

/* ---- buttons -------------------------------------------------------------- */

button {
  font: inherit; cursor: pointer; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--ink);
  padding: 7px 13px; transition: border-color .12s, background .12s, color .12s;
}
button:hover:not(:disabled) { border-color: var(--brass-dim); }
button:disabled { opacity: .45; cursor: not-allowed; }
.mini { font-size: 13px; padding: 5px 11px; }
.primary {
  background: var(--brass); color: #17130c; border-color: var(--brass);
  font-weight: 640; padding: 10px 20px;
}
html[data-theme="light"] .primary { color: #fffdf8; }
.primary:hover:not(:disabled) { filter: brightness(1.08); }

/* ---- intro ---------------------------------------------------------------- */

.intro { padding: 34px 0 8px; }
h1 {
  font-family: var(--serif); font-size: 40px; line-height: 1.1;
  margin: 0 0 12px; letter-spacing: -0.01em;
}
.lede { font-size: 18px; margin: 0 0 12px; max-width: 68ch; }

/* ---- lanes ---------------------------------------------------------------- */

.lanes { display: flex; gap: 6px; margin: 26px 0 0; flex-wrap: wrap; }
.lane {
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
  border-bottom-color: transparent; background: transparent; color: var(--ink-dim);
}
.lane.active {
  background: var(--panel); color: var(--ink);
  border-color: var(--line); border-bottom-color: var(--panel);
  font-weight: 620;
}

/* ---- panels --------------------------------------------------------------- */

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-top: -1px;
}
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.lab { font-size: 13px; font-weight: 620; color: var(--ink); letter-spacing: .01em; }
.hint { font-size: 12.5px; color: var(--ink-faint); line-height: 1.45; }
textarea, input[type="text"], select {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%;
}
textarea { resize: vertical; min-height: 70px; font-family: var(--sans); }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--brass-dim); outline-offset: 1px; }
.dials {
  display: grid; gap: 14px 18px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.dials .field { margin-bottom: 0; }
.field.narrow { max-width: 110px; }
.field.wide { grid-column: 1 / -1; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.actions input[type="text"] { max-width: 320px; }

.meter {
  font-size: 13px; color: var(--ink-dim); margin: 14px 0 0;
  padding: 9px 12px; border-left: 3px solid var(--brass-dim); background: var(--panel2);
  border-radius: 0 6px 6px 0;
}

/* ---- guard ---------------------------------------------------------------- */

.guard {
  margin-top: 16px; padding: 12px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel2);
}
.guard .block-h { margin: 0 0 8px; font-size: 14px; }

/* The attribute alone is a UA default and loses to any explicit display: rule
 * below. Both of these must outrank every layout rule in this file. */
[hidden], .hidden { display: none !important; }

/* ---- progress ------------------------------------------------------------- */

.progress {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 18px 0 0; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
}
.steps { display: flex; flex-wrap: wrap; gap: 14px; list-style: none; margin: 0; padding: 0; }
.step { font-size: 13px; color: var(--ink-faint); }
.step::before { content: "o "; }
.step.done { color: var(--sage); }
.step.done::before { content: "+ "; }
.step.now { color: var(--brass); font-weight: 620; }
.step.now::before { content: "> "; }
.elapsed { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); margin-left: auto; }

.note { font-size: 14px; color: var(--ink-dim); min-height: 1.4em; margin: 14px 0 0; }
.recovery { font-size: 13px; color: var(--rose); margin: 0 0 10px; }

/* ---- result --------------------------------------------------------------- */

.result { margin-top: 26px; }
.zone:empty { display: none; }
.zone { margin-bottom: 22px; }
.showhead, .numhead { margin-bottom: 20px; }
.showtitle { font-family: var(--serif); font-size: 31px; line-height: 1.15; margin: 0 0 6px; }
.tagline { font-style: italic; color: var(--brass); margin: 0 0 8px; font-size: 16px; }
.logline { font-size: 17px; margin: 0; max-width: 70ch; }
.block {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 16px;
}
.block-h {
  font-size: 12px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--ink-faint); margin: 0 0 10px; font-weight: 700;
}
.para { margin: 0 0 10px; max-width: 74ch; }
.para:last-child { margin-bottom: 0; }
.score { color: var(--ink-dim); font-size: 15px; }
.empty { color: var(--ink-faint); font-style: italic; margin: 0; }

.cast { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cast-row { display: grid; gap: 2px; padding-left: 12px; border-left: 2px solid var(--line); }
.cast-name { font-weight: 660; }
.cast-who { color: var(--ink-dim); font-size: 14.5px; }
.cast-want, .cast-hide { font-size: 13.5px; color: var(--ink-faint); }

.act { margin-bottom: 18px; }
.act:last-child { margin-bottom: 0; }
.act-h { font-family: var(--serif); font-size: 20px; margin: 0 0 4px; }
.act-change { color: var(--brass); font-size: 14.5px; margin: 0 0 8px; }
.beats { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.beat-t { font-weight: 620; display: block; }
.beat-b { color: var(--ink-dim); font-size: 14.5px; }

/* ---- tables --------------------------------------------------------------- */

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 720px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); }
td.num, td.act { font-family: var(--mono); color: var(--ink-faint); white-space: nowrap; }
td.title { font-weight: 620; }
td.fn { color: var(--brass); }
td.change { color: var(--ink-dim); min-width: 220px; }
.flag {
  display: inline-block; margin-left: 6px; font-size: 11px; padding: 1px 6px;
  border-radius: 999px; background: var(--rose); color: #fff; white-space: nowrap;
}
.listhead { margin-bottom: 10px; }
.songs tbody tr:hover { background: var(--panel2); }
.prosody td.mono, .mono { font-family: var(--mono); font-size: 13px; }

/* ---- lyric ---------------------------------------------------------------- */

.lyricsec { margin-bottom: 18px; }
.lyricsec:last-child { margin-bottom: 0; }
.sec-h {
  font-size: 12px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--brass); margin: 0 0 6px; font-weight: 700;
}
.lyriclines { border-left: 2px solid var(--line); padding-left: 14px; }
.lyricline {
  font-family: var(--serif); font-size: 17.5px; line-height: 1.45; margin: 0 0 2px;
}
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px; margin-bottom: 8px; }
.kv-k { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.kv-v { font-size: 14.5px; }

/* ---- findings ------------------------------------------------------------- */

.scan .scanhead { margin-bottom: 10px; }
.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.finding {
  display: grid; grid-template-columns: 72px 1fr; gap: 4px 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
}
.lvl {
  grid-row: 1 / 3; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700; color: var(--ink-faint); padding-top: 2px;
}
.lvl-high { border-left: 3px solid var(--rose); }
.lvl-high .lvl { color: var(--rose); }
.lvl-medium { border-left: 3px solid var(--brass); }
.lvl-medium .lvl { color: var(--brass); }
.lvl-info { border-left: 3px solid var(--line); }
.fx-t { font-weight: 620; font-size: 14.5px; }
.fx-d { color: var(--ink-dim); font-size: 13.5px; }

.shapes { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.shape {
  display: grid; gap: 2px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
}
.shape-id { font-family: var(--mono); font-size: 11.5px; color: var(--brass); }
.shape-line { font-family: var(--serif); font-size: 16px; }
.shape-note { font-size: 12.5px; color: var(--ink-faint); }

/* ---- history and about ---------------------------------------------------- */

.hist { margin-top: 44px; }
.hist h2 {
  font-family: var(--serif); font-size: 22px; margin: 0 0 6px;
}

/* Collapsed disclosures. Everything inside stays in the DOM and stays crawlable;
 * it simply is not standing between a visitor and the first field. */
.disc {
  margin: 12px 0 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
}
.disc:first-of-type { margin-top: 44px; }
.disc > summary {
  cursor: pointer; padding: 12px 16px; font-weight: 620; font-size: 16px;
  font-family: var(--serif);
}
.disc > summary:hover { color: var(--brass); }
.disc[open] > summary { border-bottom: 1px solid var(--line); }
.disc-body { padding: 6px 16px 14px; }
.disc-body p { max-width: 76ch; color: var(--ink-dim); font-size: 15px; }
.scoretable { border-collapse: collapse; margin: 10px 0 14px; font-size: 15px; }
.scoretable th, .scoretable td {
  border: 1px solid var(--line); padding: 6px 12px; text-align: left;
}
.scoretable th { color: var(--ink); font-weight: 620; }
.scoretable td { color: var(--ink-dim); }
.scoretable strong { color: var(--brass); }
.tablewrap { overflow-x: auto; }
.hlist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.hrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
}
.hlane {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-faint); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
}
.htitle { font-weight: 620; }
.hmeta { font-size: 12.5px; color: var(--ink-faint); }
.hmeta.warn { color: var(--rose); }
.hrow button { margin-left: auto; }

/* ---- footer --------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--line); margin-top: 60px; padding: 20px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  font-size: 13px; color: var(--ink-faint); background: var(--panel);
}
.foot .fine { margin-left: auto; max-width: 46ch; }

/* ---- docs pages ----------------------------------------------------------- */

.doc { max-width: 900px; margin: 0 auto; padding: 30px 20px 80px; }
.doc h1 { font-size: 32px; }
.doc h2 { font-family: var(--serif); font-size: 22px; margin: 34px 0 8px; }
.doc h3 { font-size: 16px; margin: 22px 0 6px; }
.doc p, .doc li { max-width: 78ch; }
.doc code {
  font-family: var(--mono); font-size: 13px; background: var(--panel2);
  padding: 1px 5px; border-radius: 4px;
}
pre {
  font-family: var(--mono); font-size: 12.7px; line-height: 1.5;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 13px 15px; overflow-x: auto; margin: 0;
}
.codegroup { margin: 12px 0 20px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tab {
  font-size: 12.5px; padding: 4px 10px; border-radius: 6px;
  background: transparent; color: var(--ink-faint);
}
.tab.active { background: var(--panel2); color: var(--brass); border-color: var(--brass-dim); }
.doc table { min-width: 0; }
.stateBox {
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  padding: 14px 16px; margin: 14px 0;
}
.tokenBox {
  font-family: var(--mono); font-size: 13px; word-break: break-all;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 8px; padding: 11px 13px; margin: 10px 0;
}

@media (max-width: 620px) {
  h1 { font-size: 30px; }
  .showtitle { font-size: 25px; }
  .foot .fine { margin-left: 0; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
}
