:root {
  color-scheme: light;
  --red: #d50b2f;
  --red-dark: #a60825;
  --ink: #000000;
  --muted: #465d66;
  --paper: #d5dfe1;
  --card: #e1e8e8;
  --line: #acbfc5;
  --sea: #c1d8df;
  --green: #10764f;
  --topbar: #dbe4e5;
  --control: #e8eeee;
  --subtle: #c7d4d8;
  --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.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-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; }
