/* Rando La Parenthèse — partie voyageurs (mobile d'abord) */
:root {
  --forest: #1f4d3a;
  --forest-2: #2c6a50;
  --forest-deep: #163a2b;
  --forest-tint: #e6efe9;
  --ember: #d9782f;
  --ember-tint: #fbeee2;
  --snow: #fbfaf6;
  --paper: #f3f1ea;
  --card: #ffffff;
  --ink: #1b221e;
  --ink-2: #5a645e;
  --line: #e1ded4;
  --danger: #b4372f;
  --danger-tint: #fbeceb;
  --info-tint: #eaf1f7;
  --info: #285a85;
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
a { color: var(--forest-2); }
button { font: inherit; }

/* ---------- Page de connexion ---------- */
.hero { position: relative; background: linear-gradient(170deg, var(--forest-deep) 0%, var(--forest) 55%, var(--forest-2) 100%); color: #fff; padding: calc(28px + env(safe-area-inset-top, 0px)) 20px 70px; overflow: hidden; }
.hero-inner { max-width: 480px; margin: 0 auto; position: relative; z-index: 1; }
.hero-logo { display: block; border-radius: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.25); margin-bottom: 18px; }
.hero-kicker { margin: 0 0 6px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: #bcd6c7; font-weight: 600; }
.hero-title { font-size: 1.85rem; font-weight: 750; letter-spacing: -.02em; }
.hero-text { margin: 10px 0 0; color: #d7e6dd; font-size: 1rem; max-width: 34ch; }
.hero-ridge { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 60px; fill: var(--paper); }

.login { max-width: 480px; margin: -40px auto 0; padding: 0 16px calc(32px + var(--safe-b)); position: relative; z-index: 2; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20,40,30,.06), 0 10px 30px rgba(20,40,30,.08); }
.login-card { padding: 22px 20px 20px; }
.card-title { font-size: 1.25rem; }
.card-sub { margin: 4px 0 18px; color: var(--ink-2); font-size: .95rem; }

.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field input {
  width: 100%; height: 52px; padding: 0 14px; font: inherit; font-size: 17px; /* ≥16px : pas de zoom auto sur iPhone */
  color: var(--ink); background: var(--snow); border: 1.5px solid var(--line); border-radius: 12px;
  transition: border-color .15s, background .15s;
}
.field input:focus { outline: none; border-color: var(--forest-2); background: #fff; box-shadow: 0 0 0 4px rgba(44,106,80,.14); }
.field input.is-missing { border-color: var(--danger); background: var(--danger-tint); }
.field input[name=code] { letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.field-hint { margin: -4px 0 16px; font-size: .84rem; color: var(--ink-2); }
.help { margin: -6px 0 16px; font-size: .9rem; }
.help summary { cursor: pointer; color: var(--forest-2); font-weight: 600; list-style: none; padding: 4px 0; }
.help summary::-webkit-details-marker { display: none; }
.help summary::before { content: "+"; display: inline-block; width: 1.1em; font-weight: 700; }
.help[open] summary::before { content: "−"; }
.help p { margin: 4px 0 0; color: var(--ink-2); background: var(--forest-tint); padding: 10px 12px; border-radius: 10px; }

.switch { display: flex; align-items: center; gap: 12px; margin: 4px 0 20px; font-size: .92rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { flex: 0 0 auto; width: 46px; height: 28px; border-radius: 99px; background: #cfd3cc; position: relative; transition: background .2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--forest-2); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 3px solid rgba(44,106,80,.35); outline-offset: 2px; }

.btn-main {
  position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 54px;
  border: 0; border-radius: 14px; background: var(--ember); color: #fff; font-weight: 700; font-size: 1.05rem;
  cursor: pointer; box-shadow: 0 6px 16px rgba(217,120,47,.32); transition: transform .1s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-main:active { transform: scale(.985); background: #c56a25; }
.btn-main .spinner { display: none; width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.btn-main.is-busy .btn-label { display: none; }
.btn-main.is-busy .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; margin-bottom: 14px; font-size: .95rem; box-shadow: 0 6px 20px rgba(20,40,30,.08); }
.notice-icon { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .9rem; color: #fff; }
.notice-error { background: #fff; border-left: 5px solid var(--danger); }
.notice-error .notice-icon { background: var(--danger); }
.notice-info { background: #fff; border-left: 5px solid var(--forest-2); }
.notice-info .notice-icon { background: var(--forest-2); font-family: Georgia, serif; font-style: italic; }

.login-foot { text-align: center; color: var(--ink-2); font-size: .9rem; margin: 18px 8px 8px; }
.login-privacy { text-align: center; color: #8a918c; font-size: .76rem; margin: 0 12px; }

/* ---------- Accueil connecté ---------- */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--forest); color: #fff; }
.topbar-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 1rem; white-space: nowrap; }
.topbar-brand img { border-radius: 8px; }
.topbar-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,.28); background: transparent; color: #fff; cursor: pointer; }
.topbar-btn:active { background: rgba(255,255,255,.12); }

.home { max-width: 720px; margin: 0 auto; padding: 0 16px calc(28px + var(--safe-b)); }
.welcome { background: linear-gradient(160deg, var(--forest) 0%, var(--forest-2) 100%); color: #fff; margin: 0 -16px; padding: 18px 20px 26px; border-radius: 0 0 24px 24px; }
.welcome-hello { font-size: 1.55rem; font-weight: 750; margin: 0 0 4px; letter-spacing: -.01em; }
.welcome-stay { margin: 0; color: #e3eee7; }
.welcome-stay strong { color: #fff; }
.welcome-access { margin: 6px 0 0; font-size: .86rem; color: #b9d3c4; }
.badge-test { display: inline-block; margin: 10px 0 0; padding: 3px 10px; border-radius: 99px; background: var(--ember); color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .03em; }

.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.section h2 { font-size: 1.25rem; }
.section-note { font-size: .82rem; color: var(--ink-2); }
.soon { margin: 10px 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--ember-tint); color: #8a4612; font-size: .9rem; }
.empty { color: var(--ink-2); }

.routes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.route { background: var(--card); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: 0 1px 2px rgba(20,40,30,.05), 0 4px 14px rgba(20,40,30,.05); }
.route-top { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .76rem; font-weight: 700; background: var(--forest-tint); color: var(--forest); }
.chip-trail { background: #fde9dc; color: #a24b12; }
.chip-raquettes { background: #e4eef8; color: #24527a; }
.chip-vtt { background: #efe8f8; color: #5b3a8a; }
.chip-soft { background: #f0eee7; color: var(--ink-2); font-weight: 600; }
.route-title { font-size: 1.1rem; font-weight: 700; }
.route-summary { margin: 4px 0 0; color: var(--ink-2); font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.route-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid #efece4; }
.route-stats div { min-width: 0; }
.route-stats dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.route-stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.route-where { margin: 10px 0 0; font-size: .84rem; color: var(--ink-2); }

.safety { background: var(--card); border-radius: var(--radius); padding: 18px 16px; box-shadow: 0 1px 2px rgba(20,40,30,.05); }
.disclaimer { font-size: .93rem; color: #333b36; }
.disclaimer p { margin: 8px 0; }
.emergency-title { font-size: 1rem; margin: 18px 0 10px; }
.emergency { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.call { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); text-decoration: none; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.call:active { background: var(--forest-tint); }
.call-main { border-color: var(--danger); background: var(--danger-tint); }
.call-text { display: flex; flex-direction: column; min-width: 0; }
.call-label { font-weight: 700; }
.call-note { font-size: .8rem; color: var(--ink-2); }
.call-num { flex: 0 0 auto; font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; color: var(--forest); }
.call-main .call-num { color: var(--danger); font-size: 1.3rem; }
.call-num::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -2px;
  background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15 15 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15 15 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E") center/contain no-repeat; }
.foot { margin-top: 26px; text-align: center; font-size: .76rem; color: #8a918c; }

/* ---------- Écrans plus larges ---------- */
@media (min-width: 560px) {
  .hero { padding-top: 48px; padding-bottom: 90px; }
  .hero-title { font-size: 2.2rem; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 28px; }
  .welcome { margin: 16px 0 0; border-radius: var(--radius); }
  .routes { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* =====================================================================
   Étape 3 — carte, filtres, fiche
   ===================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topbar-back { display: inline-flex; align-items: center; gap: 4px; color: #fff; text-decoration: none; font-weight: 600; height: 44px; padding-right: 10px; margin-left: -6px; }

.explore, .detail { max-width: 760px; margin: 0 auto; padding: 0 16px calc(28px + var(--safe-b)); }
.hello { background: var(--forest); color: #fff; margin: 0 -16px; padding: 4px 16px 14px; }
.hello-name { margin: 0; font-size: 1.3rem; font-weight: 750; display: flex; align-items: center; gap: 8px; }
.hello-name .badge-test { margin: 0; }
.hello-stay { margin: 2px 0 0; font-size: .85rem; color: #bcd6c7; }

.searchbar { position: sticky; top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 40; display: flex; gap: 8px; margin: 0 -16px; padding: 10px 16px; background: var(--paper); box-shadow: 0 6px 12px -10px rgba(0,0,0,.25); }
.search { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink-2); }
.search:focus-within { border-color: var(--forest-2); box-shadow: 0 0 0 4px rgba(44,106,80,.14); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.filter-btn { flex: 0 0 auto; position: relative; display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--forest); background: #fff; color: var(--forest); font-weight: 700; cursor: pointer; }
.filter-btn.is-active { background: var(--forest); color: #fff; }
.filter-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--ember); color: #fff; font-size: .75rem; }

.map-wrap { position: relative; margin: 0 -16px; }
.map-main { height: 46vh; height: 46svh; min-height: 280px; max-height: 560px; background: #e3e6df; z-index: 0; }
.map-detail { height: 42vh; height: 42svh; min-height: 260px; max-height: 520px; background: #e3e6df; z-index: 0; }
.map-fab { position: absolute; right: 12px; bottom: 26px; z-index: 500; width: 44px; height: 44px; border-radius: 12px; border: 0; background: #fff; color: var(--forest); box-shadow: 0 2px 8px rgba(0,0,0,.25); display: grid; place-items: center; cursor: pointer; }
.leaflet-control-layers-toggle { width: 40px !important; height: 40px !important; }
.leaflet-touch .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; }
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { margin: 12px 14px; font: 14px/1.4 var(--font); min-width: 200px; }
.pop-title { display: block; font-weight: 700; font-size: 1rem; color: var(--ink); margin-bottom: 2px; }
.pop-stats { color: var(--ink-2); margin: 0 0 8px; }
.pop-link { display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 40px; border-radius: 10px; background: var(--ember); color: #fff !important; text-decoration: none; font-weight: 700; }
.pin { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 2px 4px rgba(0,0,0,.25); }
.pin-start { background: #2c6a50; } .pin-end { background: #b4372f; }
.pin-home { width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--ember); border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4); }
.arrow { width: 18px; height: 18px; display: grid; place-items: center; }
.arrow svg { filter: drop-shadow(0 0 1px rgba(255,255,255,.9)); }

.results-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 10px; }
.results-count { margin: 0; font-weight: 750; font-size: 1.1rem; }
.sort select { height: 40px; padding: 0 30px 0 10px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: 15px; color: var(--ink); }

.route { position: relative; padding: 0; overflow: hidden; }
.route.is-hl { box-shadow: 0 0 0 2px var(--ember), 0 4px 14px rgba(20,40,30,.08); }
.route-link { display: block; padding: 16px 16px 14px; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.route-link:active { background: #faf9f5; }
.route-pin { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--forest); display: grid; place-items: center; cursor: pointer; }
.route .route-top { padding-right: 46px; }
.route-stats { grid-template-columns: repeat(3, 1fr); }
.chip-kids { background: #fff3c9; color: #7a5a00; }
.chip-diff { background: #f0eee7; color: var(--ink-2); }
.diff-tres_facile, .diff-facile { background: #e3f1e6; color: #22603d; }
.diff-moyenne { background: #fdf0d8; color: #8a5a00; }
.diff-difficile { background: #fde5dc; color: #a2401c; }
.diff-tres_difficile { background: #f7dcdc; color: #8f1f1f; }
.no-result { text-align: center; background: #fff; border-radius: var(--radius); padding: 22px 16px; }
.no-result p { margin: 0 0 6px; }
.btn-ghost { height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; }

/* Panneau de filtres (feuille du bas sur mobile) */
.sheet { width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 22px 22px 0 0; background: #fff; color: var(--ink); box-shadow: 0 -10px 40px rgba(0,0,0,.25); }
.sheet::backdrop { background: rgba(18, 30, 24, .5); }
.sheet[open] { animation: sheet-up .22s ease-out; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet[open] { display: flex; flex-direction: column; overflow: hidden; }
.sheet-inner { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid #efece4; }
.sheet-head h2 { font-size: 1.2rem; }
.sheet-close { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #f0eee7; font-size: 1rem; cursor: pointer; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 16px 16px; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid #efece4; }
.sheet-foot .btn-main { flex: 1; height: 50px; box-shadow: none; }
.fgroup { border: 0; margin: 0; padding: 14px 0 4px; border-bottom: 1px solid #f2f0ea; }
.fgroup legend { float: left; width: 100%; font-weight: 700; font-size: .95rem; margin-bottom: 10px; padding: 0; }
.fgroup legend + * { clear: both; }
.range-label { display: flex; justify-content: space-between; width: 100%; font-weight: 700; font-size: .95rem; margin-bottom: 10px; padding: 0; }
.range-label output { font-weight: 700; color: var(--forest-2); }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle span { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: .92rem; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.toggle input:checked + span { background: var(--forest); border-color: var(--forest); color: #fff; }
.toggle input:focus-visible + span { outline: 3px solid rgba(44,106,80,.35); outline-offset: 2px; }
input[type=range] { width: 100%; height: 32px; accent-color: var(--forest-2); }
.switches { display: grid; gap: 4px; }
.switches .switch { margin: 6px 0; }

/* Fiche */
.page-route .topbar { background: var(--forest); }
.detail-head { padding: 14px 0 12px; }
.detail-title { font-size: 1.55rem; font-weight: 750; letter-spacing: -.01em; margin-top: 6px; }
.detail-where { margin: 4px 0 0; color: var(--ink-2); font-size: .92rem; }
.map-wrap-detail { margin-top: 0; }
.profile { background: #fff; margin: 0 -16px; padding: 10px 12px 6px; }
.profile-canvas { position: relative; height: 150px; }
.profile canvas { touch-action: pan-y; }
.profile-hint { margin: 2px 0 0; text-align: center; font-size: .72rem; color: #9aa19c; pointer-events: none; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.fact { background: #fff; border-radius: 12px; padding: 10px 12px; min-width: 0; }
.fact span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.fact strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fact-main strong { font-size: 1.25rem; color: var(--forest); }
.runs { margin-top: 14px; }
.small-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin-bottom: 8px; }
.run-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.run { background: var(--ember-tint); border-radius: 12px; padding: 8px 12px; }
.run span { display: block; font-size: .78rem; color: #8a4612; }
.run strong { font-variant-numeric: tabular-nums; }
.note { margin: 6px 0 0; font-size: .78rem; color: var(--ink-2); }
.actions { margin-top: 16px; display: grid; gap: 10px; }
.btn-nav { gap: 8px; }
.btn-nav:disabled { background: #b9bfba; box-shadow: none; cursor: not-allowed; }
.soon-tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: rgba(255,255,255,.3); padding: 2px 7px; border-radius: 99px; }
.actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-sec { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; border-radius: 14px; border: 1.5px solid var(--forest); color: var(--forest); background: #fff; font-weight: 700; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.btn-sec:active { background: var(--forest-tint); }
.btn-inline { display: inline-flex; width: auto; padding: 0 20px; text-decoration: none; }
.prose-card { background: #fff; border-radius: var(--radius); padding: 16px; }
.lead { font-size: 1.05rem; font-weight: 600; margin: 0 0 10px; }
.prose { font-size: .98rem; line-height: 1.6; }
.prose h2 { font-size: 1.15rem; margin: 18px 0 6px; }
.prose h3 { font-size: 1.02rem; margin: 14px 0 4px; }
.prose p { margin: 0 0 10px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 10px; }
.prose blockquote { margin: 10px 0; padding: 8px 12px; border-left: 4px solid var(--ember); background: var(--ember-tint); border-radius: 0 10px 10px 0; }
.prose .ql-align-center { text-align: center; }
.access { margin-top: 12px; padding: 12px; background: var(--forest-tint); border-radius: 12px; }
.access h3 { font-size: .95rem; margin-bottom: 4px; }
.access p { margin: 0; }
.meta { margin: 10px 0 0; font-size: .92rem; }
.tags { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: .82rem; color: var(--forest-2); background: var(--forest-tint); padding: 2px 9px; border-radius: 99px; }

@media (min-width: 560px) {
  .hello, .searchbar, .map-wrap, .profile { margin-left: 0; margin-right: 0; }
  .hello { border-radius: 0 0 var(--radius) var(--radius); }
  .map-main, .map-detail { border-radius: var(--radius); }
  .map-wrap-detail .map-detail { border-radius: var(--radius) var(--radius) 0 0; }
  .profile { border-radius: 0 0 var(--radius) var(--radius); }
  .sheet { margin: auto; border-radius: 22px; }
}
.map-fab-inline { position: static; margin: 0 2px 10px 0; }

/* Couleur propre à chaque itinéraire (identique sur la carte) */
.route { border-left: 6px solid var(--route-color, var(--forest-2)); }
.route-title::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--route-color, var(--forest-2)); vertical-align: 2px; }

/* =====================================================================
   Étape 4 — mode navigation
   ===================================================================== */
body.page-nav { overflow: hidden; background: #e3e6df; height: 100vh; height: 100dvh; overscroll-behavior: none; }
.nav { position: fixed; inset: 0; }
.nav-map { position: absolute; inset: 0; z-index: 0; background: #e3e6df; }
.nav-top { position: absolute; z-index: 1000; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; background: var(--forest-deep); color: #fff; }
.nav-round { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.nav-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nav-title-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-title-name i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; border: 2px solid #fff; vertical-align: 0; }
.nav-gps { font-size: .78rem; color: #c7d9cf; }
.nav-gps::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #9aa19c; margin-right: 6px; vertical-align: 1px; }
.gps-good::before { background: #4ade80; } .gps-mid::before { background: #fbbf24; } .gps-bad::before { background: #f87171; }
.nav-sos { flex: 0 0 auto; height: 44px; padding: 0 14px; border-radius: 22px; border: 2px solid #fff; background: #c62828; color: #fff; font-weight: 800; letter-spacing: .06em; cursor: pointer; }

.nav-map .leaflet-top { top: calc(70px + env(safe-area-inset-top, 0px)); }
.nav-alert { position: absolute; z-index: 1000; left: 12px; right: 12px; top: calc(74px + env(safe-area-inset-top, 0px)); display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px; background: #c62828; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.3); animation: pop .2s ease-out; }
.nav-alert strong { display: block; font-size: 1.05rem; }
.nav-alert span { font-size: .88rem; }
.nav-alert-info { background: #1f5fd1; }
.nav-alert-ok { background: var(--forest-2); }
.nav-alert-arrow { flex: 0 0 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; transition: transform .3s; }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

.nav-fabs { position: absolute; z-index: 1000; right: 12px; bottom: calc(170px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; }
.nav-fab { width: 52px; height: 52px; border-radius: 16px; border: 0; background: #fff; color: var(--forest); box-shadow: 0 3px 10px rgba(0,0,0,.25); display: grid; place-items: center; cursor: pointer; }
#nav-follow { background: #1f5fd1; color: #fff; }

.nav-panel { position: absolute; z-index: 1000; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.18);
  padding: 0 14px calc(12px + env(safe-area-inset-bottom, 0px)); }
.nav-progress { height: 6px; margin: 0 -14px 10px; background: #e8ebe7; border-radius: 20px 20px 0 0; overflow: hidden; }
.nav-progress span { display: block; height: 100%; width: 0; background: var(--ember); transition: width .5s; }
.nav-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
.nav-stat span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.nav-stat strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nav-stat-main strong { font-size: 1.4rem; color: var(--forest); }

.me { position: relative; width: 64px; height: 64px; }
.me-dot { position: absolute; left: 22px; top: 22px; width: 20px; height: 20px; border-radius: 50%; background: #1f5fd1; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.45); }
.me-cone { display: none; position: absolute; inset: 0; transform-origin: 50% 50%; transition: transform .25s linear;
  background: conic-gradient(from -28deg at 50% 50%, rgba(31,95,209,.55) 0deg, rgba(31,95,209,0) 56deg, transparent 56deg);
  -webkit-mask: radial-gradient(circle, #000 0 31px, transparent 32px); mask: radial-gradient(circle, #000 0 31px, transparent 32px); border-radius: 50%; }

/* Écran de préparation */
.nav-intro { position: fixed; inset: 0; z-index: 2000; background: rgba(18,30,24,.6); display: flex; align-items: flex-end; justify-content: center; }
.nav-intro-card { width: 100%; max-width: 560px; max-height: 94vh; max-height: 94dvh; overflow-y: auto; background: #fff; border-radius: 22px 22px 0 0;
  padding: 22px 18px calc(18px + env(safe-area-inset-bottom, 0px)); }
.nav-intro-kicker { margin: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ember); font-weight: 700; }
.nav-intro h1 { font-size: 1.4rem; margin: 4px 0 2px; }
.nav-intro-stats { margin: 0 0 12px; color: var(--ink-2); }
.nav-intro-disclaimer { font-size: .92rem; background: var(--paper); border-radius: 12px; padding: 4px 14px; }
.nav-intro-tips { margin: 12px 0; padding-left: 1.2em; font-size: .88rem; color: #3b443f; }
.nav-intro-tips li { margin-bottom: 4px; }
.tip-warn { color: var(--danger); font-weight: 600; }
.nav-check { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--forest-2); font-weight: 700; cursor: pointer; }
.nav-check input { width: 22px; height: 22px; accent-color: var(--forest-2); flex: 0 0 auto; }
.nav-intro .btn-main:disabled { background: #c3c8c4; box-shadow: none; cursor: not-allowed; }
.nav-intro-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--danger-tint); color: #7d221c; font-size: .9rem; }
.nav-intro-back { display: block; text-align: center; margin-top: 14px; color: var(--ink-2); }

.em-position { margin-top: 16px; padding: 12px 14px; background: var(--paper); border-radius: 12px; }
.em-pos-label { margin: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.em-pos { margin: 4px 0 0; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; user-select: all; }
.sheet-small .end-body { padding-top: 18px; }
.sheet-small .end-body h2 { font-size: 1.2rem; }
.sheet-small .sheet-foot .btn-ghost { flex: 1; height: 50px; }

/* Fiche : bloc hors-ligne */
.offline-box { margin-top: 4px; padding: 14px; border-radius: 14px; background: #fff; border: 1.5px dashed #c9d6ce; }
.offline-box h3 { font-size: .98rem; margin-bottom: 4px; }
.offline-box p { margin: 0 0 10px; font-size: .88rem; color: var(--ink-2); }
.offline-box .btn-sec { width: 100%; }
.offline-ok { border-style: solid; border-color: var(--forest-2); background: var(--forest-tint); }
.offline-prog { height: 8px; border-radius: 99px; background: #e5e9e6; overflow: hidden; margin: 6px 0 4px; }
.offline-prog span { display: block; height: 100%; width: 0; background: var(--forest-2); transition: width .2s; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--danger); font: inherit; font-size: .88rem; text-decoration: underline; cursor: pointer; }
.chip-offline { background: var(--forest-2); color: #fff; }
.actions-row-1 { grid-template-columns: 1fr; }
a.btn-main { text-decoration: none; }

/* Visionneuse PDF */
body.page-pdf { background: #4a524d; }
.pdf-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; background: var(--forest); color: #fff; }
.pdf-close { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.14); }
.pdf-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pdf-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-kicker { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #bcd6c7; }
.pdf-zoom { display: flex; gap: 6px; }
.pdf-zoom button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; font-size: 1.4rem; cursor: pointer; }
.pdf-pages { padding: 12px 8px calc(60px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 10px; overflow-x: auto; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pdf-page { display: block; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); max-width: none; }
.pdf-status { color: #fff; margin-top: 30vh; text-align: center; padding: 0 16px; }
.pdf-pageinfo { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); margin: 0; padding: 6px 14px; border-radius: 99px; background: rgba(20,30,25,.8); color: #fff; font-size: .85rem; }
@media print { body.page-pdf * { display: none !important; } body.page-pdf::after { content: "L'impression de ce document n'est pas disponible."; display: block; } }

/* Points d'intérêt */
.actions-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.actions-row-3 .btn-sec { flex-direction: column; gap: 2px; height: 64px; font-size: .88rem; }
.poi-pin { width: 26px; height: 26px; border-radius: 50%; background: #0b6e8a; color: #fff; border: 2.5px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4); display: grid; place-items: center; font: 800 12px/1 var(--font); }
.poi-pin.is-near { background: var(--ember); transform: scale(1.2); }
.pois h2 { font-size: 1.2rem; margin-bottom: 10px; }
.poi-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.poi-card { display: flex; gap: 12px; background: #fff; border-radius: 14px; padding: 14px; }
.poi-badge { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #0b6e8a; color: #fff; font-weight: 800; cursor: pointer; }
.poi-body { min-width: 0; flex: 1; }
.poi-cat { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #0b6e8a; }
.poi-body h3 { font-size: 1.02rem; margin: 2px 0 4px; }
.poi-body h3 small { font-weight: 500; color: var(--ink-2); font-size: .82rem; }
.poi-more summary { cursor: pointer; color: var(--ink-2); font-size: .9rem; list-style: none; }
.poi-more summary::-webkit-details-marker { display: none; }
.poi-more:not([open]) summary::after { content: " Lire la suite"; color: var(--forest-2); font-weight: 700; }
.poi-more[open] summary { display: none; }
.poi-more p { margin: 0; font-size: .93rem; line-height: 1.55; }
.leaflet-popup-content .poi-pop-cat { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #0b6e8a; }
.leaflet-popup-content .poi-pop-text { margin: 4px 0 0; max-height: 40vh; overflow-y: auto; white-space: pre-line; }

/* Suivi : point d'intérêt proche */
.nav-poi { position: absolute; z-index: 1001; left: 12px; right: 12px; bottom: calc(176px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 0; border-radius: 14px; background: #0b6e8a; color: #fff; text-align: left; font: inherit; box-shadow: 0 6px 20px rgba(0,0,0,.3); animation: pop .2s ease-out; cursor: pointer; }
.nav-poi strong { display: block; }
.nav-poi span { font-size: .85rem; opacity: .9; }
.nav-poi .poi-pin { flex: 0 0 auto; }
