/* ============================================================
   Future Tech Map - local styles
   Loads after colors_and_type.css.  All Translation Endeavors
   tokens are inherited; this file is for layout & component chrome.
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: var(--te-paper-100);
  color: var(--te-fg);
  font-family: var(--te-font-sans);
  overflow-x: hidden;
}

/* The wall-card frame ----------------------------------------- */
.ftm {
  max-width: 1760px;
  margin: 0 auto;
  padding: var(--te-space-6) var(--te-space-6) var(--te-space-9);
}

.ftm__plate {
  background: var(--te-paper-100);
  border: 1px solid var(--te-line);
  box-shadow: var(--te-shadow-sm);
  padding: var(--te-space-7) var(--te-space-7) var(--te-space-6);
  position: relative;
}

/* Hairline corner crosses - a museum-card flourish */
.ftm__plate::before,
.ftm__plate::after,
.ftm__plate > .corner-tl,
.ftm__plate > .corner-tr,
.ftm__plate > .corner-bl,
.ftm__plate > .corner-br {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.ftm__plate > .corner-tl { top: 16px;    left: 16px;    border-top: 1px solid var(--te-ink-900); border-left: 1px solid var(--te-ink-900); }
.ftm__plate > .corner-tr { top: 16px;    right: 16px;   border-top: 1px solid var(--te-ink-900); border-right: 1px solid var(--te-ink-900); }
.ftm__plate > .corner-bl { bottom: 16px; left: 16px;    border-bottom: 1px solid var(--te-ink-900); border-left: 1px solid var(--te-ink-900); }
.ftm__plate > .corner-br { bottom: 16px; right: 16px;   border-bottom: 1px solid var(--te-ink-900); border-right: 1px solid var(--te-ink-900); }

/* Header ----------------------------------------------------- */
.ftm__header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--te-space-6);
  align-items: end;
  padding-bottom: var(--te-space-5);
  margin-bottom: var(--te-space-6);
  border-bottom: 1px solid var(--te-line-strong);
}

.ftm__eyebrow {
  font-family: var(--te-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--te-fg-subtle);
  display: flex;
  gap: var(--te-space-3);
  align-items: center;
  margin-bottom: var(--te-space-3);
}
.ftm__eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--te-pulse);
  display: inline-block;
}

.ftm__title {
  font-family: var(--te-font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(40px, 5.2vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--te-ink-900);
  text-wrap: balance;
  max-width: 22ch;
  margin: 0;
}
.ftm__title em { font-style: normal; font-family: var(--te-font-display); }

.ftm__sub {
  font-family: var(--te-font-serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.4;
  color: var(--te-fg-muted);
  max-width: 56ch;
  margin: var(--te-space-4) 0 0;
}

.ftm__serial {
  font-family: var(--te-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--te-fg-subtle);
  text-align: right;
  line-height: 1.6;
}
.ftm__serial strong { color: var(--te-ink-900); font-weight: 500; }
.ftm__serial-num {
  font-family: var(--te-font-display);
  font-style: italic;
  font-size: 36px;
  line-height: 1;
  color: var(--te-ink-900);
  letter-spacing: -0.01em;
  margin-top: 4px;
}

/* Inspiration credit - sits below the headline, in place of
   the old subtitle.  Mono label + serif italic body, same visual
   register as a preamble note but inline in the header. */
.ftm__inspiration {
  margin-top: var(--te-space-4);
  max-width: 56ch;
}
.ftm__inspiration .label {
  font-family: var(--te-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--te-fg-subtle);
  display: block;
  margin-bottom: 8px;
}
.ftm__inspiration .body {
  font-family: var(--te-font-serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
  color: var(--te-fg-muted);
  margin: 0;
}

/* Preamble (disclaimer + reading guide, sits ABOVE the themes
   /legend and the map) ----------------------------------------- */
.ftm__preamble {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--te-space-7);
  padding: var(--te-space-5) 0 var(--te-space-5);
  border-top: 1px solid var(--te-line);
  border-bottom: 1px solid var(--te-line);
  margin-bottom: var(--te-space-5);
}
.ftm__preamble-note .label {
  font-family: var(--te-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--te-fg-subtle);
  margin-bottom: 8px;
  display: block;
}
.ftm__preamble-note .body {
  font-family: var(--te-font-serif);
  font-style: italic;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--te-fg-muted);
  margin: 0;
  max-width: 42ch;
}
/* Disclaimer column reads as the lead - ink-900, slightly larger */
.ftm__preamble-note--disclaimer .label {
  color: var(--te-ink-900);
  font-weight: 500;
}
.ftm__preamble-note--disclaimer .body {
  color: var(--te-ink-900);
  font-size: 15px;
}

/* Toolbar (filters) ----------------------------------------- */
.ftm__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--te-space-5);
  align-items: center;
  padding: var(--te-space-3) 0 var(--te-space-5);
  border-bottom: 1px dashed var(--te-line);
  margin-bottom: var(--te-space-5);
}
.ftm__toolbar-group {
  display: flex;
  align-items: center;
  gap: var(--te-space-3);
}
.ftm__toolbar-label {
  font-family: var(--te-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--te-fg-subtle);
}
.ftm__chips {
  display: inline-flex;
  border: 1px solid var(--te-ink-900);
  border-radius: 999px;
  overflow: hidden;
  background: var(--te-paper-100);
}
.ftm__chip {
  background: transparent;
  border: 0;
  padding: 6px 14px;
  font-family: var(--te-font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--te-ink-900);
  border-right: 1px solid var(--te-ink-100);
  transition: background var(--te-dur) var(--te-ease);
}
.ftm__chip:last-child { border-right: 0; }
.ftm__chip:hover { background: var(--te-paper-300); }
.ftm__chip[aria-pressed="true"] {
  background: var(--te-ink-900);
  color: var(--te-paper-100);
}
.ftm__chip .yr {
  font-size: 10px;
  opacity: 0.6;
  margin-left: 6px;
}
.ftm__chip[aria-pressed="true"] .yr { opacity: 0.7; }

.ftm__legend {
  margin-left: auto;
  display: flex;
  gap: var(--te-space-4);
  flex-wrap: wrap;
}
.ftm__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--te-font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--te-fg-muted);
}
.ftm__legend-item .swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: var(--te-paper-100);
}

/* The map canvas ---------------------------------------------- */
.ftm__canvas {
  position: relative;
  background: var(--te-paper-100);
  background-image:
    linear-gradient(to right,  rgba(20,17,11,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20,17,11,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  border: 1px solid var(--te-line);
  overflow: hidden;
}
.ftm__canvas[data-density="compact"]  { --ftm-canvas-h: 62vh; }
.ftm__canvas[data-density="spacious"] { --ftm-canvas-h: 78vh; }

/* The scroll viewport - SVG is rendered at its natural pixel size and
   the container scrolls when the SVG exceeds the viewport.            */
.ftm__map-scroll {
  position: relative;
  width: 100%;
  height: var(--ftm-canvas-h, 70vh);
  min-height: 480px;
  overflow: auto;
  cursor: grab;
  scrollbar-width: thin;
  scrollbar-color: var(--te-ink-300) transparent;
  touch-action: pan-x pan-y;
}
.ftm__map-scroll.dragging { cursor: grabbing; }
.ftm__map-scroll svg {
  display: block;
  /* Width and height set inline so zoom is precise.  At zoom=1 the SVG is
     rendered at its native 2080 px viewBox width.                       */
}

/* Floating zoom controls -------------------------------------- */
.ftm__zoom-ui {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--te-ink-900);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: var(--te-shadow-sm);
  font-family: var(--te-font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  z-index: 5;
}
.ftm__zoom-ui button {
  background: transparent;
  border: 0;
  border-right: 1px solid var(--te-ink-100);
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
  color: var(--te-ink-900);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background var(--te-dur) var(--te-ease);
  min-width: 36px;
}
.ftm__zoom-ui button:last-child { border-right: 0; }
.ftm__zoom-ui button:hover { background: var(--te-paper-300); }
.ftm__zoom-ui button:disabled { opacity: 0.35; cursor: not-allowed; }
.ftm__zoom-ui .zoom-level {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: var(--te-fg-muted);
  border-right: 1px solid var(--te-ink-100);
  font-feature-settings: "tnum";
  min-width: 56px;
  justify-content: center;
}
.ftm__zoom-ui .zoom-hint {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: var(--te-fg-subtle);
  font-size: 10px;
  letter-spacing: 0.1em;
  border-right: 1px solid var(--te-ink-100);
}

/* Mini-map (overview rectangle showing current viewport) ------ */
.ftm__minimap {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 220px;
  height: calc(220px * 920 / 2080);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--te-ink-900);
  z-index: 5;
  pointer-events: none;
  box-shadow: var(--te-shadow-sm);
}
.ftm__minimap svg { width: 100%; height: 100%; display: block; }
.ftm__minimap .viewport {
  fill: none;
  stroke: var(--te-pulse);
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

/* Station marker styles --------------------------------------- */
.station-hit { cursor: pointer; }
.station-hit:hover .station-ring { stroke-width: 4; }
.station-label {
  font-family: var(--te-font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  fill: var(--te-ink-900);
  pointer-events: none;
  user-select: none;
}
.station-label-sm {
  font-family: var(--te-font-sans);
  font-size: 12px;
  font-weight: 500;
  fill: var(--te-ink-900);
  pointer-events: none;
  user-select: none;
}
.zone-label {
  font-family: var(--te-font-display);
  font-style: italic;
  font-size: 36px;
  fill: var(--te-ink-100);
  letter-spacing: -0.02em;
  pointer-events: none;
  user-select: none;
}
.zone-year {
  font-family: var(--te-font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  fill: var(--te-fg-subtle);
  text-transform: uppercase;
  pointer-events: none;
}
.zone-divider { stroke: var(--te-line); stroke-width: 1; stroke-dasharray: 4 6; }

.line-track { fill: none; stroke-linejoin: round; stroke-linecap: round; }

.india-marker {
  fill: var(--te-pulse);
  pointer-events: none;
}

/* Filtered-out fade */
.station-hit[data-fade="true"] { opacity: 0.18; }
.station-hit[data-fade="true"]:hover { opacity: 0.5; }
.line-track[data-fade="true"] { opacity: 0.22; }

/* Convergence highlight */
.interchange-pulse {
  fill: none;
  stroke: var(--te-ochre);
  stroke-width: 1.5;
  opacity: 0.0;
  transition: opacity var(--te-dur) var(--te-ease);
}
.show-convergence .interchange-pulse { opacity: 1; animation: ftm-pulse 2.6s var(--te-ease) infinite; }
@keyframes ftm-pulse {
  0%   { opacity: 0.0; r: 16; }
  40%  { opacity: 0.7; r: 22; }
  100% { opacity: 0.0; r: 30; }
}

/* India halo */
.show-india .india-halo { opacity: 1; }
.india-halo { opacity: 0; transition: opacity var(--te-dur) var(--te-ease); fill: none; stroke: var(--te-pulse); stroke-width: 1; stroke-dasharray: 2 3; }

/* Footer plate (just the edition mark) ----------------------- */
.ftm__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--te-space-6);
  padding-top: var(--te-space-4);
  border-top: 1px solid var(--te-line-strong);
  font-family: var(--te-font-sans);
}

.ftm__sig {
  text-align: right;
  font-family: var(--te-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--te-fg-subtle);
  text-transform: uppercase;
  line-height: 1.6;
}
.ftm__sig img { display: block; height: 36px; margin-bottom: 10px; margin-left: auto; }

/* Spectrum cap ------------------------------------------------ */
.ftm__spectrum {
  display: flex;
  height: 4px;
  width: 100%;
  margin-top: var(--te-space-3);
}
.ftm__spectrum > span { flex: 1; }
.ftm__spectrum .s1 { background: var(--te-pulse); }
.ftm__spectrum .s2 { background: var(--te-ultramarine); }
.ftm__spectrum .s3 { background: var(--te-tangerine); }
.ftm__spectrum .s4 { background: var(--te-kelp); }
.ftm__spectrum .s5 { background: var(--te-violet); }
.ftm__spectrum .s6 { background: var(--te-ochre); }

/* Detail panel ----------------------------------------------- */
.ftm__panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20,17,11,0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--te-dur) var(--te-ease);
  z-index: 90;
}
.ftm__panel-backdrop[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.ftm__panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 95vw);
  background: var(--te-paper-100);
  border-left: 1px solid var(--te-ink-900);
  box-shadow: var(--te-shadow-lg);
  transform: translateX(100%);
  transition: transform var(--te-dur-slow) var(--te-ease);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ftm__panel[data-open="true"] { transform: translateX(0); }
.ftm__panel-inner {
  padding: var(--te-space-6) var(--te-space-6) var(--te-space-7);
  overflow-y: auto;
  flex: 1;
}

.ftm__panel-bar {
  height: 6px;
  flex-shrink: 0;
}
.ftm__panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--te-space-4);
  padding-bottom: var(--te-space-3);
}
.ftm__panel-meta {
  font-family: var(--te-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--te-fg-subtle);
  line-height: 1.6;
}
.ftm__panel-meta .acct { color: var(--te-ink-900); }
.ftm__panel-close {
  background: none;
  border: 1px solid var(--te-line);
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 16px;
  font-family: var(--te-font-mono);
  cursor: pointer;
  color: var(--te-fg-muted);
  transition: all var(--te-dur) var(--te-ease);
  flex-shrink: 0;
}
.ftm__panel-close:hover { background: var(--te-ink-900); color: var(--te-paper-100); border-color: var(--te-ink-900); }

.ftm__panel-title {
  font-family: var(--te-font-display);
  font-size: 44px;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: var(--te-space-3) 0 var(--te-space-3);
  color: var(--te-ink-900);
  text-wrap: pretty;
}

.ftm__panel-tag {
  font-family: var(--te-font-serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.45;
  color: var(--te-fg-muted);
  margin: 0 0 var(--te-space-5);
  padding-bottom: var(--te-space-5);
  border-bottom: 1px solid var(--te-line);
}

.ftm__panel-section { margin-bottom: var(--te-space-5); }
.ftm__panel-section h4 {
  font-family: var(--te-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 var(--te-space-3);
  color: var(--te-fg-subtle);
}
.ftm__panel-section h4 .pointer {
  margin-right: 6px;
  color: var(--te-ink-900);
}
.ftm__panel-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: prob;
}
.ftm__panel-bullets li {
  counter-increment: prob;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--te-line);
  font-family: var(--te-font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--te-ink-900);
}
.ftm__panel-bullets li:last-child { border-bottom: 1px solid var(--te-line); }
.ftm__panel-bullets li::before {
  content: counter(prob, decimal-leading-zero);
  font-family: var(--te-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--te-fg-subtle);
  padding-top: 3px;
}

.ftm__panel-india {
  background: var(--te-paper-300);
  border-left: 3px solid var(--te-pulse);
  padding: var(--te-space-4);
  margin-bottom: var(--te-space-5);
}
.ftm__panel-india .label {
  font-family: var(--te-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--te-pulse);
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}
.ftm__panel-india p {
  font-family: var(--te-font-serif);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
  color: var(--te-ink-900);
}

.ftm__panel-watching {
  font-family: var(--te-font-mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--te-fg-muted);
}
.ftm__panel-watching div { padding: 4px 0; }

.ftm__panel-footer {
  margin-top: var(--te-space-6);
  padding-top: var(--te-space-4);
  border-top: 1px solid var(--te-line-strong);
  font-family: var(--te-font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--te-fg-subtle);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}

/* Hero strip - themed line keys */
.ftm__themes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--te-space-5);
  margin: var(--te-space-5) 0 var(--te-space-6);
  padding-top: var(--te-space-5);
  border-top: 1px solid var(--te-line);
}
.ftm__theme {
  border-top: 3px solid var(--theme-color, var(--te-ink-900));
  padding-top: var(--te-space-3);
}
.ftm__theme .mono {
  font-family: var(--te-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--te-fg-subtle);
  display: block;
  margin-bottom: 4px;
}
.ftm__theme .name {
  font-family: var(--te-font-display);
  font-style: italic;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--te-ink-900);
  margin: 0 0 8px;
}
.ftm__theme .sub {
  font-family: var(--te-font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--te-fg-muted);
  margin: 0;
}
.ftm__theme .count {
  font-family: var(--te-font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--theme-color);
  margin-top: 8px;
  display: block;
}

/* ============================================================
   Responsive - tablet (≤1100px)
   ============================================================ */
@media (max-width: 1100px) {
  .ftm__header { grid-template-columns: 1fr; }
  .ftm__serial { text-align: left; }
  .ftm__themes { grid-template-columns: repeat(2, 1fr); }
  .ftm__preamble { grid-template-columns: 1fr 1fr; }
  .ftm__preamble-note--disclaimer { grid-column: span 2; }
  .ftm__sig { text-align: left; }
  .ftm__minimap { width: 160px; }
}

/* ============================================================
   Responsive - phone (≤720px)
   Goal: the article reads cleanly on a single thumb. The tube
   map itself stays wide and pan-scrolls horizontally - that's
   correct behaviour for a tube map.
   ============================================================ */
@media (max-width: 720px) {
  /* Plate chrome - pull margins way in */
  .ftm { padding: var(--te-space-3) var(--te-space-3) var(--te-space-6); }
  .ftm__plate {
    padding: var(--te-space-5) var(--te-space-4) var(--te-space-5);
  }
  .ftm__plate > .corner-tl,
  .ftm__plate > .corner-tr,
  .ftm__plate > .corner-bl,
  .ftm__plate > .corner-br {
    width: 10px; height: 10px;
  }
  .ftm__plate > .corner-tl { top: 10px;    left: 10px; }
  .ftm__plate > .corner-tr { top: 10px;    right: 10px; }
  .ftm__plate > .corner-bl { bottom: 10px; left: 10px; }
  .ftm__plate > .corner-br { bottom: 10px; right: 10px; }

  /* Header */
  .ftm__header {
    padding-bottom: var(--te-space-4);
    margin-bottom: var(--te-space-4);
  }
  .ftm__title {
    font-size: clamp(34px, 9vw, 48px);
    max-width: 100%;
  }
  .ftm__sub {
    font-size: 15px;
    line-height: 1.45;
    margin-top: var(--te-space-3);
  }
  .ftm__eyebrow {
    flex-wrap: wrap;
    gap: var(--te-space-2);
    font-size: 10px;
  }

  /* Theme key - single column */
  .ftm__themes {
    grid-template-columns: 1fr;
    gap: var(--te-space-3);
    margin: var(--te-space-4) 0 var(--te-space-4);
    padding-top: var(--te-space-4);
  }
  .ftm__theme .name { font-size: 22px; }
  .ftm__theme .sub { font-size: 13px; }

  /* Toolbar - stack vertically; chips scroll horizontally
     so they don't wrap into multiple rows */
  .ftm__toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--te-space-3);
    padding: var(--te-space-3) 0 var(--te-space-4);
    margin-bottom: var(--te-space-4);
  }
  .ftm__toolbar-group {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--te-space-2);
    width: 100%;
  }
  .ftm__chips {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .ftm__chips::-webkit-scrollbar { display: none; }
  .ftm__chip {
    padding: 8px 12px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .ftm__legend {
    margin-left: 0;
    gap: var(--te-space-3);
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }
  .ftm__legend-item { font-size: 10px; }
  .ftm__download {
    margin-left: 0;
    padding: 8px 12px;
    font-size: 10px;
  }

  /* Map canvas - keep usable height but shrink min */
  .ftm__canvas[data-density="compact"]  { --ftm-canvas-h: 70vh; }
  .ftm__canvas[data-density="spacious"] { --ftm-canvas-h: 72vh; }
  .ftm__map-scroll {
    min-height: 380px;
    -webkit-overflow-scrolling: touch;
  }

  /* Floating overlays on the map - hide minimap (not useful at
     phone scale), simplify zoom UI */
  .ftm__minimap { display: none !important; }
  .ftm__zoom-ui {
    top: 8px;
    right: 8px;
    font-size: 10px;
  }
  .ftm__zoom-ui .zoom-hint { display: none; }
  .ftm__zoom-ui button { padding: 8px 10px; min-width: 34px; }
  .ftm__zoom-ui .zoom-level { padding: 0 10px; min-width: 44px; }

  /* Detail panel - full-width slide-up */
  .ftm__panel {
    width: 100vw;
    border-left: 0;
    border-top: 1px solid var(--te-ink-900);
  }
  .ftm__panel-inner {
    padding: var(--te-space-5) var(--te-space-4) var(--te-space-6);
  }
  .ftm__panel-title { font-size: 32px; }
  .ftm__panel-tag { font-size: 16px; }

  /* Preamble - stack on phone */
  .ftm__preamble {
    grid-template-columns: 1fr;
    gap: var(--te-space-4);
    padding: var(--te-space-4) 0;
    margin-bottom: var(--te-space-4);
  }
  .ftm__preamble-note--disclaimer { grid-column: auto; }
  .ftm__preamble-note .body { max-width: 100%; font-size: 14px; }
  .ftm__preamble-note--disclaimer .body { font-size: 14.5px; }

  /* Footer - just the edition mark */
  .ftm__footer {
    justify-content: flex-start;
    margin-top: var(--te-space-4);
  }
  .ftm__sig { grid-column: auto; }

  /* Tweaks panel - hide on mobile (it's an editor affordance
     and overlaps the article on small screens) */
  .twk-panel { display: none !important; }
}

/* ============================================================
   Responsive - tight phone (≤420px)
   ============================================================ */
@media (max-width: 420px) {
  .ftm { padding: var(--te-space-2) var(--te-space-2) var(--te-space-5); }
  .ftm__plate { padding: var(--te-space-4) var(--te-space-3); }
  .ftm__title { font-size: clamp(28px, 9.5vw, 38px); }
  .ftm__legend {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--te-space-2);
  }
  .ftm__download { align-self: flex-start; }
  .ftm__panel-title { font-size: 26px; }
}

/* ============================================================
   Download button (lives in the toolbar legend area)
   ============================================================ */
.ftm__download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--te-ink-900);
  border-radius: var(--te-radius-pill);
  background: var(--te-ink-900);
  color: var(--te-paper-100);
  font-family: var(--te-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  margin-left: 16px;
  transition: opacity var(--te-dur) var(--te-ease);
}
.ftm__download:hover { opacity: 0.85; }

/* ============================================================
   Print-only station appendix
   - Hidden on-screen
   - Shown only when the user prints (or "Save as PDF")
   ============================================================ */
.ftm__print-only { display: none; }

@media print {
  /* === Page setup ===
     Two named pages so the tube map prints landscape and the
     station appendix prints portrait. Chrome's "Save as PDF"
     honours per-page orientation. */
  @page {
    margin: 12mm 12mm;
    size: A4 portrait;
  }
  @page tube {
    size: A4 landscape;
    margin: 10mm 10mm;
  }
  @page appendix {
    size: A4 portrait;
    margin: 14mm 12mm;
  }
  html, body {
    background: #fff !important;
    color: #000 !important;
    zoom: 1 !important;
  }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* === Hide everything we don't want in the PDF ===
     Only the tube map (landscape) and the station appendix
     (portrait) should appear in print output. */
  header.te-nav,
  .te-nav,
  .ftm__header,
  .ftm__themes,
  .ftm__preamble,
  .ftm__toolbar,
  .ftm__zoom-ui,
  .ftm__minimap,
  .ftm__panel,
  .ftm__panel-backdrop,
  .ftm__footer,
  .ftm__sig,
  .ftm__spectrum,
  .twk-panel,
  .twk-panel *,
  .ftm__download {
    display: none !important;
  }

  /* === Plate chrome simplification for print === */
  .ftm { padding: 0 !important; max-width: none !important; }
  .ftm__plate {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: #fff !important;
  }
  .ftm__plate > .corner-tl,
  .ftm__plate > .corner-tr,
  .ftm__plate > .corner-bl,
  .ftm__plate > .corner-br {
    display: none !important;
  }

  /* === Map canvas - landscape, fit-to-page === */
  .ftm__canvas {
    page: tube;
    border: none !important;
    background: #fff !important;
    page-break-after: always;
    overflow: visible !important;
    height: auto !important;
    margin: 0 !important;
  }
  .ftm__map-scroll {
    overflow: visible !important;
    height: auto !important;
    cursor: default !important;
    transform: none !important;
  }
  .ftm__map-scroll svg {
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    page-break-inside: avoid;
  }

  /* === Show the appendix (portrait pages) === */
  .ftm__print-only { display: block !important; }
  .ftm__print-stations {
    page: appendix;
    page-break-before: always;
    padding-top: 0;
  }
  .ftm__print-h1 {
    font-family: var(--te-font-display);
    font-size: 32px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    color: #000 !important;
  }
  .ftm__print-h1 em { font-style: italic; }
  .ftm__print-intro {
    font-family: var(--te-font-serif);
    font-style: italic;
    font-size: 13px;
    color: #444;
    margin: 0 0 18px;
    max-width: 60ch;
  }

  /* Each line on its own page */
  .ftm__print-line {
    page-break-before: always;
    margin-bottom: 24px;
  }
  .ftm__print-line:first-of-type {
    page-break-before: auto;
  }
  .ftm__print-line-title {
    display: block;
    margin: 0 0 16px;
    padding: 0 0 8px;
    border-bottom: 2px solid var(--theme-color, #000);
  }
  .ftm__print-line-title .mono {
    display: block;
    font-family: var(--te-font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--theme-color, #000);
    margin-bottom: 6px;
  }
  .ftm__print-line-title .name {
    display: block;
    font-family: var(--te-font-display);
    font-style: italic;
    font-size: 28px;
    line-height: 1.05;
    color: #000;
  }
  .ftm__print-line-title .sub {
    display: block;
    font-family: var(--te-font-serif);
    font-style: italic;
    font-size: 14px;
    color: #555;
    margin-top: 4px;
  }

  /* Each station card */
  .ftm__print-station {
    padding: 10px 0 10px;
    border-top: 1px solid #ccc;
    page-break-inside: avoid;
  }
  .ftm__print-station:first-of-type {
    border-top: none;
  }
  .ftm__print-station-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 4px;
  }
  .ftm__print-station-name {
    font-family: var(--te-font-display);
    font-size: 18px;
    line-height: 1.1;
    color: #000;
    margin: 0;
    font-weight: 500;
    flex: 1 1 auto;
  }
  .ftm__print-station-meta {
    font-family: var(--te-font-mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #666;
    white-space: nowrap;
  }
  .ftm__print-station-tag {
    font-family: var(--te-font-serif);
    font-style: italic;
    font-size: 12.5px;
    line-height: 1.4;
    color: #333;
    margin: 0 0 8px;
  }

  .ftm__print-block { margin: 6px 0; }
  .ftm__print-block-label {
    display: block;
    font-family: var(--te-font-mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 3px;
  }
  .ftm__print-list {
    margin: 0;
    padding-left: 20px;
    font-family: var(--te-font-serif);
    font-size: 11.5px;
    line-height: 1.45;
    color: #222;
  }
  .ftm__print-list li { padding: 1px 0; }
  .ftm__print-india {
    border-left: 2px solid var(--te-pulse);
    padding-left: 8px;
  }
  .ftm__print-india p {
    margin: 0;
    font-family: var(--te-font-serif);
    font-style: italic;
    font-size: 11.5px;
    line-height: 1.45;
    color: #222;
  }
  .ftm__print-watching {
    font-family: var(--te-font-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    color: #444;
    margin: 0;
  }

}
