/* =========================================================
   Trail Agrégateur · feuille de style
   ========================================================= */

@font-face { font-family: "Inter"; src: url("fonts/inter-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ===== Thème ===== */
:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #f6f7f4;
  --surface-3: #eceee9;
  --text: #121a16;
  --text-2: #3d4842;
  --muted: #5f6a63;
  --border: #e3e6e0;
  --border-strong: #cfd4cc;
  --brand: #0d2a20;
  --primary: #15784b;
  --primary-hover: #106540;
  --primary-soft: #e4f3ea;
  /* Orange de marque : #f2612c reste pour la sélection sur la carte ; le bouton et le texte orange
     sont foncés pour un contraste d'au moins 4,5:1 (WCAG AA). */
  --cta: #c7471a;
  --cta-hover: #ad3c14;
  --cta-ink: #b8431a;
  --on-primary: #fff;
  --sel: #f2612c;
  --star: #f0a400;
  --danger: #c2412b;
  --ws-bg: #fff1d1; --ws-fg: #6b4700;
  --night-bg: #2a2d5c; --night-fg: #e8e9ff;
  --d1: #22a06b; --d2: #2f6fde; --d3: #8b5cf6; --d4: #e5484d;
  --shadow-sm: 0 1px 2px rgba(16, 24, 20, .06);
  --shadow: 0 1px 3px rgba(16, 24, 20, .06), 0 6px 20px rgba(16, 24, 20, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 20, .18);
  --radius: 14px;
  --radius-sm: 10px;
  --hdr-h: 64px;
  --stick: 160px; /* hauteur cumulée en-tête + barre de recherche (mise à jour en JS) */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", "Inter", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c110f;
    --surface: #141b17;
    --surface-2: #19211c;
    --surface-3: #212b25;
    --text: #e9eee9;
    --text-2: #c3ccc6;
    --muted: #8f9c94;
    --border: #26302a;
    --border-strong: #35413a;
    --primary: #3fbf7f;
    --primary-hover: #57cf92;
    --primary-soft: #18322a;
    --on-primary: #06170e;
    --cta-ink: #ff9a70;
    --danger: #f08a73;
    --ws-bg: #4a3712; --ws-fg: #ffdf9e;
    --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--stick) + 8px); }
body {
  margin: 0; min-height: 100dvh;
  font: 15px/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3, h4 { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 3000; background: var(--surface); padding: 8px 12px; border-radius: 8px; box-shadow: var(--shadow); }
.skip:focus { top: 12px; }

/* ===== Boutons ===== */
button { font: inherit; color: inherit; cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .92rem; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { border-color: var(--text-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .85rem; }
.btn.icon-only { width: 44px; padding: 0; }
.btn-cta { background: var(--cta); border-color: var(--cta); color: #fff; }
.btn-cta:hover { background: var(--cta-hover); border-color: var(--cta-hover); }
.link { background: none; border: 0; padding: 4px 0; font-weight: 600; color: var(--primary); }
.link.danger { color: var(--danger); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--cta); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; }
.danger-text { color: var(--danger) !important; }

/* ===== En-tête ===== */
.site-header {
  position: sticky; top: 0; z-index: 1200;
  height: var(--hdr-h);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.hdr { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; stroke: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; letter-spacing: .3px; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.brand-name span { color: var(--primary); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px;
  border: 0; background: none; color: var(--text-2); font-weight: 600; font-size: .92rem; text-decoration: none;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current="page"] { color: var(--text); }
.nav-link svg { width: 18px; height: 18px; }
#open-lists svg { color: var(--star); fill: var(--star); stroke: var(--star); }
.nav .add-race { margin-left: 8px; min-height: 40px; border-radius: 999px; }

/* ===== Bandeau d'accueil ===== */
.hero { position: relative; overflow: hidden; color: #fff; background: #0d2a20; isolation: isolate; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; stroke: none; }
.hero-inner { padding-top: 56px; padding-bottom: 84px; }
.eyebrow { margin: 0 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: #8fe0b5; }
.hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.3rem, 4.6vw, 3.9rem); line-height: .98; text-transform: uppercase; letter-spacing: .2px; max-width: 14ch; }
.hero-sub { margin: 14px 0 0; font-size: 1.05rem; color: rgba(255, 255, 255, .82); max-width: 56ch; }
.hero-sub b { color: #fff; font-weight: 700; }
.hero-sub a { color: #fff; font-weight: 600; text-underline-offset: 3px; white-space: nowrap; }
.hero-sub .linkish { font: inherit; color: #fff; font-weight: 600; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
body.list-view .hero { display: none; }

/* ===== Barre de recherche ===== */
.searchbar { position: sticky; top: var(--hdr-h); z-index: 1100; margin-top: -48px; pointer-events: none; }
.searchbar .wrap { pointer-events: none; }
.sb-card {
  pointer-events: auto;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 12px; display: grid; gap: 10px;
  transition: border-radius .2s, box-shadow .2s;
}
.searchbar.stuck .sb-card { box-shadow: 0 8px 24px rgba(16, 24, 20, .12); }
.sb-row { display: flex; gap: 8px; }
.search {
  position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius-sm); padding: 0 6px 0 14px; min-height: 50px;
}
.search.small { min-height: 46px; }
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search > svg { color: var(--muted); width: 20px; height: 20px; }
.search input { flex: 1; border: 0; background: transparent; outline: none; padding: 0; font-size: 16px; min-width: 0; min-height: 0; color: var(--text); box-shadow: none !important; }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { border: 0; background: var(--surface-2); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.search-clear svg { width: 16px; height: 16px; }
.sb-btn { min-height: 50px; }
.sb-btn svg { color: var(--primary); }
.sb-btn.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.sb-lbl { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

.suggest {
  position: absolute; z-index: 50; left: -1px; right: -1px; top: calc(100% + 6px);
  list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: min(60vh, 420px); overflow-y: auto;
}
.suggest li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--surface-2); }
.suggest .sg-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.suggest .sg-ic svg { width: 17px; height: 17px; }
.suggest .sg-txt { min-width: 0; display: grid; }
.suggest .sg-txt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .sg-txt small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .sg-head { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 8px 10px 4px; cursor: default; }
.suggest .sg-head:hover { background: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; align-items: center; margin: 0 -12px; padding: 0 12px; }
.chips::-webkit-scrollbar { display: none; }
.chips-sep { width: 1px; height: 22px; background: var(--border); flex: none; margin: 0 2px; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px;
  padding: 0 14px; min-height: 36px; font-size: .86rem; font-weight: 600; white-space: nowrap; color: var(--text-2);
}
.chip svg { width: 15px; height: 15px; }
.chip:hover { border-color: var(--text-2); color: var(--text); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--surface); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dc); flex: none; display: inline-block; }
.chip.active .dot { box-shadow: 0 0 0 2px var(--surface); }
body.list-view .searchbar { display: none; }

/* ===== Mise en page résultats + carte ===== */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 44%); gap: 24px; align-items: start;
  padding-top: 24px; padding-bottom: 40px;
}
body.list-view .layout { padding-top: 20px; }

.results { min-width: 0; outline: none; }
.results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.rh-count h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; line-height: 1.05; text-transform: uppercase; letter-spacing: .2px; }
#count { color: var(--primary); font-variant-numeric: tabular-nums; }
.rh-sub { display: block; color: var(--muted); font-size: .86rem; margin-top: 2px; }
.results-actions { display: flex; gap: 8px; align-items: center; }
.sort select { width: auto; min-height: 44px; font-size: .9rem; font-weight: 600; padding-right: 32px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 0 10px; min-height: 38px; display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; align-items: center; }
.token {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; min-height: 32px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); border: 0; font-size: .84rem; font-weight: 600;
}
.token svg { width: 14px; height: 14px; }
.token .tx { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.token:hover .tx { background: color-mix(in srgb, var(--primary) 18%, transparent); }
.clear-all { border: 0; background: none; color: var(--text-2); font-weight: 600; font-size: .84rem; text-decoration: underline; text-underline-offset: 3px; padding: 4px 6px; }

/* ===== Fiches course ===== */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ev {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px;
  padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ev:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.ev.hl { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ev.absent { opacity: .7; }
.ev-date {
  align-self: start; text-align: center; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
  padding: 8px 0 7px; line-height: 1; display: grid; gap: 3px;
}
.ev-date .wd { font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.ev-date .d { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--text); }
.ev-date .m { font-size: .72rem; font-weight: 700; color: var(--cta-ink); text-transform: uppercase; letter-spacing: .6px; }
.ev-date.approx { padding: 9px 0 10px; }
.ev-date.approx .d { font-size: 1.3rem; text-transform: uppercase; color: var(--text-2); padding-top: 2px; }
.ev-main { min-width: 0; }
.ev-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ev-name { font-size: 1.06rem; font-weight: 700; line-height: 1.3; letter-spacing: -.1px; overflow-wrap: anywhere; }
.ev-near { flex: none; font-size: .78rem; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.ev-meta { margin: 3px 0 0; color: var(--muted); font-size: .86rem; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.ev-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ev-meta svg { width: 14px; height: 14px; }
.ev-meta .warn { color: #a5600b; }
@media (prefers-color-scheme: dark) { .ev-meta .warn { color: #f2b05e; } }

.fmts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.fmt {
  display: grid; grid-template-columns: 76px 96px minmax(0, 1fr) auto; align-items: center; gap: 2px 10px;
  padding: 2px 4px 2px 12px; min-height: 42px; border-top: 1px solid var(--border);
}
.fmt:first-child { border-top: 0; }
.fmt .icon-btn { width: 34px; height: 34px; }
.f-km { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.f-km small, .f-dp small { font-weight: 500; color: var(--muted); font-size: .78rem; }
.f-dp { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-2); }
.f-dp.unknown { color: var(--muted); font-weight: 500; }
.f-info { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.f-label { color: var(--text-2); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.f-acts { display: flex; gap: 2px; }
.ev-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin-top: 10px; }
.ev-also { color: var(--muted); font-size: .8rem; }
.ev-links { display: flex; gap: 14px; flex-wrap: wrap; }
.ev-links a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: .86rem; text-decoration: none; }
.ev-links a:hover { text-decoration: underline; }
.ev-links a svg { width: 13px; height: 13px; }
.r-notes { font-size: .82rem; color: var(--text); margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--ws-bg); color: var(--ws-fg); }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-size: .72rem; font-weight: 700; white-space: nowrap; letter-spacing: .1px; }
.tag svg { width: 12px; height: 12px; }
.tag.ws { background: var(--ws-bg); color: var(--ws-fg); }
.tag.night { background: var(--night-bg); color: var(--night-fg); }
.tag.muted { background: var(--surface-3); color: var(--muted); font-weight: 600; }
.tag.mine { background: #fdeccc; color: #7a4a00; }
@media (prefers-color-scheme: dark) { .tag.mine { background: #4a3712; color: #ffdf9e; } }

.icon-btn {
  border: 0; background: none; width: 36px; height: 36px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.fav-btn.on { color: var(--star); }
.fav-btn.on svg { fill: var(--star); }
.fav-btn:hover { color: var(--star); }

.skel { min-height: 148px; cursor: default; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty > svg { width: 40px; height: 40px; color: var(--border-strong); }
.empty p { margin: 8px 0 0; }
#empty-title { color: var(--text); font-weight: 700; font-size: 1.05rem; }
.empty .btn { margin-top: 16px; }
.more-btn { display: flex; margin: 18px auto 0; min-width: 240px; }
#sentinel { height: 1px; }
.hint { color: var(--muted); font-size: .78rem; margin: 20px 0 0; max-width: 80ch; }

/* ===== Tableau ===== */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: clip; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .9rem; }
th, td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
th {
  position: sticky; top: var(--stick); z-index: 5;
  background: var(--surface-2); color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  cursor: pointer; user-select: none; white-space: nowrap;
}
th:hover { color: var(--text); }
th.sorted-asc::after { content: " ↑"; color: var(--primary); }
th.sorted-desc::after { content: " ↓"; color: var(--primary); }
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { cursor: pointer; transition: background .1s; }
tbody tr:hover { background: var(--surface-2); }
td.date { white-space: nowrap; }
.d-day { font-weight: 700; display: block; }
.d-sub { color: var(--muted); font-size: .8rem; }
.r-name { font-weight: 700; }
.r-sub { color: var(--muted); font-size: .82rem; }
.place { white-space: nowrap; }
.dim { color: var(--muted); }
td.links { white-space: nowrap; }
td.links a { font-weight: 600; text-decoration: none; margin-right: 10px; }
.r-name-row { display: flex; align-items: flex-start; gap: 4px; }
.r-name-row .fav-btn { margin: -6px 0 0 -8px; }
.dist { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.dist::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--dc, var(--d1)); }
tr.absent { opacity: .7; }
.edit-btn { border: 0; background: none; padding: 0; font-size: .84rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.edit-btn:hover { color: var(--primary); text-decoration: underline; }

/* Mode tableau : carte au-dessus, tableau pleine largeur */
body.table-mode .layout { grid-template-columns: minmax(0, 1fr); }
body.table-mode .map-pane { position: relative; top: 0; height: 440px; order: -1; }
body.table-mode .cards { display: none; }

/* ===== Carte ===== */
.map-pane {
  position: sticky; top: calc(var(--stick) + 16px);
  height: calc(100dvh - var(--stick) - 32px); min-height: 420px;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border);
  background: #dfe5df;
}
#map { position: absolute; inset: 0; background: #e7ebe5; }
@media (prefers-color-scheme: dark) { #map { background: #1b221e; } }
.map-tools {
  position: absolute; z-index: 800; top: 12px; left: 56px; right: 64px;
  display: flex; flex-wrap: wrap; gap: 8px; pointer-events: none;
}
.map-tools > * { pointer-events: auto; }
.map-tools .seg { background: var(--surface); box-shadow: var(--shadow-lg); align-items: center; }
.map-tools .seg button { min-height: 34px; font-size: .82rem; padding: 0 10px; }
.map-tools .seg button svg { width: 16px; height: 16px; }
.map-tools .seg button.active { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.seg-lbl { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 0 4px 0 8px; }
.freehand-active #draw-free, .drawing-active .seg button.drawing, .radius-pick #draw-radius { background: var(--sel) !important; color: #fff !important; }
.map-side { position: absolute; z-index: 800; top: 12px; right: 12px; display: grid; gap: 8px; justify-items: end; }
.map-btn { width: 40px; height: 40px; border: 0; border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-lg); display: grid; place-items: center; color: var(--text); }
.map-btn:hover { color: var(--primary); }
.basemap-menu { background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 4px; display: grid; min-width: 130px; }
.basemap-menu button { border: 0; background: none; text-align: left; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: .88rem; }
.basemap-menu button:hover { background: var(--surface-2); }
.basemap-menu button[aria-checked="true"] { color: var(--primary); }
.basemap-menu button[aria-checked="true"]::after { content: " ✓"; }

.map-zone-btn { display: none; }
.search-here {
  position: absolute; z-index: 820; top: 60px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 0 16px; min-height: 40px;
  background: var(--text); color: var(--surface); font-weight: 600; font-size: .88rem; box-shadow: var(--shadow-lg); white-space: nowrap;
  animation: pop .18s ease-out;
}
.search-here svg { width: 16px; height: 16px; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -6px); } }
.draw-hint {
  position: absolute; z-index: 830; left: 12px; right: 12px; bottom: 56px; margin: 0 auto; max-width: 460px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--text); color: var(--surface); border-radius: var(--radius-sm); padding: 10px 10px 10px 16px; box-shadow: var(--shadow-lg);
  font-size: .9rem; font-weight: 500;
}

.legend {
  position: absolute; z-index: 800; left: 12px; bottom: 24px;
  display: flex; gap: 10px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px);
  padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow);
  font-size: .74rem; font-weight: 600; color: var(--text-2);
}
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.map-status {
  position: absolute; z-index: 800; left: 12px; right: 12px; bottom: 60px; margin: 0 auto; width: fit-content; max-width: min(440px, calc(100% - 24px));
  display: grid; gap: 2px;
  background: var(--surface); border-radius: 14px; padding: 6px 8px 6px 14px; box-shadow: var(--shadow-lg); font-size: .85rem; font-weight: 600;
}
.ms-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.ms-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-row span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--sel); margin-right: 8px; vertical-align: -1px; }
.ms-radius { display: flex; align-items: center; gap: 10px; padding: 0 6px 4px 0; min-width: 260px; }
.ms-radius input { flex: 1; }
.ms-radius output { color: var(--primary); font-weight: 700; min-width: 52px; text-align: right; }
.map-status .link { padding: 4px 8px; }

.leaflet-container { font-family: var(--font); }
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow-lg) !important; border-radius: var(--radius-sm) !important; overflow: hidden; }
.leaflet-bar a { width: 40px !important; height: 40px !important; line-height: 40px !important; color: var(--text) !important; background: var(--surface) !important; border-color: var(--border) !important; }
.leaflet-touch .leaflet-control-zoom { margin: 12px 0 0 12px; }
.leaflet-control-attribution { font-size: 10px; background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--text-2); }
/* Pas de contour au clic, mais un anneau bien visible au clavier sur les marqueurs et la carte */
.leaflet-interactive:focus:not(:focus-visible) { outline: none; }
.leaflet-marker-icon:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 50%; }
path.leaflet-interactive:focus-visible { outline: none; stroke: var(--primary); stroke-width: 4; }
.freehand-active #map, .radius-pick #map { cursor: crosshair; }
#map:focus:not(:focus-visible) { outline: none; }
#map:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }

.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: var(--shadow-lg); padding: 0; }
.leaflet-popup-content { margin: 14px 16px; font: 14px/1.45 var(--font); min-width: 230px; }
.leaflet-popup { --surface-2: #f3f5f1; --surface-3: #e9ece6; --text: #121a16; --text-2: #3d4842; --muted: #5f6a63; --primary: #15784b; --primary-soft: #e4f3ea; --ws-bg: #fff1d1; --ws-fg: #6b4700; color: #121a16; }
.leaflet-popup a { color: #15784b; }
.leaflet-popup-close-button { top: 6px !important; right: 6px !important; }
.pop-date { font-size: .74rem; font-weight: 700; color: var(--cta); text-transform: uppercase; letter-spacing: .5px; }
.pop-title { font-weight: 700; font-size: 1.02rem; line-height: 1.3; margin: 2px 18px 2px 0; }
.pop-sub { color: var(--muted); font-size: .84rem; margin-bottom: 8px; }
.pop .fmts { margin-top: 6px; }
.pop .fmt { grid-template-columns: auto auto minmax(0, 1fr) auto; padding: 3px 4px 3px 10px; gap: 2px 10px; font-size: .86rem; }
.pop .icon-btn { width: 32px; height: 32px; }
.pop .ev-links { margin-top: 8px; }

/* Points et groupes de points */
.cluster { background: none; }
.cluster div {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  background: #15784b; color: #fff; font-weight: 700; font-size: .8rem; font-family: var(--font); border: 2px solid #fff;
  box-shadow: 0 0 0 4px rgba(21, 120, 75, .28), 0 2px 8px rgba(0,0,0,.25);
}
.cluster.c-md div { font-size: .84rem; box-shadow: 0 0 0 5px rgba(21, 120, 75, .25), 0 2px 8px rgba(0,0,0,.25); }
.cluster.c-lg div { background: #0f5c3a; font-size: .88rem; box-shadow: 0 0 0 6px rgba(15, 92, 58, .25), 0 2px 8px rgba(0,0,0,.3); }
.radius-center-pin { background: none; }
.radius-center-pin div { width: 22px; height: 22px; border-radius: 50%; background: var(--sel); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }

/* ===== Bouton liste / carte (mobile) ===== */
.fab {
  display: none;
  position: fixed; z-index: 1150; left: 50%; transform: translateX(-50%); bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
  border: 0; border-radius: 999px; padding: 0 22px; min-height: 50px; align-items: center; gap: 8px;
  background: var(--text); color: var(--surface); font-weight: 700; font-size: .95rem; box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.fab span { display: inline-flex; align-items: center; gap: 8px; }
.fab .fab-list { display: none; }
body.map-mode .fab .fab-map { display: none; }
body.map-mode .fab .fab-list { display: inline-flex; }

/* ===== Bandeau de liste (favoris) ===== */
.list-banner {
  margin-bottom: 18px; padding: 16px 18px 18px; border-radius: var(--radius);
  background: var(--brand); color: #fff; box-shadow: var(--shadow);
  display: grid; gap: 12px;
}
.back-btn {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: rgba(255,255,255,.12);
  color: #fff; font-weight: 600; font-size: .9rem; padding: 0 14px 0 10px; min-height: 40px; border-radius: 999px;
}
.back-btn:hover { background: rgba(255,255,255,.2); }
.lb-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.lb-main { display: grid; min-width: 0; }
.lb-kicker { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #8fe0b5; }
.lb-main h1 { font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1.05; text-transform: uppercase; overflow-wrap: anywhere; }
.lb-note { font-size: .86rem; color: rgba(255,255,255,.75); }
.lb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lb-actions .btn { min-height: 40px; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.lb-actions .btn:hover { background: rgba(255,255,255,.2); }
.lb-actions .btn.primary { background: var(--cta); border-color: var(--cta); }
.lb-actions .btn.danger { color: #ffb4a3; }
body.list-view .results-head .rh-count { display: none; }
body.list-view .map-tools, body.list-view .map-zone-btn, body.list-view .search-here { display: none !important; }
body.list-view #nav-home { color: var(--muted); }
body.list-view #nav-home[aria-current] { color: var(--text-2); }

/* ===== Panneaux (filtres, zone) ===== */
.scrim { position: fixed; inset: 0; z-index: 1300; background: rgba(8, 14, 11, .45); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.panel:focus { outline: none; }
.panel {
  position: fixed; z-index: 1310; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: slide-in .22s ease-out;
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel-head h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; text-transform: uppercase; letter-spacing: .2px; }
.panel-body { flex: 1; overflow-y: auto; padding: 4px 20px 20px; overscroll-behavior: contain; }
.panel-foot { display: flex; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.panel-foot .btn { flex: 1; }
.fsec { padding: 18px 0; border-bottom: 1px solid var(--border); display: grid; gap: 12px; }
.fsec:last-child { border-bottom: 0; }
.fsec h4 { font-size: .95rem; font-weight: 700; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.frow.tight { display: flex; flex-wrap: wrap; gap: 8px; }
.frow.tight .btn { flex: 1 1 auto; min-height: 42px; }
.frow label, .fsec > label:not(.switch) { display: grid; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); min-width: 0; }
input, select {
  font: inherit; font-size: 16px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); min-width: 0; width: 100%;
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b766f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 34px; }
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .92rem; font-weight: 500; color: var(--text); min-height: 40px; cursor: pointer; }
.switch span { order: -1; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; flex: none; cursor: pointer; border: 0; padding: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }

.month-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.month-grid button, .opt {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius-sm);
  min-height: 44px; padding: 6px 8px; font-weight: 600; font-size: .85rem; color: var(--text-2); line-height: 1.15;
}
.month-grid button small { display: block; font-size: .68rem; font-weight: 500; color: var(--muted); }
.month-grid button:hover, .opt:hover { border-color: var(--text-2); }
.month-grid button.active, .opt.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.month-grid button.active small, .opt.active small { color: var(--primary); }
.opt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opt-grid.two { grid-template-columns: 1fr 1fr; }
.opt { text-align: left; padding: 10px 12px; display: grid; gap: 2px; }
.opt b { font-size: .9rem; color: inherit; }
.opt small { font-size: .74rem; font-weight: 500; color: var(--muted); }

.radius-box { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.radius-head { display: flex; justify-content: space-between; font-weight: 600; font-size: .9rem; }
.radius-head output { color: var(--primary); font-weight: 700; }
input[type="range"] { -webkit-appearance: none; appearance: none; padding: 0; min-height: 28px; border: 0; background: transparent; box-shadow: none !important; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: var(--border-strong); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--border-strong); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); margin-top: -10px; }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.radius-presets { display: flex; gap: 6px; }
.radius-presets button { flex: 1; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; min-height: 34px; font-size: .8rem; font-weight: 600; }
.radius-presets button.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.radius-center { margin: 0; font-size: .84rem; color: var(--muted); }
.rmode { display: flex; }
.rmode button { flex: 1; justify-content: center; }
.route-note { margin: 0; font-size: .76rem; color: var(--muted); }
.radius-center b { color: var(--text); }
.zone-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.zone-tags:empty { display: none; }

/* ===== Dialogues ===== */
.dlg {
  border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--text);
  width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-shadow: var(--shadow-lg);
}
.dlg-wide { width: min(640px, calc(100vw - 32px)); }
.fi-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.fi-back svg { width: 16px; height: 16px; }
.fi-body { display: grid; gap: 14px; }
.fi-sec { display: grid; gap: 8px; border-top: 1px solid var(--border); padding-top: 14px; }
.fi-sec h4 { margin: 0; font-size: 1rem; }
.fi-sec p { margin: 0; font-size: .9rem; line-height: 1.5; }
.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.hist li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .88rem; }
.hist-chg { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--ws-bg); color: var(--ws-fg); }
.pratique { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pratique li { display: grid; grid-template-columns: 7.5em 1fr; align-items: baseline; gap: 12px; font-size: .9rem; }
.pratique .pr-l { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pratique a { font-weight: 600; text-decoration: none; }
.pratique a:hover { text-decoration: underline; }
.insc { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 600; font-size: .85rem; background: var(--surface-2); }
.insc-ouvertes { background: var(--primary-soft); color: var(--primary); }
.insc-complet, .insc-fermees { color: var(--muted); }
.nw { white-space: nowrap; }
.fi-fmts { display: flex; flex-wrap: wrap; gap: 6px; }
.fi-fmts button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; min-height: 32px; padding: 0 12px; font-size: .8rem; font-weight: 600; }
.fi-fmts button.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.sims { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sim { width: 100%; text-align: left; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.sim:hover { border-color: var(--primary); }
.sim-date { font-size: .74rem; font-weight: 700; color: var(--primary); text-transform: capitalize; }
.sim-name { font-weight: 700; }
.sim-meta { font-size: .84rem; color: var(--muted); }
.sim-meta b { color: var(--text); }
.sim-why { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.est { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.est li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .9rem; }
.est b { color: var(--primary); white-space: nowrap; }
.chrono-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }
.chrono-form label { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; }
.chrono-form label[hidden] { display: none; }
.chrono-form .btn, .chrono-form .dlg-note { grid-column: 1 / -1; }
.fiche-btn { font-size: .86rem; }
.dlg::backdrop { background: rgba(8, 14, 11, .5); }
.dlg-inner { margin: 0; padding: 20px; display: grid; gap: 14px; }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dlg-head h3 { font-size: 1.2rem; line-height: 1.3; overflow-wrap: anywhere; }
.dlg-kicker { margin: 0 0 2px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--primary); }
.dlg-sub { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.dlg-note { margin: 0; color: var(--muted); font-size: .8rem; }
.dlg-x { border: 0; background: var(--surface-2); border-radius: 50%; width: 36px; height: 36px; flex: none; color: var(--muted); display: grid; place-items: center; }
.dlg-x:hover { color: var(--text); background: var(--surface-3); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.check-list, .lists-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 45vh; overflow-y: auto; }
.check-list label {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 48px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.check-list label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.check-list span { flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.check-list small { color: var(--muted); white-space: nowrap; }
.new-list { display: flex; gap: 8px; }
/* Sauvegarde des listes dans un fichier (dialogue « Mes listes ») */
.backup { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.backup h4 { margin: 0; font-size: .95rem; }
.backup-status { margin: 0; font-size: .88rem; color: var(--muted); }
.backup-status.warn { background: var(--ws-bg); color: var(--ws-fg); padding: 6px 10px; border-radius: var(--radius-sm); }
.backup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.backup-actions .btn { flex: 1 1 auto; }
.backup-actions svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.new-list input { flex: 1; }

.lists-list li { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.ll-open { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 10px 14px; display: grid; gap: 1px; }
.ll-open:hover { background: var(--surface-2); }
.ll-name { font-weight: 700; overflow-wrap: anywhere; }
.ll-meta { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ll-actions { display: flex; align-items: center; padding-right: 4px; }

.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.edit-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); font-weight: 600; min-width: 0; }
.edit-grid label.wide { grid-column: 1 / -1; }
.edit-grid label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 500; font-size: .9rem; align-self: end; min-height: 44px; }
.edit-grid small { font-weight: 500; font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-grid input:invalid { border-color: var(--danger); }

.toast {
  position: fixed; z-index: 2000; left: 50%; bottom: max(84px, calc(env(safe-area-inset-bottom) + 76px)); transform: translateX(-50%);
  background: var(--text); color: var(--surface); padding: 12px 18px; border-radius: 16px; text-align: center; line-height: 1.35; font-size: .9rem; font-weight: 600;
  box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px);
}

/* ===== Pied de page ===== */
.site-footer { background: var(--brand); color: rgba(255,255,255,.72); margin-top: 24px; }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-top: 44px; padding-bottom: 28px; }
.foot .brand { color: #fff; }
.foot .brand-name span { color: #5fd69a; }
.foot-brand p { margin: 14px 0 0; max-width: 46ch; font-size: .9rem; }
.foot-col { display: grid; gap: 8px; align-content: start; font-size: .9rem; }
.foot-col h2 { color: #fff; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.foot-col a { color: rgba(255,255,255,.85); text-decoration: none; }
.foot-col a:hover { color: #fff; text-decoration: underline; }
/* Liens au milieu d'une phrase (attributions) : soulignés pour se distinguer du texte. */
.foot-col span a { text-decoration: underline; text-underline-offset: 2px; }
.foot-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); font-size: .8rem; }

/* ===== Responsive ===== */
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr) minmax(340px, 42%); gap: 18px; }
  .map-tools .lbl { display: none; }
  .seg-lbl { display: none; }
}

/* Tablette et mobile : liste OU carte, bascule par bouton flottant */
@media (max-width: 1023px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 18px; padding-bottom: 96px; }
  .fab { display: inline-flex; }
  .map-pane { display: none; }
  body.map-mode { overflow: hidden; }
  body.map-mode .map-pane {
    display: block; position: fixed; z-index: 1000; inset: var(--hdr-h) 0 0 0; top: var(--hdr-h); height: auto; min-height: 0;
    border-radius: 0; border: 0;
  }
  body.map-mode .searchbar, body.map-mode .site-footer { visibility: hidden; }
  .view-seg [data-mode="table"] { display: none; }
  body.table-mode .cards { display: grid; }
  body.table-mode .table-wrap { display: none; }
  .map-tools { display: none; }
  .map-zone-btn {
    position: absolute; z-index: 820; top: 12px; left: 64px; right: 64px; margin: 0 auto; max-width: 360px;
    display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; min-height: 44px; padding: 0 16px;
    border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; font-size: .92rem; box-shadow: var(--shadow-lg);
  }
  .map-zone-btn svg { color: var(--sel); }
  .map-zone-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .search-here { top: 66px; }
  .legend { bottom: 92px; }
  .map-status { bottom: 132px; }
  .draw-hint { bottom: 92px; }
  .foot { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  :root { --hdr-h: 56px; --radius: 14px; }
  .wrap { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .brand-mark { width: 30px; height: 30px; }
  .brand-name { font-size: 1.25rem; }
  .nav .add-race, #nav-home { display: none; }
  .nav-compte .nl-txt { display: none; } /* compte : icône seule sur téléphone */
  .nav-link { padding: 0 12px; background: var(--surface-2); }
  .hero-inner { padding-top: 26px; padding-bottom: 66px; }
  .eyebrow { font-size: .7rem; margin-bottom: 6px; }
  .hero h1 { font-size: 2.15rem; }
  .hero-sub { font-size: .92rem; margin-top: 8px; }
  .searchbar { margin-top: -44px; }
  .searchbar .wrap { padding-left: 8px; padding-right: 8px; }
  .sb-card { padding: 10px; gap: 8px; border-radius: var(--radius); }
  .searchbar.stuck .wrap { padding: 0; }
  .searchbar.stuck .sb-card { border-radius: 0 0 var(--radius) var(--radius); }
  .search { min-height: 46px; padding-left: 12px; }
  .sb-btn { min-height: 46px; padding: 0 12px; }
  /* Libellé masqué à l'écran mais lu par les lecteurs d'écran */
  .sb-btn .sb-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .chips { margin: 0 -10px; padding: 0 10px; }
  .chip { min-height: 34px; padding: 0 12px; }
  .rh-count h2 { font-size: 1.45rem; }
  .results-head { align-items: center; }
  .sort select { max-width: 170px; min-height: 40px; font-size: .84rem; }
  #export { display: none; }
  .ev { grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .ev-date { padding: 6px 0 5px; }
  .ev-date .d { font-size: 1.55rem; }
  .ev-name { font-size: 1rem; }
  .ev-meta .when { display: none; }
  .fmt { grid-template-columns: 68px minmax(0, 1fr) auto; gap: 0 8px; padding: 2px 2px 2px 10px; font-size: .9rem; }
  .fmt .f-dp { grid-column: 2; grid-row: 1; }
  .fmt .f-acts { grid-column: 3; grid-row: 1; }
  .fmt .f-info { grid-column: 1 / -1; grid-row: 2; padding-bottom: 6px; }
  .f-info:empty { display: none; }
  .fmt .icon-btn { width: 40px; height: 40px; }
  .list-banner { padding: 12px 14px 14px; }
  .lb-main h1 { font-size: 1.6rem; }
  .lb-actions { width: 100%; }
  .lb-actions .btn { flex: 1 1 auto; }
  .panel {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 90dvh;
    border-radius: 20px 20px 0 0; animation: sheet-up .24s ease-out;
  }
  .panel-head { padding: 14px 16px 12px; position: relative; }
  .panel-head::before { content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); }
  .panel-head h3 { font-size: 1.35rem; }
  .panel-body { padding: 0 16px 16px; }
  .panel-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .opt-grid { grid-template-columns: 1fr; }
  .opt-grid.two { grid-template-columns: 1fr 1fr; }
  .dlg { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 90dvh; }
  .dlg-inner { padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
  .edit-grid { grid-template-columns: 1fr; }
  .dlg-foot .btn { flex: 1 1 auto; }
  .foot { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
  .site-footer { padding-bottom: 70px; }
}
@media (max-width: 380px) {
  .brand-name { font-size: 1.15rem; }
  .nl-txt { display: none; }
}
@keyframes sheet-up { from { transform: translateY(60px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== Disponibilités (bêta) ===== */
:root { --dispo-ok: #2e9d5b; --dispo-unsure: #e8912a; --dispo-busy: #d2412f; }
.dispo-dot {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: var(--dot, var(--muted)); color: #fff; font: normal 800 10px/1 system-ui, sans-serif;
  vertical-align: middle; letter-spacing: 0; text-transform: none;
}
.dispo-dot::before { content: var(--glyph); }
.dispo-dot.ok { --dot: var(--dispo-ok); --glyph: "✓"; }
.dispo-dot.unsure { --dot: var(--dispo-unsure); --glyph: "?"; }
.dispo-dot.busy { --dot: var(--dispo-busy); --glyph: "✕"; }
td.date .dispo-dot { float: left; margin: 1px 8px 0 0; }
tr:has(.dispo-dot.busy) td:first-child { box-shadow: inset 3px 0 0 var(--dispo-busy); }
.ev.dispo-busy { box-shadow: inset 4px 0 0 var(--dispo-busy), var(--shadow-sm); }
.ev-date .dispo-dot { display: grid; margin: 4px auto 0; }
.pop-date .dispo-dot { margin: -2px 6px 0 0; }
.chip.dispo { display: inline-flex; align-items: center; gap: 6px; }

.dot-trio { width: 22px; height: 8px; flex: none; background:
  radial-gradient(circle 4px at 4px 4px, var(--dispo-ok) 98%, transparent),
  radial-gradient(circle 4px at 11px 4px, var(--dispo-unsure) 98%, transparent),
  radial-gradient(circle 4px at 18px 4px, var(--dispo-busy) 98%, transparent); }
.dispo-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.dispo-legend li { display: flex; align-items: center; gap: 8px; }
.dispo-bar {
  display: grid; gap: 8px; margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--dispo-ok); font-size: .9rem;
}
.dispo-bar p { margin: 0; }
.dispo-bar-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .84rem; }
.dispo-bar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dispo-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dispo-bar-actions .btn { min-height: 34px; font-size: .85rem; }

/* Couverture par région (dialogue de l'accueil) */
.couv { list-style: none; margin: 0; padding: 0; display: grid; }
.couv li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 12px; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: .9rem; }
.couv-n { font-variant-numeric: tabular-nums; font-weight: 700; }
.couv-barre { grid-column: 1 / -1; display: block; height: 6px; width: var(--p); min-width: 3px; border-radius: 3px; background: var(--primary); opacity: .7; }
#couv-table { max-height: 50vh; overflow: auto; }

/* ---------- Vue calendrier (site/calendrier.js) ---------- */
body.cal-mode #cards { display: none; }
.cal-wrap { display: grid; gap: 22px; }
.cal-mois h3 { font-size: 1.05rem; margin: 0 0 8px; text-transform: capitalize; }
.cal-mois h3 .dim { font-size: .85rem; font-weight: 500; text-transform: none; margin-left: 6px; }
table.cal { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 3px; }
table.cal th { font-size: .72rem; font-weight: 600; color: var(--muted); text-align: left; padding: 0 4px 2px; }
table.cal td { vertical-align: top; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 3px; height: 64px; }
table.cal td.vide { background: transparent; border-color: transparent; }
table.cal td.we { background: var(--surface-2); }
table.cal td.we-ok { box-shadow: inset 0 0 0 2px var(--primary-soft); }
table.cal td.we-busy { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface-3) 6px 12px); }
table.cal td.auj .cal-num span { background: var(--primary); color: var(--on-primary); border-radius: 999px; padding: 0 6px; }
.cal-num { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none; padding: 1px 3px; font: inherit; font-size: .78rem; color: var(--text-2); cursor: pointer; border-radius: 6px; }
.cal-num:disabled { cursor: default; }
.cal-num.sel { background: var(--primary-soft); }
.cal-n { display: none; min-width: 1.5em; text-align: center; font-size: .72rem; background: var(--primary); color: var(--on-primary); border-radius: 999px; padding: 0 5px; }
.cal-evs { display: grid; gap: 2px; margin-top: 2px; }
.cal-ev { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--c); background: var(--surface-2); color: var(--text); font: inherit; font-size: .72rem; line-height: 1.25; padding: 2px 4px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-ev:hover { background: var(--primary-soft); }
.cal-plus { border: 0; background: none; color: var(--primary); font: inherit; font-size: .72rem; font-weight: 600; text-align: left; padding: 0 4px; cursor: pointer; }
.cal-flous { margin: 8px 0 0; font-size: .85rem; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.cal-flous .cal-ev { width: auto; max-width: 100%; }
.cal-jour { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.cal-jour h4 { margin: 0 0 6px; font-size: .92rem; }
.cal-jour ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cal-jour li { font-size: .88rem; }
.cal-legende { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .82rem; color: var(--muted); }
.cal-legende span { display: inline-flex; align-items: center; gap: 6px; }
.cal-we { display: inline-block; width: 16px; height: 12px; border-radius: 3px; border: 1px solid var(--border); background: var(--surface-2); }
.cal-we.we-ok { box-shadow: inset 0 0 0 2px var(--primary-soft); }
.cal-we.we-busy { background: repeating-linear-gradient(135deg, var(--surface-2) 0 3px, var(--surface-3) 3px 6px); }
.cal-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }
@media (max-width: 760px) {
  table.cal td { height: 46px; }
  .cal-evs { display: none; }
  .cal-n { display: inline-block; }
  .cal-num { flex-direction: column; align-items: flex-start; gap: 2px; height: 100%; }
}

/* ---------- Comparateur (site/comparateur.js) ---------- */
.cmp-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.cmp-btn.on { color: var(--primary); background: var(--primary-soft); }
.cmp-bar { position: fixed; z-index: 1140; right: 24px; bottom: 24px; display: flex; gap: 8px; padding: 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.cmp-bar[hidden] { display: none; }
.cmp-bar .btn { min-height: 40px; }
.cmp-wrap { overflow-x: auto; }
table.cmp { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.cmp th, table.cmp td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.cmp th { position: static; top: auto; z-index: auto; background: none; text-transform: none; letter-spacing: normal; font-size: .9rem; cursor: default; color: var(--text); white-space: normal; user-select: auto; }
table.cmp thead th { position: relative; padding-right: 26px; min-width: 120px; vertical-align: bottom; }
table.cmp tbody tr { cursor: default; }
table.cmp tbody th { min-width: 0; }
@media (max-width: 700px) { table.cmp thead th { min-width: 140px; } table.cmp tbody th { position: sticky; left: 0; background: var(--surface); z-index: 1; white-space: normal; min-width: 96px; } }
table.cmp thead th .link { font-weight: 700; text-align: left; }
table.cmp thead th .dim { display: block; font-size: .8rem; font-weight: 500; }
table.cmp tbody th { font-weight: 600; color: var(--text-2); width: 9.5em; }
table.cmp td { font-variant-numeric: tabular-nums; }
.cmp-x { position: absolute; top: 6px; right: 2px; border: 0; background: none; font-size: 1.1rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.cmp-x:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 1023px) {
  .cmp-bar { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(max(20px, calc(env(safe-area-inset-bottom) + 12px)) + 60px); }
  body.map-mode .cmp-bar { display: none; }
}

/* ---------- Planificateur de saison (site/saison.js) ---------- */
.lb-actions .btn.on { background: #fff; color: var(--brand); border-color: #fff; }
#saison { margin: 0 0 18px; }
.saison { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 14px); padding: 14px 16px; }
.sz-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.sz-head h2 { margin: 0; font-size: 1.05rem; }
.sz-head label { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--text-2); }
.sz-head select { font: inherit; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.sz-resume { margin: 8px 0 12px; font-size: .9rem; }
.sz-liste { list-style: none; margin: 0; padding: 0; }
.sz-course { display: grid; grid-template-columns: 6.6em 1fr auto; gap: 4px 12px; align-items: baseline; padding: 8px 0; }
.sz-course.obj { background: var(--primary-soft); border-radius: 10px; padding: 8px 10px; margin: 0 -10px; }
.sz-date { font-size: .85rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sz-nom .link { font-weight: 700; text-align: left; }
.sz-nom .dim { font-size: .84rem; margin-left: 4px; }
.sz-obj { background: var(--primary); color: var(--on-primary); }
.sz-set { min-height: 32px; font-size: .8rem; padding: 0 10px; }
.sz-gap { margin-left: 3.2em; padding: 2px 0 2px 14px; border-left: 2px dashed var(--border-strong); font-size: .8rem; color: var(--muted); }
.sz-gap.alerte { border-left-color: var(--danger); color: var(--danger); font-weight: 600; }
@media (max-width: 560px) { .sz-course { grid-template-columns: 1fr auto; } .sz-date { grid-column: 1 / -1; } .sz-gap { margin-left: 1em; } }

/* ---------- Sortie à plusieurs (site/groupe.js) ---------- */
#groupe { margin: 0 0 18px; }
.groupe { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 14px); padding: 14px 16px; }
.gp-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin: 10px 0 6px; }
.gp-form label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--text-2); }
.gp-form input, .gp-form select { font: inherit; font-size: .9rem; min-height: 36px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.gp-form input[name=nom] { width: 9em; }
.gp-form input[name=dossard] { width: 7em; }
.gp-form select { max-width: 18em; }
.gp-form .btn { min-height: 36px; }
.gp-liste { list-style: none; margin: 8px 0 0; padding: 0; }
.gp-format { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.gp-nom { font-weight: 700; font-size: .92rem; }
.gp-nom .dim { font-weight: 400; font-size: .82rem; }
.gp-qui { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gp-puce { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-soft); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: .84rem; font-weight: 600; }
.gp-puce:not(:has(.gp-x)) { padding-right: 10px; }
.gp-dos { font-weight: 400; color: var(--text-2); font-variant-numeric: tabular-nums; }
.gp-x { border: 0; background: none; color: var(--muted); font-size: 1rem; line-height: 1; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; }
.gp-x:hover { background: var(--surface); color: var(--danger); }
.gp-format.vide .gp-nom { color: var(--text-2); }
@media (max-width: 560px) {
  .gp-format { grid-template-columns: 1fr; }
  .gp-form label { flex: 1 1 40%; }
  .gp-form input[name=nom], .gp-form input[name=dossard], .gp-form select { width: 100%; max-width: none; }
  .gp-form label:has(select) { flex-basis: 100%; }
}

/* ----- Réglage « Mes semaines » : calendrier à toucher ----- */
#dlg-dispo .dlg-inner { gap: 16px; }
.dc-tag { display: inline-block; padding: 0 7px; border-radius: 999px; font-weight: 700; color: #fff; }
.dc-tag.free { background: var(--dispo-ok); }
.dc-tag.busy { background: var(--dispo-busy); }
.dc-rythme, .dc-cal { display: grid; gap: 10px; }
.dc-rythme h4 { margin: 0; font-size: .82rem; color: var(--muted); font-weight: 600; }
.dc-rythme .seg { flex-wrap: wrap; width: fit-content; max-width: 100%; }
.dc-phase { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: .88rem; color: var(--text-2); }
.dc-phase-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.dc-pick { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 0 12px; min-height: 36px; font: inherit; font-size: .84rem; font-weight: 600; color: var(--text-2); cursor: pointer; }
.dc-pick.active { background: var(--dispo-busy); border-color: var(--dispo-busy); color: #fff; }
.dc-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dc-nav h4 { margin: 0; font-size: 1.1rem; text-transform: capitalize; font-family: var(--font-display); letter-spacing: .3px; }
.dc-nav .dlg-x { font-size: 1.4rem; line-height: 1; color: var(--text); }
.dc-nav .dlg-x:disabled { opacity: .35; cursor: default; }
.dc-grid { touch-action: pan-y; }
.dc-head, .dc-row { display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: 8px; align-items: center; }
.dc-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: center; }
.dc-head { font-size: .72rem; font-weight: 600; color: var(--muted); text-align: center; padding: 0 12px 4px; }
.dc-head > span:last-child { color: var(--text-2); }
.dc-head .we { color: var(--text-2); }
.dc-rows { display: grid; gap: 6px; }
.dc-row {
  --st: var(--dispo-ok); width: 100%; min-height: 52px; padding: 4px 6px 4px 12px; border-radius: 14px;
  border: 2px solid var(--st); background: color-mix(in srgb, var(--st) 12%, var(--surface)); color: var(--text);
  font: inherit; text-align: left; cursor: pointer; transition: transform .12s, background .2s, border-color .2s;
}
.dc-row.busy { --st: var(--dispo-busy); background: var(--dispo-busy); color: #fff; }
.dc-row:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.dc-row:active:not(:disabled) { transform: scale(.98); }
.dc-row:disabled { cursor: default; opacity: .45; }
.dc-day { text-align: center; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.dc-day.we { font-weight: 700; }
.dc-day.out { opacity: .4; }
.dc-day.auj { text-decoration: underline 2px; text-underline-offset: 4px; }
.dc-st { display: grid; gap: 1px; justify-items: start; padding: 4px 8px; border-radius: 10px; background: color-mix(in srgb, var(--st) 18%, var(--surface)); color: var(--text); }
.dc-row.busy .dc-st { background: rgba(255, 255, 255, .18); color: #fff; }
.dc-st-l { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.dc-ico { width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center; font: normal 800 10px/1 system-ui, sans-serif; background: var(--st); color: #fff; }
.dc-row.free .dc-ico::before { content: "✓"; }
.dc-row.busy .dc-ico { background: #fff; color: var(--dispo-busy); }
.dc-row.busy .dc-ico::before { content: "✕"; }
.dc-n { font-size: .72rem; opacity: .85; white-space: nowrap; }
.dc-rep { font-style: normal; font-weight: 800; opacity: .85; }
.dc-row.pop { animation: dc-pop .28s ease-out; }
@keyframes dc-pop { 40% { transform: scale(1.03); } }
.dc-legend { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); }
.dc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dc-sw { display: inline-block; width: 18px; height: 12px; border-radius: 4px; }
.dc-sw.free { border: 2px solid var(--dispo-ok); background: color-mix(in srgb, var(--dispo-ok) 14%, var(--surface)); }
.dc-sw.busy { background: var(--dispo-busy); }
.dc-bilan { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .88rem; line-height: 1.6; }
#dlg-dispo label.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; min-height: 44px; }
.dc-foot { position: sticky; bottom: 0; background: var(--surface); padding: 10px 0 4px; box-shadow: 0 -8px 12px -8px rgba(0,0,0,.12); }
.dc-clear { border: 0; background: none; padding: 0; margin-left: auto; font: inherit; font-size: .8rem; font-weight: 600; color: var(--primary); text-decoration: underline; cursor: pointer; }
@media (max-width: 760px) {
  .dc-head, .dc-row { grid-template-columns: minmax(0, 1fr) 104px; gap: 6px; }
  .dc-head { padding: 0 8px 4px; }
  .dc-row { padding: 4px 4px 4px 8px; }
  .dc-day { font-size: 1.02rem; }
  .dc-st { padding: 4px 6px; }
  .dc-st-l { font-size: .72rem; }
}
