/* MySQL Advisor — shared design system (blueprint + instrument panel).
   One sheet for every page: index, help, privacy, 404, request-key.
   Day/night via body.light-mode + localStorage key "theme". */

:root {
  --bg: #0b1626; --surface: #101b30; --surface-2: #0d1728; --elevated: #16233c;
  --border: #1f3050; --border-strong: #2c4269;
  --grid-line: rgba(122, 167, 255, .045);
  --text: #e6edf9; --text-2: #a3b4d0; --muted: #7b8dab;
  --accent: #7aa7ff; --accent-ink: #0b1626; --accent-soft: rgba(122, 167, 255, .13);
  --crit: #ff8583; --crit-bg: rgba(255, 133, 131, .12);
  --warn: #f5c04a; --warn-bg: rgba(245, 192, 74, .12);
  --info: #7aa7ff; --info-bg: rgba(122, 167, 255, .12);
  --ok:   #56d99b; --ok-bg:   rgba(86, 217, 155, .12);
  --radius: 10px; --radius-sm: 8px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
body.light-mode {
  --bg: #f2f5fb; --surface: #ffffff; --surface-2: #f7f9fd; --elevated: #ffffff;
  --border: #dfe6f2; --border-strong: #c3d0e6;
  --grid-line: rgba(47, 86, 166, .055);
  --text: #152238; --text-2: #46587a; --muted: #6d7d99;
  --accent: #2f62d9; --accent-ink: #ffffff; --accent-soft: rgba(47, 98, 217, .1);
  --crit: #d13330; --crit-bg: #fdeceb;
  --warn: #a26a08; --warn-bg: #fbf2dd;
  --info: #2f62d9; --info-bg: #e9effc;
  --ok:   #157a4a; --ok-bg:   #e5f6ed;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text);
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg);
  font-family: var(--sans); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hidden { display: none !important; }
.muted { color: var(--muted); }

::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html, textarea { scrollbar-color: var(--border-strong) transparent; }

/* Inline stroke icons (one family, one weight) */
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ico-sm { width: 14px; height: 14px; }

/* Mono annotation: the blueprint label voice used for section markers,
   table headers, nav, pills. */
.anno {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
}

/* ─────────── Top bar ─────────── */
header.bar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.bar-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; max-width: 960px; margin: 0 auto; padding: 0 20px; }
.wrap.bar-inner { padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--text); letter-spacing: -0.01em; }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #3b82f6, #6d28d9);
  display: grid; place-items: center; color: #fff; font-size: 15px; flex: none; }
.navlinks { display: flex; align-items: center; gap: 2px; }
.navlinks a, .navlinks button {
  background: none; border: 0; color: var(--text-2); cursor: pointer;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none;
}
.navlinks a:hover, .navlinks button:hover { background: var(--accent-soft); color: var(--text); }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; padding: 0 !important; }

/* ── "More" nav dropdown ──────────────────────────────────────────────────────
   Built on <details>/<summary> so it works with no JavaScript and gets keyboard
   support (Enter/Space to toggle) from the browser. assets/nav.js is optional
   polish only: Escape and outside-click to close. */
.navmore { position: relative; }
.navmore > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; color: var(--text-2);
  font-family: var(--mono); font-size: 11.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 8px 10px; border-radius: var(--radius-sm);
}
.navmore > summary::-webkit-details-marker { display: none; }
.navmore > summary:hover { background: var(--accent-soft); color: var(--text); }
.navmore > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.navmore[open] > summary { background: var(--accent-soft); color: var(--text); }
.navmore .navmore-caret { width: 8px; height: 8px; flex: none; transition: transform .15s ease; }
.navmore[open] .navmore-caret { transform: rotate(180deg); }

.navmore-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 210px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: 0 12px 28px rgba(0, 0, 0, .38);
  display: flex; flex-direction: column; gap: 2px;
}
body.light-mode .navmore-panel { box-shadow: 0 12px 28px rgba(15, 23, 42, .14); }

.navlinks .navmore-panel a {
  display: block; text-align: left; white-space: nowrap;
  padding: 9px 10px; text-transform: none; letter-spacing: 0;
  font-family: var(--sans); font-size: 13px; color: var(--text);
}
.navmore-panel a .navmore-desc {
  display: block; margin-top: 2px;
  font-size: 11.5px; color: var(--muted); letter-spacing: 0;
}
.navlinks .navmore-panel a:hover { background: var(--accent-soft); }
.navmore-panel a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

@media (max-width: 560px) {
  .navmore-panel { position: fixed; left: 12px; right: 12px; top: 62px; min-width: 0; }
}
.sun-icon { display: none; } body.light-mode .sun-icon { display: inline; } body.light-mode .moon-icon { display: none; }

/* ─────────── Hero: copy + spec plate ─────────── */
.hero { padding: 44px 0 28px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 324px; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(30px, 4.6vw, 40px); font-weight: 700; margin: 0 0 12px; letter-spacing: -0.03em; line-height: 1.12; max-width: 21ch; }
.hero p { color: var(--text-2); font-size: 16px; margin: 0; max-width: 58ch; }

/* Spec plate: mono data readout with blueprint registration corners */
.spec-card { position: relative; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); font-family: var(--mono); }
.spec-card::before, .spec-card::after { content: ""; position: absolute; width: 14px; height: 14px;
  border: 0 solid var(--accent); }
.spec-card::before { top: -6px; left: -6px; border-top-width: 1px; border-left-width: 1px; }
.spec-card::after { bottom: -6px; right: -6px; border-bottom-width: 1px; border-right-width: 1px; }
.spec-head { padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 10.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.spec-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 16px; font-size: 11.5px; }
.spec-row + .spec-row { border-top: 1px solid var(--border); }
.spec-key { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; white-space: nowrap; }
.spec-val { color: var(--text); text-align: right; }
.spec-val .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 6px; }

/* ─────────── Cards / panels ─────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.panel { padding: 22px; }

/* Console chrome: channel header with live source LEDs */
.console-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: -22px -22px 18px; padding: 12px 20px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.console-title { display: flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 11px;
  font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
.console-title .ico { color: var(--accent); }
.src-leds { display: flex; gap: 14px; flex-wrap: wrap; }
.led { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.led i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--border-strong); }
.led.on { color: var(--text-2); }
.led i { transition: background .25s, border-color .25s, box-shadow .25s; }
.led.on i { background: var(--ok); border-color: var(--ok);
  box-shadow: 0 0 6px color-mix(in srgb, var(--ok) 60%, transparent); }
.console-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.btn-sample { display: inline-flex; align-items: center; gap: 6px; background: none; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 7px; padding: 5px 11px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--text-2); }
.btn-sample:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.btn-sample:active { transform: translateY(1px); }
.btn-sample:disabled { opacity: .5; cursor: wait; }
.btn-sample .ico { color: var(--accent); }
.detected-chip { display: inline-flex; align-items: center; margin-left: 10px; padding: 2px 9px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--accent-soft);
  font-size: 10px; letter-spacing: .04em; text-transform: none; color: var(--accent); }
.detected-chip.hidden { display: none; }
.console-note { font-family: var(--mono); font-size: 12px; color: var(--accent);
  margin: -6px 0 12px; opacity: 0; transition: opacity .25s; min-height: 0; }
.console-note.show { opacity: 1; }
.panel.dropping { outline: 2px dashed var(--accent); outline-offset: -6px; }

/* Segmented tabs (instrument channel selector) */
.tab-bar { display: inline-flex; gap: 3px; padding: 4px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  background: none; border: 1px solid transparent; color: var(--text-2); cursor: pointer;
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .02em;
  padding: 7px 13px; border-radius: 7px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--elevated); color: var(--accent); border-color: var(--border-strong); box-shadow: inset 0 2px 0 var(--accent); }
.tab.has-data::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok); margin-left: 7px; vertical-align: 1px; }
.optional { color: var(--muted); font-weight: 400; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }
.input-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
textarea {
  width: 100%; min-height: 190px; resize: vertical; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 15px;
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.or-divider { text-align: center; margin: 12px 0; position: relative; }
.or-divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.or-divider span { position: relative; background: var(--surface); padding: 0 12px; color: var(--muted); font-size: 12px; }
.file-upload {
  display: flex; align-items: center; gap: 8px; justify-content: center; cursor: pointer;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 12px;
  font-size: 13px; color: var(--text-2); background: var(--surface-2);
}
.file-upload:hover { border-color: var(--accent); color: var(--text); }
.file-upload input[type=file] { display: none; }
.file-name { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 6px; text-align: center; }

/* Action row */
.action-row { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.captcha-group { display: flex; align-items: center; gap: 10px; }
.captcha-group label { display: none; }
.captcha-container { display: flex; align-items: center; gap: 8px; }
#captcha-img { border: 1px solid var(--border); border-radius: 6px; height: 40px; cursor: pointer; }
#captcha { width: 130px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px; font-family: var(--mono); letter-spacing: 2px; font-size: 14px; }
#captcha:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-refresh { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); width: 40px; height: 40px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 15px; }
.btn-refresh:hover { color: var(--text); border-color: var(--border-strong); }
.grow { flex: 1; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: var(--radius-sm); padding: 11px 22px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  text-decoration: none;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary { background: none; border: 1px solid var(--border-strong); color: var(--text-2); border-radius: var(--radius-sm);
  padding: 11px 18px; font: inherit; font-size: 14px; cursor: pointer; }
.btn-secondary:hover { color: var(--text); }
.btn-icon { font-size: 15px; }
.spinner { border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor;
  border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Collect (secondary, quiet) */
details.collect { margin-top: 16px; }
details.collect > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--accent); padding: 4px 0; }
details.collect > summary::-webkit-details-marker { display: none; }
details.collect[open] > summary { margin-bottom: 12px; }
.collect-box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.collect-box-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.collect-box-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text); }
.info-icon-wrap { position: relative; }
.info-icon { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; }
.info-popover { position: absolute; right: 0; top: 26px; width: 250px; background: var(--elevated); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 12px; font-size: 12px; color: var(--text-2); z-index: 5; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.info-popover.hidden { display: none; }
.collect-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.collect-field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; }
.field-hint { color: var(--muted); }
.collect-field input { width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 11px; font-size: 13px; }
.collect-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-collect { display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 32px); margin: 0 16px 14px;
  background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent); border-radius: var(--radius-sm);
  padding: 10px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-collect:hover { background: var(--accent); color: var(--accent-ink); }
.collect-status { margin: 0 16px 14px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.collect-status.hidden, .data-ready-banner.hidden { display: none; }
.collect-status.success { background: var(--ok-bg); color: var(--ok); }
.collect-status.error { background: var(--crit-bg); color: var(--crit); }
.collect-status.loading { background: var(--info-bg); color: var(--info); }
.data-ready-banner { display: flex; align-items: center; gap: 8px; margin: 0 16px 14px; padding: 10px 12px;
  background: var(--ok-bg); color: var(--ok); border-radius: var(--radius-sm); font-size: 13px; }

/* ─────────── Results (instrument readouts) ─────────── */
.results { margin: 28px 0; }
.results.hidden, .errors.hidden { display: none; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.summary-card { border-radius: var(--radius); padding: 16px 18px; border: 1px solid var(--border); background: var(--surface); }
.summary-card .count { font-family: var(--mono); font-size: 30px; font-weight: 700; line-height: 1; }
.summary-card .label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin-top: 8px; }
.summary-card.critical { border-color: var(--border); box-shadow: inset 0 3px 0 var(--crit); } .summary-card.critical .count { color: var(--crit); }
.summary-card.warning  { box-shadow: inset 0 3px 0 var(--warn); } .summary-card.warning .count { color: var(--warn); }
.summary-card.info     { box-shadow: inset 0 3px 0 var(--info); } .summary-card.info .count { color: var(--info); }
.summary-card.ok       { box-shadow: inset 0 3px 0 var(--ok); }   .summary-card.ok .count { color: var(--ok); }

.report-header-block, .version-info { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; }
.version-info { display: flex; gap: 22px; flex-wrap: wrap; }
.version-info .item { display: flex; gap: 6px; font-size: 13px; }
.item-label { color: var(--muted); } .item-value { color: var(--text); font-weight: 500; font-family: var(--mono); font-size: 12.5px; }
.report-title { font-size: 16px; font-weight: 600; margin: 0 0 2px; }
.report-for { color: var(--text-2); font-size: 13px; }
.report-identity { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.report-icon { width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--accent-soft);
  color: var(--accent); display: flex; align-items: center; justify-content: center; }
.report-icon .ico { width: 19px; height: 19px; }
.report-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 28px; font-size: 13px; }
.report-info-heading { font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted); margin-bottom: 7px; }
.report-info-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0;
  border-bottom: 1px dashed var(--border); }
.report-info-row:last-child { border-bottom: none; }
.ril { color: var(--text-2); display: inline-flex; align-items: center; gap: 7px; }
.riv { color: var(--text); font-family: var(--mono); font-size: 12.5px; text-align: right; }
.sev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.severity-critical .sev-dot { background: var(--crit); }
.severity-warning .sev-dot { background: var(--warn); }
.severity-info .sev-dot { background: var(--info); }
.severity-ok .sev-dot { background: var(--ok); }

/* Inline help link shown under input format errors */
.errors-help { margin: 10px 0 0; }
.errors-help a { color: var(--accent); font-size: 13px; text-decoration: none; font-weight: 500; }
.errors-help a:hover { text-decoration: underline; }

.results-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 14px; }
.results-head h2 { font-size: 18px; margin: 0; letter-spacing: -0.01em; }
.export-actions { display: flex; gap: 8px; }
.btn-export { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); border-radius: var(--radius-sm);
  padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.btn-export:hover { color: var(--text); border-color: var(--border-strong); }

.findings-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; background: var(--surface); }
.findings-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.findings-table th { text-align: left; font-family: var(--mono); font-weight: 500; color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.findings-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
.findings-data-row:hover td { background: var(--surface-2); }
.var-cell code, .var-cell { font-family: var(--mono); color: var(--text); font-size: 12.5px; }
.var-cell { min-width: 160px; max-width: 220px; overflow-wrap: anywhere; }
.val-cell { font-family: var(--mono); font-size: 12.5px; }
.recommendation-cell { color: var(--text); }
.badge { display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .05em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap; text-transform: uppercase; }
.badge-critical { background: var(--crit-bg); color: var(--crit); }
.badge-warning  { background: var(--warn-bg); color: var(--warn); }
.badge-info     { background: var(--info-bg); color: var(--info); }
.badge-ok       { background: var(--ok-bg); color: var(--ok); }
.findings-data-row.sev-row-critical td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.findings-data-row.sev-row-warning td:first-child  { box-shadow: inset 3px 0 0 var(--warn); }
.findings-data-row.sev-row-info td:first-child     { box-shadow: inset 3px 0 0 var(--info); }
.findings-data-row.sev-row-ok td:first-child       { box-shadow: inset 3px 0 0 var(--ok); }
.findings-category-row td { background: var(--surface-2); font-weight: 600; color: var(--text); }
.findings-category-count { color: var(--muted); font-weight: 400; font-family: var(--mono); font-size: 12px; margin-left: 10px; }

.errors { margin: 20px 0; background: var(--crit-bg); border: 1px solid var(--crit); color: var(--crit);
  border-radius: var(--radius); padding: 14px 18px; font-size: 14px; }
.errors ul { margin: 6px 0 0; padding-left: 18px; }

/* API promo */
.api-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 16px 20px; margin: 30px 0;
  background: var(--accent-soft); }
.api-strip .txt { font-size: 14px; color: var(--text-2); }
.api-strip .txt b { color: var(--text); font-weight: 600; }
.api-strip .acts { display: flex; gap: 10px; }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); color: var(--text);
  border-radius: var(--radius-sm); padding: 9px 15px; font-size: 13px; font-weight: 500; text-decoration: none; }
.btn-ghost:hover { border-color: var(--accent); }
.btn-fill { background: var(--accent); color: var(--accent-ink); border-radius: var(--radius-sm); padding: 9px 15px; font-size: 13px; font-weight: 600; }
.btn-fill:hover { filter: brightness(1.08); }

/* Section divider (measurement rule) */
.section-divider { position: relative; text-align: center; margin: 40px 0 30px; }
.section-divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border-strong); }
.section-divider span { position: relative; background: var(--bg); padding: 0 14px; color: var(--muted);
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; }

/* ─────────── Reading content ─────────── */
.content { margin: 8px 0 10px; }
.content h2 { font-size: 22px; font-weight: 600; margin: 46px 0 12px; letter-spacing: -0.02em; }
.content h2:first-of-type { margin-top: 0; }
.content h3 { font-size: 18px; font-weight: 600; margin: 40px 0 12px; padding-top: 26px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em; }
.content h3::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--accent); flex: none; }
.content p { color: var(--text-2); margin: 0 0 14px; }
.content ul { color: var(--text-2); margin: 0 0 14px; padding-left: 20px; }
.content li { margin: 5px 0; }
.content a { text-decoration: underline; }
.content .lead { font-size: 16px; color: var(--text); }
.content code, .prose code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; color: var(--text); }

/* In-page contents */
.toc { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 14px 18px; margin: 0 0 26px; }
.toc .toc-title { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.toc li { margin: 0; }
.toc a { font-size: 13px; color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* Why-use checklist */
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; margin: 4px 0 16px; padding: 0; list-style: none; }
.why-grid li { display: flex; align-items: flex-start; gap: 9px; color: var(--text); font-size: 14px; margin: 0; }
.why-grid .tick { color: var(--ok); font-weight: 700; flex: none; }
.why-grid b { font-weight: 600; }
.why-grid span.note { color: var(--muted); font-weight: 400; }

/* FAQ */
.faq details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 0 0 10px; overflow: hidden; }
.faq summary { cursor: pointer; list-style: none; padding: 14px 18px; font-weight: 600; color: var(--text); font-size: 15px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 20px; font-weight: 400; line-height: 1; font-family: var(--mono); }
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq .faq-body { padding: 14px 18px; color: var(--text-2); }
.faq .faq-body p { margin: 0; }

/* Two-column content + sidebar */
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 244px; gap: 34px; align-items: start; margin-top: 8px; }
.content-layout .content { margin: 0; }
.sidebar { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 14px; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.side-title { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 10px; }
.side-card .blog-link, .side-row { display: block; color: var(--text-2); font-size: 13px; line-height: 1.45; padding: 8px 0; border-top: 1px solid var(--border); }
.side-card .blog-link:first-child, .side-card .side-row:first-of-type { border-top: 0; padding-top: 0; }
.side-card .blog-link:hover, .side-row:hover { color: var(--accent); }
.side-row { display: flex; align-items: center; gap: 8px; }
/* Rotating tip */
.tip-card { background: var(--accent-soft); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 14px 16px; }
.tip-head { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); margin-bottom: 8px; }
.tip-dots { margin-left: auto; display: flex; gap: 4px; }
.tip-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: .3; transition: opacity .3s; }
.tip-dots span.on { opacity: 1; }
.tip-text { font-size: 13px; color: var(--text); line-height: 1.5; min-height: 56px; transition: opacity .35s ease; }
.side-icons { display: flex; gap: 14px; font-size: 18px; }
.side-icons .ico { width: 19px; height: 19px; }
.side-icons a { color: var(--text-2); text-decoration: none; }
.side-icons a:hover { color: var(--accent); }

/* Scroll reveal (JS-gated so no flash / no hiding without JS) */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* ─────────── Aux pages (privacy, 404, request-key) ─────────── */
main.wrap { padding-top: 12px; padding-bottom: 40px; }
.page-head { padding: 34px 0 8px; }
.page-head h1 { font-size: 28px; font-weight: 700; margin: 0 0 8px; letter-spacing: -0.02em; }
.page-head p { color: var(--text-2); margin: 0; }
.prose { max-width: 74ch; }
.prose h2 { font-size: 20px; font-weight: 600; margin: 34px 0 10px; }
.prose h3 { font-size: 16px; font-weight: 600; margin: 22px 0 6px; }
.prose p, .prose li { color: var(--text-2); }
.prose ul { padding-left: 20px; }
.prose li { margin: 5px 0; }
.prose a { text-decoration: underline; }

/* ─────────── Footer ─────────── */
footer { border-top: 1px solid var(--border); margin-top: 34px; padding: 24px 0 40px; color: var(--muted); font-size: 13px; text-align: center; }
footer a { color: var(--text-2); }
footer .v { display: block; margin-top: 6px; font-size: 12px; }
/* An explicit `display` beats the UA's [hidden] rule, so the version slot
   would still reserve a line box before version.json resolves. */
.tool-version-display[hidden] { display: none !important; }
footer .tool-version-display { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; }

/* ─────────── Responsive ─────────── */
@media (max-width: 760px) {
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .spec-card { max-width: 420px; }
  .report-info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .collect-form { grid-template-columns: 1fr; }
  .findings-table .th-val, .findings-table .val-cell { display: none; }
  .hero { padding: 40px 0 24px; }
}
