/* =====================================================================
   Golfo · Guide de bord — feuille de style
   Thèmes : jour (papier, hybride avec panneaux sombres pour le live),
            nuit (bleu nuit), veille (rouge, quart de nuit)
   ===================================================================== */

:root {
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 14px;
  --radius-sm: 9px;
  --tap: 48px;
  --gutter: 16px;
  --maxw: 1180px;

  /* Thème JOUR (papier) */
  color-scheme: light;
  --bg: #f4f1e9;
  --surface: #ffffff;
  --surface-2: #f8f6f0;
  --ink: #1c1b18;
  --ink-2: #4a4841;
  --muted: #7a776d;
  --line: #e2ded2;
  --line-strong: #cfcabb;
  --accent: #c0195f;
  --accent-ink: #ffffff;
  --accent-soft: #fbe7ef;
  --accent-soft-ink: #8f0f45;
  --ok: #0f7a3a;
  --warn: #b25d00;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --focus: #2a78d6;
  --shadow: 0 1px 2px rgba(20, 18, 12, .06), 0 6px 20px rgba(20, 18, 12, .06);

  /* Panneaux "live" (tableau de bord sombre, même en mode jour) */
  --panel: #0b1526;
  --panel-2: #13213a;
  --panel-3: #1a2c4b;
  --panel-ink: #f2f5fa;
  --panel-ink-2: #b7c3d6;
  --panel-muted: #7f8ea6;
  --panel-line: #223252;
  --panel-accent: #ff6fa5;

  /* Séries du graphique (validées sur #0b1526) */
  --s1: #3987e5;  /* ICON-2I */
  --s2: #d95926;  /* AROME */
  --s3: #199e70;  /* ECMWF */
  --s-night: rgba(255, 255, 255, .06);
  --grid: #223252;
  --axis: #35496f;
}

:root[data-theme="nuit"] {
  color-scheme: dark;
  --bg: #050e1c;
  --surface: #0b1526;
  --surface-2: #10203a;
  --ink: #eef2f8;
  --ink-2: #c1cbdb;
  --muted: #8494ab;
  --line: #1c2a44;
  --line-strong: #2b3d5f;
  --accent: #ff6fa5;
  --accent-ink: #1a0410;
  --accent-soft: #2a1020;
  --accent-soft-ink: #ffb1cf;
  --ok: #3ac46f;
  --warn: #f5a524;
  --danger: #ff5d5d;
  --danger-soft: #3a1414;
  --shadow: none;
  --panel: #0e1a2f;
  --panel-2: #142440;
  --panel-3: #1b2f52;
}

:root[data-theme="veille"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #0a0000;
  --surface-2: #120302;
  --ink: #ff4a3d;
  --ink-2: #e2382c;
  --muted: #9a2a22;
  --line: #3a0d0a;
  --line-strong: #5a1510;
  --accent: #ff7a5c;
  --accent-ink: #000;
  --accent-soft: #200604;
  --accent-soft-ink: #ff9a80;
  --ok: #ff8a3d;
  --warn: #ffa050;
  --danger: #ff3b30;
  --danger-soft: #2a0503;
  --shadow: none;
  --panel: #0a0000;
  --panel-2: #140302;
  --panel-3: #1e0503;
  --panel-ink: #ff5a4a;
  --panel-ink-2: #e04a3c;
  --panel-muted: #9a2a22;
  --panel-line: #3a0d0a;
  --panel-accent: #ffa050;
  --s1: #ff7a5c;
  --s2: #ffb36b;
  --s3: #ff4a3d;
  --s-night: rgba(255, 60, 40, .08);
  --grid: #3a0d0a;
  --axis: #5a1510;
}
:root[data-theme="veille"] img,
:root[data-theme="veille"] iframe { filter: brightness(.45) sepia(1) saturate(4) hue-rotate(-30deg); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); font-size: 17px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
svg { display: inline-block; vertical-align: middle; }
.ico { width: 1.15em; height: 1.15em; flex: none; position: relative; top: -.05em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--accent-soft-ink); }

/* ---------- Structure ---------- */
.app { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) var(--gutter) 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-height: var(--tap); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-serif); font-size: 21px; letter-spacing: .01em; }
.brand-text small { font-size: 12px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); display: inline-grid; place-items: center; cursor: pointer;
}
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:active { transform: scale(.96); }
.sos-btn {
  min-height: var(--tap); padding: 0 16px; border-radius: 999px;
  background: var(--danger); color: #fff; font-weight: 800; letter-spacing: .06em;
  display: inline-grid; place-items: center;
}
.sos-btn:hover { text-decoration: none; filter: brightness(1.05); }
:root[data-theme="veille"] .sos-btn { background: #7a0a05; color: #ff8a80; }
.net-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.net-dot.off { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent); }

.main { padding: 12px var(--gutter) calc(96px + env(safe-area-inset-bottom)); max-width: var(--maxw); width: 100%; margin: 0 auto; }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }

/* Barre d'onglets (téléphone) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px; border-radius: 12px; color: var(--muted); font-size: 12px; font-weight: 600;
}
.tab svg { width: 26px; height: 26px; }
.tab:hover { text-decoration: none; }
.tab.active { color: var(--accent); background: var(--accent-soft); }

/* Rail (tablette / ordinateur) */
.rail { display: none; }
@media (min-width: 900px) {
  .app { grid-template-columns: 200px 1fr; grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; }
  .rail {
    display: flex; flex-direction: column; gap: 4px; padding: 16px 12px;
    border-right: 1px solid var(--line); position: sticky; top: 72px; height: calc(100dvh - 72px); overflow: auto;
  }
  .rail .tab { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 12px; min-height: 48px; font-size: 15px; }
  .rail .tab svg { width: 22px; height: 22px; }
  .rail .rail-sep { height: 1px; background: var(--line); margin: 10px 4px; }
  .tabbar { display: none; }
  .main { padding-bottom: 48px; }
}

/* ---------- Typo utilitaire ---------- */
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
.serif { font-family: var(--font-serif); }
.page-title { font-family: var(--font-serif); font-size: 28px; margin: 6px 0 2px; }
.page-sub { color: var(--muted); font-size: 15px; margin: 0 0 14px; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.grid-2 { display: grid; gap: 12px; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Cartes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }
.card-title { font-family: var(--font-serif); font-size: 20px; margin-bottom: 6px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card-title .kicker { font-family: var(--font-ui); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h2, .card-head h3 { font-size: 17px; font-weight: 700; }

/* Panneau live (sombre) */
.panel {
  background: var(--panel); color: var(--panel-ink); border: 1px solid var(--panel-line);
  border-radius: var(--radius); padding: 16px;
}
.panel + .panel, .card + .panel, .panel + .card { margin-top: 12px; }
.panel .muted { color: var(--panel-muted); }
.panel .card-head h2, .panel .card-head h3 { color: var(--panel-ink); }
.panel a { color: var(--panel-accent); }
.panel .kicker { color: var(--panel-accent); }
.panel hr { border: 0; border-top: 1px solid var(--panel-line); margin: 12px 0; }

/* Tuiles de mesures */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tile { background: var(--panel-2); border-radius: var(--radius-sm); padding: 12px 12px 10px; min-height: 84px; }
.tile .label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--panel-muted); font-weight: 700; }
.tile .value { font-size: 30px; font-weight: 700; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .value small { font-size: 15px; font-weight: 600; color: var(--panel-ink-2); margin-left: 3px; }
.tile .sub { font-size: 13px; color: var(--panel-ink-2); margin-top: 3px; }
.tile.big { grid-column: span 2; }
.tile.wind { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.wind-arrow { width: 56px; height: 56px; color: var(--panel-accent); }
.wind-arrow svg { width: 100%; height: 100%; transition: transform .5s ease; }
.bft-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--panel-3); color: var(--panel-ink); margin-top: 4px; }
.bft-0, .bft-1, .bft-2, .bft-3 { background: #17442c; }
.bft-4, .bft-5 { background: #3f5a12; }
.bft-6 { background: #7a5a00; }
.bft-7 { background: #8a3f00; }
.bft-8, .bft-9, .bft-10, .bft-11, .bft-12 { background: #8a1a1a; }
:root[data-theme="veille"] [class*="bft-"] { background: var(--panel-3); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: scale(.985); }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); background: var(--accent); }
.btn.danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn.block { width: 100%; }
.btn.lg { min-height: 60px; font-size: 18px; border-radius: 14px; }
.btn.ghost { background: transparent; }
.panel .btn { background: var(--panel-2); color: var(--panel-ink); border-color: var(--panel-line); }
.panel .btn:hover { background: var(--panel-3); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 140px; }

/* Segments (A / B) */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--surface); }
.seg button { min-height: 44px; padding: 0 16px; border: 0; background: transparent; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--accent); color: var(--accent-ink); }
.seg.sm button { min-height: 38px; padding: 0 12px; font-size: 14px; }

/* Puces / chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; min-height: 44px; padding: 6px 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); font-weight: 600; cursor: pointer; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15;
}
.chip small { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.active small { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.chip.today { box-shadow: inset 0 0 0 2px var(--accent); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 3px; }
:root[data-theme="veille"] .chip.active { background: #3a0d0a; color: var(--ink); }

/* ---------- Guide : fiches ---------- */
.day-head { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; margin: 6px 0 14px; }
@media (min-width: 600px) { .day-head { grid-template-columns: 1fr 220px; } }
.day-head .croquis { width: 100%; max-width: 340px; justify-self: center; }
@media (min-width: 600px) { .day-head .croquis { max-width: 260px; justify-self: end; } }
.day-label { color: var(--accent); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.day-title { font-family: var(--font-serif); font-size: 30px; margin: 2px 0 4px; }
.day-meta { color: var(--ink-2); font-size: 15px; display: flex; gap: 14px; flex-wrap: wrap; }
.day-meta b { color: var(--ink); }
.day-intro { font-size: 17px; color: var(--ink-2); margin-top: 8px; }
.day-intro p { margin: 0 0 8px; }

.fiche { padding: 14px 16px; }
.fiche-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fiche-title h3 { font-size: 18px; font-weight: 700; }
.fiche-title .star { color: var(--accent); width: 15px; height: 15px; flex: none; position: relative; top: 1px; }
.fiche-title .cat { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: lowercase; }
.fiche-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 8px; font-size: 14px; color: var(--ink-2); }
.fiche-meta a { color: var(--accent); font-weight: 600; }
.fiche-meta .tel { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.fiche-meta .tel svg { width: 16px; height: 16px; }
.fiche p { margin: 0 0 8px; }
.fiche p:last-child { margin-bottom: 0; }
.alerte { color: var(--accent-soft-ink); }
.alerte-box { background: var(--accent-soft); color: var(--accent-soft-ink); border-radius: var(--radius-sm); padding: 10px 12px; }
:root[data-theme="jour"] .alerte { color: #a3124f; }
.fiche .alerte { border-left: 3px solid var(--accent); padding-left: 10px; }
.encadre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }

/* Onglets de section */
.subtabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { flex: 0 0 auto; min-height: 46px; padding: 0 14px; border: 0; background: transparent; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
.subtabs button.active { color: var(--ink); border-bottom-color: var(--accent); }

/* Tableaux */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 8px 6px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.alerte { color: var(--accent-soft-ink); font-weight: 600; }
:root[data-theme="jour"] .table td.alerte { color: #a3124f; }
.table-wrap { overflow-x: auto; }

/* ---------- Accueil ---------- */
.hero { display: grid; gap: 12px; }
.today-card .day-title { font-size: 26px; }
.progress { display: flex; gap: 4px; margin: 8px 0; }
.progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--line-strong); }
.progress i.done { background: var(--accent); }
.activities { display: grid; gap: 8px; }
.activity { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; min-height: 56px; text-align: left; }
.activity .cat-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); font-size: 15px; }
.activity b { display: block; font-size: 16px; }
.activity small { color: var(--muted); font-size: 13px; }
.activity svg.chev { width: 20px; height: 20px; color: var(--muted); transition: transform .2s; }
.activity[aria-expanded="true"] svg.chev { transform: rotate(90deg); }
.activity-body { padding: 4px 12px 10px 56px; font-size: 15px; }
.activity-body p { margin: 0 0 6px; }
.rule-box { border-left: 4px solid var(--accent); padding: 8px 12px; background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.rule-box p { margin: 0; }
.panel .rule-box { background: var(--panel-2); color: var(--panel-ink); border-left-color: var(--panel-accent); }
.panel .rule-box .kicker { color: var(--panel-accent); }

.override { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.override select { min-height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 10px; font: inherit; font-size: 14px; }

/* ---------- Nautique ---------- */
.escale-select { display: flex; gap: 10px; align-items: center; }
.escale-select select { flex: 1; min-height: var(--tap); border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 12px; font: inherit; font-size: 17px; font-weight: 600; }
.updated { font-size: 12px; color: var(--panel-muted); display: flex; align-items: center; gap: 6px; }
.updated.stale { color: var(--warn); }
.src { font-size: 12px; color: var(--panel-muted); margin-top: 8px; }
.src a { color: var(--panel-ink-2); text-decoration: underline; }

.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; display: block; touch-action: pan-y; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--panel-ink-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.legend i.dash { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px); height: 2px; }
.tooltip { position: absolute; pointer-events: none; background: var(--panel-3); color: var(--panel-ink); border: 1px solid var(--panel-line); border-radius: 8px; padding: 6px 10px; font-size: 13px; line-height: 1.3; white-space: nowrap; transform: translate(-50%, 0); display: none; z-index: 2; }
.tooltip b { font-variant-numeric: tabular-nums; }

.tide-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.tide { background: var(--panel-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.tide .t { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tide .k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--panel-muted); font-weight: 700; }
.tide .h { font-size: 13px; color: var(--panel-ink-2); }
.tide.pm .k { color: #6fb4ff; } .tide.bm .k { color: #ffb36b; }
:root[data-theme="veille"] .tide .k { color: var(--panel-muted); }

.moon { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; }
.moon svg { width: 72px; height: 72px; }
.astro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.astro-grid div { background: var(--panel-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.astro-grid .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--panel-muted); font-weight: 700; }
.astro-grid .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

.embed { margin-top: 10px; border-radius: var(--radius-sm); overflow: hidden; background: var(--panel-2); border: 1px solid var(--panel-line); }
.embed iframe { width: 100%; height: 380px; border: 0; display: block; }
.embed .embed-ph { padding: 14px; color: var(--panel-ink-2); font-size: 14px; }
.embed-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.embed-tabs .btn { flex: 1 1 120px; }
.embed-tabs .btn.active { background: var(--panel-accent); color: #1a0410; border-color: transparent; }
:root[data-theme="veille"] .embed-tabs .btn.active { background: #5a1510; color: var(--ink); }

/* ---------- Lexique ---------- */
.lex-section { margin-bottom: 18px; }
.lex-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lex-row:last-child { border-bottom: 0; }
.lex-row .fr { color: var(--ink-2); font-size: 15px; }
.lex-row .it { font-weight: 700; font-size: 18px; margin-top: 1px; }
.lex-row .ph { color: var(--muted); font-size: 14px; font-family: var(--font-mono); margin-top: 2px; letter-spacing: -.01em; }
.play {
  width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.play svg { width: 28px; height: 28px; }
.play:active { transform: scale(.94); }
.play.speaking { animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); } 50% { box-shadow: 0 0 0 10px transparent; } }
.voice-bar { display: grid; gap: 8px; }
.voice-bar select, .voice-bar input[type="range"] { width: 100%; }
.voice-bar select { min-height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 10px; font: inherit; }
.tts-warn { font-size: 14px; }

/* ---------- Devises ---------- */
.conv { display: grid; gap: 12px; }
.conv-field { display: grid; grid-template-columns: 1fr 84px; gap: 8px; align-items: center; }
.conv-field input { width: 100%; min-height: 64px; font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 0 14px; font-family: var(--font-ui); }
.conv-field .cur { font-size: 20px; font-weight: 800; text-align: center; }
.rate-line { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.quick .btn { padding: 0 6px; flex-direction: column; gap: 0; line-height: 1.15; min-height: 60px; }
.quick .btn small { color: var(--muted); font-weight: 600; }

/* ---------- Vols ---------- */
.flight { display: grid; gap: 10px; }
.flight-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.flight-route .code { font-size: 34px; font-weight: 800; letter-spacing: .02em; line-height: 1; }
.flight-route .time { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.flight-route .ap { color: var(--muted); font-size: 13px; }
.flight-route .arrow { color: var(--muted); font-size: 13px; text-align: center; }
.flight-route .arrow b { display: block; font-size: 15px; color: var(--ink); }
.flight-route .to { text-align: right; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge.warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--warn); border-color: transparent; }
.badge.ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.countdown { font-size: 15px; color: var(--ink-2); }

/* ---------- Urgences ---------- */
.contact-list { display: grid; gap: 8px; }
.contact { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
@media (min-width: 560px) { .contact { grid-template-columns: minmax(0, 1fr) auto; } }
.contact.urgence { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.contact b { display: block; font-size: 17px; }
.contact small { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }
.contact .call { min-height: 56px; min-width: 56px; border-radius: 14px; white-space: nowrap; background: var(--ok); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.contact .call:hover { text-decoration: none; filter: brightness(1.06); }
.contact .call svg { width: 22px; height: 22px; }
.contact.urgence .call { background: var(--danger); }
.contact .call.dim { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-strong); }
:root[data-theme="veille"] .contact .call { background: #5a1510; color: var(--ink); }
.contact .flags { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.pos-box { font-family: var(--font-mono); font-size: 18px; font-weight: 700; word-break: break-all; }

/* ---------- Équipage ---------- */
.member { display: grid; gap: 8px; }
.member h3 { font-family: var(--font-serif); font-size: 22px; }
.member dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0; font-size: 15px; }
.member dt { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; padding-top: 2px; }
.member dd { margin: 0; }
.med { padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 6px; }
.med b { display: block; }
.med small { color: var(--muted); }
.placeholder { color: var(--muted); font-style: italic; }

/* ---------- Plus / diagnostic ---------- */
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .menu-grid { grid-template-columns: repeat(3, 1fr); } }
.menu-item { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; min-height: 108px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-weight: 700; }
.menu-item:hover { text-decoration: none; background: var(--surface-2); }
.menu-item svg { width: 28px; height: 28px; color: var(--accent); }
.menu-item small { font-weight: 500; color: var(--muted); font-size: 13px; }
.diag { display: grid; gap: 6px; font-size: 14px; }
.diag div { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.diag i { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.diag i.ok { background: var(--ok); } .diag i.err { background: var(--danger); } .diag i.wait { background: var(--warn); }
.diag code { font-size: 12px; color: var(--muted); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---------- Croquis SVG ---------- */
.croquis { display: block; }
.croquis .land { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: .6; }
.croquis .sea { fill: transparent; }
.croquis .route { fill: none; stroke: var(--muted); stroke-width: .9; stroke-dasharray: 2 2.2; }
.croquis .leg { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.croquis .stop { fill: var(--accent); }
.croquis .stop-ring { fill: none; stroke: var(--accent); stroke-width: 1; opacity: .5; }
.croquis .lbl { font-size: 5.2px; fill: var(--muted); font-family: var(--font-ui); }
.croquis .mtn { fill: none; stroke: var(--line-strong); stroke-width: .8; }
.panel .croquis .land { fill: var(--panel-2); stroke: var(--panel-line); }
.panel .croquis .lbl { fill: var(--panel-muted); }
.panel .croquis .route { stroke: var(--panel-muted); }
.panel .croquis .leg, .panel .croquis .stop-ring { stroke: var(--panel-accent); }
.panel .croquis .stop { fill: var(--panel-accent); }

/* ---------- Impression / mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .topbar, .tabbar, .rail { display: none; } .panel { background: #fff; color: #000; border-color: #999; } }
