:root {
  color-scheme: dark;
  --bg: #071014;
  --surface: #0c181d;
  --surface-raised: #112128;
  --line: #294149;
  --line-strong: #43606a;
  --text: #eff8f4;
  --text-soft: #b6c9c5;
  --text-dim: #819a96;
  --cyan: #65e5dc;
  --cyan-deep: #163b3d;
  --amber: #ffc46b;
  --amber-deep: #3f301c;
  --red: #ff928a;
  --red-deep: #442321;
  --green: #8ce5ac;
  --green-deep: #173626;
  --radius: 16px;
  --shadow: 0 20px 60px rgb(0 0 0 / 28%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% -10%, rgb(61 155 151 / 16%), transparent 34rem),
    linear-gradient(180deg, #081216 0%, var(--bg) 38rem);
  color: var(--text);
  line-height: 1.55;
}

a { color: var(--cyan); text-underline-offset: 0.2em; }
a:hover { color: #a0fff7; }

button,
input,
select { font: inherit; }

button,
input,
select,
summary,
a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid rgb(101 229 220 / 18%);
  background: rgb(7 16 20 / 90%);
  backdrop-filter: blur(18px);
}

.header-inner,
.footer-inner {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 750;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  color: var(--cyan);
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.78rem;
}

nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }

nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--text-soft);
  font-size: 0.88rem;
  text-decoration: none;
}

nav a[aria-current="page"] { color: var(--cyan); }

main { padding-block: 64px 80px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(230px, 0.65fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow,
.metric-label {
  margin: 0 0 8px;
  color: var(--cyan);
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p { overflow-wrap: anywhere; }

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 5.7rem);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  letter-spacing: -0.025em;
}

.lede {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
}

.hero-actions { display: grid; gap: 10px; justify-items: stretch; }

.button {
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--cyan);
  border-radius: 10px;
  background: var(--cyan);
  color: #061416;
  cursor: pointer;
  font-weight: 760;
}

.button:hover { background: #9cfff7; }
.button:disabled { cursor: wait; opacity: 0.65; }

.refresh-status {
  min-height: 2.8em;
  margin: 0;
  color: var(--text-dim);
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.74rem;
}

.boundary {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding: 15px 18px;
  border: 1px solid #76582f;
  border-radius: 12px;
  background: rgb(63 48 28 / 52%);
  color: #ffe2b5;
}

.boundary strong { flex: 0 0 auto; }

.summary-grid,
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgb(17 33 40 / 95%), rgb(9 22 27 / 95%));
  box-shadow: var(--shadow);
}

.metric { min-height: 154px; padding: 20px; }

.metric-value {
  margin: 18px 0 6px;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
}

.metric-note {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.79rem;
}

.status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  width: fit-content;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.metric-value.status { margin-top: 18px; font-size: 0.78rem; }
.status[data-tone="good"] { border-color: #3b8e5c; background: var(--green-deep); color: var(--green); }
.status[data-tone="warn"] { border-color: #8b6532; background: var(--amber-deep); color: var(--amber); }
.status[data-tone="bad"] { border-color: #98524c; background: var(--red-deep); color: var(--red); }

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 16px;
  margin-top: 16px;
}

.panel { padding: 24px; }

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.35fr);
  gap: 12px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #071318;
  color: var(--text);
}

input::placeholder { color: #718985; opacity: 1; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

caption {
  padding: 0 0 12px;
  color: var(--text-dim);
  text-align: left;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text-dim);
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inspect-button {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  text-align: left;
}

.inspect-button:hover,
.inspect-button[aria-pressed="true"] { border-color: var(--cyan); background: var(--cyan-deep); }

.cell-primary { display: block; color: var(--text); font-weight: 700; }
.cell-secondary { display: block; margin-top: 3px; color: var(--text-dim); font-size: 0.72rem; }
.mono { font-family: "Roboto Mono", ui-monospace, monospace; font-size: 0.75rem; }

.empty-state,
.inspector-intro,
.noscript {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--text-dim);
}

.batch-note {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.76rem;
}

.inspector dl { display: grid; gap: 0; margin: 0; }

.inspector dl > div {
  display: grid;
  grid-template-columns: minmax(105px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

dt { color: var(--text-dim); font-size: 0.72rem; }
dd { min-width: 0; margin: 0; font-family: "Roboto Mono", ui-monospace, monospace; font-size: 0.73rem; overflow-wrap: anywhere; }
.digest { word-break: break-all; }

details { margin-top: 18px; }
summary { min-height: 44px; cursor: pointer; color: var(--cyan); }
pre {
  max-height: 380px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #061014;
  color: #cce0dc;
  font-size: 0.7rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.evidence-grid .panel > p:not(.eyebrow) { color: var(--text-soft); }

.disclosure-list,
.endpoint-list { margin: 18px 0 0; padding: 0; list-style: none; }

.disclosure-list li {
  padding: 10px 0 10px 20px;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  position: relative;
}

.disclosure-list li::before { position: absolute; left: 2px; content: "—"; color: var(--amber); }

.endpoint-list li {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
}

code { color: var(--text-dim); font-family: "Roboto Mono", ui-monospace, monospace; font-size: 0.7rem; }

.site-footer { border-top: 1px solid var(--line); color: var(--text-dim); font-size: 0.76rem; }

@media (max-width: 920px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .hero-actions { justify-items: start; }
  .button { min-width: 220px; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 28px, 1180px); }
  .header-inner { align-items: flex-start; flex-direction: column; gap: 0; padding-block: 10px; }
  nav { width: 100%; }
  nav a { flex: 1 1 auto; }
  main { padding-block: 42px 56px; }
  .boundary { flex-direction: column; gap: 5px; }
  .summary-grid,
  .evidence-grid,
  .filters { grid-template-columns: 1fr; }
  .metric { min-height: 132px; }
  .panel { padding: 18px; }
  .panel-heading { flex-direction: column; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 5px; padding-block: 18px; }

  table,
  tbody,
  tr,
  td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  tr { padding: 10px 0; border-bottom: 1px solid var(--line-strong); }
  td { display: grid; grid-template-columns: minmax(90px, 0.4fr) minmax(0, 1fr); gap: 12px; padding: 8px 0; border: 0; }
  td::before { content: attr(data-label); color: var(--text-dim); font-family: "Roboto Mono", ui-monospace, monospace; font-size: 0.67rem; letter-spacing: 0.06em; text-transform: uppercase; }
  .inspect-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

@media (forced-colors: active) {
  .status,
  .metric,
  .panel,
  .boundary { border: 1px solid CanvasText; }
  .button { forced-color-adjust: none; background: Highlight; color: HighlightText; }
}

@media print {
  .site-header,
  .hero-actions,
  .filters { display: none; }
  body { background: #fff; color: #000; }
  .shell { width: 100%; }
  main { padding: 0; }
  .metric,
  .panel,
  .boundary { break-inside: avoid; box-shadow: none; background: #fff; color: #000; }
}
