/* ── DSEG7 Classic — police affichage LCD 7 segments ── */
@font-face {
  font-family: 'DSEG7Classic';
  src: url('https://cdn.jsdelivr.net/npm/dseg@0.46.0/fonts/DSEG7-Classic/DSEG7Classic-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DSEG7Classic';
  src: url('https://cdn.jsdelivr.net/npm/dseg@0.46.0/fonts/DSEG7-Classic/DSEG7Classic-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ── Beach Design — KiteNow ── */
:root {
  --sand:       #fdf8f0;
  --sand-dark:  #f5ede0;
  --coral:      #e07a5f;
  --live-red:   #d63031;
  --teal:       #2a9d8f;
  --teal-dark:  #1e7268;
  --teal-light: #3bb5a6;
  --text:       #2d2d2d;
  --text-muted: #8a8a8a;
  --border:     #e8ddd0;
  --warn:       #e08c00;

  /* Wind colours — industry standard */
  --w0:   #ddeeff; /* 0-3 kt   — calm, pale blue */
  --w1:   #aaddcc; /* 3-7 kt   — light, teal-green */
  --w2:   #66bb88; /* 7-12 kt  — gentle, green */
  --w3:   #99cc44; /* 12-17 kt — good, yellow-green */
  --w4:   #ffcc00; /* 17-22 kt — fresh, yellow */
  --w5:   #ff8800; /* 22-28 kt — strong, orange */
  --w6:   #ee3300; /* 28-34 kt — very strong, red */
  --w7:   #aa00cc; /* 34+ kt   — storm, purple */

  --tide:   #1a6eb5;
  --tide-w: 44px;

  --radius: 12px;
  --row-h:  52px;
  --hdr-h:  26px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 18px;
}
input, textarea, select {
  font-size: 16px !important;
}

/* ── iOS install banner ── */
#ios-install-banner {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: #1c1c1e; color: #fff;
  padding: 14px 16px 14px 16px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 9999; align-items: center; gap: 12px;
  font-size: 0.85rem; line-height: 1.4;
}
#ios-install-banner.visible { display: flex; }
#ios-install-banner p { margin: 0; flex: 1; }
#ios-install-banner i.fa-arrow-up-from-bracket { color: #0a84ff; }
#ios-install-close {
  background: none; border: none; color: #aaa; font-size: 1rem;
  cursor: pointer; flex-shrink: 0; padding: 4px;
}
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--sand);
  color: var(--text);
  overscroll-behavior: none;
}

/* ── App shell ── */
#app { display: flex; flex-direction: column; height: 100dvh; max-width: 480px; margin: 0 auto; position: relative; background: var(--teal-dark); }

/* ── Token gate screen ── */
#gate-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100dvh; gap: 24px; padding: 32px;
  background: var(--sand);
}
#gate-screen h1 { font-size: 2rem; font-weight: 800; color: var(--teal); letter-spacing: -1px; }
#gate-screen p  { color: var(--text-muted); text-align: center; font-size: 0.9rem; }
#gate-screen input {
  width: 100%; padding: 14px 16px; border: 2px solid var(--border);
  border-radius: var(--radius); font-size: 1rem; background: #fff;
  text-align: center; letter-spacing: 4px;
}
#gate-screen button {
  width: 100%; padding: 14px; background: var(--coral); color: #fff;
  border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 700;
  cursor: pointer;
}
#gate-error { color: var(--coral); font-size: 0.85rem; display: none; }

.section-header-row { display: flex; align-items: center; justify-content: center; position: relative; }
.btn-add-inline {
  position: absolute; right: 0;
  width: 32px; height: 32px; flex-shrink: 0;
  background: var(--teal); color: #fff; border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; cursor: pointer;
}
#spot-list { display: flex; flex-direction: column; }
.spot-row {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
#spot-list .spot-row:last-child { border-bottom: none; }
.spot-left-col {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; width: 26px;
}
.drag-handle {
  display: flex; align-items: center; justify-content: center;
  color: #bbb; font-size: 1rem; cursor: grab; touch-action: none;
  width: 26px; height: 26px;
}
.drag-handle:active { cursor: grabbing; }
.spot-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.spot-line1 { display: flex; gap: 5px; align-items: center; }
.spot-line1 [data-field="name"] {
  flex: 1; min-width: 0; height: 36px; padding: 0 10px; font-size: 0.9rem;
  border: 1.5px solid var(--border); border-radius: 7px; background: #fff;
}
.spot-line1 .btn-map-pick { width: 36px; height: 36px; font-size: 0.9rem; flex-shrink: 0; border-radius: 50%; }
.spot-right-col {
  display: flex; align-items: center; flex-shrink: 0;
}
.spot-right-col .btn-spot-del {
  width: 36px; height: 36px; font-size: 1.1rem; flex-shrink: 0;
  background: transparent; border: none; color: #e03535; border-radius: 50%;
}
.field-incomplete { background: #fff7e0 !important; border-color: var(--warn) !important; }
.warn-icon { color: var(--warn); display: none; }
.warn-icon.active { display: inline; }
/* ── Splash screen ── */
#splash-screen {
  position: absolute; inset: 0; background: rgba(0,0,0,0.52);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
#splash-screen.visible { opacity: 1; pointer-events: auto; }
#splash-logo { width: 72px; height: auto; }
#splash-title { font-size: 2.6rem; color: #fff; }
#splash-title .km-dot { background: #fff; }

#confirm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 510; display: none;
}
#confirm-overlay.visible { display: block; }

/* Reset confirmation bubble */
#reset-confirm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 340; display: none;
}
#reset-confirm-overlay.visible { display: block; }
#reset-confirm-bubble {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, calc(-50% - 16px));
  width: min(92vw, 440px); background: #fff; border-radius: 18px;
  padding: 20px 22px 18px; z-index: 350;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(.32,1,.53,1);
}
#reset-confirm-bubble.visible {
  opacity: 1; pointer-events: auto; transform: translate(-50%, -50%);
}
#reset-confirm-msg {
  margin: 0 0 16px; font-size: 0.95rem; font-weight: 500; color: var(--text);
  line-height: 1.4;
}
.reset-confirm-btns { display: flex; gap: 10px; }
.reset-confirm-btns button {
  flex: 1; padding: 10px; border-radius: 9999px; border: none;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
#reset-confirm-cancel { background: var(--border); color: var(--text); }
#reset-confirm-ok { background: var(--teal); color: #fff; }
#confirm-panel {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, calc(-50% - 16px));
  width: min(92vw, 440px); background: #fff; border-radius: 18px;
  padding: 20px 22px 18px; z-index: 520;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(.32,1,.53,1);
}
#confirm-panel.visible {
  opacity: 1; pointer-events: auto; transform: translate(-50%, -50%);
}
.confirm-title {
  margin: 0 0 6px; font-size: 0.95rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 7px;
}
.confirm-title i { color: #e03535; }
.confirm-subtitle { font-size: 0.88rem; color: var(--text-muted); margin: 0 0 16px; }
.confirm-buttons { display: flex; gap: 10px; }
.confirm-btn-cancel {
  flex: 1; padding: 10px; border: none;
  background: var(--border); border-radius: 9999px; font-size: 0.9rem;
  font-weight: 600; cursor: pointer; color: var(--text);
}
.confirm-btn-delete {
  flex: 1; padding: 10px; border: none; display: flex; align-items: center;
  justify-content: center; gap: 8px;
  background: #e03535; color: #fff; border-radius: 9999px;
  font-size: 0.9rem; font-weight: 700; cursor: pointer;
}
.pw-field-wrap { position: relative; }
.pw-field-wrap input { padding-right: 44px !important; }
.btn-pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.95rem; padding: 4px; line-height: 1;
}
.btn-icon { width: 36px; height: 36px; border: 1.5px solid var(--border); background: #fff;
  border-radius: 8px; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.btn-save {
  width: 100%; padding: 14px; background: var(--teal); color: #fff;
  border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 700; cursor: pointer;
}

/* ── Bottom floating bar ── */
#bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 480px; margin: 0 auto;
  display: flex; justify-content: space-around; align-items: flex-end;
  padding: 0 16px 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  background: linear-gradient(to bottom, transparent, rgba(42,157,143,0.72) 100%);
  z-index: 220;
  pointer-events: none;
  padding-top: 20px;
}
.btn-panel-active { background: #fff !important; color: var(--teal) !important; box-shadow: none !important; }

.btn-model-icon { width: 1.3rem; height: 1.3rem; object-fit: contain; filter: brightness(0) invert(1); flex-shrink: 0; transition: filter .15s; }
.btn-panel-active .btn-model-icon { filter: brightness(0) saturate(100%) invert(47%) sepia(79%) saturate(390%) hue-rotate(128deg) brightness(90%); }
.sheet-title-icon { width: 1.1rem; height: 1.1rem; object-fit: contain; filter: brightness(0) invert(1); flex-shrink: 0; }

/* Les 4 boutons de la toolbar : même style rond, icône seule, flottants */
#btn-spot, #btn-model, #btn-burger, #btn-refresh {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; border: none;
  background: var(--teal); color: #fff;
  cursor: pointer; font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4), 0 6px 20px rgba(0,0,0,0.25);
  pointer-events: auto;
}
#btn-spot:active, #btn-model:active,
#btn-burger:active, #btn-refresh:active { background: var(--teal-dark); }
/* Textes masqués — le modèle et le spot sont visibles dans le tableau */
#btn-spot span, #btn-model span { display: none; }
.btn-refresh-loading { background: #fff !important; color: var(--teal) !important; }
.btn-refresh-loading i { animation: spin 1.2s ease-in-out 1; }

/* ── Burger / display panel ── */
#burger-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.3);
  z-index: 210; display: none;
}
#burger-overlay.visible { display: block; }

#burger-panel {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  background: #fff; border-radius: 20px 20px 0 0; overflow: hidden;
  box-shadow: none;
  z-index: 215;
  transform: translateY(100%); transition: transform .3s ease;
}
#app.app-no-spots #timeline-wrap { padding-bottom: 0; justify-content: center; align-items: center; }
#burger-panel.visible { transform: translateY(0); box-shadow: 0 -4px 24px rgba(0,0,0,.15); }

.burger-handle {
  width: 40px; height: 4px; background: var(--border);
  border-radius: 2px; margin: 12px auto 0;
}
.sheet-header {
  background: var(--teal); flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 16px 14px; gap: 8px;
}
.sheet-header .burger-handle { background: rgba(255,255,255,0.4); margin: 0; }
.sheet-header-row {
  display: flex; align-items: center; justify-content: space-between; width: 100%; position: relative;
}
.sheet-spacer { width: 36px; flex-shrink: 0; }
.sdd-left-btns, .sheet-left-btns, .sheet-right-btns { display: flex; align-items: center; gap: 6px; }
.mdd-info-panel {
  background: var(--sand); border-bottom: 1px solid var(--border);
  padding: 10px 14px 12px; font-size: 0.8rem; color: var(--text); line-height: 1.5;
}
.mdd-info-panel p { margin-bottom: 8px; color: var(--text-muted); }
.mdd-info-panel ul { padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
.mdd-info-panel li { list-style: disc; }
.sheet-title {
  position: absolute; left: 0; right: 0; pointer-events: none;
  margin: 0; font-size: 1.25rem; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-sheet-close {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: rgba(0,0,0,0.22); border: none; color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
#burger-panel.burger-edit #btn-burger-lock,
#spot-dropdown.sdd-edit .btn-sdd-lock,
#model-dropdown.mdd-edit .btn-mdd-lock {
  background: #fff; color: var(--teal);
}
.burger-content { padding: 4px 0 110px; }
.burger-info-panel {
  background: var(--sand); border-bottom: 1px solid var(--border);
  padding: 12px 16px 14px; font-size: 0.68rem;
  color: var(--text-muted); line-height: 1.4; text-align: justify;
}
.burger-info-panel a { color: var(--teal-dark); text-decoration: none; }
.burger-info-panel a:hover { text-decoration: underline; }
.burger-credits-by { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 0.72rem; color: var(--text-muted); text-align: center; }
.burger-section-title {
  font-size: 0.9rem; font-weight: 700; color: var(--text); margin: 10px 0 4px;
  text-align: center;
}
.burger-group { margin-bottom: 6px; }
.burger-col-item { display: flex; flex-direction: column; border-bottom: 1px solid var(--border); }
.burger-col-item:last-child { border-bottom: none; }
.burger-drag-handle {
  display: flex; align-items: center; justify-content: center;
  color: var(--teal-dark); font-size: 1rem; cursor: grab; touch-action: none;
  width: 14px; height: 26px; flex-shrink: 0;
}
.burger-drag-handle:active { cursor: grabbing; }
#burger-panel:not(.burger-edit) .burger-drag-handle,
#burger-panel:not(.burger-edit) .bp-eye { visibility: hidden; pointer-events: none; }
#burger-panel.burger-edit .burger-col-item { user-select: none; -webkit-user-select: none; cursor: grab; }
#burger-panel.burger-edit .burger-col-item button { cursor: pointer; }
.bp-ghost .burger-drag-handle,
.bp-ghost .bp-eye { visibility: visible; }
.burger-item {
  display: grid;
  grid-template-columns: 14px 1fr 220px auto;
  align-items: center;
  padding: 14px 10px 14px 10px;
  gap: 8px;
}
.burger-label { font-size: 0.9rem; font-weight: 500; color: var(--text); flex: 1; margin-left: 4px; display: flex; align-items: center; gap: 7px; }
.burger-label > i { color: var(--teal); font-size: 0.9rem; width: 16px; text-align: center; flex-shrink: 0; }
.burger-label .burger-site-icon { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; filter: brightness(0) saturate(100%) invert(47%) sepia(79%) saturate(390%) hue-rotate(128deg) brightness(90%); }
.burger-sublabel { font-size: 0.7rem; font-weight: 400; color: #aaa; margin-right: 10px; }
.burger-group + .burger-section-title {
  border-top: 1px solid var(--teal);
  margin-left: -20px; margin-right: -20px;
  padding-left: 20px; padding-right: 20px;
  padding-top: 14px; margin-top: 4px;
}

/* Toggle switch */
.toggle-switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #ddd; border-radius: 26px; cursor: pointer; transition: background .2s;
}
.toggle-slider:before {
  content: ''; position: absolute;
  height: 20px; width: 20px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.toggle-switch input:checked + .toggle-slider { background: var(--teal); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(18px); }

/* Segmented control */
.seg-control {
  display: flex; border: 1.5px solid var(--border); border-radius: 8px;
  overflow: hidden; width: 100%;
}
#bp-wind-unit, #bp-gust-unit { width: calc(220px / 3 * 2); }
.seg-control button { flex: 1; }
.seg-control button {
  padding: 6px 8px; border: none; background: #fff;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  color: var(--text-muted); transition: background .1s, color .1s;
  font-family: inherit; white-space: nowrap;
}
.seg-control button + button { border-left: 1.5px solid var(--border); }
.seg-control button.active { background: var(--teal); color: #fff; }
.seg-control.disabled { opacity: 0.35; pointer-events: none; }
.seg-control.pills {
  border: none; overflow: visible; gap: 6px;
}
.seg-control.pills button {
  border: 1.5px solid var(--border); border-radius: 8px;
}
.seg-control.pills button + button { border-left: 1.5px solid var(--border); }

.bp-eye {
  background: none; border: none; cursor: pointer;
  color: var(--teal-dark); font-size: 1rem; padding: 4px 0 4px 8px;
  grid-column: 4;
}

/* Display visibility rules */
#app.hide-time .cell-time,
#app.hide-time .ch-time { display: none; }
#app.hide-wind .cell-wind,
#app.hide-wind .ch-wind { display: none; }
#app.hide-gust .cell-gust,
#app.hide-gust .ch-gust { display: none; }

#app.hide-dir .cell-dir,
#app.hide-dir .ch-dir { display: none; }

/* dir-mode-card: cardinal visible, degrés cachés */
#app.dir-mode-card .dir-deg { opacity: 0; }

/* dir-mode-deg: degrés visibles, cardinal caché */
#app.dir-mode-deg .dir-cardinal { opacity: 0; }

/* dir-mode-auto: alternance cardinal ↔ degrés (6 s, 3 s chacun) */
#app.dir-mode-auto .dir-cardinal { animation: dir-cardinal-fade 6s infinite ease-in-out; }
#app.dir-mode-auto .dir-deg     { animation: dir-deg-fade     6s infinite ease-in-out; }
@keyframes dir-cardinal-fade { 0%, 40% { opacity: 1; } 50%, 90% { opacity: 0; } 100% { opacity: 1; } }
@keyframes dir-deg-fade      { 0%, 40% { opacity: 0; } 50%, 90% { opacity: 1; } 100% { opacity: 0; } }

#app.hide-tide .cell-tide,
#app.hide-tide .ch-tide,
#app.hide-tide #tide-svg { display: none; }

/* ── Spot meta (name + refresh) ── */
#spot-meta {
  padding: 8px 16px 4px;
  display: flex; align-items: baseline; justify-content: space-between;
}
#spot-name { font-size: 1.15rem; font-weight: 800; color: var(--text); }
#last-refresh { font-size: 0.75rem; color: var(--text-muted); }

/* ── Timeline ── */
#timeline-wrap {
  flex: 1; overflow-y: auto; position: relative; display: flex; flex-direction: column;
  padding: 0 0 70px;
  scroll-behavior: smooth;
}
#timeline { display: flex; flex-direction: column; position: relative; }

/* Tide SVG overlay — repositionné en JS */
#tide-svg {
  position: absolute; top: 0; left: 0;
  pointer-events: none; z-index: 2; overflow: visible;
}

/* ── Zone separator ── */
.zone-sep {
  height: 1px; background: var(--border);
  margin: 0;
}

/* ── Column headers — élément fixe du layout, hors du scroll ── */
#col-headers {
  display: flex; align-items: stretch;
  background: var(--teal-dark); flex-shrink: 0;
  position: relative; z-index: 201;
  height: 50px;
}
#col-headers > span {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 4px; gap: 3px; overflow: hidden;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: manipulation; transition: background 0.12s;
}
#col-headers > span:active { background: rgba(0,0,0,0.18); }
#col-headers > span > i { font-size: 1.3rem; color: rgba(255,255,255,0.9); flex-shrink: 0; }
#col-headers .ch-icon-img { width: 1.3rem; height: 1.3rem; object-fit: contain; flex-shrink: 0; filter: brightness(0) invert(1); opacity: 0.9; }
#col-headers > span.ch-auto-mode > i { font-size: 1.7rem; }
#col-headers > span.ch-auto-mode .ch-icon-img { width: 1.7rem; height: 1.7rem; }
#col-headers > span.ch-auto-mode .ch-badge { display: none; }
.ch-badge {
  font-size: 0.6rem; font-weight: 700; color: rgba(255,255,255,0.75);
  line-height: 1; letter-spacing: 0; min-height: 0.6rem;
}

/* ── KNOTS wordmark ── */
.knots-mark {
  display: inline-flex; align-items: flex-end;
  font-family: 'Helvetica Neue', 'Arial Black', Arial, sans-serif;
  font-weight: 900; line-height: 1; text-transform: none; letter-spacing: 0;
  color: var(--teal-dark);
}
.km-sw { display: inline-flex; flex-direction: column; align-items: center; margin-left: 0.06em; }
.km-s  { line-height: 1; padding-bottom: 0.07em; }
.km-dot { width: 0.18em; height: 0.18em; border-radius: 50%; background: currentColor; }
#empty-state .knots-mark { font-size: 2rem; color: #fff; }
.cell-meteo .knots-mark { font-size: 0.92rem; }
.ch-unit {
  font-size: 0.68rem; font-weight: 400; color: rgba(255,255,255,0.6);
  line-height: 1; min-height: 0.68rem;
}
.ch-wind  { flex: 1 0 0; }
.ch-gust  { flex: 1 0 0; }
.ch-dir   { flex: 1 0 0; }
.ch-wave  { flex: 1 0 0; }
.ch-tide  { flex: 1 0 0; }
.ch-temp  { flex: 1 0 0; }
.ch-time  { flex: 1 0 0; }


/* ── Wind row — column layout ── */
.wind-row {
  display: flex; align-items: center;
  min-height: var(--row-h); position: relative;
  flex-shrink: 0; background: #fff;
  border-bottom: 1px solid var(--border);
}
/* Ligne LIVE : fond blanc partout (plus de rouge dans les cellules) */
.wind-row.is-live { background: #fff; border-bottom: none; }

/* Zone icon in left margin */
.zone-label {
  position: absolute; left: 0; top: 0; bottom: 0; width: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted);
  writing-mode: vertical-rl; text-orientation: mixed;
  opacity: 0;
}
.zone-label.visible { opacity: 1; }

/* Coloured cells — wind & gust only */
.cell-wind, .cell-gust {
  flex: 1 0 0; align-self: stretch;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* Mode demi-heure : 2 valeurs empilées, chacune sur sa couleur */
.cell-wind-split { flex-direction: column; padding: 0; }
.cell-wind-split .band {
  flex: 1; width: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 800; line-height: 1;
}

/* Direction cell — arrow + cardinal stacked */
.cell-dir {
  flex: 1 0 0; align-self: stretch; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; min-width: 0;
}
.cell-dir .dir-arrow { width: 1.25rem; height: 1.25rem; color: var(--teal-dark); display: inline-block; vertical-align: middle; }
.dir-label {
  position: relative; height: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}
.cell-dir .dir-cardinal,
.cell-dir .dir-deg {
  position: absolute;
  font-size: 0.72rem; font-weight: 600; line-height: 1; color: var(--teal-dark);
}
.cell-dir .dir-cardinal { text-transform: uppercase; letter-spacing: 0.3px; }

/* Wave column */
.cell-wave {
  flex: 1 0 0; align-self: stretch; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; min-width: 0;
}
.cell-wave .dir-arrow { font-size: 1rem; line-height: 1; color: var(--teal-dark); }
.wave-label {
  position: relative; height: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}
.wave-height, .wave-period {
  position: absolute;
  font-size: 0.72rem; font-weight: 600; line-height: 1; color: var(--teal-dark);
}

/* wave-mode-height: hauteur visible, période cachée */
#app.wave-mode-height .wave-period { opacity: 0; }
/* wave-mode-period: période visible, hauteur cachée */
#app.wave-mode-period .wave-height { opacity: 0; }
/* wave-mode-auto: alternance hauteur ↔ période (6 s, 3 s chacune) */
#app.wave-mode-auto .wave-height { animation: wave-height-fade 6s infinite ease-in-out; }
#app.wave-mode-auto .wave-period { animation: wave-period-fade 6s infinite ease-in-out; }
@keyframes wave-height-fade { 0%, 40% { opacity: 1; } 50%, 90% { opacity: 0; } 100% { opacity: 1; } }
@keyframes wave-period-fade { 0%, 40% { opacity: 0; } 50%, 90% { opacity: 1; } 100% { opacity: 0; } }

/* fond sombre : tout passe en blanc */
.cell-wave.wave-on-dark .wave-height,
.cell-wave.wave-on-dark .wave-period,
.cell-wave.wave-on-dark .dir-arrow { color: rgba(255,255,255,0.75); }

#app.hide-wave .cell-wave, #app.hide-wave .ch-wave { display: none; }

/* Tide placeholder column — SVG overlay se positionne dessus */
.cell-tide {
  flex: 1 0 0;
}

/* Météo cell */
.cell-meteo {
  flex: 1 0 0; align-self: stretch; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
}
.cell-meteo > i { font-size: 1.25rem; line-height: 1; display: inline-block; }
.cell-meteo > .wi-img { width: 1.25rem; height: 1.25rem; display: inline-block; object-fit: contain; }
.meteo-label {
  position: relative; height: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}
.meteo-celsius, .meteo-rainval {
  position: absolute; font-size: 0.72rem; font-weight: 600;
  font-variant-numeric: tabular-nums; opacity: 0;
}
.meteo-celsius { color: var(--teal-dark); }
/* live sans météo : toujours visible */
.cell-meteo.no-wx .meteo-celsius { opacity: 1; font-size: 0.78rem; color: var(--teal-dark); }
/* temp-mode-c : température toujours */
#app.temp-mode-c .meteo-celsius { opacity: 1; }
/* temp-mode-rain : pluie si has-rain */
#app.temp-mode-rain .cell-meteo.has-rain .meteo-rainval { opacity: 1; }
/* auto + pas de pluie : température seule */
#app.temp-mode-auto .cell-meteo:not(.has-rain) .meteo-celsius { opacity: 1; }
/* auto + pluie : alternance °C ↔ mm */
#app.temp-mode-auto .cell-meteo.has-rain .meteo-celsius { animation: temp-c-fade    6s infinite ease-in-out; }
#app.temp-mode-auto .cell-meteo.has-rain .meteo-rainval { animation: temp-rain-fade 6s infinite ease-in-out; }
@keyframes temp-c-fade    { 0%, 40% { opacity: 1; } 50%, 90% { opacity: 0; } 100% { opacity: 1; } }
@keyframes temp-rain-fade { 0%, 40% { opacity: 0; } 50%, 90% { opacity: 1; } 100% { opacity: 0; } }
.wi-sun        { color: #f5a623; }
.wi-moon       { color: #7a8fa6; }
.wi-cloud-sun  { color: #f5a623; }
.wi-cloud      { color: #8a8a8a; }
.wi-fog        { color: #aaa; }
.wi-snow       { color: #74b9e8; }
.wi-snow-heavy { color: #4a9fd4; }
.wi-freeze     { color: #74b9e8; }
.cell-time {
  flex: 1 0 0; text-align: center;
  font-family: 'DSEG7Classic', monospace;
  font-size: 0.78rem; font-weight: 700; color: var(--teal-dark);
  font-variant-numeric: tabular-nums;
}

/* Model badge — absolute on first forecast row */
.model-badge {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  padding: 2px 7px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 0.65rem; font-weight: 700; color: var(--text-muted);
  background: #fff; cursor: pointer; white-space: nowrap;
}
.model-badge:active { background: var(--sand-dark); }

/* Live indicator (badge + time) — même largeur que cell-temp + cell-time */
.live-indicator {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  width: calc(2.6rem + 4px + 2.8rem); flex-shrink: 0;
}
.wind-row.is-live .cell-time {
  background: #fff;
  color: var(--text-muted);
  font-weight: 400;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Day label row — sticky sous les col-headers */
.day-sep {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  /* Tout en pixels entiers pour éviter tout arrondi sub-pixel sur le centrage du texte */
  padding: 0 16px 0 12px; min-height: 26px;
  font-size: 13px; line-height: 26px;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: rgba(255,255,255,0.9);
  background: var(--teal); flex-shrink: 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.10);
  /* GPU compositing — élimine le tressautement sub-pixel en sticky */
  transform: translateZ(0);
  will-change: transform;
  /* Isole la layout du day-sep — évite que des recalculs voisins bougent le texte */
  contain: layout paint;
}
/* Sentinel placé en absolu DANS le day-sep, juste au-dessus de son bord supérieur.
   Aucune empreinte dans le flux → pas de pixel parasite, pas de double-couche. */
.day-sep-sentinel {
  position: absolute; top: -1px; left: 0; right: 0; height: 1px;
  pointer-events: none;
}
/* La rangée juste avant un day-sep n'a plus de bordure (le fond crème filtrait
   à travers le 1 px transparent). */
.wind-row:has(+ .day-sep) { border-bottom: none; }
.day-sep.is-stuck { box-shadow: 0 -2px 8px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.10); }
.day-sep-model { font-size: 13px; line-height: 26px; font-weight: 700; letter-spacing: 0.8px; color: rgba(255,255,255,0.9); display: flex; align-items: center; gap: 4px; }
.day-sep-model-icon { width: 16px; height: 16px; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.9; }
.day-sep-spot { font-size: 13px; line-height: 26px; font-weight: 700; letter-spacing: 0.8px; color: rgba(255,255,255,0.95); display: flex; align-items: center; gap: 5px; }
.day-sep-spot > i { font-size: 13px; opacity: 0.9; }
/* Fake day-sep LIVE = rouge ; REPORT et day-seps passés reprennent le vert
   standard des stickies (même couleur que les jours dans le futur). */
.day-sep-fake-live { background: var(--live-red); }

/* Gust label in wind row */
.row-gust {
  font-size: 0.78rem; color: var(--text-muted); margin-left: 4px;
  font-variant-numeric: tabular-nums; align-self: flex-end; padding-bottom: 5px;
}

/* ── Empty state (no spots) ── */
#empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 60px 24px; text-align: center;
}
#empty-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#empty-icon { height: auto; }
#empty-state .empty-tagline { font-size: 0.85rem; font-style: italic; color: rgba(255,255,255,0.75); margin-top: -8px; margin-bottom: 8px; }
.km-qdot { font-weight: 900; vertical-align: bottom; margin-left: 0.04em; }
.empty-tagline .km-qdot .km-dot { margin-left: -0.24em; }
.empty-cta-group {
  display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 268px;
}
#btn-add-first-spot {
  width: 100%; height: 48px; padding: 0 20px 0 0; border-radius: 26px; border: none;
  background: var(--teal); color: #fff;
  cursor: pointer; font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  transition: background .15s;
}
#btn-add-first-spot:active { background: var(--teal-dark); }
.btn-icon-slot {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: flex-start;
  padding-left: 6px; flex-shrink: 0;
}
.btn-icon-circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.22); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
#btn-add-tregor {
  width: 100%; height: 48px; padding: 0; border-radius: 26px; border: none;
  background: #FFD700; color: #1a1a1a;
  cursor: pointer; font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  overflow: hidden; transition: background .15s;
}
#btn-add-tregor:active { background: #e6c200; }
#btn-add-tregor .btn-icon-circle { background: rgba(0,0,0,0.22); color: #1a1a1a; }
.tregor-label { flex: 1; text-align: left; }
#btn-add-tregor .tregor-flag {
  width: 64px; height: 48px; object-fit: cover; flex-shrink: 0; display: block; margin-left: auto;
}

/* ── Data warning banner (points 2 & 3) ── */
.no-station-notice {
  padding: 10px 14px; background: #fde8ee;
  font-size: 0.82rem; color: var(--text-muted);
  display: flex; align-items: center; flex-shrink: 0;
}
.no-station-text { flex: 1; display: flex; align-items: center; gap: 8px; }
.no-station-text > span { flex: 1; }
.no-station-notice i { color: var(--teal); }
.no-station-notice .knots-mark { font-size: 0.92rem; margin-left: 14px; }
.no-station-link {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--teal); font-weight: 600; font-size: inherit; text-decoration: underline;
}

.data-warnings {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 14px; background: #fff8e8;
  border-left: 3px solid var(--warn);
  flex-shrink: 0;
}
.data-warning-item {
  font-size: 0.78rem; color: var(--warn); font-weight: 600;
}
.data-warning-stale {
  font-size: 0.78rem; color: var(--text-muted); margin-left: auto;
}

/* ── Loading / error ── */
#loading { display: flex; align-items: center; justify-content: center;
  height: 200px; color: var(--text-muted); font-size: 0.9rem; gap: 10px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border);
  border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#error-msg { padding: 24px; color: var(--coral); font-size: 0.9rem; text-align: center; display: none; }

/* ── Spot & Model bottom panels ── */
#spot-overlay, #model-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.3);
  z-index: 210; display: none;
}
#spot-overlay.visible, #model-overlay.visible { display: block; }

#model-dropdown, #spot-dropdown {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  background: #fff; border-radius: 20px 20px 0 0; overflow: hidden;
  box-shadow: none;
  z-index: 215; display: block;
  transform: translateY(100%); transition: transform .3s ease;
  padding-bottom: 110px;
}
#model-dropdown.visible, #spot-dropdown.visible { transform: translateY(0); box-shadow: 0 -4px 24px rgba(0,0,0,.15); }

/* .panel-title replaced by .sheet-title inside .sheet-header */
.model-option, .spot-option {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.model-option { padding: 14px 20px 14px 44px; }
.spot-option  { padding: 14px 10px 14px 10px; gap: 8px; }
.model-option { padding: 14px 20px 14px 10px; gap: 8px; }
.model-option:last-child, .spot-option:last-child { border-bottom: none; }
.model-option:active, .spot-option:active { background: var(--sand); }
.model-option.mo-hidden { opacity: 0.38; }
.burger-col-item.bp-col-hidden { opacity: 0.38; }
/* Lock/edit mode — model dropdown */
#model-dropdown .mo-drag-handle { display: none; }
#model-dropdown.mdd-edit .mo-drag-handle { display: flex; width: 14px; }
#model-dropdown.mdd-edit .mo-check { display: none; }
#model-dropdown:not(.mdd-edit) .mo-hide-btn { visibility: hidden; pointer-events: none; }
#model-dropdown.mdd-edit .model-option { user-select: none; -webkit-user-select: none; cursor: grab; }
#model-dropdown.mdd-edit .model-option button { cursor: pointer; }
/* Modèle Automatique (combiné) : épinglé, pas déplaçable */
.model-option.mo-pinned { cursor: default !important; }
#model-dropdown.mdd-edit .model-option.mo-pinned .mo-drag-handle { visibility: hidden; }
#model-dropdown.mdd-edit .model-option.mo-pinned { cursor: default !important; }
.mo-drag-handle-spacer { pointer-events: none; }
.mo-combined-desc { font-size: 0.72rem; color: var(--text-muted); }
/* Lock/edit mode — spot dropdown */
#spot-dropdown .so-drag-handle { display: none; }
#spot-dropdown.sdd-edit .so-drag-handle { display: flex; width: 14px; }
#spot-dropdown.sdd-edit .so-check { display: none; }
#spot-dropdown:not(.sdd-edit) .so-edit-btn { visibility: hidden; pointer-events: none; }
#spot-dropdown.sdd-edit .spot-option { user-select: none; -webkit-user-select: none; cursor: grab; }
#spot-dropdown.sdd-edit .spot-option button { cursor: pointer; }
.sdd-ghost .so-drag-handle { display: flex; width: 14px; }
.sdd-ghost .so-check { display: none; }
/* Eye button matches burger display panel style; symmetric with drag handle */
#model-dropdown .model-option,
.mdd-ghost { padding-right: 10px; }
#model-dropdown .mo-label,
.mdd-ghost .mo-label { margin-left: 4px; }
#model-dropdown .mo-hide-btn,
.mdd-ghost .mo-hide-btn {
  background: none; border-radius: 0; width: auto; height: auto;
  color: var(--teal-dark); font-size: 1rem; padding: 4px 0 4px 8px;
}
#model-dropdown .mo-hide-btn:active { background: none; color: var(--teal); }
/* Ghost drag handle matches edit-mode size */
.mdd-ghost .mo-drag-handle { display: flex; width: 14px; }
.mdd-ghost .mo-check { display: none; }
.so-drag-handle, .mo-drag-handle {
  display: flex; align-items: center; justify-content: center;
  color: var(--teal-dark); font-size: 1rem; cursor: grab; touch-action: none;
  width: 26px; height: 26px; flex-shrink: 0;
}
.so-drag-handle:active, .mo-drag-handle:active { cursor: grabbing; }
.so-check, .mo-check { color: var(--teal); font-size: 0.85rem; opacity: 0; flex-shrink: 0; width: 14px; }
.spot-option.selected .so-check, .model-option.selected .mo-check { opacity: 1; }
.model-option .mo-label { font-weight: 600; font-size: 0.9rem; flex: 1; }
.model-option .mo-range {
  display: flex; align-items: center; gap: 2px;
  font-size: 0.78rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.mo-col  { display: flex; align-items: center; gap: 2px; }
.mo-days { min-width: 2ch; text-align: right; }
.mo-res  { min-width: 4ch; text-align: right; }
.mo-sep  { margin: 0 6px; }
.spot-option .so-label { font-size: 0.9rem; font-weight: 600; flex: 1; display: flex; align-items: center; gap: 7px; margin-left: 4px; }
.so-warn-icon { font-size: 1rem; color: var(--warn); flex-shrink: 0; }
.so-coords {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums; flex-shrink: 0;
  width: 110px; justify-content: flex-end;
}
.so-coords i { font-size: 1rem; flex-shrink: 0; width: 18px; text-align: center; }
.so-coords-vals { display: flex; flex-direction: row; gap: 4px; white-space: nowrap; }
.so-coords-missing { color: var(--warn); }
.so-station {
  font-size: 0.78rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
  font-variant-numeric: tabular-nums;
  width: 110px; flex-shrink: 0; justify-content: flex-end;
}
.so-station-id { text-align: right; }
.holfuy-icon {
  width: 18px; height: 18px; border-radius: 4px; object-fit: cover; flex-shrink: 0;
  filter: brightness(0) invert(1) brightness(0.54);
}
.holfuy-icon-warn {
  filter: brightness(0) invert(50%) sepia(1) saturate(5) brightness(0.935);
}
.so-station-missing { color: var(--warn); }

.so-right { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.so-edit-btn {
  background: none; border: none; cursor: pointer;
  color: var(--teal-dark); font-size: 1rem; padding: 4px 8px;
  flex-shrink: 0;
}
.so-edit-btn:active { color: var(--teal); }
.so-del-btn {
  background: none; border: none; cursor: pointer;
  color: var(--teal-dark); font-size: 1rem; padding: 4px 0 4px 8px;
  flex-shrink: 0;
}
.so-del-btn:active { color: #e63946; }
#spot-dropdown:not(.sdd-edit) .so-del-btn { visibility: hidden; pointer-events: none; }
.mo-hide-btn {
  background: rgba(0,0,0,0.32); color: #fff; border: none; cursor: pointer;
  border-radius: 50%; width: 30px; height: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
}
.mo-hide-btn:active { background: rgba(0,0,0,0.5); }

/* ── Map picker modal ── */
#map-modal {
  position: fixed; inset: 0; z-index: 500;
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .3s ease;
}
#map-spot-fields {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 14px 12px; background: var(--sand);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
  overflow: visible;
}
.map-name-wrap { position: relative; width: 100%; margin-bottom: 10px; }
#map-name-input {
  width: 100%; height: 38px; padding: 0 34px 0 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 0.9rem; background: #fff; outline: none;
}
#map-name-input:focus { border-color: var(--teal); }
#map-name-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: 0.78rem; display: none; align-items: center; justify-content: center;
  padding: 4px;
}
.map-name-wrap.has-name #map-name-clear { display: flex; }
/* ── Merged location field (station + GPS) ── */
#map-location-field {
  display: flex; align-items: stretch;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: #fff; position: relative;
}
#map-location-field:focus-within { border-color: var(--teal); }
.map-location-inputs { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Station search inside merged field */
#map-station-wrap { width: 100%; position: relative; }
#map-station-wrap .station-results { z-index: 1100; }
#map-location-field .station-search {
  border: none; border-radius: 0;
  border-bottom: 1px solid var(--border);
  background: transparent; height: 38px;
}
#map-location-field .station-search:focus { border-color: inherit; outline: none; }
#map-location-field .station-clear-btn { display: none !important; }

/* GPS inputs inside merged field */
#map-coord-inputs {
  display: flex; align-items: stretch; gap: 0; height: 38px;
}
#map-coord-inputs input {
  flex: 1; min-width: 0; height: 100%; padding: 0 10px;
  border: none; border-radius: 0; background: transparent; outline: none;
  font-size: 0.82rem; color: var(--text-muted); font-variant-numeric: tabular-nums;
  cursor: default; user-select: none;
}
#map-lat-input { border-right: 1px solid var(--border); }
#map-coord-inputs input.invalid { background: #fff5f5; color: var(--coral); }

/* Unified eraser */
#map-clear-pin {
  flex-shrink: 0; border: none; border-left: 1px solid var(--border);
  background: none; cursor: pointer; color: var(--text-muted);
  font-size: 0.78rem; display: none; align-items: center; justify-content: center;
  padding: 0 10px; border-radius: 0 6px 6px 0;
}
#map-clear-pin.visible { display: flex; }

#map-modal.visible { transform: translateY(0); }
#map-hint {
  padding: 10px 14px; background: #f0f7f6; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
}
#map-hint p {
  margin: 0; font-size: 0.8rem; color: var(--text-muted);
  display: flex; align-items: flex-start; gap: 7px; line-height: 1.4;
}
#map-hint i { color: var(--teal); flex-shrink: 0; margin-top: 1px; }
.map-hint-required { color: var(--coral); font-weight: 700; }
#map-hint.hidden { display: none; }
#map-container { flex: 1; min-height: 0; }
#map-footer {
  flex-shrink: 0; display: flex; gap: 10px;
  padding: 10px 14px 14px; background: var(--sand);
  border-top: 1px solid var(--border);
}
#map-footer:empty { display: none; }
.map-btn-save {
  flex: 1; height: 42px; border: none; border-radius: 9999px;
  background: var(--teal); color: #fff; font-size: 0.95rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.map-btn-save:active { opacity: 0.82; }
.map-btn-cancel {
  flex: 1; height: 42px; border: 1.5px solid var(--border); border-radius: 9999px;
  background: #fff; color: var(--text); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.map-btn-cancel:active { opacity: 0.72; }
#map-coord-error {
  font-size: 0.75rem; color: var(--coral); display: none;
}
#map-coord-error.visible { display: block; }
#map-coord-revert {
  background: none; border: none; color: var(--coral);
  text-decoration: underline; cursor: pointer; font-size: 0.75rem; padding: 0;
}
#map-container { flex: 1; min-height: 0; }
.btn-map-pick {
  width: 36px; height: 36px; border: none; background: var(--teal);
  border-radius: 50%; cursor: pointer; font-size: 0.9rem; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0; color: #fff;
}
.btn-map-pick.field-incomplete {
  background: var(--warn) !important; border: none !important; color: #fff !important;
}
/* ── Station picker (custom combobox) ── */
.station-picker { position: relative; width: 100%; }
.station-search-icon {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.75rem; pointer-events: none; z-index: 1;
}
.station-search {
  width: 100%; height: 36px; padding: 0 30px 0 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 0.9rem; background: #fff; color: var(--text);
  outline: none; transition: border-color .15s;
}
.station-search:focus { border-color: var(--teal); }
.station-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 400;
  background: #fff; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.14);
  max-height: 210px; overflow-y: auto; display: none;
}
.station-results.open { display: block; }
.station-result-item {
  padding: 11px 14px; font-size: 0.88rem; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background .08s;
  color: var(--text);
}
.station-result-item:last-child { border-bottom: none; }
.station-result-item:hover { background: var(--sand); }
.station-result-item.is-selected { color: var(--teal); font-weight: 700; }
.station-result-item.is-none { color: var(--text-muted); font-style: italic; }
.station-clear-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: 0.78rem; display: none; align-items: center; justify-content: center;
  padding: 4px; z-index: 1;
}
.station-picker.has-station .station-search-icon { display: none; }
.station-picker.has-station .station-clear-btn { display: flex; }

/* Display visibility rules */
#app.hide-temp .cell-meteo,
#app.hide-temp .ch-temp { display: none; }

/* ── Station cluster markers ── */
.leaflet-div-icon.spot-marker,
.leaflet-div-icon.smm-marker {
  background: transparent !important;
  border: none !important;
  overflow: visible !important;
}
.leaflet-div-icon.smm-marker svg,
.leaflet-div-icon.spot-marker svg {
  width: 30px; height: 41px; overflow: visible;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}


/* ── Tide auto pill : alternance coef ↔ heure ↔ hauteur (3 s chacune, cycle 9 s) ── */
@keyframes tide-pill-coef-fade {
  0%, 30%    { opacity: 1; }
  34%, 96%   { opacity: 0; }
  100%       { opacity: 1; }
}
@keyframes tide-pill-time-fade {
  0%, 30%    { opacity: 0; }
  34%, 63%   { opacity: 1; }
  67%, 100%  { opacity: 0; }
}
@keyframes tide-pill-height-fade {
  0%, 63%    { opacity: 0; }
  67%, 96%   { opacity: 1; }
  100%       { opacity: 0; }
}
.tide-pill-coef   { animation: tide-pill-coef-fade   9s infinite ease-in-out; }
.tide-pill-time   { animation: tide-pill-time-fade   9s infinite ease-in-out; }
.tide-pill-height { animation: tide-pill-height-fade 9s infinite ease-in-out; }
