/* Closed controls occupy one native 44px disclosure row. */
.sea-chart-controls{min-width:0;width:100%;box-sizing:border-box;border:1px solid var(--line,#40535e);border-radius:10px;background:#162630;color:#edf5f8;font:600 12px/1.35 system-ui,sans-serif}
.sea-chart-controls>summary{box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:8px 10px;cursor:pointer;list-style:none;touch-action:manipulation}
.sea-chart-controls>summary::-webkit-details-marker{display:none}
.sea-chart-controls>summary::after{content:'⌄';flex:none;font-size:17px;line-height:1}
.sea-chart-controls[open]>summary::after{transform:rotate(180deg)}
.sea-chart-controls>summary>b{min-width:0;font-size:12px;overflow-wrap:anywhere}
.sea-chart-controls>summary>span{margin-left:auto;color:#b5cad5;text-align:right;font-size:10px;font-variant-numeric:tabular-nums;white-space:normal}
.sea-chart-controls .sea-chart-control-body{display:grid;gap:8px;padding:3px 10px 10px;min-width:0}
.sea-chart-controls label{display:block;min-width:0;margin:0}
.sea-chart-controls label>span{display:flex;justify-content:space-between;gap:8px;align-items:baseline;font:650 12px/1.4 system-ui,sans-serif}
.sea-chart-controls output{flex:none;color:#d9eff7;font-variant-numeric:tabular-nums}
.sea-chart-controls input[type=range]{display:block;box-sizing:border-box;width:100%;min-width:0;height:44px;min-height:44px;margin:0;accent-color:#83dbcf;touch-action:pan-y;cursor:ew-resize}
.sea-chart-controls .sea-chart-presets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;min-width:0}
.sea-chart-controls .sea-chart-presets button{appearance:none;display:block;box-sizing:border-box;min-width:0;width:100%;height:auto;min-height:44px;padding:6px 4px;margin:0;border:1px solid #4b6674;border-radius:8px;background:#233a47;color:#ecf8fd;font:650 11px/1.25 system-ui,sans-serif;white-space:normal;overflow-wrap:anywhere;touch-action:manipulation;cursor:pointer}
.sea-chart-controls .sea-chart-presets button[aria-pressed=true]{border-color:#81dccc;background:#1e4b52}
.sea-chart-controls p{margin:0;color:#afc4d0;font:500 10px/1.45 system-ui,sans-serif;white-space:normal}
.sea-chart-controls :is(summary,button,input):focus-visible{outline:2px solid #8ae5d5;outline-offset:2px}
/* The visibility disclosure remains reachable while the optional catalogue
   actions are collapsed. Its open content scrolls within the map controls. */
html body #atlasModePeek.atlas-mode-peek:has(.sea-chart-controls){height:auto!important;max-height:min(58dvh,420px)!important;padding:0 8px 7px!important;overflow:auto!important}
html body #atlasModePeek.atlas-mode-peek:has(.sea-chart-controls) .atlas-mode-peek-body{display:grid!important;grid-template-columns:minmax(0,1fr) 44px;align-items:center!important;gap:5px!important;height:auto!important;padding:0!important;overflow:visible!important}
html body #atlasModePeek:has(.sea-chart-controls) .sea-chart-controls,html body #atlasModePeek:has(.sea-chart-controls) .atlas-peek-extra{grid-column:1 / -1}
html body #atlasModePeek:has(.sea-chart-controls) .atlas-peek-more{min-width:44px;min-height:44px;height:44px}
html body #atlasModePeek:has(.sea-chart-controls) .atlas-slim-chips{min-width:0;width:100%}
.sea-forecast-menu { display: inline-block; max-width: 100%; }
.sea-forecast-menu > summary {
  min-height: 36px; padding: 8px 12px; box-sizing: border-box; cursor: pointer;
  color: #edf7fb; background: #132b38; border: 1px solid #4e6978; border-radius: 9px;
  font: 700 13px/1.4 system-ui, sans-serif; white-space: nowrap;
}
.sea-forecast-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; margin-top: 6px; }
.sea-forecast-options > button { min-height: 38px; padding: 5px 8px; white-space: normal; }
.sea-forecast-options > button[aria-pressed="true"] { background: #edf7fb; color: #112b38; }
/* An open forecast list needs the sheet's vertical scroll area. */
html body #atlasModePeek:has(.sea-forecast-menu[open]) .atlas-mode-peek-body { align-items: start !important; }
html body #atlasModePeek .atlas-slim-chips:has(.sea-forecast-menu[open]) { height: auto; overflow: visible; }
html body #atlasModePeek .sea-forecast-menu[open] { width: 100%; min-width: 0; }
html body #atlasModePeek .sea-forecast-menu[open] + .atlas-peek-legend { display: none; }
html body #atlasModePeek .sea-forecast-menu .sea-forecast-options > button {
  min-height: 44px; height: auto; padding: 5px 8px; white-space: normal; overflow-wrap: anywhere;
}
@media (orientation: landscape) and (max-height: 360px) {
  .sea-forecast-options { grid-template-columns: repeat(4,minmax(0,1fr)); }
  html body #atlasModePeek.atlas-mode-peek:has(.sea-forecast-menu[open]) {
    max-height: min(clamp(142px, 58dvh, 420px), calc(100dvh - var(--atlas-mode-peek-bottom, 52px) - 8px)) !important;
    overscroll-behavior-y: contain;
  }
}

.atlas-vitar-button {
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid #ffe290;
  border-radius: 10px;
  background: #ffebb3;
  color: #172737;
  font: 750 14px system-ui, sans-serif;
  touch-action: manipulation;
  cursor: pointer;
}
html body #atlasModePeek .atlas-slim-chips .atlas-vitar-button { min-height: 44px; height: 44px; }
html body #atlasModePeek .atlas-slim-chips:has(.sea-forecast-menu[open]) .atlas-vitar-button { display: none; }
#atlasVitarDesktop { position: absolute; top: 68px; right: 24px; z-index: 20; }
#atlasVitarDesktop[hidden], #atlasLighthouseBrowser[hidden] { display: none !important; }
#atlasLighthouseBrowser:not([hidden]) { display: flex; }
#atlasLighthouseBrowser h2 { margin: 0; }
#atlasLighthouseBrowser .atlas-lighthouse-toggle { display: flex; align-items: center; min-height: 44px; gap: 8px; }
#atlasLighthouseToggle { width: 22px; height: 22px; accent-color: #83dbcf; }
#atlasLighthouseSearch { min-width: 0; min-height: 44px; padding: 4px 10px; font-size: 16px; }
#atlasLighthouseList { display: grid; align-content: start; gap: 4px; margin-top: 8px; }
#atlasLighthouseList button, .atlas-lighthouse-actions :is(button,a) {
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid var(--line,#45606d);
  border-radius: 9px;
  color: var(--ink,#e8f1f7);
  background: #193440;
  text-align: start;
  touch-action: manipulation;
}
#atlasLighthouseList button { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#atlasLighthouseList button span { flex: none; color: #c2d3dd; }
.atlas-lighthouse-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.atlas-lighthouse-actions a { display: inline-flex; align-items: center; }
#atlasLighthouseCredit { font-size: 12px; }
@media (orientation: landscape) and (max-height: 310px) {
  html.atlas-phone-shell body[data-phone-tab="sea"] #atlasModePeek.atlas-mode-peek:has(.sea-chart-controls) {
    inset: auto auto var(--atlas-sea-tab-inset,44px) max(8px, env(safe-area-inset-left)) !important;
    width: min(320px, 42vw) !important;
    max-height: min(58dvh, calc(100dvh - var(--atlas-sea-tab-inset,44px) - 48px)) !important;
    border-radius: 12px !important;
  }
  html.atlas-phone-shell body[data-phone-tab="sea"] #weatherGraphSystem#weatherGraphSystem#weatherGraphSystem[data-dock-mode="collapsed"] {
    left: min(336px, 44vw) !important;
    right: max(8px,env(safe-area-inset-right)) !important;
    width: auto !important;
    margin: 0 !important;
    transform: none !important;
  }
  html.atlas-phone-shell body[data-phone-tab="sea"] #atlasModePeek .sea-forecast-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
