#sea-map-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--sea-glass-edge);
  border-radius: 12px;
  background: var(--sea-glass-light);
  color: var(--sea-ink);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  text-shadow: none;
}
#sea-map-button .sea-icon { width: 17px; height: 17px; color: var(--sea-blue); }
#sea-map-button:is(:hover, :active) { background: var(--sea-soft); }

#sea-app[data-panel="map"] .sea-sheet { width: min(100%, 920px); }
.sea-harbor-map {
  --sea-map-course: #b66d3e;
  --sea-map-paper: #e7dfbb;
  --sea-map-pin: #fffcf1;
  display: grid;
  align-items: start;
  gap: 18px;
}
.sea-map-visual, .sea-map-destinations { min-width: 0; }
.sea-map-chart {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #58756c47;
  border-radius: 20px;
  background: var(--sea-map-paper);
}
.sea-map-canvas { display: block; width: 100%; height: 100%; }
.sea-map-pin {
  position: absolute;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 1px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--sea-ink);
  transform: translate(-50%, -15px);
}
.sea-map-pin-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #5c6d644d;
  border-radius: 50%;
  background: var(--sea-map-pin);
  color: #234c54;
  box-shadow: 0 2px 5px #253f3b40;
}
.sea-map-pin-icon .sea-icon { width: 17px; height: 17px; }
.sea-map-pin-label {
  padding: 0 5px 1px;
  border-radius: 6px;
  background: var(--sea-map-pin);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.55;
  white-space: nowrap;
}
.sea-map-pin[aria-current="location"] .sea-map-pin-icon,
.sea-map-pin:is(:hover, :focus-visible, :active) .sea-map-pin-icon {
  border-color: var(--sea-blue);
  background: var(--sea-blue);
  color: var(--sea-surface);
}
.sea-map-pin:focus-visible { z-index: 3; outline-offset: 2px; }
.sea-map-self {
  position: absolute;
  z-index: 2;
  width: 16px;
  height: 16px;
  border: 3px solid var(--sea-surface);
  border-radius: 50%;
  background: var(--sea-blue);
  box-shadow: 0 0 0 2px #1746a3, 0 1px 4px #10243b4d;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.sea-map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  padding: 9px 2px 0;
  color: var(--sea-muted);
  font-size: 12px;
}
.sea-map-legend > span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.sea-map-legend-self::before {
  width: 11px;
  height: 11px;
  border: 2px solid var(--sea-surface);
  border-radius: 50%;
  background: var(--sea-blue);
  box-shadow: 0 0 0 1px #1746a3;
  content: "";
}
.sea-map-legend-sled::before {
  width: 13px;
  height: 10px;
  border: 1px solid var(--sea-map-course);
  border-radius: 2px;
  background: #c9854e60;
  content: "";
}
.sea-map-hint {
  margin: 0 0 10px;
  color: var(--sea-muted);
  font-size: 13px;
  line-height: 1.6;
  word-break: keep-all;
}
.sea-map-places {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.sea-map-choice {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 48px;
  padding: 6px 8px;
  border: 1px solid var(--sea-line);
  border-radius: 12px;
  background: var(--sea-glass-inner);
  color: var(--sea-ink);
  text-align: left;
}
.sea-map-choice .sea-icon { width: 18px; height: 18px; color: var(--sea-muted); }
.sea-map-choice-text { display: grid; gap: 1px; min-width: 0; line-height: 1.35; }
.sea-map-choice-text strong { font-size: 13px; font-weight: 650; word-break: keep-all; overflow-wrap: anywhere; }
.sea-map-choice-text small { color: var(--sea-muted); font-size: 11px; word-break: keep-all; }
.sea-map-choice:is(:hover, :active, [aria-current="location"]) { border-color: #1755e84a; background: var(--sea-soft); }
.sea-map-choice[aria-current="location"] .sea-icon { color: var(--sea-blue); }
.sea-map-choice:focus-visible { outline-offset: 1px; }

@media (min-width: 680px) {
  .sea-harbor-map { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(18px, 3vw, 30px); }
  .sea-map-chart { max-width: min(100%, max(280px, calc(var(--sea-overlay-height, 100dvh) - 172px))); }
  .sea-map-choice { min-height: 60px; gap: 9px; padding: 9px 10px; }
  .sea-map-choice-text strong { font-size: 14px; }
  .sea-map-choice-text small { font-size: 12px; }
  .sea-map-hint { font-size: 14px; }
  .sea-map-legend { font-size: 13px; }
}
@media (min-width: 960px) and (min-height: 400px) and (hover: hover) and (pointer: fine) {
  #sea-map-button { margin-left: auto; background: var(--sea-glass-inner); }
  #sea-map-button:is(:hover, :active) { background: var(--sea-soft); }
  #sea-app .sea-place-stack .sea-zone-line { width: 100%; }
  #sea-zone { min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
}
@media (max-width: 679px) and (orientation: portrait) {
  #sea-app[data-panel="map"] .sea-sheet { max-height: calc(var(--sea-overlay-height, 100dvh) - 12px); }
  .sea-map-chart { max-width: min(100%, max(260px, calc(var(--sea-overlay-height, 100dvh) - 300px))); margin-inline: auto; }
}
@media (max-width: 599px), (pointer: coarse), (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  #sea-zone { min-width: 0; }
  #sea-map-button {
    padding-inline: 9px;
    box-shadow: var(--sea-glass-shadow);
    -webkit-backdrop-filter: var(--sea-frost);
    backdrop-filter: var(--sea-frost);
  }
}
@media (max-height: 500px) and (min-width: 560px) and (orientation: landscape) {
  #sea-app[data-panel="map"] #sea-sheet-cover {
    --sea-map-top: max(8px, env(safe-area-inset-top));
    --sea-map-bottom: max(8px, env(safe-area-inset-bottom));
    align-items: center;
    padding: var(--sea-map-top) max(8px, env(safe-area-inset-right)) var(--sea-map-bottom) max(8px, env(safe-area-inset-left));
  }
  #sea-app[data-panel="map"] .sea-sheet { max-height: calc(var(--sea-overlay-height, 100dvh) - var(--sea-map-top) - var(--sea-map-bottom)); border-radius: 23px; }
  #sea-app[data-panel="map"] .sea-sheet-header { padding-block: 8px; }
  .sea-harbor-map { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sea-map-chart { max-width: min(100%, max(226px, calc(var(--sea-overlay-height, 100dvh) - 132px))); margin-inline: auto; }
  .sea-map-choice { min-height: 44px; padding: 5px 8px; }
  .sea-map-legend { justify-content: center; }
}
@media (max-width: 355px) {
  #sea-map-button { padding-inline: 7px; gap: 4px; }
  .sea-map-choice { padding-inline: 6px; gap: 6px; }
  .sea-map-choice .sea-icon { width: 16px; height: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  #sea-map-button, .sea-map-pin, .sea-map-choice { transition: none; }
}
