/* Map controls and markers */
.map-tools { position: absolute; top: 12px; right: 12px; z-index: 800; display: flex; flex-direction: column; gap: 8px; }
.map-btn {
  width: var(--touch); height: var(--touch); display: grid; place-items: center; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: var(--shadow-1);
}
.map-btn:hover { background: var(--surface-2); }
/* Profile and chart crew share one top-right group. */
.map-identity { position: absolute; top: 12px; right: 12px; z-index: 820; display: flex; align-items: center; gap: 0; height: var(--touch); }
  .map-acct { position: relative; z-index: 2; display: grid; place-items: center; overflow: hidden; flex: none;
    width: var(--touch); height: var(--touch); padding: 0; line-height: 1; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text);
    box-shadow: var(--shadow-1); font-size: 14px; font-weight: 600; letter-spacing: .02em; text-decoration: none; -webkit-tap-highlight-color: transparent; }
  .map-acct.acct-avatar { background: var(--primary); color: var(--bg); border-color: transparent; }
  .map-acct img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .map-acct .icon { width: 20px; height: 20px; }
@media (max-width: 1023px) {
  .map-identity { top: 10px; right: 10px; }
  .mapwrap .map-chain-b { overflow: hidden; text-overflow: ellipsis; }
}
.map-btn[aria-pressed="true"] { color: var(--primary-text); background: var(--primary-soft); }

.map-float {
  position: absolute; left: 12px; bottom: 28px; z-index: 800; width: min(280px, calc(100% - 24px));
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1); padding: 10px 12px; font-size: 13px;
}
.map-float .field-label { font-size: 12.5px; }
.map-float input[type="range"] { width: 100%; accent-color: var(--primary); }
.legend { max-height: 220px; overflow-y: auto; margin-top: 6px; }
.legend-h { font-weight: 700; color: var(--text-2); margin: 8px 0 2px; font-size: 12px; }
.legend-i { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.legend-i img { width: 16px; height: 16px; flex: none; }
.map-offline-note { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-2); z-index: 400; padding: 24px; text-align: center; }

/* layer chooser */
.layer-group { display: flex; flex-direction: column; gap: var(--s2); }
.layer-opt { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); cursor: pointer; background: var(--surface); }
.layer-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.layer-opt input { grid-row: span 2; margin-top: 3px; width: 20px; height: 20px; accent-color: var(--primary); }
.layer-opt .t { font-weight: 650; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.layer-opt .d { font-size: 13px; color: var(--text-2); }

/* markers */
/* GPS check: white diamond with a black outline (a thin white halo keeps it visible on dark maps) */
.check-marker div { width: 13px; height: 13px; transform: rotate(45deg); background: #fff; border: 2.5px solid #111; box-shadow: 0 0 0 1.5px rgba(255,255,255,.9), 0 1px 3px rgba(0,0,0,.35); box-sizing: border-box; }
.check-marker.off div { opacity: .4; }
.me-marker { width: 18px; height: 18px; border-radius: 50%; background: #1b74e4; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(27,116,228,.35), 0 0 0 10px rgba(27,116,228,.15); }

/* Leaflet theming */
.leaflet-container { font: inherit; background: var(--surface-3); }
/* Tiles overlap by 1 px to hide seams (TILE_PAD in js/app/map.js). Leaflet's own seam fix blends image tiles with
   plus-lighter, which adds the overlapping strip twice and draws solid white grid lines; draw tiles normally. */
.leaflet-container img.leaflet-tile { mix-blend-mode: normal; }
.leaflet-container .leaflet-bar a, .leaflet-container .leaflet-bar a:hover, .leaflet-container .leaflet-bar a:focus { width: var(--touch); height: var(--touch); line-height: var(--touch); background: var(--surface); color: var(--text); border-color: var(--line); }
.leaflet-container .leaflet-bar a:hover { background: var(--surface-2); }
.leaflet-bar { border: 1px solid var(--line) !important; box-shadow: var(--shadow-1) !important; border-radius: var(--r-sm) !important; overflow: hidden; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13.5px; line-height: 1.5; }
.leaflet-popup-content b { font-size: 14.5px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-2); width: 32px; height: 32px; font-size: 22px; }
.leaflet-tooltip { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: var(--shadow-1); }
.leaflet-control-attribution { font-size: 10.5px; max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leaflet-control-attribution:hover { white-space: normal; }
.leaflet-control-scale-line { background: rgba(255,255,255,.8); }

@media (max-width: 1023px) {
  .map-float { bottom: 20px; }
  .map-tools { top: 10px; right: 10px; }
  /* Mobile/PWA already fills its app window; fullscreen remains a desktop tool. */
  .mapwrap .map-btn[data-t="full"] { display: none !important; }
}
/* Tools panel collapse button, with a divider before the layers button */
.map-tools-divider { height: 1px; margin: 2px 6px; background: var(--line-strong); }
@media (max-width: 1023px) { .aux-map-btn, .map-tools-divider, .map-btn[data-aux-tab] { display: none !important; } }
.mapwrap:fullscreen{width:100%;height:100%;background:var(--bg)} .mapwrap.map-fs{position:fixed!important;inset:0!important;width:100vw!important;height:100vh!important;z-index:2147483000!important;border-radius:0!important;background:var(--bg)} .mapwrap:fullscreen #map,.mapwrap.map-fs #map{width:100%;height:100%}
/* Map converter: button near bottom right, popup beside it, centred draft pin */
.mc-btn { position: relative; }
.aux-map-btn { display: none !important; }
.mc-pop { position: absolute; right: calc(12px + var(--touch) + 10px); bottom: 40px; z-index: 801; width: min(260px, calc(100% - 90px)); max-height: calc(100% - 60px); overflow-y: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 12px 14px; font-size: 13.5px; }
.mc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mc-x { background: none; border: 0; color: var(--text-2); font-size: 22px; line-height: 1; width: 32px; height: 32px; cursor: pointer; }
.mc-kv { margin: 0 0 10px; }
.mc-mode { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.mc-mode label { display: flex; gap: 8px; align-items: flex-start; }
.mc-mode input { accent-color: var(--primary); margin-top: 3px; }
.mc-pin { position: absolute; left: 50%; top: 50%; width: 30px; height: 40px; margin: -40px 0 0 -15px; z-index: 790; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.mc-pin svg { width: 100%; height: 100%; }
.mc-pin path { fill: var(--primary); stroke: #fff; stroke-width: 1.5; }
.mc-pin circle { fill: #fff; }
.mc-pin::after { content: ""; position: absolute; left: 50%; bottom: -3px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px #fff; }
.mc-placement .mc-position { margin-bottom: var(--s3); color: var(--text-2); font-size: 13px; }
.mc-placement .btn-row { display: flex; gap: var(--s2); flex-wrap: wrap; }
.mc-placement .btn { min-height: var(--touch); }
.mc-placement .mc-head .btn { flex-shrink: 0; }
.mc-visual .leaflet-grab, .mc-visual .leaflet-interactive { cursor: crosshair; }
@media (max-width: 1023px) { .mapwrap .mc-placement { bottom: 12px; } .mc-placement .btn-row > .btn { flex: 1; } }
@media (max-width: 1023px) { .mc-pop { right: 10px; left: 10px; width: auto; bottom: 84px; } }
.mc-pop.mc-wide { width: min(440px, calc(100% - 90px)); padding: 10px 12px; }
.mc-pop.mc-wide .mc-head { margin-bottom: 4px; }
.mc-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: start; }
.mc-form .field > span:first-child { font-size: 12px; }
.mc-form .hint { font-size: 11px; }
.mc-form .hint.is-ok { color: var(--ok); }
.mc-form .hint.is-bad { color: var(--danger); font-weight: 600; }
.mc-go { margin-top: 20px; white-space: nowrap; }
@media (max-width: 1023px) { .mc-pop.mc-wide { width: auto; } .mc-form { grid-template-columns: 1fr 1fr; } .mc-go { grid-column: span 2; margin-top: 0; } }
.mc-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 3px; margin-bottom: 8px; background: var(--surface-2); border-radius: var(--r-sm); }
.mc-tabs button { border: 0; background: none; color: var(--text-2); padding: 6px 8px; border-radius: calc(var(--r-sm) - 2px); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.mc-tabs button[aria-selected="true"] { background: var(--surface); color: var(--primary-text); box-shadow: var(--shadow-1); }
.mc-loc { margin-top: 6px; }
.mc-note { margin: 6px 0 0; color: var(--text-2); }
.mc-warn { color: var(--warn, #b45309); }
.mc-pop .mc-form input[name="la"], .mc-pop .mc-form input[name="lo"] { font-size: 13px !important; padding-left: 8px !important; padding-right: 6px !important; letter-spacing: 0 !important; }
.layers-pop { width: min(320px, calc(100% - 90px)); max-height: calc(100% - 100px); overflow-y: auto; scrollbar-width: none; }
.layers-pop::-webkit-scrollbar { display: none; }
.layers-pop > .mc-head { position: sticky; top: -12px; z-index: 2; margin: -12px -14px 8px; padding: 12px 14px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.layers-pop .layer-opt { padding: 8px 10px; }
.layers-pop .layer-opt .d { font-size: 12px; }
@media (max-width: 1023px) { .layers-pop { left: 10px; right: 10px; width: auto; top: auto !important; bottom: 10px !important; max-height: calc(100% - 100px); } }

/* Region banner: top centre, just under the chart picker when there is one (its text length varies, so it gets the
   full width between the corner buttons rather than sharing the bottom edge with the scale) */
body.has-charts .map-chain { top: 50px; }
.map-chain{position:absolute;top:10px;left:50%;transform:translateX(-50%);z-index:800;pointer-events:none;
  display:flex;flex-direction:column;align-items:center;gap:4px}
.mapwrap .map-chain-b { max-width: calc(100% - 144px); overflow: hidden; text-overflow: ellipsis; }
.mapwrap .map-chain { width: 100%; }
.map-chain-b{padding:4px 14px;border-radius:999px;font-size:12px;font-weight:500;letter-spacing:.06em;white-space:nowrap;
  background:var(--surface,hsl(var(--background)));color:var(--text,hsl(var(--foreground)));
  border:1px solid var(--border-color,hsl(var(--border)));box-shadow:0 1px 4px rgba(0,0,0,.15)}
.map-chain-sub{font-size:11px;padding:3px 12px;color:var(--text-2,var(--text))}








#view > div:has(> .lists-signin) { flex: 1; display: flex; flex-direction: column; }
/* Layer list: online-only (cloud) / works offline (crossed cloud) icon after the name */
.layers-pop .lay-av { width: 15px; height: 15px; vertical-align: -3px; margin-left: 4px; opacity: .65; flex: none; }
/* Layer list: no radio/checkbox marks — the highlighted row shows what's selected */
.layers-pop .layer-opt { grid-template-columns: 1fr; position: relative; }
.layers-pop .layer-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.layers-pop .layer-opt:hover { border-color: var(--primary); }
.layers-pop .layer-opt:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.layers-pop .layer-opt:has(input:checked) .t { color: var(--primary); }
/* Layer list: square map preview on the left of each option */
.layers-pop .layer-opt { grid-template-columns: 40px 1fr; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; }
.layers-pop .lay-th { width: 40px; height: 40px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line-strong);
  background: var(--surface-2, var(--line)) url('https://server.arcgisonline.com/ArcGIS/rest/services/Ocean/World_Ocean_Base/MapServer/tile/11/878/563') center / cover; }
.layers-pop .lay-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Layer list: more breathing room between rows and sections */
.layers-pop .layer-group { gap: 10px; }
.layers-pop .layer-opt { gap: 12px; padding: 8px 12px 8px 8px; }
.layers-pop .layer-group + h3, .layers-pop h3, .layers-pop .field-label { margin-top: 14px; margin-bottom: 8px; }
.layers-pop .section-label { margin: 16px 0 8px; } .layers-pop .section-label:first-of-type { margin-top: 10px; }
/* Layer list: provider + availability line under the name */
.layers-pop .layer-opt { grid-template-columns: 40px 1fr; grid-template-rows: auto auto; row-gap: 2px; }
.layers-pop .lay-th { grid-row: span 2; }
.layers-pop .lay-meta { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-2); }
.layers-pop .lay-meta .lay-av { margin-left: 0; width: 13px; height: 13px; vertical-align: 0; }

.map-btn[data-aux-tab][aria-pressed="true"], .map-btn[data-chart-set][aria-pressed="true"] { color: var(--primary); }
.pop-info { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-weight: 500; } .pop-info .icon { width: 18px; height: 18px; }

/* Shared map datasets (js/app/datasets.js): wrecks, obstructions, rocks ... */
.layers-pop .layer-opt.is-off { opacity: .6; cursor: default; }
.ds-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 4px 10px; }
.ds-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12px; cursor: pointer; background: var(--surface); }
.ds-chip:has(input:checked) { border-color: var(--accent); }
.ds-chip input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }
.ds-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.ds-low { display: flex; align-items: center; gap: 8px; margin-top: var(--s2); font-size: 13px; cursor: pointer; }
.ds-low input { width: 18px; height: 18px; accent-color: var(--primary); }
.ds-legend { display: flex; gap: 14px; margin: var(--s2) 0 2px; color: var(--text-2); }
.ds-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ds-dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--text-2); display: inline-block; }
.ds-dot.high { background: var(--text-2); }
.ds-dot.medium { background: color-mix(in srgb, var(--text-2) 45%, transparent); }
.ds-dot.low { border-style: dashed; }
.ds-cluster { display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 2px solid var(--text-2); color: var(--text); font: 600 12px/1 var(--mono); box-shadow: var(--shadow-2); }
/* Dataset hint ("Zoom in to see …"): below the chart picker and region banner so nothing covers it; wraps when long */
body.has-charts .ds-hint { top: 86px; }
.mapwrap .ds-hint { max-width: calc(100% - 2 * (var(--touch) + 22px)); width: max-content; text-align: center; line-height: 1.35; border-radius: 14px; }
.ds-hint { position: absolute; top: 46px; left: 50%; transform: translateX(-50%); z-index: 500; padding: 6px 12px; border-radius: 999px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); font-size: 12.5px; box-shadow: var(--shadow-2); pointer-events: none; }
.ds-pop { min-width: 210px; }
.ds-kind { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.ds-rate { display: inline-block; margin: 6px 0 2px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.ds-rate.ds-high { background: var(--ok-soft, #12302a); color: var(--ok, #34d399); }
.ds-rate.ds-medium { background: var(--warn-soft); color: var(--warn); }
.ds-rate.ds-low { background: var(--danger-soft); color: var(--danger); }
.ds-rows { margin-top: 8px; border-top: 1px solid var(--line); }
.ds-row { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.ds-row > span:first-child { color: var(--text-2); }
.ds-nav { margin-top: 6px; color: var(--text-2); }
.layers-pop .ds-th { display: flex; align-items: center; justify-content: center; gap: 3px; background: var(--surface-2); }
.layers-pop .ds-th i { width: 8px; height: 8px; border-radius: 50%; }
.ds-warn { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.leaflet-container a.leaflet-popup-close-button { display: none !important; }
.dp-line { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }

/* Right-click menu on the map (js/app/mapmenu.js) */
.ctx-menu { position: absolute; z-index: 1000; min-width: 230px; max-width: calc(100% - 12px); padding: 6px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); display: flex; flex-direction: column; font-size: 13.5px; }
.ctx-head { padding: 6px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; line-height: 1.45; }
.ctx-head .mono { font-size: 12.5px; }
.ctx-head .ctx-spot { font-weight: 700; font-size: 13.5px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.ctx-menu [role=menuitem] { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 10px; border: 0; background: none; color: inherit;
  border-radius: var(--r-sm); text-align: left; font: inherit; cursor: pointer; }
.ctx-menu [role=menuitem] svg, .ctx-noicon { width: 16px; height: 16px; flex: none; }
.ctx-menu [role=menuitem]:hover, .ctx-menu [role=menuitem]:focus-visible { background: var(--surface-2); outline: none; }
.ctx-menu [role=menuitem]:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.ctx-menu [aria-disabled=true] { opacity: .5; cursor: default; }
.ctx-menu [aria-disabled=true]:hover { background: none; }
.ctx-sep { height: 1px; margin: 4px 6px; background: var(--line); }
@media (pointer: coarse) { .ctx-menu [role=menuitem] { min-height: var(--touch); } }

/* Measure distance (js/app/measure.js) */
.ms-adding, .ms-adding .leaflet-grab, .ms-adding .leaflet-interactive { cursor: crosshair; }
.ms-pt { background: #fff; border: 2px solid #E0A526; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.4); cursor: move; }
.ms-pt.ms-start { background: #E0A526; }
.leaflet-tooltip.ms-tip { font: 600 11.5px var(--mono); padding: 2px 6px; border-radius: 6px; background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: var(--shadow-1); }
.leaflet-tooltip.ms-tip::before { display: none; }
.leaflet-tooltip.ms-live { opacity: .92 !important; }
.ms-panel { position: absolute; top: 12px; left: 12px; z-index: 801; width: min(280px, calc(100% - 84px)); max-height: calc(100% - 24px); overflow-y: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 10px 12px; font-size: 13px; }
.ms-head { display: flex; align-items: center; gap: 8px; margin: -4px -6px 4px 0; }
.ms-head .ms-units { margin: 0 0 0 auto; }
.ms-total { font-size: 14px; margin-bottom: 6px; }
.ms-total b { font-size: 16px; }
.ms-legs { list-style: none; margin: 0 0 8px; padding: 0; max-height: 132px; overflow-y: auto; border-top: 1px solid var(--line); }
.ms-legs li { display: grid; grid-template-columns: 3.2em 1fr auto; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.ms-units { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.ms-units button { border: 0; background: none; color: inherit; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.ms-units button[aria-pressed=true] { background: var(--primary); color: var(--on-primary); }
.ms-btns { gap: 6px; flex-wrap: wrap; }
.ms-hint { margin: 8px 0 0; }
@media (max-width: 1023px) {
  /* phones: left side, below the profile button, chart picker and region banner (max-height keeps it off the + button) */
  .ms-panel { top: 64px; left: 10px; width: min(270px, calc(100% - 76px)); max-height: calc(100% - 64px - 80px); padding: 8px 10px; }
  body.has-charts .ms-panel { top: 86px; max-height: calc(100% - 86px - 80px); }
  .ms-hint { display: none; }
  .ms-legs { max-height: 62px; }
  .ms-total { margin-bottom: 4px; }
}

/* Routes: plotting toolbar (centre-left), plotting panel, numbered points (js/app/routeplot.js, views/routes.js) */
.rt-tools { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); z-index: 802; display: flex; flex-direction: column; gap: 8px; }
.rt-tools .map-btn[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.rt-tools .map-btn:disabled { opacity: .45; cursor: default; }
.rt-tools .map-tools-divider { margin: 0 6px; }
.rt-adding, .rt-adding .leaflet-grab, .rt-adding .leaflet-interactive { cursor: crosshair; }
.rt-panel { position: absolute; top: 12px; left: calc(12px + var(--touch) + 12px); z-index: 801; width: min(300px, calc(100% - 2 * (var(--touch) + 24px)));
  max-height: calc(100% - 24px); overflow-y: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-2); padding: 10px 12px; font-size: 13px; }
.rt-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.rt-name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: inherit; }
.rt-speed { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); }
.rt-speed input { width: 52px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; text-align: right; }
.rt-stats { font-size: 13px; margin-bottom: 6px; }
.rt-stats b { font-size: 15px; }
.rt-hint { margin: 4px 0 0; }
.rt-sel-box { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.rt-sel-box input { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; }
.rt-sel-box .btn-row { gap: 6px; flex-wrap: wrap; }
.rt-pt span { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #111;
  border: 2px solid var(--rt, #E0A526); font: 700 11px/1 var(--font-ui); box-shadow: 0 1px 3px rgba(0,0,0,.45); box-sizing: border-box; }
.rt-pt.rt-edit span { cursor: move; }
.rt-pt.rt-snapped span { background: var(--rt, #E0A526); color: #fff; }
.rt-pt.rt-sel span { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--primary); }
.rt-editing .ms-panel, body.has-charts .rt-editing .ms-panel { top: auto; bottom: 28px; max-height: calc(100% - 140px); }   /* route plotting: bottom; beats the phone top position */
.rt-row { display: flex; align-items: center; gap: 4px; padding-right: 8px; }
.rt-row-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; padding: 10px 12px; }
@media (max-width: 1023px) {
  .rt-tools { left: 10px; gap: 6px; }
  .rt-panel { top: 10px; left: calc(10px + var(--touch) + 8px); width: calc(100% - 2 * (var(--touch) + 18px)); padding: 8px 10px; }
  .rt-hint { display: none; }
}
/* Routes step 2: marks, symbol picker, bearing line, range rings */
.rt-tools { max-height: calc(100% - 24px); flex-wrap: wrap; align-content: flex-start; }
.rt-placing, .rt-placing .leaflet-grab, .rt-placing .leaflet-interactive { cursor: crosshair; }
.rt-mk span { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.92);
  box-shadow: 0 1px 4px rgba(0,0,0,.45); box-sizing: border-box; }
.rt-mk.rt-edit span { cursor: move; }
.rt-mk.rt-sel span { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--primary); }
.rt-syms { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; }
.rt-syms button { display: flex; align-items: center; justify-content: center; height: 34px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; cursor: pointer; padding: 0; }
.rt-syms button[aria-checked="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.rt-syms button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.rt-tool-box { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.rt-tool-hint { border-top: 1px solid var(--line); padding-top: 8px; }
.rt-row2 { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; }
.rt-in { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); }
.rt-in input, .rt-in select { width: 64px; padding: 5px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; }
.rt-in select { width: auto; }
.rt-tool-box .ms-units { margin: 0; }
.rt-bend { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid #0a6788; box-shadow: 0 1px 3px rgba(0,0,0,.4); box-sizing: border-box; cursor: move; }
.ms-legs li { grid-template-columns: 3.2em auto 1fr; }
.ms-legs li span:last-child { text-align: right; }
@media (max-width: 1023px) {
  .rt-syms { grid-template-columns: repeat(8, 1fr); } .rt-syms button { height: 30px; }
  .rt-panel { width: auto; right: calc(10px + var(--touch) + 8px); }   /* left follows the toolbar (routeplot.js) */
}
.rt-marks { list-style: none; margin: 0; padding: 0; }
.rt-marks li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rt-marks li:last-child { border-bottom: 0; }
.rt-label { width: 0; height: 0; }
.rt-label span { position: absolute; left: 0; top: 0; white-space: nowrap; pointer-events: none; border: 1px solid var(--line); }
.rt-label-center span { transform: translate(-50%, -50%); }
.rt-label-right span { transform: translate(14px, -50%); }
.rt-label .rt-leg { font-size: 10.5px; padding: 1px 5px; opacity: .92; }
.rt-label .rt-ring { font-size: 10px; padding: 0 4px; }
.rt-label .rt-mk-label { font-size: 11px; padding: 1px 5px; }
.rt-label span { font: 600 11px var(--mono); background: var(--surface); color: var(--text); border-radius: 6px; box-shadow: var(--shadow-1); padding: 2px 6px; }
.rt-label span.rt-ring { color: var(--text); border-color: #0a6788; }
.rt-legs { list-style: none; margin: 10px 0 0; padding: 0; }
.rt-legs li { padding: 8px 0; border-top: 1px solid var(--line); }
.rt-leg-name { font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.rt-leg-n { flex: none; min-width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.rt-leg-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0 0 calc(1.6em + 8px); font-size: 12.5px; }
.rt-export { margin-top: 10px; gap: 6px; flex-wrap: wrap; }

/* Map + / - buttons: hidden unless turned on in Settings > Display, per layout (map.js zoomPrefs; phone layout = up to 1023px) */
.mapwrap .leaflet-control-zoom { display: none; }
@media (max-width: 1023px) { .mapwrap.zoom-btn-phone .leaflet-control-zoom { display: block; } }
@media (min-width: 1024px) { .mapwrap.zoom-btn-desktop .leaflet-control-zoom { display: block; } }
/* GPS check on top of a spot (map.js drawChecks): smaller diamond beside the spot's dot instead of over it */
.check-marker.check-badge div { width: 11px; height: 11px; border-width: 2px; }

/* "+" add button (all layouts) (js/app/fab.js): bottom right; zoom buttons, when shown, sit above it. */
@media all {
  .mapwrap .leaflet-bottom.leaflet-right { display: flex; flex-direction: column; align-items: flex-end; }
  .mapwrap .leaflet-bottom.leaflet-right .leaflet-control-zoom { order: 1; }
  .mapwrap .leaflet-bottom.leaflet-right .fab-wrap { order: 2; }
  .mapwrap .leaflet-bottom.leaflet-right .leaflet-control-attribution { order: 3; }
}
/* Phones: map credits span the bottom edge; map.js measures their height for bottom controls. */
@media (max-width: 1023px) {
  .mapwrap .leaflet-bottom.leaflet-right { left: 0; }
  .mapwrap .leaflet-bottom.leaflet-right .leaflet-control-attribution { align-self: stretch; max-width: none; margin: 0;
    white-space: normal; overflow: visible; text-overflow: clip; text-align: center; line-height: 1.35; padding: 2px 8px; }
}
@media all {
  .mapwrap .fab-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin: 0 10px 10px 0; position: relative; }
  .fab-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
    background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 14px rgb(0 0 0 / .3); }
  .fab-btn .icon { width: 26px; height: 26px; stroke-width: 2.4; transition: transform .25s cubic-bezier(.3,1.4,.5,1); }
  .fab-wrap.is-open .fab-btn .icon { transform: rotate(90deg); }
  .fab-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
  /* Radial menu: items sit behind the "+" and fly out to --fx/--fy (set in fab.js). */
  .fab-menu { position: absolute; right: 0; bottom: 0; width: 52px; height: 52px; pointer-events: none; }
  .fab-menu button { position: absolute; left: 4px; top: 4px; width: 44px; height: 44px; padding: 0; border-radius: 50%;
    display: grid; place-items: center; border: 1px solid var(--line-strong); background: var(--surface, var(--bg)); color: var(--primary);
    box-shadow: var(--shadow-2, 0 4px 14px rgb(0 0 0 / .2)); cursor: pointer; opacity: 0; transform: translate(0, 0) scale(.4);
    transition: transform .28s cubic-bezier(.3,1.4,.5,1), opacity .18s; }
  .fab-menu button[hidden] { display: none; }
  .fab-menu .icon { width: 22px; height: 22px; }
  .fab-wrap.is-open .fab-menu { pointer-events: auto; }
  .fab-wrap.is-open .fab-menu button { opacity: 1; transform: translate(var(--fx, 0), var(--fy, 0)) scale(1); }
  .fab-menu button:disabled { color: var(--muted, var(--text)); cursor: not-allowed; }
  .fab-wrap.is-open .fab-menu button:disabled { opacity: .5; }
  .fab-menu button:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
  @media (prefers-reduced-motion: reduce) { .fab-menu button, .fab-btn .icon { transition: none; } }
}
@media all {
  /* Keep the launcher in front throughout both directions of the radial animation. */
  .fab-btn { position: relative; z-index: 2; }
  .fab-menu { z-index: 1; }
}
/* Keep the right-side tool buttons clear of the "+" button (and zoom buttons): when the map is short the column
   scrolls instead of running under them. */
@media (max-width: 1023px) {
  .mapwrap .map-tools { max-height: calc(100% - 78px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: 2px; }
  .mapwrap.zoom-btn-phone .map-tools { max-height: calc(100% - 172px); }
}
@media (max-width: 1023px) { .mapwrap .map-tools > * { flex-shrink: 0; } }

/* Spot form "Pick on map" (views/spots.js pickOnMap): crosshair cursor and a bar saying what to do */
.picking, .picking .leaflet-interactive { cursor: crosshair !important; }
.pick-bar { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 14px; border-radius: 999px; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.pick-bar > span { display: inline-flex; align-items: center; gap: 8px; }
.pick-bar .icon { width: 18px; height: 18px; color: var(--primary); }

/* Title and source credit share the column beside the preview. Unavailable layers remain dimmed. */
.layers-pop .layer-opt { grid-template-columns: 40px minmax(0, 1fr); }
.layers-pop .lay-credit { grid-column: 2; font-size: 12px; line-height: 1.4; color: var(--text-2); overflow-wrap: anywhere; }
.layers-pop .lay-credit a { color: inherit; }
/* No required credits for the layers in use: hide the empty credits bar */
.leaflet-control-attribution:empty { display: none; }
.layers-pop .layer-opt.is-locked { opacity: .6; cursor: not-allowed; }
.layers-pop .layer-opt.is-locked:hover { border-color: var(--line-strong); }
.layers-pop .layer-opt .chip-paid { font-size: 10.5px; padding: 1px 6px; }
/* Dataset hover labels (js/app/datasets.js tip / clusterTip): kind, name, reliability; clusters list their kinds */
.leaflet-tooltip.ds-tip { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px; padding: 6px 9px; font-size: 12px; line-height: 1.35; white-space: nowrap;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2); }
.leaflet-tooltip.ds-tip::before { display: none; }
.ds-tip .ds-tip-kind { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.ds-tip .ds-tip-rate { font-size: 11px; color: var(--text-2); }
.ds-tip .ds-tip-line { display: flex; align-items: center; gap: 6px; }
.ds-tip .ds-tip-line i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
/* Map focus ring: only while the keyboard is in use (map.js adds html.kbd-nav), inside the map's edge. Leaflet focuses
   the map on every press, and the global :focus-visible ring sat outside it as a stray line under the credits. */
.leaflet-container:focus, .leaflet-container:focus-visible { outline: none; }
html.kbd-nav .leaflet-container:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }

/* Desktop spot search (js/app/spotsearch.js): quick suggestions while typing, full-height results panel on Enter */
.spot-search { position: absolute; top: 12px; left: 12px; right: calc(var(--identity-w, 44px) + 24px); max-width: 380px; z-index: 815; display: flex; }
.ss-card { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: calc(var(--touch) / 2); box-shadow: var(--shadow-2); }
.spot-search.has-sugg .ss-card { border-radius: calc(var(--touch) / 2); }
.spot-search.is-full .ss-card { border-radius: calc(var(--touch) / 2); }
.spot-search.is-full .ss-results { position: absolute; top: -12px; left: -12px; width: calc(100% + 24px); height: var(--search-map-h); padding-top: calc(var(--touch) + 24px); z-index: -1; background: var(--surface); border-right: 1px solid var(--line); box-shadow: var(--shadow-1); }
.spot-search.is-full .ss-results { animation: ss-slide-in .18s ease-out; }
@keyframes ss-slide-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .spot-search.is-full .ss-results { animation: none; } }
.ss-field { display: flex; align-items: center; gap: 2px; height: calc(var(--touch) - 2px); padding: 0 8px 0 4px; flex: none; color: var(--text-2); background: var(--surface); border-radius: calc(var(--touch) / 2); }
.ss-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; }
.ss-field input::-webkit-search-cancel-button { display: none; }
.ss-btn { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer; }
.ss-btn:hover { background: var(--surface-2); color: var(--text); }
.ss-btn .icon { width: 17px; height: 17px; }
.ss-list { margin: 0; padding: 4px 0 8px; list-style: none; border-top: 1px solid var(--line); border-radius: 0 0 calc(var(--touch) / 2) calc(var(--touch) / 2); overflow: hidden; }
.ss-list li { display: flex; align-items: center; gap: 16px; padding: 10px 18px; cursor: pointer; font-size: 14px; color: var(--text); }
.ss-list li .icon { width: 16px; height: 16px; flex: none; color: var(--text-2); }
.ss-list li[aria-selected], .ss-list li:hover { background: var(--surface-2); }
.ss-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-list b, .ss-rname b { font-weight: 700; }
.ss-list .ss-none { color: var(--text-2); }
.ss-results { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ss-rhead { display: flex; align-items: baseline; gap: 10px; padding: 16px 20px 8px; flex: none; }
.ss-rhead h2 { font-size: 18px; font-weight: 600; }
.ss-count { font-size: 12px; color: var(--text-2); }
.ss-rlist { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.ss-rlist li[data-i] { display: flex; gap: 12px; align-items: flex-start; padding: 14px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ss-rlist li[data-i]:hover, .ss-rlist li[data-i]:focus-visible { background: var(--surface-2); outline: 0; }
.ss-rmain { flex: 1; min-width: 0; }
.ss-rname { font-size: 15px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.ss-rsub { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.ss-rnote { font-size: 12.5px; color: var(--text-2); margin-top: 4px; font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-ract { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--primary); font-weight: 600; }
.ss-rico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.ss-rico .icon { width: 17px; height: 17px; }
.ss-rnone { padding: 24px 20px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
/* Thin Google Maps-style scrollbar, no arrows */
@supports not selector(::-webkit-scrollbar) { .ss-rlist { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; } }
.ss-rlist::-webkit-scrollbar { width: 6px; }
.ss-rlist::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.ss-rlist::-webkit-scrollbar-track { background: transparent; }
.ss-rlist::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.ss-rlist::-webkit-scrollbar-thumb:hover { background: var(--text-2); }
@media (max-width: 1023px) {
  .spot-search { top: 10px; left: 10px; right: 10px; max-width: none; }
  .ss-field { height: calc(var(--touch) + 6px); padding-left: var(--s4); padding-right: 5px; border-radius: 999px; }
  .ss-field > .map-acct { position: relative; margin-left: 4px; z-index: 3; box-shadow: none;
    width: calc(var(--touch) - 4px); height: calc(var(--touch) - 4px); border-radius: 999px; }
  .ss-field input { font-size: 16px; }
  .ss-go { display: none; }
  .spot-search.is-full .ss-results { top: -10px; left: -10px; padding-top: calc(var(--touch) + 28px); width: calc(100% + 20px); }
}
@media (max-width: 767px) { .spot-search { max-width: none; } }
/* Phones: the map buttons start below the profile button (top right). Desktop has the profile in the top bar, so they
   start at the top. */
.mapwrap .map-tools { top: calc(var(--touch) + 24px); max-height: calc(100% - var(--touch) - 102px); }
@media (min-width: 1024px) { .mapwrap .map-tools { top: 12px; max-height: calc(100% - 90px); } }
@media (min-width: 1024px) { .mapwrap .leaflet-top.leaflet-left { top: 58px; } .mapwrap .ms-panel, .mapwrap .rt-panel { top: 68px; } }
@media (min-width: 1024px) { .mapwrap:has(.spot-search.is-full) .leaflet-bottom.leaflet-left { left: 404px; } }

/* Spot hover label: name, then presumed depth and predicted tide (map.js tipHTML) */
.leaflet-tooltip.sp-tip { display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.35; }
.sp-tip-sub { font: 500 11.5px var(--mono); color: var(--text-2); }

/* Spot / dataset canvases are hidden during an animated zoom and fade back in at their new places (map.js steadyCanvas) */
.leaflet-overlay-pane canvas, .leaflet-pane > canvas { transition: opacity .15s ease-out; }
canvas.cv-hide { opacity: 0; transition: none; }

/* Weather alerts (js/app/wxalerts.js) */
.wx-btn[hidden] { display: none !important; }
.wx-btn { position: relative; color: var(--warn); }
.wx-btn[data-sev="s"], .wx-btn[data-sev="x"] { color: var(--danger); background: var(--danger-soft); }
.wx-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.wx-panel { position: absolute; top: 12px; right: 64px; z-index: 850; width: min(380px, calc(100% - 84px)); max-height: calc(100% - 40px); display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); color: var(--text); font-family: var(--font-ui); letter-spacing: 0; }
.wx-panel[hidden] { display: none; }
.wx-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.wx-head strong { font-size: 17px; font-weight: 650; line-height: 1.4; }
.wx-head .btn { width: var(--touch); height: var(--touch); flex-shrink: 0; }
.wx-list { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.wx-item { border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: var(--r-sm); padding: var(--s4); background: var(--surface-2); flex-shrink: 0; }
.wx-item[data-sev="s"], .wx-item[data-sev="x"] { border-left-color: var(--danger); }
.wx-show { display: flex; flex-direction: column; gap: var(--s2); width: 100%; text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; border-radius: 4px; }
.wx-show b { font-size: 15px; font-weight: 650; line-height: 1.4; }
.wx-area-label { font-weight: 650; color: var(--text-2); }
.wx-area { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.wx-item:has(details[open]) .wx-area { display: block; }
.wx-panel .small { font-size: 13px; line-height: 1.55; }
.wx-show > span, .wx-show b { overflow-wrap: anywhere; }
.wx-show .muted { font-size: 12px; color: var(--text-2); }
.wx-item details { margin-top: var(--s3); padding-top: var(--s2); border-top: 1px solid var(--line); }
.wx-item summary { min-height: var(--touch); align-content: center; color: var(--primary-text); font-weight: 600; cursor: pointer; }
.wx-show:hover b, .wx-item summary:hover { color: var(--primary-text); }
.wx-show:focus-visible, .wx-item summary:focus-visible, .wx-item a:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
.wx-text { white-space: pre-wrap; max-height: 260px; overflow: auto; margin: var(--s2) 0 var(--s3); overscroll-behavior: contain; }
.wx-item details a { display: inline-block; padding: var(--s2) 0; color: var(--primary-text); text-underline-offset: 3px; }
.wx-note { padding: var(--s3) var(--s4); margin: 0; border-top: 1px solid var(--line); background: var(--surface-2); flex-shrink: 0; }
/* Phone-only viewport-bottom popouts; keep content above the device home indicator. */
@media (max-width: 1023px) {
  .wx-panel {
    position: fixed; top: auto !important; bottom: 0 !important; left: 0; right: 0; width: auto;
    border-radius: var(--r) var(--r) 0 0; padding-bottom: env(safe-area-inset-bottom, 0px);
    max-height: min(70dvh, calc(100dvh - 100px)); z-index: 1200;
    animation: map-panel-slide-up .24s ease-out;
  }
  .layers-pop { overscroll-behavior: contain; }
  .layers-pop .mc-x { width: var(--touch); height: var(--touch); flex-shrink: 0; }
}
@keyframes map-panel-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.spot-banner { display: none; }
@media (max-width: 1023px) {
  #aux .spot-banner { display: flex; flex: none; align-items: center; justify-content: space-between;
    min-width: 0; height: 64px; padding: var(--s1) var(--s3) var(--s1) 14px; gap: var(--s2); color: var(--text); }
  #aux .spot-banner[hidden], #aux:not([data-sheet="min"]) .spot-banner { display: none; }
  .spot-banner-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
  .spot-banner-copy strong, .spot-banner-copy .sp-title { font: 650 16px/20px var(--font-ui); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .spot-banner-copy .mono { font-size: 13px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .spot-banner-estimates { font: 13px/16px var(--font-ui); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .spot-banner-actions { display: flex; align-items: center; gap: var(--s2); flex: none; }
  .spot-banner-actions .btn { width: var(--touch); height: var(--touch); padding: 0; flex-shrink: 0;
    border-radius: var(--s2); background: var(--surface-2); }
  .spot-banner-actions > .btn { border-color: transparent; }
  .spot-banner-actions .btn .icon { width: 20px; height: 20px; }
  .spot-banner-actions [data-spot-action="delete"] { color: var(--danger); }
}
dialog.spot-details-sheet { max-height: min(80dvh, calc(100dvh - 80px)); overflow: hidden; }
dialog.spot-details-sheet[open] { display: flex; flex-direction: column; }
.spot-details-sheet .modal-head { border-bottom: 1px solid var(--line); flex-shrink: 0; padding-bottom: var(--s3); }
.spot-details-sheet .modal-body { max-height: calc(80dvh - 80px); overscroll-behavior: contain; }
.spot-details-sheet .sp-detail { padding: 0; }
@media (max-width: 1023px) {
  dialog.spot-details-sheet { position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: 100%; border-radius: var(--r) var(--r) 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px); animation: map-panel-slide-up .24s ease-out; }
}
@media (prefers-reduced-motion: reduce) { dialog.spot-details-sheet { animation: none; } }
@media (prefers-reduced-motion: reduce) {
  .wx-panel { animation: none; }
}
.mc-add .mc-help { margin: 2px 0 10px; line-height: 1.45; }
.mc-add .mc-go[data-a="pinhere"] { width: 100%; }
.mc-add .mc-tabs button { white-space: nowrap; }

/* Phone: the circular profile ends the top-right crew row, in front of shared avatars. */
.map-identity .pp-stack { z-index: 1; margin-right: 0; }
.map-identity .map-acct { z-index: 3; }
@media (max-width: 1023px) { .map-identity .map-acct { margin-left: -9px; } }

.ss-list li.ss-q .ss-name { color: var(--text-2); }

/* Desktop keeps its account in the global header, not the map search. */
@media (min-width: 1024px) { .mapwrap > .map-acct { display: none; } }

/* Phones: live chart collaborators sit beneath the main profile, extending leftward. */
@media (max-width: 1023px) {
  .mapwrap > .pp-stack { position: absolute; top: calc(var(--s3) + var(--touch) + var(--s2)); bottom: auto; left: auto; right: var(--s3); z-index: 825;
    display: flex; flex-direction: row; justify-content: flex-start; align-items: center; height: auto; gap: 0; padding: 0; background: transparent; border: 0; }
  .mapwrap > .pp-stack[hidden] { display: none; }
  .mapwrap > .pp-stack .pp-item { margin-left: -8px; }
  .mapwrap > .pp-stack .pp-item:first-child { margin-left: 0; }
  .mapwrap > .pp-stack .pp-plus, .mapwrap > .pp-stack .pp-solo { display: none; }
  .mapwrap > .pp-stack .pp-av { width: 30px; height: 30px; box-shadow: var(--shadow-1); }
  .mapwrap:has(.spot-search.is-full) > .pp-stack, .mapwrap:has(.spot-banner:not([hidden])) > .pp-stack, body.add-menu-open .mapwrap > .pp-stack { display: none; }
}

.spot-search > .ss-card { flex: 1 1 auto; min-width: 0; }
.spot-search { max-width: 380px; }

/* Spot with a chosen map icon: symbol on a white disc ringed in the list colour */
.sp-sym > span { display: grid; place-items: center; width: 26px; height: 26px; box-sizing: border-box; border-radius: 50%; background: var(--surface, #fff); border: 2.5px solid; box-shadow: var(--shadow-1); }
/* Zoomed-out spot clusters (map.js drawCluster) */
.sp-selected { pointer-events: none; }
.sp-selected > span { display: block; width: 44px; height: 44px; box-sizing: border-box; border: 3px solid var(--focus); border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 2px var(--surface); }
.sp-cluster { display: grid; place-items: center; }
.sp-cluster span { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: var(--surface); border: 2px solid var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 30%, transparent), 0 2px 6px rgba(0,0,0,.3); font-weight: 700; font-size: 13px; cursor: pointer; }

/* Phones while plotting a route: only the route tools, route panel, measuring and the Add-point launcher stay over the map. */
@media (max-width: 1023px) {
  .mapwrap.rt-editing > :not(#map):not(.rt-tools):not(.rt-panel):not(.ms-panel):not(.ctx-menu):not(.map-tools) { display: none !important; }
  .mapwrap.rt-editing .leaflet-control-container .leaflet-control:not(.fab-wrap):not(.leaflet-control-attribution) { display: none !important; }
  .mapwrap.rt-editing .fab-menu { display: none; }
  body.rt-route-editing > .wx-panel { display: none !important; }
}
/* Route editing: keep Map layers and Go to my location; desktop also keeps Full screen. */
.mapwrap.rt-editing .map-tools > :not([data-t="layers"]):not([data-t="full"]):not([data-t="locate"]) { display: none !important; }

/* Route direction triangles along route lines (travel order) */
.rt-arrow { pointer-events: none; }
.rt-arrow span { display: block; width: 12px; height: 12px; background: var(--rt, #E0A526); clip-path: polygon(15% 8%, 95% 50%, 15% 92%); filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); }
/* To spot / From spot */
.rt-dir { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; margin: 6px 0 2px; }
.rt-dir button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.rt-dir button + button { border-left: 1px solid var(--line); }
.rt-dir button[aria-checked="true"] { background: var(--focus); color: #fff; }
.rt-dir button svg { width: 14px; height: 14px; }
.rt-dir-note { margin: 2px 0 6px; }
/* A spot's routes in Chart items and spot details */
.sp-li-wrap { display: flex; align-items: center; }
.sp-li-wrap > .list-item { flex: 1; min-width: 0; }
.sp-rt-toggle { flex: none; gap: 4px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.sp-rt-toggle[aria-expanded="true"] { color: var(--focus); }
.sp-li-routes { margin: 0 0 6px 28px; border-left: 2px solid var(--line); }
.rt-sub .rt-row-main { padding: 6px 10px; }
.sp-routes-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.sp-routes-head .section-label { margin: 0; }
.rt-loose > summary { cursor: pointer; list-style: none; }
.rt-loose > summary::-webkit-details-marker { display: none; }
.rt-loose > summary::after { content: "▸"; margin-left: 6px; color: var(--text-2); }
.rt-loose[open] > summary::after { content: "▾"; }
