/* tm-czar.com — Traffic's First Wiki · public-utility design system
   Tokens per GrandPrompt v1.4: paper/ink/muted/hairline + signal-teal signature
   and four zone accents. Mobile-first; the reference must read fast. */

:root {
  --paper: #F5F8FA;
  --ink: #10131A;
  --muted: #586170;
  --hairline: #D5DDE5;
  --teal: #0E7C86;
  --teal-soft: #E3F1F2;
  --zone-landing: #2563EB;
  --zone-archive: #0E8A6B;
  --zone-directory: #6D5AE6;
  --zone-live: #E0932A;
  --card: #FFFFFF;
  --seed: #8A5A00;
  --seed-bg: #FFF3D6;
  --danger: #B3382C;
  --radius: 10px;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.65rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
/* Section headers inside reference pages read as small caps — the
   Basketball-Reference section rhythm, not article headlines. */
.wrap > h2, #dir-groups h2 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); margin: 1.7rem 0 .5rem; padding-bottom: .3rem;
  border-bottom: 1px solid var(--hairline);
}
p { margin: .4rem 0 .9rem; }
small { color: var(--muted); }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.site-head { background: var(--ink); color: #EAF0F4; }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: baseline; gap: .55rem; margin-right: auto; white-space: nowrap; }
.brand a { color: #fff; font-weight: 700; font-size: 1.06rem; letter-spacing: .02em; }
.brand .tag { color: #9FB3BE; font-size: .74rem; letter-spacing: .04em; }
.nav { display: flex; flex-wrap: wrap; gap: .15rem; font-size: .88rem; }
.nav a { color: #C9D6DD; padding: .3rem .55rem; border-radius: 6px; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { color: #fff; font-weight: 600; }
.nav a.z-landing.active { box-shadow: inset 0 -2px 0 var(--zone-landing); }
.nav a.z-archive.active { box-shadow: inset 0 -2px 0 var(--zone-archive); }
.nav a.z-directory.active { box-shadow: inset 0 -2px 0 var(--zone-directory); }
.nav a.z-live.active { box-shadow: inset 0 -2px 0 var(--zone-live); }
.nav a.z-blog.active { box-shadow: inset 0 -2px 0 var(--teal); }
.head-out { display: flex; gap: .35rem; font-size: .8rem; }
.head-out a { color: #9FB3BE; padding: .3rem .5rem; }
.head-out a:hover { color: #fff; text-decoration: none; }
#signin-btn {
  background: var(--teal); color: #fff; border: 0; border-radius: 6px;
  font: 600 .82rem var(--sans); padding: .38rem .75rem; cursor: pointer;
}
#signin-btn:hover { filter: brightness(1.1); }

/* ---------- page chrome ---------- */
.crumbs { font-size: .76rem; color: var(--muted); margin: .8rem 0 .3rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--teal); }
main { padding-bottom: 3rem; }
.page-head { margin: .4rem 0 1rem; }
.page-head h1 { font-size: 1.85rem; }
.page-head .kicker {
  font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.k-landing { color: var(--zone-landing); }
.k-archive { color: var(--zone-archive); }
.k-directory { color: var(--zone-directory); }
.k-live { color: var(--zone-live); }
.k-ref { color: var(--teal); }
.lede { color: var(--muted); max-width: 62ch; font-size: .95rem; }

/* ---------- badges ---------- */
.badge {
  display: inline-block; font-size: .6rem; font-weight: 700; letter-spacing: .05em;
  padding: .08rem .38rem; border-radius: 3px; text-transform: uppercase; vertical-align: middle;
  line-height: 1.5;
}
.badge-seed { background: var(--seed-bg); color: var(--seed); border: 1px solid #EAD196; }
.badge-sourced { background: #E3F1EA; color: #1E6B4C; border: 1px solid #BFDECC; }
.vol-line { font-size: .84rem; margin: .5rem 0 .3rem; }

/* live congestion (proxy-fed; hidden until it returns) */
.congestion {
  font-size: .84rem; margin: .5rem 0 .3rem; padding: .5rem .7rem;
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius);
}
.cg-dot { display: inline-block; width: .62rem; height: .62rem; border-radius: 50%; vertical-align: middle; }
.cg-ok { background: #2E9C6A; }
.cg-slow { background: var(--zone-live); }
.cg-jam { background: var(--danger); }
.cg-unk { background: var(--muted); }
.cg-src { color: var(--muted); }
.badge-live { background: #FDEFDB; color: #8A5A00; }
.badge-demo { background: #E8E4FB; color: #4A3AB8; }
.badge-active { background: #FCE8E6; color: var(--danger); }
.badge-cleared { background: #E3F1EA; color: #1E6B4C; }
.badge-archived { background: #E7ECF2; color: #495669; }
.badge-real { background: var(--teal-soft); color: var(--teal); border: 1px solid #BEDDE0; }
.badge-type { background: #EAEFF4; color: var(--muted); }
.badge-cadence { background: var(--teal-soft); color: var(--teal); }

.seed-note {
  background: var(--seed-bg); border: 1px solid #EAD196; color: #6B4A08;
  border-radius: var(--radius); padding: .45rem .7rem; font-size: .76rem; margin: .7rem 0;
  line-height: 1.45;
}
.real-note {
  background: var(--teal-soft); border: 1px solid #BEDDE0; color: #0B5A62;
  border-radius: var(--radius); padding: .45rem .7rem; font-size: .76rem; margin: .7rem 0;
  line-height: 1.45;
}

/* ---------- cards & panels ---------- */
.panel { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1rem 1.1rem; }
.grid { display: grid; gap: .9rem; }
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.zone-card { border-top: 3px solid var(--hairline); display: block; color: inherit; }
.zone-card:hover { text-decoration: none; border-color: var(--teal); box-shadow: 0 2px 10px rgba(16,19,26,.06); }
.zone-card h3 { margin-bottom: .2rem; }
.zone-card p { font-size: .85rem; color: var(--muted); margin: 0; }
.zc-landing { border-top-color: var(--zone-landing); }
.zc-archive { border-top-color: var(--zone-archive); }
.zc-directory { border-top-color: var(--zone-directory); }
.zc-live { border-top-color: var(--zone-live); }
.zone-card .lock { float: right; font-size: .72rem; color: var(--zone-live); font-weight: 700; }

/* ---------- stat blocks — one joined strip, hairline-divided ---------- */
.stats-row {
  display: flex; flex-wrap: wrap; gap: 0; margin: .8rem 0;
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--radius); overflow: hidden;
}
.stat {
  flex: 1 1 108px; padding: .45rem .7rem;
  box-shadow: -1px -1px 0 0 #EDF1F5; /* uniform hairlines when the strip wraps */
}
@media (max-width: 640px) {
  .stats-row { display: grid; grid-template-columns: repeat(2, 1fr); }
}
.stat .n { font-size: 1.15rem; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .l { font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }

/* ---------- tables (the reference look: dense, striped, tabular) ---------- */
.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius); }
table.ref {
  border-collapse: collapse; width: 100%;
  font-size: 13px; line-height: 1.35; font-variant-numeric: tabular-nums;
}
table.ref th, table.ref td { padding: .3rem .55rem; text-align: left; white-space: nowrap; }
table.ref th {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  border-bottom: 2px solid var(--hairline); background: #FAFCFD; position: sticky; top: 0;
}
table.ref td { border-bottom: 1px solid #F0F3F6; }
table.ref tbody tr:nth-child(even) td { background: #F7FAFB; }
table.ref tr:last-child td { border-bottom: 0; }
table.ref tr:hover td { background: #EFF6F7; }
table.ref td.num { font-variant-numeric: tabular-nums; }
table.ref td.desc-cell { white-space: normal; min-width: 260px; }

/* ---------- query surface ---------- */
.query-bar { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius); padding: .6rem .7rem; margin-bottom: .8rem; }
.query-bar .row { display: grid; gap: .45rem; grid-template-columns: 1fr 1fr; }
@media (min-width: 760px) { .query-bar .row { grid-template-columns: repeat(4, 1fr); } }
.query-bar label { display: block; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: .12rem; }
.query-bar select, .query-bar input {
  width: 100%; padding: .32rem .45rem; border: 1px solid var(--hairline); border-radius: 5px;
  font: .84rem var(--sans); background: #fff; color: var(--ink);
}
.query-bar select:focus, .query-bar input:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.query-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .5rem; }
.btn {
  display: inline-block; border: 1px solid var(--hairline); background: #fff; color: var(--ink);
  border-radius: 5px; padding: .32rem .7rem; font: 600 .8rem var(--sans); cursor: pointer;
}
.btn:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { color: #fff; filter: brightness(1.08); }
.btn-gated { position: relative; }
.btn-gated::after { content: "account"; font-size: .6rem; color: var(--zone-live); font-weight: 700; margin-left: .35rem; text-transform: uppercase; }
.result-count { font-size: .76rem; color: var(--muted); margin: .4rem 0 .35rem; }
.tabs { display: flex; gap: .25rem; margin-bottom: .5rem; border-bottom: 1px solid var(--hairline); }
.tabs button {
  border: 0; background: none; font: 600 .84rem var(--sans); color: var(--muted);
  padding: .35rem .7rem; cursor: pointer; border-bottom: 2px solid transparent;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--zone-archive); }

/* ---------- directory ---------- */
.dir-search { width: 100%; padding: .55rem .7rem; border: 1px solid var(--hairline); border-radius: var(--radius); font: 1rem var(--sans); margin-bottom: 1rem; }
.dir-search:focus { outline: 2px solid var(--zone-directory); border-color: var(--zone-directory); }
.src-card { display: block; color: inherit; padding: .7rem .9rem; }
.src-card:hover { text-decoration: none; border-color: var(--zone-directory); }
.src-card .nm { font-weight: 600; }
.src-card p { font-size: .82rem; color: var(--muted); margin: .2rem 0 0; }
.topic-chip {
  display: inline-block; font-size: .74rem; background: #EFECFB; color: #4A3AB8;
  border-radius: 999px; padding: .15rem .6rem; margin: 0 .25rem .25rem 0;
}
a.topic-chip:hover { text-decoration: none; background: #E3DEF8; }

/* ---------- live board ---------- */
.gate {
  max-width: 460px; margin: 2.5rem auto; text-align: center;
  border-top: 3px solid var(--zone-live);
}
.gate input { width: 100%; padding: .55rem .7rem; border: 1px solid var(--hairline); border-radius: 6px; font: 1rem var(--sans); margin: .6rem 0; }
.board-hero {
  background: var(--ink); color: #EAF0F4; border-radius: var(--radius); padding: 1.1rem 1.2rem;
  margin-bottom: 1rem; position: relative; overflow: hidden;
}
.board-hero .corridor-name { font-size: 1.5rem; font-weight: 700; }
.board-hero .metro-line { color: #9FB3BE; font-size: .85rem; }
.board-hero .rot { position: absolute; top: .8rem; right: .9rem; font-size: .68rem; color: #9FB3BE; text-transform: uppercase; letter-spacing: .08em; }
.board-hero .h-stats { display: flex; gap: 1.6rem; margin-top: .8rem; flex-wrap: wrap; }
.board-hero .h-stats .n { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.board-hero .h-stats .l { font-size: .68rem; color: #9FB3BE; text-transform: uppercase; letter-spacing: .06em; }
.board-still { border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; background: var(--ink); color: #EAF0F4; padding: 1rem 1.1rem; }
.board-still .bs-head { display: flex; justify-content: space-between; font-size: .72rem; color: #9FB3BE; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .6rem; }
.board-still .bs-row { display: flex; justify-content: space-between; padding: .3rem 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: .85rem; }
.board-still .bs-row:last-child { border-bottom: 0; }
.board-still .ok { color: #7BC9A2; }
.board-still .warn { color: #E8B36A; }

/* ---------- cite block ---------- */
.cite {
  background: var(--teal-soft); border: 1px solid #C4E0E2; border-radius: var(--radius);
  padding: .55rem .8rem; font-size: .76rem; margin: 1.2rem 0; line-height: 1.5;
}
.cite .u { font-family: var(--mono); font-size: .74rem; word-break: break-all; color: var(--teal); }

/* ---------- road card ---------- */
.roadcard { border-top: 3px solid var(--zone-archive); }
.roadcard .rc-date { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.roadcard .rc-head { font-size: 1.3rem; font-weight: 700; margin: .15rem 0 .5rem; }
.rc-stats { display: flex; flex-wrap: wrap; gap: 1.4rem; margin: .8rem 0; }
.rc-stats .n { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rc-stats .l { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- blog ---------- */
.blog-entry { margin-bottom: 1.4rem; }
.blog-entry .be-meta { font-size: .78rem; color: var(--muted); }

/* ---------- landing hero ---------- */
.hero { padding: 2.2rem 0 1.4rem; }
.hero h1 { font-size: 2rem; max-width: 22ch; }
@media (min-width: 700px) { .hero h1 { font-size: 2.5rem; } }
.hero .sub { color: var(--muted); max-width: 58ch; font-size: 1.02rem; }
.hero-search { display: flex; gap: .5rem; max-width: 560px; margin: 1.1rem 0; }
.hero-search input { flex: 1; padding: .65rem .8rem; border: 1px solid var(--hairline); border-radius: 8px; font: 1rem var(--sans); }
.hero-search input:focus { outline: 2px solid var(--zone-landing); border-color: var(--zone-landing); }
.hero-search button { background: var(--zone-landing); color: #fff; border: 0; border-radius: 8px; padding: 0 1.1rem; font: 600 .95rem var(--sans); cursor: pointer; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--hairline); margin-top: 2rem; background: #EDF2F6; }
.site-foot .wrap { padding: 1.4rem 16px 2rem; font-size: .78rem; color: var(--muted); }
.site-foot .cols { display: grid; gap: 1.2rem; }
@media (min-width: 700px) { .site-foot .cols { grid-template-columns: 2fr 1fr 1fr; } }
.site-foot h4 { margin: 0 0 .35rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin: .18rem 0; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--teal); }
.site-foot .doctrine { margin-top: 1rem; border-top: 1px solid var(--hairline); padding-top: .8rem; }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; font-size: .9rem; }
.pill-row { margin: .4rem 0 .8rem; }
ul.plain { list-style: none; padding: 0; margin: .3rem 0; font-size: .88rem; }
ul.plain li { padding: .24rem 0; border-bottom: 1px solid #EDF1F5; }
ul.plain li:last-child { border-bottom: 0; }
.rc-list a { color: inherit; }
.rc-list a:hover { color: var(--teal); }

@media print {
  .site-head, .site-foot, .query-bar, .tabs, .crumbs { display: none; }
  body { background: #fff; }
  .panel { border: 1px solid #bbb; }
}
