/* Carnet des Chapters — interface pensée d'abord pour le téléphone.
   Téléphone : carte plein écran, panneau qui glisse depuis le bas, onglets en bas.
   Ordinateur (≥ 900 px) : carte à gauche, panneau fixe à droite. */
/* Polices servies par le site (RGPD : aucun appel à Google Fonts), sous-ensemble latin. */
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/barlow-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/barlow-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/barlow-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/jetbrains-mono-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #eef0ee;
  --panel: #ffffff;
  --ink: #1d2327;
  --muted: #5d676d;
  --line: #e0e4e2;
  --soft: #eef0ee;
  --accent: #d9480f;
  --accent-ink: #ffffff;
  --accent-soft: #fbe3d7;
  --accent-text: #b23a0b;
  --danger: #b42318;
  --ok: #2b7a3d;
  --track: #b0127a;
  --track-hi: #e8590c;
  --sun: #b7791f;
  --rain: #1f66b5;
  --shadow: 0 2px 10px rgba(29, 35, 39, .18);
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12171a; --panel: #182024; --ink: #e6eaeb; --muted: #9aa6ab; --line: #2b363b; --soft: #212b30;
    --accent: #f0702e; --accent-ink: #1a0d05; --accent-soft: #3b2216; --accent-text: #ffa36e;
    --danger: #f2826f; --ok: #6cc282; --track: #f062b8; --track-hi: #ffa04d; --sun: #f0b84d; --rain: #7ab4ee;
    --shadow: 0 2px 12px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
  #map:not(.fond-ign) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(1.05) saturate(.25); }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--f-body); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- carte ---------- */
#mapwrap { position: fixed; inset: 0 0 calc(var(--tab-h) + var(--safe-b)) 0; }
#map { position: absolute; inset: 0; background: var(--bg); }
.leaflet-container { font: inherit; background: var(--bg); }
.leaflet-control-attribution { font-size: 10px; }
.leaflet-bar a { background: var(--panel); color: var(--ink); border-bottom-color: var(--line); }
.leaflet-tooltip { background: var(--panel); color: var(--ink); border-color: var(--line); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--ink); }
.leaflet-popup-content { margin: 12px 14px; font: 15px/1.4 var(--f-body); }
.crosshair { position: absolute; left: 50%; top: 50%; z-index: 650; pointer-events: none; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; }
.crosspin { width: 40px; height: 40px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--accent); border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.crossshadow { width: 10px; height: 4px; margin-top: 8px; border-radius: 50%; background: rgba(0,0,0,.35); }

.pin { width: 32px; height: 32px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); display: grid; place-items: center; }
.pin b { transform: rotate(45deg); color: #fff; font: 700 14px/1 var(--f-display); }
.pin.sel { box-shadow: 0 0 0 3px var(--accent), 0 2px 6px rgba(0,0,0,.35); }
.pin.dim { opacity: .35; }
.pin.closed { filter: grayscale(.85); opacity: .7; }
/* Bon plan vu de loin : point coloré (zone de clic 28 px) ; regroupement : bulle chiffrée cerclée des couleurs des types */
.dot { width: 28px; height: 28px; display: grid; place-items: center; }
.dot i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.dot.dim { opacity: .35; }
.dot.closed { filter: grayscale(.85); opacity: .7; }
.cluster { border-radius: 50%; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.cluster b { width: calc(100% - 10px); height: calc(100% - 10px); border-radius: 50%; display: grid; place-items: center; background: var(--panel); color: var(--ink); font: 700 14px/1 var(--f-display); }
.feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.feats li { display: flex; align-items: center; gap: 8px; }
.feats svg { flex: none; color: var(--ok); }
.closed-banner { margin: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--soft); color: var(--danger); font-weight: 600; }
.item small.closed-txt { color: var(--danger); font-weight: 500; }
.kv dd.stale { color: var(--danger); }
.fs { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fs legend { padding: 0 6px; font: 700 13px var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.days .chip { min-width: 0; height: 44px; padding: 0; justify-content: center; font-size: 13px; }
.pin.rt svg { transform: rotate(45deg); color: #fff; }
.rtcount { position: absolute; top: -9px; right: -9px; transform: rotate(45deg); min-width: 20px; height: 20px; padding: 0 4px; box-sizing: border-box; border-radius: 10px; background: #111827; color: #fff; border: 1.5px solid #fff; font: 700 12px/17px var(--f-display); text-align: center; }
.rtpop { display: grid; gap: 4px; min-width: 220px; }
.rtpop > b { font: 700 14px var(--f-display); margin-bottom: 2px; }
.rtpop button { display: grid; text-align: left; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--ink); font: inherit; cursor: pointer; }
.rtpop button small { color: var(--muted); }
.chmark { width: 40px; height: 40px; border-radius: 50%; background: var(--panel); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); display: grid; place-items: center; font: 700 13px var(--f-display); color: var(--ink); overflow: hidden; }
/* Chapter avec logo : le logo seul (forme libre, fond transparent), sans le rond, avec une ombre pour ressortir sur la carte.
   Sélecteur renforcé : leaflet.css impose width:auto aux images des marqueurs. */
.chmark.logo { width: 44px; height: 38px; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
.leaflet-marker-pane .chmark.logo img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0,0,0,.45)) drop-shadow(0 2px 5px rgba(0,0,0,.3)); }
/* Concessions Harley-Davidson : pin noir « HD » orange ; chapter rattaché = logo + pastille HD (marqueur combiné) */
.pin.hd { border-color: #f26f21; }
.pin.hd b { color: #f26f21; font-size: 13px; }
.chwrap { position: relative; width: 100%; height: 100%; }
.hdtag { position: absolute; right: -12px; bottom: -6px; padding: 2px 4px; border-radius: 6px; background: #111827; color: #f26f21; border: 1.5px solid #fff; font: 700 11px/1 var(--f-display); box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.hdtag.sel { box-shadow: 0 0 0 3px var(--accent), 0 1px 4px rgba(0,0,0,.4); }
.mydot { width: 18px; height: 18px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(26,115,232,.25); }

/* ---------- barre de recherche ---------- */
.topbar { position: fixed; top: var(--safe-t); left: 0; right: 0; z-index: 800; padding: 12px 16px 0; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; background: var(--panel); color: var(--muted); border-radius: 12px; box-shadow: var(--shadow); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-weight: 500; font-size: 16px; }
.citylist { margin: -4px 0 0; padding: 4px; list-style: none; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); max-height: 50vh; overflow-y: auto; }
.citylist button { width: 100%; min-height: 44px; display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 10px; border-radius: 8px; text-align: left; cursor: pointer; }
.citylist button:hover, .citylist button:focus-visible { background: var(--soft); }
.citylist small { color: var(--muted); font: 500 12px var(--f-mono); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 14px 0 10px; border-radius: 18px; border: 0; background: var(--panel); box-shadow: 0 1px 4px rgba(29,35,39,.16); font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chip i { width: 12px; height: 12px; border-radius: 50%; }
.chip i.ch { background: var(--panel); border: 2px solid var(--ink); box-sizing: border-box; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--panel); }

/* ---------- panneau ---------- */
.sheet { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 900; background: var(--panel); border-radius: 20px 20px 0 0; box-shadow: 0 -4px 18px rgba(29,35,39,.16); display: flex; flex-direction: column; transition: height .22s ease; height: 42%; }
.sheet[data-size="low"] { height: 76px; } /* réduit : poignée + titre (ou bouton Retour), le reste pour la carte */
.sheet[data-size="mini"] { height: 236px; }
.sheet[data-size="peek"] { height: 42%; }
.sheet[data-size="tall"] { height: 68%; }
.sheet[data-size="full"] { height: calc(100% - var(--tab-h) - var(--safe-b) - var(--safe-t) - 12px); }
.handle { flex: none; height: 32px; border: 0; background: none; display: grid; place-items: center; cursor: grab; touch-action: none; }
.handle span { width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 24px; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); display: flex; flex-direction: column; gap: 14px; }
.sheet-body > * { flex-shrink: 0; } /* sinon les blocs en overflow:hidden (.facts, .elev) s'écrasent au lieu de faire défiler le panneau */
.fabs { position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: calc(100% + 12px); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fab { border: 0; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.fab.round { width: 52px; height: 52px; border-radius: 50%; background: var(--panel); color: var(--ink); }
.fab.fond { font: 700 14px/1 "JetBrains Mono", monospace; letter-spacing: .02em; }
.fab.fond[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
/* Panneau haut : pas la place pour trois boutons sous les filtres */
.sheet[data-size="tall"] .fab.fond, .sheet[data-size="full"] .fab.fond { display: none; }
.fab.add { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); }
/* POI OpenStreetMap : choix des catégories (bouton « POI ») et marqueurs */
.poibox { position: absolute; right: 64px; bottom: 0; width: min(270px, calc(100vw - 96px)); max-height: 60vh; overflow-y: auto; padding: 10px 14px; background: var(--panel); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow); z-index: 5; }
.poibox[hidden] { display: none; }
.poibox .hint { font-size: 13px; margin: 4px 0 0; }
.poibox i { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font: 700 11px/1 "JetBrains Mono", monospace; }
.poimark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-sizing: border-box; color: #fff; font: 700 11px/1 "JetBrains Mono", monospace; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.poitags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.poitags li { padding: 6px 12px; border-radius: 16px; background: var(--soft); font-size: 14px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--panel); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; }
.tabbar button[aria-current="page"] { color: var(--accent-text); font-weight: 600; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 112px); z-index: 1100; max-width: min(92vw, 460px); background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; }
.toast.err { background: var(--danger); color: #fff; }
/* Invitation à installer le carnet (installBanner dans app.js) */
.pwa[hidden], .pwa [hidden] { display: none !important; }
.pwa { position: fixed; left: 16px; right: 16px; top: calc(var(--safe-t) + 112px); z-index: 1050; max-width: 460px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--panel); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-8px); transition: opacity .25s ease, transform .25s ease; }
.pwa.open { opacity: 1; transform: none; }
.pwa > img { width: 48px; height: 48px; border-radius: 10px; flex: 0 0 auto; }
.pwa-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.pwa-text strong { color: var(--ink); font-size: 16px; }
.pwa-text b { color: var(--ink); }
.pwa-share { width: 18px; height: 18px; vertical-align: -3px; color: var(--accent); }
.pwa-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
@media (max-width: 420px) {
  .pwa { flex-wrap: wrap; }
  .pwa-text { flex-basis: calc(100% - 60px); }
  .pwa-actions { flex-direction: row; width: 100%; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { .pwa { transition: none; } }

/* ---------- ordinateur ---------- */
@media (min-width: 900px) {
  #mapwrap { inset: 0 420px 0 0; }
  .topbar { right: 420px; max-width: 560px; }
  .chips { flex-wrap: wrap; overflow: visible; } /* à la souris, pas de glisser horizontal : les filtres passent à la ligne */
  .tabbar { left: auto; width: 420px; top: 0; bottom: auto; height: 60px; padding-bottom: 0; border-top: 0; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
  .tabbar button { flex-direction: row; gap: 8px; font-size: 14px; }
  .sheet, .sheet[data-size] { left: auto; right: 0; top: 60px; bottom: 0; width: 420px; height: auto; border-radius: 0; box-shadow: none; border-left: 1px solid var(--line); }
  .handle { display: none; }
  .sheet-body { padding-top: 18px; }
  .fabs { position: fixed; right: 436px; bottom: 28px; }
  .sheet[data-size] .fab.fond { display: grid; }
  .sheet[data-size] .fab.fond[hidden] { display: none; }
  .toast { left: calc((100% - 420px) / 2); }
}

/* ---------- contenu ---------- */
h1, h2 { margin: 0; font-family: var(--f-display); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }
h1 { font-size: 30px; line-height: 1.02; }
h2 { font-size: 22px; line-height: 1.05; }
p { margin: 0; }
.kicker { font: 600 13px var(--f-display); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); }
.err { font-size: 14px; color: var(--danger); font-weight: 500; }
.gosum { font-size: 18px; color: var(--ink); }
.okmsg { font-size: 14px; color: var(--ok); font-weight: 500; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.mono { font-family: var(--f-mono); font-size: 14px; font-variant-numeric: tabular-nums; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.back { align-self: flex-start; min-height: 44px; border: 0; background: var(--soft); border-radius: 20px; padding: 0 14px 0 10px; display: inline-flex; align-items: center; gap: 4px; font-weight: 500; cursor: pointer; }

.btn { min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.block { width: 100%; }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 44px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { border: 0; background: none; padding: 0; color: var(--accent-text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
/* Suivi des chapters (administrateur) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.stats > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; }
.stats b { font-size: 22px; line-height: 1.1; }
.stats span { font-size: 13px; color: var(--muted); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.prog .item { align-items: flex-start; cursor: default; }
.prog .item > span { display: grid; gap: 3px; justify-items: start; }
.prog .marks { display: flex; flex-wrap: wrap; gap: 10px; }
.prog .ok { color: var(--ok); }
.prog .ko { color: var(--muted); }
/* Guide du référent (markdown mis en forme) */
.md ol, .md ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.md h2 { margin-top: 10px; }
.md-table { overflow-x: auto; }
.md table { border-collapse: collapse; font-size: 14px; width: 100%; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
/* Pied de panneau : copyright + pages légales, discret */
.foot { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; line-height: 2; color: var(--muted); text-align: center; }
.foot .link { font-size: 12px; font-weight: 400; color: var(--muted); }
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.action { min-height: 64px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 600; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; cursor: pointer; }
.action.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.list { display: flex; flex-direction: column; }
.photo { display: block; border-radius: 12px; overflow: hidden; background: var(--soft); }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-edit { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; }
.pickrow { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--line); }
.pickrow:last-child { border-bottom: 0; }
.pickrow > label { display: grid; place-items: center; min-height: 44px; cursor: pointer; }
.pickrow input { width: 20px; height: 20px; accent-color: var(--accent); }
.pickrow .item { border-bottom: 0; }
.item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; min-height: 60px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; width: 100%; cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item b { display: block; font-weight: 600; font-size: 17px; line-height: 1.2; }
.item small { display: block; font-size: 14px; color: var(--muted); }
.item .meta { font: 500 13px var(--f-mono); color: var(--muted); text-align: right; white-space: nowrap; }
.item .km { color: var(--accent-text); }
.badge { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; font: 700 17px var(--f-display); }
.badge.tr { background: var(--track); font-size: 13px; }
.badge.hd { color: #f26f21; font-size: 15px; }
.hdico { display: grid; place-items: center; width: 30px; height: 22px; border-radius: 5px; background: #111827; color: #f26f21; font: 700 12px/1 var(--f-display); }
.badge.ch { background: var(--ink); color: var(--panel); border-radius: 50%; font-size: 14px; }
img.badge { object-fit: contain; background: var(--soft); border-radius: 50%; }

.empty { border: 1px dashed var(--line); border-radius: 12px; padding: 16px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; }
.empty h2 { color: var(--ink); font-size: 20px; }

.chapline { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }
.chapline .badge { width: 28px; height: 28px; font-size: 11px; }
button.chapline { padding: 8px 0; margin: -8px 0; } /* zone tactile de 44 px sans décaler la mise en page */
.tip { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.tip b { font: 700 13px var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.kv { margin: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px 12px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv dd a { display: inline-block; padding: 12px 0; margin: -12px 0; } /* zone tactile de 44 px sans décaler les lignes */.facts { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.facts div { padding: 8px 12px; border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; }
.facts dt { font: 600 11px var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font: 500 17px var(--f-mono); font-variant-numeric: tabular-nums; }
.elev { width: 100%; height: 64px; display: block; }
.meteo-form { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px; }
.meteo { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.meteo li { padding: 8px 12px; display: grid; gap: 2px; border-top: 1px solid var(--line); font-size: 14px; }
.meteo li:first-child { border-top: 0; }
.meteo li > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.meteo li b { font: 500 15px var(--f-mono); font-variant-numeric: tabular-nums; }
.meteo li small { margin-left: auto; color: var(--muted); font-size: 13px; }
.meteo .alerte { color: var(--danger); font-weight: 600; }
.meteo li.on { background: var(--accent-soft); }
.mpills { display: flex; justify-content: center; }
.mpills.gauche { justify-content: flex-end; }
.mpills.droite { justify-content: flex-start; }
.mpill { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 9px 0 6px; border-radius: 16px; background: var(--panel); color: var(--ink); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); font: 500 15px/1 var(--f-mono); white-space: nowrap; }
.mpill svg { flex: none; }
.mpill.soleil svg { color: var(--sun); }
.mpill.pluie svg { color: var(--rain); }
.mpill.gris svg { color: var(--muted); }
.mpill.danger svg { color: var(--danger); }
.mpill.alerte { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger), 0 2px 6px rgba(0,0,0,.35); }
.hero { display: flex; gap: 14px; align-items: center; }
.hero img { width: 84px; height: 84px; flex: none; object-fit: contain; border-radius: 12px; background: var(--soft); }
.notice { background: var(--soft); border-radius: 12px; padding: 12px 14px; font-size: 15px; display: flex; flex-direction: column; gap: 6px; }
.confirm { border: 1px solid var(--danger); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }

/* formulaires */
form { display: flex; flex-direction: column; gap: 14px; }
.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--muted); }
.f em { font-style: normal; color: var(--accent-text); }
.f input[type=text], .f input[type=email], .f input[type=url], .f input[type=tel], .f input[type=search], .f input[type=number], .f select, .f textarea {
  width: 100%; min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel); color: var(--ink); font-size: 16px; font-weight: 400; }
.f textarea { min-height: 96px; resize: vertical; }
.f input[type=file] { font-size: 15px; color: var(--ink); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.code { letter-spacing: .5em; text-align: center; font: 500 28px var(--f-mono) !important; padding-left: .5em !important; }
.checks { display: flex; flex-direction: column; gap: 4px; }
.checks label { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-weight: 400; font-size: 16px; }
.checks input { width: 20px; height: 20px; accent-color: var(--accent); }
.coordbox { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { min-height: 44px; border: 0; border-right: 1px solid var(--line); background: var(--panel); font-size: 14px; font-weight: 500; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.range { display: flex; align-items: center; gap: 12px; }
.range input { flex: 1; accent-color: var(--accent); }
.range output { min-width: 56px; text-align: right; font: 500 15px var(--f-mono); color: var(--ink); }
.logo-edit { display: flex; gap: 12px; align-items: center; }
.logo-edit img { width: 64px; height: 64px; flex: none; object-fit: contain; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); }
