:root {
  --bg: #0a1422;
  --bg-2: #0d1a2b;
  --panel: #111f30;
  --panel-2: #0c1827;
  --line: #22364a;
  --line-2: #2d4659;
  --text: #eef4f7;
  --muted: #93a8b7;
  --faint: #8a9dac;
  --teal: #2cc3b0;
  --teal-strong: #0b7a70;
  --teal-hover: #096359;
  --teal-soft: #103a3c;
  --high: #f2a39b;
  --high-bg: #3d2226;
  --med: #f1c77e;
  --med-bg: #3a3020;
  --low: #a9c7e8;
  --low-bg: #1b2d44;
  --info: #9fb2c0;
  --info-bg: #1a2735;
  --ok: #7fdcc4;
  --ok-bg: #133a33;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
a { color: var(--teal); text-underline-offset: 2px; }
a:hover { color: #6fe6d4; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--teal-strong); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-head { border-bottom: 1px solid var(--line); background: rgba(10, 20, 34, .92); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px); }
.site-head .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; margin-right: auto; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--teal-soft); border: 1px solid #245e5d; display: grid; place-items: center; }
.brand b { font-size: 18px; letter-spacing: -.3px; }
.brand small { display: block; font-size: 10.5px; letter-spacing: 1.4px; color: var(--muted); font-weight: 600; }
nav.main { display: flex; gap: 4px; align-items: center; }
nav.main a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 550; }
nav.main a:hover, nav.main a[aria-current="page"] { color: var(--text); background: var(--panel); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; background: var(--teal-strong); color: #fff; font: inherit; font-weight: 650; font-size: 14px; padding: 10px 16px; border-radius: 10px; cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 42px; }
.btn:hover { background: var(--teal-hover); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn.ghost:hover { background: var(--panel); }
.btn.sm { padding: 6px 11px; min-height: 34px; font-size: 13px; }
.menu-toggle { display: none; }

.banner { background: var(--med-bg); color: var(--med); border-bottom: 1px solid #5a4a27; font-size: 13px; }
.banner .wrap { padding: 9px 20px; }

main { padding: 28px 0 56px; }
h1 { font-size: clamp(26px, 4.2vw, 40px); line-height: 1.15; letter-spacing: -1px; margin: 0 0 10px; }
h2 { font-size: 18px; margin: 0; letter-spacing: -.2px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.lede { color: var(--muted); max-width: 640px; font-size: 16px; }
.eyebrow { font-size: 11.5px; letter-spacing: 1.6px; font-weight: 700; color: var(--teal); text-transform: uppercase; margin-bottom: 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.mono { font-family: var(--mono); font-size: .92em; overflow-wrap: anywhere; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack > * + * { margin-top: 16px; }

/* scan form */
.scan-form { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; margin-top: 18px; }
.scan-form input { min-width: 0; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); border-radius: 10px; padding: 12px 14px; font: 14px var(--mono); min-height: 46px; }
.scan-form input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(44, 195, 176, .18); }
.form-hint { color: var(--muted); font-size: 13px; margin-top: 10px; }
.form-error { color: var(--high); font-size: 13.5px; margin-top: 8px; min-height: 1em; }

/* metrics */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-width: 0; }
.kpi .label { color: var(--muted); font-size: 12.5px; }
.kpi .value { font-size: 22px; font-weight: 700; letter-spacing: -.4px; margin-top: 4px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kpi .src { color: var(--faint); font-size: 11.5px; margin-top: 4px; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; padding: 3px 8px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.chip.onchain { background: var(--ok-bg); color: var(--ok); border-color: #22594b; }
.chip.third_party { background: var(--low-bg); color: var(--low); border-color: #2e4a6b; }
.chip.suspected { background: var(--med-bg); color: var(--med); border-color: #5a4a27; }
.chip.unavailable { background: var(--info-bg); color: var(--info); border-color: #33465a; }
.chip.sev-high { background: var(--high-bg); color: var(--high); border-color: #6b3a3f; }
.chip.sev-medium { background: var(--med-bg); color: var(--med); border-color: #5a4a27; }
.chip.sev-low { background: var(--low-bg); color: var(--low); border-color: #2e4a6b; }
.chip.sev-info { background: var(--info-bg); color: var(--info); border-color: #33465a; }
.chip.st-complete, .chip.st-available { background: var(--ok-bg); color: var(--ok); border-color: #22594b; }
.chip.st-partial, .chip.st-running, .chip.st-rate_limited, .chip.st-timeout, .chip.st-budget_exhausted { background: var(--med-bg); color: var(--med); border-color: #5a4a27; }
.chip.st-failed, .chip.st-unavailable { background: var(--high-bg); color: var(--high); border-color: #6b3a3f; }
.chip.st-not_found, .chip.st-skipped { background: var(--info-bg); color: var(--info); border-color: #33465a; }
.chip.fixture { background: #4a3a14; color: #ffd58a; border-color: #7a5e22; }

/* findings */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { background: transparent; border: 1px solid var(--line-2); color: var(--muted); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12.5px; cursor: pointer; min-height: 32px; }
.filters button[aria-pressed="true"] { background: var(--teal-soft); color: var(--text); border-color: #245e5d; }
.finding { border-top: 1px solid var(--line); padding: 14px 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.finding:first-child { border-top: 0; padding-top: 4px; }
.finding .badges { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; min-width: 92px; }
.finding .t { font-weight: 650; }
.finding .d { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.finding .meta { color: var(--faint); font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }
.finding .meta a { color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--panel-2); position: sticky; top: 0; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }

.kv { display: grid; grid-template-columns: minmax(120px, 42%) 1fr; gap: 9px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.progress { height: 8px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--teal); transition: width .4s ease; }

.notice { border: 1px solid #5a4a27; background: #2a2518; color: #f0d9a6; border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.notice.info { border-color: var(--line-2); background: var(--panel-2); color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { color: var(--muted); padding: 14px 0; font-size: 14px; }
.status-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 7px 0; border-top: 1px solid var(--line); }
.status-row:first-of-type { border-top: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); margin-right: 6px; vertical-align: middle; }
.dot.ok { background: var(--teal); }
.dot.warn { background: var(--med); }
.dot.bad { background: var(--high); }
.prose { max-width: 760px; }
.prose h2 { margin: 28px 0 10px; }
.prose ul { padding-left: 20px; margin: 0 0 12px; }
.prose li { margin: 4px 0; color: var(--muted); }
.prose p { color: var(--muted); }
.prose p strong, .prose li strong { color: var(--text); }
.grok-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
footer.site-foot { border-top: 1px solid var(--line); color: var(--faint); font-size: 12.5px; padding: 22px 0 36px; }
footer.site-foot .wrap { display: flex; gap: 14px 22px; flex-wrap: wrap; justify-content: space-between; }
footer.site-foot a { color: var(--muted); }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } .progress > i { transition: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 960px) {
  .grid.two { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .menu-toggle { display: inline-flex; }
  nav.main { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-2); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 16px 14px; }
  nav.main.open { display: flex; }
  nav.main a { padding: 11px 10px; }
  .site-head .grok-top { display: none; }
  .scan-form { grid-template-columns: 1fr 1fr; }
  .scan-form input { grid-column: 1 / -1; }
  .grid.halves { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .finding { grid-template-columns: 1fr; }
  .finding .badges { flex-direction: row; flex-wrap: wrap; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  main { padding-top: 20px; }
}
.status-row > .chip, .panel-head > .chip { flex-shrink: 0; }
td a.mono, .finding .meta a.mono { white-space: nowrap; }
@media (max-width: 720px) { .kpi .value { font-size: 19px; } .brand small { letter-spacing: .6px; } }
details.faq { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin: 10px 0; }
details.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 650; color: var(--text); list-style-position: inside; }
details.faq[open] summary { border-bottom: 1px solid var(--line); }
details.faq > div { padding: 12px 16px 4px; }

/* Auto-Poster review and private case reports (phone-first) */
.case-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.case-sec { border-top: 1px solid var(--line, #1e293b); padding-top: 10px; margin-top: 12px; }
.case-sec h3 { font-size: 15px; margin: 0 0 6px; }
.case-items { margin: 0; padding-left: 18px; }
.case-items li { margin: 6px 0; line-height: 1.45; overflow-wrap: anywhere; }
.case-links { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 4px; }
.case-links a { padding: 4px 0; }
@media (max-width: 640px) {
  .case-actions .btn { min-height: 44px; flex: 1 1 calc(50% - 8px); }
  .case-report h2 { font-size: 18px; overflow-wrap: anywhere; }
}
/* Grid children may shrink below their content so wide tables scroll inside .table-wrap instead of the page. */
.grid > * { min-width: 0; }
.table-wrap { max-width: 100%; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.kv dd input, .kv dd select { max-width: 100%; }
.case-sec pre, .case-items li { overflow-wrap: anywhere; }
