:root {
  --background: #f3f5f7;
  --foreground: #172033;
  --card: #ffffff;
  --muted: #687284;
  --border: #d9dee6;
  --accent: #e44d2e;
  --good: #16744c;
  --bad: #bd3434;
  --font-sans: "Aptos", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(23, 32, 51, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 51, 0.025) 1px, transparent 1px),
    var(--background);
  background-size: 32px 32px;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}

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

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(228, 77, 46, 0.35);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.telemetry-rail {
  height: 5px;
  background: linear-gradient(
    90deg,
    #e44d2e 0 35%,
    #2563eb 35% 52%,
    #0f766e 52% 69%,
    #7c3aed 69% 85%,
    #b26b16 85% 100%
  );
}

.page-shell {
  width: min(100% - 2rem, 1440px);
  margin: 0 auto;
  padding: 1.5rem 0 1.75rem;
}

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem 0 1.5rem;
}

.title-cluster {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.8rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.signal-mark {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  flex: none;
  place-items: center;
  border-radius: 0.8rem;
  background: #172033;
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(23, 32, 51, 0.2);
}

.signal-mark svg {
  width: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-copy {
  max-width: 750px;
  margin: 0.85rem 0 0;
  color: #5f6876;
  font-size: 1.08rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  line-height: 1.35;
  text-transform: uppercase;
}

.live-badge {
  border-color: #d4eadf;
  background: #effaf4;
  color: #176b45;
}

.live-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #20a268;
  box-shadow: 0 0 0 4px rgba(32, 162, 104, 0.12);
}

.preliminary-badge {
  border-color: #e6bc84;
  background: #fff9ed;
  color: #8b5312;
}

.update-block {
  min-width: 265px;
  border-left: 3px solid var(--accent);
  padding: 0.2rem 0 0.2rem 1rem;
  text-align: right;
}

.update-block span,
.update-block small {
  display: block;
  color: #687284;
  font-size: 0.78rem;
}

.update-block span {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.update-block strong {
  display: block;
  margin: 0.18rem 0;
  font-size: 0.96rem;
}

.disclosure-strip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.78);
  padding: 0.7rem 0.85rem;
  color: #556071;
  font-size: 0.86rem;
}

.info-icon {
  display: inline-grid;
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  font-family: Georgia, serif;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.period-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 1.35rem 0;
}

.eyebrow {
  display: block;
  color: #7a8494;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.period-row p {
  margin: 0.25rem 0 0;
  color: #3f495a;
  font-size: 0.9rem;
}

.period-tabs {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: #e8ebef;
  padding: 0.25rem;
}

.period-tabs button {
  min-height: 2.5rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  padding: 0.55rem 1rem;
  color: #5a6474;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
}

.period-tabs button[aria-selected="true"] {
  background: #ffffff;
  color: #172033;
  box-shadow: 0 2px 8px rgba(23, 32, 51, 0.09);
}

.loading-panel,
.error-panel {
  display: flex;
  min-height: 180px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #ffffff;
  padding: 1.5rem;
}

.loading-panel {
  color: #687284;
  background: linear-gradient(100deg, #fff 20%, #f6f8fa 40%, #fff 60%);
  background-size: 200% 100%;
  animation: loading-sheen 1.8s linear infinite;
}

@keyframes loading-sheen {
  to { background-position: -200% 0; }
}

.error-panel {
  justify-content: space-between;
  gap: 1rem;
  border-color: #efb2aa;
  background: #fff6f4;
}

.error-panel h2 {
  margin: 0;
  font-size: 1.4rem;
}

.error-panel p {
  margin: 0.5rem 0 0;
  color: #7c4a43;
}

.retry-button {
  border: 0;
  border-radius: 0.65rem;
  background: #172033;
  padding: 0.7rem 1rem;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric-card {
  min-height: 185px;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: #ffffff;
  padding: 1.25rem;
  box-shadow: 0 8px 28px rgba(23, 32, 51, 0.055);
}

.metric-card.frugal-card {
  border-top: 4px solid var(--accent);
  background: linear-gradient(155deg, #fff 50%, #fff3ef);
  padding-top: calc(1.25rem - 3px);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #5f6876;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 1.1rem;
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 1;
}

.metric-value.good {
  color: var(--good);
}

.metric-value.bad {
  color: var(--bad);
}

.metric-card p {
  margin: 1rem 0 0;
  color: #6a7483;
  font-size: 0.84rem;
  line-height: 1.45;
}

.panel {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 1.05rem;
  background: #ffffff;
  padding: 1.25rem;
  box-shadow: 0 8px 28px rgba(23, 32, 51, 0.05);
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.panel-heading h2,
.methodology-title h2 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 730;
  letter-spacing: -0.025em;
}

.panel-heading > p {
  max-width: 460px;
  margin: 0;
  color: #697383;
  font-size: 0.86rem;
  text-align: right;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.provider-card {
  --provider-color: #64748b;
  position: relative;
  overflow: hidden;
  border: 1px solid #dfe3e9;
  border-radius: 0.85rem;
  background: #fafbfc;
  padding: 1rem;
}

.provider-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--provider-color);
  content: "";
}

.provider-card.featured {
  border-color: #efb3a6;
  background: #fff8f5;
}

.provider-topline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.provider-topline strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-swatch,
.table-provider-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  flex: none;
  border-radius: 999px;
  background: var(--provider-color);
}

.table-provider-dot {
  margin-right: 0.35rem;
  vertical-align: 0.02rem;
}

.rank {
  margin-left: auto;
  border-radius: 999px;
  background: #e9edf2;
  padding: 0.12rem 0.42rem;
  color: #596476;
  font-size: 0.74rem;
  font-weight: 750;
}

.featured .rank {
  background: #fee2da;
  color: #a52e18;
}

.provider-values {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.provider-values > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.provider-values span {
  color: #6d7787;
  font-size: 0.75rem;
}

.provider-values strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.provider-meta {
  margin-top: 0.8rem;
  border-top: 1px solid #e4e8ed;
  padding-top: 0.65rem;
  color: #7a8493;
  font-size: 0.72rem;
}

.comparison-list {
  overflow: hidden;
  border: 1px solid #e0e4ea;
  border-radius: 0.85rem;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(220px, 0.8fr) minmax(170px, 0.6fr);
  align-items: center;
  gap: 1rem;
  min-height: 3.75rem;
  border-bottom: 1px solid #e4e7ec;
  padding: 0.75rem 1rem;
}

.comparison-row:last-child {
  border-bottom: 0;
}

.comparison-row:nth-child(even) {
  background: #fafbfc;
}

.comparison-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.comparison-name span {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
}

.comparison-win {
  color: var(--good);
  font-weight: 750;
}

.comparison-loss {
  color: var(--bad);
  font-weight: 750;
}

.comparison-count {
  color: #7a8493;
  font-size: 0.82rem;
  text-align: right;
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-height: 440px;
  overflow: hidden;
  border: 1px solid #e3e6eb;
  border-radius: 0.85rem;
  background:
    linear-gradient(rgba(23, 32, 51, 0.018) 1px, transparent 1px),
    #fdfdfd;
  background-size: 100% 52px;
  padding: 0.5rem;
}

.chart-svg {
  display: block;
  width: 100%;
  height: 430px;
  overflow: visible;
}

.chart-grid {
  stroke: #d9dee6;
  stroke-dasharray: 3 7;
  vector-effect: non-scaling-stroke;
}

.chart-label {
  fill: #5f6876;
  font-family: var(--font-sans);
  font-size: 12px;
}

.chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem 1.1rem;
  padding: 0.25rem 0 0.45rem;
  color: #556071;
  font-size: 0.78rem;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chart-legend i {
  display: inline-block;
  width: 1.35rem;
  height: 3px;
  border-radius: 999px;
}

.chart-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 185px;
  pointer-events: none;
  border: 1px solid #d9dee6;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.97);
  padding: 0.65rem 0.75rem;
  box-shadow: 0 18px 42px rgba(20, 28, 42, 0.14);
  color: #3f495a;
  font-size: 0.75rem;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #172033;
}

.chart-tooltip div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.chart-tooltip i {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.35rem;
  border-radius: 999px;
}

.empty-chart {
  display: grid;
  min-height: 420px;
  place-items: center;
  color: #7a8493;
}

.probe-panel {
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid #e3e6eb;
  border-radius: 0.75rem;
}

.probe-table {
  width: 100%;
  min-width: 1200px;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.probe-table caption {
  caption-side: bottom;
  padding: 0.8rem;
  color: #7a8493;
  font-size: 0.75rem;
  text-align: left;
}

.probe-table th,
.probe-table td {
  border-bottom: 1px solid #e4e7ec;
  padding: 0.7rem 0.75rem;
  text-align: left;
}

.probe-table th {
  background: #f0f3f6;
  color: #556071;
  font-size: 0.75rem;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.probe-table td {
  height: 3.7rem;
}

.probe-table tr:last-child td {
  border-bottom: 0;
}

.text-right {
  text-align: right !important;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.probe-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #345f9a;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.probe-link:hover,
.raw-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.network-cell {
  display: flex;
  max-width: 280px;
  flex-direction: column;
}

.network-cell strong {
  overflow: hidden;
  color: #374153;
  font-size: 0.8rem;
  text-overflow: ellipsis;
}

.network-cell span {
  color: #7a8493;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.table-winner {
  background: #f0faf5;
  color: #126440;
  font-weight: 800;
}

.winner-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  background: #edf0f4;
  padding: 0.28rem 0.55rem;
  color: #465061;
  font-size: 0.74rem;
  font-weight: 750;
}

.winner-pill span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
}

.incomplete {
  color: #929aa7;
  font-size: 0.78rem;
}

.methodology-panel {
  margin-top: 1rem;
  border-radius: 1.05rem;
  background: #172033;
  padding: 1.4rem;
  color: #ffffff;
  box-shadow: 0 12px 36px rgba(23, 32, 51, 0.18);
}

.methodology-title {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.methodology-title .info-icon {
  margin-top: 0.12rem;
  color: #ff8a6f;
}

.methodology-title .eyebrow {
  color: #aeb8c8;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.method-grid > div {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 0.9rem;
}

.method-grid strong {
  color: #ffffff;
  font-size: 0.88rem;
}

.method-grid p {
  margin: 0.42rem 0 0;
  color: #bac3d0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.raw-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.9rem;
  margin-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 1rem;
  color: #aeb8c8;
  font-size: 0.78rem;
}

.raw-links a {
  color: #d8deea;
  text-decoration: none;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0 0.3rem;
  color: #7b8594;
  font-size: 0.75rem;
}

noscript {
  display: block;
  width: min(100% - 2rem, 900px);
  margin: 1rem auto;
  border: 1px solid #efb2aa;
  border-radius: 0.75rem;
  background: #fff6f4;
  padding: 1rem;
}

@media (max-width: 1180px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 1rem, 1440px);
    padding-top: 0.75rem;
  }

  .site-header,
  .period-row,
  .panel-heading,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    gap: 1.25rem;
  }

  .title-cluster {
    gap: 0.6rem;
  }

  .signal-mark {
    width: 2.3rem;
    height: 2.3rem;
  }

  .update-block {
    min-width: 0;
    padding-left: 0.8rem;
    text-align: left;
  }

  .header-copy {
    font-size: 1rem;
  }

  .period-row {
    align-items: stretch;
  }

  .period-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid,
  .provider-grid,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 165px;
  }

  .panel {
    padding: 1rem;
  }

  .panel-heading > p,
  .comparison-count {
    text-align: left;
  }

  .comparison-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .chart-wrap {
    min-height: 360px;
    padding: 0.25rem;
  }

  .chart-svg {
    height: 350px;
  }

  .chart-tooltip {
    min-width: 160px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-panel {
    animation: none;
  }
}
