:root {
  /* Dark theme (default) */
  --bg: #0f1117;
  --bg-2: #161a23;
  --bg-3: #1f2530;
  --fg: #e6e8eb;
  --fg-dim: #9aa3af;
  --accent: #4c8bf5;
  --accent-2: #6da5ff;
  --ok: #21bf73;
  --warn: #e0a233;
  --err: #e0533a;
  --run: #d68dff;
  --border: #2a3140;
  --terminal-bg: #0a0d12;
  --terminal-fg: #d8dbe2;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --mono: ui-monospace, "Cascadia Mono", "Consolas", "Menlo", monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f8fb;
  --bg-2: #ffffff;
  --bg-3: #eef1f6;
  --fg: #1a1d24;
  --fg-dim: #5c6675;
  --accent: #2360c4;
  --accent-2: #1d4f9f;
  --ok: #0e8f54;
  --warn: #a16a05;
  --err: #c0392b;
  --run: #7a3aaf;
  --border: #d7dde8;
  --terminal-bg: #1a1d24;
  --terminal-fg: #e6e8eb;
  --shadow: 0 1px 3px rgba(15, 20, 35, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre { font-family: var(--mono); }
code {
  background: var(--bg-3);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12.5px;
}

main { max-width: 1200px; margin: 0 auto; padding: 24px; }
/* Pages built around a document viewer opt out of the reading-width cap so
   the page can use the whole monitor. Still bounded, so an ultra-wide screen
   doesn't stretch body text to an unreadable line length. */
main.main-wide { max-width: 2200px; padding: 18px 26px; }
h1 { font-size: 22px; margin-top: 0; }
h2 { font-size: 17px; }
h3 { font-size: 14px; color: var(--fg-dim); text-transform: uppercase;
     letter-spacing: 0.06em; margin: 18px 0 8px; }
p.hint { color: var(--fg-dim); margin-top: -6px; }
.muted { color: var(--fg-dim); }
.back { display: inline-block; margin-bottom: 12px; color: var(--fg-dim); }

/* ---- Top bar ---- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-2); padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}
.brand a { color: var(--fg); font-weight: 600; font-size: 15px; }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: var(--fg-dim); }
.topbar nav a:hover { color: var(--fg); }
.topbar .who {
  color: var(--fg-dim); font-size: 12px; padding-left: 8px;
  border-left: 1px solid var(--border);
}
.theme-toggle {
  padding: 5px 10px; font-size: 12px;
  border-radius: 14px; cursor: pointer;
}
/* Header CAPTCHA/proxy balance widget (refreshes hourly). */
.credits {
  display: inline-flex; gap: 8px; align-items: center;
  padding-left: 10px; border-left: 1px solid var(--border);
}
.credit-item {
  font-size: 12px; color: var(--fg-dim);
  background: var(--bg-3, rgba(127,127,127,0.12));
  padding: 3px 8px; border-radius: 12px; white-space: nowrap;
}
.credit-item:empty { display: none; }

/* ---- Login ---- */
.login-card {
  max-width: 380px; margin: 80px auto 0;
  background: var(--bg-2); padding: 28px;
  border: 1px solid var(--border); border-radius: 8px;
}
.login-card h1 { margin-top: 0; }
.login-card label {
  display: block; margin: 14px 0 4px; color: var(--fg-dim);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
}
.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%; padding: 9px 11px; font-size: 14px;
  background: var(--bg-3); color: var(--fg);
  border: 1px solid var(--border); border-radius: 5px;
}
.login-card { box-shadow: var(--shadow); }

/* ---- Buttons ---- */
.btn, button.btn, button.btn-primary, button.btn-ghost, .btn-ghost {
  display: inline-block; padding: 8px 14px; border-radius: 5px;
  background: var(--bg-3); color: var(--fg); border: 1px solid var(--border);
  cursor: pointer; font-size: 13px; font-family: inherit;
}
.btn:hover, .btn-ghost:hover { background: var(--bg-3); filter: brightness(0.96); text-decoration: none; }
.btn-primary, button.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn-primary:disabled { background: var(--bg-3); border-color: var(--border); color: var(--fg-dim); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Flash messages ---- */
.flash-stack { margin-bottom: 18px; }
.flash { padding: 10px 14px; border-radius: 5px; margin-bottom: 8px; }
.flash-error { background: rgba(224, 83, 58, 0.15); border: 1px solid var(--err); color: #ffbbb0; }
.flash-info  { background: rgba(76, 139, 245, 0.15); border: 1px solid var(--accent); }

/* ---- Cards ---- */
.card-grid {
  display: grid; gap: 14px; margin: 18px 0;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  display: block; padding: 16px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 8px; color: var(--fg);
  box-shadow: var(--shadow);
  transition: border-color 80ms ease, transform 80ms ease;
}
.card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.card h2 { margin: 0 0 10px; font-size: 16px; }
.card-row { display: flex; justify-content: space-between; padding: 4px 0;
            font-size: 13px; color: var(--fg-dim); }
.card-row .label { color: var(--fg-dim); }
.card-row span:nth-child(2) { color: var(--fg); }

/* ---- Pills ---- */
.pill {
  display: inline-block; padding: 2px 8px; border-radius: 11px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.pill-ok   { background: rgba(33, 191, 115, 0.15); color: var(--ok); }
.pill-warn { background: rgba(224, 162, 51, 0.15); color: var(--warn); }
.pill-run  { background: rgba(214, 141, 255, 0.15); color: var(--run); }
.pill-err  { background: rgba(224, 83, 58, 0.15); color: var(--err); }

/* ---- Overview stat strip ---- */
.stat-grid {
  display: grid; gap: 12px; margin: 16px 0 22px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.stat {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px; text-align: center;
}
.stat-num { font-size: 26px; font-weight: 700; color: var(--fg); }
.stat-label { font-size: 11px; color: var(--fg-dim);
              text-transform: uppercase; letter-spacing: 0.05em;
              margin-top: 4px; }
.stat-alert { border-color: var(--err); }
.stat-alert .stat-num { color: var(--err); }

/* ---- Tables ---- */
.table {
  width: 100%; border-collapse: collapse;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden;
  font-size: 13px;
}
.table th, .table td { padding: 8px 12px; text-align: left;
                       border-bottom: 1px solid var(--border); }
.table th { background: var(--bg-3); color: var(--fg-dim);
            font-weight: 600; text-transform: uppercase;
            font-size: 11px; letter-spacing: 0.05em; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-3); }

/* ---- Panels (scraper page sections) ---- */
.panel {
  margin: 22px 0; padding: 18px 20px;
  background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 8px;
}
.panel h2 { margin-top: 0; }

/* ---- Run form ---- */
.run-form {
  display: grid; gap: 10px; margin-top: 8px;
  grid-template-columns: 1fr;
}
.run-form label {
  display: grid; grid-template-columns: 160px 1fr 2fr;
  align-items: center; gap: 12px;
  padding: 6px 0;
}
.run-form .arg-name {
  font-family: var(--mono); color: var(--accent-2); font-size: 13px;
}
.run-form .arg-help { color: var(--fg-dim); font-size: 12px; }
.run-form input[type="text"], .run-form input[type="number"],
.run-form input[type="date"] {
  padding: 6px 9px; background: var(--bg-3); color: var(--fg);
  border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--mono); font-size: 13px;
  color-scheme: inherit;  /* lets the native date picker follow the theme */
}
.run-form input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.5);  /* tames the contrast in both themes */
  cursor: pointer;
}
.run-form button { margin-top: 10px; justify-self: start; }

/* County picker on the Run All page */
.county-pick {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 14px 12px; margin: 0;
  display: flex; gap: 18px; flex-wrap: wrap;
}
.county-pick legend {
  padding: 0 6px; font-size: 12px; color: var(--fg-dim);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.county-check {
  display: inline-flex; align-items: center; gap: 6px;
  grid-template-columns: none !important;  /* override run-form label */
  padding: 0 !important; cursor: pointer;
}
.county-check .county-name { color: var(--fg); font-size: 13px; }
details summary { cursor: pointer; padding: 4px 0; color: var(--fg-dim); }

/* ---- Terminal ---- */
.terminal {
  background: var(--terminal-bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 14px;
  color: var(--terminal-fg); font-family: var(--mono); font-size: 12.5px;
  line-height: 1.45; min-height: 360px; max-height: 70vh;
  overflow: auto; white-space: pre-wrap; word-break: break-all;
  margin-top: 12px;
}
.job-meta {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  color: var(--fg-dim); font-size: 13px; margin-bottom: 8px;
}
.job-meta strong { color: var(--fg); }

.terminal-layout {
  display: grid; grid-template-columns: 1fr 260px; gap: 16px;
}
.terminal-jobs h3 { margin-top: 0; }
.jobs-list { list-style: none; padding: 0; margin: 0; }
.jobs-list li { margin-bottom: 6px; }
.jobs-list a {
  display: block; padding: 8px 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 5px; color: var(--fg); font-size: 12px;
}
.jobs-list a small { display: block; color: var(--fg-dim); margin: 2px 0; }
.jobs-list a.active { border-color: var(--accent); }
.jobs-list a:hover { text-decoration: none; background: var(--bg-3); }

@media (max-width: 720px) {
  .terminal-layout { grid-template-columns: 1fr; }
  .run-form label { grid-template-columns: 1fr; }
}

/* ---- Review workspace (split: document | editable record) ---- */
/* The form column width (--form-w) is set/persisted by the resizable
   divider; the document fills whatever space remains. */
.review-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8px var(--form-w, 340px);
  gap: 0; align-items: stretch;
}
.doc-panel { display: flex; flex-direction: column; }
.doc-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap;
}
.doc-toolbar h2 { margin: 0; }
.doc-tools { display: flex; gap: 8px; align-items: center; }
.btn-sm { padding: 4px 11px; font-size: 12px; }
/* Height comes from --doc-h, set/persisted by the bottom drag handle;
   the default fills the window below the header. */
.doc-frame {
  width: 100%; height: var(--doc-h, calc(100vh - 150px)); min-height: 300px;
  margin-top: 10px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg-3);
}
/* Drag handles: vertical one between document and form, horizontal one
   under the document. */
.ws-gutter {
  cursor: col-resize; align-self: stretch; min-height: 120px;
  margin: 0 6px; border-radius: 5px; background: var(--border);
  transition: background 120ms ease;
}
.doc-vgutter {
  cursor: row-resize; height: 10px; margin-top: 4px;
  border-radius: 5px; background: var(--border);
  transition: background 120ms ease;
}
.ws-gutter:hover, .doc-vgutter:hover,
.ws-gutter.dragging, .doc-vgutter.dragging { background: var(--accent-2); }
/* A grip mark so both handles read as draggable rather than decorative. */
.ws-gutter, .doc-vgutter { position: relative; }
.ws-gutter::after, .doc-vgutter::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  border-radius: 2px; background: var(--bg-2); opacity: 0.85;
}
.ws-gutter::after { width: 2px; height: 26px; margin: -13px 0 0 -1px; }
.doc-vgutter::after { width: 26px; height: 2px; margin: -1px 0 0 -13px; }
.edit-panel { min-width: 0; }
/* While dragging, the PDF must not swallow the pointer -- an iframe eats
   mousemove, so the drag would stall the moment the cursor crossed it. */
.review-workspace.resizing .doc-frame { pointer-events: none; }
/* Maximize: document spans the full width, form + gutter hidden. */
.review-workspace.doc-max { grid-template-columns: 1fr; }
.review-workspace.doc-max .ws-gutter,
.review-workspace.doc-max .edit-panel { display: none; }
.review-workspace.doc-max .doc-frame { height: var(--doc-h, calc(100vh - 106px)); }
/* Full screen (Fullscreen API): the document panel becomes the whole screen.
   Prefixed and unprefixed are separate rules on purpose -- a browser that
   doesn't know one of the selectors would otherwise drop the whole block. */
.doc-panel:fullscreen { padding: 10px 14px; background: var(--bg-2); }
.doc-panel:fullscreen .doc-frame { height: calc(100vh - 62px); margin-top: 8px; }
.doc-panel:fullscreen .doc-vgutter { display: none; }
.doc-panel:-webkit-full-screen { padding: 10px 14px; background: var(--bg-2); }
.doc-panel:-webkit-full-screen .doc-frame { height: calc(100vh - 62px); margin-top: 8px; }
.doc-panel:-webkit-full-screen .doc-vgutter { display: none; }
.case-form .case-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
}
.case-field { display: flex; flex-direction: column; gap: 3px; }
.case-field .arg-name {
  font-family: var(--mono); color: var(--accent-2); font-size: 12px;
}
.case-field input[type="text"] {
  padding: 7px 9px; background: var(--bg-3); color: var(--fg);
  border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--mono); font-size: 13px;
}
.orig-hint { font-size: 11px; color: var(--warn); }
.case-note { display: flex; flex-direction: column; gap: 3px; margin-top: 12px; }
.case-note .arg-name {
  font-family: var(--mono); color: var(--accent-2); font-size: 12px;
}
.case-note textarea {
  padding: 7px 9px; background: var(--bg-3); color: var(--fg);
  border: 1px solid var(--border); border-radius: 4px;
  font-family: inherit; font-size: 13px; resize: vertical;
}
.case-opts {
  display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 0;
  font-size: 12px; color: var(--fg-dim);
}
.case-opts label { display: inline-flex; align-items: center; gap: 6px; }
.case-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.case-actions kbd {
  font-family: var(--mono); font-size: 10px; opacity: 0.7;
  border: 1px solid currentColor; border-radius: 3px; padding: 0 3px;
  margin-left: 4px;
}
@media (max-width: 980px) {
  .review-workspace { grid-template-columns: 1fr; }
  .ws-gutter { display: none; }
  .doc-frame { height: var(--doc-h, 82vh); }
  main.main-wide { padding: 16px; }
}

/* ---- Tabs (Mailing status views) ---- */
.tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1px solid transparent; border-bottom: none;
  border-radius: 7px 7px 0 0; color: var(--fg-dim); text-decoration: none;
  font-size: 14px; margin-bottom: -1px; }
.tab:hover { color: var(--fg); background: var(--bg-3); }
.tab-active { color: var(--fg); background: var(--bg-2);
  border-color: var(--border); border-bottom: 1px solid var(--bg-2);
  font-weight: 600; }
.tab-count { font-size: 11px; padding: 0 7px; border-radius: 10px;
  background: var(--bg-3); color: var(--fg-dim); }
.tab-active .tab-count { background: var(--accent, #2563eb); color: #fff; }

/* ---- AI assistance ---- */
.ai-box { border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 14px; background: var(--bg-2); }
.ai-ask { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-ask select { padding: 4px 8px; background: var(--bg-3); color: var(--fg);
  border: 1px solid var(--border); border-radius: 4px; }
.ai-suggest { margin-top: 10px; }
.ai-suggest-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-tag, .ai-chip-demo { background: #7c3aed; color: #fff; font-size: 11px;
  font-weight: 600; padding: 1px 7px; border-radius: 10px; }
.ai-conf { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; }
.ai-conf.ai-hi { background: rgba(34,197,94,0.2); color: var(--ok, #16a34a); }
.ai-conf.ai-mid { background: rgba(234,179,8,0.2); color: var(--warn, #b45309); }
.ai-conf.ai-lo { background: rgba(239,68,68,0.2); color: var(--err, #dc2626); }
.ai-err { color: var(--err, #dc2626); }
/* The per-field "AI: value" chip and the highlight on an applied field. */
.ai-chip { display: inline-block; margin-top: 4px; max-width: 100%;
  text-align: left; font-family: var(--mono); font-size: 11px;
  color: #fff; background: #7c3aed; border: none; border-radius: 4px;
  padding: 2px 7px; cursor: pointer; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.ai-chip:hover { background: #6d28d9; }
.ai-chip-used { opacity: 0.5; }
input.ai-filled { border-color: #7c3aed !important;
  box-shadow: 0 0 0 1px #7c3aed inset; background: rgba(124,58,237,0.06); }
.ai-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 8px 0; }
.ai-inline { display: inline-flex; align-items: center; gap: 8px; margin: 6px 12px 6px 0; }
.ai-inline input[type="text"] { padding: 6px 9px; background: var(--bg-3);
  color: var(--fg); border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--mono); font-size: 13px; }
.ai-counties { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.ai-counties label { display: inline-flex; align-items: center; gap: 6px; }

/* ---- Schedule + QA forms ---- */
.sched-form { display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px 16px; margin: 6px 0; }
.sched-days { display: inline-flex; flex-wrap: wrap; gap: 4px 10px;
  font-size: 13px; }
.sched-days label { display: inline-flex; align-items: center; gap: 4px; }
.setup-steps { margin: 8px 0 8px 18px; padding: 0; }
.setup-steps li { margin: 6px 0; line-height: 1.5; }

/* ---- Changelog ---- */
.changelog-release h2 { font-size: 16px; margin: 0 0 10px; }
.changelog-list { margin: 0; padding-left: 20px; }
.changelog-list li { margin: 7px 0; line-height: 1.5; }
.changelog-list strong { font-weight: 600; }

/* ---- Settings ---- */
.settings-jump { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 18px; }
.settings-jump a {
  font-size: 13px; padding: 5px 11px; border: 1px solid var(--border);
  border-radius: 999px; text-decoration: none;
}
.settings-jump a:hover { border-color: var(--accent, #7c3aed); }
/* Each settings section is its own form; keep them visually separated so it's
   clear which Save button covers which block. */
.settings-form + .actions, .settings-form .actions { margin-top: 14px; }
/* p.hint carries a negative top margin so it tucks under a heading. Following
   a form or a row of buttons that pulls it up into them instead -- give it
   normal spacing there. */
form + p.hint, .actions + p.hint, .case-actions + p.hint { margin-top: 12px; }
#sec-services h3, #sec-ai h3, #sec-account h3 {
  margin: 22px 0 6px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 15px;
}
.settings-form .ai-inline input[type="password"],
.settings-form .ai-inline input[type="text"] {
  padding: 6px 9px; background: var(--bg-3); color: var(--fg);
  border: 1px solid var(--border); border-radius: 4px; min-width: 240px;
}
.settings-form .ai-inline .arg-name { min-width: 170px; }

/* ---- API keys ---- */
/* The one moment a key is readable. Loud on purpose: once this page is
   navigated away from, the plaintext is gone for good. */
.key-reveal { border-color: var(--ok); }
.key-show {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding: 12px 14px;
  background: var(--terminal-bg); border: 1px solid var(--border);
  border-radius: 6px;
}
.key-show code {
  background: none; padding: 0; font-family: var(--mono);
  font-size: 14px; color: var(--terminal-fg); word-break: break-all;
}
.key-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.key-actions form { display: inline; }
tr.row-revoked td { opacity: 0.55; }
.btn-danger, button.btn-danger { border-color: var(--err); color: var(--err); }
.btn-danger:hover, button.btn-danger:hover {
  background: var(--err); border-color: var(--err); color: #fff;
}
/* Copy-paste snippets. Scrolls rather than wrapping -- a wrapped line of code
   is a line that gets pasted wrong. */
.code-block {
  background: var(--terminal-bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 14px; margin-top: 10px;
  color: var(--terminal-fg); font-size: 12.5px; line-height: 1.5;
  overflow-x: auto; white-space: pre;
}
.code-block code {
  background: none; padding: 0; font-family: var(--mono); font-size: inherit;
  color: inherit;
}

/* Swagger UI ships a light theme only. Rather than fight it, give it a light
   card of its own so it reads as an embedded panel in either theme instead of
   a white rectangle that looks like a rendering fault. */
.swagger-host {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  margin-top: 14px; padding: 4px 0 10px; overflow-x: auto;
  /* A light island inside a possibly-dark page: set the base text colour
     here too, so anything that inherits does so from the card and not from
     the dashboard theme. */
  color: #3b4151;
}
.swagger-host .swagger-ui .info { margin: 20px 0; }
.swagger-host .swagger-ui .scheme-container { background: none; box-shadow: none; }
/* Swagger UI is a complete design system and styles its own elements. The
   dashboard's bare-element rules reach inside it and fight that.
   `code` is the damaging one: Swagger sets only a font on it, so the chip
   background from the global rule lands inside the dark example blocks
   (.microlight is #333 with white text) and leaves white text on a pale
   chip -- unreadable. Hand these elements back to Swagger's own styling. */
.swagger-host code {
  background: none; padding: 0; border-radius: 0;
  font-size: inherit; color: inherit;
}
.swagger-host h1, .swagger-host h2, .swagger-host h3,
.swagger-host h4, .swagger-host h5, .swagger-host h6 {
  color: inherit; text-transform: none; letter-spacing: normal;
}

/* ---- First-run setup options ---- */
.setup-opt {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 0; border-top: 1px solid var(--border);
}
.setup-opt:first-of-type { border-top: none; }
.setup-opt > input[type="radio"] { margin-top: 4px; }
.setup-input {
  display: block; margin-top: 8px; min-width: 320px; max-width: 100%;
  padding: 7px 9px; background: var(--bg-3); color: var(--fg);
  border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--mono); font-size: 13px;
}

/* ---- Toasts (global notifications) ---- */
.toast-stack {
  position: fixed; right: 18px; bottom: 18px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 360px;
}
.toast {
  position: relative; background: var(--bg-2); color: var(--fg);
  border: 1px solid var(--border); border-left-width: 4px;
  border-radius: 8px; padding: 12px 30px 12px 14px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.35);
  animation: toast-in 160ms ease-out;
}
.toast-out { opacity: 0; transform: translateY(8px);
             transition: opacity 360ms ease, transform 360ms ease; }
.toast-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.toast-body { font-size: 12px; color: var(--fg-dim); word-break: break-word; }
.toast-attention { border-left-color: var(--warn); }
.toast-ok { border-left-color: var(--ok); }
.toast-err { border-left-color: var(--err); }
.toast-info { border-left-color: var(--accent); }
.toast-x {
  position: absolute; top: 6px; right: 8px; background: none; border: none;
  color: var(--fg-dim); font-size: 16px; cursor: pointer; line-height: 1;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
