/* Seadromy charter v3 (identite/charte/charte-v3.md). Two layers:
   --sd-*: the brand palette, fixed values, never used for a role directly in a rule below;
   --rp-*: roles (surface, ink, accent, level, map…), set per theme from the palette.
   Dark is the primary theme; day = :root, dusk = dark, night = red on black. */
:root {
  --sd-navy: #0B2E57;
  --sd-blue-light: #6AAEE8;
  --sd-black: #0E1116;
  --sd-white: #FFFFFF;
  --sd-gray-900: #1A212B;
  --sd-gray-800: #2C3542;
  --sd-gray-700: #545E6B;
  --sd-gray-400: #9AA4B0;
  --sd-gray-200: #DDE2E8;
  --sd-gray-50: #F4F6F8;
  --sd-accent: #F5FF1F;
  /* v3 extensions: usage colours, always with a word or a symbol. */
  --sd-go: #1E7D43;
  --sd-go-dark: #4CBF7E;
  --sd-reserve: #B06D00;
  --sd-reserve-dark: #FFB400;
  --sd-no-go: #B3261E;
  --sd-no-go-dark: #FF6B60;
  --sd-gold: #C99A0E;
  --sd-blue-map: #1F6FD1;
  --sd-gold-dark: #F2C94C;
  /* Night: shades of one red on black, nothing else (keeps night vision at the helm). */
  --sd-night-black: #000000;
  --sd-night-900: #120303;
  --sd-night-800: #1F0505;
  --sd-night-700: #3A0B08;
  --sd-night-500: #7A1409;
  --sd-night-400: #B0362B;
  --sd-night-red: #FF4433;
  --sd-night-ink: #FF5A4A;
  --sd-night-link: #FF7A6B;
  --sd-night-reserve: #D9452F;

  /* Type, radii, spacing, elevation: one scale for every screen. */
  --rp-font-title: "Outfit", "Roboto", system-ui, sans-serif;
  --rp-font-text: "Roboto", system-ui, sans-serif;
  --rp-radius-s: 8px;
  --rp-radius-m: 12px;
  --rp-radius-l: 16px;
  --rp-radius-pill: 999px;
  --rp-space-1: 0.25em;
  --rp-space-2: 0.5em;
  --rp-space-3: 0.75em;
  --rp-space-4: 1em;
  --rp-space-5: 1.5em;
  /* Gap between the blocks of a panel screen (cards, banners, notes, actions). */
  --rp-rhythm: var(--rp-space-3);
  --rp-shadow-float: 0 2px 8px rgb(14 17 22 / 0.25);
  --rp-shadow-panel: 0 4px 16px rgb(14 17 22 / 0.25);
  --rp-shadow-sheet: 0 -4px 16px rgb(14 17 22 / 0.2);
  /* Data scale (Beaufort, sea state): measured values, outside the brand palette, always
     written out ("F5", "moderate"); calm end = grey 200 then the charter's light blue. */
  --sd-scale-4: #74C9B4;
  --sd-scale-5: #B5DC74;
  --sd-scale-6: #F2D34B;
  --sd-scale-7: #F39A3D;
  --sd-scale-8: #D9442F;
  --sd-scale-9: #8E2C77;
  --sd-scale-night-5: #4A0D07;
  --menu-width: min(85vw, 360px);

  /* Day roles. */
  --rp-navy: var(--sd-navy);
  --rp-bg: var(--sd-gray-50);
  --rp-surface: var(--sd-white);
  --rp-border: var(--sd-gray-200);
  --rp-ink: var(--sd-black);
  --rp-slate: var(--sd-gray-700);
  --rp-link: var(--sd-navy);
  --rp-focus: var(--sd-navy);
  /* Selected card, chosen option: marine by day, light blue on dark. */
  --rp-selected: var(--sd-navy);
  --rp-accent: var(--sd-accent);
  /* Lemon vanishes on white (1.1): light theme always outlines it in black. */
  --rp-accent-edge: var(--sd-black);
  --rp-ink-on-accent: var(--sd-black);
  --rp-on-selected: var(--sd-white);
  /* Information (sea point, forecast shift): light blue fill, ink text — never blue text on white. */
  --rp-info: var(--sd-blue-light);
  --rp-info-ink: var(--sd-black);
  --rp-danger: var(--sd-no-go);
  --rp-go: var(--sd-go);
  --rp-go-reserve: var(--sd-reserve);
  --rp-no-go: var(--sd-no-go);
  --rp-ink-on-status: var(--sd-black);
  /* Text on strong fills (error banner, verdicts): white by day, black on the brighter dark and night fills. */
  --rp-on-strong: var(--sd-white);
  /* Place levels: the word carries the meaning, the fill repeats it; ink text on both. */
  --rp-level-top: var(--sd-gold);
  --rp-level-reco: var(--sd-blue-light);
  --rp-level-fair: var(--sd-go);
  --rp-level-none: var(--sd-gray-700);
  --rp-level-top-ink: var(--sd-black);
  --rp-level-reco-ink: var(--sd-black);
  /* Pins (map and route card): departure marine, arrival lemon on a black edge. */
  --rp-pin-from: var(--sd-navy);
  --rp-pin-from-edge: var(--sd-navy);
  --rp-pin-to: var(--sd-accent);
  --rp-pin-to-edge: var(--sd-black);
  --rp-pin-dot: var(--sd-white);
  /* Place being proposed by a user (community): orange ring with a cross (shape tells it apart; night reuses a red). */
  --rp-pin-proposal: var(--sd-scale-7);
  /* Route on the map: sail lemon, engine grey 400, on a black casing; stage dots white. */
  --rp-map-sail: var(--sd-accent);
  --rp-map-motor: var(--sd-gray-400);
  --rp-map-casing: var(--sd-black);
  --rp-map-halo: var(--sd-white);
  --rp-map-link: var(--sd-navy);
  /* A delivery's alternative routes: the link colour, dashed and fainter than the route (map.js). */
  --rp-map-alt: var(--rp-map-link);
  --rp-map-cog: var(--sd-black);
  --rp-map-cog-halo: var(--sd-white);
  --rp-map-bearing: var(--sd-scale-9);
  --rp-map-dot: var(--sd-white);
  --rp-map-dot-ink: var(--sd-black);
  /* Boat and own position on the map. */
  --rp-boat: var(--sd-blue-light);
  --rp-boat-edge: var(--sd-white);
  /* Forecast layer (charter §8): wind particles and swell crests; arrows on the boat with a halo. */
  --rp-map-wind: var(--sd-white);   /* white on the plan as on the photo (Gabriel 28/10) */
  --rp-map-swell: var(--sd-gray-700);
  /* Available places on the map, three tiers on a contrasting edge: correct = grey, très bien = blue, incontournable = gold. */
  --rp-place: var(--sd-blue-map);
  --rp-place-fair: var(--sd-gray-700);
  --rp-place-edge: var(--sd-white);
  --rp-wind-ink: var(--sd-black);
  --rp-wind-halo: var(--sd-white);
  --rp-swell-ink: var(--sd-blue-light);
  --rp-swell-halo: var(--sd-navy);
  /* Oculus and wordmark (brand.js): the light-background file of identite/logo. */
  --sd-oc-lid: var(--sd-navy);
  --sd-oc-white: var(--sd-white);
  --sd-oc-iris: var(--sd-blue-light);
  --sd-oc-pupil: var(--sd-navy);
  --sd-oc-needle-n: var(--sd-white);
  --sd-oc-needle-s: var(--sd-blue-light);
  --sd-oc-word: var(--sd-navy);
  /* Wave frieze: a quiet band in the theme's own blue. */
  --rp-frieze: var(--sd-navy);
  --rp-frieze-opacity: 0.18;
  /* Swell field on the map: the sea-state scale made continuous (swell-field.js), streaks over it. */
  --rp-swell-1: var(--sd-blue-light);
  --rp-swell-2: var(--sd-scale-4);
  --rp-swell-3: var(--sd-scale-6);
  --rp-swell-4: var(--sd-scale-7);
  --rp-swell-5: var(--sd-scale-8);
  --rp-swell-6: var(--sd-scale-9);
  --rp-map-swell-opacity: 0.85;
  --rp-map-swell-streak: var(--sd-white);
}

/* Dark roles. Two copies with identical content (checked by web/tests/tokens.test.mjs):
   before theme.js runs, the phone's setting decides; afterwards <html data-theme="dusk">. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --rp-bg: var(--sd-black);
    --rp-surface: var(--sd-gray-900);
    --rp-border: var(--sd-gray-800);
    --rp-ink: var(--sd-gray-50);
    --rp-slate: var(--sd-gray-400);
    --rp-link: var(--sd-blue-light);
    --rp-focus: var(--sd-accent);
    --rp-selected: var(--sd-blue-light);
    --rp-on-selected: var(--sd-black);
    --rp-accent-edge: transparent;
    --rp-danger: var(--sd-no-go-dark);
    --rp-go: var(--sd-go-dark);
    --rp-go-reserve: var(--sd-reserve-dark);
    --rp-no-go: var(--sd-no-go-dark);
    --rp-level-top: var(--sd-gold-dark);
    --rp-level-fair: var(--sd-go-dark);
    --rp-level-none: var(--sd-gray-400);
    --rp-pin-from-edge: var(--sd-gray-400);
    --rp-pin-to-edge: transparent;
    --rp-on-strong: var(--sd-black);
    --rp-map-link: var(--sd-blue-light);
    --rp-map-cog: var(--sd-gray-50);
    --rp-map-cog-halo: var(--sd-black);
    --rp-map-bearing: var(--sd-scale-7);
    --rp-map-wind: var(--sd-white);
    --rp-map-swell: var(--sd-blue-light);
    --rp-place: var(--sd-blue-light);
    --rp-place-fair: var(--sd-gray-400);
    --rp-place-edge: var(--sd-black);
    --rp-wind-ink: var(--sd-gray-50);
    --rp-wind-halo: var(--sd-black);
    --rp-swell-ink: var(--sd-blue-light);
    --rp-swell-halo: var(--sd-black);
    --sd-oc-lid: var(--sd-blue-light);
    --sd-oc-iris: var(--sd-navy);
    --sd-oc-pupil: var(--sd-blue-light);
    --sd-oc-needle-s: var(--sd-navy);
    --sd-oc-word: var(--sd-white);
    --rp-frieze: var(--sd-blue-light);
    --rp-frieze-opacity: 0.22;
    --rp-map-swell-opacity: 0.78;
    --rp-map-swell-streak: var(--sd-white);
  }
}

:root[data-theme="dusk"] {
  --rp-bg: var(--sd-black);
  --rp-surface: var(--sd-gray-900);
  --rp-border: var(--sd-gray-800);
  --rp-ink: var(--sd-gray-50);
  --rp-slate: var(--sd-gray-400);
  --rp-link: var(--sd-blue-light);
  --rp-focus: var(--sd-accent);
  --rp-selected: var(--sd-blue-light);
  --rp-on-selected: var(--sd-black);
  --rp-accent-edge: transparent;
  --rp-danger: var(--sd-no-go-dark);
  --rp-go: var(--sd-go-dark);
  --rp-go-reserve: var(--sd-reserve-dark);
  --rp-no-go: var(--sd-no-go-dark);
  --rp-level-top: var(--sd-gold-dark);
  --rp-level-fair: var(--sd-go-dark);
  --rp-level-none: var(--sd-gray-400);
  --rp-pin-from-edge: var(--sd-gray-400);
  --rp-pin-to-edge: transparent;
  --rp-on-strong: var(--sd-black);
  --rp-map-link: var(--sd-blue-light);
  --rp-map-cog: var(--sd-gray-50);
  --rp-map-cog-halo: var(--sd-black);
  --rp-map-bearing: var(--sd-scale-7);
  --rp-map-wind: var(--sd-white);
  --rp-map-swell: var(--sd-blue-light);
  --rp-place: var(--sd-blue-light);
  --rp-place-fair: var(--sd-gray-400);
  --rp-place-edge: var(--sd-black);
  --rp-wind-ink: var(--sd-gray-50);
  --rp-wind-halo: var(--sd-black);
  --rp-swell-ink: var(--sd-blue-light);
  --rp-swell-halo: var(--sd-black);
  --sd-oc-lid: var(--sd-blue-light);
  --sd-oc-iris: var(--sd-navy);
  --sd-oc-pupil: var(--sd-blue-light);
  --sd-oc-needle-s: var(--sd-navy);
  --sd-oc-word: var(--sd-white);
  --rp-frieze: var(--sd-blue-light);
  --rp-frieze-opacity: 0.22;
  --rp-map-swell-opacity: 0.78;
  --rp-map-swell-streak: var(--sd-white);
}

/* Night: red on black only — white or blue light ruins night vision at the helm.
   Statuses and levels keep their word, their colour becomes a shade of red. */
:root[data-theme="night"] {
  --rp-navy: var(--sd-night-800);
  --rp-bg: var(--sd-night-black);
  --rp-surface: var(--sd-night-900);
  --rp-border: var(--sd-night-700);
  --rp-ink: var(--sd-night-ink);
  --rp-slate: var(--sd-night-400);
  --rp-link: var(--sd-night-link);
  --rp-focus: var(--sd-night-red);
  --rp-selected: var(--sd-night-red);
  --rp-on-selected: var(--sd-night-black);
  --rp-info: var(--sd-night-700);
  --rp-info-ink: var(--sd-night-ink);
  --rp-accent: var(--sd-night-red);
  --rp-accent-edge: transparent;
  --rp-ink-on-accent: var(--sd-night-black);
  --rp-danger: var(--sd-night-red);
  --rp-go: var(--sd-night-400);
  --rp-go-reserve: var(--sd-night-reserve);
  --rp-no-go: var(--sd-night-ink);
  --rp-ink-on-status: var(--sd-night-black);
  --rp-on-strong: var(--sd-night-black);
  --rp-level-top: var(--sd-night-red);
  --rp-level-reco: var(--sd-night-800);
  --rp-level-fair: var(--sd-night-500);
  --rp-level-none: var(--sd-night-700);
  --rp-level-top-ink: var(--sd-night-black);
  --rp-level-reco-ink: var(--sd-night-ink);
  --rp-pin-from: var(--sd-night-500);
  --rp-pin-from-edge: var(--sd-night-red);
  --rp-pin-to: var(--sd-night-red);
  --rp-pin-to-edge: var(--sd-night-red);
  --rp-pin-dot: var(--sd-night-black);
  --rp-pin-proposal: var(--sd-night-400);
  --rp-map-sail: var(--sd-night-red);
  --rp-map-motor: var(--sd-night-400);
  --rp-map-casing: var(--sd-night-black);
  --rp-map-halo: var(--sd-night-link);
  --rp-map-dot: var(--sd-night-ink);
  --rp-map-dot-ink: var(--sd-night-black);
  --rp-boat: var(--sd-night-link);
  --rp-boat-edge: var(--sd-night-black);
  --rp-map-link: var(--sd-night-red);
  --rp-map-cog: var(--sd-night-ink);
  --rp-map-cog-halo: var(--sd-night-black);
  --rp-map-bearing: var(--sd-night-link);
  --rp-map-wind: var(--sd-night-ink);
  --rp-map-swell: var(--sd-night-400);
  --rp-place: var(--sd-night-ink);
  --rp-place-fair: var(--sd-night-400);
  --rp-place-edge: var(--sd-night-black);
  --rp-wind-ink: var(--sd-night-ink);
  --rp-wind-halo: var(--sd-night-black);
  --rp-swell-ink: var(--sd-night-link);
  --rp-swell-halo: var(--sd-night-black);
  --sd-oc-lid: var(--sd-night-red);
  --sd-oc-white: var(--sd-night-900);
  --sd-oc-iris: var(--sd-night-500);
  --sd-oc-pupil: var(--sd-night-red);
  --sd-oc-needle-n: var(--sd-night-black);
  --sd-oc-needle-s: var(--sd-night-500);
  --sd-oc-word: var(--sd-night-ink);
  --rp-frieze: var(--sd-night-red);
  --rp-frieze-opacity: 0.3;
  --rp-swell-1: var(--sd-night-700);
  --rp-swell-2: var(--sd-night-500);
  --rp-swell-3: var(--sd-night-400);
  --rp-swell-4: var(--sd-night-reserve);
  --rp-swell-5: var(--sd-night-red);
  --rp-swell-6: var(--sd-night-link);
  --rp-map-swell-opacity: 0.85;
  --rp-map-swell-streak: var(--sd-night-black);
}

/* Night: the basemap is painted in reds (basemap.js) and our marks take the night roles above. Only Mapbox's
   own logo and credits, which cannot be repainted, keep a red filter. */
:root[data-theme="night"] .mapboxgl-ctrl {
  filter: grayscale(1) brightness(0.55) sepia(1) saturate(6) hue-rotate(-50deg);
}
/* The white heart of Mapbox's pin. */
:root[data-theme="night"] .mapboxgl-marker > svg circle { fill: var(--sd-night-black); }
/* Night: the pins (departure, arrival, open place) are dark reds on a black sea: a bright contour shows them. */
:root[data-theme="night"] [data-testid^="marker-"] > svg {
  filter: drop-shadow(1px 0 0 var(--sd-night-ink)) drop-shadow(-1px 0 0 var(--sd-night-ink))
    drop-shadow(0 1px 0 var(--sd-night-ink)) drop-shadow(0 -1px 0 var(--sd-night-ink));
}

/* The open place: waves leave its ring, one every 1.2 s. Transform and opacity only (compositor, no layout),
   paused when the page is hidden, removed with the pin; a still ring (the map's own) when motion is reduced. */
/* Both waves stacked in one grid cell: no positioning of their own, whatever holds the marker. */
.place-ripple { display: grid; width: 30px; height: 30px; pointer-events: none; }
.place-ripple i {
  grid-area: 1 / 1; border-radius: 50%; box-sizing: border-box;
  border: 2px solid var(--rp-place); opacity: 0;
  animation: place-ripple 2.4s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
}
.place-ripple i + i { animation-delay: 1.2s; }
@keyframes place-ripple {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(2.4); opacity: 0; }
}
:root[data-page-hidden] .place-ripple i { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .place-ripple { display: none; }
}

* , *::before, *::after {
  box-sizing: border-box;
}

:focus-visible {
  outline: 2px solid var(--rp-focus);
  outline-offset: 2px;
}

/* One rule for every [hidden] element, instead of a per-class `.foo[hidden] { display:
   none }` override that's easy to forget for a new class. !important ensures hidden always
   wins over a class's own display. .side-menu doesn't use hidden at all — its slide
   transition needs to stay in the render tree, see [data-open] below — it combines
   data-open (visual) and inert (focus/screen reader) for its closed state. */
[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  max-inline-size: 100%;
}

body {
  background: var(--rp-bg);
  color: var(--rp-ink);
  font-family: var(--rp-font-text);
  line-height: 1.4;
}

/* Titles in Outfit SemiBold, text in Roboto (charter). */
h1, h2, h3, .credits-balance, .verdict, .nav-card-title, .nav-ask-title, .place-card-name {
  font-family: var(--rp-font-title);
  font-weight: 600;
}

h1, h2, h3, p {
  margin-block: 0 0.5em;
}

a {
  color: var(--rp-link);
}

/* Native controls (radio, checkbox, slider, select popups) follow the theme, never the browser blue. */
input[type="radio"], input[type="checkbox"], input[type="range"] {
  accent-color: var(--rp-selected);
}

:root { color-scheme: light; }
:root[data-theme="dusk"], :root[data-theme="night"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { color-scheme: dark; }
}

/* Icons: the shared library sprite (/icons.svg); sized by font-size, coloured by the text colour. */
.icon {
  display: inline-block;
  flex: none;
  inline-size: 1em;
  block-size: 1em;
  font-size: 24px;
  vertical-align: middle;
  overflow: visible;
}

/* --- Map-first shell ---
   The map fills the whole screen, behind everything. Over it: the floating bar (menu,
   search, balance) and a single panel — bottom sheet on phones (data-state: peek, half,
   full), fixed side panel from 900px. The nav screen sets body[data-screen="nav"]: the panel
   then becomes a transparent layer for the nav overlay (see "Navigation" below). */
/* Doubled class: beats .mapboxgl-map { position: relative } loaded after this file. */
.map-root.map-root {
  position: fixed;
  inset: 0;
  background: var(--rp-bg);
}

.topbar {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: calc(env(safe-area-inset-top, 0px) + 0.6em) 0.6em 0.6em;
  pointer-events: none;            /* la carte reste manipulable entre les boutons */
}

.topbar > * {
  pointer-events: auto;
}

.topbar-button,
.search-form,
.topbar .balance-chip {
  box-shadow: var(--rp-shadow-float);
}

/* .topbar prefix: .icon-button (declared later) would otherwise reset the background. */
.topbar .topbar-button {
  background: var(--rp-surface);
  color: var(--rp-ink);
  border-radius: var(--rp-radius-pill);
}

.search-form {
  flex: 1 1 auto;
  min-inline-size: 0;
  display: flex;
  align-items: center;
  background: var(--rp-surface);
  border-radius: var(--rp-radius-pill);
  padding-inline-start: 1em;
}

.search-input {
  flex: 1 1 auto;
  min-inline-size: 0;
  min-block-size: 44px;
  border: 0;
  background: transparent;
  color: var(--rp-ink);
  font: inherit;
  font-size: 1rem;
}

.search-input::placeholder {
  text-overflow: ellipsis;
}

.search-input:focus {
  outline: none;
}

.search-form:focus-within {
  outline: 2px solid var(--rp-focus);
}

.search-form .icon-button {
  color: var(--rp-ink);
}

/* Off the map: the bar's suggestions drop down under it, the same rows as the panel's list. */
.search-form {
  position: relative;
}

.search-results {
  position: absolute;
  inset-inline: 0;
  inset-block-start: calc(100% + 6px);
  z-index: 8;
  max-block-size: min(60vh, 28rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.5em;
  background: var(--rp-surface);
  border-radius: var(--rp-radius-l);
  box-shadow: var(--rp-shadow-float);
}

.search-results[hidden] {
  display: none;
}

/* Row chosen with the arrow keys: the same ring as the keyboard focus. */
.place-result.is-active {
  outline: 2px solid var(--rp-focus);
  outline-offset: -2px;
}

.panel {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  background: var(--rp-surface);
  color: var(--rp-ink);
  border-radius: var(--rp-radius-l) var(--rp-radius-l) 0 0;
  box-shadow: var(--rp-shadow-sheet);
  /* Peek: the handle and the first-use note in full, with its bottom margin. */
  max-block-size: calc(168px + env(safe-area-inset-bottom, 0px));
  transition: max-block-size 220ms ease;
  padding-block-end: env(safe-area-inset-bottom, 0px);
}

.panel[data-state="full"] {
  max-block-size: calc(100dvh - 72px - env(safe-area-inset-top, 0px));
}

/* Trip screen on phones: two positions only. Folded shows no photo and no body, only the head of the card;
   open goes to the very top of the screen. */
@media (max-width: 899px) {
  /* Folded on a step: as high as its lines, no empty band under the last one (Gabriel 28/10). */
  .panel[data-mode="two"][data-state="peek"] {
    max-block-size: calc(min(320px, 45dvh) + env(safe-area-inset-bottom, 0px));
  }
  .panel[data-mode="two"][data-state="full"] {
    block-size: 100dvh;
    max-block-size: none;
    z-index: 12;                 /* over the top bar: the sheet reaches the very top */
    padding-block-start: env(safe-area-inset-top, 0px);
    border-radius: 0;
  }
  /* Nothing above the sheet to reach into: the grip itself is 44 px high there. */
  .panel[data-mode="two"][data-state="full"] .panel-grip { block-size: 44px; }
  /* A trip's or a delivery's view, folded: one height whatever its lines, the overview included, so the step bar never
     moves (Gabriel 09/11: « Il faut que ce soit cohérent en termes de design », superseding « as high as its lines »,
     28/10); a longer fold scrolls inside the sheet. */
  .panel[data-mode="two"][data-state="peek"]:has(.voyage-step) {
    block-size: calc(256px + env(safe-area-inset-bottom, 0px));
    max-block-size: none;
  }
  /* Folded, the way back to the list waits for the open sheet: the bar heads the overview as it heads every step. */
  .panel[data-mode="two"][data-state="peek"] .voyage-view > .back-link { display: none; }
  /* The whole trip's opening keeps room for what a skipper must read first. */
  .panel[data-mode="two"][data-state="peek"]:has(.voyage-overview) {
    max-block-size: min(320px, 45dvh);
  }
  .panel[data-mode="two"][data-state="peek"] .voyage-step:not(.voyage-overview):not(.voyage-leg-card)
    > :not(.voyage-head):not(.voyage-stop-title):not(.voyage-fold-recap),
  .panel[data-mode="two"][data-state="peek"] .voyage-leg-card > :not(.voyage-head):not(.voyage-step-name):not(.voyage-stop-title):not(.voyage-fold-recap),
  .panel[data-mode="two"][data-state="peek"] .voyage-step .action-menu,
  .panel[data-mode="two"][data-state="peek"] .voyage-overview > :not(.voyage-head):not(.voyage-unjudged):not(.panel-action):not(.plan-note-short),
  .panel[data-mode="two"][data-state="peek"] .voyage-overview .voyage-head > .times-note,
  .panel[data-mode="two"][data-state="peek"] .voyage-drawer > :not(.voyage-drawer-head) {
    display: none;
  }
}

.panel-grip {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  block-size: 28px;
  border: 0;
  background: transparent;
  color: var(--rp-slate);
  cursor: grab;
  touch-action: none;
}

/* The finger's target is 44 px high: it reaches above the sheet's edge, over the map, around the arrow. */
.panel-grip::before {
  content: "";
  position: absolute;
  inset-block: -16px 0;
  inset-inline: calc(50% - 48px);
}

/* The arrow points where a tap sends the sheet: up to open it, down once it is fully open. */
.panel-grip-arrow {
  transition: transform 200ms ease;
}

.panel-grip[data-arrow="down"] .panel-grip-arrow {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .panel-grip-arrow { transition: none; }
}

.panel #view {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

/* A screen fills the panel's height, so its pinned action (.panel-action) sits at the foot. */
.panel #view > * {
  flex: 1 0 auto;
}

.offline-banner {
  position: fixed;
  inset-block-start: calc(env(safe-area-inset-top, 0px) + 64px);
  inset-inline: 0;
  z-index: 9;
}

/* Tablets: the bottom sheet keeps a reading width, centred, instead of a 768 px wide line. */
@media (min-width: 600px) and (max-width: 899px) {
  .panel {
    inline-size: min(100%, 600px);
    margin-inline: auto;
  }
}

@media (min-width: 900px) {
  .panel,
  .panel[data-state] {
    inset-inline: 0.75em auto;
    inset-block: 72px 0.75em;
    inline-size: 420px;
    max-block-size: none;
    padding-block-start: 0.75em;
    border-radius: var(--rp-radius-l);
    box-shadow: var(--rp-shadow-panel);
  }
  .panel-grip {
    display: none;
  }
  .search-form {
    flex: 0 1 420px;
  }
}

.balance-chip {
  flex: 0 0 auto;
  background: var(--rp-accent);
  color: var(--rp-ink-on-accent);
  box-shadow: inset 0 0 0 1px var(--rp-accent-edge);
  font-weight: 700;
  border-radius: var(--rp-radius-pill);
  padding-block: 0.4em;
  padding-inline: 0.85em;
  font-size: 0.9rem;
  white-space: nowrap;
}

.icon-button {
  flex: 0 0 auto;
  inline-size: 44px;
  block-size: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.icon-button:hover, .icon-button:focus-visible {
  background: color-mix(in srgb, var(--rp-ink) 10%, transparent);
}

main {
  flex: 1 1 auto;
  padding: 0 1em 1em;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 44px;
  padding-inline: 1.25em;
  border: none;
  border-radius: var(--rp-radius-s);
  background: var(--rp-accent);
  color: var(--rp-ink-on-accent);
  box-shadow: inset 0 0 0 1px var(--rp-accent-edge);
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  /* .btn-primary/.btn-secondary style both a <button> and an <a> (e.g. new-crossing,
     open-nav): the global `a { color: … }` rule never removes the underline, so it's
     done here. */
  text-decoration: none;
}

.btn-primary:hover, .btn-primary:focus-visible {
  filter: brightness(0.95);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 44px;
  padding-inline: 1.25em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
  color: var(--rp-ink);
  font-family: inherit;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}

.btn-secondary:hover, .btn-secondary:focus-visible {
  background: var(--rp-bg);
}

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  margin-block-start: 1em;
}

.info-banner {
  background: var(--rp-bg);
  border: 1px solid var(--rp-border);
  color: var(--rp-ink);
  border-radius: var(--rp-radius-s);
  padding: 0.75em 1em;
  margin-block-end: 1em;
}

.menu-scrim {
  position: fixed;
  inset: 0;
  background: rgb(14 17 22 / 0.45);
  z-index: 20;
}

.side-menu {
  position: fixed;
  inset-block: 0;
  inset-inline-end: calc(-1 * var(--menu-width));
  inline-size: var(--menu-width);
  block-size: 100%;
  background: var(--rp-surface);
  border-inline-start: 1px solid var(--rp-border);
  z-index: 30;
  display: flex;
  flex-direction: column;
  transition: inset-inline-end 0.25s ease;
  box-shadow: 0 0 24px rgb(14 17 22 / 0.25);
  /* Closed by default: visibility (not display) so the panel stays in the render tree —
     otherwise switching to [data-open] couldn't slide in from off-screen, it would just
     appear. hidden/inert stay reserved for keyboard/screen-reader closed state, not for
     this animation. */
  visibility: hidden;
}

.side-menu[data-open] {
  inset-inline-end: 0;
  visibility: visible;
}

.side-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75em 1em;
  border-block-end: 1px solid var(--rp-border);
}

.side-menu-title {
  display: flex;
  align-items: center;
}

.side-menu-title .brand-logo {
  block-size: 30px;
  inline-size: auto;
}

.side-menu-list {
  list-style: none;
  margin: 0;
  padding: 0.5em 0;
  overflow-y: auto;
}

.side-menu-list li a {
  display: flex;
  align-items: center;
  min-block-size: 44px;
  padding-inline: 1em;
  color: var(--rp-ink);
  text-decoration: none;
  text-align: start;
}

.side-menu-list li a:hover, .side-menu-list li a:focus-visible {
  background: var(--rp-bg);
}

/* One entry per section; language and display sit at the foot, above the frieze. */
.side-menu .lang-picker {
  margin-block-start: auto;
}

.error-banner {
  background: var(--rp-danger);
  color: var(--rp-on-strong);
  border-radius: var(--rp-radius-s);
  padding: 0.75em 1em;
  margin-block-end: 1em;
}

.login-view {
  max-inline-size: 360px;
  margin-inline: auto;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1em;
  margin-block-start: 1em;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}

.field label {
  font-weight: 500;
  text-align: start;
}

.field input {
  min-block-size: 44px;
  padding-inline: 0.75em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
  color: var(--rp-ink);
  font-family: inherit;
  font-size: 1rem;
}

.field input[readonly] {
  background: var(--rp-bg);
  color: var(--rp-slate);
}

.field input[aria-invalid="true"] {
  border-color: var(--rp-danger);
}

.form-error {
  color: var(--rp-danger);
  margin: 0;
}

.field select {
  min-block-size: 44px;
  padding-inline: 0.75em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
  color: var(--rp-ink);
  font-family: inherit;
  font-size: 1rem;
}

.field input[type="file"] {
  padding-block: 0.5em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
  color: var(--rp-ink);
  font-family: inherit;
  font-size: 0.9rem;
}

.field-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5em;
}

.field-checkbox input {
  min-block-size: auto;
  inline-size: 22px;
  block-size: 22px;
}

.warning-banner,
.danger-banner {
  background: var(--rp-bg);
  border: 1px solid var(--rp-go-reserve);
  color: var(--rp-ink);
  border-radius: var(--rp-radius-s);
  padding: 0.75em 1em;
  margin-block-end: 0;
}

.danger-banner {
  border: 2px solid var(--rp-danger);
  font-weight: 600;
}

/* The only .warning-banner outside #view (so outside main's padding: 1em): its own
   horizontal margin, so it doesn't touch the screen edges. */
#offline-banner {
  margin-inline: 0.75em;
  /* Clear of the map's layers disc (top right), which it would otherwise run under. */
  margin-inline-end: 64px;
}

.orc-search-row {
  display: flex;
  gap: 0.5em;
}

.orc-search-row input {
  flex: 1 1 auto;
  min-inline-size: 0;
  min-block-size: 44px;
  padding-inline: 0.75em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
  color: var(--rp-ink);
  font-family: inherit;
  font-size: 1rem;
}

.orc-results {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin-block-start: 0.5em;
}

.orc-result {
  text-align: start;
  justify-content: flex-start;
}

.orc-result[aria-pressed="true"] {
  border-color: var(--rp-focus);
  border-width: 2px;
}

/* One model per row, its certificates folded under "Choose a specific certificate". */
.orc-result { flex-direction: column; align-items: flex-start; padding-block: 0.5em; inline-size: 100%; }
.orc-model-meta { font-size: 0.875em; font-weight: 400; color: var(--rp-slate); }
.orc-certs summary { min-block-size: 44px; display: flex; align-items: center; cursor: pointer; color: var(--rp-link); }
.orc-certs ul { list-style: none; margin: 0.25em 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.25em; }
.orc-cert {
  inline-size: 100%;
  min-block-size: 44px;
  padding: 0.5em 0.75em;
  text-align: start;
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  background: var(--rp-surface);
  color: var(--rp-ink);
  font: inherit;
  font-size: 0.875em;
}
.orc-cert[aria-pressed="true"] { border-color: var(--rp-focus); border-width: 2px; }

.orc-selected {
  font-weight: 500;
  color: var(--rp-link);
}

.boat-list {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  margin-block: 1em;
}

.boat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  padding: 0.75em 1em;
  background: var(--rp-surface);
}

.boat-row-meta {
  color: var(--rp-slate);
  margin-block-end: 0;
}

.boat-default-badge {
  display: inline-block;
  background: transparent;
  color: var(--rp-ink);
  box-shadow: inset 0 0 0 1.5px var(--rp-selected);
  border-radius: var(--rp-radius-pill);
  padding: 0.2em 0.7em;
  font-size: 0.8rem;
  font-weight: 700;
  margin-block-start: 0.35em;
}

.boat-row-actions {
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
}

.boat-form {
  display: flex;
  flex-direction: column;
  gap: 1em;
  margin-block: 1em;
  padding: 1em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
}

/* The first boat inside a trip or crossing form: one frame, the fieldset's. */
.boat-inline .boat-form {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

/* Length and its unit on one line; the two polar percentages side by side. */
.boat-length-row { display: flex; gap: 0.5em; }
.boat-length-row input { flex: 1 1 auto; min-inline-size: 0; }
.boat-length-row select { flex: 0 0 auto; }
.boat-pct { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.boat-pct legend { padding: 0; margin-block-end: 0.35em; font-weight: 500; }
.boat-pct-row { display: flex; gap: 0.75em; flex-wrap: wrap; }
.boat-pct-row .field { flex: 1 1 7em; min-inline-size: 0; }

.boat-form-actions {
  display: flex;
  gap: 0.75em;
  flex-wrap: wrap;
}

.routing-list {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  margin-block: 1em;
}

.routing-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  padding: 0.75em 1em;
  background: var(--rp-surface);
}

.routing-row-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35em;
  flex: 1 1 220px;
  min-inline-size: 0;
  color: inherit;
  text-decoration: none;
}

.routing-row-meta {
  color: var(--rp-slate);
  margin: 0;
}

.routing-row-verdict {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--rp-radius-pill);
  padding: 0.2em 0.7em;
  color: var(--rp-on-strong);
  background: var(--rp-slate);
}

.routing-row-actions {
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
  align-items: center;
}

.rename-form {
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
  align-items: center;
}


.new-view {
  max-inline-size: 480px;
  margin-inline: auto;
}

.point-field {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin-block: 1em;
  padding: 1em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
}

.point-field h3 {
  font-size: 1rem;
  margin: 0;
}

.field-label {
  display: block;
  font-weight: 500;
  text-align: start;
  margin-block-end: 0.35em;
}

.search-row {
  display: flex;
  gap: 0.5em;
}

.search-row input {
  flex: 1 1 auto;
  min-inline-size: 0;
  min-block-size: 44px;
  padding-inline: 0.75em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
  color: var(--rp-ink);
  font-family: inherit;
  font-size: 1rem;
}

.place-results {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.place-result {
  text-align: start;
  justify-content: flex-start;
}

.chosen-point {
  font-weight: 500;
  color: var(--rp-link);
  margin: 0;
}

.radio-group {
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  padding: 0.75em 1em;
  margin: 1em 0;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.radio-group legend {
  font-weight: 500;
  padding-inline: 0.25em;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5em;
  min-block-size: 32px;
}

.radio-option input {
  inline-size: 20px;
  block-size: 20px;
  flex: 0 0 auto;
}

.submit-btn {
  inline-size: 100%;
}

.buy-credits-link {
  margin-block-end: 1em;
}

.routing-view {
  max-inline-size: 480px;
  margin-inline: auto;
}

.routing-waiting {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  align-items: flex-start;
}

.progress-track {
  position: relative;
  inline-size: 100%;
  block-size: 10px;
  border-radius: 5px;
  background: var(--rp-border);
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: 0;
  background: var(--rp-link);
  transition: inline-size 0.6s ease;
}

/* The stage under way: a moving stripe, never a made-up percentage. */
.progress-run {
  position: absolute;
  inset-block: 0;
  background: linear-gradient(90deg, transparent 0%, var(--rp-link) 50%, transparent 100%);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  opacity: 0.55;
  animation: progress-run 1.4s linear infinite;
}

@keyframes progress-run {
  from { background-position: -100% 0; }
  to { background-position: 200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-run { animation: none; background: var(--rp-link); opacity: 0.3; }
}

.progress-status {
  inline-size: 100%;
  display: flex;
  justify-content: space-between;
  gap: 1em;
  margin: 0;
}

.progress-elapsed {
  color: var(--rp-slate);
  font-variant-numeric: tabular-nums;
}

.progress-stages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  font-size: 0.9rem;
}

.progress-stages li {
  display: flex;
  align-items: center;
  gap: 0.5em;
  color: var(--rp-slate);
}

.progress-stages li::before {
  content: "";
  flex: none;
  inline-size: 0.8em;
  block-size: 0.8em;
  border-radius: 50%;
  border: 2px solid var(--rp-slate);
}

.progress-stages li[data-state="done"]::before {
  background: var(--rp-link);
  border-color: var(--rp-link);
}

.progress-stages li[data-state="current"] {
  color: var(--rp-ink);
  font-weight: 500;
}

.progress-stages li[data-state="current"]::before {
  border-color: var(--rp-link);
  animation: stage-pulse 1.2s ease-in-out infinite alternate;
}

@keyframes stage-pulse {
  from { box-shadow: 0 0 0 0 transparent; }
  to { box-shadow: 0 0 0 4px color-mix(in srgb, var(--rp-link) 35%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .progress-stages li[data-state="current"]::before { animation: none; }
}

.progress-detail {
  margin: 0;
  font-size: 0.85rem;
  color: var(--rp-slate);
}

.routing-result {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--rp-rhythm);
  padding-block-start: var(--rp-space-2);
}

.routing-result > :is(p, dl, div, section, ol) {
  margin-block: 0;
}

.routing-route { margin: 0; font-size: 1.35rem; overflow-wrap: anywhere; }

/* Folded on a phone: the route's name and « Follow the route », nothing else. */
@media (max-width: 899px) {
  .panel[data-state="peek"] .routing-result > :not(.routing-route):not(.panel-action):not(.visually-hidden):not(.plan-note-short) {
    display: none;
  }
}

.verdict-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--rp-space-2);
}

.verdict-chip {
  font-size: 1rem;
}

.verdict-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--rp-space-2);
}

.verdict-reason {
  margin: 0;
  color: var(--rp-ink);
}

/* The route summary is a description: secondary text, regular weight, a little smaller than body. */
.intro-text {
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--rp-slate);
}

/* Notes under a block ("Times shown: local time…"): a description, so the secondary text style. */
.times-note,
.forecast-at {
  margin: 0;
  font-size: 0.85rem;
  color: var(--rp-slate);
}

.verdict {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 1.3rem;
  border-radius: var(--rp-radius-s);
  padding: 0.4em 0.9em;
  margin: 0;
  color: var(--rp-on-strong);
  background: var(--rp-slate);
}

.verdict-icon {
  font-size: 1.4em;
  line-height: 1;
}

.verdict-go {
  background: var(--rp-go);
}

.verdict-go_reserve {
  background: var(--rp-go-reserve);
  color: var(--rp-ink-on-status);
}

.verdict-no_go {
  background: var(--rp-no-go);
}

.figures-list, .sea-block dl {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin: 0;
  padding: 1em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
}

.figure-row {
  display: flex;
  justify-content: space-between;
  gap: 1em;
}

.figure-row dt {
  color: var(--rp-slate);
  font-weight: 500;
}

.figure-row dd {
  margin: 0;
  font-weight: 700;
  /* "3.8 NM", "7 kn · 147°": direction comes from the value, not the page (otherwise in
     RTL the bidi algorithm would reverse number and unit). */
  unicode-bidi: plaintext;
  text-align: end;
}

.sea-block {
  margin-block: 0;
}

.sea-block h3 {
  font-size: 1rem;
}

.credits-view, .payment-view, .invoices-view, .account-view {
  max-inline-size: 480px;
  margin-inline: auto;
}

.credits-balance {
  font-size: 1.3rem;
  font-weight: 700;
}

.credit-lots, .packs, .ledger-lines, .invoice-list {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  margin-block: 1em;
}

.credit-lot, .pack, .ledger-line, .invoice-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  padding: 0.75em 1em;
  background: var(--rp-surface);
}

.credit-lot-expires, .ledger-line-label {
  color: var(--rp-slate);
}

.pack-name {
  font-weight: 500;
}

.pack-price {
  font-weight: 700;
}

.pack-text {
  display: flex;
  flex-direction: column;
  gap: 0.15em;
  flex: 1 1 10em;
}

.pack-unit, .packs-note {
  color: var(--rp-slate);
  font-size: 0.9rem;
}

.ledger-line-amount {
  font-weight: 700;
  white-space: nowrap;
}

.invoice-row {
  flex-direction: column;
  align-items: stretch;
}

.invoice-row-top, .invoice-row-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75em;
  width: 100%;
}

.invoice-row-meta {
  color: var(--rp-slate);
  font-size: 0.9rem;
}

.invoice-row-amount {
  font-weight: 700;
}

.invoice-pdf-link {
  align-self: flex-start;
  margin-block-start: 0.5em;
}

.payment-view p {
  text-align: center;
}

.field select#account-language {
  max-inline-size: 320px;
}

/* An email has no space to break on: without this, a long email (dev token, long
   address+tag) silently overflows the screen at 390px — overflow-x: hidden on html,body
   would hide it instead of letting the page scroll. */
.account-email-value {
  overflow-wrap: anywhere;
}

/* An address is Latin and left to right, even on a right-to-left page. */
[dir="rtl"] .account-email-value {
  direction: ltr;
  text-align: right;
}

/* Account sub-screens (credits, invoices): one row each, with the balance. */
/* Delete the account: set apart under sign-out, its consequences said right under the button. */
.account-delete {
  margin-block-start: 2em;
  padding-block-start: 1.25em;
  border-block-start: 1px solid var(--rp-border);
}

.account-delete .times-note {
  margin-block: 0.5em 0;
}

.account-links {
  list-style: none;
  margin: 0 0 var(--rp-rhythm);
  padding: 0;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
}

.account-links li + li {
  border-block-start: 1px solid var(--rp-border);
}

.account-link {
  display: flex;
  align-items: center;
  gap: 0.5em;
  min-block-size: 48px;
  padding-inline: 1em 0.5em;
  color: var(--rp-ink);
  text-decoration: none;
}

.account-link-label {
  flex: 1 1 auto;
  font-weight: 500;
}

.account-link-value {
  color: var(--rp-slate);
  font-variant-numeric: tabular-nums;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  margin-block-end: 0.25em;
  color: var(--rp-link);
  text-decoration: none;
}

/* Chevrons point the reading direction. */
[dir="rtl"] :is(.account-link, .back-link) .icon {
  transform: scaleX(-1);
}

/* Screen title focused programmatically after every render (app.js::titleAndFocusView):
   no focus ring on a title, it's not a control — the screen reader announces it anyway. */
#view h2[tabindex="-1"]:focus {
  outline: none;
}

/* Screens with no visible title by design (routing intro, nav, payment): the <h2> stays
   in the accessibility tree (screen reader, tab title, programmatic focus) but disappears
   visually — classic clip pattern, never display: none or visibility: hidden, which would
   remove it from the screen reader too. */
.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  margin: -1px;
  padding: 0;
  border: 0;
}

.field-hint { margin: 0.25em 0 0; font-size: 0.875em; color: var(--rp-slate); }

/* --- Navigation (plan 5c, layout of Baleeze's nav.css) -------------------------------------
   body[data-screen="nav"]: the panel becomes a transparent full-screen layer; the nav screen
   lays its banner, instruments, buttons and bottom sheet over the shared map. */
body[data-screen="nav"] .topbar {
  display: none;
}

body[data-screen="nav"] .panel,
body[data-screen="nav"] .panel[data-state] {
  inset: 0;
  inline-size: auto;
  margin-inline: 0;
  max-block-size: none;
  display: block;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
}

body[data-screen="nav"] .panel-grip,
body[data-screen="nav"] .panel-close {
  display: none;
}

body[data-screen="nav"] .panel #view {
  overflow: visible;
}

.nav-screen {
  --nb-bg: var(--sd-black);
  --nb-ink: var(--sd-gray-50);
  --nb-icon: var(--sd-accent);
  --nb-alert-bg: var(--sd-reserve-dark);
  --nb-alert-ink: var(--sd-black);
  --nb-info-bg: var(--rp-info);
  --nb-info-ink: var(--rp-info-ink);
  --nav-shadow: var(--rp-shadow-float);
}

:root[data-theme="night"] .nav-screen {
  --nb-bg: var(--sd-night-black);
  --nb-ink: var(--sd-night-ink);
  --nb-icon: var(--sd-night-red);
  --nb-alert-bg: var(--sd-night-red);
  --nb-alert-ink: var(--sd-night-black);
}

.nav-screen .nav-top,
.nav-screen .nav-fabs,
.nav-screen .nav-bottom {
  position: absolute;
  z-index: 1;
}

.nav-screen .nav-top > *,
.nav-screen .nav-fabs > *,
.nav-screen .nav-bottom > * {
  pointer-events: auto;
}

.nav-top {
  inset-block-start: calc(env(safe-area-inset-top, 0px) + 8px);
  inset-inline: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-block-size: 52px;
  padding-block: 6px;
  padding-inline: 10px 14px;
  background: var(--nb-bg);
  color: var(--nb-ink);
  border-radius: var(--rp-radius-l);
  box-shadow: var(--nav-shadow);
}

.nav-banner-icon.icon {
  flex: none;
  font-size: 36px;
  color: var(--nb-icon);
  transition: transform 0.35s ease;
}

.nav-banner-text {
  flex: 1 1 auto;
  min-inline-size: 0;
}

.nav-banner-main {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.nav-banner-sub {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  margin-block-start: 1px;
}

.nav-banner[data-kind="off"],
.nav-banner[data-kind="lost"],
.nav-banner[data-kind="denied"],
.nav-banner[data-kind="error"] {
  background: var(--nb-alert-bg);
  color: var(--nb-alert-ink);
}

.nav-banner[data-kind="shift"] {
  background: var(--nb-info-bg);
  color: var(--nb-info-ink);
}

.nav-banner[data-kind="off"] .nav-banner-icon,
.nav-banner[data-kind="lost"] .nav-banner-icon,
.nav-banner[data-kind="denied"] .nav-banner-icon,
.nav-banner[data-kind="error"] .nav-banner-icon,
.nav-banner[data-kind="shift"] .nav-banner-icon {
  color: inherit;
}

.nav-banner-action {
  flex: none;
  align-self: center;
  padding: 0.5em 0.9em;
  border-radius: var(--rp-radius-pill);
  border: 2px solid currentColor;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

/* One line of three, so the map keeps the height. */
.nav-instruments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px;
  background: var(--rp-surface);
  color: var(--rp-ink);
  border-radius: var(--rp-radius-m);
  box-shadow: var(--nav-shadow);
}

.nav-ins {
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-inline: 4px;
  border-inline-end: 1px solid var(--rp-border);
}

.nav-ins:last-child {
  border-inline-end: 0;
}

.nav-ins-k {
  max-inline-size: 100%;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rp-slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Figures read at a glance at the helm: at least 24px on phones. */
.nav-ins-v {
  max-inline-size: 100%;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-ins-warn .nav-ins-v {
  color: var(--rp-go-reserve);
}

.nav-ins-bad .nav-ins-v {
  color: var(--rp-danger);
}

.nav-note {
  margin: 0;
  font-size: 0.9rem;
}

.nav-toast {
  display: flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  max-inline-size: 100%;
  margin: 0;
  padding-block: 4px;
  padding-inline: 12px 4px;
  border-radius: var(--rp-radius-m);
  background: var(--rp-surface);
  color: var(--rp-slate);
  font-size: 0.85rem;
  line-height: 1.3;
  box-shadow: var(--nav-shadow);
}

.nav-toast-close {
  flex: none;
  inline-size: 36px;
  block-size: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.nav-toast-close .icon {
  font-size: 20px;
}

.nav-fabs {
  inset-inline-end: 8px;
  inset-block-start: var(--nav-top-h, 220px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* The plan / satellite switch joins the column, a disc like the others. */
.nav-fabs .map-basemap {
  position: static;
  inline-size: 48px;
  block-size: 48px;
  box-shadow: var(--nav-shadow);
}

.nav-fab {
  inline-size: 48px;
  block-size: 48px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--rp-surface);
  color: var(--rp-ink);
  box-shadow: var(--nav-shadow);
  cursor: pointer;
  text-decoration: none;
}

.nav-fab[aria-pressed="true"] {
  box-shadow: var(--nav-shadow), inset 0 0 0 2px var(--rp-ink);
}

.nav-fab-toggle[aria-pressed="true"] {
  background: var(--rp-selected);
  color: var(--rp-on-selected);
  box-shadow: var(--nav-shadow);
}

.nav-bottom {
  inset-inline: 0;
  inset-block-end: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  /* Never over the banner and instruments: the sheet body scrolls instead. */
  max-block-size: calc(100dvh - var(--nav-top-h, 240px));
}

.nav-recenter {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  block-size: 48px;
  padding-inline: 16px 20px;
  border: 0;
  border-radius: 24px;
  background: var(--nb-bg);
  color: var(--nb-ink);
  font: inherit;
  font-weight: 700;
  box-shadow: var(--nav-shadow);
  cursor: pointer;
}

.nav-dev-stop {
  align-self: center;
}

.nav-ask,
.nav-card {
  background: var(--rp-surface);
  color: var(--rp-ink);
  box-shadow: var(--rp-shadow-sheet);
}

/* Simulation: "SIMULATION" over the simulated clock, beside the phase title; controls at the foot. */
.nav-card-headrow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.nav-card-titles {
  flex: 1 1 auto;
  min-inline-size: 0;
}

.nav-sim-row {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.nav-sim-row[hidden] { display: none; }

.nav-sim-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rp-slate);
}

.nav-sim-time {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: end;
}

.nav-sim-zone {
  margin-inline-start: 0.3em;
  font-size: 0.6em;
  font-weight: 500;
  opacity: 0.8;
}

/* Segment controls: previous, replay, then the big "Next segment". */
.nav-sim-actions {
  display: flex;
  gap: 8px;
  margin-block-start: 10px;
}

.nav-sim-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-block-size: 48px;
  padding-inline: 10px;
  white-space: nowrap;
}

.nav-sim-btn[hidden] {
  display: none;
}

.nav-sim-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.nav-sim-next {
  flex: 1 1 auto;
  min-inline-size: 0;
  font-size: 1.05rem;
}

/* Previous and replay as icons (named for screen readers and on hover), "Next segment" in full. */
.nav-sim-btn:not(.nav-sim-next) .nav-sim-label {
  display: none;
}

.nav-sim-btn:not(.nav-sim-next) {
  flex: none;
  min-inline-size: 48px;
}

/* Arrows point the reading direction. */
[dir="rtl"] .nav-sim-btn .icon,
[dir="rtl"] .nav-card-aim .icon {
  transform: scaleX(-1);
}

.nav-ask,
.nav-card {
  border-radius: var(--rp-radius-l) var(--rp-radius-l) 0 0;
  padding-block: 0 calc(env(safe-area-inset-bottom, 0px) + 12px);
  padding-inline: 16px;
}

.nav-ask {
  padding-block-start: 16px;
}

.nav-ask-title {
  font-size: 1.15rem;
}

.nav-ask-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-ask-actions > * {
  flex: 1 1 10em;
}

.nav-card {
  display: flex;
  flex-direction: column;
  min-block-size: 0;
  touch-action: pan-y;
}

.nav-card-handle {
  align-self: stretch;
  display: grid;
  place-items: center;
  block-size: 22px;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
}

.nav-card-grip {
  inline-size: 44px;
  block-size: 5px;
  border-radius: 3px;
  background: var(--rp-border);
}

.nav-card-head {
  touch-action: pan-y;
  user-select: none;
}

/* One line whatever the phase's name: the folded card never grows (ellipsis only as a last resort). */
.nav-card-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-card-head .stage-when {
  margin: 0.15em 0 0;
}

.nav-card-next {
  margin: 0.35em 0 0;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.nav-card-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-block-size: 0;
  margin-block-start: 8px;
}

.nav-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-start: 10px;
}

.nav-card-actions[hidden],
.nav-sim[hidden] { display: none; }

.nav-card-step {
  flex: none;
  inline-size: 48px;
  block-size: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-m);
  background: var(--rp-bg);
  color: var(--rp-ink);
  cursor: pointer;
}

.nav-card-step:disabled {
  opacity: 0.4;
  cursor: default;
}

.nav-card-aim {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-block-size: 48px;
  font-size: 1.05rem;
}

.nav-card-step {
  block-size: 48px;
}

/* Chevrons point the reading direction. */
[dir="rtl"] .nav-card-step .icon {
  transform: scaleX(-1);
}

/* Orientation: north up / course over ground up / 3D, one pressed at a time. */
.nav-orient {
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: var(--rp-surface);
  box-shadow: var(--nav-shadow);
  overflow: hidden;
}

.nav-orient-btn {
  inline-size: 48px;
  block-size: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--rp-ink);
  cursor: pointer;
}

.nav-orient-btn + .nav-orient-btn {
  border-block-start: 1px solid var(--rp-border);
}

.nav-orient-btn[aria-checked="true"] {
  background: var(--rp-ink);
  color: var(--rp-surface);
}

/* Phase card: planned conditions, then planned sailing; side by side when there is room. */
.nav-card-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.5em, 1fr));
  gap: 8px 16px;
  margin-block-start: 8px;
}

.nav-card-block-k {
  margin: 0 0 4px;
  font-family: var(--rp-font-text);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rp-slate);
}

.phase-wx {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.phase-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4em;
  margin: 0;
  font-size: 0.95rem;
}

.phase-k,
.phase-rest {
  color: var(--rp-slate);
}

/* Compass point the wind or sea comes from ("NNE"); no arrow beside a value (Gabriel, 04/10). */
.wx-dir {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  font-weight: 500;
  unicode-bidi: isolate;
}

.phase-allure {
  display: grid;
  gap: 2px;
  margin: 0;
  font-size: 0.95rem;
}

.phase-row {
  display: flex;
  gap: 0.5em;
}

.phase-row dt {
  min-inline-size: 5.5em;
  color: var(--rp-slate);
}

.phase-row dd {
  margin: 0;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Peek (card closed, the phone default, Baleeze's nav card): the same blocks on two short lines, block
   titles kept for screen readers only; the handle opens them in full with the legend. */
.nav-card:not(.nav-card-open) .nav-card-blocks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-block-start: 6px;
}

.nav-card:not(.nav-card-open) .nav-card-block-k {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.nav-card:not(.nav-card-open) .phase-wx {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.nav-card:not(.nav-card-open) .phase-line {
  gap: 0.3em;
  font-size: 0.9rem;
}

.nav-card:not(.nav-card-open) .phase-allure {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.3em;
  font-size: 0.9rem;
}

.nav-card:not(.nav-card-open) .phase-row {
  gap: 0;
}

.nav-card:not(.nav-card-open) .phase-row dt {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.nav-card:not(.nav-card-open) .phase-row + .phase-row::before {
  content: "·";
  margin-inline-end: 0.3em;
  color: var(--rp-slate);
}

/* Measured arrival and cross-track: read in the open card only, the peek stays two lines. */
.nav-card:not(.nav-card-open) .nav-card-measured {
  display: none;
}

/* Wind, gusts, sea and current: the boat's arrows and the strip already say them; the open card has them. */
.nav-card:not(.nav-card-open) .nav-card-planned {
  display: none;
}

.nav-card-measured .phase-row dt {
  min-inline-size: 11em;
}

.phase-row.nav-ins-warn dd {
  color: var(--rp-go-reserve);
}

.phase-row.nav-ins-bad dd {
  color: var(--rp-danger);
}

/* Open: the card may take most of the screen, its body scrolls above the buttons. */
.nav-card-open {
  max-block-size: 88dvh;
}

/* Legend of the two map lines: solid = course over ground, dashed = bearing to the waypoint. */
.nav-legend {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  font-size: 0.9rem;
}

.nav-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block: 4px;
}

.nav-legend li::before {
  content: "";
  flex: none;
  inline-size: 28px;
  border-block-start: 3px solid var(--rp-map-cog);
}

.nav-legend .nav-legend-note::before { content: none; }

.nav-legend .nav-legend-brg::before {
  border-block-start: 3px dashed var(--rp-map-bearing);
}

.nav-boat {
  inline-size: 34px;
  block-size: 34px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}

.nav-boat svg {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  fill: var(--rp-boat);
  stroke: var(--rp-boat-edge);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.nav-boat .nav-boat-dot,
.nav-boat-still .nav-boat-arrow {
  display: none;
}

.nav-boat-still .nav-boat-dot {
  display: inline;
}

/* Wind and swell on the boat: shapes tell them apart (solid, dashed, wavy); the swell also has its own colour. */
.boat-wind {
  inline-size: 130px;
  block-size: 130px;
  pointer-events: none;
}

.boat-wind svg {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  overflow: visible;
}

.boat-wind path,
.boat-wind-glyph path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.boat-wind .bw-ink,
.boat-wind-glyph .bw-ink { stroke: var(--rp-wind-ink); stroke-width: 2.5; }
.boat-wind .bw-halo,
.boat-wind-glyph .bw-halo { stroke: var(--rp-wind-halo); stroke-width: 6; opacity: 0.85; }
.boat-wind-true .bw-head { fill: var(--rp-wind-ink); }
.boat-wind-apparent .bw-ink { stroke-width: 3; }
.boat-wind-apparent .bw-ink:not(.bw-head) { stroke-dasharray: 5 4; }
.boat-wind-swell .bw-ink { stroke: var(--rp-swell-ink); stroke-width: 2.5; }
.boat-wind-swell .bw-halo { stroke: var(--rp-swell-halo); opacity: 1; }

/* Values of the arrows above the sheet: glyph = the arrow's shape. */
.wind-strip {
  display: flex;
  align-items: center;
  gap: var(--rp-space-2);
  padding: var(--rp-space-1) var(--rp-space-3);
  border-radius: var(--rp-radius-m);
  background: var(--rp-surface);
  color: var(--rp-ink);
  box-shadow: var(--rp-shadow-float);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.wind-strip[hidden] { display: none; }

/* Label over value, as many columns as fit at 140 px: two by two on a phone, never one label over the next. */
.wind-strip-items {
  flex: 1;
  min-inline-size: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 2px var(--rp-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.wind-strip li {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
}

.wind-strip .wind-strip-k {
  display: flex;
  align-items: center;
  gap: var(--rp-space-1);
  min-inline-size: 0;
  color: var(--rp-slate);
  font-size: 0.75rem;
  white-space: nowrap;
}

.wind-strip strong {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wind-strip .boat-wind-glyph { flex: none; }

.nav-top .wind-strip { box-shadow: var(--nav-shadow); }

/* Forecast time shown by the layer on the result screen, with its switch. */
.wind-chip {
  display: flex;
  align-items: center;
  gap: var(--rp-space-2);
  margin: 0;
  font-size: 0.85rem;
  color: var(--rp-slate);
}

.wind-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--rp-space-1);
  min-block-size: 44px;
  padding: 0 var(--rp-space-3);
  border: 1.5px solid var(--rp-border);
  border-radius: var(--rp-radius-pill);
  background: var(--rp-surface);
  color: var(--rp-ink);
  font: inherit;
  cursor: pointer;
}

.wind-toggle[aria-pressed="true"] {
  border-color: var(--rp-selected);
  background: var(--rp-selected);
  color: var(--rp-on-selected);
}

.nav-boat-stale {
  opacity: 0.35;
  filter: grayscale(1);
}
:root[data-theme="night"] .nav-boat-stale { filter: none; }

/* Seadromy signature in navigation: right of the Mapbox logo (88 x 23 px, 10 px margins), same
   baseline, above the bottom sheet on the phone. Physical left: Mapbox keeps its logo there in RTL too. */
.nav-signature {
  position: fixed;
  left: 106px;
  bottom: calc(var(--nav-bottom-h, 0px) + 6px);
  z-index: 1;
  display: flex;
  align-items: center;
  block-size: 23px;
  padding-inline: 6px;
  border-radius: var(--rp-radius-pill);
  background: color-mix(in srgb, var(--rp-surface) 72%, transparent);
  pointer-events: none;
}

.nav-signature .brand-logo {
  block-size: 17px;
  inline-size: auto;
}

@media (min-width: 900px) {
  .nav-signature {
    bottom: 6px;
  }
}

@media (max-width: 899px) {
  body[data-screen="nav"] .mapboxgl-ctrl-bottom-left,
  body[data-screen="nav"] .mapboxgl-ctrl-bottom-right {
    bottom: var(--nav-bottom-h, 0px);
  }
  /* The open sheet covers the map buttons: hide them rather than show half a disc. */
  .nav-sheet-open .nav-fabs {
    visibility: hidden;
  }
  /* ...and the scale, which the open sheet pushes up under the values. */
  body[data-screen="nav"]:has(.nav-sheet-open) .mapboxgl-ctrl-scale {
    visibility: hidden;
  }
}

@media (min-width: 900px) {
  .nav-top {
    inset-inline: 12px auto;
    inset-block-start: 12px;
    inline-size: 420px;
  }
  .nav-fabs {
    inset-block-start: 12px;
    inset-inline-end: 12px;
  }
  .nav-bottom {
    inset-inline: 12px auto;
    inset-block-end: 36px;
    inline-size: 420px;
  }
  .nav-bottom {
    max-block-size: calc(100dvh - var(--nav-top-h, 240px) - 36px);
  }
  .nav-ask,
  .nav-card {
    border-radius: var(--rp-radius-l);
    padding-block-end: 12px;
  }
}


/* --- Explore ---*/
.explore-view {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

.place-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

.place-result {
  inline-size: 100%;
  min-block-size: 44px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1em;
  padding: 0.6em 0.75em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-m);
  background: var(--rp-surface);
  color: var(--rp-ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.place-name {
  font-weight: 500;
}

.place-posidonia {
  padding: 0.4em 0.6em;
  border-radius: var(--rp-radius-s);
  border-inline-start: 4px solid var(--rp-danger);
  background: color-mix(in srgb, var(--rp-danger) 12%, transparent);
  color: var(--rp-danger);
  font-weight: 700;
}

.place-facts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15em;
}

.place-kind,
.trip-note,
.trip-hint,
.trip-pending {
  font-size: 0.85rem;
  color: var(--rp-slate);
}

.trip-box {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.trip-row {
  display: flex;
  align-items: center;
  gap: 0.75em;
  min-block-size: 44px;
}

.trip-label {
  flex: 0 0 4.5em;
  font-size: 0.85rem;
  color: var(--rp-slate);
}

.trip-value {
  flex: 1 1 auto;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
}

.trip-name {
  overflow-wrap: anywhere;
}

/* Route card: departure and arrival joined by a dotted leg, each with its map pin. */
.route-card {
  display: flex;
  flex-direction: column;
  padding: 0.5em 0.25em 0.5em 0.6em;
  border-radius: var(--rp-radius-m);
  background: var(--rp-surface);
  box-shadow: inset 0 0 0 1px var(--rp-border);
}

.route-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: start;
  column-gap: 0.6em;
  min-block-size: 44px;
}

.route-pin {
  inline-size: 22px;
  block-size: 31px;
  margin-block-start: 0.35em;
  justify-self: center;
}

.route-pin-body { stroke-width: 1.5; }
.route-pin-from .route-pin-body { fill: var(--rp-pin-from); stroke: var(--rp-pin-from-edge); }
.route-pin-to .route-pin-body { fill: var(--rp-pin-to); stroke: var(--rp-pin-to-edge); }
.route-pin-dot { fill: var(--rp-pin-dot); }
.route-row-empty .route-pin { opacity: 0.45; }

.route-text {
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2em;
  padding-block: 0.3em;
}

.route-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05em;
  padding: 0;
  border: 0;
  background: none;
  color: var(--rp-ink);
  font: inherit;
  text-align: start;
}

button.route-main { cursor: pointer; }
button.route-main:hover .route-name { text-decoration: underline; text-decoration-color: var(--rp-border); }

.route-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.route-role {
  font-weight: 700;
}

.route-context {
  font-size: 0.85rem;
  color: var(--rp-slate);
}

.route-sea {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  min-block-size: 28px;
  padding: 0.1em 0.55em 0.1em 0.4em;
  border: 0;
  border-radius: var(--rp-radius-pill);
  background: var(--rp-info);
  color: var(--rp-info-ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

.route-sea .icon { font-size: 16px; }
.route-sea-warn { background: transparent; color: var(--rp-ink); box-shadow: inset 0 0 0 1.5px var(--rp-go-reserve); }

.route-sea-explain {
  margin: 0 0 0.4em calc(26px + 0.6em);
  font-size: 0.85rem;
  color: var(--rp-slate);
}

.route-link {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  column-gap: 0.6em;
  align-items: center;
  min-block-size: 14px;
}

.route-dots {
  justify-self: center;
  block-size: 100%;
  min-block-size: 14px;
  border-inline-start: 2px dotted var(--rp-slate);
}

.route-swap { grid-column: 3; }
.route-remove { color: var(--rp-slate); }

.trip-distance {
  margin: 0;
  font-size: 0.9rem;
  color: var(--rp-slate);
}

.place-error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--rp-space-2);
  padding: var(--rp-space-3);
  border-inline-start: 4px solid var(--rp-danger);
  border-radius: var(--rp-radius-s);
  background: var(--rp-bg);
  list-style: none;
}

.place-error p {
  margin: 0;
}

.coords-entry {
  font-size: 0.85rem;
  color: var(--rp-slate);
}

.coords-entry summary {
  cursor: pointer;
  inline-size: fit-content;
  min-block-size: 44px;
  display: flex;
  align-items: center;
  text-decoration: underline;
}

.coords-entry[open] {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.coords-input {
  font: inherit;
  font-size: 1rem;
  padding: 0.5em 0.6em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
  color: var(--rp-ink);
}

.coords-actions {
  display: flex;
  gap: 0.5em;
}

/* First visit: a note over the map, with a pulse where a finger would press. Same box: adjusting a proposed place. */
.map-coach,
.map-proposal {
  position: fixed;
  z-index: 12;
  inset-inline: 16px;
  inset-block-start: 76px;
  margin-inline: auto;
  max-inline-size: 420px;
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.75em;
  border-radius: var(--rp-radius-m);
  background: var(--rp-surface);
  color: var(--rp-ink);
  box-shadow: var(--rp-shadow-panel);
  flex-wrap: wrap;
}

.map-coach-text {
  display: flex;
  flex-direction: column;
  gap: 0.1em;
  flex: 1 1 12em;
  font-size: 0.9rem;
}

.map-coach-pulse {
  flex: none;
  inline-size: 18px;
  block-size: 18px;
  border-radius: 50%;
  background: var(--rp-accent);
  box-shadow: 0 0 0 0 var(--rp-accent);
  animation: coach-pulse 1.6s ease-out infinite;
}

@keyframes coach-pulse {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--rp-accent) 70%, transparent); }
  to { box-shadow: 0 0 0 14px transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .map-coach-pulse { animation: none; }
}

@media (min-width: 900px) {
  .map-coach,
  .map-proposal {
    inset-inline: auto 24px;
  }
}

/* The adjust bar stays clear of the "Locate me" / basemap column on the end side (12 px + 44 px + gap). */
.map-proposal {
  inset-inline: 16px 68px;
}

@media (min-width: 900px) {
  .map-proposal {
    inset-inline: auto 68px;
  }
}

.map-proposal-pin {
  position: relative;
  inline-size: 30px;
  block-size: 30px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 4px solid var(--rp-pin-proposal);
  background: color-mix(in srgb, var(--rp-surface) 70%, transparent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  cursor: grab;
}

.map-proposal-pin::before,
.map-proposal-pin::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  inline-size: 12px;
  block-size: 3px;
  border-radius: 2px;
  background: var(--rp-pin-proposal);
  transform: translate(-50%, -50%);
}

.map-proposal-pin::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.map-proposal-text {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.9rem;
}

/* "Locate me" over the map (map screen), under the top bar on the end side. */
.map-locate {
  position: fixed;
  z-index: 11;
  inset-block-start: calc(env(safe-area-inset-top, 0px) + 72px);
  inset-inline-end: 12px;
  inline-size: 44px;
  block-size: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--rp-radius-pill);
  background: var(--rp-surface);
  color: var(--rp-ink);
  box-shadow: var(--rp-shadow-float);
  cursor: pointer;
}

.map-locate[data-state="granted"] {
  color: var(--rp-link);
}

body[data-screen="nav"] .map-locate {
  display: none;
}

/* The first-use note sits there and offers the location itself. */
body:has(.map-coach) .map-locate {
  visibility: hidden;
}

/* The user's position: light blue dot, white rim, soft halo (night: red dot, black rim). */
.map-me {
  inline-size: 16px;
  block-size: 16px;
  border-radius: 50%;
  background: var(--rp-boat);
  border: 3px solid var(--rp-boat-edge);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--rp-boat) 30%, transparent), 0 1px 3px rgba(0, 0, 0, 0.4);
}

.start-here {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-block-start: var(--rp-space-2);
}

.map-coach-why {
  display: block;
  font-size: 0.85rem;
  color: var(--rp-slate);
}

.map-bubble {
  position: fixed;
  z-index: 15;
  transform: translate(-50%, calc(-100% - 12px));
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  inline-size: max-content;
  max-inline-size: calc(100vw - 32px);
  gap: 0.4em;
  padding: 0.4em;
  border-radius: var(--rp-radius-m);
  background: var(--rp-surface);
  box-shadow: var(--rp-shadow-panel);
}

/* Swell height scale, in the nav card's open part and under the result's forecast time (never on the map). */
.swell-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding-block-end: 13px;
  color: var(--rp-ink);
  font-size: 0.75rem;
  line-height: 1;
}

.swell-legend[hidden] { display: none; }

.swell-legend-title { font-weight: 700; white-space: nowrap; }

/* A number scale: calm on the left in every writing direction. */
.swell-legend-bar {
  position: relative;
  direction: ltr;
  flex: 0 1 180px;
  min-inline-size: 120px;
  block-size: 7px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--rp-border);
}

.swell-legend-tick {
  position: absolute;
  inset-block-start: 9px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Tap on the sea: the swell there. */
.swell-bubble {
  display: flex;
  align-items: flex-start;
  gap: 0.25em;
  padding: 0.45em 0.3em 0.45em 0.7em;
  border-radius: var(--rp-radius-m);
  background: var(--rp-surface);
  color: var(--rp-ink);
  box-shadow: var(--rp-shadow-panel);
  font-size: 0.85rem;
  line-height: 1.35;
}

.swell-bubble p {
  display: flex;
  flex-direction: column;
  margin: 0;
  white-space: nowrap;
}

.swell-bubble-title { color: var(--rp-slate); font-size: 0.75rem; }
.swell-bubble-height { font-weight: 700; }

/* Tap on a danger mark: what it is. Names can be long: wrapped, within a phone's width. */
.danger-bubble p { white-space: normal; max-inline-size: min(16rem, calc(100vw - 6rem)); }
.danger-bubble-kind { font-weight: 700; }
.danger-bubble-source { color: var(--rp-slate); font-size: 0.75rem; }

.swell-bubble-close {
  min-inline-size: 32px;
  min-block-size: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--rp-radius-pill);
  background: transparent;
  color: var(--rp-slate);
  font: inherit;
  cursor: pointer;
}

.sea-point {
  inline-size: 10px;
  block-size: 10px;
  border-radius: 50%;
  background: var(--rp-info);
  border: 2px solid var(--rp-map-casing);
}

/* --- "Traversée" form --- */
.traversee-view {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.traversee-route {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  padding: 0.75em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-m);
}

.traversee-edit,
.traversee-new-boat {
  font-size: 0.9rem;
  align-self: flex-start;
  min-block-size: 44px;
  display: inline-flex;
  align-items: center;
}

.mode-group,
.when-group {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.mode-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  padding: 0.6em 0.75em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-m);
  cursor: pointer;
}

.mode-option:has(input:checked) {
  border-color: var(--rp-selected);
  box-shadow: inset 0 0 0 1px var(--rp-selected);
}

.mode-option:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

/* "Déconseillé": the next sailable window, offered under the verdict with its price. */
.next-window {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin-block: 0.5em 0.75em;
}

.mode-text {
  display: flex;
  flex-direction: column;
}

.mode-hint {
  font-size: 0.85rem;
  color: var(--rp-slate);
}

/* "Close" button for account screens opened over the map. */
.panel-close {
  position: absolute;
  inset-block-start: 0.25em;
  inset-inline-end: 0.25em;
  z-index: 1;
  color: var(--rp-ink);
  background: var(--rp-surface);
  border-radius: var(--rp-radius-pill);
}

/* Main action of a panel step (Traversée, Calculer, Suivre la route): pinned to the foot of the
   panel on every screen, full width, on the surface so the content scrolls under it. */
.panel-action {
  position: sticky;
  inset-block-end: 0;
  z-index: 2;
  display: flex;
  gap: var(--rp-space-2);
  margin-block-start: auto;
  padding-block: var(--rp-space-3) var(--rp-space-4);
  background: var(--rp-surface);
  box-shadow: 0 -12px 12px -12px rgb(14 17 22 / 0.35);
}

.panel-action > .btn-primary {
  flex: 1 1 auto;
}

/* A paid action's alert (credit-gate.js), just above its button, in view with it (Gabriel 17/11/2026). */
.has-gate { flex-wrap: wrap; }
.has-gate > .action-alert { flex: 1 0 100%; margin-block-end: var(--rp-space-2); font-weight: 600; }
.has-gate > .action-buy { flex: 1 1 auto; text-align: center; }
.panel-action > .action-alert { margin-block-end: 0; }

/* The view's own bottom padding would leave a strip under the pinned action. */
.panel #view:has(.panel-action:not([hidden])) {
  padding-block-end: 0;
}

.place-attribution {
  font-size: 0.75rem;
  color: var(--rp-slate);
  padding-block-start: 0.25em;
}

/* --- Result: timeline and stages (plan 5b) --- */
.frise {
  display: flex;
  gap: 2px;
  block-size: 18px;
  margin-block: 0.75em;
}

.frise-band {
  min-inline-size: 4px;
  border: 0;
  border-radius: 3px;
  padding: 0;
  cursor: pointer;
}

.frise-sail { background: var(--rp-map-sail); box-shadow: inset 0 0 0 1px var(--rp-accent-edge); }
.frise-motor { background: var(--rp-map-motor); }
.frise-motorsail { background: repeating-linear-gradient(90deg, var(--rp-map-sail) 0 6px, var(--rp-map-motor) 6px 9px); box-shadow: inset 0 0 0 1px var(--rp-accent-edge); }
/* A fuel stop: a hollow band, wide enough to be touched however short the pause. */
.frise-stop { min-inline-size: 10px; background: var(--rp-surface); box-shadow: inset 0 0 0 2px var(--rp-map-motor); }

.stage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

/* Wind and sea chips (weather.js): Beaufort force and sea state, always written out ("F5",
   "moderate"), the colour only repeats it. Same fills in day and dusk (each chip carries its own
   ink); at night, shades of red only. */
.wx-current { display: block; font-size: 0.9em; }

.wx-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em;
  align-items: center;
}

.figure-row dd .wx-row {
  justify-content: flex-end;
  margin-block-end: 0.2em;
}

.figure-row dd[data-testid="sea-wind"] {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.wx-chip {
  --wx-bg: var(--sd-gray-200);
  --wx-ink: var(--sd-black);
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.15em 0.5em;
  border-radius: var(--rp-radius-pill);
  background: var(--wx-bg);
  color: var(--wx-ink);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  unicode-bidi: isolate;
}

.wx-tag {
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.85;
}

.wx-b0, .wx-b1, .wx-b2 { --wx-bg: var(--sd-gray-200); }
.wx-b3 { --wx-bg: var(--sd-blue-light); }
.wx-b4 { --wx-bg: var(--sd-scale-4); }
.wx-b5 { --wx-bg: var(--sd-scale-5); }
.wx-b6 { --wx-bg: var(--sd-scale-6); }
.wx-b7 { --wx-bg: var(--sd-scale-7); }
.wx-b8 { --wx-bg: var(--sd-scale-8); --wx-ink: var(--sd-white); }
.wx-b9 { --wx-bg: var(--sd-scale-9); --wx-ink: var(--sd-white); }

.wx-s1, .wx-s2 { --wx-bg: var(--sd-gray-200); }
.wx-s3 { --wx-bg: var(--sd-blue-light); }
.wx-s4 { --wx-bg: var(--sd-scale-6); }
.wx-s5 { --wx-bg: var(--sd-scale-7); }
.wx-s6 { --wx-bg: var(--sd-scale-8); --wx-ink: var(--sd-white); }

:root[data-theme="night"] .wx-chip { --wx-bg: var(--sd-night-800); --wx-ink: var(--sd-night-ink); box-shadow: inset 0 0 0 1px var(--sd-night-700); }
:root[data-theme="night"] :is(.wx-b5, .wx-b6, .wx-s4) { --wx-bg: var(--sd-scale-night-5); }
:root[data-theme="night"] :is(.wx-b7, .wx-s5) { --wx-bg: var(--sd-night-500); }
:root[data-theme="night"] :is(.wx-b8, .wx-b9, .wx-s6) { --wx-bg: var(--sd-night-red); --wx-ink: var(--sd-night-black); }

.stage-card .wx-row,
.stage-sheet .wx-row,
.nav-card-wx .wx-row {
  margin-block-start: 0.25em;
}

.stage-card {
  inline-size: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.15em;
  padding: 0.6em 0.75em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-m);
  background: var(--rp-surface);
  color: var(--rp-ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.stage-card-active {
  border-color: var(--rp-selected);
  box-shadow: inset 0 0 0 1px var(--rp-selected);
}

.stage-head { font-weight: 500; }
.stage-when, .stage-line { font-size: 0.85rem; color: var(--rp-slate); }

.stage-sheet {
  padding: 0.75em;
  margin-block-end: 0.75em;
  border: 1px solid var(--rp-selected);
  border-radius: var(--rp-radius-m);
}

.stage-nav {
  display: flex;
  gap: 0.4em;
  margin-block-start: var(--rp-rhythm);
}

.stage-nav button { flex: 1; padding-inline: 0.4em; white-space: nowrap; }

.stage-nav .stage-next-btn {
  flex: 1.6;
  border-color: var(--rp-selected);
  background: var(--rp-selected);
  color: var(--rp-on-selected);
  font-weight: 700;
}

.stage-nav .stage-next-btn:hover,
.stage-nav .stage-next-btn:focus-visible {
  filter: brightness(1.08);
}

.stage-nav .stage-next-btn:disabled {
  border-color: var(--rp-border);
  background: var(--rp-surface);
  color: var(--rp-slate);
  font-weight: 500;
}

.intro-pending { color: var(--rp-slate); font-style: italic; }


/* --- Language picker (side menu): a full-width row, the language named in its own words --- */
.lang-picker {
  padding: 0.5em 1em;
  border-block-start: 1px solid var(--rp-border);
}

.lang-picker-row {
  display: flex;
  align-items: center;
  gap: 0.6em;
  inline-size: 100%;
  min-block-size: 48px;
  padding: 0 0.75em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
  color: var(--rp-ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.lang-picker-row:hover, .lang-picker-row:focus-visible { background: var(--rp-bg); }
.lang-picker-label { font-weight: 500; }
.lang-picker-value { margin-inline-start: auto; color: var(--rp-slate); }
.lang-picker-row > :last-child { transition: transform 0.2s ease; }
.lang-picker-row[aria-expanded="true"] > :last-child { transform: rotate(180deg); }

.lang-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5em, 1fr));
  gap: 0.25em;
  margin-block-start: 0.5em;
}

.lang-picker-list button {
  min-block-size: 44px;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
  color: var(--rp-ink);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.lang-picker-list button[aria-pressed="true"] {
  background: var(--rp-selected);
  color: var(--rp-on-selected);
  border-color: var(--rp-selected);
  font-weight: 700;
}

/* Flag beside a language name: 18 x 12, rounded, a hairline so white stripes hold on the dark UI. */
.flag {
  display: inline-block;
  flex: none;
  inline-size: 18px;
  block-size: 12px;
  border-radius: 2px;
  overflow: hidden;
  vertical-align: -1px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rp-ink) 22%, transparent);
}

.flag svg { display: block; inline-size: 100%; block-size: 100%; }

.lang-picker-value { display: inline-flex; align-items: center; gap: 0.45em; }

.lang-picker-list button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
}

.lang-picker-error {
  margin: 0.5em 0 0;
  font-size: 0.8rem;
  color: var(--rp-danger);
}

@media (prefers-reduced-motion: reduce) {
  .lang-picker-row > :last-child { transition: none; }
}

/* --- Display picker (side menu) --- */
.theme-picker {
  padding: 0.75em 1em;
  border-block-start: 1px solid var(--rp-border);
}

.theme-picker-title {
  display: block;
  font-weight: 500;
  margin-block-end: 0.5em;
}

.theme-picker-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25em;
}

.theme-picker-buttons button {
  min-block-size: 44px;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
  color: var(--rp-ink);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.theme-picker-buttons button[aria-pressed="true"] {
  background: var(--rp-selected);
  color: var(--rp-on-selected);
  border-color: var(--rp-selected);
  font-weight: 700;
}

.theme-picker-hint {
  margin: 0.5em 0 0;
  font-size: 0.8rem;
  color: var(--rp-slate);
}

/* Levels: "Recommended" in Seadromy light blue, "Exceptional ★" in gold, black text on both; the word
   and the star carry the meaning, the colour only repeats it. Lemon stays for the route and the action. */
.place-level {
  inline-size: fit-content;
  padding: 0.05em 0.55em;
  border-radius: var(--rp-radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--rp-level-reco);
  color: var(--rp-level-reco-ink);
}

:root[data-theme="night"] .place-level { box-shadow: inset 0 0 0 1px var(--rp-border); }

.place-level-exceptional,
:root[data-theme="night"] .place-level-exceptional {
  background: var(--rp-level-top);
  color: var(--rp-level-top-ink);
  box-shadow: none;
}

.place-level-star {
  color: inherit;
}

/* --- Place card (a stop of our base) --- */
.place-card {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}

.place-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.5em;
}

.place-card-titles {
  flex: 1 1 auto;
  min-inline-size: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25em 0.5em;
}

.place-card-name {
  margin: 0;
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}

.place-card-close {
  margin-block-start: -0.4em;
  margin-inline-end: -0.4em;
}

.place-badge {
  padding: 0.1em 0.6em;
}

.place-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-block: 0.4em 0.2em;
}

.place-card-actions > button {
  flex: 1 1 8em;
}

.place-warnings {
  padding: 0.6em 0.75em;
  border-inline-start: 4px solid var(--rp-danger);
  border-radius: var(--rp-radius-s);
  background: var(--rp-bg);
}

.place-warning {
  margin: 0.2em 0 0;
  font-weight: 500;
}

.place-section {
  padding-block-start: 0.5em;
  border-block-start: 1px solid var(--rp-border);
}

.place-section-title,
.place-warnings .place-section-title {
  margin: 0 0 0.25em;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rp-slate);
}

.place-warnings .place-section-title {
  color: var(--rp-danger);
}

.place-section-title .icon {
  font-size: 16px;
  margin-inline-end: 0.35em;
  vertical-align: -0.25em;
}

.place-line {
  margin: 0.15em 0;
  overflow-wrap: anywhere;
}

.place-muted {
  font-size: 0.85rem;
  color: var(--rp-slate);
}

.place-strong {
  font-weight: 500;
}

.place-shelter-row {
  display: flex;
  align-items: center;
  gap: 0.75em;
}

.place-rose {
  flex: 0 0 auto;
  inline-size: 84px;
  block-size: 84px;
}

.place-rose-label {
  fill: currentColor;
  font-size: 11px;
  font-weight: 700;
}

.place-rose-good { fill: var(--rp-go); background: var(--rp-go); }
.place-rose-fair { fill: var(--rp-go-reserve); background: var(--rp-go-reserve); }
.place-rose-exposed { fill: var(--rp-no-go); background: var(--rp-no-go); }

.place-shelter-words {
  min-inline-size: 0;
}

.place-legend {
  list-style: none;
  margin: 0.2em 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1em 0.75em;
  font-size: 0.8rem;
  color: var(--rp-slate);
}

.place-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

.place-legend .icon { font-size: 20px; }

.place-swatch {
  display: inline-block;
  inline-size: 0.7em;
  block-size: 0.7em;
  border-radius: 2px;
}

.place-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}

.place-tag {
  display: inline-block;
  padding: 0 0.5em;
  border: 1px solid var(--rp-go-reserve);
  border-radius: var(--rp-radius-pill);
  font-size: 0.75rem;
  color: var(--rp-ink);
}

.place-link {
  overflow-wrap: anywhere;
}

.place-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25em 1em;
}

.place-mooring .place-line a {
  min-block-size: 32px;
  display: inline-flex;
  align-items: center;
}

.place-contacts > * {
  min-block-size: 32px;
  display: inline-flex;
  align-items: center;
}


/* --- Brand (charter v3): launch, logo, oculus, wave frieze, empty states ---
   Never on the map nor in navigation: those stay clean tools. */
.oc-lid { fill: var(--sd-oc-lid); }
.oc-white { fill: var(--sd-oc-white); }
.oc-iris { fill: var(--sd-oc-iris); }
.oc-pupil { fill: var(--sd-oc-pupil); }
.oc-needle-n { fill: var(--sd-oc-needle-n); }
.oc-needle-s { fill: var(--sd-oc-needle-s); }
.oc-word { fill: var(--sd-oc-word); }

.oculus, .brand-logo {
  display: block;
  block-size: auto;
}

.oc-needle {
  transform-box: view-box;
}

/* Calculation under way: the compass needle seeks, swings past, settles, seeks again. */
.oculus-spin .oc-needle {
  animation: oc-needle 3.2s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

@keyframes oc-needle {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(250deg); }
  55% { transform: rotate(215deg); }
  70% { transform: rotate(235deg); }
  100% { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .oculus-spin .oc-needle { animation: none; }
}
:root[data-page-hidden] .oculus-spin .oc-needle { animation-play-state: paused; }

/* Wave frieze of the antique vases: a band in the theme's blue, never under the logo. */
.frieze {
  block-size: 16px;
  background: var(--rp-frieze);
  opacity: var(--rp-frieze-opacity);
  --frieze-wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 34'%3E%3Cpath d='M0 30 C10 30 14 22 14 15 C14 7 8 3 3 6 C-1 9 2 15 6 13 M14 15 C14 26 22 30 30 30' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E");
  -webkit-mask: var(--frieze-wave) repeat-x left center / auto 100%;
  mask: var(--frieze-wave) repeat-x left center / auto 100%;
}

/* Launch: the full logo on marine fading to ink (its needle turning, inline in index.html), tagline, descriptor,
   frieze at the foot. */
.launch {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 1em 1em calc(env(safe-area-inset-bottom, 0px) + 1em);
  background: linear-gradient(180deg, var(--sd-navy) 0%, var(--sd-black) 78%);
  color: var(--sd-gray-50);
  text-align: center;
  pointer-events: none;            /* never blocks the app underneath while it fades */
  transition: opacity 0.35s ease;
}

.launch[data-leaving] {
  opacity: 0;
}

.launch-logo {
  inline-size: min(68vw, 272px);
  block-size: auto;
  margin-block-end: 0.6em;
}

.launch-tagline {
  margin: 0;
  font-family: var(--rp-font-title);
  font-weight: 600;
  font-size: 1.3rem;
}

.launch-descriptor {
  margin: 0;
  min-block-size: 1.4em;
  color: var(--sd-gray-400);
}

/* The frieze that rolls (launch, menu): the band itself only clips; the waves are drawn by ::before, one wave wider,
   which slides by exactly one wave. --frieze-wave-w: crest to crest (16 px high in the app is 14). */
.frieze-roll {
  --frieze-wave-w: 14px;
  position: relative;
  block-size: calc(var(--frieze-wave-w) * 34 / 30);
  overflow: hidden;
  background: none;
  -webkit-mask: none;
  mask: none;
}

.frieze-roll::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: calc(100% + var(--frieze-wave-w));
  background: var(--rp-frieze);
  -webkit-mask: var(--frieze-wave) repeat-x left center / var(--frieze-wave-w) 100%;
  mask: var(--frieze-wave) repeat-x left center / var(--frieze-wave-w) 100%;
  /* The swell rolls to the left, the way the waves curl: one wave every 1.3 s, without end. */
  animation: frieze-roll 1.3s linear infinite;
  will-change: transform;
}

@keyframes frieze-roll {
  to { transform: translate3d(calc(-1 * var(--frieze-wave-w)), 0, 0); }
}

/* Still for who asks for less motion, while the page is not seen (app.js sets data-page-hidden) and in a closed menu. */
@media (prefers-reduced-motion: reduce) {
  .frieze-roll::before { animation: none; }
}
:root[data-page-hidden] .frieze-roll::before,
.side-menu:not([data-open]) .frieze-roll::before { animation-play-state: paused; }

.launch-frieze {
  position: absolute;
  inset-inline: 0;
  inset-block-end: calc(env(safe-area-inset-bottom, 0px) + 28px);
  --frieze-wave-w: 18px;          /* a little larger than in the app */
  opacity: 0.35;
}

.launch-frieze::before { background: var(--sd-blue-light); }

:root[data-theme="night"] .launch {
  background: var(--sd-night-black);
  color: var(--sd-night-ink);
}
:root[data-theme="night"] .launch-descriptor { color: var(--sd-night-400); }
:root[data-theme="night"] .launch-frieze::before { background: var(--sd-night-red); }
/* The logo file is blue and white: tinted red at night, like the basemap. */
:root[data-theme="night"] .launch-logo {
  filter: grayscale(1) brightness(0.8) sepia(1) saturate(8) hue-rotate(-50deg);
}

@media (prefers-reduced-motion: reduce) {
  .launch { transition: none; }
}

/* Login: full logo, tagline and descriptor above the form. */
.login-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3em;
  padding-block: 1.25em 1.5em;
  text-align: center;
}

.login-hero .brand-logo {
  inline-size: min(240px, 72%);
  margin-block-end: 0.75em;
}

.brand-tagline {
  margin: 0;
  font-family: var(--rp-font-title);
  font-weight: 600;
  font-size: 1.15rem;
}

.brand-descriptor {
  margin: 0;
  color: var(--rp-slate);
}

/* Menu: the frieze closes the panel, below the sign-out link. */
.side-menu-frieze {
  flex: none;
  margin: 0.25em 1em calc(env(safe-area-inset-bottom, 0px) + 1em);
}

/* Calculation waiting screen: the oculus above the stage bar. */
.routing-waiting .oculus {
  inline-size: 128px;
  align-self: center;
  margin-block: 0.5em 0.25em;
}

/* Empty list or search: oculus, one friendly line, frieze. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--rp-space-3);
  padding: 1.25em var(--rp-space-4) var(--rp-space-2);
  text-align: center;
  list-style: none;
}

.empty-state .oculus {
  inline-size: 112px;
}

.empty-state .ornament {
  inline-size: 132px;
  block-size: auto;
  color: var(--rp-link);
}

.empty-state .ornament-dolphin { inline-size: 168px; }

[dir="rtl"] .empty-state .ornament-dolphin { transform: scaleX(-1); }

.empty-state-lead {
  margin: 0;
  font-family: var(--rp-font-title);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--rp-ink);
}

.empty-state-text {
  margin: 0;
  max-inline-size: 32ch;
  color: var(--rp-slate);
}

.empty-state .frieze {
  align-self: stretch;
  margin-block-start: var(--rp-space-2);
}

/* --- Mes voyages (essai): layout only, every colour and shape from the tokens above. --- */
.voyage-body,
.voyage-text-box,
.voyage-others,
.voyage-change {
  display: flex;
  flex-direction: column;
  gap: var(--rp-rhythm);
}

.voyage-body > h2 { margin-block: 0; }

.voyage-wishes-list {
  margin: 0;
  padding-inline-start: 1.2em;
  display: flex;
  flex-direction: column;
  gap: var(--rp-space-1);
}

.voyage-wishes-list li { overflow-wrap: anywhere; }

.voyage-when { margin: 0; }

.voyage-when-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rp-space-2);
}

.voyage-when-row .field { flex: 1 1 8em; min-inline-size: 0; }

/* Conditions at the arrival place, first on a crossing's result: a framed block, exposed said in amber. */
.arrival-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--rp-space-2);
  padding: var(--rp-space-3);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
  min-inline-size: 0;
}

.arrival-block[data-state="exposed"], .arrival-block--windy { border-color: var(--rp-go-reserve); }
.arrival-block--windy, .arrival-block--very-windy { border-width: 2px; }
.arrival-block--very-windy { border-color: var(--rp-danger); }
.arrival-block > * { margin-block: 0; }
.arrival-title { font-size: 1rem; }
.arrival-place { font-weight: 600; overflow-wrap: anywhere; }
.arrival-lead { overflow-wrap: anywhere; }

.arrival-offer {
  display: flex;
  flex-direction: column;
  gap: var(--rp-space-2);
}

.arrival-offer > * { margin-block: 0; }
.arrival-offer .btn-secondary { white-space: normal; text-align: center; }
.arrival-block .figures-list { margin-block: 0; }
.arrival-details summary { min-block-size: 44px; display: flex; align-items: center; cursor: pointer; color: var(--rp-link); }
.arrival-details > * { margin-block: 0 var(--rp-space-1); }
.arrival-cells { margin: 0; padding-inline-start: 1.2em; }

/* A time in two lists: the hour takes the room, the quarter stays narrow. */
.time-pick {
  display: flex;
  align-items: center;
  gap: var(--rp-space-1);
  min-inline-size: 0;
}

.time-pick .time-pick-hour { flex: 1 1 4.5em; min-inline-size: 0; }
.time-pick .time-pick-minute { flex: 0 0 4.75em; }
.time-pick-sep { font-weight: 600; }
/* A clock reads hours then minutes left to right in every script, Arabic included. */
[dir="rtl"] .time-pick { direction: ltr; }
[dir="rtl"] .time-pick select { direction: rtl; }

.voyage-include { margin: 0; }

.voyage-chosen {
  list-style: none;
  margin: 0;
  padding: 0;
}

.voyage-chosen .trip-row { justify-content: space-between; }

.voyage-form textarea {
  inline-size: 100%;
  font: inherit;
  color: var(--rp-ink);
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  padding: var(--rp-space-2) var(--rp-space-3);
}

.voyage-day { cursor: default; }

.voyage-day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--rp-space-2);
}

.voyage-stops {
  list-style: none;
  margin: var(--rp-space-2) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--rp-space-3);
}

.voyage-stop {
  display: flex;
  gap: var(--rp-space-3);
  padding-block-start: var(--rp-space-3);
  border-block-start: 1px solid var(--rp-border);
}

.voyage-stop-time {
  flex: 0 0 3.2em;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.voyage-stop-main {
  flex: 1 1 auto;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--rp-space-1);
}

.voyage-stop-main p { margin: 0; }

.voyage-stop-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--rp-space-1) var(--rp-space-2);
}

.voyage-stop-role {
  font-size: 0.85rem;
  color: var(--rp-slate);
}

/* A stop's name opens its place card; a leg's line shows it on the map. */
.voyage-place,
.voyage-leg {
  min-block-size: 32px;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: var(--rp-link);
  text-align: start;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.voyage-place { font-weight: 500; text-decoration: underline; }

.voyage-leg { font-size: 0.85rem; color: var(--rp-slate); }

.voyage-night {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--rp-space-1);
}

.voyage-night-lines {
  display: flex;
  flex-direction: column;
  gap: var(--rp-space-1);
}

.voyage-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}

.voyage-engine p { margin: 0; }

.voyage-engine-error {
  margin: 0;
  padding: var(--rp-space-3);
  max-block-size: 40vh;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
}

.voyage-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rp-space-2) var(--rp-space-3);
}

/* The shell runs files of two versions: said in a banner, with its way out. */
.stale-app {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--rp-space-2);
}

.stale-app p { margin: 0; }

/* "Arrivée de nuit": the warning, then the priced offer of a departure that arrives by day. */
.night-arrival { display: grid; gap: var(--rp-space-2); margin-block: var(--rp-space-2); }
.notice-box {
  border: 1px solid var(--rp-go-reserve);
  border-radius: var(--rp-radius-s);
  background: var(--rp-bg);
  color: var(--rp-ink);
  padding: 0.75em 1em;
  margin-block: var(--rp-space-2);
}
.notice-box p { margin: 0; }
.notice-box .next-window { margin: 0; }
.notice-head { display: flex; gap: 0.6em; align-items: flex-start; }
.notice-icon { flex: none; width: 24px; height: 24px; }

/* The verdict, its reason and the offer that answers it: one frame, like the night-arrival box. */
.verdict-frame { display: grid; gap: var(--rp-space-2); }
.verdict-frame:has(.next-window:not([hidden])) {
  border: 1px solid var(--rp-no-go);
  border-radius: var(--rp-radius-s);
  background: var(--rp-bg);
  padding: 0.75em 1em;
  margin-block: var(--rp-space-2);
}
.verdict-frame .next-window { margin: 0; }
.verdict-frame .next-window p { margin: 0; }

/* Fuel: the shortage, the places to refuel with what each detour costs, the crossing asked again. */
.fuel-slot, .fuel-stops, .fuel-through { display: grid; gap: var(--rp-space-2); margin-block: var(--rp-space-2); }
.fuel-stops p, .fuel-through p { margin: 0; }
.fuel-stop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--rp-space-2); }
.fuel-stop { display: grid; gap: 0.25em; padding: var(--rp-space-2); border: 1px solid var(--rp-border); border-radius: 8px; overflow-wrap: anywhere; }
.fuel-stop-note, .fuel-stop-contact, .fuel-estimate { font-size: 0.9em; }
.fuel-optional-title { font-weight: 600; }
.fuel-ask { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5em; margin-block-start: 0.25em; }

/* A delivery's stops on the map: a dot and its name with the miles it adds; proposed ones in the alternative colour. */
.stop-mark {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}
.stop-mark-dot {
  inline-size: 14px;
  block-size: 14px;
  border-radius: 50%;
  background: var(--rp-surface);
  border: 3px solid var(--rp-map-alt);
  flex: none;
}
.stop-mark[data-kind="mandatory"] .stop-mark-dot { border-color: var(--rp-map-casing); background: var(--rp-accent); border-radius: 3px; }
.stop-mark[data-kind="accepted"] .stop-mark-dot { border-color: var(--rp-map-casing); background: var(--rp-accent); }
.stop-mark-label {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--rp-surface);
  color: var(--rp-ink);
  font-size: 0.75rem;
  white-space: nowrap;
  box-shadow: var(--rp-shadow-float);
  opacity: 0.9;
}
.stop-mark[data-active="true"] .stop-mark-label { outline: 2px solid var(--rp-map-alt); opacity: 1; font-weight: 600; }
.stop-mark:focus-visible { outline: 3px solid var(--rp-focus); outline-offset: 2px; }
.delivery-proposed-row[data-active="true"] { outline: 2px solid var(--rp-map-alt); outline-offset: 2px; border-radius: 8px; }

/* Fuel options on the map: a small pump mark each (the ones the route needs stand out), and a card on hover or tap. */
.pump-mark {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 22px;
  block-size: 22px;
  padding: 0;
  border-radius: 50%;
  background: var(--rp-surface);
  border: 1.5px solid var(--rp-map-link);
  color: var(--rp-map-link);
  box-shadow: var(--rp-shadow-float);
  cursor: pointer;
}
.pump-mark::after { content: ""; position: absolute; inset: -10px; }      /* a finger-sized target around the small mark */
.pump-mark svg { inline-size: 13px; block-size: 13px; }
.pump-mark[data-needed="true"] {
  inline-size: 30px;
  block-size: 30px;
  background: var(--rp-accent);
  color: var(--rp-ink-on-accent);
  border: 2px solid var(--rp-accent-edge);
}
.pump-mark[data-needed="true"] svg { inline-size: 18px; block-size: 18px; }
.pump-mark:focus-visible { outline: 3px solid var(--rp-focus); outline-offset: 2px; }
.pump-card-host {
  position: fixed;
  z-index: 14;
  inset-inline: var(--rp-space-4);
  inset-block-start: calc(env(safe-area-inset-top, 0px) + 72px);
  max-inline-size: 22rem;
  margin-inline: auto;
}
.pump-card-host[hidden] { display: none; }
.pump-card {
  display: grid;
  gap: 0.3em;
  padding: var(--rp-space-3);
  background: var(--rp-surface);
  color: var(--rp-ink);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-m);
  box-shadow: var(--rp-shadow-panel);
  overflow-wrap: anywhere;
}
.pump-card p { margin: 0; }
.pump-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--rp-space-2); }
.pump-card-close { flex: 0 0 auto; inline-size: 32px; block-size: 32px; margin: -6px -6px 0 0; border: 0; background: none; color: var(--rp-ink); font-size: 1.4em; line-height: 1; cursor: pointer; }
.pump-card-presumed { font-size: 0.9em; color: var(--rp-slate); }
.pump-card .fuel-ask { margin-block-start: 0.4em; }
@media (min-width: 900px) {
  .pump-card-host { inset-inline: auto 0.75em; inset-block-start: 72px; inline-size: 22rem; margin-inline: 0; }
}

/* --- Trip result, the unfolding: a strip of days, the chosen day as a sequence (layout only). --- */
.voyage-summary { margin: 0; }

.voyage-summary span { white-space: nowrap; }

.voyage-dates { margin: 0; font-weight: 500; }

.voyage-leg-figures { margin: 0; }

.voyage-figure {
  font-family: var(--rp-font-title, inherit);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--rp-ink);
  font-variant-numeric: tabular-nums;
}

.voyage-strip {
  display: flex;
  gap: var(--rp-space-2);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-block-end: var(--rp-space-2);
  margin-inline: calc(-1 * var(--rp-space-1));
  padding-inline: var(--rp-space-1);
}

.voyage-strip-day {
  flex: 0 0 9.5em;
  inline-size: 9.5em;
  align-items: stretch;
  text-align: start;
  scroll-snap-align: center;
  background: var(--rp-surface);
  color: var(--rp-ink);
  font: inherit;
  cursor: pointer;
}

.voyage-strip-figures { font-size: 0.85rem; font-variant-numeric: tabular-nums; }

.voyage-strip-end {
  display: flex;
  align-items: center;
  gap: var(--rp-space-1);
  min-inline-size: 0;
  font-size: 0.85rem;
}

.voyage-strip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Night verdict as a dot: the verdict colours, grey when the night is not judged. */
.voyage-dot {
  flex: 0 0 auto;
  inline-size: 0.7em;
  block-size: 0.7em;
  border-radius: 50%;
  background: var(--rp-slate);
}

.voyage-dot.verdict-go { background: var(--rp-go); }
.voyage-dot.verdict-go_reserve { background: var(--rp-go-reserve); }
.voyage-dot.verdict-no_go { background: var(--rp-no-go); }

.voyage-strip-marks { font-size: 16px; color: var(--rp-slate); }
.place-tag .icon { font-size: 16px; margin-inline-end: 0.25em; vertical-align: -0.2em; }
.swell-bubble-close .icon { font-size: 18px; }

/* One column that never grows past the panel: the strip scrolls inside it, the page never sideways. */
/* The trip screen takes the panel's width whatever a card holds: a short card does not pull ⏭ sideways. */
.voyage-view { inline-size: 100%; }
.voyage-body { display: grid; grid-template-columns: minmax(0, 1fr); }

.voyage-day-detail { display: flex; flex-direction: column; min-inline-size: 0; }

.voyage-day {
  display: flex;
  flex-direction: column;
  gap: var(--rp-space-2);
}

.voyage-seq {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.voyage-seq-row {
  display: flex;
  gap: var(--rp-space-3);
  padding-block: var(--rp-space-2);
}

.voyage-seq-arrive, .voyage-seq-start, .voyage-seq-stay { border-block-start: 1px solid var(--rp-border); }

.voyage-seq-leave .voyage-stop-time { font-weight: 400; color: var(--rp-slate); }

.voyage-leg {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--rp-space-1) var(--rp-space-3);
}

/* The way to the passage that leads to this stop. */
.voyage-step > .voyage-leg {
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  min-block-size: 44px;
  padding-inline: var(--rp-space-3);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-m);
  font-size: 1rem;
  color: var(--rp-link);
}

.voyage-says {
  display: flex;
  flex-direction: column;
  gap: var(--rp-space-1);
  padding-inline-start: var(--rp-space-3);
  border-inline-start: 2px solid var(--rp-border);
  font-size: 0.9rem;
  color: var(--rp-slate);
}

.voyage-says p { margin: 0; overflow-wrap: anywhere; }

.voyage-count { cursor: pointer; background: none; font: inherit; font-size: 0.75rem; min-block-size: 28px; }

.voyage-checklist { display: flex; flex-direction: column; gap: var(--rp-space-2); }

.voyage-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--rp-space-2);
}

.voyage-check {
  display: flex;
  align-items: flex-start;
  gap: var(--rp-space-2);
  font-size: 0.9rem;
}

.voyage-check .voyage-count { flex: 0 0 auto; }

.voyage-check span { overflow-wrap: anywhere; }

.voyage-full-text summary { cursor: pointer; color: var(--rp-link); min-block-size: 44px; display: flex; align-items: center; }

/* Nights nothing could judge: said at the head of the trip. */
.voyage-unjudged { display: flex; flex-direction: column; gap: var(--rp-space-1); margin: 0; }
.voyage-unjudged p { margin: 0; }

/* --- Trip result as a presentation: one step open at a time in the sheet, the map above (layout only). --- */
.voyage-step,
.voyage-drawer {
  display: flex;
  flex-direction: column;
  gap: var(--rp-space-2);
  min-inline-size: 0;
}

.voyage-step p, .voyage-drawer p { margin: 0; }

/* Previous, the itinerary, next: the head of every card, in reach of the thumb when the sheet is folded. */
.voyage-transport {
  display: flex;
  align-items: center;
  gap: var(--rp-space-2);
}

.voyage-transport .icon-button { border: 1px solid var(--rp-border); }

.voyage-transport-next {
  border-color: var(--rp-selected);
  background: var(--rp-selected);
  color: var(--rp-on-selected);
}

.voyage-transport-next:hover,
.voyage-transport-next:focus-visible {
  background: var(--rp-selected);
  filter: brightness(1.08);
}

.voyage-transport-next:disabled {
  border-color: var(--rp-border);
  background: var(--rp-surface);
  color: var(--rp-slate);
  filter: none;
}

/* Wind and swell in one line: what a folded step adds to its name; the open card has the tiles instead. */
.voyage-fold-recap { display: none; }

@media (max-width: 899px) {
  .panel[data-mode="two"][data-state="peek"] .voyage-fold-recap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15em 1em;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
  }
}

/* Beside « Commencer » on a folded opening: the gales and the early return the fold hides, one tap to read them. */
.voyage-fold-hint { display: none; }

@media (max-width: 899px) {
  .panel[data-mode="two"][data-state="peek"] .voyage-fold-hint {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    min-block-size: 44px;
    min-inline-size: 0;
    max-inline-size: 62%;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    text-align: start;
    cursor: pointer;
  }
}

.voyage-fold-hint .place-tag { display: inline-flex; align-items: center; gap: 0.3em; max-inline-size: 100%; line-height: 1.5; white-space: nowrap; }
.voyage-fold-hint .place-tag > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.voyage-fold-hint .icon { font-size: 14px; }

/* Which trip a step or a leg belongs to, beside its moment. */
.voyage-step-when .place-tag { align-self: flex-start; }
.voyage-step-when span > .place-tag { margin-inline-start: 0.6em; }

.fold-recap-part { display: inline-flex; align-items: center; gap: 0.3em; white-space: nowrap; }
.fold-recap-label { color: var(--rp-slate); }
.fold-recap-part .cond-arrow { inline-size: 18px; block-size: 18px; }

.voyage-transport-list {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--rp-space-2);
  min-block-size: 44px;
  font-variant-numeric: tabular-nums;
}

.voyage-step-when {
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
}

.voyage-step-when span { color: var(--rp-slate); }

.voyage-step-name { margin: 0; font-size: 1.35rem; overflow-wrap: anywhere; }

.voyage-leg-from { font-size: 0.85rem; color: var(--rp-slate); }

.voyage-about { display: flex; flex-direction: column; gap: var(--rp-space-1); }

.voyage-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rp-space-2);
}

.voyage-days-list,
.voyage-step-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.voyage-days-list { gap: var(--rp-space-3); }

.voyage-step-row {
  inline-size: 100%;
  min-block-size: 44px;
  display: flex;
  align-items: center;
  gap: var(--rp-space-2);
  padding: var(--rp-space-1) var(--rp-space-2);
  border: 1px solid transparent;
  border-block-start-color: var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: none;
  color: var(--rp-ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.voyage-step-n {
  flex: 0 0 1.8em;
  inline-size: 1.8em;
  block-size: 1.8em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--rp-ink);
  border-radius: 50%;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.voyage-step-row-name {
  flex: 1 1 auto;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
}

.voyage-step-row-name strong { overflow-wrap: anywhere; }

/* Between two stops of the itinerary, the leg: the line that joins them, its miles and its time. */
.voyage-leg-row {
  inline-size: 100%;
  min-block-size: 44px;
  display: flex;
  align-items: center;
  gap: var(--rp-space-2);
  padding: 0 var(--rp-space-2);
  border: 1px solid transparent;
  border-radius: var(--rp-radius-s);
  background: none;
  color: var(--rp-link);
  font: inherit;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  text-align: start;
  cursor: pointer;
}

.voyage-leg-mark {
  flex: 0 0 auto;
  inline-size: 2px;
  block-size: 36px;
  margin-inline: calc(0.72rem - 1px);
  background: var(--rp-slate);
}

.voyage-leg-row-figures { flex: 1 1 auto; }

button.back-link { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }

/* A place's photo: a box of fixed shape (nothing moves when the image arrives), its credit always under it. */
.place-photo { margin: 0; display: flex; flex-direction: column; gap: 2px; }

.place-photo-box {
  display: block;
  inline-size: 100%;
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  border-radius: var(--rp-radius-m);
  overflow: hidden;
  background: var(--rp-border);
}

button.place-photo-box { cursor: pointer; }

.place-photo-box img,
.place-photo-thumb img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.place-photo-credit { font-size: 0.72rem; line-height: 1.3; color: var(--rp-slate); overflow-wrap: anywhere; }

/* A reconstructed view (AI): a small label always in view, on the image's corner or in the row. */
.place-photo-box { position: relative; }

.place-photo-ai {
  align-self: flex-start;
  padding: 1px 6px;
  border-radius: var(--rp-radius-s);
  background: rgb(0 0 0 / 68%);
  color: var(--sd-white);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.place-photo-box .place-photo-ai { position: absolute; inset-block-start: 6px; inset-inline-start: 6px; pointer-events: none; }

.place-photo-ai-hint { font-size: 0.72rem; color: var(--rp-slate); }

.place-photo-credit a { color: inherit; }

.place-photo-thumb {
  flex: 0 0 44px;
  inline-size: 44px;
  block-size: 44px;
  border-radius: var(--rp-radius-s);
  overflow: hidden;
  background: var(--rp-border);
}

/* A place's photos: one row that the finger swipes (snap), each photo with its credit; buttons for the rest. */
.place-gallery { display: flex; flex-direction: column; gap: 2px; margin: 0; }

.place-gallery-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--rp-radius-m);
}

.place-gallery-track::-webkit-scrollbar { display: none; }

.place-gallery-track:focus-visible { outline: 2px solid var(--rp-link); outline-offset: 2px; }

.place-gallery-slide { flex: 0 0 100%; min-inline-size: 0; scroll-snap-align: start; scroll-snap-stop: always; }

.place-gallery-bar { display: flex; align-items: center; justify-content: center; gap: 4px; }

.place-gallery-count { font-size: 0.78rem; color: var(--rp-slate); min-inline-size: 4.5em; text-align: center; font-variant-numeric: tabular-nums; }

.place-gallery-btn:disabled { opacity: 0.35; cursor: default; }

[dir="rtl"] .place-gallery-btn .icon { transform: scaleX(-1); }

.place-photo-credit-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: 0.72rem; color: var(--rp-slate); }

/* On a phone the half sheet keeps the map in view: the step's photo is a band there, whole in the full sheet. */


/* Trip, crossing and nav screens: the basemap switch (plan / satellite), Baleeze's layers disc; trip: the legend of the dotted leg, over the map. */
.map-basemap {
  position: fixed;
  z-index: 11;
  inset-block-start: calc(env(safe-area-inset-top, 0px) + 72px);
  inset-inline-end: 12px;
  inline-size: 44px;
  block-size: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--rp-surface);
  color: var(--rp-ink);
  box-shadow: var(--rp-shadow-panel);
  cursor: pointer;
}

.map-basemap .icon { font-size: 26px; }

/* Map screen: under "Locate me" (its place when it is gone), hidden with it under the first-use note and a raised card. */
.map-basemap-explore {
  inset-block-start: calc(env(safe-area-inset-top, 0px) + 124px);
  box-shadow: var(--rp-shadow-float);
}

body:has(.map-locate[hidden]) .map-basemap-explore {
  inset-block-start: calc(env(safe-area-inset-top, 0px) + 72px);
}

body:has(.map-coach) .map-basemap-explore {
  visibility: hidden;
}

@media (max-width: 899px) {
  body:has(.panel[data-mode="fold"][data-state="full"] .place-card) .map-basemap-explore { visibility: hidden; }
}

/* Bottom-left controls (scale, Mapbox logo) clear of the panel: right of the side panel, above the sheet (map-scale.js). */
body:not([data-screen="nav"]) .mapboxgl-ctrl-bottom-left {
  left: var(--map-ctrl-left, 0px);
  bottom: var(--map-ctrl-bottom, 0px);
}

body:not([data-screen="nav"]) [data-scale-hidden] .mapboxgl-ctrl-scale { visibility: hidden; }

/* Scale (Mapbox's), above its logo: a thin bracket, ink on the plan, white on the photo; nautical miles, metres on a cove. */
.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-scale {
  margin-block-end: 4px;
  padding: 0 4px 1px;
  border: 2px solid var(--rp-ink);
  border-block-start: 0;
  background: color-mix(in srgb, var(--rp-surface) 55%, transparent);
  color: var(--rp-ink);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-scale[data-unit="nautical"] {
  text-transform: uppercase;       /* "NM", as everywhere in the app; metres stay "m" */
}

[data-basemap="satellite"] .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-scale {
  border-color: var(--sd-white);
  background: transparent;
  color: var(--sd-white);
  text-shadow: 0 0 2px var(--sd-black), 0 0 2px var(--sd-black);
}

.map-legend {
  position: fixed;
  z-index: 11;
  inset-block-start: calc(env(safe-area-inset-top, 0px) + 72px);
  inset-inline-start: 12px;
  max-inline-size: min(60vw, 260px);
  margin: 0;
  padding: 0.4em 0.7em;
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
  color: var(--rp-ink);
  font-size: 0.8rem;
  box-shadow: var(--rp-shadow-panel);
}

/* « Retour au départ »: the arrival set to the departure in one tap. */
.route-same { min-block-size: 36px; padding-block: 0.25em; margin-block-start: 0.2em; font-size: 0.9rem; }

/* --- Places to include, chosen on the map: the form steps aside, a bar holds the choices --- */
body[data-picking] .panel { display: none; }

.voyage-pick-map { margin-block-start: 0.5em; }

.voyage-pick-bar {
  position: fixed;
  z-index: 12;
  inset-inline: 12px;
  inset-block-end: calc(env(safe-area-inset-bottom, 0px) + 12px);
  max-inline-size: 560px;
  margin-inline: auto;
  padding: 0.75em 1em;
  border-radius: var(--rp-radius-l);
  background: var(--rp-surface);
  color: var(--rp-ink);
  box-shadow: var(--rp-shadow-panel);
  display: grid;
  gap: 0.5em;
}

.voyage-pick-bar[hidden] { display: none; }
.voyage-pick-help { margin: 0; font-size: 0.9rem; }

.voyage-pick-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  max-block-size: 7.5em;
  overflow-y: auto;
}

.voyage-pick-chip {
  min-block-size: 36px;
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.voyage-pick-chip .icon { font-size: 18px; }


/* --- The head every step shares, and its first block: wind, swell, protection (or the angle to the route) --- */
.voyage-head { display: contents; }

.voyage-head-title { margin: 0; font-size: 1.1rem; }

.voyage-head-day,
.voyage-day-nav {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25em 0.75em;
  font-size: 0.9rem;
}

.voyage-day-nav { color: var(--rp-slate); }

.voyage-cond {
  display: grid;
  grid-template-columns: repeat(var(--cond-n, 2), minmax(0, 1fr));   /* --cond-n: the number of tiles, set by the script */
  gap: 0.5em;
}

/* A port night the weather imposes: the closed crossing and the night's word share one colour. */
.cond-tile.cond-imposed { background: var(--sd-pill-amber-bg); border-color: transparent; color: var(--sd-pill-amber-ink); }
.cond-tile.cond-imposed .cond-title,
.cond-tile.cond-imposed .cond-state { color: inherit; }
.cond-tile.cond-imposed .cond-value { font-size: 1.05rem; hyphens: auto; }
.voyage-role-imposed {
  display: inline-block;
  justify-self: start;
  inline-size: fit-content;
  padding: 0.05em 0.6em;
  border-radius: var(--rp-radius-pill);
  background: var(--sd-pill-amber-bg);
  color: var(--sd-pill-amber-ink);
}

.cond-tile {
  display: grid;
  gap: 0.2em;
  align-content: start;
  padding: 0.5em 0.65em;
  border: 1px solid var(--rp-border);
  border-radius: 12px;
  min-inline-size: 0;
}

.cond-title {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rp-slate);
}

.cond-value { font-size: 1.2rem; }
.cond-state, .cond-none { font-size: 0.85rem; color: var(--rp-slate); }

.cond-dir {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-weight: 600;
}

.cond-arrow { inline-size: 28px; block-size: 28px; fill: currentColor; stroke: currentColor; stroke-width: 1.6; }
.cond-wind-arrow { color: var(--rp-ink); }
.cond-sea-arrow { color: var(--rp-map-swell); }
.cond-shaft { fill: none; }
.cond-tile .place-rose { inline-size: 76px; block-size: 76px; }

.cond-tile.cond-relative { grid-column: 1 / -1; }
svg.cond-relative { inline-size: 104px; block-size: 104px; flex: 0 0 auto; }
.cond-rel-body { display: flex; align-items: center; gap: 1em; }
.cond-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4em; font-size: 0.9rem; }
.cond-legend li { display: flex; align-items: center; gap: 0.5em; }
.cond-key { inline-size: 28px; block-size: 0; border-top: 3px solid var(--rp-ink); }
.cond-key.cond-sea-line { border-top-style: dashed; border-top-color: var(--rp-map-swell); }
.cond-route { fill: var(--rp-ink); }
.cond-route-line { stroke: var(--rp-ink); stroke-width: 2; fill: none; stroke-dasharray: 3 3; }
.cond-in { fill: none; stroke-width: 3; stroke-linecap: round; }
.cond-wind-line { stroke: var(--rp-ink); }
.cond-sea-line { stroke: var(--rp-map-swell); stroke-dasharray: 5 3; }
.cond-head.cond-wind-line { fill: var(--rp-ink); }
.cond-head.cond-sea-line { fill: var(--rp-map-swell); stroke-dasharray: none; }

.cond-wide { grid-column: 1 / -1; margin: 0; }


/* --- Predictability pill: green from 80 %, amber 50-70, red up to 40 (the number is always said) --- */
.predictability-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3em;
  padding: 0.1em 0.7em;
  border-radius: var(--rp-radius-pill);
  font-size: 0.82rem;
  white-space: nowrap;
}
.predictability-green { background: var(--sd-pill-green-bg); color: var(--sd-pill-green-ink); }
.predictability-amber { background: var(--sd-pill-amber-bg); color: var(--sd-pill-amber-ink); }
.predictability-red { background: var(--sd-pill-red-bg); color: var(--sd-pill-red-ink); }
:root[data-theme="dusk"], :root[data-theme="night"] {
  --sd-pill-green-bg: #134A26; --sd-pill-green-ink: #C9F2D4;
  --sd-pill-amber-bg: #5A3E06; --sd-pill-amber-ink: #FFE3A6;
  --sd-pill-red-bg: #6B1B17; --sd-pill-red-ink: #FFD2CE;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --sd-pill-green-bg: #134A26; --sd-pill-green-ink: #C9F2D4;
    --sd-pill-amber-bg: #5A3E06; --sd-pill-amber-ink: #FFE3A6;
    --sd-pill-red-bg: #6B1B17; --sd-pill-red-ink: #FFD2CE;
  }
}
:root {
  --sd-pill-green-bg: #D6F2DD; --sd-pill-green-ink: #0B4D1F;
  --sd-pill-amber-bg: #FFE9B8; --sd-pill-amber-ink: #6B4300;
  --sd-pill-red-bg: #FAD0CD; --sd-pill-red-ink: #7A1410;
}


/* --- Itinerary panel: the vertical timeline alone, a day opening its first step --- */
.voyage-day-open {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--rp-space-1, 4px) 0.5em;
  inline-size: 100%;
  text-align: start;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.voyage-headline { margin: 0; font-weight: 600; }
/* The early return under the gales: its line, then the one control that swaps the trip shown. */
.voyage-early { display: grid; gap: var(--rp-space-2, 8px); }
.voyage-early p { margin: 0; }
.voyage-early .btn-secondary { justify-self: start; white-space: normal; text-align: start; }
.cond-note { font-size: 0.75rem; color: var(--rp-slate); }
.voyage-swim { display: grid; gap: var(--rp-space-2, 8px); }

.voyage-pistes { margin: 0; padding-inline-start: 1.2em; display: flex; flex-direction: column; gap: var(--rp-space-2); }
.voyage-piste { display: flex; flex-direction: column; align-items: flex-start; gap: var(--rp-space-1); }

/* In-app confirmation: a sheet from the bottom on a phone, a card in the middle on a wide screen. */
.confirm-sheet {
  inline-size: min(100vw, 28rem);
  max-inline-size: 100vw;
  margin: auto auto 0;
  padding: 1.25em 1em calc(1em + env(safe-area-inset-bottom));
  border: 1px solid var(--rp-border);
  border-block-end: none;
  border-radius: var(--rp-radius-l) var(--rp-radius-l) 0 0;
  background: var(--rp-surface);
  color: var(--rp-ink);
  box-shadow: var(--rp-shadow-sheet);
  font-family: var(--rp-font-text);
}

.confirm-sheet::backdrop {
  background: rgb(0 0 0 / 0.45);
}

.confirm-sheet-text {
  margin: 0 0 1em;
  font-family: var(--rp-font-title);
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
}

.confirm-sheet-actions {
  display: flex;
  gap: 0.75em;
}

.confirm-sheet-actions > button {
  flex: 1 1 0;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 44px;
  padding-inline: 1.25em;
  border: none;
  border-radius: var(--rp-radius-s);
  background: var(--rp-no-go);
  color: var(--rp-ink-on-status);
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.btn-danger:hover, .btn-danger:focus-visible {
  filter: brightness(0.95);
}

@media (min-width: 720px) {
  .confirm-sheet {
    margin: auto;
    border-block-end: 1px solid var(--rp-border);
    border-radius: var(--rp-radius-l);
    padding-block-end: 1em;
  }
}

/* --- Map screen on phones: the sheet is folded (a title, the map has the rest) or open on the whole form --- */
.explore-fold { display: none; }

@media (max-width: 899px) {
  .panel[data-mode="fold"][data-state="peek"] {
    max-block-size: calc(84px + env(safe-area-inset-bottom, 0px));
  }
  .panel[data-mode="fold"][data-state="peek"] #view {
    padding-block: 0 0.5em;
    overflow: hidden;
  }
  .panel[data-mode="fold"][data-state="peek"] .explore-view > :not(.explore-fold) {
    display: none;
  }
  .panel[data-mode="fold"][data-state="peek"] .explore-fold {
    display: block;
    flex: 0 0 auto;
    min-block-size: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: start;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
  }
}

/* A place's card on the map screen: a wide photo, so the facts under it stay in reach. */
.place-card:not(.place-card-embedded) .place-photo-box { aspect-ratio: 16 / 9; }

/* An open card reaches the top of the phone: "Locate me" would sit on its close button. */
@media (max-width: 899px) {
  body:has(.panel[data-mode="fold"][data-state="full"] .place-card) .map-locate { visibility: hidden; }
}

/* Legal pages and the notes that point to them (legal.js). */
.legal-note,
.legal-aid {
  margin: 0.75em 0 0;
  font-size: 0.85rem;
  color: var(--rp-slate);
}
/* The plan's note: discreet, on every result, never in a collapsed box (brief 13/11). */
.plan-note { font-size: 0.78rem; line-height: 1.4; }
/* Its one-line version, only on a folded phone sheet (Claude 13/11), under the pinned action. */
.plan-note-short { display: none; }
.panel-action:has(> .plan-note-short) { flex-wrap: wrap; row-gap: 4px; }
.panel-action > .plan-note-short { flex: 1 0 100%; }
@media (max-width: 899px) {
  .panel[data-state="peek"] .plan-note-short {
    display: block;
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.legal-note a,
.legal-aid a,
.legal-check a { color: inherit; text-decoration: underline; }
.legal-check {
  display: flex;
  gap: 0.6em;
  align-items: flex-start;
  margin: 0.75em 0;
  font-size: 0.9rem;
}
.legal-check input { margin-top: 0.2em; flex: none; }
.legal-view h3 { margin: 1.4em 0 0.4em; font-size: 1rem; }
.legal-view p,
.legal-view li { line-height: 1.5; }
.legal-view ul { padding-inline-start: 1.2em; }
.legal-meta { margin: 0 0 0.4em; font-size: 0.85rem; color: var(--rp-slate); }
.legal-back { display: inline-block; margin-block-end: 0.6em; font-size: 0.9rem; }
.legal-index { list-style: none; padding: 0; }
.legal-index li { margin: 0.6em 0; }
.legal-mail { overflow-wrap: anywhere; }
.legal-gate ul { padding-inline-start: 1.2em; }
.legal-gate li { margin: 0.4em 0; line-height: 1.45; }

/* Community feedback dialogs (rate / comment a place, propose a new one) */
.community-dialog {
  inline-size: min(32em, calc(100vw - 32px));
  max-block-size: calc(100dvh - 32px);
  padding: 1em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-m);
  background: var(--rp-surface);
  color: var(--rp-ink);
  overflow-y: auto;
}

.community-dialog::backdrop {
  background: rgb(0 0 0 / 0.55);
}

.community-dialog h3 {
  margin: 0 0 0.25em;
}

.community-form {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

.community-form > p {
  margin: 0;
}

.community-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.community-choice {
  display: flex;
  align-items: center;
  gap: 0.4em;
  min-block-size: 44px;
  padding-inline: 0.75em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-pill);
}

.community-choice:has(input:checked) {
  border-color: var(--rp-ink);
  font-weight: 600;
}

.community-text,
.community-name {
  inline-size: 100%;
  box-sizing: border-box;
  padding: 0.6em 0.75em;
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-s);
  background: var(--rp-surface);
  color: var(--rp-ink);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
}

.community-name {
  min-block-size: 44px;
  resize: none;
}

.community-form > .community-label {
  margin-block-end: -0.4em;
  font-weight: 600;
}

.community-counter {
  color: var(--rp-slate);
  text-align: end;
}

.community-counter.is-over,
.community-status.is-error {
  color: var(--rp-danger);
}

.community-form > button {
  min-block-size: 44px;
}

/* --- Deliveries (convoyages): the plan screen --- */
/* The first answer reads as a trip's headline (voyage-headline): only its lines are laid out here. */
.delivery-summary > span { display: block; }
.delivery-summary > .summary-waits { margin-block-start: 0.2em; }

/* The stops the summary names, right under it (Gabriel 09/11): one tap opens the stop's step. */
.delivery-must-stops {
  display: flex;
  flex-direction: column;
  gap: var(--rp-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.delivery-must-stop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.2em var(--rp-space-2);
  inline-size: 100%;
  min-block-size: 44px;
  padding: 0.6em 0.8em;
  border: 1px solid var(--rp-go-reserve);
  border-radius: 10px;
  background: var(--rp-surface);
  color: var(--rp-ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.delivery-must-stop > :not(.icon) { grid-column: 1; }
.delivery-must-stop > .icon { grid-column: 2; grid-row: 1 / span 3; color: var(--rp-slate); }
.delivery-must-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3em 0.6em; }
.delivery-must-wait { font-size: 0.9rem; }
[dir="rtl"] .delivery-must-stop > .icon { transform: scaleX(-1); }

.delivery-proposed,
.delivery-stages {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  margin-block: 1em;
}

.delivery-proposed-row,
.delivery-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  align-items: center;
  justify-content: space-between;
  padding: 0.7em 0.8em;
  border: 1px solid var(--rp-border);
  border-radius: 10px;
  background: var(--rp-surface);
}

.delivery-stage { flex-direction: column; align-items: stretch; }

.delivery-proposed-text,
.delivery-stage-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 0.6em;
  align-items: baseline;
  min-inline-size: 0;
  flex: 1 1 12em;
}

.delivery-proposed-text > .field-hint { flex-basis: 100%; }
/* The early route of a running delivery or trip (early-status.js): one line above every view, the edit screens' spinner,
   then « à jour ». */
.delivery-status, .voyage-status { margin: 0 0 var(--rp-space-2); font-size: 0.9rem; line-height: 1.35; color: var(--rp-slate); }
.delivery-status strong, .voyage-status strong { color: var(--rp-ink); }
.delivery-status .icon, .voyage-status .icon { font-size: 18px; color: var(--rp-go); }
.delivery-proposed .times-note { margin: 0; }
/* A stop chosen by the crew: what it breaks without being refused, one line each (brief 13/11). */
.delivery-choice-warnings { list-style: none; margin: 0; display: flex; flex-direction: column; gap: 0.3em; }
.delivery-add h3 { margin: 0.4em 0 0.3em; }
/* A chosen stop's length: three presets, the active one filled (Claude 13/11). */
.stay-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex-basis: 100%; }
.stay-choices > .field-hint { margin-inline-end: 4px; }
.stay-choice {
  min-block-size: 44px; min-inline-size: 52px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--rp-border); background: var(--rp-surface); color: var(--rp-ink);
  font: inherit; font-variant-numeric: tabular-nums; cursor: pointer;
}
.stay-choice[aria-pressed="true"] { background: var(--rp-ink); color: var(--rp-surface); border-color: var(--rp-ink); cursor: default; }
.stay-choice:disabled { opacity: 0.55; }
.delivery-stage > .delivery-stage-head { flex: none; }

.delivery-stage-tags,
.delivery-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  align-items: center;
}

.delivery-tag {
  display: inline-block;
  font-size: 0.8rem;
  border-radius: var(--rp-radius-pill);
  padding: 0.15em 0.6em;
  border: 1px solid var(--rp-border);
  color: var(--rp-ink);
}

.delivery-tag.tag-strong { font-weight: 700; }
.delivery-tag.tag-fuel { border-color: var(--rp-go); }
.delivery-tag.tag-warn { border-color: var(--rp-go-reserve); font-weight: 600; }
.delivery-tag.tag-muted { color: var(--rp-slate); }
/* The delivery's chips are a trip's (place-tag); a pump harbour keeps its green, a mandatory stop its weight. */
.place-tag.tag-fuel { border-color: var(--rp-go); }
.place-tag.tag-strong { font-weight: 700; }

.delivery-recompute {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  padding-block-start: 0.4em;
}

.delivery-place .place-results { margin: 0; padding: 0; list-style: none; }

/* A delivery's proposed stop: where it is on the map (a link-looking button), and its detail page. */
.delivery-locate {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--rp-link, var(--rp-map-link));
  text-decoration: underline;
  font: inherit;
  font-size: 0.9em;
  cursor: pointer;
}
.delivery-detail-link { align-self: flex-start; display: inline-flex; align-items: center; min-block-size: 44px; color: var(--rp-link); }
.delivery-detail-stage { cursor: pointer; }
.delivery-detail-stage:focus-visible { outline: 3px solid var(--rp-focus); outline-offset: 2px; }

/* Buy page of the credits e-mails' links (web/achat.html): a plain page, no map. */
.buy-page-body {
  background: var(--rp-bg);
}

.buy-page {
  max-inline-size: 34rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.buy-page-logo {
  display: block;
  margin-block-end: 1.5rem;
}

.buy-page .btn-secondary {
  margin-block-start: 1rem;
}

/* Sign-in with a password: discreet, under the e-mail code (Google Play's review account). */
.login-password-toggle {
  display: block;
  margin: 1.25em auto 0;
  padding: 0.5em;
  min-block-size: 44px;
  border: none;
  background: none;
  color: var(--rp-slate);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}

/* Changes to a computed trip (brief 13/11): the buttons of a step or a leg, the picker of a place, the status of the last
   change (computing, its verdict to confirm, why it is refused) over every card. */
.voyage-edit { display: flex; flex-direction: column; gap: 0.5em; padding-block-start: 0.5em; border-block-start: 1px solid var(--rp-border); }
.voyage-edit .place-section-title { margin: 0; }
.voyage-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.voyage-edit-actions > button { min-block-size: 44px; }
.voyage-edit-picker { display: flex; flex-direction: column; gap: 0.5em; }
.voyage-edit-picker-title { margin: 0; font-weight: 600; }
.voyage-edit-group { list-style: none; margin-block-start: 0.4em; font-size: 0.85rem; font-weight: 600; color: var(--rp-slate); }
.voyage-edit-picker input[type="search"] { inline-size: 100%; min-block-size: 44px; box-sizing: border-box; }
.voyage-edit-picker > .btn-secondary { align-self: flex-start; min-block-size: 44px; }
.voyage-edit-status { display: flex; flex-direction: column; gap: 0.5em; margin-block-end: 0.75em; }
.voyage-edit-status > p { margin: 0; }
.voyage-edit-verdict { font-weight: 600; }
.voyage-edit-what { font-size: 0.9rem; color: var(--rp-slate); }
.error-banner .voyage-edit-what { color: inherit; }
.voyage-edit-warnings { margin: 0; padding-inline-start: 1.2em; display: flex; flex-direction: column; gap: 0.25em; }
.voyage-edit-day { display: flex; flex-direction: column; gap: 0.35em; }
.voyage-edit-day > p { margin: 0; }
.voyage-edit-computing { display: flex; align-items: center; gap: 0.6em; }
.voyage-edit-spinner {
  inline-size: 16px; block-size: 16px; flex: none; border-radius: 50%;
  border: 2px solid var(--rp-border); border-block-start-color: var(--rp-ink); animation: edit-spin 0.9s linear infinite;
}
@keyframes edit-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .voyage-edit-spinner { animation: none; } }
.voyage-edited { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4em; }
.voyage-edited > p { margin: 0; }
.voyage-edited > button { min-block-size: 44px; }
/* Folded on a phone, the status waits for the open sheet (the fold keeps its fixed height). */
@media (max-width: 899px) {
  .panel[data-mode="two"][data-state="peek"] .voyage-view > .voyage-edit-status { display: none; }
}

/* A discreet "Modifier" (icon + word) opening a small menu of actions with icons (Gabriel 13/11). */
.action-menu { position: relative; margin-inline-start: auto; }
.action-menu-button {
  display: inline-flex; align-items: center; gap: 6px; min-block-size: 44px; padding-inline: 8px 10px;
  border: 0; border-radius: var(--rp-radius-s); background: none; color: var(--rp-link);
  font: inherit; font-size: 0.95rem; font-weight: 500; cursor: pointer;
}
.action-menu-button .icon { font-size: 20px; }
.action-menu-button:hover, .action-menu-button:focus-visible, .action-menu-button[aria-expanded="true"] { background: var(--rp-bg); }
.action-menu-list {
  position: absolute; inset-block-start: calc(100% + 4px); inset-inline-end: 0; z-index: 30;
  display: flex; flex-direction: column; gap: 2px; padding: 4px;
  inline-size: max-content; min-inline-size: 220px; max-inline-size: min(320px, calc(100vw - 32px));
  border: 1px solid var(--rp-border); border-radius: var(--rp-radius-s); background: var(--rp-surface);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.action-menu-list[hidden] { display: none; }
.action-menu-item {
  display: flex; align-items: center; gap: 10px; min-block-size: 44px; padding-inline: 10px 14px;
  border: 0; border-radius: var(--rp-radius-s); background: none; color: var(--rp-ink);
  font: inherit; font-size: 0.95rem; text-align: start; cursor: pointer;
}
.action-menu-item .icon { font-size: 20px; }
.action-menu-item:hover, .action-menu-item:focus-visible { background: var(--rp-bg); }
.action-menu-item:disabled { opacity: 0.45; cursor: default; background: none; }
.action-menu-note { margin: 4px 10px 6px; font-size: 0.8rem; color: var(--rp-slate); white-space: normal; }
/* The picker of a place opens under the title, the whole width. */
.voyage-edit-host:empty { display: none; }
.community-actions .btn-secondary { gap: 8px; }
.community-actions .btn-secondary .icon { font-size: 20px; }

/* At sea without network (offline.js): « Préparer pour la navigation », its ready line, the lists' mark, the reason
   under a greyed action. Discreet: the result's own action stays the main one. */
.offline-prep { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-block: 4px; }
.offline-prepare { margin-inline-start: -8px; }
.offline-prepare:disabled { color: var(--rp-slate); cursor: default; }
.offline-ready {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; min-block-size: 32px;
  font-size: 0.85rem; color: var(--rp-go);
}
.offline-ready .icon { font-size: 18px; flex: none; }
.offline-ready[hidden] { display: none; }
.offline-mark { display: inline-flex; vertical-align: -3px; color: var(--rp-go); }
.offline-mark .icon { font-size: 18px; }
.offline-reason { margin: 4px 0 0; font-size: 0.85rem; color: var(--rp-slate); }
a[data-needs-network][aria-disabled="true"] { opacity: 0.55; cursor: default; }
