/* Lyrics Generator - one stylesheet, both themes.
 *
 * The load-bearing part of this file is the finding colours and the lyric
 * block. A lyric has to read as a lyric - monospaced enough that the syllable
 * column lines up, proportional enough that it is not a spreadsheet - and a
 * high-severity originality finding has to look different from a craft note
 * from across the room, because one of them is a legal question and the other
 * is an opinion about a rhyme. */

:root {
  --bg: #0e0f13;
  --panel: #16181f;
  --panel2: #1c1f28;
  --ink: #e8eaf0;
  --ink-dim: #9aa1b2;
  --line: #272b36;
  --accent: #d8574a;
  --accent-ink: #fff;
  --ok: #4ea87a;
  --warn: #d99a3a;
  --bad: #d8574a;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="light"] {
  --bg: #f7f7f9;
  --panel: #ffffff;
  --panel2: #f1f2f6;
  --ink: #16181f;
  --ink-dim: #5d6474;
  --line: #dfe2ea;
  --accent: #b8392c;
  --ok: #2f7d55;
  --warn: #9a6a12;
  --bad: #b8392c;
}

* { 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-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-dim); margin-bottom: .25em; }
p { margin: 0 0 .8em; }
a { color: var(--accent); }
.muted { color: var(--ink-dim); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.req { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }

/* ---- Header ------------------------------------------------------------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.backlink { text-decoration: none; color: var(--ink-dim); }
.sep { color: var(--line); }
.topactions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.credits { font-variant-numeric: tabular-nums; font-size: .875rem; color: var(--ink-dim); }
.topup { font-size: .875rem; }

/* ---- Buttons ------------------------------------------------------------ */

button { font: inherit; cursor: pointer; border-radius: var(--radius); }
button:disabled { opacity: .5; cursor: not-allowed; }

.primary {
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid var(--accent); padding: 10px 18px; font-weight: 600;
}
.primary:hover:not(:disabled) { filter: brightness(1.08); }
.ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); padding: 8px 14px;
}
.ghost:hover { border-color: var(--ink-dim); }
.big { padding: 12px 18px; font-weight: 600; background: var(--panel2); color: var(--ink); border: 1px solid var(--line); }
.big:hover { border-color: var(--accent); }
button.small, .ghost.small { padding: 6px 12px; font-size: .875rem; }
a.ghost { text-decoration: none; display: inline-block; }

/* ---- Layout blocks ------------------------------------------------------ */

.hero { padding: 40px 0 20px; }
.lede { font-size: 1.05rem; color: var(--ink-dim); max-width: 68ch; }
.lede strong, .lede em { color: var(--ink); }
.herobtns { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 10px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 18px;
}
.panel.free { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }

.freetag {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
  background: color-mix(in srgb, var(--ok) 18%, transparent);
  color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent);
  border-radius: 999px; padding: 2px 8px; margin-left: 8px; vertical-align: middle;
  font-weight: 600;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }

.fieldlabel { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 6px; }
input[type="text"], input[type="search"], select, textarea {
  width: 100%; padding: 10px 12px;
  background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.countrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.countrow select { width: auto; }
.countrow .fieldlabel { margin-bottom: 0; }

.runrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 24px; }
.meter { font-size: .875rem; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.rungate {
  border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px;
}
.rungate a { margin-left: 8px; }
.notice {
  border-left: 3px solid var(--warn); padding: 6px 12px;
  background: color-mix(in srgb, var(--warn) 8%, transparent); border-radius: 4px;
}

/* ---- Chips -------------------------------------------------------------- */

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px; font-size: .8rem;
}
.chiplabel { color: var(--ink-dim); }
.chipval { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- Progress ----------------------------------------------------------- */

.progress {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px;
}
.progresshead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.elapsed { font-variant-numeric: tabular-nums; color: var(--ink-dim); font-size: .875rem; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.step { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink-dim); }
.step .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--line); flex: 0 0 auto;
}
.step.active { color: var(--ink); }
.step.active .dot { background: var(--accent); }
.step.done .dot { background: var(--ok); }

/* ---- Result ------------------------------------------------------------- */

.result { margin-bottom: 24px; }
.resulthead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.genreread {
  border-left: 3px solid var(--accent); padding: 8px 14px; margin-bottom: 18px;
  color: var(--ink-dim); font-style: italic;
}
.block {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
}
.blockhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }

.limits { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.limitnote { font-size: .9rem; }
.limitnote strong { color: var(--ink); }

/* ---- Name cards ---------------------------------------------------------
 * The verdict border is the fastest read on the page. Taken is a hard red bar
 * the eye cannot skip; close is amber; clear is quiet. */

.namezone { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }

.namecard {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
.namecard.v-taken { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 7%, var(--panel)); }
.namecard.v-close { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 6%, var(--panel)); }
.namecard.v-clear { border-left-color: var(--ok); }

.namehead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.thename { font-size: 1.35rem; margin: 0; letter-spacing: -0.01em; }

.verdict {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.verdict.v-taken { background: var(--bad); color: #fff; }
.verdict.v-close { background: var(--warn); color: #1a1300; }
.verdict.v-clear {
  background: transparent; color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent);
}

.collision {
  background: color-mix(in srgb, var(--bad) 10%, transparent);
  border-radius: 6px; padding: 8px 12px; margin: 0 0 10px; font-size: .9rem;
}
.namecard.v-close .collision { background: color-mix(in srgb, var(--warn) 10%, transparent); }

.device { font-size: .82rem; color: var(--ink-dim); margin-bottom: 10px; }
.devlabel { color: var(--accent); font-weight: 600; }
.field { margin-bottom: 10px; }
.field p { margin: 0; font-size: .92rem; }
.risktag { font-size: .78rem; font-weight: 600; }
.risktag.r-high { color: var(--bad); }
.risktag.r-medium { color: var(--warn); }
.risktag.r-low { color: var(--ok); }
.cardactions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---- Findings ----------------------------------------------------------- */

.finding {
  border-left: 3px solid var(--line); padding: 10px 14px; margin-bottom: 10px;
  background: var(--panel2); border-radius: 0 6px 6px 0;
}
.finding.f-critical { border-left-color: var(--bad); }
.finding.f-high { border-left-color: var(--bad); }
.finding.f-medium { border-left-color: var(--warn); }
.finding.f-low { border-left-color: var(--ink-dim); }
.findinghead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.finding p { margin: 0; font-size: .9rem; color: var(--ink-dim); }

.sev {
  font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  border-radius: 4px; padding: 2px 7px;
}
.sev.s-critical { background: var(--bad); color: #fff; }
.sev.s-high { background: color-mix(in srgb, var(--bad) 75%, transparent); color: #fff; }
.sev.s-medium { background: var(--warn); color: #1a1300; }
.sev.s-low { background: var(--line); color: var(--ink-dim); }

/* ---- Free zone / reference check ---------------------------------------- */

.refcheck { margin-top: 12px; }
.refrow { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: .9rem; }
.refname { font-weight: 600; }

/* ---- Standalone checker ------------------------------------------------- */

.checkrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.checkrow input { flex: 1 1 260px; }
.checkout:empty { display: none; }
.checkresult {
  border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.checkresult.v-taken { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 7%, transparent); }
.checkresult.v-close { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 6%, transparent); }
.checkresult.v-clear { border-left-color: var(--ok); }
.checkresult p { font-size: .9rem; margin-bottom: .5em; }

/* ---- History ------------------------------------------------------------ */

.historylist { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.histrow {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; background: var(--panel2);
}
.histhead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.histrow p { margin: 0 0 8px; }

/* ---- Exports, raw, how ---------------------------------------------------*/

.exports { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.raw {
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; overflow-x: auto; font-family: var(--mono); font-size: .85rem;
  white-space: pre-wrap; word-break: break-word;
}
.how { font-size: .95rem; }
.how h3 { margin-top: 1.4em; }
.how p { max-width: 74ch; color: var(--ink-dim); }
.how strong { color: var(--ink); }

/* ---- Footer ------------------------------------------------------------- */

footer {
  border-top: 1px solid var(--line); padding: 28px 20px 48px;
  max-width: 940px; margin: 0 auto; font-size: .9rem; color: var(--ink-dim);
}
footer p { margin: 0 0 .5em; }

/* ---- Toasts ------------------------------------------------------------- */

.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px));
}
.toast {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--ink-dim);
  border-radius: var(--radius); padding: 12px 14px; font-size: .9rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  transition: opacity .5s ease, transform .5s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--bad); }
.toast.gone { opacity: 0; transform: translateY(6px); }
.toast a { margin-left: 8px; }

/* ---- Docs pages (api.html, tokens.html) --------------------------------- */

.doc { max-width: 900px; }
.doc h1 { margin-top: 32px; }
.doc h2 { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }
.doc code {
  font-family: var(--mono); font-size: .88em;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px;
}
.doc pre code { background: none; border: 0; padding: 0; font-size: inherit; }

pre.block, .codegroup pre {
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  overflow-x: auto; font-family: var(--mono); font-size: .84rem;
  line-height: 1.5; margin: 0 0 14px;
}

.codegroup { margin: 0 0 22px; }
.tabs {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: -1px;
}
.tab {
  background: transparent; color: var(--ink-dim);
  border: 1px solid transparent; border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 6px 12px; font-size: .8rem;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] {
  background: var(--panel2); color: var(--ink);
  border-color: var(--line); font-weight: 600;
}
.codegroup pre { border-top-left-radius: 0; }
/* The switcher hides the inactive languages. Without JS every sample shows,
 * which is verbose but correct — the page is still fully readable. */
.codegroup pre[hidden] { display: none; }

.errtable {
  width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: .9rem;
  display: block; overflow-x: auto;
}
.errtable th, .errtable td {
  text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.errtable th { color: var(--ink-dim); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }

.callout {
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: var(--radius); padding: 16px 18px; margin: 20px 0;
}
.callout h3 { margin-top: 0; }
.callout p { margin-bottom: 0; }

/* ---- Wide content must scroll inside itself, never the page ------------- */

pre, table { max-width: 100%; overflow-x: auto; }
img { max-width: 100%; height: auto; }

/* ---------------------------------------------------------------------------
 * Lyrics Generator additions.
 *
 * Every class render.js emits is defined here. A sibling app inherited a
 * stylesheet that did not define 35 of the classes its renderer produced, and
 * the result was unstyled tables sizing to their content and horizontal page
 * overflow at every viewport - which no offline assertion sees and a browser
 * finds in one run. The rule followed here: a class that appears in render.js
 * appears in this file, and every wide thing scrolls inside its own container
 * rather than pushing the page.
 * ------------------------------------------------------------------------ */

.lanes { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 6px; }
.lane {
  background: var(--panel2); color: var(--ink-dim); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 15px; font: inherit; font-size: 14px;
  cursor: pointer;
}
.lane.on { background: var(--panel); color: var(--ink); border-color: var(--accent); font-weight: 600; }
.lane:hover { color: var(--ink); }

.card, .subcard, .panelcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin: 14px 0;
}
.subcard { background: var(--panel2); padding: 12px 14px; }
.subcard:empty { display: none; }
.panelcard h3 { margin: 0 0 10px; font-size: 17px; }
.panelcard h4 { margin: 16px 0 8px; font-size: 14px; color: var(--ink-dim);
  text-transform: uppercase; letter-spacing: .05em; }

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.resultactions { display: flex; gap: 8px; flex-wrap: wrap; }
.hint { margin: 6px 0 0; font-size: 13px; color: var(--ink-dim); }
.checkfield { display: flex; align-items: flex-end; }
.checkfield label { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.more summary { cursor: pointer; color: var(--ink-dim); font-size: 14px; }
.measured { line-height: 1.6; }
.checkout { margin-top: 16px; }
.checkout:empty { display: none; }

/* The lyric block. The rhyme letter and the syllable count are monospaced so
 * they form columns; the line itself is not, because a lyric set in a terminal
 * face reads as data rather than as words. */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.lyric, table.measure { border-collapse: collapse; width: 100%; }
table.lyric td { padding: 4px 8px; vertical-align: baseline; border: 0; }
.rhymecell {
  font-family: var(--mono); font-size: 12px; color: var(--ink-dim);
  width: 2.2em; text-align: center; opacity: .85;
}
.linecell { font-size: 16.5px; line-height: 1.55; }
.syllcell {
  font-family: var(--mono); font-size: 12px; color: var(--ink-dim);
  text-align: right; white-space: nowrap; width: 6.5em;
}
.syllcell.lowconf { color: var(--warn); }
.syllcell.gapcell { color: var(--bad); font-weight: 600; }
.lyricrow:hover { background: var(--panel2); }

.songsec { margin: 0 0 22px; }
.sechead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 8px; }
.sechead h3 { margin: 0; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.secmeta { display: flex; gap: 6px; flex-wrap: wrap; }
.secfn { margin: 0 0 8px; color: var(--ink-dim); font-size: 14px; font-style: italic; }
.chip {
  font-family: var(--mono); font-size: 11px; color: var(--ink-dim);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px; white-space: nowrap;
}
.chip.warnchip { color: var(--warn); border-color: var(--warn); }

table.measure th, table.measure td {
  padding: 5px 10px; text-align: left; font-size: 14px;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
table.measure th { color: var(--ink-dim); font-weight: 500; width: 46%; }

/* Findings. Severity has to be legible from across the room, because a high
 * originality finding is a legal question and a low craft note is an opinion
 * about a rhyme, and they must never look alike. */
.findings { margin: 0; }
.findhead { display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 18px 0 8px; }
.findhead:first-child { margin-top: 0; }
.findhead h3 { margin: 0; font-size: 16px; }
.verdict { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); white-space: nowrap; }
.verdict.v-none { color: var(--ok); border-color: var(--ok); }
.verdict.v-low { color: var(--ink-dim); }
.verdict.v-medium { color: var(--warn); border-color: var(--warn); }
.verdict.v-high { color: var(--accent-ink); background: var(--bad); border-color: var(--bad); }

.findlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.finding { background: var(--panel2); border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: 8px; padding: 10px 13px; }
.finding.f-low { border-left-color: var(--ink-dim); }
.finding.f-medium { border-left-color: var(--warn); }
.finding.f-high { border-left-color: var(--bad); }
.findtop { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.lvl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.lvl-low { color: var(--ink-dim); }
.lvl-medium { color: var(--warn); }
.lvl-high { color: var(--bad); }
.fid { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); }
.findwhy { margin: 0; font-size: 14.5px; line-height: 1.55; }
.findwhere { margin: 6px 0 0; font-size: 13px; color: var(--ink-dim); }
.findtext { margin: 6px 0 0; padding: 7px 10px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; font-size: 15px; line-height: 1.5;
  overflow-wrap: anywhere; }

.worklist, .shapelist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
.workitem { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.worktitle { font-weight: 600; }
.workmeta { color: var(--ink-dim); font-size: 13px; }
.shapeitem { display: grid; gap: 3px; font-size: 14px; }
.shapeid { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); }
.shapewhy { line-height: 1.5; }
.snippet { display: block; font-family: var(--mono); font-size: 12px; padding: 5px 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 5px;
  overflow-wrap: anywhere; }

.askbox { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  background: var(--panel); }
.askbox h4 { margin: 0 0 8px; font-size: 15px; }
.askbox.a-high { border-color: var(--bad); }
.askbox.a-medium { border-color: var(--warn); }
.crowd { margin: 0; font-size: 14.5px; line-height: 1.55; }
.crowd.crowdhigh { color: var(--warn); }

.gate { display: grid; gap: 6px; }
.holdline { margin: 0; font-size: 15px; }
.holdline strong { font-family: var(--mono); font-size: 17px; }
.warntext { color: var(--warn); margin: 0; font-size: 14.5px; line-height: 1.55; }

.kv { margin: 12px 0 0; }
.kvk { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-dim); margin-bottom: 3px; }
.kvv { margin: 0; font-size: 15px; line-height: 1.6; }
.hookline { margin: 0 0 6px; font-size: 20px; font-weight: 600; line-height: 1.4;
  overflow-wrap: anywhere; }

.devicelist { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.device { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.device.devunknown .devid { color: var(--warn); }
.devid { font-family: var(--mono); font-size: 12px; min-width: 12em; }
.devdesc { color: var(--ink-dim); }

.histlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.histitem { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 13px; }
.histhead { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.histtitle { font-weight: 600; font-size: 15px; }
.histmeta { color: var(--ink-dim); font-size: 12px; font-family: var(--mono); }
.histsubject { margin: 5px 0 0; color: var(--ink-dim); font-size: 14px; }
.histacts { display: flex; gap: 8px; margin-top: 8px; }

.steps { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.step { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-dim); }
.step .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.step.doing { color: var(--ink); }
.step.doing .dot { background: var(--warn); }
.step.done .dot { background: var(--ok); }
.steplabel { line-height: 1.4; }

.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 20px 0 40px;
  font-size: 14px; color: var(--ink-dim); }
.foot p { margin: 0 0 8px; line-height: 1.6; }

.checksong, .checkfindings { margin-top: 12px; }

@media (max-width: 640px) {
  .grid3 { grid-template-columns: 1fr; }
  .devid { min-width: 0; }
  .linecell { font-size: 15.5px; }
}

.keepfield { display: block; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line); }
.keepfield label { display: flex; gap: 8px; align-items: center; font-weight: 500; }

/* Docs pages. They share this stylesheet and the same CSP, which is why the tab
 * switcher is an external file and there is no <style> block in api.html. */
.doc { max-width: 900px; }
.doc h1 { font-size: 26px; margin: 24px 0 12px; }
.doc h2 { font-size: 19px; margin: 32px 0 10px; padding-top: 18px;
  border-top: 1px solid var(--line); }
.doc p { line-height: 1.65; }
.doc ul { line-height: 1.7; }
.doc pre {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px;
  line-height: 1.55; margin: 10px 0; max-width: 100%;
}
.doc code { font-family: var(--mono); font-size: 12.5px; background: var(--panel2);
  border-radius: 4px; padding: 1px 5px; }
.doc pre code { background: none; padding: 0; }
.codegroup { margin: 12px 0 20px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.tab {
  background: transparent; color: var(--ink-dim); border: 1px solid var(--line);
  border-radius: 6px 6px 0 0; padding: 4px 10px; font: inherit; font-size: 12.5px;
  cursor: pointer;
}
.tab.active { color: var(--ink); background: var(--panel); border-bottom-color: var(--panel);
  font-weight: 600; }
.tab:hover { color: var(--ink); }
