:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1d2733;
  --muted: #5b6878;
  --line: #dde3ea;
  --accent: #1873b4;
  --accent-text: #ffffff;
  --code-bg: #f0f3f7;
  --bad: #b42318;
  --warn: #9a5b00;
  --ok: #1e7b34;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c;
    --surface: #182029;
    --text: #e3e9ef;
    --muted: #9aa8b6;
    --line: #2b3642;
    --accent: #5aa9e6;
    --accent-text: #0b1218;
    --code-bg: #0e141a;
    --bad: #f97066;
    --warn: #f5b546;
    --ok: #6fcf86;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
code { font-family: var(--mono); font-size: .92em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

.top { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 2; }
.top-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; min-height: 56px; gap: 4px 16px; padding-top: 8px; padding-bottom: 8px; }
section[id] { scroll-margin-top: 72px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
nav { display: flex; gap: 18px; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
nav a:hover { color: var(--text); }

.hero { padding: 64px 16px 40px; }
.eyebrow { color: var(--accent); font-weight: 600; margin: 0 0 8px; }
h1 { font-size: clamp(28px, 4.5vw, 44px); line-height: 1.15; margin: 0 0 16px; max-width: 900px; }
h2 { font-size: 22px; margin: 0 0 10px; }
.lead { font-size: 18px; color: var(--muted); max-width: 820px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

.button {
  display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; font: inherit; cursor: pointer;
}
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

section { margin: 40px auto; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card h2 { font-size: 18px; }
.card p { margin: 0; color: var(--muted); }

.code, .output {
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px;
  font: 13px/1.5 var(--mono); overflow: auto; margin: 0;
}

.toolbar { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin: 16px 0; }
.toolbar label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; max-width: 100%; }
#example { width: 420px; }
select, input {
  font: inherit; font-size: 15px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); min-width: 220px; max-width: 100%;
}
.panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 860px) { .panes { grid-template-columns: minmax(0, 1fr); } }
.pane { display: flex; flex-direction: column; min-width: 0; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; font-weight: 600; font-size: 14px; }
textarea {
  width: 100%; height: 520px; resize: vertical; padding: 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--code-bg); color: var(--text); font: 13px/1.5 var(--mono); tab-size: 2;
  white-space: pre; overflow-wrap: normal; overflow: auto;
}
.output { height: 520px; white-space: pre; }
.tabs { display: flex; gap: 4px; overflow-x: auto; }
.tabs button {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 6px;
  padding: 3px 8px; font: 12px var(--mono); cursor: pointer; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--accent); }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg { font: inherit; font-size: 15px; padding: 7px 14px; border: 0; background: var(--surface); color: var(--muted); cursor: pointer; }
.seg + .seg { border-left: 1px solid var(--line); }
.seg[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.head-actions { display: flex; gap: 12px; flex-shrink: 0; }
.texts { margin-top: 10px; font-size: 14px; }
.texts summary { cursor: pointer; font-weight: 600; }
.texts textarea { height: 160px; margin-top: 8px; }
textarea::placeholder { color: var(--muted); white-space: pre-wrap; }

.status { margin: 14px 0 6px; font-weight: 600; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }
.findings h3 { font-size: 15px; margin: 18px 0 6px; }
.findings ul { margin: 0; padding-left: 20px; }
.findings li { margin: 3px 0; }
.findings .row { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-right: 6px; }
.findings .bad { color: var(--bad); }
.findings .warn { color: var(--warn); }

.foot { border-top: 1px solid var(--line); padding: 24px 16px 40px; color: var(--muted); font-size: 14px; }
