:root {
  --ink: #14202e;
  --ink-soft: #4a5b6e;
  --line: #dfe6ee;
  --bg: #ffffff;
  --bg-soft: #f5f8fb;
  --accent: #0b6ea8;
  --accent-dark: #08557f;
  --radius: 10px;
  --wrap: 68rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- header ---------- */
header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1rem 0; flex-wrap: wrap;
}
.logo {
  display: inline-block; font-size: 1.3rem; font-weight: 700;
  letter-spacing: -0.02em; color: var(--ink); text-decoration: none;
  /* 34px to 44px. Cancelled by the negative margin, so the header keeps its
     height and only the hit area grows. */
  padding: 0.32rem 0; margin: -0.32rem 0;
}
.logo span { color: var(--accent); }
/* Tap targets. These links were 17px tall, a line box and nothing else, on
   every page in the site, header and footer alike, which is about a third of
   the 44px both Apple and Google give as the comfortable minimum on a phone.
   Padding the anchor rather than spacing it with margin gives the finger
   something to land on without moving anything visually. */
nav a {
  display: inline-block; color: var(--ink-soft); text-decoration: none;
  font-size: 0.95rem; padding: 0.7rem 0; margin-left: 1.4rem;
}
nav a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- hero ---------- */
.hero {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 3.5rem 0;
}
.hero h1 {
  font-size: 2.4rem; line-height: 1.2; letter-spacing: -0.03em;
  margin: 0 0 1rem; max-width: 22ch;
}
.hero p.lede {
  font-size: 1.15rem; color: var(--ink-soft);
  margin: 0 0 1.5rem; max-width: 60ch;
}
.notice {
  display: inline-block; background: #fff; border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 0.9rem 1.1rem; border-radius: var(--radius);
  font-size: 0.95rem; color: var(--ink-soft); max-width: 60ch;
}

/* ---------- sections ---------- */
main section { padding: 3rem 0; border-bottom: 1px solid var(--line); }
main section:last-child { border-bottom: 0; }
h2 {
  font-size: 1.6rem; letter-spacing: -0.02em;
  margin: 0 0 1rem;
}
h3 { font-size: 1.1rem; margin: 1.8rem 0 0.5rem; }
p { margin: 0 0 1rem; max-width: 72ch; }
ul { max-width: 72ch; padding-left: 1.2rem; }
li { margin-bottom: 0.5rem; }

.grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: 1.5rem;
}
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; background: var(--bg);
}
.card h3 { margin-top: 0; font-size: 1.05rem; }
.card p { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 0; }

table {
  width: 100%; border-collapse: collapse; margin-top: 1.25rem;
  font-size: 0.95rem;
}
th, td {
  text-align: left; padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
th { font-weight: 600; background: var(--bg-soft); }
/* A provider or state name in a table is the main way people leave a hub page,
   and as a bare inline link it was a 17px-tall target with dead cell padding
   all around it, so aiming slightly high does nothing. Filling the cell
   makes the whole row-cell tappable. The negative margin cancels the padding,
   so no row gets taller and the tables stay as scannable as they were. */
td a {
  display: block; padding: 0.7rem 0.6rem; margin: -0.7rem -0.6rem;
}
/* Except where a cell holds running prose rather than a single link, where
   block links would stack onto separate lines. */
td a + a, td a:not(:only-child) { display: inline; padding: 0; margin: 0; }

.muted { color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- legal pages ---------- */
.legal { padding: 2.5rem 0 3.5rem; }
.legal h1 { font-size: 2rem; letter-spacing: -0.02em; margin: 0 0 0.4rem; }
.legal .updated { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 2rem; }
.legal h2 { font-size: 1.2rem; margin-top: 2.2rem; }

/* ---------- footer ---------- */
footer {
  background: var(--bg-soft); border-top: 1px solid var(--line);
  padding: 2rem 0; font-size: 0.92rem; color: var(--ink-soft);
}
footer a { color: var(--ink-soft); }
footer nav { margin-bottom: 0.75rem; }
footer nav a { margin: 0 1.2rem 0 0; }

@media (max-width: 40rem) {
  .hero { padding: 2.5rem 0; }
  .hero h1 { font-size: 1.9rem; }
  nav a { margin: 0 1rem 0 0; }
  .bar { flex-direction: column; align-items: flex-start; }
}

/* ---------- address lookup (page type 5) ---------- */
/* Two labelled fields, not one free-text box. The geocoder returns zero matches
   for any address missing a locality, so a second required field turns the most
   common failure into something the form will not let you submit. Labels are
   visible rather than sr-only: with two boxes the visitor has to know which is
   which before typing, and a placeholder disappears the moment they do. */
#lookup { display: flex; gap: 0.6rem 0.75rem; flex-wrap: wrap; max-width: 46rem; }
#lookup .field { display: flex; flex-direction: column; gap: 0.3rem; flex: 1 1 20rem; }
#lookup .field-narrow { flex: 1 1 12rem; }
#lookup label {
  font-size: 0.85rem; font-weight: 600; color: var(--ink-soft);
}
#lookup input {
  width: 100%; box-sizing: border-box; font: inherit; padding: 0.75rem 0.9rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
#lookup input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#lookup .actions { display: flex; gap: 0.6rem; flex: 1 0 100%; flex-wrap: wrap; }
#lookup button {
  font: inherit; font-weight: 600; padding: 0.75rem 1.4rem; cursor: pointer;
  color: #fff; background: var(--accent); border: 1px solid var(--accent-dark);
  border-radius: var(--radius);
}
#lookup button:hover { background: var(--accent-dark); }
#lookup .muted { flex: 1 0 100%; margin: 0.2rem 0 0; }
/* The lookup output section is empty on first load. Left as a normal section it
   reserved 3rem of padding and a bottom rule for nothing, opening the page with
   a band of blank white that reads as a broken render. Zero it out and hang the
   spacing off the children, which only exist once there is a result. */
main section#lookup-out { padding: 0; border-bottom: 0; }
#status:not(:empty) {
  margin: 3rem 0; padding: 0.9rem 1.1rem; border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  background: var(--bg-soft); max-width: 60ch;
}
#lookup-out #choices:not([hidden]), #lookup-out #results:not([hidden]) {
  padding: 3rem 0; border-bottom: 1px solid var(--line);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The study's one citable sentence. Sized so it is unmistakably THE claim on
   the page rather than the first of five table rows. A journalist should be
   able to see what to quote without reading anything. */
.claim {
  font-size: 1.45rem; line-height: 1.45; font-weight: 500;
  margin: 0 0 1rem; max-width: 44ch;
  border-left: 4px solid var(--accent); padding-left: 1.1rem;
}
.claim b { font-weight: 700; color: var(--accent-dark); white-space: nowrap; }
@media (max-width: 40rem) { .claim { font-size: 1.25rem; } }

/* ---------- primary call to action ---------- */
.btn {
  display: inline-block; font-weight: 600; text-decoration: none;
  padding: 0.8rem 1.5rem; border-radius: var(--radius);
  color: #fff; background: var(--accent); border: 1px solid var(--accent-dark);
}
.btn:hover { background: var(--accent-dark); }
.hero-cta { margin: 0 0 1.5rem; }
nav a.nav-cta {
  color: var(--accent); font-weight: 600;
}
nav a.nav-cta:hover { color: var(--accent-dark); }
@media (max-width: 40rem) { nav a.nav-cta { margin-left: 0; } }

/* ---------- address lookup: coverage visuals ---------- */
/* Deliberately CSS-only. No charting library, no map tiles, no third-party
   request of any kind beyond the Census geocoder the lookup already needs.
   Plotting a pin on someone else's map would send the visitor's location to a
   tile CDN, which contradicts what the form promises directly above it. */

.statgrid {
  display: grid; gap: 0.75rem; margin: 1.25rem 0;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}
.stat {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-soft); padding: 0.85rem 0.95rem;
}
.stat b { display: block; font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.02em; }
.stat span { display: block; font-size: 0.85rem; color: var(--ink-soft); }

/* NOT .bar, because that class already belongs to the header (.wrap.bar), which sets
   display:flex and padding:1rem 0. Reusing it made the fill's height:100%
   resolve against a zero content box, so every bar rendered empty. */
.covbar {
  position: relative; height: 0.6rem; border-radius: 999px;
  background: var(--line); overflow: hidden; margin-bottom: 0.3rem;
  min-width: 6rem;
}
.covbar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.covbar.t-fiber i          { background: #0b6ea8; }
.covbar.t-cable i          { background: #4a7fa5; }
.covbar.t-fixedwireless i  { background: #7a93a8; }
.covbar.t-copper i         { background: #9aa8b5; }
.covbar-label { font-size: 0.85rem; color: var(--ink-soft); }

.compare-strip {
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); background: var(--bg-soft);
  padding: 1rem 1.15rem; margin: 1.5rem 0;
}
.compare-strip h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.compare-strip p { margin: 0 0 0.5rem; font-size: 0.95rem; }
.compare-strip p:last-child { margin-bottom: 0; }

/* ---------- address lookup: secondary action, match echo, disambiguation ---------- */
/* Must out-specify `#lookup button`, which is an ID selector. Without the
   #lookup prefix the secondary button rendered identical to the primary one,
   two filled blue buttons side by side, neither obviously the main action. */
#lookup .btn-secondary {
  font: inherit; font-weight: 600; padding: 0.75rem 1.1rem; cursor: pointer;
  color: var(--accent); background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius);
}
#lookup .btn-secondary:hover { border-color: var(--accent); background: var(--bg-soft); }

.matched { color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 0.5rem; }

#choices ul { list-style: none; padding: 0; margin: 0.75rem 0; max-width: 46rem; }
#choices li { margin: 0; border-bottom: 1px solid var(--line); }
#choices li a {
  display: block; padding: 0.75rem 0.2rem; color: var(--accent);
  text-decoration: none; font-size: 0.98rem;
}
#choices li a:hover { text-decoration: underline; background: var(--bg-soft); }

@media (max-width: 40rem) {
  /* Content sat about 20px from the screen edge, which reads as cramped on a
     phone. 24px is the comfortable minimum for body text against a bezel. */
  .wrap { padding: 0 1.5rem; }
  /* Three-column tables are wider than a phone. Let them scroll rather than
     forcing the page to. */
  table { display: block; overflow-x: auto; }
  /* Both actions full width and equal weight. "Use my location" is the
     zero-typing path, which on a phone is the better option for most people, so
     it should not read as the consolation prize. */
  #lookup .actions { flex-direction: column; }
  #lookup button, #lookup .btn-secondary { width: 100%; }
}
