:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #17212b;
  --muted: #5b6875;
  --line: #dde3e9;
  --brand: #0e7490;
  --brand-ink: #ffffff;
  --soft: #ecf6f8;
  --error: #b42318;
  --ok: #067647;
  --warn: #b54708;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1418;
    --card: #182027;
    --text: #e6edf3;
    --muted: #9aa8b5;
    --line: #2b3640;
    --brand: #22a3c3;
    --brand-ink: #071216;
    --soft: #13303a;
    --error: #ff8a80;
    --ok: #5fd39a;
    --warn: #f5b26b;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px max(16px, calc(50% - 480px)); border-bottom: 1px solid var(--line); background: var(--card); }
h1 { font-size: 1.15rem; margin: 0; }
h2 { font-size: 1.02rem; margin: 0 0 6px; }
main { max-width: 960px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }
footer { max-width: 960px; margin: 0 auto 24px; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-width: 0; }
.muted { color: var(--muted); margin: 4px 0; }
.small { font-size: .85rem; }
.error { color: var(--error); min-height: 1em; margin: 6px 0 0; }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: .82rem; margin: 0; white-space: nowrap; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 10px; }
button { font: inherit; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); border-radius: 8px; padding: 7px 14px; cursor: pointer; }
button.secondary { background: transparent; color: var(--brand); }
button:disabled { opacity: .55; cursor: wait; }
button.role { text-align: left; background: var(--soft); color: var(--text); border-color: var(--line); padding: 10px 12px; }
button.role strong { display: block; }
button.role span { color: var(--muted); font-size: .85rem; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
textarea, input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; max-width: 100%; }
textarea { width: 100%; resize: vertical; margin: 8px 0; }
#data-params { flex: 1 1 220px; }
label { font-size: .9rem; }
.field { display: grid; gap: 4px; margin-top: 8px; max-width: 280px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 300px; }
.chips button { background: transparent; color: var(--muted); border-color: var(--line); border-radius: 999px; padding: 3px 10px; font-size: .82rem; }
.answer { margin-top: 12px; padding: 12px 14px; background: var(--soft); border-radius: 8px; overflow-wrap: anywhere; }
.answer p { margin: 4px 0; }
.answer ul { margin: 4px 0; padding-left: 20px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 10px 0 0; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.yes { color: var(--ok); font-weight: 600; }
.no { color: var(--warn); font-weight: 600; }
.table-wrap { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
.pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 420px; overflow: auto; font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 560px) {
  .top { flex-direction: column; align-items: flex-start; }
  .facts { grid-template-columns: 1fr; }
}
