/* Inter, served from this site (latin and latin-ext; other scripts fall back to the system font). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --soft: #f1f3f9;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --line: #e2e6ee;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;

  /* the map */
  --canvas: #f2f4f8;
  --edge: #9ba6b6;
  --pill-line: #d0d6df;
  --best: #dc2626;
  --best-halo: #f87171;
  --best-soft: #fee2e2;
  --origin: #10b981;
  --origin-soft: #ecfdf5;
  --origin-line: #6ee7b7;
  --origin-text: #047857;
  --prefix: #f97316;
  --prefix-soft: #fff7ed;
  --prefix-line: #fdba74;
  --prefix-text: #9a3412;
  --t1: #8b5cf6;
  --t1-soft: #f5f3ff;
  --t1-line: #c4b5fd;
  --t1-text: #6d28d9;
  --t2: #3b82f6;
  --t2-soft: #eff6ff;
  --t2-line: #93c5fd;
  --t2-text: #1d4ed8;
  --tr: #06b6d4;
  --tr-soft: #ecfeff;
  --tr-line: #67e8f9;
  --tr-text: #0e7490;
  --stub-line: #d9dee7;
  --stub-bar: #cbd5e1;

  --radius: 12px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --code: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono, .asn { font-family: var(--sans); font-variant-numeric: tabular-nums; font-weight: 500; }
code { font-family: var(--code); font-size: 0.92em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
h1 { font-size: 30px; line-height: 1.25; margin: 10px 0 10px; letter-spacing: -0.02em; font-weight: 700; }
h2 { font-size: 17px; line-height: 1.35; margin: 0 0 10px; font-weight: 650; letter-spacing: -0.01em; }
.lede { font-size: 16.5px; color: var(--text-2); max-width: 820px; margin: 0 0 24px; }
.muted { color: var(--muted); }
.holder { color: var(--text-2); }
.subtle { color: var(--muted); font-weight: 500; }
.note { color: var(--muted); font-size: 13.5px; margin: -4px 0 10px; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 18px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand-bg { fill: var(--accent); }
.brand-line { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.brand-dot { fill: #fff; }
.brand-prefix { fill: #fdba74; }
.mini-search { display: flex; flex: 1; max-width: 380px; margin-left: auto; }
.mini-search input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-right: 0; border-radius: 9px 0 0 9px; background: var(--soft); color: var(--text); font: 500 14px var(--sans); }
.mini-search button { height: 38px; padding: 0 16px; border: 0; border-radius: 0 9px 9px 0; background: var(--accent); color: #fff; font: 600 14px var(--sans); cursor: pointer; }
.links { margin-left: auto; }
.mini-search + .links { margin-left: 0; }
.links a { color: var(--text-2); font-size: 14px; font-weight: 500; }
.links a:hover { color: var(--text); }

/* search */
.hero { text-align: center; padding: 52px 0 30px; }
.hero h1 { font-size: 44px; margin: 0 0 8px; letter-spacing: -0.03em; }
.hero .lede { margin: 0 auto 26px; }
.hero.narrow h1 { font-size: 30px; }
.search { display: flex; max-width: 640px; margin: 0 auto; border-radius: 12px; box-shadow: 0 4px 14px rgba(79, 70, 229, 0.08); }
.search input { flex: 1; min-width: 0; height: 54px; padding: 0 18px; font: 500 17px var(--sans); border: 1px solid #d5dae3; border-right: 0; border-radius: 12px 0 0 12px; background: var(--surface); color: var(--text); }
.search button { height: 54px; padding: 0 26px; font: 600 16px var(--sans); color: #fff; background: var(--accent); border: 0; border-radius: 0 12px 12px 0; cursor: pointer; }
.search input:focus, .mini-search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.search button:hover, .mini-search button:hover { background: var(--accent-hover); }
.try { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.try a { font-weight: 500; }
.error { color: var(--best); margin: 14px 0 0; }

/* map card */
.map-card { margin: 0 0 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 3px rgba(17, 24, 39, 0.04); }
.map-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.map-title { font-size: 15px; min-width: 0; color: var(--text-2); }
.map-title b { color: var(--text); font-weight: 650; }
.map-title code { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.zoom { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; flex: none; }
.zoom button { min-width: 38px; height: 32px; padding: 0 11px; border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: 600 13px var(--sans); font-variant-numeric: tabular-nums; cursor: pointer; }
.zoom button:first-child { border-left: 0; }
.zoom button:hover { background: var(--soft); color: var(--text); }
.zoom [data-zoom="reset"] { min-width: 60px; }
.frame { overflow: auto; background: var(--canvas); cursor: grab; }
.frame.panning { cursor: grabbing; user-select: none; }
.frame svg { display: block; margin: 0 auto; max-width: none; }
.map-foot { border-top: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0; padding: 12px 16px; font-size: 13px; color: var(--text-2); }
.legend .best-note { font-weight: 600; color: var(--best); }
.key { display: inline-block; width: 16px; height: 12px; margin-right: 6px; vertical-align: -1px; border: 1.5px solid var(--stub-line); border-radius: 4px; background: #fff; }
.key.origin { border-color: var(--origin); background: var(--origin-soft); }
.key.prefix { border-color: var(--prefix); background: var(--prefix-soft); }
.key.tier-t1 { border-color: var(--t1); background: var(--t1-soft); }
.key.tier-t2 { border-color: var(--t2); background: var(--t2-soft); }
.key.tier-transit { border-color: var(--tr); background: var(--tr-soft); }
.key.best { width: 20px; height: 4px; border: 0; border-radius: 2px; background: var(--best); vertical-align: 3px; box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.3); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 12px 16px; background: var(--soft); border-top: 1px solid var(--line); }
.btn { display: inline-flex; align-items: center; height: 36px; padding: 0 15px; border: 1px solid #d5dae3; border-radius: 9px; background: var(--surface); color: var(--text); font: 500 14px var(--sans); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: #b7bfcc; background: #fafbfd; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* the drawing: links */
.map .edge { fill: none; stroke: var(--edge); }
.map .arrow { fill: var(--edge); }
.map .halo { fill: none; stroke: var(--best-halo); stroke-opacity: 0.28; stroke-linecap: round; }
.map .edge.best { stroke: var(--best); stroke-linecap: round; }
.map .arrow.best { fill: var(--best); }
.map .count rect { fill: #fff; stroke: var(--pill-line); stroke-width: 1; }
.map .count text { fill: var(--text-2); font: 600 11px var(--sans); font-variant-numeric: tabular-nums; text-anchor: middle; }
.map .count.best rect { fill: var(--best); stroke: #fff; stroke-width: 1.5; }
.map .count.best text { fill: #fff; font-weight: 700; }

/* the drawing: boxes, by tier; origin and prefix after the tiers, the best path last so it wins */
.map .shadow { fill: #111827; fill-opacity: 0.06; }
.map .box { fill: #fff; stroke: var(--stub-line); stroke-width: 1.2; }
.map .bar { fill: var(--stub-bar); }
.map .label { fill: var(--text); font: 600 13.5px var(--sans); font-variant-numeric: tabular-nums; text-anchor: middle; }
.map .name { fill: #4b5563; font: 400 11.5px var(--sans); text-anchor: middle; }
.map .tag { font: 700 9px var(--sans); text-anchor: end; letter-spacing: 0.04em; }
.map .tier-t1 .box { fill: var(--t1-soft); stroke: var(--t1-line); }
.map .tier-t1 .bar, .map .tier-t1 .tag { fill: var(--t1); }
.map .tier-t1 .label { fill: var(--t1-text); }
.map .tier-t2 .box { fill: var(--t2-soft); stroke: var(--t2-line); }
.map .tier-t2 .bar, .map .tier-t2 .tag { fill: var(--t2); }
.map .tier-t2 .label { fill: var(--t2-text); }
.map .tier-transit .box { fill: var(--tr-soft); stroke: var(--tr-line); }
.map .tier-transit .bar { fill: var(--tr); }
.map .tier-transit .label { fill: var(--tr-text); }
.map .origin .box { fill: var(--origin-soft); stroke: var(--origin-line); }
.map .origin .bar { fill: var(--origin); }
.map .origin .label { fill: var(--origin-text); }
.map .prefix .box { fill: var(--prefix-soft); stroke: var(--prefix-line); }
.map .prefix .bar { fill: var(--prefix); }
.map .prefix .label { fill: var(--prefix-text); }
.map .node.best .box { stroke: var(--best); stroke-width: 2.2; }
.map a.node { cursor: pointer; }
.map a.node:hover .box, .map a.node:focus-visible .box { stroke: var(--accent); stroke-width: 2.4; }
.map a.node:focus { outline: none; }

/* page parts */
.crumbs { font-size: 13.5px; color: var(--muted); margin: 22px 0 0; }
.crumbs .sep { margin: 0 7px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 28px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 16px; }
.stat b { display: block; font-size: 23px; line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin: 0 0 32px; }
.block { margin: 0 0 32px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
.data th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--text-2); padding: 10px 12px; background: var(--soft); border-bottom: 1px solid var(--line); white-space: nowrap; }
.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data tr:last-child td { border-bottom: 0; }
.data tbody tr:hover td { background: #fafbfd; }
.data .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.path { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.path .sep { color: var(--muted); margin: 0 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips a { display: inline-block; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: 500 13px var(--sans); font-variant-numeric: tabular-nums; }
.chips a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.plain { margin: 0; padding-left: 18px; }
.plain li { margin: 0 0 7px; color: var(--text-2); }
.swatch { font-weight: 600; padding: 0 6px; border-radius: 5px; border: 1px solid var(--stub-line); background: #fff; color: var(--text); }
.swatch.tier-t1 { border-color: var(--t1-line); background: var(--t1-soft); color: var(--t1-text); }
.swatch.tier-t2 { border-color: var(--t2-line); background: var(--t2-soft); color: var(--t2-text); }
.swatch.tier-transit { border-color: var(--tr-line); background: var(--tr-soft); color: var(--tr-text); }
.swatch.origin { border-color: var(--origin-line); background: var(--origin-soft); color: var(--origin-text); }
.swatch.prefix { border-color: var(--prefix-line); background: var(--prefix-soft); color: var(--prefix-text); }
details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 8px; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 2px; color: var(--text-2); }
.prose { max-width: 760px; padding: 26px 0 10px; }
.prose h2 { margin: 30px 0 8px; font-size: 19px; }
.prose p { margin: 0 0 12px; color: var(--text-2); }
.source { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.foot { margin-top: 36px; padding: 22px 0 34px; border-top: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted); }
.foot .dot { margin: 0 6px; }

@media (max-width: 760px) {
  body { font-size: 15px; }
  .wrap { padding: 0 14px; }
  .top-in { gap: 10px; }
  .brand span { display: none; }
  .mini-search { max-width: none; }
  h1 { font-size: 24px; }
  .hero { padding: 30px 0 18px; }
  .hero h1 { font-size: 34px; }
  .search input { height: 50px; padding: 0 12px; font-size: 15px; }
  .search button { height: 50px; padding: 0 16px; font-size: 15px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

@media print {
  .top, .foot, .zoom, .actions, .mini-search { display: none !important; }
  .frame { background: none; overflow: visible; }
}
