/* ============================================================================
   /island-hopping — the Caribbean inter-island air network.

   Mobile first. The prototype in _dev/specs/.../design_handoff_caribbean_connectivity_map
   is desktop-first at 1560px with one breakpoint; its SIZES and BEHAVIOUR are kept exactly,
   its palette and typeface are not — see the brand mapping below.

   Brand mapping (from handoff.md "Brand deviation"):
       prototype coral #C9553A  ->  orange #FF7F0E   primary hubs, focused routes, highlight
       prototype teal  #2C6F8A  ->  navy   #003366   secondary hubs, default routes, inset bar
       prototype IBM Plex Sans  ->  Plus Jakarta Sans (headings/UI)
       prototype IBM Plex Mono  ->  JetBrains Mono, kept for IATA codes and figures only
                                     (handoff open question 1: a mono is kept, because the
                                     hub list is a column of 3-letter codes and a 2-digit
                                     number that must align down the column)

   The warm-neutral paper/land surfaces are kept: they are cartographic, not brand, and a
   white ocean reads as a hole in the page.
   ========================================================================= */

.ih {
    /* Cartography */
    --ih-paper: #F7F5F0;
    --ih-sea: #E3EAEE;
    --ih-land: #ECE5D6;
    --ih-landline: #C4B99F;
    --ih-graticule: #CBD8DE;

    /* Brand */
    --ih-route: var(--navy, #003366);
    --ih-hub: var(--orange, #FF7F0E);
    --ih-ink: var(--navy, #003366);
    --ih-hub-ink: #B45309;

    /* Neutrals */
    --ih-muted: #5A6672;
    --ih-rule: #D8D3C7;
    --ih-row-hover: #EFEBE1;

    --ih-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --ih-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

    background: var(--ih-paper);
    color: var(--ih-ink);
    font-family: var(--ih-font);
}

.ih-wrap {
    max-width: 1560px;
    margin: 0 auto;
    padding: 20px 16px 36px;
}

/* The controls, the tooltip and the bottom sheet all ship `hidden` and are revealed by the
   script. `display: flex` on them would otherwise beat the UA stylesheet's `[hidden]`, so with
   no JavaScript an empty bottom sheet and a dead zoom control render over the page — which is
   exactly the state a crawler and a link preview see. Specificity, not cascade order, decides
   this, so it needs the !important. */
.ih [hidden] { display: none !important; }

.ih-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.ih-head {
    border-bottom: 1px solid var(--ih-ink);
    padding-bottom: 16px;
}

.ih-eyebrow {
    margin: 0 0 8px;
    font: 500 11px/1 var(--ih-mono);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ih-muted);
}

.ih h1 {
    margin: 0;
    font-size: 25px;
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -.01em;
    text-wrap: pretty;
}

.ih-lede {
    margin: 10px 0 0;
    max-width: 62ch;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ih-muted);
    text-wrap: pretty;
}

/* A 2x2 grid on narrow screens, a flex row from 1000px (see the desktop block).
   Four stats wrapped as a flex row give 3 + 1, which reads as a widow; a grid of equal fractions
   gives two tidy rows and keeps the long label ("SEEN IN LIVE DATA") inside its own column
   whatever it says. */
.ih-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    margin: 18px 0 0;
}

.ih-stat { min-width: 0; }

.ih-stat dd {
    margin: 0;
    font: 700 26px/1 var(--ih-font);
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.ih-stat dt {
    margin-top: 3px;
    font: 500 10.5px/1.3 var(--ih-mono);
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ih-muted);
}

.ih-stat-live dd { color: var(--ih-hub-ink); }

/* ── Layout ─────────────────────────────────────────────────────────────── */

.ih-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    margin-top: 18px;
}

/* ── Map ────────────────────────────────────────────────────────────────── */

.ih-mapbox {
    position: relative;
    background: var(--ih-sea);
    border: 1px solid var(--ih-rule);
    aspect-ratio: 1200 / 820;
    max-width: 100%;
}

/* Phone: full-bleed out of the 16px wrap padding. */
@media (max-width: 639px) {
    .ih-mapbox {
        margin-inline: -16px;
        border-inline: 0;
    }
}

.ih-mapbox svg {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none; /* d3.zoom owns the gesture */
}

.ih-mapnote {
    position: absolute;
    inset: auto 12px 12px;
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--ih-muted);
    background: rgba(247, 245, 240, .9);
    padding: 7px 9px;
    border-radius: 3px;
}

.ih-tip {
    position: absolute;
    pointer-events: none;
    z-index: 5;
    max-width: 280px;
    padding: 9px 11px;
    border-radius: 4px;
    background: var(--ih-ink);
    color: var(--ih-paper);
    font-size: 12px;
    line-height: 1.45;
    opacity: 0;
    transition: opacity .12s;
}

.ih-tip[data-shown="1"] { opacity: 1; }
.ih-tip b { font-variant-numeric: tabular-nums; }
.ih-tip .ih-tip-t { font: 700 14px/1.25 var(--ih-font); }
.ih-tip .ih-tip-m { font: 500 11px/1.4 var(--ih-mono); opacity: .75; letter-spacing: .03em; }

/* Zoom presets and reset. Top-RIGHT only while there is no inset; the desktop rule below moves
   them left, because the inset occupies x 835-1180 of the viewBox and the controls landed on top
   of it. */
.ih-mapctl {
    position: absolute;
    inset: 10px 10px auto auto;
    max-width: calc(100% - 20px);
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.ih-zoompresets { display: flex; gap: 0; }

.ih-mapctl button {
    font: 600 11px/1 var(--ih-font);
    letter-spacing: .02em;
    padding: 7px 10px;
    min-height: 32px;
    border: 1px solid var(--ih-rule);
    background: rgba(247, 245, 240, .94);
    color: var(--ih-ink);
    cursor: pointer;
}

.ih-zoompresets button:first-child { border-radius: 3px 0 0 3px; }
.ih-zoompresets button:last-child { border-radius: 0 3px 3px 0; border-left: 0; }
.ih-reset { border-radius: 3px; }

.ih-mapctl button[aria-pressed="true"] {
    background: var(--ih-ink);
    border-color: var(--ih-ink);
    color: var(--ih-paper);
}

.ih-mapctl button:hover { border-color: var(--ih-ink); }

/* Hub size toggle */
.ih-sizetoggle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font: 500 11px/1 var(--ih-mono);
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ih-muted);
}

.ih-sizetoggle div { display: flex; }

.ih-sizetoggle button {
    font: 600 11.5px/1 var(--ih-font);
    letter-spacing: 0;
    text-transform: none;
    padding: 7px 11px;
    min-height: 32px;
    border: 1px solid var(--ih-rule);
    background: transparent;
    color: var(--ih-ink);
    cursor: pointer;
}

.ih-sizetoggle button:first-child { border-radius: 999px 0 0 999px; }
.ih-sizetoggle button:last-child { border-radius: 0 999px 999px 0; border-left: 0; }

.ih-sizetoggle button[aria-pressed="true"] {
    background: var(--ih-ink);
    border-color: var(--ih-ink);
    color: var(--ih-paper);
}

/* ── SVG classes the script applies ─────────────────────────────────────── */

.ih-graticule-path { fill: none; stroke: var(--ih-graticule); stroke-width: .6; }
.ih-land-path { fill: var(--ih-land); stroke: var(--ih-landline); stroke-width: .7; }

.ih-edge {
    fill: none;
    stroke: var(--ih-route);
    stroke-linecap: round;
    stroke-opacity: .42;
}

.ih-edge[data-dim="1"] { stroke-opacity: .06; }
.ih-edge[data-focus="1"] { stroke: var(--ih-hub); stroke-opacity: .85; }
.ih-edge[data-active="1"] { stroke-opacity: .85; }
.ih-edge[data-unpublished="1"] { stroke-dasharray: 3 3; }

.ih-node { cursor: pointer; }
.ih-node[data-dim="1"] { opacity: .18; }
.ih-node circle { stroke: var(--ih-paper); stroke-width: 1.6; }
.ih-node.ih-tier-primary circle { fill: var(--ih-hub); }
.ih-node.ih-tier-secondary circle { fill: var(--ih-route); }
.ih-node.ih-tier-spoke circle { fill: var(--ih-paper); stroke: var(--ih-ink); stroke-width: 1.2; }

.ih-node:focus-visible { outline: none; }
.ih-node:focus-visible circle {
    stroke: var(--ih-hub);
    stroke-width: 3;
    paint-order: stroke;
}

.ih-lbl {
    font-family: var(--ih-mono);
    paint-order: stroke;
    stroke: var(--ih-sea);
    stroke-width: 3px;
    stroke-linejoin: round;
    pointer-events: none;
    fill: var(--ih-ink);
}

.ih-node.ih-tier-primary .ih-lbl { fill: var(--ih-hub-ink); }
.ih-inset-frame { fill: var(--ih-sea); stroke: var(--ih-ink); stroke-width: 1.2; }
.ih-inset-bar { fill: var(--ih-ink); }
.ih-inset-bar-text { fill: var(--ih-paper); font: 500 10.5px var(--ih-mono); letter-spacing: .08em; }
.ih-inset-marker { fill: none; stroke: var(--ih-ink); stroke-width: .8; stroke-dasharray: 3 3; }
.ih-scalenote { fill: var(--ih-muted); font: 500 10px var(--ih-mono); letter-spacing: .06em; }

/* ── Sidebar ────────────────────────────────────────────────────────────── */

.ih-side {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
}

.ih-panel h2 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 9px;
    font: 600 11px/1.3 var(--ih-mono);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ih-muted);
}

.ih-count { font-weight: 500; white-space: nowrap; }

.ih-clear {
    font: 500 11px var(--ih-mono);
    color: var(--ih-route);
    letter-spacing: .03em;
    white-space: nowrap;
}

/* Hub list */
.ih-hublist {
    list-style: none;
    margin: 0;
    padding: 0 4px 0 0;
    max-height: 452px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-bottom: 1px solid var(--ih-rule);
}

.ih-hubrow {
    display: grid;
    grid-template-columns: 22px 40px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-radius: 3px;
}

.ih-hubrow:hover,
.ih-hubrow.ih-on { background: var(--ih-row-hover); }

.ih-rk { font: 500 11px var(--ih-mono); color: var(--ih-muted); }
.ih-cd { font: 600 13px var(--ih-mono); color: var(--ih-ink); text-decoration: none; }
.ih-cd:hover { color: var(--ih-hub-ink); text-decoration: underline; }
.ih-nm { min-width: 0; }

.ih-place {
    display: block;
    font-size: 12px;
    color: var(--ih-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ih-bar {
    display: block;
    height: 4px;
    margin-top: 4px;
    background: var(--ih-rule);
    border-radius: 2px;
    overflow: hidden;
}

.ih-bar i { display: block; height: 100%; background: var(--ih-route); }
.ih-tier-primary .ih-bar i { background: var(--ih-hub); }

.ih-n {
    font: 600 13px var(--ih-mono);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Chips */
.ih-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ih-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    font: 500 12px var(--ih-font);
    padding: 7px 11px;
    min-height: 34px;
    border: 1px solid var(--ih-rule);
    border-radius: 999px;
    background: transparent;
    color: var(--ih-ink);
    cursor: pointer;
    text-align: left;
}

.ih-chip:hover { border-color: var(--ih-ink); }

.ih-chip[aria-pressed="true"] {
    background: var(--ih-ink);
    border-color: var(--ih-ink);
    color: var(--ih-paper);
}

.ih-chip small { font: 500 10px var(--ih-mono); opacity: .65; font-variant-numeric: tabular-nums; }

/* Key */
.ih-keylist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 9px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--ih-muted);
}

.ih-keylist li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ih-keylist svg { flex: 0 0 34px; }
.ih-k-primary { fill: var(--ih-hub); stroke: var(--ih-paper); stroke-width: 1.5; }
.ih-k-secondary { fill: var(--ih-route); stroke: var(--ih-paper); stroke-width: 1.5; }
.ih-k-spoke { fill: var(--ih-paper); stroke: var(--ih-ink); stroke-width: 1.3; }
.ih-k-line { stroke: var(--ih-route); stroke-width: 3; }
.ih-k-dash { stroke: var(--ih-route); stroke-width: 1.2; stroke-dasharray: 3 3; }

.ih-note {
    margin: 14px 0 0;
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--ih-muted);
    text-wrap: pretty;
}

.ih-note-geo { font-style: italic; }

/* ── Confidence pills ───────────────────────────────────────────────────── */

.ih-pill {
    display: inline-block;
    font: 600 10.5px/1 var(--ih-font);
    letter-spacing: .02em;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid currentColor;
    white-space: nowrap;
}

.ih-pill-verified { color: #15803D; }
.ih-pill-estimated { color: var(--ih-muted); }
.ih-pill-illustrative { color: #B45309; }

.ih-pill-live {
    color: var(--ih-paper);
    background: var(--ih-hub);
    border-color: var(--ih-hub);
}

/* ── Per-airport detail ─────────────────────────────────────────────────── */

.ih-detail {
    margin-top: 32px;
    border-top: 1px solid var(--ih-ink);
    padding-top: 18px;
}

.ih-detail > h2 {
    margin: 0 0 14px;
    font: 600 12px/1.4 var(--ih-mono);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ih-muted);
}

.ih-filtered { text-transform: none; letter-spacing: 0; font-family: var(--ih-font); }
.ih-empty { font-size: 13px; color: var(--ih-muted); }

.ih-ap {
    border-bottom: 1px solid var(--ih-rule);
    padding: 2px 0;
}

.ih-ap summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    padding: 11px 4px;
    cursor: pointer;
    min-height: 44px;
}

.ih-ap summary:hover { background: var(--ih-row-hover); }
.ih-ap[open] summary { background: var(--ih-row-hover); }
.ih-ap-code { font: 700 15px var(--ih-mono); }
.ih-ap-place { font-size: 14px; font-weight: 600; }

.ih-ap-tier {
    font: 600 10px var(--ih-mono);
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid var(--ih-rule);
    color: var(--ih-muted);
}

.ih-ap-tier.ih-tier-primary { color: var(--ih-hub-ink); border-color: currentColor; }
.ih-ap-tier.ih-tier-secondary { color: var(--ih-route); border-color: currentColor; }

.ih-ap-deg {
    margin-left: auto;
    font: 500 12px var(--ih-mono);
    color: var(--ih-muted);
}

.ih-ap-name {
    margin: 4px 4px 10px;
    font-size: 12.5px;
    color: var(--ih-muted);
}

/* The table is the one element allowed to scroll sideways on a phone. */
.ih-routes {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 14px;
    font-size: 12.5px;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

.ih-routes thead th {
    text-align: left;
    font: 600 10px var(--ih-mono);
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ih-muted);
    padding: 6px 10px 6px 4px;
    border-bottom: 1px solid var(--ih-rule);
}

.ih-routes tbody td {
    padding: 8px 10px 8px 4px;
    border-bottom: 1px solid var(--ih-rule);
    vertical-align: top;
}

.ih-routes tbody tr:last-child td { border-bottom: 0; }
.ih-routes a { color: var(--ih-ink); text-decoration: none; }
.ih-routes a:hover { color: var(--ih-hub-ink); text-decoration: underline; }
.ih-rt-place { color: var(--ih-muted); margin-left: 6px; }

.ih-rt-days {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    font-style: italic;
    color: var(--ih-muted);
}

/* ── Bottom sheet (phone tap target) ────────────────────────────────────── */

.ih-sheet {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 60;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    background: var(--ih-paper);
    border-top: 2px solid var(--ih-ink);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .14);
}

.ih-sheet-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ih-rule);
}

.ih-sheet-bar h2 { margin: 0; font-size: 15px; font-weight: 700; }

.ih-sheet-close {
    border: 1px solid var(--ih-rule);
    background: transparent;
    color: var(--ih-ink);
    border-radius: 999px;
    width: 36px;
    height: 36px;
    font-size: 14px;
    cursor: pointer;
    flex: 0 0 auto;
}

.ih-sheet-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 4px 14px 18px;
    -webkit-overflow-scrolling: touch;
}

.ih-sheet-body .ih-routes { white-space: normal; }

/* -- Preview banner ------------------------------------------------------- */

/* Loud on purpose. A preview that looks like the live page is how an unpublished figure ends up
   in a screenshot, a deck, or somebody's memory of what the site says. */
.ih-preview {
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 2px solid var(--ih-hub);
    border-radius: 3px;
    background: #FFF4E6;
    color: #7C3A00;
    font-size: 13px;
    line-height: 1.5;
}

.ih-preview code {
    font: 600 12px var(--ih-mono);
    background: rgba(0, 0, 0, .05);
    padding: 1px 4px;
    border-radius: 2px;
}

/* -- Day filter ----------------------------------------------------------- */

.ih-days {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.ih-days-label {
    font: 500 11px/1 var(--ih-mono);
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ih-muted);
}

.ih-days-set { display: flex; flex-wrap: wrap; }

.ih-days-set button {
    font: 600 11.5px/1 var(--ih-font);
    padding: 8px 10px;
    min-height: 36px;
    min-width: 40px;
    border: 1px solid var(--ih-rule);
    border-right-width: 0;
    background: transparent;
    color: var(--ih-ink);
    cursor: pointer;
}

.ih-days-set button:first-child { border-radius: 999px 0 0 999px; padding-inline: 13px; }
.ih-days-set button:last-child { border-radius: 0 999px 999px 0; border-right-width: 1px; }

.ih-days-set button[aria-pressed="true"] {
    background: var(--ih-ink);
    border-color: var(--ih-ink);
    color: var(--ih-paper);
}

.ih-days-note {
    margin: 10px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--ih-muted);
    text-wrap: pretty;
}

/* -- Round trip ----------------------------------------------------------- */

.ih-roundtrip {
    margin-top: 32px;
    border-top: 1px solid var(--ih-ink);
    padding-top: 18px;
}

.ih-roundtrip > h2 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.ih-rt-intro {
    margin: 0 0 16px;
    max-width: 62ch;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ih-muted);
    text-wrap: pretty;
}

.ih-rt-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
    margin: 0 0 18px;
}

.ih-field { margin: 0; display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.ih-field label {
    font: 500 10.5px/1 var(--ih-mono);
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ih-muted);
}

.ih-field select {
    font: 500 13px var(--ih-font);
    padding: 9px 10px;
    min-height: 42px;
    max-width: 100%;
    border: 1px solid var(--ih-rule);
    border-radius: 3px;
    background: #fff;
    color: var(--ih-ink);
}

.ih-field-go button {
    font: 600 13px var(--ih-font);
    padding: 11px 18px;
    min-height: 42px;
    border: 1px solid var(--ih-ink);
    border-radius: 999px;
    background: var(--ih-ink);
    color: var(--ih-paper);
    cursor: pointer;
}

.ih-field-go button:hover { background: var(--ih-hub); border-color: var(--ih-hub); }

.ih-rt-summary {
    margin: 0 0 16px;
    padding: 10px 12px;
    background: var(--ih-row-hover);
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.5;
    text-wrap: pretty;
}

.ih-rt-empty { font-size: 13.5px; line-height: 1.55; max-width: 62ch; }
.ih-rt-suggestions { margin: 8px 0 0; padding-left: 20px; }
.ih-rt-suggestions li { margin-bottom: 4px; }

.ih-rt-islands {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr);
}

.ih-rt-island {
    border: 1px solid var(--ih-rule);
    border-radius: 4px;
    padding: 12px 14px;
}

.ih-rt-island h3 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin: 0 0 6px;
    font-size: 14px;
}

.ih-rt-code { font: 700 16px var(--ih-mono); }
.ih-rt-place { font-weight: 600; }
.ih-rt-nights { margin-left: auto; font: 500 12px var(--ih-mono); color: var(--ih-muted); }

.ih-rt-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin: 0 0 10px;
}

/* Sits inside the leg heading now, so it must not inherit the heading's uppercase mono. */
.ih-rt-zone {
    font: italic 400 11px/1.3 var(--ih-font);
    letter-spacing: 0;
    text-transform: none;
    color: var(--ih-muted);
    margin-left: 6px;
}

.ih-rt-legs { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }

.ih-rt-legs h4 {
    margin: 0 0 6px;
    font: 600 10.5px/1 var(--ih-mono);
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ih-muted);
}

.ih-rt-legs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

.ih-rt-legs li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    font-size: 13px;
}

.ih-rt-time { font: 600 13px var(--ih-mono); font-variant-numeric: tabular-nums; }
.ih-rt-op { color: var(--ih-muted); }

/* An option with no published time is not a time. It reads as prose, not as a clock. */
.ih-rt-untimed .ih-rt-time {
    font: italic 400 12px var(--ih-font);
    color: var(--ih-muted);
}

/* -- Unidentified carriers ------------------------------------------------ */

.ih-rt-other {
    font-style: italic;
    color: var(--ih-muted);
    border-bottom: 1px dotted currentColor;
    cursor: help;
}

/* ── The strip that links the three maps to each other ──────────────────── */

.ih-siblings {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px 14px;
    margin: 18px 0 0;
}

.ih-siblings-label {
    align-self: center;
    font: 600 10px var(--ih-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ih-muted);
}

.ih-siblings ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ih-siblings a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 14px;
    border: 1px solid var(--ih-rule);
    border-radius: 6px;
    background: #fff;
    color: var(--ih-ink);
    text-decoration: none;
}

.ih-siblings a:hover,
.ih-siblings a:focus-visible { border-color: var(--ih-hub); background: var(--ih-row-hover); }
.ih-siblings strong { font-size: 14px; }
.ih-siblings span { font-size: 12px; color: var(--ih-muted); }

/* ── Unavailable state ──────────────────────────────────────────────────── */

.ih-unavailable .ih-wrap { padding-block: 48px 64px; }
.ih-unavailable p { max-width: 56ch; font-size: 15px; line-height: 1.6; color: var(--ih-muted); }

/* ── Tablet ─────────────────────────────────────────────────────────────── */

@media (min-width: 640px) {
    .ih-wrap { padding: 26px 24px 44px; }
    .ih-rt-legs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ih h1 { font-size: 30px; }
    .ih-stats { gap: 16px 30px; }
    .ih-routes { display: table; white-space: normal; }
    .ih-sheet { inset: auto auto 18px 18px; width: 380px; border: 2px solid var(--ih-ink); border-radius: 6px; }
}

/* ── Desktop: the prototype's own grid ──────────────────────────────────── */

@media (min-width: 1000px) {
    .ih-wrap { padding: 28px 32px 48px; }
    .ih-rt-islands { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .ih-head {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        justify-content: space-between;
        gap: 16px 40px;
    }

    .ih h1 { font-size: 34px; }
    .ih-stats { display: flex; margin: 0; gap: 32px; }
    .ih-stat dd { font-size: 30px; }
    .ih-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; margin-top: 20px; }

    /* The inset is drawn at x 835-1180, y 22 of the 1200x820 viewBox — the top-right corner.
       The controls live top-LEFT from here, or they sit on top of it. */
    .ih-mapctl { inset: 10px auto auto 10px; justify-content: flex-start; }
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .ih-tip { transition: none; }
    .ih * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* "Use this map": licence, dataset link and embed snippet (_MapDataPanel). */
.ih-usedata a { text-decoration: underline; }
.ih-embed { margin-top: 8px; }
.ih-embed summary { cursor: pointer; font-weight: 600; }
.ih-embed-code {
  width: 100%;
  margin: 6px 0;
  padding: 8px;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  resize: vertical;
}
.ih-embed-status:empty { display: none; }
