/* =====================================================================
   TRANSFER - a city journal arranged as a transit network
   ---------------------------------------------------------------------
   Design notes:
   - Radius system (documented mixed rule): structural surfaces use a
     near-sharp 2px radius (civic signage). Route nodes are full circles
     because they are station markers, not containers.
   - Color system: ONE interaction accent ("signal") per theme, plus a
     semantic transit-line palette mapped to the five categories.
   ===================================================================== */

/* ---------- Fonts (self-hosted, supplied assets) ---------- */
@font-face { font-family: "Oswald"; src: url("./assets/oswald.ttf") format("truetype"); font-weight: 200 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("./assets/space-grotesk.ttf") format("truetype"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("./assets/literata.ttf") format("truetype"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("./assets/ibm-plex-mono.ttf") format("truetype"); font-weight: 400 600; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --maxw: 1180px;
  --readw: 720px;
  --r: 2px;

  --l1: #ff6fae; /* Culture  */
  --l2: #ff9f1c; /* Food     */
  --l3: #4cc9f0; /* Movement */
  --l4: #57d68a; /* People   */
  --l5: #ff6b6b; /* Places   */

  --stage: 0;
}

:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #0c0f14;
  --bg-2: #10151c;
  --panel: #161c26;
  --panel-2: #1c2431;
  --text: #f2eee6;
  --muted: #9aa5b3;
  --faint: #808b99;
  --hair: rgba(255, 255, 255, 0.12);
  --hair-strong: rgba(255, 255, 255, 0.26);
  --accent: #ffd23f;
  --accent-ink: #14110a;
  --accent-soft: rgba(255, 210, 63, 0.16);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --img-filter: saturate(0.92) contrast(1.02) brightness(0.86);
}

:root[data-theme="day"] {
  color-scheme: light;
  --bg: #f1eee6;
  --bg-2: #e9e4d7;
  --panel: #ffffff;
  --panel-2: #f8f5ee;
  --text: #15181d;
  --muted: #55606d;
  --faint: #5f6a77;
  /* Accessible day-service variants of the line colors (used as text
     and marker strokes on a light background). */
  --l1: #c2185b; /* Culture  */
  --l2: #9a5b00; /* Food     */
  --l3: #0a6ea8; /* Movement */
  --l4: #1c7a45; /* People   */
  --l5: #b3341f; /* Places   */
  --hair: rgba(21, 24, 29, 0.16);
  --hair-strong: rgba(21, 24, 29, 0.34);
  --accent: #9a5b00;
  --accent-ink: #fffaf0;
  --accent-soft: rgba(154, 91, 0, 0.14);
  --shadow: 0 18px 44px rgba(40, 32, 12, 0.14);
  --img-filter: saturate(0.96) contrast(1.02);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(1100px 620px at 82% -8%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 68%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  transition: background-color 0.45s ease, color 0.45s ease;
}

img { max-width: 100%; display: block; }

button, input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r);
}

.sr-only, .skip-link:not(:focus) {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--r);
}

/* =====================================================================
   TOP BAR
   ===================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hair);
}

.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex: 0 0 auto;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 7px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--r);
}

.brand-mark-node {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--bg) 70%, transparent);
}

.brand-word {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.14em;
}

.topbar-status {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 1 1 auto;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ghost-btn {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--hair-strong);
  border-radius: var(--r);
  color: var(--text);
  padding: 9px 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}
.ghost-btn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ghost-btn:active { transform: translateY(1px); }

/* =====================================================================
   MASTHEAD
   ===================================================================== */
.masthead { border-bottom: 1px solid var(--hair); }

.masthead-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 52px 20px 44px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: end;
}

.kicker {
  margin: 0 0 18px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.wordmark {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: clamp(3.4rem, 10.5vw, 7.4rem);
  line-height: 0.86;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.lede {
  margin: 22px 0 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.02rem;
}

/* network board */
.network {
  border: 1px solid var(--hair-strong);
  border-radius: var(--r);
  background: var(--panel);
  padding: 16px 16px 12px;
  box-shadow: var(--shadow);
}

.network-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hair);
  margin-bottom: 6px;
}

.network-title {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.network-note {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.network-list { list-style: none; margin: 0; padding: 0; }

.line-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 8px;
  background: transparent;
  border: 0;
  border-left: 4px solid var(--c);
  border-radius: var(--r);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.18s ease;
}
.line-btn:hover { background: color-mix(in srgb, var(--c) 12%, transparent); }
.line-btn[aria-pressed="true"] {
  background: color-mix(in srgb, var(--c) 20%, transparent);
}

.line-no {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--c);
}
.line-name { font-size: 0.94rem; font-weight: 500; }
.line-count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  color: var(--faint);
  white-space: nowrap;
}

/* =====================================================================
   CONTROLS
   ===================================================================== */
.controls { border-bottom: 1px solid var(--hair); }

.controls-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(160px, 1.1fr) minmax(170px, 1.1fr) minmax(170px, 1.1fr);
  gap: 16px;
  align-items: end;
}

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

.field > label,
.field-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="search"],
select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--hair-strong);
  border-radius: var(--r);
  padding: 11px 13px;
  color: var(--text);
  min-height: 44px;
}
input[type="search"]::placeholder { color: var(--faint); opacity: 1; }
input[type="search"]:hover, select:hover { border-color: var(--accent); }

.toggle-btn {
  width: 100%;
  min-height: 44px;
  background: var(--panel);
  border: 1px solid var(--hair-strong);
  border-radius: var(--r);
  padding: 9px 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.toggle-btn:hover { border-color: var(--accent); }
.toggle-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.toggle-state { font-size: 0.9rem; font-weight: 500; }
.toggle-count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.72;
}

/* =====================================================================
   ROUTE / MAIN LIST
   ===================================================================== */
.route-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.route {
  list-style: none;
  margin: 0 auto 0 0;
  padding: 0;
  max-width: 900px;
  position: relative;
}

.loading-note {
  list-style: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 22px 0 22px 72px;
}

@media (max-width: 720px) {
  .loading-note { padding-left: 46px; }
}

.station {
  position: relative;
  padding: 0 0 40px 72px;
}
.station:last-child { padding-bottom: 0; }

/* the connecting rail, colored per line */
.station::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--c);
  opacity: 0.9;
}

.station.has-interchange .node { top: 50px; }

.station .node {
  position: absolute;
  left: 15px;
  top: 22px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--bg);
  border: 5px solid var(--c);
  z-index: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.station .node::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: transparent;
  transition: background-color 0.2s ease;
}
.station.is-saved .node::after { background: var(--accent); }

.station-card {
  border: 1px solid var(--hair);
  border-radius: var(--r);
  background: var(--panel);
  overflow: hidden;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 0;
  transition: border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}
.station-card:hover,
.station-card:focus-within {
  border-color: var(--hair-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.station-card:hover .node,
.station-card:focus-within .node { transform: scale(1.16); }

.station-media {
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
  min-height: 100%;
}
.station-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--img-filter);
  transition: transform 0.5s ease, filter 0.3s ease;
}
.station-card:hover .station-media img { transform: scale(1.04); filter: saturate(1) contrast(1.02) brightness(0.94); }

:root[data-theme="day"] .station-card:hover .station-media img { filter: saturate(1) contrast(1.02); }

.station-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.line-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c);
}
.line-tag::before {
  content: "";
  width: 14px;
  height: 5px;
  background: var(--c);
  border-radius: 1px;
}

.station-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: clamp(1.32rem, 2.3vw, 1.85rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.station-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 62ch;
}

.station-meta {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.station-foot {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.open-item {
  background: transparent;
  border: 1px solid var(--hair-strong);
  border-radius: var(--r);
  color: var(--text);
  padding: 10px 18px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.open-item:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.open-item:active { transform: translateY(1px); }

.station-saved-flag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  display: none;
}
.station.is-saved .station-saved-flag { display: inline; }

/* interchange marker */
.interchange {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.interchange::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--muted);
}
.interchange strong { color: var(--c); font-weight: 600; }

/* ---------- Empty state ---------- */
.empty {
  max-width: 620px;
  margin: 30px auto 0;
  padding: 44px 30px;
  border: 1px dashed var(--hair-strong);
  border-radius: var(--r);
  text-align: center;
  background: var(--panel);
}
.empty-line {
  height: 5px;
  width: 120px;
  margin: 0 auto 22px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 14px, transparent 14px 24px);
}
.empty-title {
  margin: 0 0 10px;
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  font-size: 1.7rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.empty-body { margin: 0 0 22px; color: var(--muted); }

.action-btn {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  padding: 12px 22px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.18s ease;
}
.action-btn:hover { filter: brightness(1.08); }
.action-btn:active { transform: translateY(1px); }

/* ---------- reveal ---------- */
/* Content is always visible in its base state. Motion on this page is
   reserved for interaction feedback (hover, focus) and view transitions. */

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer { border-top: 1px solid var(--hair); background: var(--bg-2); }
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 20px 56px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 28px;
  align-items: start;
}
.footer-brand {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.14em;
}
.footer-note { margin: 0; color: var(--muted); font-size: 0.86rem; max-width: 68ch; }
.footer-lines {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--faint);
  text-align: right;
}

/* =====================================================================
   DETAIL VIEW
   ===================================================================== */
.detail {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  animation: detail-in 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.detail[hidden] { display: none; }

@keyframes detail-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.detail-progress {
  position: sticky;
  top: 0;
  height: 5px;
  z-index: 3;
  background: transparent;
}
.detail-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.08s linear;
}

.detail-scroll {
  height: calc(100% - 5px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-inner {
  max-width: var(--readw);
  margin: 0 auto;
  padding: 0 20px 96px;
}

.detail-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hair);
  margin-bottom: 34px;
}

.detail-sign {
  border-top: 6px solid var(--c);
  background: var(--panel);
  border-left: 1px solid var(--hair);
  border-right: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  border-radius: var(--r);
  padding: 24px 26px 26px;
  margin-bottom: 30px;
}

.now-arriving {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c);
  margin: 0 0 10px;
}

.detail-title {
  margin: 0 0 16px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.detail-meta {
  margin: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.detail-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }

.save-item {
  background: transparent;
  border: 1px solid var(--hair-strong);
  border-radius: var(--r);
  color: var(--text);
  padding: 12px 18px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.save-item:hover { border-color: var(--accent); }
.save-item[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.save-item:active { transform: translateY(1px); }

.detail-figure {
  margin: 0 0 30px;
  border: 1px solid var(--hair);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-2);
}
.detail-figure img { width: 100%; max-height: 440px; object-fit: cover; filter: var(--img-filter); }

.detail-body {
  font-family: "Literata", Georgia, serif;
  font-size: 1.175rem;
  line-height: 1.78;
  color: color-mix(in srgb, var(--text) 92%, var(--muted));
}
.detail-body p { margin: 0 0 1.35em; }
.detail-body p:first-child::first-letter {
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  float: left;
  font-size: 3.6em;
  line-height: 0.82;
  padding: 0.06em 0.12em 0 0;
  color: var(--accent);
}

.detail-nav {
  margin-top: 54px;
  padding-top: 26px;
  border-top: 1px solid var(--hair);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.detail-nav button {
  background: var(--panel);
  border: 1px solid var(--hair-strong);
  border-radius: var(--r);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.detail-nav button:hover { border-color: var(--accent); }
.detail-nav button[disabled] { opacity: 0.4; cursor: default; }
.detail-nav .dir {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-nav .dest { font-weight: 500; font-size: 0.95rem; line-height: 1.3; }
.detail-nav .next { text-align: right; align-items: flex-end; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1000px) {
  .masthead-inner { grid-template-columns: 1fr; gap: 30px; align-items: stretch; }
  .controls-inner { grid-template-columns: 1fr 1fr; }
  .field-search { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .topbar-status { display: none; }
  .masthead-inner { padding: 30px 18px 26px; gap: 22px; }
  .lede { margin-top: 16px; }

  /* compact the network board into a horizontal strip so search
     stays close to the top of the mobile view */
  .network { padding: 12px 12px 10px; }
  .network-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .network-list li { flex: 0 0 auto; }
  .line-btn {
    width: auto;
    grid-template-columns: auto auto;
    gap: 8px;
    padding: 8px 11px;
  }
  .line-count { display: none; }

  .controls-inner { padding: 16px 18px; grid-template-columns: 1fr; gap: 12px; }

  .route-wrap { padding: 26px 16px 64px; }
  .station { padding-left: 46px; }
  .station::before { left: 15px; width: 4px; }
  .station .node { left: 6px; width: 22px; height: 22px; border-width: 4px; }

  .station-card { grid-template-columns: 1fr; }
  .station-media { aspect-ratio: 16 / 9; min-height: 0; }
  .station-body { padding: 18px 18px 20px; }

  .footer-inner { grid-template-columns: 1fr; gap: 16px; }
  .footer-lines { text-align: left; }

  .detail-bar { padding: 12px 0; margin-bottom: 24px; }
  .detail-inner { padding: 0 16px 72px; }
  .detail-sign { padding: 20px 18px; }
  .detail-body { font-size: 1.08rem; }
  .detail-nav { grid-template-columns: 1fr; }
  .detail-nav .next { text-align: left; align-items: flex-start; }
}

@media (max-width: 420px) {
  .wordmark { font-size: 3.1rem; }
  .brand-word { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .detail { animation: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar, .detail-bar {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--bg);
  }
}
