/* ================================================================
   Netzplan Mallorca — Gestaltung
   Nach dem Vorbild der Ulmer Schule: eine Schrift, eine Skala,
   ein Raster von 8 px, feine Linien statt Schatten, Farbe nur dort,
   wo sie etwas bedeutet.
   Schriftskala: 11 / 13 / 15 / 20 / 28 px · Gewichte 400 / 700
   ================================================================ */

/* Schrift Archivo (SIL Open Font License, assets/fonts/OFL.txt), selbst gehostet:
   keine Anfrage an fremde Server */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-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;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-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;
}

:root {
  --sea: #EDF0F1;
  --land: #FFFFFF;
  --ink: #111315;
  --ink-2: #4E555A;
  --ink-3: #5E666B;
  --rule: #D9DEE0;
  --rule-strong: #B7BEC2;
  --panel: #FFFFFF;
  --panel-2: #F4F6F6;
  --panel-3: #E8ECED;
  --accent: #D8291C;
  --focus: #111315;
  --pill: #FFFFFF;
  --pill-edge: #111315;
  --sel-edge: #111315;
  --water-ink: #8A979E;
  --relief-ink: #A3ACB0;
  --panel-w: 384px;
  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --t11: 11px; --t13: 13px; --t15: 15px; --t20: 20px; --t28: 28px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sea: #0B0F11;
    --land: #161B1E;
    --ink: #EDF0F1;
    --ink-2: #AEB6BB;
    --ink-3: #9AA3A8;
    --rule: #262E32;
    --rule-strong: #3B454A;
    --panel: #101417;
    --panel-2: #171D20;
    --panel-3: #1F272B;
    --accent: #FF5A45;
    --focus: #EDF0F1;
    --pill: #161B1E;
    --pill-edge: #EDF0F1;
    --sel-edge: #000000;
    --water-ink: #56636A;
    --relief-ink: #4A565C;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sea: #0B0F11;
  --land: #161B1E;
  --ink: #EDF0F1;
  --ink-2: #AEB6BB;
  --ink-3: #9AA3A8;
  --rule: #262E32;
  --rule-strong: #3B454A;
  --panel: #101417;
  --panel-2: #171D20;
  --panel-3: #1F272B;
  --accent: #FF5A45;
  --focus: #EDF0F1;
  --pill: #161B1E;
  --pill-edge: #EDF0F1;
  --sel-edge: #000000;
  --water-ink: #56636A;
  --relief-ink: #4A565C;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--sea);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t15);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { 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 {
  position: absolute; left: 16px; top: -64px; z-index: 50;
  background: var(--ink); color: var(--panel); padding: 12px 16px; border-radius: 2px;
  text-decoration: none; font-weight: 700; font-size: var(--t15);
}
.skip:focus { top: 16px; }
svg.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ── Bühne ─────────────────────────────────────────────────── */
.app { position: fixed; inset: 0; }
.stage { position: absolute; inset: 0; outline: none; }
.stage:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
svg.netz { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
svg.netz.is-dragging { cursor: grabbing; }

/* ── Karte ─────────────────────────────────────────────────── */
.land { fill: var(--land); }
.geo { font-family: var(--font); pointer-events: none; user-select: none; }
.geo-relief { fill: var(--relief-ink); font-weight: 600; letter-spacing: .12em; }
.geo-water { fill: var(--water-ink); font-weight: 500; letter-spacing: .04em; }
.g-casing .casing { fill: none; stroke: var(--land); stroke-linecap: round; stroke-linejoin: round; }
.ln path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ln .stroke { stroke: var(--c); }
.ln .outline { stroke: transparent; }
.ln.has-outline .outline { stroke: var(--edge); }
.ln .rail { stroke: var(--c); stroke-linecap: round; }
.ln .conn { stroke: var(--c); stroke-linecap: round; }
.ln.is-demand .stroke { stroke-linecap: butt; }
.ln .hit { stroke: transparent; pointer-events: stroke; cursor: pointer; }

.hub-disc { fill: var(--pill); stroke: var(--pill-edge); }
.hub-core { fill: var(--pill-edge); }
.st { cursor: pointer; }
.pill { fill: var(--pill); stroke: var(--pill-edge); }
.pill-edge { stroke: var(--pill-edge); stroke-linecap: round; }
.pill-fill { stroke: var(--pill); stroke-linecap: round; }
.pill-rail { fill: var(--pill-edge); stroke: var(--pill-edge); }
.pill-rail-edge { stroke: var(--pill-edge); stroke-linecap: round; }
.pill-rail-fill { stroke: var(--pill-edge); stroke-linecap: round; }
.pill-core { fill: var(--pill); }
.pill-core-line { stroke: var(--pill); stroke-linecap: round; }
.tick { stroke: var(--c); stroke-linecap: butt; }
.tick-ring { fill: var(--land); stroke: var(--c); }
.st-hit { fill: transparent; }
.bridge-casing { fill: none; stroke: var(--land); stroke-linecap: round; stroke-linejoin: round; }
.bridge-stroke { fill: none; stroke: var(--c); stroke-linecap: round; stroke-linejoin: round; }

.lbl { font-family: var(--font); fill: var(--ink); font-stretch: 84%; font-weight: 600; paint-order: stroke; stroke: var(--land); stroke-width: .34em; stroke-linejoin: round; cursor: pointer; }
.lbl.small { font-weight: 500; fill: var(--ink-3); }
.lbl.trip { font-weight: 650; fill: var(--ink); }
.lbl.r1 { font-weight: 700; }
.lbl.r3 { font-weight: 500; }
.lbl.hub-name { font-weight: 800; font-stretch: 100%; letter-spacing: -.01em; }
.hub-sub { font-weight: 600; font-stretch: 100%; fill: var(--ink-2); stroke-width: .3em; }

.badge { cursor: pointer; }
.badge-bg { fill: var(--c); }
.badge-tx { fill: var(--tc); font-family: var(--font); font-weight: 700; font-stretch: 80%; font-variant-numeric: tabular-nums; pointer-events: none; }

/* Hervorhebung */
.lvl .ln, .lvl .lc, .lvl .slot, .lvl .badge, .lvl .st, .lvl .lbl, .lvl .bridge { transition: opacity .25s ease; }
.ln.is-sel .outline { stroke: var(--sel-edge); }
svg.netz.has-focus .slot.is-dim { opacity: .12; }
svg.netz.has-focus .slot.is-dim .ln { opacity: 1; }
svg.netz.has-hover:not(.has-focus) .slot.is-hdim { opacity: .25; }
svg.netz.has-hover:not(.has-focus) .slot.is-hdim .ln { opacity: 1; }
svg.netz.has-route .st.is-trip { opacity: 0; }
.lbl.is-edge, .badge.is-edge, .geo.is-edge, .lbl.is-crowd { opacity: 0 !important; pointer-events: none; }
.geo { transition: opacity .2s ease; }
.leader { stroke: var(--ink-3); }
svg.netz.has-focus .ln:not(.is-focus),
svg.netz.has-focus .bridge:not(.is-focus) { opacity: .12; }
svg.netz.has-focus .badge:not(.is-focus) { opacity: 0; pointer-events: none; }
svg.netz.has-focus .st:not(.is-focus):not(.hub) { opacity: .35; }
svg.netz.has-focus .lbl:not(.is-focus):not(.hub-name):not(.hub-sub) { opacity: .55; }
svg.netz.has-focus .lbl.is-focus { fill: var(--ink); }
svg.netz.has-hover:not(.has-focus) .ln:not(.is-hover) { opacity: .25; }
svg.netz.has-hover:not(.has-focus) .badge:not(.is-hover) { opacity: .25; }
svg.netz.has-focus .ln.is-focus .outline { stroke: var(--edge); }

/* Effekte */
.fx-vehicle { fill: var(--land); stroke: var(--c); }
.fx-vehicle-core { fill: var(--c); }
.fx-route-casing { fill: none; stroke: var(--land); stroke-linecap: round; stroke-linejoin: round; }
.fx-route { fill: none; stroke: var(--c); stroke-linecap: round; stroke-linejoin: round; }
.fx-pin { fill: var(--ink); stroke: var(--land); }
.fx-stop { fill: var(--land); stroke: var(--ink); }
.fx-pin-ring { fill: var(--land); stroke: var(--ink); }
.fx-pin-tx { fill: var(--ink); font-family: var(--font); font-weight: 700; }

/* Tooltip */
.tip {
  position: absolute; z-index: 30; pointer-events: none;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--rule-strong);
  border-radius: 2px; padding: 6px 10px 6px 6px; font-size: var(--t13); line-height: 1.2; white-space: nowrap;
  transform: translate(14px, 14px); opacity: 0; transition: opacity .12s ease;
}
.tip.is-on { opacity: 1; }

/* ── Seitenleiste ──────────────────────────────────────────── */
.panel {
  position: absolute; z-index: 15; top: 0; left: 0; bottom: 0;
  width: var(--panel-w);
  display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--rule);
  padding-top: env(safe-area-inset-top, 0px);
}
.panel-grip { display: none; }
.brand {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px;
  padding: 16px 16px 16px 24px; border-bottom: 1px solid var(--rule);
}
.brand h1 { margin: 0; font-size: 18px; line-height: 1.2; font-weight: 400; letter-spacing: -.005em; display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.brand h1 span { font-weight: 700; color: var(--ink); margin-right: -5px; }
.brand h1 .mark { width: 20px; height: 20px; flex: none; margin-right: -2px; }
.brand h1 .mark path { stroke: var(--accent); fill: none; }
.brand h1 .mark circle { fill: var(--panel); stroke: var(--ink); stroke-width: 2.5; }
.brand p { margin: 2px 0 0 28px; font-size: 12px; color: var(--ink-3); }
.brand p a { color: var(--ink-2); text-underline-offset: 2px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 2px;
  border: 1px solid var(--rule); background: var(--panel); color: var(--ink);
}
.icon-btn:hover { background: var(--panel-2); }

.search { position: relative; padding: 16px 16px 12px 24px; }
.search .ico { position: absolute; left: 36px; top: 28px; color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%; height: 44px; border-radius: 2px; border: 1px solid var(--rule-strong);
  background: var(--panel); padding: 0 12px 0 40px; font-size: var(--t15);
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.suggest {
  position: absolute; left: 24px; right: 16px; top: 60px; z-index: 5;
  list-style: none; margin: 0; padding: 4px 0; max-height: 336px; overflow: auto;
  background: var(--panel); border: 1px solid var(--ink); border-radius: 2px;
}
.suggest li { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 4px 12px; cursor: pointer; font-size: var(--t15); }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--panel-3); }
.suggest .kind { margin-left: auto; font-size: var(--t11); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 16px 0 24px; border-bottom: 1px solid var(--rule); }
.tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  height: 48px; font-weight: 700; font-size: var(--t15); color: var(--ink-3); margin-bottom: -1px; text-align: left; padding: 0;
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab:hover { color: var(--ink); }
.panel.is-detail .search, .panel.is-detail .tabs { display: none; }

.views { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; padding: 16px 16px 32px 24px; }
.view[hidden] { display: none !important; }
.view.is-entering { animation: viewIn .22s cubic-bezier(.2,.7,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }

/* Filter */
.filters { display: grid; gap: 12px; margin-bottom: 24px; }
.filter-row { display: grid; gap: 6px; }
.filter-label { margin: 0; font-size: var(--t11); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--rule-strong); border-radius: 2px; }
.seg button { border: 0; background: none; height: 40px; font-size: var(--t13); font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button + button { border-left: 1px solid var(--rule-strong); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.seg .ico { width: 16px; height: 16px; }
.toggles { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--rule-strong); border-radius: 2px; }
.toggle { border: 0; background: none; height: 40px; font-size: var(--t13); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink); }
.toggle + .toggle { border-left: 1px solid var(--rule-strong); }
.toggle::before { content: ""; width: 12px; height: 12px; box-sizing: border-box; border: 1.5px solid var(--ink); background: var(--ink); flex: none; }
.toggle[aria-pressed="false"] { color: var(--ink-2); }
.toggle[aria-pressed="false"]::before { background: var(--panel); }

/* Liniengruppen */
.group { margin: 0 0 24px; }
.group h2 {
  margin: 0; padding: 0 0 8px; border-bottom: 1px solid var(--ink);
  font-size: var(--t11); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
  display: flex; justify-content: space-between;
}
.group h2 span + span { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.group h2 .fam { display: inline-block; width: 10px; height: 10px; margin: 0 10px 0 0; background: var(--c, var(--ink)); vertical-align: -1px; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { border-bottom: 1px solid var(--rule); }
.line-row {
  width: 100%; min-height: 56px; display: grid; grid-template-columns: 56px 1fr 20px; align-items: center; gap: 12px;
  padding: 8px 0; border: 0; background: none; text-align: left;
}
.line-row:hover, .line-row.is-hover { background: var(--panel-2); }
.line-row[aria-current="true"] { background: var(--panel-3); }
.line-row .name { font-size: var(--t15); line-height: 1.25; font-weight: 400; }
.line-row .meta { font-size: 12px; color: var(--ink-3); }
.line-row.is-off { opacity: .4; }

/* Liniennummer */
.lb {
  --c: #333; --tc: #fff;
  display: inline-flex; align-items: center; justify-content: center; min-width: 48px; height: 26px; padding: 0 6px;
  background: var(--c); color: var(--tc); border-radius: 2px;
  font-weight: 700; font-size: var(--t15); font-stretch: 86%; font-variant-numeric: tabular-nums;
  line-height: 1; white-space: nowrap;
}
.lb.is-rail { --c: var(--ink); --tc: var(--panel); }
.lb.sm { min-width: 32px; height: 20px; font-size: var(--t13); padding: 0 4px; }
.lb.lg { min-width: 64px; height: 40px; font-size: var(--t20); }
.season { display: inline-grid; place-items: center; width: 20px; height: 20px; color: var(--ink-2); }
.season .ico { width: 16px; height: 16px; }
.more { font-size: var(--t13); color: var(--ink-3); align-self: center; }

/* Halte A–Z */
.az { list-style: none; margin: 0; padding: 0; }
.az li { border-bottom: 1px solid var(--rule); }
.stop-row { width: 100%; min-height: 56px; display: grid; gap: 4px; padding: 8px 0; background: none; border: 0; text-align: left; }
.stop-row:hover { background: var(--panel-2); }
.stop-row .nm { font-weight: 700; font-size: var(--t15); }
.stop-row .bdg { display: flex; flex-wrap: wrap; gap: 4px; }
.letter { position: sticky; top: -16px; background: var(--panel); z-index: 1; margin: 16px 0 0; padding: 8px 0; font-size: var(--t20); font-weight: 700; border-bottom: 1px solid var(--ink); }
.letter:first-child { margin-top: 0; }

/* Detailansicht */
.detail-bar {
  position: sticky; top: -16px; z-index: 2; margin: -16px -16px 16px -24px; padding: 8px 16px 8px 12px;
  display: grid; grid-template-columns: 40px auto 1fr; align-items: center; gap: 12px; min-height: 64px;
  background: var(--panel); border-bottom: 1px solid var(--rule);
}
.back { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; border-radius: 2px; color: var(--ink); }
.back:hover { background: var(--panel-2); }
.detail-bar h2 { margin: 0; font-size: var(--t20); line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
.detail-bar .sub { display: block; font-size: var(--t13); font-weight: 400; color: var(--ink-3); margin-top: 2px; }
.st-sym { width: 40px; height: 40px; display: grid; place-items: center; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 16px; font-size: var(--t13); color: var(--ink-2); }
.facts b { color: var(--ink); font-weight: 700; }
.facts span { display: inline-flex; align-items: center; gap: 6px; }
.note { margin: 0 0 16px; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: var(--t13); color: var(--ink-2); display: grid; gap: 4px; }
.note p { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 2px; height: 40px; padding: 0 14px; font-size: var(--t13); font-weight: 700;
  border: 1px solid var(--ink); background: var(--panel); color: var(--ink);
}
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--ink); color: var(--panel); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--panel)); }
.btn .ico { width: 16px; height: 16px; }

/* Linienband */
.eyebrow { margin: 0 0 8px; font-size: var(--t11); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.strip { list-style: none; margin: 0; padding: 0; }
.strip-branch + .strip-branch { margin-top: 24px; }
.strip li { position: relative; display: grid; grid-template-columns: 32px 1fr; align-items: start; min-height: 48px; }
.strip li::before { content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 6px; background: var(--c); }
.strip li:first-child::before { top: 18px; }
.strip li:last-child::before { bottom: calc(100% - 18px); }
.strip.is-demand li::before { background: repeating-linear-gradient(to bottom, var(--c) 0 8px, transparent 8px 13px); }
.strip .dot { position: relative; z-index: 1; margin: 10px 0 0 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--pill); border: 2px solid var(--pill-edge); }
.strip li.is-end .dot { background: var(--pill-edge); }
.strip button { display: grid; gap: 4px; justify-items: start; text-align: left; background: none; border: 0; padding: 8px 8px 8px 4px; min-height: 48px; width: 100%; }
.strip button:hover { background: var(--panel-2); }
.strip .st-name { font-weight: 700; font-size: var(--t15); line-height: 1.2; }
.strip .st-req { font-size: 12px; color: var(--ink-2); }
.strip .xfer { display: flex; flex-wrap: wrap; gap: 4px; }

/* Verbindung */
.route-form { display: grid; gap: 8px; margin-bottom: 16px; }
.route-field { position: relative; display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 8px; }
.route-field .pin { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--ink); margin-left: 4px; background: var(--panel); }
.route-field .pin.to { background: var(--ink); }
.route-field input { width: 100%; height: 44px; border-radius: 2px; border: 1px solid var(--rule-strong); background: var(--panel); padding: 0 12px; font-size: var(--t15); }
.route-field input:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.route-field .suggest { top: 48px; left: 32px; right: 0; }
.route-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.route-empty { color: var(--ink-2); font-size: var(--t15); margin: 24px 0; }
.summary { display: flex; gap: 16px; font-size: var(--t13); color: var(--ink-2); margin: 0 0 16px; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.summary b { color: var(--ink); }
.legs { list-style: none; margin: 0; padding: 0; }
.leg { position: relative; display: grid; grid-template-columns: 32px 1fr; padding-bottom: 16px; }
.leg::before { content: ""; position: absolute; left: 13px; top: 18px; bottom: -2px; width: 6px; background: var(--c); }
.leg .dot { position: relative; z-index: 1; margin: 2px 0 0 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--pill); border: 2px solid var(--pill-edge); }
.leg .num { position: relative; z-index: 1; margin: 0 0 0 5px; width: 22px; height: 22px; border-radius: 50%; background: var(--pill); border: 2px solid var(--pill-edge); display: grid; place-items: center; font-size: var(--t11); font-weight: 700; }
.leg-body { display: grid; gap: 4px; padding-left: 4px; }
.leg-body .from { font-weight: 700; }
.leg-body .ride { display: flex; align-items: center; gap: 8px; font-size: var(--t13); color: var(--ink-2); }
.leg-end { display: grid; grid-template-columns: 32px 1fr; align-items: center; }
.leg-end .dot { margin-left: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--pill-edge); }
.leg-end b { padding-left: 4px; }
.xfer-note { font-size: var(--t11); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }

/* Legende */
.legend { margin-top: 8px; }
.legend h2 { margin: 0; padding: 0 0 8px; border-bottom: 1px solid var(--ink); font-size: var(--t11); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.legend dl { display: grid; grid-template-columns: 56px 1fr; gap: 0 12px; margin: 0; align-items: center; font-size: var(--t13); }
.legend dt, .legend dd { min-height: 40px; display: flex; align-items: center; border-bottom: 1px solid var(--rule); margin: 0; }
.legend dt svg { width: 56px; height: 20px; display: block; }
.legend dd { color: var(--ink-2); }
.poster-link { margin: 16px 0 0; }
.poster-link .btn { text-decoration: none; }
.source { margin: 16px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.source a { color: var(--ink-2); }
.source.legal { margin-top: 8px; }

/* ── Werkzeuge ─────────────────────────────────────────────── */
.tools { position: absolute; z-index: 15; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; }
.tool-group { display: grid; background: var(--panel); border: 1px solid var(--rule-strong); border-radius: 2px; }
.tool-group button { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--ink); }
.tool-group button + button { border-top: 1px solid var(--rule); }
.tool-group button:hover { background: var(--panel-2); }
.hint {
  position: absolute; z-index: 14; top: 16px; right: 16px; margin: 0;
  display: flex; align-items: center; gap: 12px;
  font-size: var(--t13); color: var(--ink); background: var(--panel);
  border: 1px solid var(--rule-strong); padding: 8px 8px 8px 14px; border-radius: 2px; max-width: 360px;
  transition: opacity .3s ease;
}
.hint[hidden] { display: none; }
.hint button { border: 0; background: none; width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.intro-veil { position: absolute; inset: 0; z-index: 40; background: var(--sea); transition: opacity .45s ease; }
.intro-veil.is-gone { opacity: 0; pointer-events: none; }

/* ── Schmal: Blatt von unten ───────────────────────────────── */
@media (max-width: 820px) {
  .panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 50%;
    border-right: 0; border-top: 1px solid var(--rule-strong); border-radius: 12px 12px 0 0;
    transition: height .3s cubic-bezier(.2,.7,.2,1);
    padding-top: 0; padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .panel.is-min { height: 20%; min-height: 176px; }
  .panel.is-full { height: 92%; }
  .panel-grip { display: grid; place-items: center; height: 24px; border: 0; background: none; width: 100%; padding: 0; flex: none; }
  .panel-grip::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: var(--rule-strong); }
  .brand { padding: 4px 12px 8px 16px; border-bottom: 0; }
  .brand p { margin-top: 0; }
  .search { padding: 0 12px 8px 16px; }
  .search .ico { left: 28px; top: 12px; }
  .suggest { left: 16px; right: 12px; top: 48px; }
  .tabs { padding: 0 12px 0 16px; }
  .view { padding: 16px 12px 32px 16px; }
  .detail-bar { margin: -16px -12px 16px -16px; }
  .panel.is-detail .brand { display: none; }
  .tools { right: 12px; bottom: calc(50% - 20px); transition: bottom .3s cubic-bezier(.2,.7,.2,1); z-index: 16; }
  .tools #zoom-in, .tools #zoom-out { display: none; }
  .tool-group button { width: 40px; height: 40px; }
  .panel.is-min ~ .tools { bottom: max(calc(20% - 20px), 156px); }
  .panel.is-full ~ .tools { opacity: 0; pointer-events: none; }
  .hint { left: 12px; right: 12px; top: 12px; max-width: none; }
}
@media (pointer: coarse) {
  .tools #zoom-in, .tools #zoom-out { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media (prefers-contrast: more) {
  :root { --rule: #8E979B; --ink-2: #2E3336; --ink-3: #3E4549; }
}

/* ── Plakat A1 ─────────────────────────────────────────────── */
body.is-poster .app { display: none; }
.poster { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-rows: auto 1fr; background: var(--panel-3); overflow: auto; }
.poster[hidden] { display: none; }
.poster-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--rule); font-size: var(--t13); color: var(--ink-2); }
.poster-bar p { margin: 0; }
.poster-bar .btn { text-decoration: none; }
.poster-bar .poster-legal { margin-left: auto; }
.poster-bar .poster-legal a { color: inherit; }
.poster-stage { display: grid; place-items: center; padding: 24px 16px; min-height: 0; }
.poster-svg {
  width: 100%; max-width: calc((100vh - 120px) * 841 / 594); height: auto; display: block; border: 1px solid #C9D0D3; background: #FFFFFF;
  --sea: #EDF0F1; --land: #FFFFFF; --ink: #111315; --ink-2: #4E555A; --ink-3: #5E666B; --rule: #D9DEE0; --panel: #FFFFFF;
  --pill: #FFFFFF; --pill-edge: #111315; --sel-edge: #111315; --water-ink: #8A979E; --relief-ink: #A3ACB0;
}
.p-paper { fill: #FFFFFF; }
.p-sea { fill: #EDF0F1; }
.p-grid line { stroke: #CBD2D5; stroke-width: 1; }
.p-frame { fill: none; stroke: #9AA3A8; stroke-width: 1.5; }
.p-gridlbl text { font-family: var(--font); font-size: 13px; font-weight: 700; fill: #7F8990; }
.p-title { font-family: var(--font); font-size: 46px; font-weight: 700; fill: #111315; letter-spacing: -.01em; }
.p-title-light { font-weight: 400; fill: #4E555A; }
.p-sub { font-family: var(--font); font-size: 13px; fill: #4E555A; }
.p-head { font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: .08em; fill: #111315; }
.p-rule { stroke: #111315; stroke-width: 1.5; }
.p-item { font-family: var(--font); font-size: 12px; fill: #111315; }
.p-idx { font-family: var(--font); font-size: 9.5px; font-stretch: 85%; fill: #111315; }
.p-idx-ref { fill: #5E666B; font-weight: 700; font-variant-numeric: tabular-nums; }
.p-src text { font-family: var(--font); font-size: 9px; fill: #5E666B; }
.p-mark-line { stroke: #D8291C; stroke-width: 3; stroke-linecap: square; fill: none; }
.p-mark-ring { fill: #FFFFFF; stroke: #111315; stroke-width: 2.5; }
.netz-poster { overflow: hidden; }
@media print {
  @page { size: landscape; margin: 0; }
  body.is-poster { background: #FFFFFF; overflow: visible; height: auto; }
  .poster { position: static; display: block; background: #FFFFFF; overflow: visible; }
  .poster-bar { display: none; }
  .poster-stage { padding: 0; display: block; }
  .poster-svg { max-width: none; width: 100%; border: 0; }
}

/* Standbild-Modus (nur für Bildschirmfotos) */
body.is-bare .panel, body.is-bare .tools, body.is-bare .hint { display: none !important; }
