:root {
  color-scheme: light;
  --red: #d50b2f;
  --red-dark: #a60825;
  --ink: #000000;
  --muted: #465d66;
  --paper: #f3f5f3;
  --card: #ffffff;
  --line: #d7dedb;
  --sea: #c1d8df;
  --green: #10764f;
  --topbar: #f3f5f3;
  --control: #ffffff;
  --subtle: #e7ece9;
  --body-copy: #171717;
  --shadow: #20384210;
  --hover-line: #8fa8b1;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f3ef;
  --muted: #b9bec8;
  --paper: #11151c;
  --card: #1b212b;
  --line: #3c4655;
  --sea: #263a44;
  --green: #5bc99b;
  --topbar: #171d27;
  --control: #222a36;
  --subtle: #2b3441;
  --body-copy: #d7dbe2;
  --shadow: #00000045;
  --hover-line: #8993a3;
}

@font-face {
  font-family: "Vintersno Cormorant";
  src: url("/fonts/CormorantGaramond-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
}

button, select, audio { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: calc(13px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 13px max(18px, env(safe-area-inset-left));
  color: var(--ink);
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 18px #0002;
}

.topbar h1 { margin: 1px 0 0; font-size: 1.24rem; }
.topbar .quiet-button { margin-left: auto; color: var(--ink); border-color: var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-actions .quiet-button { margin-left: 0; text-decoration: none; }
.language-control { display: block; }
.language-control select {
  min-width: 68px;
  min-height: 40px;
  padding-right: 28px;
  color: var(--ink);
  background-color: var(--control);
}
.theme-toggle {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 38px;
  margin-left: 0 !important;
  padding: 0;
  place-items: center;
  font-size: 1.2rem;
  line-height: 1;
}
.site-brand {
  display: inline-flex;
  width: 60px;
  min-height: 60px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  border-radius: 10px;
  text-decoration: none;
}
.home-topbar .site-brand {
  width: clamp(176px, 19vw, 220px);
  min-height: 0;
  margin-left: 0;
  border-radius: 0;
}
.site-brand:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
}
.brand-wordmark {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}
:root:not([data-theme="dark"]) .brand-wordmark {
  filter: brightness(0) saturate(100%);
}
.brand-mark {
  display: block;
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  border-radius: 24%;
  object-fit: cover;
}

main { width: min(1120px, 100%); margin: 0 auto; padding: 22px 16px 64px; }
.update-banner {
  width: min(1120px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: white;
  background: #242424;
  border-radius: 10px;
  box-shadow: 0 8px 28px #0003;
}
.update-banner p { margin: 4px 0 0; color: #e0e0e0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 28px var(--shadow); }
.setup-panel { padding: clamp(18px, 4vw, 34px); }
.identity-error { margin: 0 0 20px; padding: 13px 15px; color: #721c24; background: #f8d7da; border: 1px solid #e5aeb4; border-radius: 9px; font-weight: 700; line-height: 1.4; }
.step-label, .eyebrow { margin: 0 0 10px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 26px; }
.choice-grid.compact { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.choice {
  min-height: 92px;
  padding: 16px;
  text-align: left;
  color: var(--ink);
  background: var(--control);
  border: 2px solid var(--line);
  border-radius: 10px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.choice:hover { transform: translateY(-1px); border-color: var(--hover-line); box-shadow: 0 5px 15px var(--shadow); }
.choice.selected { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.choice strong, .choice span { display: block; }
.choice strong { font-size: 1.05rem; }
.choice span { margin-top: 7px; color: var(--muted); line-height: 1.35; }
.primary-button, .secondary-button, .quiet-button {
  border-radius: 8px;
  font-weight: 750;
}
.primary-button { padding: 14px 20px; color: white; background: var(--red); border: 1px solid var(--red); }
.primary-button:hover { background: var(--red-dark); }
.secondary-button { padding: 10px 14px; color: var(--ink); background: var(--control); border: 1px solid var(--line); }
.quiet-button { padding: 8px 11px; color: var(--ink); background: transparent; border: 1px solid var(--line); }
.start-step { display: flex; flex-wrap: wrap; gap: 10px; }
.start-summary { flex: 1 0 100%; margin: 0 0 8px; color: var(--ink); line-height: 1.6; }
.track-status { margin-left: auto; padding-left: 10px; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.track-button[data-playback-state="playing"] { border-color: var(--red); box-shadow: inset 3px 0 var(--red); }
.track-button[data-playback-state="queued"] { border-style: dashed; }
.track-button[data-playback-state="error"] { border-color: #b34120; }
.track-button[data-playback-state="paused"] { border-color: #b58c35; }
.audio-download-panel { margin: 16px 0; padding: 18px; }
.audio-download-panel p { margin: 10px 0 0; }
.audio-download-panel progress { width: 100%; margin-top: 12px; accent-color: var(--red); }

.player-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr); gap: 16px; }
.now-playing { padding: clamp(20px, 4vw, 34px); }
.now-playing h2 { margin: 4px 0 10px; font-size: clamp(1.45rem, 4vw, 2.4rem); }
.segment-copy { max-height: 8.5em; overflow: auto; color: var(--body-copy); line-height: 1.55; white-space: pre-wrap; }
audio { width: 100%; margin-top: 18px; }
.status-row, .route-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.badge, .progress-pill { display: inline-flex; padding: 6px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: var(--subtle); }
.status-dot { color: var(--muted); font-size: .83rem; }
.status-dot.live { color: var(--green); }
.transport-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.route-panel { padding: 18px; }
.route-panel p { margin: 2px 0; }
.map-stage { position: relative; width: 100%; height: 340px; margin-top: 16px; overflow: hidden; border-radius: 9px; background: var(--sea); }
.map-tiles, #route-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-tiles { overflow: hidden; background: var(--sea); }
.map-tile { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
#route-map { display: block; z-index: 2; }
.map-attribution { position: absolute; right: 4px; bottom: 3px; z-index: 3; margin: 0; padding: 2px 5px; color: #222; background: #ffffffe6; border-radius: 3px; font-size: .64rem; }
.route-line { fill: none; stroke: #174b59; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; opacity: .78; filter: drop-shadow(0 1px 1px #fff); }
.geofence-area { fill: #d50b2f18; stroke: #174b59; stroke-width: 1.5; stroke-dasharray: 5 4; }
.geofence-area.played { fill: #10764f24; stroke: var(--green); }
.geofence-area.active { fill: #d50b2f3d; stroke: var(--red); stroke-width: 3; stroke-dasharray: none; }
.route-node { fill: white; stroke: #174b59; stroke-width: 2.5; }
.route-node.played { fill: var(--green); stroke: white; }
.boat { fill: #ed1738; stroke: white; stroke-width: 3; filter: drop-shadow(0 2px 4px #0005); }
.boat.forecast { stroke-dasharray: 3 2; }
.manual-panel, .share-panel { grid-column: 1 / -1; padding: 18px; }
.track-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 16px; }
.track-button { display: flex; gap: 10px; align-items: flex-start; padding: 12px; color: var(--ink); text-align: left; background: var(--control); border: 1px solid var(--line); border-radius: 8px; }
.track-button.played { border-color: #73a58e; background: #f0f8f4; }
.track-number { display: grid; flex: 0 0 30px; height: 30px; place-items: center; color: white; background: #333; border-radius: 50%; font-size: .74rem; font-weight: 800; }
.share-panel { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.share-url { overflow-wrap: anywhere; }
.share-panel img { width: min(180px, 42vw); border: 8px solid white; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 50; transform: translate(-50%, 140%); padding: 11px 16px; color: white; background: #111; border-radius: 8px; transition: transform .2s; }
.toast:not(.show) { visibility: hidden; }
.toast.show { transform: translate(-50%, 0); }
.site-footer {
  margin-top: clamp(28px, 6vw, 64px);
  padding: 28px clamp(18px, 5vw, 72px);
  color: #d9dde8;
  background: #1e2d55;
  border-bottom: 2px solid #465477;
  text-align: center;
}
.site-footer p { margin: 0; font-size: clamp(.86rem, 1.5vw, 1rem); }
.support-contact {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 45;
  display: block;
  width: 60px;
  height: 60px;
  border: 1px solid #ffffff80;
  border-radius: 19px;
  background: #a60825;
  box-shadow: 0 12px 30px #0005, inset 0 1px 0 #ffffff45;
  transition: transform .16s ease, box-shadow .16s ease;
}
.support-contact svg { display: block; width: 100%; height: 100%; }
.support-contact:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 16px 36px #0006, inset 0 1px 0 #ffffff60; }
.support-contact:focus-visible { outline: 3px solid #6ee7d1; outline-offset: 4px; }
.support-contact:active { transform: translateY(0); }

@media (prefers-reduced-motion: no-preference) {
  body, .topbar, .panel, .choice, .secondary-button, .quiet-button, .track-button {
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
  }
}

@media (max-width: 760px) {
  .player-layout { grid-template-columns: 1fr; }
  .route-panel { grid-row: auto; }
  .choice-grid { grid-template-columns: 1fr; }
  .update-banner { align-items: stretch; flex-direction: column; }
  .support-contact { width: 54px; height: 54px; border-radius: 17px; }
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .topbar-actions { width: 100%; justify-content: flex-end; }
  .home-topbar { align-items: center; flex-wrap: nowrap; gap: 10px; }
  .home-topbar .pilot-operator-title { flex: 1 1 auto; }
  .home-topbar .pilot-operator-title .eyebrow { margin-bottom: 2px; font-size: .66rem; }
  .home-topbar .pilot-operator-title h1 { font-size: 1.12rem; }
  .home-topbar .topbar-actions { width: auto; flex: 0 0 auto; margin-left: auto; }
  .home-topbar .language-control select { min-width: 60px; }
  .home-topbar .home-title { flex: 1 1 auto; }
  .home-topbar .site-brand {
    width: clamp(150px, 42vw, 176px);
    margin-left: 0;
  }
}

/* Keep route context on screen while operating the narration controls. */
.player-layout .route-panel { align-self: start; position: sticky; top: 96px; grid-column: 2; grid-row: 1 / span 3; }
.player-layout .position-controls { padding: 18px; grid-column: 1; }
.player-layout .manual-panel, .player-layout .share-panel { grid-column: 1; }
#route-recovery { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
#route-recovery summary { cursor: pointer; font-weight: 750; }
#route-recovery label { display: grid; gap: 8px; }
#route-recovery select { width: 100%; min-height: 44px; padding: 8px; color: var(--ink); background: var(--control); border: 1px solid var(--line); border-radius: 7px; }
.track-button[data-playback-state="skipped"] { opacity: .75; border-style: dotted; }
@media (max-width: 760px) {
  .player-layout .route-panel { grid-column: 1; grid-row: 1; top: 0; z-index: 10; padding: 10px; box-shadow: 0 4px 12px #0003; }
  .player-layout .route-panel .map-stage { height: clamp(160px, 28vh, 240px); margin-top: 8px; }
  .player-layout .now-playing { grid-row: 2; padding: 16px; }
  .player-layout .position-controls, .player-layout .manual-panel, .player-layout .share-panel { grid-column: 1; }
  .player-layout .segment-copy { max-height: 5em; }
}

.player-layout > .panel { min-width: 0; }
/* During Manual playback the map and all numbered controls share one viewport. */
body:has(#player.player-map-mode:not([hidden])) {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
body:has(#player.player-map-mode:not([hidden])) #audio-download-panel,
body:has(#player.player-map-mode:not([hidden])) > .site-footer,
body:has(#player.player-map-mode:not([hidden])) > .support-contact,
body:has(#player.player-map-mode:not([hidden])) > .update-banner { display: none; }
body:has(#player.player-map-mode:not([hidden])) > .toast:not(.show) { display: none; }
body:has(#player.player-map-mode:not([hidden])) > main {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: max(4px, env(safe-area-inset-top)) max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
}
.player-layout.player-map-mode {
  --manual-node-size: clamp(44px, 4.5vw, 56px);
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 4px;
}
.player-layout.player-map-mode .route-panel {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
  position: relative;
  top: auto;
  min-height: 0;
  padding: 4px;
  border-radius: 10px;
  box-shadow: none;
  overflow: hidden;
  scroll-margin: 0;
}
.player-layout.player-map-mode .route-panel > .route-header { justify-content: flex-start; flex-wrap: nowrap; min-height: 44px; }
.player-layout.player-map-mode #progress-text,
.player-layout.player-map-mode #manual-map-help,
.player-layout.player-map-mode .now-playing,
.player-layout.player-map-mode .position-controls,
.player-layout.player-map-mode .share-panel { display: none; }
.player-layout.player-map-mode .map-header-controls,
.player-layout.player-map-mode .map-zoom-controls { gap: 4px; flex-wrap: nowrap; }
.player-layout.player-map-mode .map-zoom-controls button { height: 44px; padding: 6px 10px; font-size: .9rem; }
.player-layout.player-map-mode #map-zoom-in,
.player-layout.player-map-mode #map-zoom-out { width: 44px; padding: 0; font-size: 1.4rem; }
.player-layout.player-map-mode .map-stage { height: 100%; min-height: 0; margin: 0; border-radius: 6px; }
.player-layout.player-map-mode .manual-panel { grid-column: 1; grid-row: 2; padding: 4px; border-radius: 10px; box-shadow: none; }
.player-layout.player-map-mode .manual-panel .route-header { display: none; }
.player-layout.player-map-mode .track-list { display: grid; grid-template-columns: repeat(auto-fit, var(--manual-node-size)); justify-content: center; gap: 4px; margin: 0; }
.player-layout.player-map-mode .track-button { display: grid; place-items: center; width: var(--manual-node-size); height: var(--manual-node-size); min-height: 44px; padding: 0; border: 2px solid #000; border-radius: 50%; background: var(--node-color, #e87373); color: #000; opacity: 1; }
.player-layout.player-map-mode .track-button.highlights-intro-button { grid-column: span 3; width: auto; padding: 0 12px; border-radius: 8px; background: var(--control); white-space: nowrap; }
.player-layout.player-map-mode .track-number { width: 32px; height: 32px; flex-basis: 32px; font-size: .95rem; background: transparent; color: #000; }
.player-layout.player-map-mode .track-button > :not(.track-number) { display: none; }
.player-layout.player-map-mode .track-button[data-playback-state="playing"],
.player-layout.player-map-mode .track-button[data-playback-state="queued"],
.player-layout.player-map-mode .track-button[data-playback-state="loading"] { box-shadow: 0 0 0 1px var(--card), 0 0 0 2px #000; }
.player-layout.player-map-mode .track-button:focus-visible { outline: 2px solid #000; outline-offset: 1px; }
.manual-map-help { margin-top: 10px !important; color: var(--body-copy); line-height: 1.5; }
.map-header-controls, .map-zoom-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.map-header-controls { justify-content: flex-end; }
.map-zoom-controls button { min-width: 44px; min-height: 44px; }
#map-zoom-in, #map-zoom-out { font-size: 1.4rem; line-height: 1; }
.player-map-mode #route-map { touch-action: none; cursor: grab; }
.player-map-mode .map-stage { touch-action: none; }
.player-map-mode #route-map:active { cursor: grabbing; }
.manual-map-area-group { cursor: pointer; outline: none; }
.narration-halo {
  fill: none; stroke: #fff; stroke-width: 14; stroke-linejoin: round;
  vector-effect: non-scaling-stroke; pointer-events: none;
  filter: drop-shadow(0 0 2px #111) drop-shadow(0 0 6px #fff);
}
.player-layout.player-map-mode .track-button[data-narration-active="true"] {
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #111;
}
.player-layout.player-map-mode .track-button[data-narration-active="true"]::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid #fff;
  border-radius: inherit;
  box-shadow: 0 0 0 2px #111, 0 0 8px 3px #fff;
  pointer-events: none;
}
@keyframes narration-shine-pulse {
  0%, 100% { opacity: .72; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .narration-halo,
  .player-layout.player-map-mode .track-button[data-narration-active="true"]::after {
    animation: narration-shine-pulse 1.8s ease-in-out infinite;
  }
}
@media (prefers-reduced-motion: reduce) {
  .narration-halo,
  .player-layout.player-map-mode .track-button[data-narration-active="true"]::after {
    animation: none;
    opacity: 1;
  }
}
.player-map-mode .geofence-area { fill: var(--node-color, #e87373); fill-opacity: .55; stroke: #000; stroke-width: 2; stroke-dasharray: none; cursor: pointer; }
.player-map-mode .geofence-area.active { fill-opacity: .65; stroke-width: 3; }
/* The large22area crosses blue water; keep its shared orange-red clearly visible. */
.player-map-mode .manual-map-area-group[data-route-ordinal="22"] .geofence-area { fill-opacity: .72; }
.player-map-mode .boat, .player-map-mode .route-line { pointer-events: none; }
.manual-map-area-group:hover .manual-map-area,
.manual-map-area-group:focus-visible .manual-map-area { stroke-width: 4; fill-opacity: .65; }
.manual-map-area-group[data-playback-state="playing"] .manual-map-area,
.manual-map-area-group[data-playback-state="queued"] .manual-map-area,
.manual-map-area-group[data-playback-state="loading"] .manual-map-area { stroke-width: 4; fill-opacity: .65; }
.track-button > span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .home-topbar { position: relative; }
  .player-layout { grid-template-columns: minmax(0, 1fr); }
  .status-row, .route-header { flex-wrap: wrap; }
  .track-status { white-space: normal; }

}

/* These DOM hooks support the player engine, never presentation. */
#player-engine-hooks[hidden] { display: none !important; }
.player-layout.player-map-mode #manual-settings { white-space: nowrap; }
@media (max-width: 380px) {
  .player-layout.player-map-mode .map-zoom-controls button { padding-inline: 6px; font-size: .8rem; }
}

/* Verified regional map loading stays inside the map, without shifting controls. */
.map-renderer-host { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-renderer-status { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; text-align: center; color: var(--ink); background: var(--card); }
.map-renderer-status[hidden] { display: none !important; }
.map-renderer-status p { margin: 0; max-width: 32em; }
.map-renderer-progress { width: min(300px, 80%); accent-color: var(--red); }
.map-renderer-retry { min-width: 44px; min-height: 44px; }

#setup-back { min-height: 44px; margin-bottom: 16px; }
.location-grid .choice { min-height: 68px; }
.location-grid .choice span:empty { display: none; }
#tour-empty { padding-block: 12px; }
.player-layout.player-map-mode .map-header-controls { justify-content: flex-start; min-width: 0; max-width: 100%; }
.player-layout.player-map-mode .map-zoom-controls { min-width: 0; max-width: 100%; }
.player-layout.player-map-mode .map-zoom-controls button:not(#map-fit) { flex-shrink: 0; }
.player-layout.player-map-mode #map-fit { min-width: 0; line-height: 1.15; }
.player-layout.player-map-mode .map-stage { container-type: size; }
@container (max-height: 110px) {
  .map-renderer-status { flex-direction: row; padding: 4px; gap: 6px; }
  .map-renderer-status .map-renderer-message { display: none; }
  .map-renderer-status .map-renderer-retry { flex-shrink: 0; }
}
/* Exact transparent marks; switching themes changes the SVG, never its geometry. */
.home-topbar .site-brand { width: 80px; height: 80px; }
.home-topbar .brand-mark { width: 80px; height: 80px; flex: 0 0 80px; border-radius: 0; object-fit: contain; }

/* Map failure/retry stays a small badge; the renderer hides it while loading. */
.map-renderer-status.map-renderer-status-compact {
  inset: auto;
  left: 12px;
  bottom: 12px;
  width: auto;
  height: auto;
  max-width: min(30rem, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: 0 4px 12px var(--shadow);
  text-align: left;
  pointer-events: auto;
}
.map-renderer-status-compact .map-renderer-message { display: block; }
.map-renderer-status-compact .map-renderer-progress { display: none; }
.home-topbar .brand-mark-dark { display: none; }
.home-topbar .pilot-operator-title { flex: 1 1 auto; min-width: 0; }
.home-topbar .pilot-operator-title .eyebrow { margin-bottom: 4px; transform: translateY(-4px); }
.home-topbar .pilot-operator-title h1 { margin: 0; }
:root[data-theme="dark"] .home-topbar .brand-mark-light { display: none; }
:root[data-theme="dark"] .home-topbar .brand-mark-dark { display: block; }
@media (max-width: 760px) {
  .home-topbar .site-brand { width: 56px; height: 56px; }
  .home-topbar .brand-mark { width: 56px; height: 56px; flex-basis: 56px; }
}

/* The two boat choices stay side by side on small screens. */
.choice-grid.boat-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.boat-options .choice { min-width: 0; min-height: 64px; overflow-wrap: anywhere; }
.current-vessel { margin: 0; font-weight: 700; width: 100%; }

.operator-logo-title { line-height: 1; }
.operator-logo { display: block; width: 100px; max-width: 100%; height: auto; border-radius: 6px; transform: translateX(-6px); }
.boat-map-status { flex: 1 1 260px; min-width: 0; }
.boat-map-status p { margin: 0; }
#map-position-status { margin-top: 4px; font-size: .8rem; line-height: 1.3; }
.player-layout.player-map-mode .route-panel > .route-header { flex-wrap: wrap; }
@media (max-width: 480px) { .operator-logo { width: 88px; } }

/* The guide dedicates its viewport to map and controls. */
body:has(#player.player-map-mode:not([hidden])) > .topbar { display: none; }
body:has(#player.player-map-mode:not([hidden])) > main { overflow: hidden; }
#guide-preferences .topbar-actions { display: flex; align-items: center; flex-wrap: nowrap; width: auto; margin: 0; gap: 4px; }
#guide-preferences .quiet-button { height: 44px; padding: 6px 8px; min-width: 44px; }
#guide-preferences select.quiet-button { width: 62px; }
.player-layout.player-map-mode .map-header-controls { min-width: 0; }
.player-layout.player-map-mode .map-zoom-controls { flex-wrap: wrap; }

/* The immutable ö SVG ends at y≈1053.7 in its 1254-unit viewBox. */
.home-topbar .pilot-operator-title { box-sizing: border-box; height: 80px; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 12.8px; }
@media (max-width: 600px) {
  .home-topbar .pilot-operator-title { height: 56px; padding-bottom: 9px; }
}

.boat-map-status[hidden] { display: none; }
.map-ais-note { position: absolute; z-index: 3; top: 6px; left: 6px; padding: 3px 6px; border-radius: 5px; background: var(--card); color: var(--ink); font-size: .7rem; line-height: 1.2; pointer-events: none; }
.map-ais-note:empty { display: none; }

.theme-toggle svg { display: block; width: 20px; height: 20px; }
#location-label:focus, #tour-label:focus { outline: none; }

/* A complete QR link presents one explicit Start and its read-only presets. */
body.qr-entry:has(#setup:not([hidden])) > .topbar,
body.qr-entry #setup-back,
body.qr-entry #tour-settings > :not(#start-step) { display: none; }
body.qr-entry:has(#setup:not([hidden])) > main {
  min-height: 100svh; display: grid; place-items: center; padding: 24px 16px;
}
body.qr-entry #setup:not([hidden]) { width: 100%; border: 0; box-shadow: none; background: transparent; }
body.qr-entry #start-step:not([hidden]) { display: flex; flex-direction: column; align-items: center; gap: 20px; }
body.qr-entry #start-new { order: 0; min-width: 120px; min-height: 64px; font-size: 1.25rem; }
body.qr-entry #start-summary { order: 1; flex: none; margin: 0; text-align: center; white-space: pre-line; }

/* Compact phone guide toolbar; preferences stay in the preceding menu. */
@media (max-width: 760px), (max-width: 960px) and (max-height: 500px) {
  .player-layout.player-map-mode #guide-preferences { display: none; }
  .player-layout.player-map-mode .route-panel > .route-header { flex-wrap: nowrap; }
  .player-layout.player-map-mode .map-header-controls { width: 100%; }
  .player-layout.player-map-mode .map-zoom-controls {
    display: grid;
    grid-template-columns: auto auto 44px 44px minmax(0, 1fr);
    width: 100%;
    gap: 3px;
  }
  .player-layout.player-map-mode .map-zoom-controls button { padding: 4px 6px; font-size: .8rem; }
  .player-layout.player-map-mode #map-fit { padding: 3px; line-height: 1; white-space: normal; }
}
@media (max-width: 359px) {
  .player-layout.player-map-mode #manual-settings [data-i18n="back"] { display: none; }
  .player-layout.player-map-mode #manual-settings { width: 44px; padding: 0; }
  .player-layout.player-map-mode .map-zoom-controls button { font-size: .75rem; }
}

body:has(#source-preview:not([hidden])) { overflow:hidden; }
body:has(#source-preview:not([hidden])) .home-topbar { display:none; }
.source-preview:not([hidden]) {
  position:fixed; inset:0; z-index:30; display:flex; flex-direction:column; gap:8px;
  height:100dvh; width:100%; max-width:none; box-sizing:border-box; margin:0; padding:12px 16px;
  border:0; border-radius:0; background:var(--paper); overflow:hidden;
}
.source-preview-head { display:flex; align-items:center; gap:12px; flex:none; }
.source-preview-head h2 { margin:0; font-size:clamp(18px,2.1vw,27px); line-height:1.15; }
.source-preview-head .eyebrow { margin:0 0 3px; font-size:10px; }
#source-preview-preferences { margin-left:auto; }
#source-preview-preferences .topbar-actions { width:auto; flex-wrap:nowrap; }
.source-preview-summary, #source-preview-now-source { display:none; }
.source-tabs { display:flex; gap:6px; margin:0; overflow-x:auto; flex:none; max-width:100%; }
.source-tabs:empty { display:none; }
.source-tab { flex:none; min-height:40px; padding:7px 12px; border:1px solid var(--line); border-radius:9px; background:var(--control); color:var(--ink); font:inherit; font-size:13px; font-weight:700; }
.source-tab[aria-pressed="true"] { background:var(--ink); color:var(--paper); }
.source-preview-status { flex:none; margin:0; font-size:12px; line-height:1.35; color:var(--muted); }
.source-preview-now { display:flex; flex:none; gap:6px; overflow-x:auto; max-width:100%; padding:1px 0 2px; }
.source-preview-now span { flex:none; padding:5px 8px; border:1px solid var(--line); border-radius:999px; background:var(--control); color:var(--body-copy); font-size:11px; font-weight:700; white-space:nowrap; }
.source-preview-now span[data-state="ready"] { border-color:#24713c; background:#e8f5ec; color:#18552c; }
.source-preview-now span[data-state="missing"] { border-color:#a45e00; background:#fff3dc; color:#754300; }
.source-preview-now span[data-state="playing"] { border-color:var(--red); background:#fff0f3; color:#8e0922; }
.source-preview-boats { display:flex; align-items:center; gap:6px; flex:none; overflow-x:auto; }
.source-preview-boats strong { margin-right:2px; font-size:12px; white-space:nowrap; }
.source-preview-boats button { min-height:40px; padding:7px 12px; border:1px solid var(--line); border-radius:9px; background:var(--control); color:var(--ink); font:700 12px Inter,Arial,sans-serif; white-space:nowrap; }
.source-preview-boats button.selected { border-color:var(--red); background:var(--red); color:white; }
.source-preview-launch { width:min(720px,100%); margin:auto; padding:clamp(18px,4vw,34px); border:1px solid var(--line); border-radius:16px; background:var(--card); box-shadow:var(--shadow); box-sizing:border-box; }
.source-preview-launch .source-tabs { margin:8px 0 18px; }
.source-preview-launch .source-tab { flex:1 1 0; text-align:center; }
.source-preview-manual { margin:0 0 10px; padding:10px 12px; border-radius:9px; background:var(--control); font-weight:800; }
#source-preview-launch-language { margin:0 0 12px; }
#source-preview-launch-language select { width:100%; min-height:48px; }
#source-preview-start { width:100%; margin-top:18px; min-height:50px; }
.source-preview.awaiting-start .source-preview-guide, .source-preview:not(.awaiting-start) .source-preview-launch { display:none; }
.source-preview-map-region { position:relative; flex:1 1 auto; min-height:120px; overflow:hidden; border:1px solid var(--line); border-radius:12px; }
.source-preview-map-controls { position:absolute; top:8px; right:8px; z-index:8; display:flex; gap:5px; }
.source-preview-map-controls button { min-height:40px; background:var(--control); box-shadow:0 1px 5px #0002; }
#source-preview-map-host, #source-preview-map-host .map-stage { height:100%; min-height:0; margin:0; border:0; border-radius:0; }
.source-preview-ais { position:absolute; z-index:9; left:8px; top:8px; max-width:calc(100% - 220px); margin:0; padding:6px 9px; border-radius:8px; background:#fffffff2; color:#222; box-shadow:0 1px 5px #0002; font-size:11px; font-weight:700; line-height:1.25; }
.source-preview-ais[data-state="fresh"] { border-left:4px solid #278640; }
.source-preview-ais[data-state="last-known"] { border-left:4px solid #d78600; }
#source-preview-map-host .map-ais-note { display:none; }
.source-preview-bottom { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:7px; align-items:center; flex:none; }
.source-preview-list { flex:none; list-style:none; display:flex; flex-wrap:wrap; gap:5px; max-height:100px; overflow-y:auto; margin:0; padding:0; }
.source-preview-list li { padding:0; margin:0; }
.source-preview-list button { display:block; width:44px; height:44px; border:2px solid transparent; border-radius:9px; background:var(--node-color); color:#171717; font:700 14px Inter,Arial,sans-serif; cursor:pointer; }
.source-preview-list button.unmapped { background:var(--control); border:2px dashed var(--muted); color:var(--ink); }
.source-preview-list button.control-point { background:var(--control); border:2px dotted var(--muted); color:var(--ink); }
.source-preview-list button.selected { border-color:var(--ink); box-shadow:inset 0 0 0 1px var(--ink); }
.source-preview .manual-map-area-group.selected .geofence-area { stroke:var(--ink); stroke-width:4; fill-opacity:.85; }
.source-preview .source-node-badge { fill:#fff; stroke:#111; stroke-width:2; filter:drop-shadow(0 1px 2px #0005); }
.source-preview .source-node-number { fill:#111; font:800 12px Inter,Arial,sans-serif; }
.source-preview-place { flex:none; margin:0; padding:4px 8px; max-height:48px; overflow:auto; border-left:3px solid var(--red); font-size:13px; line-height:1.4; }
.source-preview-audio-controls { display:flex; align-items:center; gap:5px; }
#source-preview-audio, #source-preview-stop { display:inline-flex; min-height:40px; }
#source-preview-audio-language { min-height:40px; border:1px solid var(--line); border-radius:9px; background:var(--control); color:var(--ink); padding:7px 10px; font:inherit; font-size:13px; font-weight:700; }
#source-preview-audio:disabled { display:none; }
.source-preview details { flex:none; font-size:13px; margin:0; }
.source-preview details summary { cursor:pointer; }
.source-preview details p { max-height:88px; overflow:auto; margin:5px 0 0; line-height:1.4; }
@media(max-width:600px) {
  .source-preview:not([hidden]) { padding:8px; gap:6px; }
  .source-preview-head { gap:7px; flex-wrap:wrap; }
  .source-preview-head h2 { font-size:18px; }
  .source-preview-head .eyebrow { font-size:9px; }
  #source-preview-back { padding:8px; font-size:13px; }
  #source-preview-preferences .language-control select { min-width:54px; }
  #source-preview-preferences .topbar-actions { gap:4px; }
  .source-preview-summary { font-size:12px; }
  .source-preview-list { max-height:94px; gap:4px; }
  .source-preview-status { font-size:11px; }
  .source-preview-now { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); overflow:visible; }
  .source-preview-now span { overflow:hidden; text-overflow:ellipsis; }
  #source-preview-now-source, #source-preview-now-language { display:none; }
  .source-preview-summary, .source-preview-status { display:none; }
  .source-preview-boats strong { display:none; }
  .source-preview-boats button { flex:1 1 0; min-width:0; padding:6px; }
  .source-preview-ais { top:6px; left:6px; right:6px; max-width:none; box-sizing:border-box; font-size:10px; }
  .source-preview-map-controls { top:42px; right:6px; }
  .source-preview-bottom { grid-template-columns:1fr; }
  .source-preview-list { justify-content:center; }
  .source-preview-audio-controls { justify-content:center; }
}

body:has(#stockholm-player:not([hidden])) { overflow:hidden; }
body:has(#stockholm-player:not([hidden])) .home-topbar { display:none; }
.stockholm-settings { margin-top:12px; }
.stockholm-setup-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:10px 0; }
.stockholm-setup-grid label { display:flex; flex-direction:column; gap:5px; color:var(--body-copy); font-size:12px; font-weight:700; }
.stockholm-setup-grid select { width:100%; min-height:44px; padding:8px; border:1px solid var(--line); border-radius:9px; background:var(--control); color:var(--ink); font:inherit; }
.stockholm-overview-layout { display:grid; grid-template-columns:minmax(0,1fr) 310px; gap:8px; flex:1 1 auto; min-height:0; }
.stockholm-fleet-list { display:flex; flex-direction:column; gap:5px; overflow:auto; }
.stockholm-fleet-row { display:flex; justify-content:space-between; gap:8px; min-height:42px; padding:7px 9px; border:1px solid var(--line); border-radius:7px; background:var(--paper); color:var(--ink); text-align:left; }
.stockholm-fleet-row.selected { border-color:#176fa5; box-shadow:0 0 0 2px #176fa533; }
.stockholm-fleet-row strong { flex:0 0 70px; white-space:nowrap; }
.stockholm-fleet-row span { color:var(--body-copy); font-size:11px; }
#stockholm-fleet-map { width:100%; height:100%; display:block; background:#e7eef0; }
.stockholm-fleet-marker circle { fill:#176fa5; stroke:#fff; stroke-width:2; }.stockholm-fleet-marker.selected circle { fill:#178b55; stroke-width:3; }.stockholm-fleet-marker text { fill:#fff; font:bold 8px Inter,Arial,sans-serif; text-anchor:middle; dominant-baseline:middle; }
.stockholm-player:not([hidden]) { position:fixed; inset:0; z-index:35; display:flex; flex-direction:column; gap:8px; width:100%; height:100dvh; box-sizing:border-box; padding:12px 16px; background:var(--paper); overflow:hidden; }
.stockholm-player-head { display:flex; align-items:center; gap:12px; flex:none; }
.stockholm-player-head h2,.stockholm-player-head p { margin:0; }
#stockholm-guide-preferences { margin-left:auto; display:flex; align-items:center; }
#stockholm-guide-preferences label { display:flex; align-items:center; gap:8px; color:#565b61; font-size:12px; font-weight:700; white-space:nowrap; }
#stockholm-player-language { min-height:41px; max-width:240px; padding:7px 30px 7px 10px; border:1px solid #c9cdd2; border-radius:8px; background:#fff; color:#202326; font:inherit; }
#stockholm-selection-status { font-weight:800; }
#stockholm-selection-status.invalid { color:#a02424; }
.stockholm-now { flex:none; padding:7px 10px; border:1px solid var(--line); border-radius:9px; background:var(--control); font-size:12px; font-weight:700; }
.stockholm-map-wrap { position:relative; flex:1 1 auto; min-height:220px; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#e7eef0; }
#stockholm-map { width:100%; height:100%; display:block; background:#e7eef0; }
.stockholm-map-controls { position:absolute; top:8px; right:8px; z-index:4; display:flex; gap:4px; }.stockholm-map-controls button { min-height:40px; background:#fffffff0; }
.stockholm-land { fill:#f7f4ec; stroke:#d5d2ca; stroke-width:.7; }
.stockholm-green { fill:#dcebd6; stroke:#bfd2b8; stroke-width:.7; }
.stockholm-water { fill:#cfe8ef; stroke:#9fcbd7; stroke-width:.8; }
.stockholm-coastline { fill:none; stroke:#8eb9c4; stroke-width:1; }
.stockholm-waterway { fill:none; stroke:#8ebfd0; stroke-width:1.2; }
.stockholm-road { fill:none; stroke:#d2cec3; stroke-width:1.3; }.stockholm-road-major { stroke:#c5ae85; stroke-width:2.2; }
.stockholm-label { fill:#5d5a53; font:600 9px Inter,Arial,sans-serif; paint-order:stroke; stroke:#fff; stroke-width:2px; stroke-linejoin:round; }
.stockholm-route { fill:none; stroke:#d50b2f; stroke-width:4; stroke-linecap:round; stroke-linejoin:round; }
.stockholm-route-arrow { fill:#9e0824; stroke:#fff; stroke-width:1; }
.stockholm-sample { fill:#1b6da8; opacity:.34; }
.stockholm-stop { cursor:pointer; }.stockholm-stop circle { fill:#d50b2f; stroke:#fff; stroke-width:2; }.stockholm-stop .stop-number { fill:#fff; font:bold 9px Inter,Arial,sans-serif; text-anchor:middle; dominant-baseline:middle; pointer-events:none; }
.stockholm-bus-marker { transition:transform 900ms linear; }
.stockholm-bus-marker { pointer-events:none; }.stockholm-bus-marker circle { fill:#176fa5; stroke:#fff; stroke-width:3; }.stockholm-bus-marker .bus-glyph { fill:#fff; }
.stockholm-stop-detail { position:absolute; left:8px; top:8px; z-index:3; max-width:min(420px,calc(100% - 16px)); margin:0; padding:7px 10px; border-radius:7px; background:#fffffff2; color:#222; font-size:12px; font-weight:700; box-shadow:0 1px 5px #0002; }
#stockholm-fleet-detail { top:auto; bottom:28px; }
.stockholm-map-key { position:absolute; left:8px; bottom:8px; padding:5px 8px; border-radius:7px; background:#fffffff0; color:#333; font-size:11px; }
.stockholm-attribution { position:absolute; right:8px; bottom:8px; padding:3px 5px; border-radius:4px; background:#fffffff0; color:#555; font-size:9px; }
.stockholm-key-stop,.stockholm-key-bus { display:inline-block; width:10px; height:10px; margin:0 3px 0 8px; border-radius:50%; vertical-align:-1px; }
.stockholm-key-stop { background:#d50b2f; border:1px solid #fff; margin-left:0; }.stockholm-key-bus { background:#176fa5; }
/* Story circles show the actual source audio area without source-editor numbering. */
.stockholm-key-guide { display:inline-block; width:10px; height:10px; margin:0 3px 0 8px; border-radius:50%; vertical-align:-1px; background:#f4a62355; border:1px solid #b76800; }
.stockholm-guide-node { cursor:pointer; }
.stockholm-guide-node .guide-marker { fill:#f4a623; fill-opacity:.25; stroke:#b76800; stroke-opacity:.8; stroke-width:1.5; vector-effect:non-scaling-stroke; }
.stockholm-guide-node:hover .guide-marker { fill-opacity:.38; stroke-width:2; }
.stockholm-guide-node.selected .guide-marker { fill-opacity:.42; stroke:#804400; stroke-width:3; }
.stockholm-guide-node:focus-visible { outline:none; }
.stockholm-guide-node:focus-visible .guide-marker { stroke:#202326; stroke-width:3.5; fill-opacity:.4; }
.stockholm-guide-node .guide-marker-label,.guide-marker-leader { display:none; }
.stockholm-guide-panel { flex:none; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px 14px; align-items:start; max-height:26vh; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:var(--control); overflow:auto; }
.stockholm-guide-panel p { margin:3px 0; font-size:12px; color:var(--body-copy); }
.stockholm-guide-panel details { grid-column:1 / -1; }
.stockholm-guide-panel details p { white-space:pre-wrap; }
.stockholm-guide-actions { display:flex; gap:5px; }
.stockholm-guide-image { width:clamp(84px,12vw,150px); max-height:96px; object-fit:contain; align-self:center; border-radius:7px; background:#f4f4f2; }
#stockholm-audio { display:none; }
.stockholm-replay-controls { flex:none; display:grid; grid-template-columns:auto 1fr auto; gap:10px; align-items:center; }
.stockholm-replay-controls label { display:flex; align-items:center; gap:7px; font-size:12px; font-weight:700; }
#stockholm-scrub { width:100%; }
@media(max-width:700px) {
  #stockholm-guide-preferences { width:100%; margin-left:0; }
  #stockholm-guide-preferences label { width:100%; flex-wrap:wrap; }
  #stockholm-player-language { flex:1 1 190px; max-width:none; }
  .stockholm-setup-grid { grid-template-columns:1fr; gap:6px; }
  .stockholm-overview-layout { grid-template-columns:1fr; grid-template-rows:minmax(220px,1fr) minmax(150px,38vh); }
  .stockholm-player:not([hidden]) { padding:8px; gap:6px; }
  .stockholm-player-head h2 { font-size:18px; }
  .stockholm-replay-controls { grid-template-columns:auto minmax(0,1fr) auto; }
  .stockholm-map-wrap { min-height:180px; }
  .stockholm-guide-panel { max-height:30vh; grid-template-columns:1fr; }
  .stockholm-guide-panel details { grid-column:1; }
  #stockholm-player .stockholm-stop-detail { top:56px; right:8px; max-width:calc(100% - 16px); box-sizing:border-box; overflow-wrap:anywhere; }
}

@media(max-width:760px) {
  #stockholm-guide-preferences .topbar-actions { display:none; }
  #stockholm-player .stockholm-map-key { bottom:26px; }
  #stockholm-player .stockholm-attribution { bottom:5px; }
}

#source-preview-text { align-self:flex-start; min-height:40px; margin:0 0 4px; }
#source-text-dialog { width:min(850px,calc(100vw - 24px)); max-height:90dvh; padding:20px; border:1px solid var(--line); border-radius:16px; background:var(--paper); color:var(--ink); }
#source-text-dialog::backdrop { background:rgba(0,0,0,.5); }
.source-text-head { display:flex; align-items:start; justify-content:space-between; gap:12px; }
.source-text-head h2 { margin:0; font-size:1.3rem; }
#source-text-note,#source-text-warning { font-size:.9rem; line-height:1.45; }
#source-text-parts section { margin:16px 0; }
#source-text-parts h3 { margin:4px 0; }
#source-text-parts textarea { display:block; width:100%; min-height:180px; resize:vertical; white-space:pre-wrap; padding:12px; margin:8px 0; border:1px solid var(--line); border-radius:8px; background:var(--paper); color:var(--ink); font:inherit; line-height:1.5; }
#source-text-language { min-height:44px; }
@media(max-width:600px) { #source-text-dialog { padding:14px; } #player-source-text { font-size:.75rem; padding:6px; } }
.stockholm-fleet-marker { transition:transform 900ms linear; }
.djurgarden-route-preview{margin-top:1rem}.djurgarden-preview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;margin-top:.5rem}.djurgarden-preview-card{display:grid;gap:.25rem;padding:.65rem;border:1px solid var(--line);border-radius:12px;background:var(--panel)}.djurgarden-preview-card.selected{outline:3px solid var(--accent);outline-offset:1px}.djurgarden-preview-card svg{width:100%;max-height:180px;background:var(--map-water,#e8f3f6);border-radius:8px}.djurgarden-preview-zone{fill:color-mix(in srgb,var(--accent) 14%,transparent);stroke:var(--accent);stroke-width:1.5}.djurgarden-preview-marker{fill:var(--ink);stroke:var(--panel);stroke-width:1}.djurgarden-fixed-selection{font-weight:700;margin:.6rem 0 0}@media(max-width:760px){.djurgarden-preview-grid{grid-template-columns:1fr}.djurgarden-preview-card svg{max-height:145px}}

.djurgarden-preview-route{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.route-choice{border-inline-start:8px solid var(--route-choice-color);text-align:start}.route-choice.selected{box-shadow:0 0 0 3px color-mix(in srgb,var(--route-choice-color) 55%,transparent)}.djurgarden-preview-description{min-height:2.4em}.djurgarden-preview-card:first-child{border-top:5px solid #DB4436}.djurgarden-preview-card:nth-child(2){border-top:5px solid #009D57}
.choice.route-choice.selected{border-color:var(--route-choice-color);border-inline-start-color:var(--route-choice-color);box-shadow:inset 0 0 0 1px var(--route-choice-color),0 0 0 3px color-mix(in srgb,var(--route-choice-color) 35%,transparent)}.djurgarden-preview-card.selected{outline-color:var(--route-choice-color)}
.royal-source-choice{display:grid;gap:.4rem;padding:.5rem;border:2px solid var(--gold);border-radius:8px;background:var(--panel)}.royal-source-choice[hidden]{display:none}.royal-source-choice-options{display:flex;gap:.4rem;flex-wrap:wrap}#royal-source-choice-options{display:flex;gap:.4rem;flex-wrap:wrap}

/* HoHo story numbers stay legible above the source geofence areas. */
#route-map[data-tour-id="stockholm-hoho-boat"] .source-node-badge { fill:#fff; stroke:#172f39; stroke-width:2; filter:drop-shadow(0 1px 2px #0005); }
#route-map[data-tour-id="stockholm-hoho-boat"] .source-node-number { fill:#172f39; stroke:none; font:800 13px Arial,sans-serif; }

/* Follow v2: reserve a stable minimum while allowing complete translated status text. */
.player-layout.player-map-mode .boat-map-status{flex:1 1 260px;min-width:0;display:grid;grid-template-rows:minmax(1.3em,auto) minmax(3.9em,auto);align-content:start}
.player-layout.player-map-mode #map-position-status{min-height:3.9em;overflow-wrap:anywhere;white-space:normal}
/* Post-tour release: route-estimated marker remains visually distinct and moves via RAF attributes. */
.boat[data-position-status="route-estimate"] { stroke-dasharray: 2.5 2; transform-box: fill-box; transform-origin: center; }
#map-tiles, #route-map { will-change: transform; }

/* The map-stage clips the viewport; the translated SVG must keep offscreen route geometry painted. */
.player-layout.player-map-mode #route-map { overflow: visible; }

/* Direct links wait for their validated setup; ordinary home is country-first. */
html[data-setup-entry="pending"] #setup,
html[data-setup-entry="pending"] .home-topbar { visibility: hidden; }
#location-options > .choice:disabled { opacity: 1; cursor: wait; }

/* Stockholm guest controls stay readable at phone widths and in both themes. */
#stockholm-settings [hidden] { display:none!important; }
#stockholm-setup-description { color:var(--body-copy); line-height:1.5; margin:.4rem 0 1rem; }
#stockholm-guide-preferences label { color:var(--body-copy); }
#stockholm-player-language { background:var(--control); color:var(--ink); border-color:var(--line); }
.stockholm-guide-actions { flex-wrap:wrap; }
.stockholm-guide-actions button { min-height:44px; }
.stockholm-guide-panel details summary { cursor:pointer; padding:4px 0; font-size:13px; }
.stockholm-fleet-row strong { flex:1 1 auto; }
.stockholm-fleet-row { flex-wrap:wrap; min-height:48px; }
.stockholm-fleet-row span { width:100%; }
#stockholm-player .stockholm-map-controls button[aria-pressed="true"] { background:#edf5ee; border-color:#327641; color:#173b22; }
@media(max-width:700px) {
  #stockholm-player .stockholm-player-head { flex-wrap:wrap; gap:7px 10px; }
  #stockholm-player .stockholm-player-head > div:not(#stockholm-guide-preferences) { min-width:0; flex:1; }
  #stockholm-player .stockholm-player-head h2 { font-size:16px; line-height:1.25; }
  #stockholm-player .stockholm-player-head .eyebrow { display:none; }
  #stockholm-player-bus { display:block; margin-top:3px; font-size:13px; }
  #stockholm-guide-preferences { width:auto; flex:1 1 100%; }
  #stockholm-guide-preferences label { display:flex; flex-wrap:nowrap; gap:8px; }
  #stockholm-player-language { min-height:38px; max-width:190px; flex:1; }
  .stockholm-now { font-size:11px; padding:6px 8px; line-height:1.35; }
  .stockholm-map-controls { top:6px; right:6px; left:6px; justify-content:flex-end; }
  .stockholm-map-controls button { min-height:44px; padding:7px 9px; font-size:12px; }
  .stockholm-guide-panel { gap:6px; padding:8px; max-height:27dvh; }
  .stockholm-guide-panel > div:first-child { min-width:0; }
  .stockholm-guide-actions { display:flex; flex-wrap:nowrap; gap:5px; }
  .stockholm-guide-actions button { flex:1; padding:7px; font-size:12px; }
  .stockholm-guide-image { width:72px; max-height:58px; }
}
@media(max-height:520px) and (orientation:landscape) {
  #stockholm-guide-preferences { width:auto; flex:0 1 auto; margin-left:auto; }
  #stockholm-player .stockholm-player-head { flex-wrap:nowrap; }
  #stockholm-player .stockholm-map-wrap { min-height:100px; }
  .stockholm-guide-panel { grid-template-columns:minmax(0,1fr) auto; max-height:24dvh; }
  .stockholm-guide-image { display:none; }
}
@media(prefers-reduced-motion:reduce) { .stockholm-bus-marker,.stockholm-fleet-marker { transition:none; } }

/* Bus QR entry: one clear decision, quiet branding and generous touch targets. */
body.stockholm-qr-mode #setup { max-width:680px; margin:0 auto; border-radius:20px; box-shadow:0 8px 32px #162c3510; }
body.stockholm-qr-mode .home-topbar { box-shadow:none; }
:root:not([data-theme="dark"]) body.stockholm-qr-mode { --paper:#f3f6f5; --card:#fff; --control:#f8faf9; --topbar:#f3f6f5; --ink:#172e35; --body-copy:#486069; --line:#d4dfdf; }
.stockholm-qr-entry { max-width:540px; margin:0 auto; padding:4px 0; text-align:center; }
.stockholm-qr-entry .eyebrow { font-size:11px; letter-spacing:.12em; color:var(--muted); }
.stockholm-qr-entry h1 { margin:14px auto 16px; max-width:470px; font-size:clamp(1.7rem,4vw,2.15rem); font-weight:750; letter-spacing:-.035em; line-height:1.16; }
.stockholm-qr-bus { display:inline-block; padding:7px 14px; border:1px solid var(--line); border-radius:7px; font-size:.95rem; font-weight:700; margin:0 0 4px; }
.stockholm-qr-entry > p { line-height:1.5; }
#stockholm-qr-help { max-width:370px; margin:12px auto 0; color:var(--body-copy); font-size:.95rem; }
.stockholm-qr-language-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:24px 0 20px; }
.stockholm-qr-language-options button { display:flex; align-items:center; justify-content:space-between; min-height:66px; padding:16px 18px; background:var(--control); color:var(--ink); border:1px solid var(--line); border-radius:10px; font:650 17px Inter,Arial,sans-serif; text-align:left; cursor:pointer; transition:border-color .15s,background .15s; }
.stockholm-qr-language-options button::after { content:"→"; font-size:19px; font-weight:400; color:var(--muted); margin-left:8px; }
.stockholm-qr-language-options button:hover { border-color:var(--red); background:var(--card); }
.stockholm-qr-language-options button:hover::after { color:var(--red); }
.stockholm-qr-language-options button:focus-visible { outline:3px solid var(--red); outline-offset:3px; }
.stockholm-qr-tip { color:var(--body-copy); font-size:.82rem; margin:12px auto 18px; max-width:360px; }
#stockholm-qr-back { padding:9px 12px; min-height:44px; background:transparent; border-color:transparent; color:var(--muted); font-size:.85rem; font-weight:500; text-decoration:underline; text-underline-offset:4px; }
#stockholm-qr-back:hover { color:var(--ink); }
body.stockholm-qr-mode #stockholm-guide-preferences .topbar-actions,
body.stockholm-qr-mode .home-topbar .topbar-actions,
body.stockholm-qr-mode #setup-back,
body.stockholm-qr-mode .stockholm-qr-entry > .eyebrow { display:none; }
@media(max-width:600px) {
  body.stockholm-qr-mode > main { padding:16px 12px 28px; }
  body.stockholm-qr-mode #setup { padding:22px 18px 14px; border-radius:16px; }
  .stockholm-qr-language-options { gap:10px; margin-top:22px; }
  .stockholm-qr-language-options button { min-height:62px; padding:13px 14px; font-size:16px; }
}

/* Keep the Stockholm tour name directly above the operator mark. */
body.stockholm-qr-mode #navigation-context { display:block; font-size:clamp(.65rem,1.5vw,.82rem); line-height:1.3; letter-spacing:.06em; max-width:36em; }
body.stockholm-qr-mode .home-topbar .pilot-operator-title { height:auto; min-height:80px; justify-content:center; padding:0; }
@media(max-width:600px) { body.stockholm-qr-mode .home-topbar .pilot-operator-title { min-height:56px; } }


/* QR guests listen to the automatic guide. Keep only exceptional recovery visible. */
body.stockholm-qr-mode #stockholm-guide-panel { display:contents; }
body.stockholm-qr-mode #stockholm-guide-panel > div:first-child,
body.stockholm-qr-mode #stockholm-guide-image,
body.stockholm-qr-mode #stockholm-guide-panel details,
body.stockholm-qr-mode #stockholm-guide-play,
body.stockholm-qr-mode #stockholm-guide-stop,
body.stockholm-qr-mode #stockholm-guide-end { display:none; }
body.stockholm-qr-mode .stockholm-guide-actions { display:contents; }
body.stockholm-qr-mode #stockholm-guide-continue:not([hidden]) { position:absolute; z-index:8; left:50%; bottom:18px; transform:translateX(-50%); width:auto; min-height:40px; white-space:nowrap; }
body.stockholm-qr-mode .stockholm-guide-node { cursor:default; }

/* Paired stops 10/12 retain both digits inside the existing circle. */
.stockholm-stop .stop-number.paired { font-size:6px; }


/* QR guests stay on the live map: a compact header and controls leave space for it. */
body.stockholm-qr-mode #stockholm-player .stockholm-player-head { display:grid; grid-template-columns:minmax(0,1fr) minmax(108px,150px); gap:12px; align-items:center; padding:2px 2px 0; }
body.stockholm-qr-mode #stockholm-player #stockholm-back { display:none; }
body.stockholm-qr-mode #stockholm-player .stockholm-player-head .eyebrow { display:none; }
body.stockholm-qr-mode #stockholm-player .stockholm-player-head h2 { font-size:clamp(13px,2vw,20px); line-height:1.15; letter-spacing:-.025em; }
body.stockholm-qr-mode #stockholm-player-bus { display:block; margin-top:4px; font-size:clamp(12px,1.4vw,13px); line-height:1.25; }
body.stockholm-qr-mode #stockholm-guide-preferences { width:auto; margin:0; min-width:0; }
body.stockholm-qr-mode #stockholm-guide-preferences label { display:block; }
body.stockholm-qr-mode #stockholm-player-language { width:100%; min-height:44px; max-width:none; }
body.stockholm-qr-mode #stockholm-player .stockholm-map-controls { top:12px; right:auto; bottom:auto; left:12px; display:grid; grid-template-columns:minmax(0,auto) 44px 44px auto; gap:6px; align-items:center; padding:6px; border:1px solid #c4ced0; border-radius:14px; background:#fffffff2; box-shadow:0 3px 12px #17303a26; }
body.stockholm-qr-mode #stockholm-player .stockholm-map-controls button { min-width:44px; min-height:44px; padding:0 10px; white-space:nowrap; }
body.stockholm-qr-mode #stockholm-player #stockholm-zoom-out,body.stockholm-qr-mode #stockholm-player #stockholm-zoom-in { width:44px; padding:0; font-size:22px; line-height:1; }
body.stockholm-qr-mode #stockholm-player #stockholm-guide-continue:not([hidden]) { bottom:76px; }
@media(max-width:600px) {
  body.stockholm-qr-mode #stockholm-player .stockholm-player-head { grid-template-columns:minmax(0,1fr) 108px; gap:10px; }
  body.stockholm-qr-mode #stockholm-player .stockholm-map-controls { top:8px; right:auto; bottom:auto; left:8px; gap:4px; padding:5px; }
  body.stockholm-qr-mode #stockholm-player .stockholm-map-controls button { padding:0 8px; font-size:12px; }
}

body.stockholm-qr-mode #stockholm-player-language-label { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }


/* Automatic intro is optional; this overlay appears only while one of its source tracks plays. */
.stockholm-skip-intro { position:absolute; z-index:5; top:72px; left:12px; min-height:44px; padding:0 12px; background:#fffffff2; box-shadow:0 3px 12px #17303a26; }
@media(max-width:600px) { .stockholm-skip-intro { top:68px; left:8px; } }
body.stockholm-qr-mode .stockholm-skip-intro { top:72px; left:12px; }
@media(max-width:600px) { body.stockholm-qr-mode .stockholm-skip-intro { top:68px; left:8px; } }

/* 30 September: keep the phone boat toolbar legible beside live tracking. */
@media (max-width: 760px), (max-width: 960px) and (max-height: 500px) {
  .player-layout.player-map-mode .boat-map-status { display: none; }
  .player-layout.player-map-mode .map-zoom-controls { display: flex; flex-wrap: wrap; gap: 4px; }
  .player-layout.player-map-mode .map-zoom-controls button { flex: 0 0 auto; width: auto; min-width: 44px; padding: 4px 8px; white-space: nowrap; }
  .player-layout.player-map-mode #map-fit { padding-inline: 8px; white-space: nowrap; }
}

/* Nordisk klarhet — shared guest surface, 15 October 2026. */
.skip-link{position:fixed;top:-100px;left:16px;z-index:100;padding:12px 18px;background:var(--card);color:var(--ink);border:2px solid var(--red);border-radius:8px}
.skip-link:focus{top:12px}
button,select{min-height:44px}
button:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid var(--red);outline-offset:3px}
.home-topbar{position:relative;max-width:1240px;margin:auto;padding:28px 32px;gap:32px;border-bottom:0;box-shadow:none}
.home-topbar .site-brand{width:clamp(142px,20vw,216px);height:auto;min-height:44px}
.home-topbar .brand-wordmark{display:block;width:100%;height:auto;object-fit:contain}
.home-topbar .pilot-operator-title,body.stockholm-qr-mode .home-topbar .pilot-operator-title{height:auto;min-height:44px;padding:0;justify-content:center;gap:5px}
.home-topbar .pilot-operator-title .eyebrow{transform:none;font-size:11px;letter-spacing:.08em;line-height:1.4;margin:0}
.operator-logo{transform:none;width:100px;border-radius:3px}
.home-topbar .topbar-actions{margin-left:auto}
.theme-toggle{min-width:44px;height:44px}
main{padding-top:16px}
.setup-panel{max-width:960px;margin-inline:auto;border-radius:22px;border-color:var(--line);box-shadow:0 6px 28px var(--shadow);padding:clamp(22px,4vw,42px)}
#setup-back{margin-bottom:22px;background:transparent}
.step-label{font-size:14px;letter-spacing:.01em;text-transform:none;color:var(--body-copy);font-weight:650;margin-bottom:14px}
#location-label,#tour-label{font-size:clamp(24px,3vw,32px);color:var(--ink);font-weight:720;letter-spacing:-.025em;margin-bottom:24px}
.choice{min-height:76px;border-radius:13px;box-shadow:none;transition:border-color .15s,background-color .15s;overflow-wrap:anywhere}
.choice:hover{transform:none;box-shadow:none;border-color:var(--red)}
.choice.selected{background:color-mix(in srgb,var(--red) 4%,var(--card));border-color:var(--red);box-shadow:inset 0 0 0 1px var(--red)}
.choice strong{font-weight:650;line-height:1.3}
.choice span{font-size:14px;line-height:1.5}
.location-grid .choice{min-height:84px;display:flex;align-items:center;justify-content:space-between}
.location-grid .choice::after{content:'→';color:var(--muted);font-size:22px}
.primary-button{min-height:50px;border-radius:11px;padding:13px 24px;font-weight:700}
.secondary-button,.quiet-button{border-radius:9px;box-shadow:none}
.start-summary{line-height:1.55;color:var(--body-copy)}
.start-step{border-top:1px solid var(--line);padding-top:8px}
body.stockholm-qr-mode{--ink:#141b1a;--body-copy:#40534e;--paper:#f3f5f3;--topbar:#f3f5f3;--control:#fff;--line:#d7dedb}
:root[data-theme="dark"] body.stockholm-qr-mode{--ink:#f4f3ef;--body-copy:#d7dbe2;--paper:#11151c;--topbar:#171d27;--control:#222a36;--line:#3c4655}
body.stockholm-qr-mode #setup{max-width:660px}
body.stockholm-qr-mode .home-topbar .topbar-actions{display:flex}
body.stockholm-qr-mode .home-topbar .language-control{display:none}
.stockholm-qr-bus{border-radius:99px;background:var(--paper)}
.stockholm-qr-language-options button{border-radius:12px;min-height:70px;background:var(--card)}
.stockholm-qr-language-options{gap:12px}
.player-layout.player-map-mode .track-button{border-color:color-mix(in srgb,var(--node-color) 65%,#111);border-width:1px;background:color-mix(in srgb,var(--node-color) 38%,white)}
.player-layout.player-map-mode .track-button[data-playback-state="playing"]{border:2px solid var(--red);box-shadow:0 0 0 2px var(--card),0 0 0 3px var(--red)}
.player-layout.player-map-mode .route-panel,.stockholm-map-wrap{border-radius:14px}
@media(max-width:760px){
 .home-topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;padding:20px 20px 12px}
 .home-topbar .site-brand{width:162px;max-width:100%;grid-column:1;grid-row:1}
 .home-topbar .topbar-actions{grid-column:2;grid-row:1;gap:6px}
 .home-topbar .pilot-operator-title{grid-column:1/-1;grid-row:2;display:flex;flex-direction:row;justify-content:space-between;align-items:center;min-height:28px}
 .home-topbar .pilot-operator-title .eyebrow{max-width:70%;font-size:10px}
 .home-topbar .operator-logo{width:88px}
 body.stockholm-qr-mode .home-topbar .pilot-operator-title{min-height:28px;flex-direction:row;justify-content:space-between}
 body.stockholm-qr-mode #navigation-context{font-size:10px;max-width:70%}
 main{padding:12px 12px 32px}
 .setup-panel{padding:24px 18px;border-radius:18px}
 .choice-grid.compact{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .choice{min-width:0;padding:14px}
 .choice strong{font-size:15px}
 .choice span{font-size:13px}
 #mode-step .choice-grid{grid-template-columns:1fr}
 .location-grid{gap:10px}
 .location-grid .choice{min-height:68px}
 .stockholm-qr-entry h1{font-size:28px}
}
@media(max-width:360px){.home-topbar{padding-inline:14px;gap:12px}.home-topbar .site-brand{width:140px}.home-topbar .language-control select{min-width:54px;padding-inline:7px}.stockholm-qr-language-options button{padding:12px;font-size:15px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
