:root {
  --bg: #f2f5f7;
  --surface: #ffffff;
  --ink: #0f1b28;
  --ink-2: #46586c;
  --ink-muted: #7c8b9c;
  --line: #dfe6ec;
  --accent: #00a06b;
  --accent-deep: #067d58;
  --accent-soft: #d7f2e6;
  --marker: #0f1b28;
  --chip-bg: #e9eef2;
  --good: #067d58;
  --warn: #b45309;
  --head-bg: rgba(255, 255, 255, 0.88);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c141d;
    --surface: #131f2b;
    --ink: #e9eef2;
    --ink-2: #a7b6c4;
    --ink-muted: #71818f;
    --line: #24313f;
    --accent: #2bd99f;
    --accent-deep: #55e0b1;
    --accent-soft: #12362b;
    --marker: #e9eef2;
    --chip-bg: #1c2937;
    --good: #4ade80;
    --warn: #fbbf24;
    --head-bg: rgba(12, 20, 29, 0.88);
  }
}
:root[data-theme="dark"] {
  --bg: #0c141d;
  --surface: #131f2b;
  --ink: #e9eef2;
  --ink-2: #a7b6c4;
  --ink-muted: #71818f;
  --line: #24313f;
  --accent: #2bd99f;
  --accent-deep: #55e0b1;
  --accent-soft: #12362b;
  --marker: #e9eef2;
  --chip-bg: #1c2937;
  --good: #4ade80;
  --warn: #fbbf24;
  --head-bg: rgba(12, 20, 29, 0.88);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

/* ---------- header / nav ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: var(--head-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head-inner {
  max-width: 860px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  font-weight: 800; font-size: 1rem; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.brand-mark { color: var(--accent); font-size: 0.8rem; letter-spacing: -0.12em; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-2); text-decoration: none; font-size: 0.86rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
}
.site-nav a:hover { color: var(--accent-deep); background: var(--accent-soft); }
.site-nav a.active { color: var(--accent-deep); background: var(--accent-soft); }
.nav-more { position: relative; }
.nav-more summary {
  list-style: none; cursor: pointer; color: var(--ink-2); font-size: 0.86rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
}
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary:hover, .nav-more[open] summary { color: var(--accent-deep); background: var(--accent-soft); }
.nav-drop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 27, 40, 0.14); padding: 8px;
}
.nav-drop a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.nav-drop a:hover { background: var(--accent-soft); color: var(--accent-deep); }

.agent-cta {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 14px; padding: 18px 20px; margin: 28px 0 8px;
}
.agent-cta-head { font-weight: 800; letter-spacing: -0.01em; margin-bottom: 4px; }
.agent-cta-sub { font-size: 0.88rem; color: var(--ink-2); margin: 0 0 10px; }
.agent-cta-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 6px; }
.agent-cta-code {
  flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 0.82rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink); overflow-x: auto; white-space: pre-wrap; word-break: break-word;
}
.agent-cta-copy {
  flex: 0 0 auto; font-size: 0.82rem; padding: 0 16px; border-radius: 10px;
  background: var(--accent); color: #fff; border: none; font-weight: 700; cursor: pointer;
}
.agent-cta-power summary { font-size: 0.8rem; color: var(--ink-muted); cursor: pointer; margin: 8px 0; }

.wrap { max-width: 860px; margin: 0 auto; padding: 36px 20px 0; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; margin: 0 0 8px; text-wrap: balance; }
.sub { color: var(--ink-2); margin: 0 0 26px; font-size: 1.05rem; max-width: 62ch; }
h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; margin: 26px 0 8px; }
.wrap ul { padding-left: 20px; }
a { color: var(--accent-deep); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- lookup form ---------- */
.lookup {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px;
  box-shadow: 0 1px 3px rgba(15, 27, 40, 0.06);
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field.grow { flex: 1 1 150px; }
.field label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); }
input, select {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
button {
  font: inherit; font-weight: 700; color: #fff; background: var(--accent);
  border: none; border-radius: 10px; padding: 11px 22px; cursor: pointer;
}
:root[data-theme="dark"] button, body button { color: #fff; }
button:hover { background: var(--accent-deep); }
button:disabled { opacity: 0.6; cursor: wait; }

.coverage-known { flex-basis: 100%; border: none; border-top: 1px solid var(--line); margin: 4px 0 0; padding: 12px 0 0; }
.coverage-known summary { font-size: 0.78rem; color: var(--ink-muted); cursor: pointer; margin-bottom: 8px; }
.ov-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.ov-grid label { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--ink-2); }
.ov-grid select { font-size: 0.82rem; padding: 5px 8px; }

.status { margin: 18px 0; color: var(--warn); }
.status.info { color: var(--ink-2); }

/* ---------- results ---------- */
.loc-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 24px 0 14px; color: var(--ink-2); }
.chip { background: var(--chip-bg); color: var(--ink-2); border-radius: 999px; padding: 2px 12px; font-size: 0.8rem; white-space: nowrap; }

.verdict {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 14px; padding: 16px 18px; margin: 22px 0 14px; font-size: 1.02rem;
  box-shadow: 0 1px 3px rgba(15, 27, 40, 0.06);
}
.verdict.compact { font-size: 0.9rem; padding: 12px 16px; margin: 0 0 14px; color: var(--ink-2); }
.verdict.compact a { color: var(--accent-deep); font-weight: 700; text-decoration: none; white-space: nowrap; }
.verdict .v-good { color: var(--good); font-weight: 600; }
.verdict .v-warn { color: var(--warn); font-weight: 600; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(15, 27, 40, 0.06);
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--accent); }
.card.highlight { border-color: var(--accent); }
.card.dim { opacity: 0.68; }
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.avail { font-size: 0.78rem; color: var(--ink-muted); }
.avail.confirmed { color: var(--good); }
.avail.auto { color: var(--accent-deep); }

.brand-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 5px; border-radius: 8px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.02em;
  margin-right: 8px; vertical-align: middle;
}
.brand-link { color: inherit; text-decoration: none; }
.brand-link:hover { color: var(--accent-deep); }

.range-label { font-size: 0.92rem; margin-bottom: 6px; display: flex; gap: 18px; flex-wrap: wrap; }
.range-label strong { font-variant-numeric: tabular-nums; }
.io-row { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 8px; border-radius: 4px; display: inline-block; }
.swatch.solid { background: var(--accent); }
.swatch.soft { background: var(--accent-soft); }

.scale { position: relative; height: 18px; margin: 4px 0 2px; }
.scale .track { position: absolute; top: 7px; left: 0; right: 0; height: 4px; background: var(--chip-bg); border-radius: 2px; }
.scale .band { position: absolute; top: 5px; height: 8px; border-radius: 4px; background: var(--accent); }
.scale .band.soft { background: var(--accent-soft); }
.scale .marker { position: absolute; top: 0; width: 2px; height: 18px; background: var(--marker); }
.scale-axis { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--ink-muted); margin-bottom: 8px; }
.marker-note { font-size: 0.78rem; color: var(--ink-2); margin: 2px 0 8px; }
.meta { font-size: 0.84rem; color: var(--ink-2); display: flex; gap: 18px; flex-wrap: wrap; }
.meta .faster, .faster { color: var(--good); font-weight: 600; }
.note { font-size: 0.8rem; color: var(--ink-muted); margin-top: 8px; }

.deal { display: inline-block; margin-top: 10px; font-size: 0.88rem; font-weight: 700; color: var(--accent-deep); text-decoration: none; }
.deal:hover { text-decoration: underline; }

.mvno-block { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.mvno-block-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); margin-bottom: 8px; }
.mvno-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.mvno-pill {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px;
  font-size: 0.85rem; font-weight: 600; color: var(--ink); text-decoration: none;
  background: var(--bg);
}
.mvno-pill:hover { border-color: var(--accent); color: var(--accent-deep); }
.mvno-pill .brand-chip { width: 22px; min-width: 22px; height: 22px; font-size: 0.62rem; margin-right: 7px; border-radius: 999px; }
.mvno-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.mvno-list a { color: var(--accent-deep); font-weight: 600; text-decoration: none; }
.mvno-note { font-size: 0.82rem; color: var(--ink-2); margin-left: 6px; }

/* ---------- race animation ---------- */
.race-card { border-left: 4px solid var(--accent); }
.race-title { font-weight: 800; letter-spacing: -0.01em; margin-bottom: 12px; }
.race-lane { margin-bottom: 12px; }
.race-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--ink-2); margin-bottom: 4px; }
.race-label strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.race-track { height: 12px; background: var(--chip-bg); border-radius: 6px; overflow: hidden; }
.race-bar {
  height: 100%; width: 0; border-radius: 6px; background: var(--accent);
  transition: width 1.8s cubic-bezier(0.2, 0.7, 0.3, 1);
  background-image: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
  background-size: 80px 100%; background-repeat: no-repeat;
  animation: race-shimmer 1.4s linear infinite;
}
.race-lane.fttc .race-bar { background-color: var(--warn); transition-duration: 2.6s; }
.race-lane.g5 .race-bar { background-color: var(--accent); transition-duration: 1.8s; }
.race-lane.ghost .race-bar { background-color: var(--ink-muted); opacity: 0.45; transition-duration: 1.2s; }
@keyframes race-shimmer {
  from { background-position: -80px 0; }
  to { background-position: calc(100% + 80px) 0; }
}
@media (prefers-reduced-motion: reduce) {
  .race-bar { transition: none; animation: none; }
}

/* ---------- misc ---------- */
.disclaimer { font-size: 0.78rem; color: var(--ink-muted); margin-top: 20px; }
.cross-link { margin-top: 14px; }
.cross-link a { color: var(--accent-deep); font-weight: 700; text-decoration: none; }
.cross-link a:hover { text-decoration: underline; }

/* ---------- guide / comparison table ---------- */
.guide { margin-top: 36px; max-width: 68ch; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin: 12px 0 8px; }
.cmp { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 0.88rem; }
.cmp th { text-align: left; padding: 10px 14px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); border-bottom: 1px solid var(--line); }
.cmp td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.cmp td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }
.cmp tr:last-child td { border-bottom: none; }

/* ---------- footer ---------- */
.site-foot { margin-top: 48px; border-top: 1px solid var(--line); background: var(--surface); }
.foot-cols {
  max-width: 860px; margin: 0 auto; padding: 28px 20px 36px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px;
}
.foot-cols a { display: block; color: var(--ink-2); text-decoration: none; font-size: 0.86rem; padding: 3px 0; }
.foot-cols a:hover { color: var(--accent-deep); }
.foot-h { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-muted); margin-bottom: 8px; }
.foot-note { display: block; font-size: 0.75rem; color: var(--ink-muted); margin-top: 10px; line-height: 1.5; }

/* ---------- consent ---------- */
.consent-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 12px 16px; font-size: 0.85rem; color: var(--ink-2);
}
.consent-banner a { color: var(--accent-deep); }
.consent-actions { display: flex; gap: 8px; }
.consent-btn { font: inherit; font-weight: 700; font-size: 0.82rem; cursor: pointer; border-radius: 999px; padding: 6px 16px; border: none; background: var(--accent); color: #fff; }
.consent-btn.secondary { background: var(--chip-bg); color: var(--ink-2); }
