:root {
  --accent: #3c6cf4;
  --accent-deep: #2b50c9;
  --accent-tint: #eef3ff;
  --yellow: #ffd11a;
  /* --danger is for emergency chrome (SOS, man overboard) and carries white
     text, so it is deep enough to read at 4.5:1 in sun; map pins keep the
     brighter severity colours from data.js */
  --danger: #c4262c;
  --caution: #f5a524;
  --info: #17b26a;
  /* the same hues dark enough to be text on white */
  --caution-ink: #8a5a0b;
  --info-ink: #0b7a45;
  --ink: #12161c;
  --sub: #5c6b7a;
  --muted: #666f78;   /* the lightest grey that still reads 4.5:1 on white and on panels */
  --line: #e9edf1;
  --panel: #ffffff;
  --lift-1: 0 2px 8px rgba(16, 24, 40, 0.10);
  --lift-2: 0 10px 30px rgba(16, 24, 40, 0.16);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  /* one motion vocabulary: press, move, settle */
  --dur-press: 120ms;
  --dur: 220ms;
  --dur-sheet: 320ms;
  --ease: cubic-bezier(0.32, 0.72, 0.28, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* dialogs take focus so screen readers announce them; the container itself
   is not a control, so it gets no ring */
[role=dialog]:focus, [role=alertdialog]:focus { outline: none; }

html, body {
  margin: 0;
  height: 100%;
  background: #e8eaed;
  color: var(--ink);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

.icon { width: 1em; height: 1em; display: block; }

/* ---------- Full-bleed map ---------- */
#map {
  position: fixed;
  inset: 0;
  background: #dfe3e8;
  z-index: 1;
}
.maplibregl-ctrl-attrib {
  background: rgba(255, 255, 255, 0.7) !important;
  border-radius: 8px 0 0 0;
}
.maplibregl-ctrl-attrib, .maplibregl-ctrl-attrib a {
  color: var(--muted) !important;
  font-size: 9.5px !important;
}
.maplibregl-canvas { outline: none; }

/* ---------- Floating map chrome ---------- */
.tl-stack, .tr-stack {
  position: fixed;
  top: calc(14px + var(--sat));
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tl-stack { left: 14px; }
.tr-stack { right: 14px; }

.sq-btn, .rd-btn {
  position: relative;
  width: 54px;
  height: 54px;
  border: 0;
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--lift-1);
  font: inherit;
  transition: transform 0.1s ease;
}
.sq-btn { border-radius: 16px; }
.rd-btn { border-radius: 50%; }
.sq-btn:active, .rd-btn:active { transform: scale(0.93); }
.rd-btn .icon { font-size: 25px; }

/* hamburger */
.burger { display: grid; gap: 4.5px; }
.burger i {
  display: block;
  height: 3px;
  width: 22px;
  border-radius: 999px;
  background: var(--ink);
}
.burger i:nth-child(2) { width: 16px; }
.burger i:nth-child(3) { width: 22px; }
.notif-dot {
  position: absolute;
  top: 9px; right: 9px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid #fff;
}
.notif-dot[hidden] { display: none; }

/* compass needle: red north half, grey south half */
.needle {
  width: 15px;
  height: 26px;
  background:
    linear-gradient(to bottom, var(--danger) 0 50%, #c3ccd4 50% 100%);
  clip-path: polygon(50% 0, 100% 100%, 50% 78%, 0 100%);
  transition: transform 0.2s ease;
}

.sos-round {
  color: var(--danger);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: var(--lift-1), 0 0 0 2px rgba(229, 72, 77, 0.28) inset;
}
#locate .icon { color: var(--sub); }
/* tracking but not following: blue arrow says "tap to pick the boat back up" */
#locate.tracking .icon { color: var(--accent); }
#locate.tracking.following { background: var(--accent); }
#locate.tracking.following .icon { color: #fff; }

.ar-btn {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.4px;
}
.ar-btn.live { background: var(--ink); color: #fff; }

/* ---------- AR: camera with bearings drawn over it ---------- */
.ar {
  position: fixed;
  inset: 0;
  z-index: 1800;
  background: #0d1218;
  overflow: hidden;
  animation: ar-in var(--dur-sheet) var(--ease-out);
}
.ar[hidden] { display: none; }
.ar.closing { animation: ar-out var(--dur) var(--ease) forwards; }
@keyframes ar-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes ar-out { to { opacity: 0; transform: scale(1.02); } }

.ar-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0d1218;
}
/* without a camera the scene still works — it just reads as a dark horizon */
.ar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 14, 20, 0.55) 0%, rgba(8, 14, 20, 0) 38%, rgba(8, 14, 20, 0.5) 100%);
  pointer-events: none;
}
.ar-horizon {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}
.ar-scene { position: absolute; inset: 0; z-index: 2; }

.ar-target {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  font: inherit;
  color: #fff;
  cursor: pointer;
  transition: opacity var(--dur) var(--ease);
  white-space: nowrap;
}
.ar-dot {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 21px;
  color: #fff;
  background: rgba(18, 22, 28, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.ar-label {
  background: rgba(18, 22, 28, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.ar-label b { font-weight: 800; }
.ar-label span { opacity: 0.75; font-weight: 600; margin-left: 6px; }

.ar-bar {
  position: absolute;
  top: calc(14px + var(--sat));
  left: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ar-heading {
  background: rgba(18, 22, 28, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}
.ar-close {
  border: 0;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(18, 22, 28, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}
.ar-note {
  position: absolute;
  left: 16px; right: 16px;
  bottom: calc(22px + var(--sab));
  z-index: 3;
  margin: 0;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ---------- Street/place name pill ---------- */
.place-pill {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-out);
  bottom: calc(var(--sheet-peek, 224px) + var(--sab) + 14px);
  max-width: 62vw;
  background: #fff;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.3px;
  color: var(--ink);
  box-shadow: var(--lift-1);
  z-index: 780;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* `.off` fades things out in place; `hidden` would snap them away */
.place-pill.off {
  opacity: 0;
  transform: translateX(-50%) translateY(6px) scale(0.94);
  pointer-events: none;
}

/* ---------- Speed over ground ---------- */
.speed-wrap {
  position: fixed;
  left: 14px;
  bottom: calc(var(--sheet-peek, 224px) + var(--sab) + 12px);
  z-index: 790;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-out);
}
.speed-wrap.off {
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  pointer-events: none;
}
.speed-dial {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #1b1f24;
  color: #fff;
  display: grid;
  place-content: center;
  justify-items: center;
  box-shadow: var(--lift-2);
}
.speed-dial b { font-size: 27px; font-weight: 800; line-height: 1; }
.speed-dial span { font-size: 11px; font-weight: 600; opacity: 0.75; margin-top: 2px; }
.speed-limit {
  position: absolute;
  top: -8px; right: -16px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid var(--danger);
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: var(--lift-1);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-out);
}
.speed-limit.off { opacity: 0; transform: scale(0.6); }

/* ---------- Report button ---------- */
.report-fab {
  position: fixed;
  right: 14px;
  bottom: calc(var(--sheet-peek, 224px) + var(--sab) + 12px);
  width: 76px;
  height: 76px;
  border: 0;
  border-radius: 24px;
  background: var(--yellow);
  color: #12161c;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 790;
  box-shadow: var(--lift-2);
  transition: transform 0.1s ease;
}
.report-fab svg { width: 42px; height: 42px; }
.report-fab:active { transform: scale(0.93); }

/* ---------- Bottom sheet ---------- */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 88dvh;
  background: var(--panel);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 34px rgba(16, 24, 40, 0.14);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateY(calc(88dvh - 224px - var(--sab)));
  transition: transform var(--dur-sheet) var(--ease);
  touch-action: none;
  will-change: transform;
}
.sheet.dragging { transition: none; }

.sheet-handle { padding: 9px 18px 4px; cursor: grab; flex: 0 0 auto; }
.grip {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: #d6dde3;
  margin: 0 auto;
}

/* search bar lives inside the sheet, Waze-style */
.searchbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 16px 0;
  padding: 0 18px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  background: #f1f3f5;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}
.searchbar:active { background: #e8ebee; }
.sb-icon { font-size: 22px; color: var(--sub); display: grid; }
.sb-ph { flex: 1; font-size: 17px; font-weight: 600; letter-spacing: -0.3px; }
.sb-mic { font-size: 21px; color: var(--sub); display: grid; }
.sb-mic[hidden] { display: none; }

.live-badge {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #0a8f52;
  background: rgba(23, 178, 106, 0.12);
  border-radius: 999px;
  padding: 3px 8px;
}
.live-badge.on { display: inline-flex; }
/* not live: saying so plainly beats a green dot that is quietly lying */
.live-badge.stale { color: #8a6100; background: rgba(245, 165, 36, 0.16); }
.live-badge.stale .live-dot { background: #f5a524; animation: none; }
.live-badge.waiting { color: #1a52c9; background: rgba(61, 110, 247, 0.14); }
.live-badge.waiting .live-dot { background: #3d6ef7; }
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #2fdc8b;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* quick destination cards */
.shortcuts {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  padding: 14px 16px 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.shortcuts::-webkit-scrollbar { display: none; }
.sc-card {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 190px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 13px 16px;
  font: inherit;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.1s ease;
}
.sc-card:active { transform: scale(0.96); background: #f6f8fa; }
.sc-icon { font-size: 22px; display: grid; flex: 0 0 auto; }
.sc-name {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.3px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(10px + var(--sab));
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 18px 6px;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.2px;
  color: var(--sub);
}
.feed-count {
  font-size: 12px;
  font-weight: 750;
  color: var(--accent-deep);
  background: var(--accent-tint);
  border-radius: 999px;
  padding: 3px 10px;
}

.sheet-conditions {
  display: flex;
  gap: 16px;
  margin: 0 18px 4px;
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
}
.cond { white-space: nowrap; }
.cond.boaters { color: #0a8f52; font-weight: 700; }
.cond[hidden] { display: none; }
/* a reading we do not have, told apart from one we do at a glance */
.cond-none { font-style: italic; }

/* recent destinations */
.recent-list, .feed-list { list-style: none; margin: 0; padding: 0 8px; }
.recent-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 14px;
  cursor: pointer;
}
.recent-row:active { background: #f4f7f9; }
.rr-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f1f3f5;
  color: var(--sub);
  font-size: 22px;
}
.rr-main { min-width: 0; }
.rr-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rr-sub {
  font-size: 14.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* live report rows */
.feed-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 11px 10px;
  border-radius: 14px;
  cursor: pointer;
}
.feed-item:active { background: #f4f7f9; }
.feed-icon {
  width: 44px; height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #fff;
}
.feed-main { min-width: 0; }
.feed-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.feed-badge {
  padding: 1.5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.feed-note {
  font-size: 14px;
  color: var(--sub);
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-meta {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  gap: 12px;
}
.feed-empty {
  padding: 18px 20px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  line-height: 1.5;
}
.sheet-fine {
  margin: 10px 0 0;
  padding: 10px 18px 6px;
  font-size: 10.5px;
  color: #9fb0bc;
  text-align: center;
  line-height: 1.5;
  border-top: 1px solid var(--line);
}
.sheet-fine a { color: var(--accent-deep); text-decoration: none; }

/* ---------- Search overlay ---------- */
.search-panel {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  z-index: 1500;
  animation: search-in var(--dur) var(--ease-out);
}
.search-panel[hidden] { display: none; }
.search-panel.closing { animation: search-out var(--dur) var(--ease) forwards; }
@keyframes search-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes search-out { to { opacity: 0; transform: translateY(10px); } }
.search-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: calc(10px + var(--sat)) 12px 10px;
  border-bottom: 1px solid var(--line);
}
.search-back {
  border: 0;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: none;
  font-size: 22px;
  color: var(--ink);
  cursor: pointer;
}
#search-input {
  flex: 1;
  border: 0;
  background: none;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--ink);
  padding: 8px 4px;
}
#search-input:focus { outline: none; }
.search-results { overflow-y: auto; padding: 4px 8px 20px; flex: 1; }
.search-group {
  margin: 14px 12px 4px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
}
.search-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: none;
  border-radius: 14px;
  padding: 11px 10px;
  cursor: pointer;
  text-align: left;
}
.search-row:active { background: #f4f7f9; }
.sr-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #f1f3f5;
  color: var(--sub);
  display: grid;
  place-items: center;
  font-size: 22px;
}
.sr-main { min-width: 0; }
.sr-title { font-size: 16.5px; font-weight: 700; letter-spacing: -0.3px; color: var(--ink); display: block; }
.sr-sub { font-size: 14px; color: var(--muted); display: block; }

/* ---------- Route card ---------- */
.route-card {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--sheet-peek, 224px) + var(--sab) + 100px);
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 20px;
  padding: 13px 15px;
  z-index: 900;
  box-shadow: var(--lift-2);
  animation: card-in var(--dur-sheet) var(--ease-out);
}
.route-card[hidden] { display: none; }
.route-card.closing { animation: card-out var(--dur) var(--ease) forwards; }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes card-out { to { opacity: 0; transform: translateY(12px) scale(0.98); } }
.route-main { flex: 1; min-width: 0; }
.route-title {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-meta { font-size: 13px; color: var(--sub); margin-top: 2px; font-weight: 600; }
.route-speed {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-tint);
  border-radius: 999px;
  padding: 4px 6px;
}
.route-speed button {
  border: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  color: var(--accent-deep);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
#route-speed-val { font-size: 12px; font-weight: 750; color: var(--accent-deep); min-width: 42px; text-align: center; }
.route-close {
  border: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #f1f3f5;
  font-size: 14px;
  color: var(--sub);
  cursor: pointer;
  flex: 0 0 auto;
}
.btn-directions {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 10px;
  font-size: 13.5px;
  font-weight: 750;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  margin-top: 6px;
}

/* ---------- Map markers ---------- */
.pin {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(45deg);
  color: #fff;
  box-shadow: 0 0 0 2px #fff, 0 3px 10px rgba(16, 24, 40, 0.35);
  transition: transform 0.15s ease;
}
.pin > span { transform: rotate(-45deg); font-size: 19px; display: grid; }
.pin:hover { transform: rotate(45deg) scale(1.1); }
.pin.fresh { animation: pop 0.35s ease; }
@keyframes pop {
  0% { transform: rotate(45deg) scale(0.2); }
  70% { transform: rotate(45deg) scale(1.12); }
  100% { transform: rotate(45deg) scale(1); }
}

.dest-pin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #2b3b47;
  font-size: 19px;
  box-shadow: 0 0 0 2px #fff, 0 3px 10px rgba(16, 24, 40, 0.3);
}
.dest-kind {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--sub);
  background: #f1f3f5;
  border-radius: 999px;
  padding: 2.5px 9px;
  margin: 2px 0 4px;
}

.me-marker {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(61, 110, 247, 0.18);
  display: grid;
  place-items: center;
}
.me-marker::after {
  content: '';
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 15px solid var(--accent);
  filter: drop-shadow(0 1px 2px rgba(16, 24, 40, 0.4));
}

.maplibregl-popup-content {
  border-radius: 18px;
  box-shadow: var(--lift-2);
  padding: 14px 16px;
  font-family: inherit;
  min-width: 226px;
}
.popup-title { font-size: 16px; font-weight: 750; margin: 0 0 2px; letter-spacing: -0.3px; }
.popup-note { font-size: 14px; color: var(--sub); margin: 4px 0 8px; }
.popup-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.popup-actions { display: flex; gap: 8px; align-items: center; }
.popup-actions button {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 9px 8px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.btn-confirm { background: #e6f7ef; color: #0b7a44; }
.btn-remove { background: #fdeceb; color: #b42722; }
/* the vote you already cast: still legible, plainly spent */
.popup-actions button.voted {
  opacity: 0.62;
  box-shadow: inset 0 0 0 2px currentColor;
}
.vote-score {
  flex: 0 0 auto;
  min-width: 26px;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
}

/* ---------- Toasts ---------- */
/* full-width track so a toast sizes to its text, not to half the viewport */
.toasts {
  position: fixed;
  top: calc(80px + var(--sat));
  left: 0;
  right: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: #1b1f24;
  color: #fff;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.2px;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: var(--lift-2);
  animation: toast-in 0.25s ease;
  max-width: 92vw;
}
.toast.has-action {
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
}
.toast-action {
  border: 0;
  background: #363c44;
  color: var(--yellow);
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.toast.out { animation: toast-out 0.3s ease forwards; }
/* ---------- Still there? ---------- */
/* Under the top row so SOS is never covered; big targets for wet hands. */
.pass {
  position: fixed;
  top: calc(70px + var(--sat));
  left: 12px;
  right: 12px;
  z-index: 3100;
  background: var(--panel);
  border-radius: 20px;
  padding: 14px 14px 16px;
  box-shadow: var(--lift-2);
  overflow: hidden;
  animation: pass-in var(--dur-sheet) var(--ease-out);
}
.pass[hidden] { display: none; }
.pass.closing { animation: pass-out var(--dur) var(--ease) forwards; }
@keyframes pass-in { from { opacity: 0; transform: translateY(-14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pass-out { to { opacity: 0; transform: translateY(-10px) scale(0.98); } }
.pass-head { display: flex; align-items: center; gap: 12px; }
.pass-icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
}
.pass-text { min-width: 0; }
.pass-title { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.3px; }
.pass-sub { margin: 2px 0 0; font-size: 13px; color: var(--sub); }
.pass-actions { display: flex; gap: 10px; margin-top: 12px; }
.pass-btn {
  flex: 1;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease);
}
.pass-btn:active { transform: scale(0.97); }
.pass-yes { background: var(--info); color: #fff; }
.pass-no { background: var(--line); color: var(--ink); }
.pass-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  animation: pass-timer 12s linear forwards;
}
@keyframes pass-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .pass-timer { display: none; } }

@keyframes toast-in { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateY(-10px); opacity: 0; } }

/* ---------- Sheets / modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.42);
  display: grid;
  place-items: end center;
  z-index: 2000;
}
.modal-backdrop[hidden] { display: none; }
.modal-backdrop { animation: backdrop-in var(--dur) var(--ease); }
.modal {
  width: min(500px, 100%);
  max-height: calc(92dvh - var(--sat));
  overflow-y: auto;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: var(--lift-2);
  animation: rise var(--dur-sheet) var(--ease);
  padding-bottom: var(--sab);
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(42px); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* closing: run the reverse, then JS sets `hidden` */
.modal-backdrop.closing { animation: backdrop-out var(--dur) var(--ease) forwards; }
.modal-backdrop.closing .modal { animation: sink var(--dur) var(--ease) forwards; }
@keyframes backdrop-out { to { opacity: 0; } }
@keyframes sink { to { transform: translateY(32px); opacity: 0; } }
.modal-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 20px 20px 6px;
}
.modal-head h3 { margin: 0; font-size: 19px; letter-spacing: -0.4px; flex: 1; }
.modal-close, .modal-back {
  border: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #f1f3f5;
  font-size: 15px;
  cursor: pointer;
  color: var(--sub);
  flex: 0 0 auto;
}
.modal-back[hidden] { display: none; }
/* The disc stays small; the finger gets 44px or more. These are the buttons
   pressed most, often one-handed on a moving boat. */
.modal-close, .modal-back, .nav-x, .search-back { position: relative; }
.modal-close::after, .modal-back::after, .nav-x::after, .search-back::after, .join-x::after {
  content: '';
  position: absolute;
  inset: -6px;
}
.modal-body { padding: 6px 20px 4px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin: 16px 0 8px;
}

/* report sheet */
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 16px 4px;
}
.report-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  border: 0;
  background: none;
  padding: 10px 2px;
  border-radius: 18px;
  cursor: pointer;
  font: inherit;
  transition: transform 0.08s ease;
}
.report-tile:active { transform: scale(0.94); }
.rt-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: #fff;
}
.rt-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.25;
  text-align: center;
}
.report-hint {
  margin: 10px 0 0;
  padding: 12px 20px calc(18px + var(--sab));
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* layers */
.layer-list { padding: 6px 12px 4px; }
.layer-row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  border: 0;
  background: none;
  border-radius: 14px;
  padding: 12px 10px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.layer-row:active { background: #f4f7f9; }
.lr-icon {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 21px;
  color: #fff;
}
.lr-label { flex: 1; font-size: 16px; font-weight: 650; letter-spacing: -0.2px; }
.lr-tick {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  background: var(--accent);
  color: #fff;
}
.layer-row[aria-pressed="false"] .lr-icon { filter: grayscale(1); opacity: 0.4; }
.layer-row[aria-pressed="false"] .lr-label { color: var(--muted); }
.layer-row[aria-pressed="false"] .lr-tick { background: #e8ebee; color: transparent; }

.modal-foot { display: flex; gap: 10px; padding: 12px 20px 20px; }
.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.2px;
  cursor: pointer;
}
.btn:active { transform: scale(0.97); }
.btn.ghost { background: #f1f3f5; color: var(--sub); }
.btn.primary { background: var(--accent); color: #fff; flex: 1; }

/* SOS */
.sos-action {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.3px;
  color: var(--ink);
  background: #f4f7f9;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.sos-action span {
  display: block;
  font-size: 13px;
  font-weight: 550;
  color: var(--sub);
  margin-top: 2px;
  letter-spacing: 0;
}
.sos-action.sos-000 { background: var(--danger); color: #fff; }
.sos-action.sos-000 span { color: rgba(255, 255, 255, 0.95); }
.sos-action.sos-static { cursor: default; }
.pos-readout {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 15px;
  font-weight: 700;
  background: var(--accent-tint);
  border-radius: 14px;
  padding: 13px 14px;
  text-align: center;
  word-break: break-word;
}
.pos-copy { width: 100%; margin-top: 8px; }

/* splash */
.modal.splash { padding: 30px 26px calc(24px + var(--sab)); text-align: center; }
.splash-hero { font-size: 52px; color: var(--accent); display: grid; place-items: center; margin-bottom: 6px; }
.modal.splash h3 { margin: 0; font-size: 23px; letter-spacing: -0.5px; }
.splash-sub { margin: 6px 0 16px; color: var(--muted); font-size: 15px; }
.splash-points { list-style: none; margin: 0 0 6px; padding: 0; text-align: left; }
.splash-points li { font-size: 15px; color: var(--sub); padding: 8px 2px; line-height: 1.45; }
.splash-points b { color: var(--ink); }
#splash-captain {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  font: inherit;
  font-size: 16px;
  text-align: center;
  margin-top: 12px;
}
.splash-go { width: 100%; margin-top: 16px; }
.splash-name {
  border: 0;
  background: none;
  color: var(--accent-deep);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  margin-top: 12px;
  cursor: pointer;
  text-decoration: underline;
}
.splash-name[hidden], #splash-captain[hidden] { display: none; }
.splash-fine { font-size: 11px; color: var(--muted); margin: 14px 0 0; }

/* ---------- Desktop: sheet becomes a side card ---------- */
@media (min-width: 900px) {
  .sheet {
    left: auto;
    right: 16px;
    top: calc(16px + var(--sat));
    bottom: 16px;
    width: 390px;
    height: auto;
    border-radius: 22px;
    transform: none !important;
    transition: none;
    touch-action: auto;
  }
  .grip { display: none; }
  .sheet-handle { padding-top: 14px; cursor: default; }
  .tr-stack { right: 422px; }
  .report-fab { right: 422px; bottom: 28px; }
  .speed-wrap { bottom: 28px; }
  .place-pill { left: calc(50% - 200px); bottom: 28px; }
  .route-card { left: 16px; right: 422px; bottom: 120px; }
  .search-panel { left: auto; right: 16px; top: calc(16px + var(--sat)); bottom: 16px; width: 390px; border-radius: 22px; }
  .modal-backdrop { place-items: center; padding: 16px; }
  .modal { border-radius: 24px; padding-bottom: 0; }
}

@media (max-width: 380px) {
  #cond-time { display: none; }
  .sheet-conditions { gap: 12px; font-size: 12px; }
}

/* ---------- Motion: lists arrive, they don't appear ---------- */
/* Rows are rebuilt wholesale, so a short stagger on the first few reads as
   the list settling rather than the whole panel flashing. */
.report-tile, .search-row, .recent-row, .feed-item, .sc-card, .layer-row {
  animation: row-in var(--dur) var(--ease-out) backwards;
}
.report-tile:nth-child(1), .search-row:nth-child(1), .recent-row:nth-child(1),
.feed-item:nth-child(1), .sc-card:nth-child(1), .layer-row:nth-child(1) { animation-delay: 0ms; }
.report-tile:nth-child(2), .search-row:nth-child(2), .recent-row:nth-child(2),
.feed-item:nth-child(2), .sc-card:nth-child(2), .layer-row:nth-child(2) { animation-delay: 25ms; }
.report-tile:nth-child(3), .search-row:nth-child(3), .recent-row:nth-child(3),
.feed-item:nth-child(3), .sc-card:nth-child(3), .layer-row:nth-child(3) { animation-delay: 50ms; }
.report-tile:nth-child(4), .search-row:nth-child(4), .recent-row:nth-child(4),
.feed-item:nth-child(4), .sc-card:nth-child(4), .layer-row:nth-child(4) { animation-delay: 75ms; }
.report-tile:nth-child(n+5), .search-row:nth-child(n+5), .recent-row:nth-child(n+5),
.feed-item:nth-child(n+5), .sc-card:nth-child(n+5), .layer-row:nth-child(n+5) { animation-delay: 95ms; }
@keyframes row-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* map popups settle out of the pin rather than blinking on */
.maplibregl-popup { animation: popup-in 0.2s var(--ease-out); }
@keyframes popup-in { from { opacity: 0; transform: translateY(6px) scale(0.96); } to { opacity: 1; transform: none; } }

/* buttons: press feedback on colour as well as scale */
.sq-btn, .rd-btn, .report-fab, .sc-card, .btn, .searchbar, .toast-action {
  transition: transform var(--dur-press) var(--ease), background-color var(--dur-press) var(--ease);
}

/* ---------- Someone who asked for less motion gets none of it ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Navigate mode ---------- */
.btn-go {
  border: 0;
  border-radius: 999px;
  background: var(--info);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 10px 20px;
  cursor: pointer;
  flex: 0 0 auto;
  transition: transform var(--dur-press) var(--ease);
}
.btn-go:active { transform: scale(0.95); }

.nav-mode {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;   /* the chart stays usable between the bars */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: nav-in var(--dur-sheet) var(--ease-out);
}
.nav-mode[hidden] { display: none; }
.nav-mode.closing { animation: nav-out var(--dur) var(--ease) forwards; }
@keyframes nav-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nav-out { to { opacity: 0; } }

.nav-head {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: calc(12px + var(--sat)) 12px 0;
  padding: 14px 16px;
  border-radius: 22px;
  background: #12161c;
  color: #fff;
  box-shadow: var(--lift-2);
}
.nav-main { flex: 1; min-width: 0; }
.nav-to {
  font-size: 14px;
  font-weight: 650;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-figures { display: flex; align-items: baseline; gap: 12px; margin-top: 2px; }
.nav-big { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; }
.nav-sub { font-size: 14px; font-weight: 650; opacity: 0.75; font-variant-numeric: tabular-nums; }
.nav-x {
  border: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  flex: 0 0 auto;
}

.nav-xte {
  pointer-events: auto;
  align-self: center;
  margin-top: 10px;
  background: var(--caution);
  color: #3d2c00;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 750;
  box-shadow: var(--lift-1);
}
.nav-xte[hidden] { display: none; }

.nav-foot {
  pointer-events: auto;
  margin: 0 12px calc(14px + var(--sab));
  padding: 12px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--lift-2);
}
.nav-clear {
  margin: 6px 0;
  text-align: center;
  font-size: 14px;
  font-weight: 650;
  color: var(--info-ink);
}
.nav-hazard {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: none;
  border-radius: 14px;
  padding: 9px 6px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.nav-hazard:active { background: #f4f7f9; }
.nh-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #fff;
}
.nh-main { min-width: 0; }
.nh-name { display: block; font-size: 15.5px; font-weight: 750; letter-spacing: -0.2px; }
.nh-where { display: block; font-size: 13px; color: var(--sub); font-weight: 600; }
.nav-marks-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-radius: 14px;
  background: #f1f3f5;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
}
.nav-marks-btn span { display: grid; font-size: 19px; color: var(--sub); }

/* ---------- Marks guide ---------- */
.marks-region {
  margin: 0 20px 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.marks-list { padding: 6px 16px 0; }
.mark-card {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.mark-card:last-child { border-bottom: 0; }
.mark-art svg { width: 100%; height: auto; }
.mark-name { font-size: 16px; font-weight: 750; letter-spacing: -0.3px; }
.mark-action {
  display: inline-block;
  margin: 5px 0 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
}
.mark-meaning { margin: 0; font-size: 14px; line-height: 1.45; color: var(--sub); }
.mark-light {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
}
.mark-light i {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(16, 24, 40, 0.15);
}

/* Underway, the chart and the leg are all that matter: the sheet goes away,
   menu/compass/AR/locate go with it, and only speed and reporting stay. */
body.navigating .sheet { transform: translateY(100%) !important; }
body.navigating .tl-stack,
body.navigating .tr-stack,
body.navigating .place-pill { opacity: 0; pointer-events: none; }
body.navigating .speed-wrap,
body.navigating .report-fab { bottom: calc(232px + var(--sab)); }
.tl-stack, .tr-stack { transition: opacity var(--dur) var(--ease); }
.speed-wrap, .report-fab { transition: bottom var(--dur-sheet) var(--ease), opacity var(--dur) var(--ease), transform var(--dur) var(--ease-out); }

/* ---------- "This is a bearing, not a course" ---------- */
.route-warn {
  margin-top: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: #b45309;
  white-space: normal;
  line-height: 1.35;
}
.route-warn[hidden] { display: none; }
.nav-land {
  margin: 2px 6px 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff4e0;
  color: #7c4a02;
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.35;
}
.nav-land[hidden] { display: none; }

/* ---------- Boot screen ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #08306b 0%, #0b62d6 52%, #12a3e8 100%);
  color: #fff;
  transition: opacity 0.45s var(--ease);
}
.boot.out { opacity: 0; pointer-events: none; }
.boot-logo {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  animation: boot-rise 0.6s var(--ease-out);
}
.boot-logo svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35)); }
.boot-name {
  margin: 14px 0 2px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.6px;
  animation: boot-rise 0.6s 60ms var(--ease-out) backwards;
}
.boot-tag {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  animation: boot-rise 0.6s 120ms var(--ease-out) backwards;
  transition: opacity var(--dur) var(--ease);
}
@keyframes boot-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.boot-dots { display: flex; gap: 7px; margin-top: 26px; }
.boot-dots i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  animation: boot-dot 1.1s ease-in-out infinite;
}
.boot-dots i:nth-child(2) { animation-delay: 0.16s; }
.boot-dots i:nth-child(3) { animation-delay: 0.32s; }
@keyframes boot-dot {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-5px); }
}

/* ---------- Channel gates ---------- */
.gate-mark {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.45);
}
.nav-gate {
  pointer-events: auto;
  align-self: center;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  background: #12161c;
  color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 650;
  box-shadow: var(--lift-2);
}
.nav-gate[hidden] { display: none; }
.nav-gate b { font-weight: 800; }
.ng-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid #fff;
  flex: 0 0 auto;
}

/* ---------- Menu ---------- */
.me-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: calc(100% - 32px);
  margin: 4px 16px 10px;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: #f4f7f9;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.me-card:active { background: #eaeff3; }
.me-badge {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 24px;
  flex: 0 0 auto;
}
.me-main { flex: 1; min-width: 0; }
.me-name { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.3px; }
.me-sub { display: block; font-size: 13.5px; color: var(--sub); font-weight: 600; }
.me-go, .mr-go { color: var(--muted); font-size: 22px; font-weight: 300; }

.menu-list { padding: 0 8px calc(14px + var(--sab)); }
.menu-row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  border: 0;
  background: none;
  border-radius: 14px;
  padding: 12px 10px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.menu-row:active { background: #f4f7f9; }
.mr-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #fff;
  flex: 0 0 auto;
}
.mr-main { flex: 1; min-width: 0; }
.mr-label { display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.mr-sub { display: block; font-size: 13px; color: var(--muted); }

/* ---------- Account ---------- */
.rank-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #12161c;
  color: #fff;
  margin-bottom: 4px;
}
.rank-now { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.rank-next { font-size: 12.5px; color: rgba(255, 255, 255, 0.7); font-weight: 650; }
.rank-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--yellow); transition: width var(--dur-sheet) var(--ease); }

.field {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
}
.field:focus { outline: none; border-color: var(--accent); }
.field-hint { margin: 6px 2px 0; font-size: 12.5px; color: var(--muted); }

.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--sub);
  cursor: pointer;
}
.pick[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-weight: 750;
}
.swatch {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--line);
}
.swatch[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--ink); }

.acc-auth { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.acc-state { margin: 0 0 10px; font-size: 14px; color: var(--sub); line-height: 1.5; }
.acc-state b { color: var(--ink); }
.acc-row { display: flex; gap: 8px; }
.acc-row .field { flex: 1; }
.acc-row .btn { flex: 0 0 auto; }

/* ---------- Settings ---------- */
.settings-list { padding: 4px 12px 0; }
.set-group {
  margin: 18px 10px 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
}
.set-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 0;
  background: none;
  border-radius: 14px;
  padding: 12px 10px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.set-row:active { background: #f4f7f9; }
.set-main { flex: 1; min-width: 0; }
.set-label { display: block; font-size: 16px; font-weight: 650; letter-spacing: -0.2px; }
.set-hint { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; line-height: 1.35; }
.switch {
  width: 50px; height: 30px;
  border-radius: 999px;
  background: #dde3e8;
  flex: 0 0 auto;
  padding: 3px;
  transition: background var(--dur) var(--ease);
}
.switch i {
  display: block;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--lift-1);
  transition: transform var(--dur) var(--ease);
}
.set-row[aria-pressed="true"] .switch { background: var(--info); }
.set-row[aria-pressed="true"] .switch i { transform: translateX(20px); }

.set-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
}
.segmented { display: flex; background: #f1f3f5; border-radius: 12px; padding: 3px; }
.segmented button {
  border: 0;
  background: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--sub);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--lift-1); }

.set-danger {
  width: calc(100% - 20px);
  margin: 22px 10px 6px;
  border: 0;
  border-radius: 14px;
  background: #fdeceb;
  color: #b42722;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  padding: 14px;
  cursor: pointer;
}

/* ---------- Boaties ---------- */
.boatie { transition: transform var(--dur) var(--ease); }
.boatie-hull {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.4);
}

/* ---------- Anchor watch ---------- */
.anchor-marker {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 19px;
  color: #fff;
  background: #12161c;
  border: 2px solid #fff;
  box-shadow: var(--lift-2);
}
.anchor-alarm {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: #fff;
  background: var(--danger);
  animation: alarm-pulse 0.9s ease-in-out infinite;
}
.anchor-alarm[hidden] { display: none; }
@keyframes alarm-pulse {
  0%, 100% { background: #e5484d; }
  50% { background: #b42722; }
}
.aa-icon { font-size: 54px; }
.anchor-alarm h2 { margin: 4px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -0.6px; }
.anchor-alarm p { margin: 0 0 18px; font-size: 16px; font-weight: 650; opacity: 0.9; }
.aa-btn {
  width: min(360px, 100%);
  border: 0;
  border-radius: 16px;
  padding: 16px;
  font: inherit;
  font-size: 16.5px;
  font-weight: 800;
  cursor: pointer;
}
.aa-reset { background: #fff; color: var(--danger); }
.aa-stop { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* ---------- FollowMe ---------- */
.fm-link {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13.5px;
  font-weight: 650;
  background: var(--accent-tint);
  color: var(--accent-deep);
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 4px;
  word-break: break-all;
}
.fm-banner {
  position: fixed;
  top: calc(14px + var(--sat));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #12161c;
  color: #fff;
  border-radius: 999px;
  padding: 10px 10px 10px 16px;
  font-size: 14px;
  font-weight: 650;
  box-shadow: var(--lift-2);
  max-width: 92vw;
}
.fm-banner[hidden] { display: none; }
.fm-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #2fdc8b;
  animation: blink 1.6s ease-in-out infinite;
  flex: 0 0 auto;
}
.fm-banner-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#fm-banner-stop {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  padding: 6px 14px;
  cursor: pointer;
  flex: 0 0 auto;
}
.mate-marker {
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #8b5cf6;
  filter: drop-shadow(0 2px 5px rgba(16, 24, 40, 0.45));
}
.mate-tag {
  position: absolute;
  top: 26px;
  white-space: nowrap;
  background: #8b5cf6;
  color: #fff;
  font-size: 11.5px;
  font-weight: 750;
  border-radius: 999px;
  padding: 2px 9px;
}

/* map look picker sits above the report toggles */
.look-choice { padding: 6px 10px 10px; }
.look-choice .segmented button { padding: 8px 12px; font-size: 13px; }

/* ---------- Avatars ---------- */
.avatar-pick {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 3px solid transparent;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--line);
}
.avatar-pick[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--ink); }

/* ---------- Fishing ---------- */
.bite-strip {
  margin: 4px 16px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f1f3f5;
  color: var(--ink);
}
.bite-strip.biting { background: #e6f7ef; }
.bite-now { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.bite-strip.biting .bite-now { color: #0b7a44; }
.bite-sub { font-size: 13px; color: var(--sub); margin-top: 3px; }
.fish-actions { display: flex; gap: 8px; margin-bottom: 4px; }
.fish-actions .btn { flex: 1; }
.fish-session {
  margin: 10px 0 2px;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 750;
}
.fish-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: none;
  padding: 9px 4px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.fr-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #f1f3f5;
  color: var(--sub);
  font-size: 18px;
  flex: 0 0 auto;
}
.fr-main { min-width: 0; }
.fr-name { display: block; font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.fr-sub { display: block; font-size: 12.5px; color: var(--muted); }
.spot-mark {
  width: 26px; height: 26px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(45deg);
  background: #17b26a;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  box-shadow: 0 0 0 2px #fff, 0 3px 8px rgba(16, 24, 40, 0.35);
}
.spot-mark svg { transform: rotate(-45deg); }

/* ---------- Quests ---------- */
.quest-list { padding: 4px 14px 10px; }
.quest {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
}
.quest:last-child { border-bottom: 0; }
.q-main { flex: 1; min-width: 0; }
.q-title { font-size: 16px; font-weight: 750; letter-spacing: -0.2px; display: flex; align-items: center; gap: 8px; }
.q-period {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: #f1f3f5;
  border-radius: 999px;
  padding: 2px 8px;
}
.q-hint { font-size: 13px; color: var(--sub); margin-top: 2px; }
.q-bar { height: 6px; border-radius: 999px; background: #eef2f5; margin-top: 8px; overflow: hidden; }
.q-bar i { display: block; height: 100%; background: var(--accent); transition: width var(--dur-sheet) var(--ease); }
.quest.done .q-bar i { background: var(--info); }
.q-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 auto; }
.q-count { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.q-reward { font-size: 12px; font-weight: 750; color: var(--caution-ink); }
.q-claim {
  border: 0;
  border-radius: 999px;
  background: var(--info);
  color: #fff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  padding: 6px 13px;
  margin-top: 3px;
  cursor: pointer;
}
.q-claimed { font-size: 11.5px; font-weight: 750; color: var(--muted); }

/* ---------- Mates ---------- */
.my-code {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 16px;
  background: #12161c;
  color: #fff;
  margin-bottom: 10px;
}
.mc-label { font-size: 13px; opacity: 0.7; font-weight: 650; }
#mc-value {
  flex: 1;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1px;
}
.my-code .btn { padding: 8px 14px; font-size: 13.5px; }
.board { padding: 4px 12px 8px; }
.board-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  border-radius: 14px;
  cursor: pointer;
}
.board-row.me { background: var(--accent-tint); cursor: default; }
.b-place {
  width: 22px;
  font-size: 15px;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
  flex: 0 0 auto;
}
.board-row:nth-child(1) .b-place { color: #b8860b; }
.b-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #fff;
  flex: 0 0 auto;
}
.b-main { flex: 1; min-width: 0; }
.b-name { display: block; font-size: 16px; font-weight: 750; letter-spacing: -0.2px; }
.b-sub { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-points { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; flex: 0 0 auto; }

/* ---------- Trips ---------- */
.trip-running {
  margin: 4px 16px 10px;
  padding: 16px;
  border-radius: 18px;
  background: #8b5cf6;
  color: #fff;
}
.tr-big { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; }
.tr-sub { font-size: 13.5px; opacity: 0.85; font-weight: 650; margin-top: 2px; }
.trip-list { padding: 0 12px 4px; max-height: 44dvh; overflow-y: auto; }
.trip-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  border-radius: 14px;
  cursor: pointer;
}
.trip-row:active { background: #f4f7f9; }
.tr-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #f1f3f5;
  color: #8b5cf6;
  font-size: 19px;
  flex: 0 0 auto;
}
.tr-main { flex: 1; min-width: 0; }
.tr-name { display: block; font-size: 15.5px; font-weight: 750; letter-spacing: -0.2px; }
.tr-meta { display: block; font-size: 12.5px; color: var(--muted); }
.tr-share {
  border: 0;
  border-radius: 999px;
  background: #f1f3f5;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  padding: 7px 14px;
  cursor: pointer;
  flex: 0 0 auto;
}

/* ---------- Man overboard ---------- */
.sos-mob {
  background: #12161c;
  color: #fff;
  border: 0;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
  cursor: pointer;
}
.sos-mob span { color: rgba(255, 255, 255, 0.75); }

.mob {
  position: fixed;
  inset: 0;
  z-index: 5500;
  background: var(--danger);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: calc(18px + var(--sat)) 18px calc(18px + var(--sab));
  animation: mob-in 0.2s var(--ease-out);
}
.mob[hidden] { display: none; }
@keyframes mob-in { from { opacity: 0; } to { opacity: 1; } }

.mob-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.mob-title { font-size: 19px; font-weight: 800; letter-spacing: 1.2px; }
.mob-since {
  font-size: 19px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 999px;
  padding: 4px 14px;
}

.mob-figures {
  display: flex;
  gap: 14px;
  margin: 18px 0 10px;
}
.mob-figures > div {
  flex: 1;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 20px;
  padding: 16px;
  text-align: center;
}
.mob-figures b {
  display: block;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1.2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.mob-figures span { font-size: 12.5px; font-weight: 700; opacity: 0.8; }

.mob-pos {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 15px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  word-break: break-word;
}
.mob-note {
  font-size: 13.5px;
  line-height: 1.45;
  opacity: 0.9;
  margin: 12px 2px;
}
.mob-actions { margin-top: auto; display: grid; gap: 9px; }
.mob-btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 16px;
  font: inherit;
  font-size: 16.5px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  /* shade the red rather than lighten it: white on a lightened red fails in sun */
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  cursor: pointer;
}
.mob-btn.mob-000 { background: #fff; color: var(--danger); }
.mob-btn.mob-stand { background: rgba(0, 0, 0, 0.25); font-size: 15px; }

.mob-mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: 3px solid #fff;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  box-shadow: var(--lift-2);
  animation: mob-pulse 1.4s ease-out infinite;
}
@keyframes mob-pulse {
  0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.6); }
  70% { box-shadow: 0 0 0 22px rgba(229, 72, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); }
}
.mob-btn.arming { background: #fff; color: var(--danger); }

/* ---------- Build-a-captain ---------- */
.face-editor { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.face-preview {
  width: 88px; height: 88px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: var(--lift-1);
}
.face-preview svg, .av { width: 100%; height: 100%; display: block; }
.face-editor .btn { flex: 0 0 auto; }
.face-controls { margin-top: 6px; }
.face-row { margin-bottom: 12px; }
.face-label {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 6px;
}
.face-opts {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.face-opts::-webkit-scrollbar { display: none; }
.face-opt {
  flex: 0 0 auto;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--sub);
  cursor: pointer;
}
.face-opt[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-weight: 750;
}
.face-swatch {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--line);
}
.face-swatch[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--ink); }

/* faces fill their circles wherever they appear */
.me-badge.has-face, .b-avatar.has-face, .boatie-hull.has-face { padding: 0; overflow: hidden; }
.me-badge.has-face svg, .b-avatar.has-face svg, .boatie-hull.has-face svg { width: 100%; height: 100%; }

/* ---------- Joining ---------- */
.modal.join {
  position: relative;
  text-align: left;
  padding: 26px 24px calc(24px + var(--sab));
}
.join-x {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(127, 140, 158, 0.14);
  color: var(--muted);
  font-size: 20px; line-height: 1;
  cursor: pointer;
}
.join h3 { margin: 4px 0 0; font-size: 20px; }
.join-sub { margin: 6px 0 16px; color: var(--muted); font-size: 14px; line-height: 1.45; }
/* the dots stop short of the close button rather than running under it */
.join-steps { display: flex; gap: 6px; margin: 0 40px 16px 0; }
.join-steps i {
  height: 3px; flex: 1; border-radius: 999px;
  background: rgba(127, 140, 158, 0.28);
  transition: background var(--t-med, 220ms) ease;
}
.join-steps i.on { background: var(--accent); }
.join input {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid rgba(127, 140, 158, 0.3);
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 16px;            /* 16px or iOS zooms the page on focus */
  font-weight: 600;
  background: var(--card, #fff);
  color: inherit;
}
.join input:focus { outline: none; border-color: var(--accent); }
#join-code { letter-spacing: 6px; text-align: center; font-size: 22px; font-weight: 800; }
.join .btn.primary { width: 100%; margin-top: 12px; }
.join-err {
  margin: 8px 0 0; font-size: 13px; font-weight: 650; color: #b42722;
}
.join-err[hidden] { display: none; }
.join-row {
  display: flex; justify-content: space-between; gap: 12px; margin: 12px 0 16px;
}
.join-link {
  border: 0; background: none; padding: 4px 0;
  color: var(--accent); font-size: 13px; font-weight: 700; cursor: pointer;
}
.join-skip {
  display: block; width: 100%; margin-top: 12px; padding: 10px 0;
  border: 0; background: none; color: var(--muted);
  font-size: 13px; font-weight: 650; cursor: pointer;
}
.join-face {
  width: 104px; height: 104px; margin: 8px auto 4px;
}
.join-face .av { width: 100%; height: 100%; display: block; }

/* ---------- Log on ---------- */
.logon-body { padding: 0 20px calc(20px + var(--sab)); }
.logon-intro, .logon-fine { color: var(--muted); font-size: 13px; line-height: 1.5; }
.logon-intro { margin: 0 0 16px; }
.logon-fine { margin: 14px 0 0; }
.logon-label {
  display: block; margin: 14px 0 6px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--muted);
}
.logon-hours { display: flex; flex-wrap: wrap; gap: 8px; }
.logon-body .btn.primary { width: 100%; margin-top: 18px; }
.logon-state { margin: 4px 0 0; font-size: 17px; }
.logon-due { color: #8a6100; }
.logon-over { color: #b42722; }
.logon-heading { margin: 6px 0 0; font-size: 15px; font-weight: 700; }
.logon-meta { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.logon-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.logon-actions .btn { width: 100%; margin: 0; }
.logon-body .btn.ghost { width: 100%; margin-top: 8px; }

/* ---------- Bar crossing ---------- */
.bar-body { padding: 0 20px calc(20px + var(--sab)); }
.bar-name { margin: 2px 0 2px; font-size: 17px; font-weight: 800; }
.bar-note { margin: 0 0 14px; color: #8a3b00; font-size: 13px; font-weight: 650; }
.bar-list { margin: 0; padding-left: 20px; }
.bar-list li { font-size: 15px; line-height: 1.5; padding: 6px 0; color: var(--ink); }
.bar-fine { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ---------- Boat ramps ---------- */
.ramp-body { padding: 0 20px calc(20px + var(--sab)); }
.ramp-where { margin: 2px 0 6px; color: var(--muted); font-size: 13px; font-weight: 650; }
.ramp-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid rgba(127, 140, 158, 0.16);
}
.ramp-k { flex: 0 0 74px; color: var(--muted); font-size: 12px; font-weight: 750;
  text-transform: uppercase; letter-spacing: 0.4px; }
.ramp-v { flex: 1; font-size: 15px; font-weight: 700; }
.ramp-v.none { font-weight: 500; color: var(--muted); font-style: italic; }
.ramp-age { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ramp-note { margin: 10px 0 0; font-size: 14px; font-style: italic; color: var(--sub); }
.ramp-count { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.ramp-empty { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.ramp-f { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.ramp-f span {
  background: rgba(127, 140, 158, 0.14); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; font-weight: 650; text-transform: capitalize;
}
.ramp-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.ramp-body .btn { width: 100%; margin-top: 16px; }
.ramp-body .field { width: 100%; box-sizing: border-box; margin-top: 14px; }
.ramp-fine { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Wind outlook ---------- */
.wx-outlook {
  margin: 6px 0 0; font-size: 13px; font-weight: 650; line-height: 1.4;
  color: var(--sub);
}
.wx-outlook[hidden] { display: none; }
.wx-outlook.wx-strong { color: #b42722; }
.wx-outlook.wx-building { color: #8a6100; }
.wx-outlook.wx-easing, .wx-outlook.wx-fresh { color: var(--muted); }

/* ---------- Walkie-talkie ---------- */
.walkie-btn.on { color: var(--accent); }
.walkie-dot {
  position: absolute;
  top: 9px; right: 9px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--info);
  border: 2px solid #fff;
}
.walkie-dot[hidden] { display: none; }
/* a mate on air: the button goes green and rings, so it reads at a glance */
.walkie-btn.rx { background: var(--info-ink); color: #fff; animation: walkie-ring 1.1s ease-out infinite; }
.walkie-btn.tx { background: var(--danger); color: #fff; }
@keyframes walkie-ring {
  from { box-shadow: var(--lift-1), 0 0 0 0 rgba(11, 122, 69, 0.5); }
  to   { box-shadow: var(--lift-1), 0 0 0 14px rgba(11, 122, 69, 0); }
}

.walkie-pill {
  position: fixed;
  top: calc(18px + var(--sat));
  left: 50%;
  transform: translateX(-50%);
  z-index: 850;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 164px);   /* clear of the button stacks either side */
  padding: 6px 14px 6px 6px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--lift-2);
  font: inherit;
  cursor: pointer;
  animation: rise var(--dur) var(--ease-out);
}
.walkie-pill[hidden] { display: none; }
.wp-avatar {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #dbe6f2;
  color: var(--ink);
}
.wp-avatar svg { width: 100%; height: 100%; }
.wp-avatar .icon { width: 22px; height: 22px; }
.wp-text { display: flex; flex-direction: column; min-width: 0; text-align: left; line-height: 1.2; }
.wp-text b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-text span { font-size: 12px; color: #c9d2db; }
.wp-bars { display: flex; gap: 3px; align-items: center; height: 18px; flex: 0 0 auto; }
.wp-bars i {
  width: 3px; height: 100%;
  border-radius: 2px;
  background: #3ddc97;
  animation: wp-bar 0.9s ease-in-out infinite;
}
.wp-bars i:nth-child(2) { animation-delay: -0.3s; }
.wp-bars i:nth-child(3) { animation-delay: -0.6s; }
.wp-bars i:nth-child(4) { animation-delay: -0.15s; }
@keyframes wp-bar { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }

.walkie-gate { text-align: center; padding: 6px 4px 14px; }
.walkie-gate p { margin: 0 0 14px; color: var(--sub); font-size: 15px; line-height: 1.45; }
.walkie-gate[hidden], #walkie-main[hidden] { display: none; }
.walkie-code { margin: 4px 0 6px; padding: 12px 14px; border-radius: 14px; background: var(--accent-tint); }
.walkie-code p { margin: 0 0 10px; font-size: 14px; line-height: 1.4; color: var(--ink); }
.walkie-code[hidden], #walkie-lock[hidden], #walkie-targets[hidden], #walkie-to-label[hidden], #walkie-code-input[hidden] { display: none; }
.pick .live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--info);
  vertical-align: 1px;
}

.ptt-wrap { display: grid; place-items: center; padding: 24px 0 8px; }
.ptt {
  width: 188px; height: 188px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font: inherit;
  cursor: pointer;
  box-shadow: var(--lift-2), inset 0 -6px 0 rgba(0, 0, 0, 0.14);
  /* a long press must stay a press: no selection, no callout, no scroll */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  transition: transform var(--dur-press) var(--ease), background var(--dur) var(--ease);
}
.ptt .icon { width: 42px; height: 42px; }
.ptt-label { font-size: 18px; font-weight: 750; letter-spacing: -0.2px; }
.ptt-sub { min-height: 1.25em; font-size: 13px; color: rgba(255, 255, 255, 0.88); font-variant-numeric: tabular-nums; }
.ptt:disabled { background: #dde3e8; color: var(--muted); box-shadow: none; cursor: default; }
.ptt:disabled .ptt-sub { color: var(--muted); }
.ptt.tx { background: var(--danger); transform: scale(0.96); animation: ptt-air 1.2s ease-out infinite; }
.ptt.rx { background: var(--info-ink); }
.ptt:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
@keyframes ptt-air {
  from { box-shadow: var(--lift-2), 0 0 0 0 rgba(196, 38, 44, 0.45); }
  to   { box-shadow: var(--lift-2), 0 0 0 26px rgba(196, 38, 44, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ptt.tx, .walkie-btn.rx, .wp-bars i, .walkie-pill { animation: none; }
}

/* ---------- My boats ---------- */
.boat-mini {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 8px 12px 8px 8px;
  border: 1.5px solid var(--line); border-radius: 16px;
  background: #fff; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.bm-pic { flex: 0 0 auto; width: 72px; height: 46px; border-radius: 10px; overflow: hidden; background: #dbe6f2; }
.bm-pic img, .bm-pic svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.bm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bm-main b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-main span { font-size: 13px; color: var(--muted); }
.bm-go { font-size: 24px; color: var(--muted); }

.boat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.boat-card {
  position: relative; display: flex; flex-direction: column;
  padding: 0; border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden;
  background: #fff; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.boat-card.current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.bc-pic { display: block; aspect-ratio: 16 / 10; background: #dbe6f2; }
.bc-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bc-main { display: flex; flex-direction: column; padding: 8px 10px 10px; min-width: 0; }
.bc-main b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-main span { font-size: 12.5px; color: var(--muted); }
.bc-badge {
  position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700;
}
.bc-fuel { display: block; height: 4px; margin: 0 10px 10px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bc-fuel i { display: block; height: 100%; background: var(--info); }
.boat-card.add {
  align-items: center; justify-content: center; gap: 4px; min-height: 150px;
  border-style: dashed; color: var(--accent-deep);
}
.bc-plus { font-size: 30px; line-height: 1; }

.boat-hero { aspect-ratio: 16 / 9; background: #dbe6f2; overflow: hidden; }
.boat-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin-top: -2px; }
.ph {
  position: relative; flex: 0 0 auto; width: 84px; height: 64px;
  border-radius: 10px; overflow: hidden; background: #dbe6f2;
}
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph.cover { box-shadow: 0 0 0 2px var(--accent); }
.ph-tag {
  position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px;
  background: rgba(18, 22, 28, 0.72); color: #fff; font-size: 10.5px; font-weight: 700;
}
.ph-del, .ph-cover {
  position: absolute; top: 3px; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: rgba(18, 22, 28, 0.66); color: #fff; font-size: 12px; cursor: pointer;
  display: grid; place-items: center;
}
.ph-del { right: 3px; }
.ph-cover { left: 3px; }
.ph.add {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1.5px dashed var(--accent); background: var(--accent-tint);
  color: var(--accent-deep); font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer;
  width: 104px;
}
.ph.add span { font-size: 20px; line-height: 1.1; }
.boat-current { width: 100%; margin: 4px 0 14px; }

.fuel-card {
  margin: 0 0 16px; padding: 14px; border-radius: 16px;
  background: #f4f7f9; border: 1px solid var(--line);
}
.fuel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fuel-head h4 { margin: 0; font-size: 16px; }
.fuel-head span { font-size: 12.5px; color: var(--muted); }
.fuel-gauge { height: 12px; margin: 10px 0 8px; border-radius: 999px; background: #dde3e8; overflow: hidden; }
.fuel-gauge[hidden] { display: none; }
.fuel-gauge i { display: block; height: 100%; border-radius: 999px; background: var(--info); transition: width var(--dur) var(--ease); }
.fuel-gauge.mid i { background: var(--caution); }
.fuel-gauge.low i { background: var(--danger); }
.fuel-line { margin: 6px 0 10px; font-size: 14.5px; line-height: 1.4; }
.fuel-form { margin-bottom: 10px; }
.fuel-form[hidden], #fuel-log-open[hidden] { display: none; }
.fuel-form .btn { width: 100%; margin-top: 10px; }
.fuel-log { list-style: none; margin: 10px 0 0; padding: 0; }
.fuel-log li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--sub); }
.fl-del { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 6px; cursor: pointer; }
.dock-line { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dock-line:empty { display: none; }
.dl-main { font-size: 14.5px; }
.dl-said { grid-column: 1; font-size: 12.5px; color: var(--muted); }
.dl-go { grid-row: 1 / span 2; grid-column: 2; }
.boat-remove { width: 100%; margin-top: 18px; color: var(--danger); }

/* ---------- Tides ---------- */
.cond-tide {
  border: 0; background: none; padding: 0; font: inherit; color: var(--accent-deep);
  font-weight: 700; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.cond-tide[hidden] { display: none; }
.tide-now { margin: 0 0 10px; font-size: 16px; font-weight: 650; }
.tide-chart { margin: 0 -4px 8px; }
.tide-chart svg { width: 100%; height: auto; display: block; font: 12px -apple-system, system-ui, sans-serif; fill: var(--sub); }
.tc-area { fill: #dbe9fb; }
.tc-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.tc-now { stroke: var(--danger); stroke-width: 2; stroke-dasharray: 4 3; }
.tc-nowlabel { fill: var(--danger); font-weight: 700; }
.tc-day { stroke: var(--line); stroke-width: 1.5; }
.tc-daylabel { fill: var(--muted); font-weight: 650; }
.tide-turns { list-style: none; margin: 0 0 8px; padding: 0; }
.tide-turns li {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: center;
  padding: 8px 2px; border-top: 1px solid var(--line); font-size: 14.5px;
}
.tt-type { font-weight: 750; }
.tt-type.high { color: var(--accent-deep); }
.tt-type.low { color: var(--sub); }
.tt-h { color: var(--muted); font-variant-numeric: tabular-nums; }
.popup-tide { font-size: 13px; color: var(--accent-deep); font-weight: 650; margin: -2px 0 8px; }
.route-tide { margin-top: 4px; font-size: 12.5px; color: var(--accent-deep); font-weight: 650; white-space: normal; line-height: 1.35; }
.route-tide[hidden] { display: none; }
.bar-tide { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--accent-tint); font-size: 13.5px; line-height: 1.45; color: var(--ink); }

/* ---------- The week ahead ---------- */
.cond-link {
  border: 0; background: none; padding: 0; font: inherit; color: var(--accent-deep);
  font-weight: 700; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.cond-link[hidden] { display: none; }
.wx-outlook { cursor: pointer; }
.week-where { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.week-list { list-style: none; margin: 0 0 10px; padding: 0; }
.wk-day { border-top: 1px solid var(--line); }
.wk-row {
  display: grid; grid-template-columns: 86px 74px 1fr; gap: 10px; align-items: center;
  width: 100%; padding: 10px 2px; border: 0; background: none; font: inherit; color: var(--ink);
  text-align: left; cursor: pointer;
}
.wk-name b { display: block; font-size: 15px; }
.wk-name small, .wk-wind small { display: block; font-size: 12px; color: var(--muted); }
.wk-wind b { font-size: 14.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.wk-level {
  justify-self: start; padding: 3px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 750; color: #fff;
}
.lvl-light .wk-level { background: var(--info-ink); }
.lvl-moderate .wk-level { background: var(--accent-deep); }
.lvl-fresh .wk-level { background: var(--caution-ink); }
.lvl-strong .wk-level { background: var(--danger); }
.wk-detail { padding: 0 2px 12px; }
.wk-detail[hidden] { display: none; }
.wk-detail p { margin: 0 0 6px; font-size: 14px; font-weight: 650; }
.week-chart { width: 100%; height: auto; display: block; font: 11px -apple-system, system-ui, sans-serif; fill: var(--sub); }
.wc-gust { stroke: var(--ink); stroke-width: 2; }
.wc-kn { fill: var(--ink); font-weight: 650; }
.wc-arrow { fill: var(--sub); }
.wc-key { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 0 0; }
.wc-k-bar { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--accent); }
.wc-k-gust { display: inline-block; width: 12px; height: 2px; background: var(--ink); margin-left: 8px; }
.week-bom { display: block; margin-top: 12px; text-align: center; text-decoration: none; }

/* ---------- The way in: sign-in gate, in the website's look ---------- */
@font-face { font-family: 'Inter Tight'; src: url('../vendor/fonts/inter-tight-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; src: url('../vendor/fonts/instrument-serif-italic-latin.woff2') format('woff2'); font-display: swap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

#join.gate {
  --g-ink: #eef2f7; --g-sub: #a4b3c6; --g-line: rgba(238, 242, 247, .16);
  --g-aqua: #7fe3ff; --g-gold: #ffd27a; --g-err: #ff8f84;
  z-index: 2500; display: block; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(130% 75% at 50% 16%, #0c2c47 0%, #051424 46%, #02070d 100%);
  color: var(--g-ink); font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  animation: gate-in .6s cubic-bezier(.2, .7, .2, 1) both;
}
#join.gate[hidden] { display: none; }
#join.gate.closing { animation: gate-out .45s ease forwards; }
@keyframes gate-in { from { opacity: 0; } }
@keyframes gate-out { to { opacity: 0; transform: scale(1.02); } }
body.gated #sos { z-index: 2600; }

/* sky, star, sea */
.gate-sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.gate-stars { position: absolute; left: 50%; top: 0; width: 1800px; margin-left: -900px; height: 62%; }
.gate-stars::before { content: ""; position: absolute; width: 1px; height: 1px; border-radius: 50%; box-shadow: 663px 154px 0 .4px rgba(230,240,255,.35), 148px 548px 0 0 rgba(230,240,255,.7), 1193px 59px 0 .8px rgba(230,240,255,.5), 76px 88px 0 .4px rgba(230,240,255,.9), 143px 246px 0 0 rgba(230,240,255,.9), 121px 579px 0 0 rgba(230,240,255,.5), 1291px 642px 0 .8px rgba(230,240,255,.35), 1181px 599px 0 .4px rgba(230,240,255,.35), 452px 47px 0 .8px rgba(230,240,255,.5), 593px 429px 0 0 rgba(230,240,255,.35), 1169px 315px 0 .8px rgba(230,240,255,.5), 211px 595px 0 .8px rgba(230,240,255,.5), 762px 99px 0 .8px rgba(230,240,255,.35), 1155px 61px 0 .8px rgba(230,240,255,.5), 1016px 696px 0 .8px rgba(230,240,255,.9), 1591px 321px 0 .4px rgba(230,240,255,.9), 740px 306px 0 0 rgba(230,240,255,.5), 1431px 249px 0 0 rgba(230,240,255,.7), 1075px 506px 0 0 rgba(230,240,255,.9), 589px 623px 0 0 rgba(230,240,255,.35), 1048px 428px 0 0 rgba(230,240,255,.7), 311px 500px 0 .4px rgba(230,240,255,.35), 1368px 79px 0 .8px rgba(230,240,255,.7), 696px 711px 0 0 rgba(230,240,255,.9), 1187px 467px 0 0 rgba(230,240,255,.35), 552px 485px 0 0 rgba(230,240,255,.35), 1497px 718px 0 0 rgba(230,240,255,.9), 582px 395px 0 0 rgba(230,240,255,.35), 945px 363px 0 0 rgba(230,240,255,.35), 1011px 60px 0 0 rgba(230,240,255,.7), 264px 253px 0 .4px rgba(230,240,255,.9), 1784px 508px 0 0 rgba(230,240,255,.5), 919px 411px 0 .8px rgba(230,240,255,.7), 280px 440px 0 .8px rgba(230,240,255,.7), 1446px 425px 0 0 rgba(230,240,255,.9), 472px 154px 0 0 rgba(230,240,255,.5), 309px 237px 0 0 rgba(230,240,255,.35), 993px 603px 0 0 rgba(230,240,255,.7), 577px 4px 0 0 rgba(230,240,255,.9), 1094px 378px 0 .8px rgba(230,240,255,.7), 257px 707px 0 .8px rgba(230,240,255,.35), 935px 696px 0 .8px rgba(230,240,255,.9), 815px 408px 0 .4px rgba(230,240,255,.35), 986px 649px 0 .4px rgba(230,240,255,.35), 390px 68px 0 0 rgba(230,240,255,.9), 332px 112px 0 0 rgba(230,240,255,.35), 209px 0px 0 .8px rgba(230,240,255,.5), 1098px 103px 0 0 rgba(230,240,255,.35), 144px 212px 0 .8px rgba(230,240,255,.9), 304px 649px 0 0 rgba(230,240,255,.7), 1233px 372px 0 .4px rgba(230,240,255,.35), 236px 499px 0 .4px rgba(230,240,255,.9), 990px 319px 0 0 rgba(230,240,255,.5), 209px 350px 0 0 rgba(230,240,255,.9), 1697px 708px 0 0 rgba(230,240,255,.35), 420px 540px 0 0 rgba(230,240,255,.5), 1413px 556px 0 0 rgba(230,240,255,.7), 1316px 93px 0 0 rgba(230,240,255,.7), 342px 364px 0 0 rgba(230,240,255,.7), 1303px 228px 0 .8px rgba(230,240,255,.5), 1650px 245px 0 .4px rgba(230,240,255,.5), 409px 530px 0 .4px rgba(230,240,255,.7), 1497px 29px 0 0 rgba(230,240,255,.7), 967px 265px 0 0 rgba(230,240,255,.7), 915px 357px 0 0 rgba(230,240,255,.35), 451px 104px 0 0 rgba(230,240,255,.9), 402px 345px 0 0 rgba(230,240,255,.9), 1278px 624px 0 0 rgba(230,240,255,.9), 1337px 352px 0 0 rgba(230,240,255,.35), 795px 204px 0 .4px rgba(230,240,255,.5), 888px 651px 0 0 rgba(230,240,255,.35), 1640px 405px 0 .4px rgba(230,240,255,.9), 1522px 86px 0 0 rgba(230,240,255,.5), 260px 28px 0 0 rgba(230,240,255,.9), 1651px 671px 0 0 rgba(230,240,255,.9), 1346px 358px 0 0 rgba(230,240,255,.5), 43px 14px 0 0 rgba(230,240,255,.5), 888px 199px 0 0 rgba(230,240,255,.35), 515px 217px 0 0 rgba(230,240,255,.5), 1564px 600px 0 0 rgba(230,240,255,.7), 1114px 429px 0 0 rgba(230,240,255,.35), 1515px 362px 0 .4px rgba(230,240,255,.9), 1693px 513px 0 0 rgba(230,240,255,.5), 1072px 522px 0 0 rgba(230,240,255,.9), 1590px 187px 0 .8px rgba(230,240,255,.35), 1589px 153px 0 0 rgba(230,240,255,.5), 969px 633px 0 0 rgba(230,240,255,.35), 667px 698px 0 .8px rgba(230,240,255,.9), 1606px 108px 0 .8px rgba(230,240,255,.35), 508px 195px 0 0 rgba(230,240,255,.35), 1581px 100px 0 .8px rgba(230,240,255,.9), 1150px 28px 0 0 rgba(230,240,255,.9), 666px 627px 0 .8px rgba(230,240,255,.5), 1418px 283px 0 .4px rgba(230,240,255,.9), 1039px 253px 0 .8px rgba(230,240,255,.7), 1145px 207px 0 .4px rgba(230,240,255,.5), 853px 124px 0 .4px rgba(230,240,255,.9), 647px 74px 0 0 rgba(230,240,255,.9), 149px 217px 0 0 rgba(230,240,255,.35), 1591px 158px 0 0 rgba(230,240,255,.5), 518px 140px 0 .4px rgba(230,240,255,.5), 1529px 96px 0 .4px rgba(230,240,255,.9), 333px 683px 0 0 rgba(230,240,255,.5), 1446px 441px 0 .8px rgba(230,240,255,.9), 694px 431px 0 0 rgba(230,240,255,.7), 652px 94px 0 0 rgba(230,240,255,.35), 692px 567px 0 .4px rgba(230,240,255,.9), 1440px 18px 0 .4px rgba(230,240,255,.7), 1059px 638px 0 0 rgba(230,240,255,.35), 231px 234px 0 0 rgba(230,240,255,.35), 543px 278px 0 0 rgba(230,240,255,.5), 553px 132px 0 .4px rgba(230,240,255,.7), 831px 152px 0 .8px rgba(230,240,255,.9), 1434px 334px 0 0 rgba(230,240,255,.7), 117px 704px 0 0 rgba(230,240,255,.9), 148px 275px 0 0 rgba(230,240,255,.35), 1641px 266px 0 0 rgba(230,240,255,.5), 136px 270px 0 0 rgba(230,240,255,.9), 23px 347px 0 .8px rgba(230,240,255,.9), 548px 636px 0 0 rgba(230,240,255,.35), 1079px 244px 0 0 rgba(230,240,255,.5), 536px 51px 0 0 rgba(230,240,255,.5), 638px 643px 0 0 rgba(230,240,255,.5), 593px 456px 0 .8px rgba(230,240,255,.5), 554px 355px 0 0 rgba(230,240,255,.7), 75px 15px 0 0 rgba(230,240,255,.5), 1053px 486px 0 0 rgba(230,240,255,.9), 217px 674px 0 .4px rgba(230,240,255,.9), 1118px 402px 0 .8px rgba(230,240,255,.7), 1408px 220px 0 0 rgba(230,240,255,.7), 406px 651px 0 0 rgba(230,240,255,.9), 711px 55px 0 0 rgba(230,240,255,.35), 144px 640px 0 0 rgba(230,240,255,.9), 334px 56px 0 0 rgba(230,240,255,.9), 1782px 518px 0 0 rgba(230,240,255,.5), 1418px 300px 0 0 rgba(230,240,255,.9), 379px 161px 0 0 rgba(230,240,255,.9), 7px 269px 0 0 rgba(230,240,255,.7), 1120px 331px 0 0 rgba(230,240,255,.35), 633px 223px 0 0 rgba(230,240,255,.5), 2px 343px 0 .4px rgba(230,240,255,.35), 972px 285px 0 .8px rgba(230,240,255,.5), 508px 516px 0 0 rgba(230,240,255,.35), 541px 91px 0 0 rgba(230,240,255,.9), 1201px 42px 0 .4px rgba(230,240,255,.35), 613px 311px 0 0 rgba(230,240,255,.35), 1199px 541px 0 0 rgba(230,240,255,.9), 1565px 333px 0 .4px rgba(230,240,255,.5), 581px 633px 0 0 rgba(230,240,255,.35), 1689px 525px 0 .4px rgba(230,240,255,.5); animation: gate-twinkle 5s ease-in-out infinite alternate; }
@keyframes gate-twinkle { to { opacity: .55; } }
.gate-star {
  position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 34px); width: 220px; height: 220px; margin-left: -110px;
  background:
    radial-gradient(circle, #fff 0 2.5px, rgba(255, 236, 196, .95) 3.5px, rgba(255, 210, 122, .35) 9px, rgba(255, 210, 122, .08) 34px, transparent 70%),
    linear-gradient(90deg, transparent 8%, rgba(255, 220, 160, .55) 50%, transparent 92%) center / 100% 1.5px no-repeat,
    linear-gradient(0deg, transparent 8%, rgba(255, 220, 160, .55) 50%, transparent 92%) center / 1.5px 100% no-repeat;
  filter: drop-shadow(0 0 18px rgba(255, 210, 122, .35));
  animation: gate-pulse 4.5s ease-in-out infinite;
}
@keyframes gate-pulse { 50% { transform: scale(.92); opacity: .85; } }
.gate-glint {
  position: absolute; left: 50%; top: 61%; width: 90px; height: 39%; margin-left: -45px;
  background: repeating-linear-gradient(180deg, rgba(255, 214, 150, .55) 0 2px, transparent 2px 9px);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); mask-image: linear-gradient(180deg, #000, transparent 85%);
  filter: blur(.6px); opacity: .7; animation: gate-shimmer 2.4s linear infinite;
}
@keyframes gate-shimmer { to { background-position: 0 18px; } }
.gate-sea { position: absolute; left: 0; right: 0; top: 60%; bottom: 0; }
.gate-wave { position: absolute; left: 0; right: 0; background-repeat: repeat-x; background-size: 1200px 100%; }
.gate-wave.w1 { top: 0; height: 60px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1200' height='200' preserveAspectRatio='none'><path d='M0 40 Q150 14 300 40 T600 40 T900 40 T1200 40 V200 H0 Z' fill='%232f7fb6' fill-opacity='.28'/></svg>"); animation: gate-drift 22s linear infinite; }
.gate-wave.w2 { top: 18px; height: 90px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1200' height='200' preserveAspectRatio='none'><path d='M0 46 Q150 20 300 46 T600 46 T900 46 T1200 46 V200 H0 Z' fill='%23174d78' fill-opacity='.55'/></svg>"); animation: gate-drift 15s linear infinite reverse; }
.gate-wave.w3 { top: 46px; bottom: 0; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1200' height='200' preserveAspectRatio='none'><path d='M0 40 Q150 14 300 40 T600 40 T900 40 T1200 40 V200 H0 Z' fill='%2306182a' fill-opacity='1'/></svg>"); background-size: 1200px 160px; background-color: transparent; animation: gate-drift 11s linear infinite; }
.gate-wave.w3::after { content: ""; position: absolute; left: 0; right: 0; top: 150px; bottom: 0; background: #06182a; }
@keyframes gate-drift { to { background-position-x: -1200px; } }

/* top bar */
.gate-top {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; box-sizing: border-box; padding: calc(18px + env(safe-area-inset-top, 0px)) 22px 0;
}
.gate-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.gate-brand svg { width: 15px; height: 15px; fill: var(--g-gold); animation: gate-spin 16s linear infinite; }
@keyframes gate-spin { to { transform: rotate(360deg); } }
.gate-sos {
  margin-left: auto; border: 1px solid rgba(255, 120, 110, .55); background: rgba(196, 38, 44, .18); color: #ffb0a8;
  font: 700 13px/1 'Inter Tight', sans-serif; letter-spacing: .08em; padding: 10px 16px; border-radius: 999px; cursor: pointer;
}
.gate-sos:active { transform: scale(.96); }
#join.gate .join-x { position: static; background: rgba(238, 242, 247, .1); color: var(--g-ink); }
#join.gate[data-mode="gate"] .join-x { display: none; }

/* the card */
#join.gate .modal.join {
  position: relative; z-index: 2; width: min(440px, calc(100% - 32px)); margin: clamp(96px, 19vh, 170px) auto calc(28px + env(safe-area-inset-bottom, 0px));
  padding: 26px 24px 22px; border-radius: 28px; text-align: left; color: var(--g-ink); max-height: none; overflow: visible;
  background: rgba(6, 16, 30, .58); border: 1px solid var(--g-line);
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
  animation: gate-card .7s .1s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes gate-card { from { opacity: 0; transform: translateY(24px); } }
#join.gate .join-step { animation: gate-step .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes gate-step { from { opacity: 0; transform: translateY(10px); } }
#join.gate .join-steps { margin: 0 0 20px; }
#join.gate .join-steps i { background: rgba(238, 242, 247, .16); }
#join.gate .join-steps i.on { background: var(--g-aqua); }
.gate-kicker { margin: 0; color: var(--g-aqua); font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.gate-title { margin: 10px 0 12px !important; font-size: clamp(36px, 10.5vw, 48px) !important; line-height: .95; letter-spacing: -.045em; font-weight: 500; }
.gate-title em { font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: -.02em; color: var(--g-gold); }
#join.gate .join-sub { color: var(--g-sub); font-size: 15px; line-height: 1.5; margin: 0 0 20px; }
#join.gate .join-sub b { color: var(--g-ink); font-weight: 600; }
#join.gate input {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(238, 242, 247, .2); border-radius: 16px;
  color: var(--g-ink); font: 500 17px 'Inter Tight', sans-serif; padding: 16px 16px; transition: border-color .2s, box-shadow .2s;
}
#join.gate input::placeholder { color: #5d6c80; }
#join.gate input:focus { border-color: var(--g-aqua); box-shadow: 0 0 0 4px rgba(127, 227, 255, .14); }
#join.gate .btn.primary {
  margin-top: 14px; height: 54px; border: 0; border-radius: 999px; background: var(--g-gold); color: #02070d;
  font: 600 16px 'Inter Tight', sans-serif; letter-spacing: -.01em; box-shadow: 0 12px 30px -12px rgba(255, 210, 122, .55);
  transition: transform .2s, filter .2s, opacity .2s;
}
#join.gate .btn.primary:active { transform: scale(.98); }
#join.gate .btn.primary:disabled { opacity: .6; }
#join.gate .join-err { color: var(--g-err); font-weight: 600; }
#join.gate .join-err.info { color: var(--g-sub); font-weight: 500; }
#join.gate .join-link { color: var(--g-aqua); font-family: 'Inter Tight', sans-serif; font-weight: 600; }
#join.gate .join-link:disabled { color: #5d6c80; cursor: default; }
.gate-fine { margin: 18px 0 0; color: #66768b; font-size: 11.5px; line-height: 1.5; text-align: center; }
.gate-fine a { color: #8fa0b4; }

/* six boxes over one real input, so paste and iOS code autofill just work */
.code-wrap { position: relative; }
.code-boxes { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.code-box {
  position: relative; height: 62px; display: grid; place-items: center; border-radius: 14px;
  border: 1px solid rgba(238, 242, 247, .2); background: rgba(255, 255, 255, .05);
  font-size: 27px; font-weight: 600; font-variant-numeric: tabular-nums; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.code-box.filled { border-color: rgba(127, 227, 255, .45); }
.code-wrap.focus .code-box.active { border-color: var(--g-aqua); box-shadow: 0 0 0 4px rgba(127, 227, 255, .14); }
.code-wrap.focus .code-box.active::after { content: ""; width: 2px; height: 26px; background: var(--g-aqua); animation: gate-caret 1s steps(1) infinite; }
@keyframes gate-caret { 50% { opacity: 0; } }
.code-wrap.shake .code-boxes { animation: gate-shake .4s; }
.code-wrap.shake .code-box { border-color: var(--g-err); }
@keyframes gate-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
#join.gate #join-code {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; box-shadow: none;
  opacity: .01; color: transparent; caret-color: transparent; letter-spacing: 0; font-size: 16px;
}
.wait-badge {
  display: flex; align-items: center; gap: 10px; margin: 0 0 6px; padding: 14px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(238, 242, 247, .14); font-weight: 600; font-size: 15px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wait-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--g-gold); box-shadow: 0 0 0 0 rgba(255, 210, 122, .6); animation: wait-pulse 1.8s ease-out infinite; }
@keyframes wait-pulse { to { box-shadow: 0 0 0 12px rgba(255, 210, 122, 0); } }
#join.gate .join-face { filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .45)); }

@media (min-width: 900px) {
  #join.gate .modal.join { margin-top: 22vh; padding: 32px 32px 26px; }
}
@media (prefers-reduced-motion: reduce) {
  #join.gate, #join.gate .modal.join, #join.gate .join-step, .gate-stars::before, .gate-star, .gate-glint, .gate-wave, .gate-brand svg, .wait-dot { animation: none !important; }
}

/* ---------- Main screen, in the TideWay look ----------
   The map and panels stay light: they are read in full sun on a boat, which
   the accessibility pass was right about. The brand comes in through the
   type, a night-blue search bar with the guiding star, one consistent glass
   style for every map button, and the gold report button. */
:root {
  --brand-night: #071526;
  --brand-night-2: #0c2b48;
  --brand-gold: #ffd27a;
  --brand-aqua: #7fe3ff;
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* map buttons: one glass family */
.sq-btn, .rd-btn {
  width: 52px; height: 52px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(7, 21, 38, .07);
  color: var(--brand-night);
  box-shadow: 0 8px 22px -6px rgba(7, 21, 38, .22), 0 1px 2px rgba(7, 21, 38, .08);
}
.sq-btn { border-radius: 17px; }
.tl-stack, .tr-stack { gap: 10px; }
.burger i { background: var(--brand-night); }
.sos-round {
  color: #c4262c; font-weight: 800; letter-spacing: .06em;
  box-shadow: 0 8px 22px -6px rgba(196, 38, 44, .35), 0 0 0 2px rgba(196, 38, 44, .28) inset;
}

/* FollowMe: straight from the map, glowing while a link is live */
.fm-btn svg { width: 24px; height: 24px; }
.fm-btn.on {
  background: var(--brand-night); color: var(--brand-aqua); border-color: rgba(127, 227, 255, .45);
  animation: fm-live 2s ease-out infinite;
}
@keyframes fm-live {
  0% { box-shadow: 0 8px 22px -6px rgba(7, 21, 38, .3), 0 0 0 0 rgba(127, 227, 255, .55); }
  100% { box-shadow: 0 8px 22px -6px rgba(7, 21, 38, .3), 0 0 0 14px rgba(127, 227, 255, 0); }
}

/* report: the brand gold, still the brightest thing on the screen */
.report-fab {
  width: 74px; height: 74px; border-radius: 26px;
  background: linear-gradient(160deg, #ffe39c 0%, #ffcc4d 100%);
  color: var(--brand-night);
  box-shadow: 0 16px 32px -10px rgba(230, 160, 20, .6), 0 2px 6px rgba(7, 21, 38, .18), inset 0 1px 0 rgba(255, 255, 255, .6);
}

/* where you are */
.place-pill {
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(7, 21, 38, .07);
  color: var(--brand-night); font-weight: 650; letter-spacing: -.02em;
  box-shadow: 0 8px 22px -6px rgba(7, 21, 38, .2);
}

/* the sheet */
.sheet { border-radius: 28px 28px 0 0; box-shadow: 0 -10px 40px rgba(7, 21, 38, .16); }
.grip { background: #d3dbe4; }

/* Where to? in night blue, with the guiding star */
.searchbar {
  background: linear-gradient(135deg, var(--brand-night-2) 0%, var(--brand-night) 100%);
  color: #eef2f7;
  box-shadow: 0 10px 24px -12px rgba(7, 21, 38, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.searchbar:active { background: linear-gradient(135deg, #103556 0%, #0a1d33 100%); }
.sb-icon { color: var(--brand-gold); }
.sb-ph { color: #eef2f7; font-weight: 600; letter-spacing: -.02em; }
.sb-mic { color: #a4b3c6; }
.live-badge { color: #7ff0b5; background: rgba(47, 220, 139, .16); }
.live-badge.stale { color: var(--brand-gold); background: rgba(255, 210, 122, .16); }
.live-badge.waiting { color: #a8c6ff; background: rgba(120, 160, 255, .18); }

/* shortcuts: pills */
.sc-card {
  border-radius: 999px; border-color: #e1e7ee; padding: 11px 16px;
  box-shadow: 0 1px 2px rgba(7, 21, 38, .05);
}
.sc-card:active { background: #f2f5f8; }
.sc-icon { color: var(--brand-night); }
.sc-name { font-weight: 650; letter-spacing: -.02em; color: var(--brand-night); }

/* section heads read like the website's labels */
.list-head { font-size: 12px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: #5c6b7a; }
.feed-count { letter-spacing: 0; text-transform: none; }

@media (min-width: 900px) {
  .sheet { border-radius: 26px; border: 1px solid rgba(7, 21, 38, .06); box-shadow: 0 24px 60px -20px rgba(7, 21, 38, .35); }
}
@media (prefers-reduced-motion: reduce) {
  .fm-btn.on { animation: none; box-shadow: 0 0 0 3px rgba(127, 227, 255, .5); }
}
