/* ── Invisible Network Telemetry ─────────────────────────────
   The telemetry site's one page, on style.css's tokens. Levers are rows
   of buttons (the D-pad walks a row with Left and Right, rows with Up and
   Down); results are tables that scroll inside themselves on a phone. */

.tl-nav { gap: 1rem; }
.tl-site {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
}
.tl-sections { display: flex; gap: 0.25rem; margin-left: auto; }
.tl-nav .theme-toggle { margin-left: 0.5rem; }
@media (max-width: 720px) {
  .tl-sections { display: none; }
  .tl-nav .theme-toggle { margin-left: auto; }
  .tl-nav .logo-text { display: none; }
}

.tl-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.tl-hero { padding: 2.5rem 0 1rem; }
.tl-hero h1 {
  font-size: var(--step-4);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.tl-lead {
  font-size: var(--step-1);
  color: var(--text-muted);
  max-width: 62ch;
  margin-bottom: 0.75rem;
}
.tl-dim { color: var(--text-dim); font-size: var(--step--1); }
.tl-dim a, .tl-lead a, .tl-section p a, .tl-section li a, .tl-section dd a, .tl-table a, figcaption a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tl-section { padding: 2rem 0 1rem; border-top: 1px solid var(--hairline); }
.tl-section > p, .tl-section > ul, .tl-section > dl { max-width: 72ch; margin-bottom: 0.9rem; }
.tl-section .section-desc { margin: -0.4rem 0 1.25rem; }
.tl-sub { font-size: var(--step-1); margin: 1.5rem 0 0.5rem; }

/* ── Levers ── */
.tl-levers {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 1.5rem 2rem;
  align-items: start;
}
@media (max-width: 980px) { .tl-levers { grid-template-columns: minmax(0, 1fr); } }

.tl-rows { display: grid; gap: 0.9rem; }
.tl-row { display: grid; gap: 0.35rem; }
.tl-row-label {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--text-muted);
}
.tl-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tl-chip {
  font: inherit;
  font-size: var(--step--1);
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  min-height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.tl-chip:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--bg-hover); }
.tl-chip[aria-pressed="true"] {
  background: var(--action);
  color: var(--on-action);
  border-color: var(--action);
}
.tl-chip[aria-pressed="true"]:hover { background: var(--action-hover); border-color: var(--action-hover); }
.tl-chip:disabled { cursor: not-allowed; opacity: 0.55; }
.tl-note { font-size: var(--step--1); color: var(--text-dim); max-width: 60ch; }

.tl-selects {
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  align-items: end;
  gap: 0.6rem;
}
.tl-selects .tl-note { grid-column: 1 / -1; }
.tl-select {
  display: grid;
  /* A grid item's least width is its content's: a long option ("Central
     African Republic") would push the column past a phone's window. */
  min-width: 0;
  gap: 0.25rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--text-muted);
}
.tl-select select {
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
  min-height: 2.25rem;
  width: 100%;
  min-width: 0;
}
.tl-show { justify-self: start; }

/* ── Results ── */
.tl-results { display: grid; gap: 0.9rem; min-width: 0; }
.tl-playing { font-size: var(--step--1); color: var(--text-muted); }
.tl-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); gap: 0.75rem; }
.tl-total {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.35rem;
}
.tl-total-title { font-size: var(--step-0); color: var(--text-muted); font-weight: 600; }
.tl-big { font-size: var(--step-1); font-weight: 600; }
.tl-number { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tl-big--g .tl-number { font-size: var(--step-2); }
.tl-range {
  display: inline-block;
  font-size: var(--step--1);
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 0.35rem;
}
.tl-grid-line { font-size: var(--step--1); color: var(--text-muted); }
.tl-why { font-size: var(--step--1); color: var(--text-muted); }

.tl-rank { padding-left: 1.4rem; display: grid; gap: 0.3rem; font-size: var(--step--1); }
.tl-rank-label { font-weight: 600; color: var(--text); }
.tl-rank-effect { font-variant-numeric: tabular-nums; color: var(--text); }

.tl-badge {
  display: inline-block;
  font-size: var(--step--2);
  font-weight: 600;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--tint-strong);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Tables ── */
.tl-table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.tl-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.tl-table caption {
  text-align: left;
  font-weight: 600;
  padding: 0.65rem 0.8rem;
  color: var(--text);
}
.tl-table th, .tl-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.8rem;
  border-top: 1px solid var(--hairline);
}
.tl-table thead th { color: var(--text-muted); font-weight: 600; }
.tl-table tbody th { font-weight: 600; }
.tl-table td .tl-range { display: block; margin-left: 0; }
.tl-stage-more td { border-top: 0; padding-top: 0; color: var(--text-muted); }
.tl-stage-note { display: block; color: var(--text-dim); margin-top: 0.3rem; }
.tl-height th { font-weight: 400; padding-left: 1.6rem; color: var(--text-muted); }
.tl-nowrap { white-space: nowrap; }
.tl-coefs td:last-child { min-width: 22rem; }

.tl-points { padding-left: 1.2rem; display: grid; gap: 0.6rem; }
.tl-defs { display: grid; gap: 0.35rem; font-size: var(--step--1); }
.tl-defs dt { font-weight: 600; margin-top: 0.5rem; }
.tl-defs dd { color: var(--text-muted); }
.tl-cited { padding-left: 1.2rem; display: grid; gap: 0.25rem; font-size: var(--step--1); }

/* ── Charts ── */
.tl-figure { margin: 1rem 0 1.5rem; max-width: 720px; }
.tl-chart { width: 100%; height: auto; display: block; overflow: visible; }
.tl-bar { fill: var(--accent); }
.tl-bar--forecast { fill: color-mix(in oklab, var(--accent) 45%, transparent); }
.tl-line { fill: none; stroke: var(--accent-text); stroke-width: 2.5; }
.tl-dot { fill: var(--accent-text); }
.tl-baseline { stroke: var(--border-strong); stroke-width: 1; }
.tl-axis {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: var(--step--2);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  margin: 0.25rem 0 0;
}
.tl-axis--top { margin: 0 0 0.25rem; }
.tl-figure figcaption { font-size: var(--step--1); color: var(--text-muted); margin-top: 0.5rem; }

/* ── TV: across a room ── */
:root[data-tv] .tl-page { max-width: none; }
:root[data-tv] .tl-chip { font-size: var(--step-0); padding: 0.55rem 1.1rem; min-height: 2.75rem; }
:root[data-tv] .tl-select select { font-size: var(--step-0); min-height: 2.75rem; }
@media (min-width: 981px) { :root[data-tv] .tl-levers { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* Our sources: the 30 days' strip, by state. Each square has its counts in
   a title, and every row says them in words beside it. */
.tl-status th[scope="row"] { min-width: 11rem; }
.tl-serves { display: block; margin-top: 0.15rem; color: var(--text-muted); font-weight: 400; font-size: var(--step--2); }
.tl-days { width: 100%; min-width: 15rem; max-width: 30rem; height: auto; display: block; }
/* On a phone the table scrolls sideways in its region (as the page's other
   tables do) rather than squeeze the 30 days to a sliver. */
@media (max-width: 640px) { .tl-status th[scope="row"] { min-width: 8.5rem; } }
.tl-day--full { fill: var(--success); }
.tl-day--part { fill: var(--warning); }
.tl-day--poor { fill: var(--danger); }
.tl-day--none { fill: var(--border); }
.tl-state { font-weight: 700; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; list-style: none; padding: 0; margin: 0.5rem 0 0.75rem; font-size: var(--step--1); color: var(--text-muted); }
.tl-legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.tl-key { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 3px; }
.tl-key.tl-day--full { background: var(--success); }
.tl-key.tl-day--part { background: var(--warning); }
.tl-key.tl-day--poor { background: var(--danger); }
.tl-key.tl-day--none { background: var(--border); }
