@font-face {
  font-family: "NaN Metrify A";
  src: url('./fonts/NaNMetrifyANarrow-Reg.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "NaN Metrify A";
  src: url('./fonts/NaNMetrifyANarrow-Med.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "NaN Metrify A";
  src: url('./fonts/NaNMetrifyANarrow-Bld.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "NaN Metrify A";
  src: url('./fonts/NaNMetrifyANarrow-ExBld.ttf') format('truetype');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "NaN Metrify A Std";
  src: url('./fonts/NaNMetrifyAStd-Bld.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #291109;
  --milk: #fff4e0;
  --almost-white: #f5f1e4;
  --grey: #e1dbce;
  --jonquil: #ffcc00;
  --tomato: #d74127;
  --bg: #f7f2e7;
  --surface: rgba(255, 250, 240, 0.78);
  --surface-solid: #fffaf0;
  --surface-muted: #eee6d6;
  --text: #291109;
  --muted: #735f55;
  --border: rgba(41, 17, 9, 0.12);
  --border-strong: rgba(41, 17, 9, 0.26);
  --green: #114e0b;
  --green-bg: #cef5ca;
  --amber: #5e5515;
  --amber-bg: #fcf8d8;
  --red: #3b0b0b;
  --red-bg: #f8e4e4;
  --blue: #291109;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.62) inset, 0 18px 44px rgba(41, 17, 9, 0.08);
  --soft-shadow: 0 10px 28px rgba(41, 17, 9, 0.07);
  --mono: "Fira Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "NaN Metrify A", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans-tight: "NaN Metrify A", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% -8%, rgba(255, 204, 0, 0.12), transparent 28%),
    linear-gradient(180deg, #fbf6ea 0%, var(--bg) 42%, #f1eadc 100%);
  color: var(--text);
  font-family: var(--sans);
  letter-spacing: 0;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

[id] {
  scroll-margin-top: 92px;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

/* ── Topbar ─────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  padding: 10px 20px;
  background: rgba(41, 17, 9, 0.98);
  border-bottom: 1px solid rgba(255, 244, 224, 0.1);
}

@supports (backdrop-filter: blur(1px)) {
  .topbar {
    background: rgba(41, 17, 9, 0.92);
    backdrop-filter: blur(20px) saturate(160%);
  }
}

/* ── Brand ──────────────────────────────────────── */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  color: var(--milk);
  min-width: 0;
}

.brand-mark-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--milk);
}

.brand-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-name {
  color: var(--milk);
  font-family: "NaN Metrify A Std", var(--sans);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-stack {
  color: rgba(255, 244, 224, 0.46);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 244, 224, 0.14);
  flex-shrink: 0;
}

/* ── Nav tabs ───────────────────────────────────── */

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 244, 224, 0.06);
  border: 1px solid rgba(255, 244, 224, 0.1);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, black 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%);
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 13px;
  color: rgba(255, 244, 224, 0.62);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-tab.is-active {
  color: var(--ink);
  background: var(--almost-white);
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.58) inset;
}

.nav-tab:not(.is-active):hover {
  color: var(--almost-white);
  background: rgba(255, 244, 224, 0.08);
}

.nav-tab:active {
  transform: translateY(1px);
}

.tab-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke-width: 1.5;
  opacity: 0.85;
}

/* ── Topbar actions ─────────────────────────────── */

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.chain-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(255, 244, 224, 0.16);
  border-radius: 999px;
  background: rgba(255, 244, 224, 0.08);
  box-shadow: rgba(255, 255, 255, 0.1) 0 1px 0 0 inset;
  color: rgba(255, 244, 224, 0.62);
  font-size: 12px;
}

.chain-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 244, 224, 0.5);
  flex-shrink: 0;
}

.chain-label strong {
  color: var(--almost-white);
  font-size: 12px;
  font-weight: 700;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #46aa54;
  box-shadow: 0 0 0 3px rgba(70, 170, 84, 0.2);
  animation: breathe 1.8s ease-in-out infinite;
  flex-shrink: 0;
}

.live-dot.is-paused {
  background: var(--jonquil);
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.2);
  animation: none;
}

.topbar .live-dot {
  box-shadow: 0 0 0 3px rgba(70, 170, 84, 0.24);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--almost-white);
  background: rgba(255, 244, 224, 0.08);
  border: 1px solid rgba(255, 244, 224, 0.16);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.icon-button:hover {
  background: rgba(255, 244, 224, 0.14);
  border-color: rgba(255, 244, 224, 0.28);
}

.icon-button:active {
  transform: translateY(1px);
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

/* ── Main layout ────────────────────────────────── */

main {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

/* ── Typography ─────────────────────────────────── */

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--sans-tight);
}

p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -0.04em;
  max-width: 700px;
  overflow-wrap: break-word;
}

h2 {
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h3 {
  font-size: 11px;
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

/* ── Proof hero ─────────────────────────────────── */

.proof-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.hero-copy {
  max-width: 660px;
  min-width: 0;
}

.hero-copy p {
  margin-top: 10px;
  color: rgba(41, 17, 9, 0.72);
  font-size: 15px;
  line-height: 1.5;
  max-width: 620px;
}

/* ── Stack rail ─────────────────────────────────── */

.stack-rail {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.stack-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  font-family: var(--sans-tight);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chip-ps {
  background: #291109;
  color: #fff4e0;
}

.chip-fynd {
  background: #d74127;
  color: #f5f1e4;
}

.chip-tycho {
  background: #e1dbce;
  color: #291109;
}

.stack-arrow {
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}

/* ── Hero status (right side of hero) ───────────── */

.hero-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 4px;
}

.stream-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  background: rgba(255, 250, 240, 0.76);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.source-badge {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 260px;
  padding: 9px 12px;
  background: rgba(255, 204, 0, 0.08);
  border: 1px solid rgba(255, 204, 0, 0.28);
  border-radius: 12px;
  font-size: 11.5px;
  line-height: 1.4;
}

.source-badge strong {
  color: #6a5200;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.source-badge span {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.source-badge.is-production {
  background: rgba(70, 170, 84, 0.08);
  border-color: rgba(70, 170, 84, 0.28);
}

.source-badge.is-production strong {
  color: #114e0b;
}

/* ── Spotlight grid ─────────────────────────────── */

.spotlight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: 12px;
  margin-bottom: 12px;
}

.spotlight-card,
.evidence-card {
  background:
    linear-gradient(135deg, rgba(255, 244, 224, 0.05), rgba(255, 244, 224, 0)),
    var(--ink);
  border: 1px solid rgba(245, 241, 228, 0.14);
  border-radius: 20px;
  color: var(--almost-white);
  box-shadow: rgba(255, 255, 255, 0.12) 0 1px 0 0 inset, 0 20px 48px rgba(41, 17, 9, 0.12);
}

.spotlight-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.spotlight-card::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 244, 224, 0.07) 42%, transparent 58%);
  transform: translateX(-120%);
  animation: sweep 7s ease-in-out infinite;
}

.spotlight-kicker {
  color: rgba(245, 241, 228, 0.52);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.spotlight-main {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 12px;
}

.spotlight-main h2 {
  color: var(--almost-white);
  font-size: 28px;
  line-height: 1;
  text-transform: none;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.spotlight-main p {
  margin-top: 6px;
  color: rgba(245, 241, 228, 0.62);
  font-size: 13px;
  line-height: 1.5;
  max-width: 440px;
}

.spotlight-main strong {
  flex: 0 0 auto;
  font-family: "NaN Metrify A", var(--sans);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--tomato);
}

/* ── Route ladder ───────────────────────────────── */

.route-ladder {
  display: grid;
  gap: 5px;
  margin-top: 18px;
}

.route-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 112px 112px;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 9px 12px;
  background: rgba(245, 241, 228, 0.07);
  border: 1px solid rgba(245, 241, 228, 0.08);
  border-radius: 10px;
  color: rgba(245, 241, 228, 0.72);
  font-size: 12.5px;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.route-step:hover {
  transform: translateX(3px);
  border-color: rgba(245, 241, 228, 0.2);
}

.route-step.is-chosen {
  background: rgba(70, 170, 84, 0.18);
  border-color: rgba(70, 170, 84, 0.32);
  color: #cef5ca;
}

.route-step.is-chosen .route-rank {
  color: #cef5ca;
}

.route-rank,
.route-score,
.route-gas {
  font-family: var(--mono);
  font-size: 11px;
}

.route-rank {
  opacity: 0.7;
}

.route-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

/* ── Evidence card ──────────────────────────────── */

.evidence-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.evidence-card h2 {
  color: var(--almost-white);
}

.evidence-card > p {
  margin-top: 8px;
  color: rgba(245, 241, 228, 0.62);
  font-size: 13px;
  line-height: 1.55;
}

.evidence-card dl {
  display: grid;
  gap: 6px;
  margin: auto 0 0;
  padding-top: 14px;
}

.evidence-card div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  background: rgba(245, 241, 228, 0.07);
  border: 1px solid rgba(245, 241, 228, 0.08);
  border-radius: 10px;
}

.evidence-card dt {
  color: rgba(245, 241, 228, 0.5);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.evidence-card dd {
  margin: 0;
  color: var(--almost-white);
  font-size: 13px;
  font-weight: 600;
}

/* ── Metrics grid ───────────────────────────────── */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  min-height: 108px;
  padding: 16px 18px;
  background: rgba(255, 250, 240, 0.6);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
}

.metric-label,
.metric-sub {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric strong {
  display: block;
  margin: 8px 0 6px;
  font-family: "NaN Metrify A", var(--sans);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.metric-pop {
  animation: metric-pop 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ── Content grid ───────────────────────────────── */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

/* ── Feed panel ─────────────────────────────────── */

.feed-panel,
.verification-panel,
.schema-panel,
.methodology-grid article,
.raw-preview {
  background: rgba(255, 250, 240, 0.66);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-toolbar > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.panel-toolbar span {
  color: var(--muted);
  font-size: 11.5px;
}

.toolbar-controls,
.raw-actions,
.export-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-controls label,
.export-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Table ──────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--ink);
  background: rgba(239, 231, 215, 0.6);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--sans-tight);
}

td {
  font-size: 13px;
  background: rgba(255, 250, 240, 0.34);
}

tbody tr:hover td {
  background: rgba(255, 244, 224, 0.82);
}

/* Outcome accent borders */
.feed-row.filled td:first-child {
  box-shadow: inset 3px 0 0 #46aa54;
}

.feed-row.lost td:first-child {
  box-shadow: inset 3px 0 0 #d74127;
}

.feed-row.expired td:first-child {
  box-shadow: inset 3px 0 0 #a83b1a;
}

.feed-row {
  animation: row-in 0.34s ease both;
}

.mono {
  font-family: var(--mono);
}

.muted {
  color: var(--muted);
}

/* ── Status badges ──────────────────────────────── */

.status {
  display: inline-flex;
  align-items: center;
  min-width: 60px;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status.filled,
.route-trace.complete {
  color: var(--green);
  background: var(--green-bg);
}

.status.lost {
  color: #7d1f0a;
  background: #fde4dd;
}

.route-trace.partial {
  color: var(--amber);
  background: var(--amber-bg);
}

.status.expired,
.route-trace.failed {
  color: var(--red);
  background: var(--red-bg);
}

.route-trace.pending {
  color: var(--muted);
  background: var(--surface-muted);
}

.protocol-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 3px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 5px;
  vertical-align: middle;
}

.protocol-uniswapx {
  background: #291109;
  color: #fff4e0;
}

.protocol-1inch-fusion {
  background: #e1dbce;
  color: #291109;
}

.surplus-pos {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-bg);
}

.solve-fast {
  color: var(--green);
  font-family: var(--mono);
  font-weight: 700;
}

.solve-slow {
  color: #7d1f0a;
  font-family: var(--mono);
  font-weight: 700;
}

.route {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.links {
  display: inline-flex;
  gap: 10px;
}

.links a,
.expand-button {
  color: var(--blue);
}

.links a {
  font-size: 12px;
  font-weight: 600;
  text-decoration-color: rgba(41, 17, 9, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.links a:hover {
  text-decoration-color: var(--blue);
}

.expand-button {
  width: 44px;
  height: 44px;
  margin-right: 2px;
  margin-left: -9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.expand-button:hover {
  color: var(--ink);
  background: rgba(41, 17, 9, 0.08);
  border-color: var(--border);
}

/* ── Details row ────────────────────────────────── */

.details-row td {
  padding: 0;
  background: rgba(239, 231, 215, 0.62);
  white-space: normal;
}

.details-card {
  min-width: 940px;
  padding: 16px 20px 20px 68px;
  animation: details-in 0.24s ease both;
}

.details-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.details-meta .mono {
  font-size: 11.5px;
}

.candidate-list {
  display: grid;
  gap: 7px;
}

.candidate-card {
  display: grid;
  grid-template-columns: 44px minmax(220px, 1fr) minmax(150px, 0.7fr) 100px 100px 68px;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 11px 14px;
  background: rgba(255, 250, 240, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.62) inset;
}

.candidate-card.is-chosen {
  background: var(--green-bg);
  border-color: rgba(17, 78, 11, 0.18);
}

.candidate-rank {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--muted);
  background: rgba(41, 17, 9, 0.06);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.candidate-card.is-chosen .candidate-rank {
  background: rgba(17, 78, 11, 0.12);
  color: var(--green);
}

.candidate-route {
  min-width: 0;
}

.candidate-route strong,
.candidate-route span,
.candidate-stat span,
.candidate-stat strong {
  display: block;
}

.candidate-route strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-route span,
.candidate-stat span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.candidate-stat strong {
  margin-top: 2px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Controls: selects, inputs, buttons ─────────── */

select,
input {
  min-height: 36px;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
  font-size: 13px;
}

select {
  min-width: 120px;
  padding: 0 30px 0 10px;
  cursor: pointer;
}

input {
  width: 140px;
  padding: 0 10px;
  font-family: var(--mono);
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 250, 240, 0.72);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: rgba(255, 255, 255, 0.42) 0 1px 1px 0 inset;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.text-button:hover {
  background: var(--surface-solid);
  border-color: var(--border-strong);
}

.text-button:active {
  transform: translateY(1px);
}

.text-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

/* ── Verification panel ─────────────────────────── */

.verification-panel {
  display: grid;
  grid-template-columns: 1.2fr 1.05fr 0.82fr;
}

.verification-panel section {
  padding: 18px;
  border-right: 1px solid var(--border);
}

.verification-panel section:last-child {
  border-right: 0;
}

.verification-panel p {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.5;
}

.summary-line {
  color: var(--text);
  font-weight: 600;
  font-size: 13px !important;
}

.empty-state {
  display: grid;
  gap: 5px;
  padding: 24px 14px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  font-size: 14px;
}

.checklist ul {
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 10px 0 0;
  list-style: none;
  color: var(--text);
  font-size: 12.5px;
}

.check {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #46aa54;
  flex-shrink: 0;
}

.check.pending {
  background: var(--jonquil);
}

.check.failed {
  background: var(--tomato);
}

.rate-box dl {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}

.rate-box div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.rate-box dt {
  color: var(--muted);
  font-size: 12.5px;
}

.rate-box dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

/* ── Narrow views (methodology, local, raw) ─────── */

.narrow-view {
  max-width: 1080px;
  margin: 0 auto;
}

.section-header,
.raw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.raw-header {
  align-items: flex-start;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.raw-header p {
  margin-top: 8px;
  font-size: 14px;
  max-width: 600px;
}

.narrow-view > h1 {
  padding-top: 20px;
}

.methodology-lede {
  max-width: 760px;
  margin-top: 10px;
  color: rgba(41, 17, 9, 0.72);
  font-size: 16px;
  line-height: 1.55;
}

.methodology-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.methodology-grid article {
  padding: 20px;
}

.methodology-grid article h2 {
  color: var(--ink);
}

.methodology-grid article p {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.6;
}

.schema-panel {
  margin-top: 12px;
  padding: 20px;
}

.schema-panel h2 {
  color: var(--ink);
}

pre {
  margin: 14px 0 0;
  overflow: auto;
  color: var(--ink);
  background: rgba(239, 231, 215, 0.72);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  padding: 16px;
}

.raw-preview {
  min-height: 520px;
  margin-top: 0;
}

.export-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  flex-wrap: wrap;
}

.export-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Animations ─────────────────────────────────── */

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 3px rgba(70, 170, 84, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(70, 170, 84, 0.07); }
}

@keyframes sweep {
  0%, 45% { transform: translateX(-120%); }
  68%, 100% { transform: translateX(120%); }
}

@keyframes metric-pop {
  0% { transform: translateY(2px); opacity: 0.7; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes details-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive: 1120px ─────────────────────────── */

@media (max-width: 1120px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 10px;
  }

  .nav-tabs {
    order: 3;
    width: 100%;
    min-height: 42px;
    overflow-x: auto;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .spotlight-grid {
    grid-template-columns: 1fr;
  }

  .verification-panel {
    grid-template-columns: 1fr;
  }

  .verification-panel section {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .verification-panel section:last-child {
    border-bottom: 0;
  }
}

/* ── Responsive: 820px ──────────────────────────── */

@media (max-width: 820px) {
  main {
    padding: 14px;
  }

  .proof-hero {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .hero-status {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .source-badge {
    max-width: 100%;
  }

  h1 {
    font-size: clamp(22px, 6vw, 30px);
    max-width: 100%;
  }

  .hero-copy p {
    max-width: 100%;
    font-size: 14px;
  }

  .stack-rail {
    margin-top: 12px;
  }

  .route-step {
    grid-template-columns: 36px minmax(0, 1fr);
    min-width: 0;
  }

  .route-score,
  .route-gas {
    display: none;
  }

  .route-name {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .spotlight-card,
  .evidence-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .spotlight-main {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .spotlight-main h2 {
    font-size: 24px;
  }

  .spotlight-main p {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .spotlight-main strong {
    font-size: 24px;
  }

  .details-card {
    min-width: 680px;
    padding-left: 52px;
  }

  .candidate-card {
    grid-template-columns: 40px minmax(160px, 1fr) minmax(120px, 0.7fr) 86px;
  }

  .candidate-card .candidate-stat:nth-of-type(4),
  .candidate-card .candidate-stat:nth-of-type(5) {
    display: none;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .methodology-grid {
    grid-template-columns: 1fr;
  }

  .panel-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .raw-header {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-tab {
    min-width: 100px;
    flex: 0 0 auto;
    justify-content: center;
  }

  .brand-stack {
    display: none;
  }
}

/* ── Responsive: 480px ──────────────────────────── */

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  /* Hide lower-priority table columns on phones */
  th:nth-child(6),
  td:nth-child(6),
  th:nth-child(7),
  td:nth-child(7),
  th:nth-child(8),
  td:nth-child(8) {
    display: none;
  }

  .stack-chip {
    font-size: 10px;
    height: 24px;
    padding: 0 9px;
  }
}

/* ── Reduced motion ─────────────────────────────── */

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