/* ============================================
   MAP SHELL — Map-first layout + drawer nav
   Po wodach Wenecji / Par le aque de Venessia
   ============================================ */

/* ── BETA NOTICE (inline in topbar) ── */
.beta-notice {
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.68rem;
  font-style: italic;
  color: var(--ink-faint, #888);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 10px;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.beta-notice .beta-pill {
  display: inline-block;
  font-size: 0.52rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f5ecd0;
  background: #8b6508;
  padding: 2px 6px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: 1px;
}

/* Short text hidden by default, shown on narrow screens */
.beta-notice .beta-short { display: none; }

.content-topbar .beta-notice {
  color: rgba(244, 239, 228, 0.4);
}

.content-topbar .beta-notice .beta-pill {
  background: rgba(139, 101, 8, 0.8);
  color: rgba(244, 239, 228, 0.85);
}

@media (max-width: 600px) {
  .beta-notice {
    font-size: 0.6rem;
    margin-left: 6px;
  }
  .beta-notice .beta-long { display: none; }
  .beta-notice .beta-short { display: inline; }
}

/* ── FULL-VIEWPORT MAP ── */
.map-page {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100dvh;
  height: 100vh;
}

.map-viewport {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.map-viewport #map {
  width: 100%;
  height: 100%;
  background: #c2d6e6;
}


/* ── MAP TOPBAR (floating over map) ── */
.map-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  background: rgba(250, 246, 238, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1.5px solid rgba(139, 0, 0, 0.25);
  font-family: var(--font, 'Lora', Georgia, serif);
  pointer-events: auto;
}

.map-topbar .drawer-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px 6px 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}

.map-topbar .drawer-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink, #1a1a1a);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.2s;
}

.map-topbar .map-brand {
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.88rem;
  font-weight: 700;
  font-style: italic;
  color: var(--ink, #1a1a1a);
  text-decoration: none;
  margin-left: 4px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-topbar .lang-switch-mini {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}

.map-topbar .lang-switch-mini a {
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink-faint, #888);
  padding: 4px 5px;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
}

.map-topbar .lang-switch-mini a:hover {
  color: var(--ink, #1a1a1a);
}

.map-topbar .lang-switch-mini a.current {
  color: var(--ink, #1a1a1a);
  background: rgba(0, 0, 0, 0.06);
}

.map-topbar .lang-switch-mini span {
  color: var(--ink-faint, #888);
  font-size: 0.55rem;
  opacity: 0.4;
}

/* ── CONTENT PAGE TOPBAR ── */
.content-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 12px;
  background: var(--primary, #1a1a1a);
  border-bottom: 2px solid var(--accent, #8b0000);
  font-family: var(--font, 'Lora', Georgia, serif);
}

.content-topbar .back-to-map {
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(244, 239, 228, 0.7);
  text-decoration: none;
  padding: 6px 8px;
  transition: color 0.2s;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.content-topbar .back-to-map:hover {
  color: #fff;
}

.content-topbar .page-title-bar {
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.72rem;
  font-weight: 400;
  color: rgba(244, 239, 228, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-topbar .drawer-toggle {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}

.content-topbar .drawer-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: rgba(244, 239, 228, 0.6);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.2s;
}

.content-topbar .drawer-toggle:hover span {
  background: rgba(244, 239, 228, 0.9);
}

.content-topbar .lang-switch-mini {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  margin-left: 12px;
  margin-right: 8px;
}

.content-topbar .lang-switch-mini a {
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: rgba(244, 239, 228, 0.35);
  padding: 4px 5px;
  border-radius: 3px;
  transition: color 0.2s;
}

.content-topbar .lang-switch-mini a:hover {
  color: rgba(244, 239, 228, 0.7);
}

.content-topbar .lang-switch-mini a.current {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.content-topbar .lang-switch-mini span {
  color: rgba(244, 239, 228, 0.15);
  font-size: 0.55rem;
}

/* ── DRAWER SCRIM ── */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(26, 26, 26, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.drawer-scrim.open {
  opacity: 1;
  visibility: visible;
}

/* ── NAVIGATION DRAWER ── */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 2000;
  width: 300px;
  max-width: 85vw;
  background: rgba(250, 246, 238, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 3px solid var(--accent, #8b0000);
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  font-family: var(--font, 'Lora', Georgia, serif);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(26, 26, 26, 0.08);
  flex-shrink: 0;
}

.drawer-brand {
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 1.05rem;
  font-weight: 700;
  font-style: italic;
  color: var(--ink, #1a1a1a);
  letter-spacing: -0.01em;
}

.drawer-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--ink-faint, #888);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s;
}

.drawer-close:hover {
  color: var(--ink, #1a1a1a);
}

/* Drawer navigation links */
.drawer-links {
  list-style: none;
  margin: 0;
  padding: 12px 0;
  flex-shrink: 0;
}

.drawer-links li {
  padding: 0;
  margin: 0;
}

.drawer-links li::before {
  display: none;
}

.drawer-links a {
  display: block;
  padding: 10px 24px;
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-light, #444);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.15s, color 0.15s, padding-left 0.2s;
  border-left: 3px solid transparent;
}

.drawer-links a:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--ink, #1a1a1a);
  padding-left: 28px;
}

.drawer-links a.drawer-active {
  color: var(--accent, #8b0000);
  border-left-color: var(--accent, #8b0000);
  font-style: italic;
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: -0.01em;
}

/* Drawer: quick-start collapsible */
.drawer-quickstart {
  border-top: 1px solid rgba(26, 26, 26, 0.08);
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.drawer-quickstart summary {
  display: block;
  padding: 12px 24px;
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-light, #444);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  list-style: none;
  user-select: none;
}

.drawer-quickstart summary::-webkit-details-marker { display: none; }
.drawer-quickstart summary::marker { display: none; content: ''; }

.drawer-quickstart summary::before {
  content: '\25B8';
  display: inline-block;
  margin-right: 8px;
  font-size: 0.65rem;
  transition: transform 0.2s;
  color: var(--accent, #8b0000);
}

.drawer-quickstart[open] summary::before {
  transform: rotate(90deg);
}

.drawer-quickstart summary:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--ink, #1a1a1a);
}

.drawer-quickstart-content {
  padding: 0 20px 16px;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--ink-light, #444);
}

.drawer-quickstart-content table {
  font-size: 0.68rem;
  margin: 0.5rem 0 1rem;
  border: 1px solid var(--bg-dark, #d4ccb8);
}

.drawer-quickstart-content th {
  font-size: 0.62rem;
  padding: 0.35rem 0.5rem;
}

.drawer-quickstart-content td {
  padding: 0.3rem 0.5rem;
  font-size: 0.62rem;
}

.drawer-quickstart-content h3 {
  font-size: 0.82rem;
  margin: 1rem 0 0.4rem;
}

.drawer-quickstart-content ul {
  margin: 0.3rem 0 0.8rem;
}

.drawer-quickstart-content li {
  font-size: 0.78rem;
  margin-bottom: 0.3rem;
}

/* Drawer footer */
.drawer-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
  flex-shrink: 0;
}

.drawer-footer .lang-switch-drawer {
  display: flex;
  align-items: center;
  gap: 2px;
}

.drawer-footer .lang-switch-drawer a {
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink-faint, #888);
  padding: 5px 7px;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
}

.drawer-footer .lang-switch-drawer a:hover {
  color: var(--ink, #1a1a1a);
}

.drawer-footer .lang-switch-drawer a.current {
  color: var(--ink, #1a1a1a);
  background: rgba(0, 0, 0, 0.06);
}

.drawer-footer .lang-switch-drawer span {
  color: var(--ink-faint, #888);
  font-size: 0.55rem;
  opacity: 0.4;
}

.drawer-attrib {
  margin-top: 10px;
  font-size: 0.68rem;
  font-style: italic;
  color: var(--ink-faint, #888);
  line-height: 1.5;
}

.drawer-attrib a {
  color: var(--accent, #8b0000);
  font-size: 0.68rem;
}

/* ── DRAWER: LAYER CONTROLS (merged from former .layer-panel) ── */
.drawer-layers {
  border-top: 1px solid rgba(26, 26, 26, 0.08);
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.drawer-layers summary {
  display: block;
  padding: 12px 24px;
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-light, #444);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  list-style: none;
  user-select: none;
}

.drawer-layers summary::-webkit-details-marker { display: none; }
.drawer-layers summary::marker { display: none; content: ''; }

.drawer-layers summary::before {
  content: '\25B8';
  display: inline-block;
  margin-right: 8px;
  font-size: 0.65rem;
  transition: transform 0.2s;
  color: var(--accent, #8b0000);
}

.drawer-layers[open] summary::before {
  transform: rotate(90deg);
}

.drawer-layers summary:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--ink, #1a1a1a);
}

.drawer-layers-content {
  padding: 2px 20px 14px;
}

.drawer-zoom-btn {
  display: block;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(26, 26, 26, 0.22);
  background: transparent;
  border-radius: 0;
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.68rem;
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink, #1a1a1a);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, letter-spacing 0.25s;
  -webkit-tap-highlight-color: transparent;
}

.drawer-zoom-btn:hover {
  background: var(--accent, #8b0000);
  color: #f5ecd0;
  border-color: var(--accent, #8b0000);
  letter-spacing: 0.16em;
}

.drawer-layer-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink, #1a1a1a);
  text-align: left;
  transition: opacity 0.18s, background 0.15s, padding-left 0.2s;
  border-bottom: 1px dotted rgba(26, 26, 26, 0.14);
  -webkit-tap-highlight-color: transparent;
}

.drawer-layer-btn:last-child { border-bottom: none; }

.drawer-layer-btn:hover {
  background: rgba(0, 0, 0, 0.03);
  padding-left: 8px;
}

.drawer-layer-btn:not(.active) { opacity: 0.42; }

.drawer-layer-btn .swatch-bar {
  display: block;
  width: 24px;
  height: 5px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

.drawer-layer-btn .swatch-solid {
  display: block;
  width: 16px;
  height: 10px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.25);
  margin-left: 4px;
}

.drawer-layer-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-layer-state {
  flex-shrink: 0;
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.56rem;
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border: 1px solid currentColor;
  min-width: 28px;
  text-align: center;
}

.drawer-layer-btn.active .drawer-layer-state {
  color: var(--accent, #8b0000);
}
.drawer-layer-btn.active .drawer-layer-state .state-off { display: none; }
.drawer-layer-btn:not(.active) .drawer-layer-state {
  color: var(--ink-faint, #888);
}
.drawer-layer-btn:not(.active) .drawer-layer-state .state-on { display: none; }

/* Safety: hide any lingering old layer-panel (cached markup) */
.layer-panel { display: none !important; }

/* ── Bathymetry layer extras ── */

/* Subtle separator above the bathymetry section */
.drawer-layer-sep {
  height: 1px;
  margin: 8px 0 4px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(139, 0, 0, 0.18) 20%,
    rgba(139, 0, 0, 0.18) 80%,
    transparent 100%);
}

/* Isobath tooltip — small, neutral, non-intrusive */
.leaflet-tooltip.isobath-tip {
  background: rgba(255, 252, 245, 0.95);
  border: 1px solid rgba(2, 132, 199, 0.5);
  color: #075985;
  font-family: 'Lora', serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 1px 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}


/* ── MAP CONTROLS: extracted from mapa.html inline styles ── */

/* Layer panel (right side) */
.layer-panel {
  position: absolute;
  top: 54px;
  right: 10px;
  z-index: 1000;
  background: rgba(255, 252, 245, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.layer-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1.5px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink, #1c1c28);
  white-space: nowrap;
  transition: background 0.12s, opacity 0.12s;
}

.layer-btn:hover { background: rgba(0, 0, 0, 0.05); }
.layer-btn:not(.active) { opacity: 0.45; }

.layer-btn .swatch {
  width: 18px; height: 4px; border-radius: 2px; flex-shrink: 0;
}

.layer-btn .swatch-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}

.layer-btn .swatch-area {
  width: 14px; height: 10px; border-radius: 2px; flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.layer-sep { height: 1px; background: rgba(0, 0, 0, 0.1); margin: 2px 4px; }

.layer-zoom-btn {
  padding: 4px 10px;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  background: rgba(255, 252, 245, 0.9);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink, #1c1c28);
  text-align: center;
}

.layer-zoom-btn:hover { background: rgba(0, 0, 0, 0.05); }

/* Popups */
.leaflet-popup-content-wrapper {
  border-radius: 4px;
  font-family: var(--font, 'Lora', Georgia, serif);
}

.leaflet-popup-content {
  margin: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.leaflet-popup-content h3 {
  margin: 0 0 4px;
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 1rem;
  color: var(--lagoon-deep, #0e3b3b);
}

.leaflet-popup-content .tag {
  display: inline-block; padding: 1px 7px; border-radius: 3px;
  font-size: 0.7rem; font-family: inherit; font-weight: 500; margin-bottom: 4px;
}

.leaflet-popup-content .tag-blu { background: #1456a820; color: #0d3f7a; }
.leaflet-popup-content .tag-restricted { background: #6b3a8a20; color: #4a2668; }
.leaflet-popup-content .tag-other { background: #2878a820; color: #1a5c82; }
.leaflet-popup-content .tag-danger { background: #8b1a2b20; color: #5c1120; }
.leaflet-popup-content .dist { color: var(--ink-faint, #8a8a9a); font-size: 0.78rem; }

.leaflet-popup-content .restriction {
  margin-top: 4px; padding: 3px 6px; background: #fef3c7;
  border-radius: 3px; font-size: 0.72rem; color: #92400e;
}

/* Route panel (left side) */
.route-panel {
  position: absolute;
  top: 54px;
  left: 10px;
  z-index: 1000;
  background: rgba(255, 252, 245, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.8rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  width: 260px;
  color: var(--ink, #1c1c28);
}

.route-panel-title {
  font-weight: 600; font-size: 0.85rem; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
}

.route-panel-toggle {
  background: rgba(255, 252, 245, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  padding: 6px 10px;
  font-family: var(--font, 'Lora', Georgia, serif);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink, #1c1c28);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: absolute;
  top: 54px;
  left: 10px;
  z-index: 1001;
}

.route-panel-toggle:hover { background: rgba(236, 229, 216, 0.95); }
.route-panel.open ~ .route-panel-toggle { display: none; }
.route-panel:not(.open) { display: none; }

.route-panel .close-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--ink-faint, #8a8a9a);
  padding: 0 2px; line-height: 1;
}
.route-panel .close-btn:hover { color: var(--ink, #1c1c28); }

.route-input-wrap { position: relative; margin-bottom: 6px; }
.route-input-wrap label {
  display: block; font-size: 0.7rem; font-weight: 500;
  color: var(--ink-faint, #8a8a9a); margin-bottom: 2px;
}
.route-input-wrap input[type="text"] {
  width: 100%; box-sizing: border-box; padding: 6px 8px;
  border: 1.5px solid rgba(0, 0, 0, 0.2); border-radius: 4px;
  font-family: inherit; font-size: 0.8rem; background: #fff;
  color: var(--ink, #1c1c28); outline: none;
}
.route-input-wrap input:focus { border-color: var(--lagoon, #1b5e5e); }

.route-ac {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border: 1.5px solid rgba(0, 0, 0, 0.2);
  border-top: none; border-radius: 0 0 4px 4px;
  max-height: 160px; overflow-y: auto; z-index: 1002; display: none;
}
.route-ac.show { display: block; }

.route-ac-item {
  padding: 5px 8px; cursor: pointer; font-size: 0.78rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.route-ac-item:hover, .route-ac-item.active { background: rgba(236, 229, 216, 0.9); }
.route-ac-item .ac-type { font-size: 0.65rem; color: var(--ink-faint, #8a8a9a); margin-left: 4px; }

.route-options {
  display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; align-items: center;
}
.route-options .opt-label {
  font-size: 0.7rem; font-weight: 500;
  color: var(--ink-faint, #8a8a9a); width: 100%;
}

.boat-btn {
  flex: 1; padding: 5px 0; border: 1.5px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px; background: #fff; cursor: pointer;
  font-family: inherit; font-size: 0.75rem; font-weight: 500;
  text-align: center; color: var(--ink, #1c1c28); transition: all 0.15s;
}
.boat-btn.active {
  background: var(--lagoon, #1b5e5e); color: #fff;
  border-color: var(--lagoon-deep, #0e3b3b);
}

.route-time-row {
  display: flex; gap: 6px; align-items: center; margin-bottom: 8px;
}
.route-time-row input[type="time"],
.route-time-row select {
  padding: 4px 6px; border: 1.5px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px; font-family: inherit; font-size: 0.75rem;
  background: #fff; color: var(--ink, #1c1c28);
}
.route-time-row input[type="time"] { flex: 1; }
.route-time-row select { flex: 1; }

.route-actions { display: flex; gap: 6px; }

.route-go {
  flex: 1; padding: 7px 0; border: none; border-radius: 4px;
  background: var(--lagoon, #1b5e5e); color: #fff;
  font-family: inherit; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.route-go:hover { background: var(--lagoon-deep, #0e3b3b); }
.route-go:disabled { opacity: 0.5; cursor: default; }

.route-clear {
  padding: 7px 12px; border: 1.5px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px; background: #fff; font-family: inherit;
  font-size: 0.8rem; cursor: pointer; color: var(--ink, #1c1c28);
}
.route-clear:hover { background: rgba(236, 229, 216, 0.9); }

.route-result {
  margin-top: 8px; padding: 8px 10px;
  background: rgba(139, 92, 246, 0.08);
  border-radius: 4px; font-size: 0.8rem; line-height: 1.5; display: none;
}
.route-result.show { display: block; }
.route-result .result-dist { font-weight: 600; color: var(--lagoon-deep, #0e3b3b); }
.route-result .result-warn {
  margin-top: 4px; padding: 3px 6px; background: #fef3c7;
  border-radius: 3px; font-size: 0.72rem; color: #92400e;
}

.route-error {
  margin-top: 6px; padding: 6px 8px; background: #fef2f2;
  border-radius: 4px; font-size: 0.75rem; color: #991b1b; display: none;
}
.route-error.show { display: block; }

.route-hint {
  margin-top: 6px; font-size: 0.7rem;
  color: var(--ink-faint, #8a8a9a); font-style: italic;
}

/* Map page: no footer visible */
.map-page footer { display: none; }

/* SVG hatching defs */
.hatch-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── RESPONSIVE ── */

/* Desktop: route panel always visible */
@media (min-width: 801px) {
  .route-panel { display: block !important; }
  .route-panel-toggle { display: none !important; }
  .route-panel .close-btn { display: none; }
}

@media (max-width: 800px) {
  .route-panel:not(.open) { display: none; }
}

@media (max-width: 600px) {
  .map-topbar { height: 40px; }
  .map-topbar .map-brand { font-size: 0.82rem; }

  .layer-panel {
    top: 50px;
    font-size: 0.65rem;
    padding: 6px;
    gap: 2px;
  }
  .layer-btn { padding: 3px 6px; font-size: 0.65rem; gap: 5px; }

  .route-panel {
    top: 50px;
    width: calc(100vw - 20px);
    max-width: 280px;
    font-size: 0.75rem;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
  .route-panel-toggle { top: 50px; }
  .route-panel-title { font-size: 0.8rem; }

  .drawer { width: 280px; }

  .content-topbar { height: 40px; }
}

/* Content page: adjust scroll padding for new topbar height */
.content-page {
  scroll-padding-top: 3.5rem;
}

/* Content page: hide old nav (safety, in case any remain) */
.content-page > nav { display: none; }
