:root {
  --bg: #f4efe4;
  --surface: #fffcf6;
  --surface-2: #f8f3e9;
  --ink: #22261e;
  --muted: #6c6f60;
  --line: #e2dac8;
  --accent: #c8553d;
  --accent-ink: #fff;
  --forest: #2f4a33;
  --forest-2: #4c7350;
  --gold: #d9a441;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --warn-bg: #fff4dc;
  --ok: #2e7d32;
  --shadow: 0 6px 24px rgba(40, 35, 20, .12), 0 1px 3px rgba(40, 35, 20, .08);
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
  --nav-w: 84px;
  --top-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12150f; --surface: #1b1f17; --surface-2: #22271d; --ink: #ece7da; --muted: #a3a593; --line: #343a2c;
    --accent: #e0694f; --forest: #9cc49a; --forest-2: #7fae7e; --danger: #ff8a80; --danger-bg: #3a1d1a; --warn-bg: #3a3018;
    --shadow: 0 6px 24px rgba(0, 0, 0, .45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12150f; --surface: #1b1f17; --surface-2: #22271d; --ink: #ece7da; --muted: #a3a593; --line: #343a2c;
  --accent: #e0694f; --forest: #9cc49a; --forest-2: #7fae7e; --danger: #ff8a80; --danger-bg: #3a1d1a; --warn-bg: #3a3018;
  --shadow: 0 6px 24px rgba(0, 0, 0, .45); color-scheme: dark;
}

* { box-sizing: border-box; }
/* Page figée : seule l'intérieur des vues défile (évite les « rebonds » et décalages sur iPhone). */
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; width: 100%; height: 100dvh; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
/* Safari iOS zoome automatiquement sur les champs dont le texte fait moins de 16 px : on l'en empêche. */
@media (pointer: coarse) { input, select, textarea { font-size: 16px !important; } }
button, .chip, .tool, .day, .opt { touch-action: manipulation; }
.page, .sheet-body, .modal-card, .layers-pop, .top-pop, .chips, .days { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.12rem; } h4 { font-size: 1rem; font-family: var(--font); font-weight: 600; }
a { color: var(--forest-2); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--forest-2); outline-offset: 1px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden, [hidden] { display: none !important; }

/* ── Barre du haut ── */
.topbar { position: fixed; inset: 0 0 auto 0; height: calc(var(--top-h) + env(safe-area-inset-top)); display: flex; align-items: center; gap: 12px; padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); background: var(--forest); color: #f6f1e6; z-index: 1000; }
:root[data-theme="dark"] .topbar { background: #1f2a1e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topbar { background: #1f2a1e; } }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 700; font-size: 1.25rem; }
.brand svg { width: 30px; height: 30px; }
.status { flex: 1; font-size: .8rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { background: rgba(255,255,255,.12); border: 0; color: inherit; width: 36px; height: 36px; border-radius: 10px; font-size: 1.1rem; }
@media (max-width: 400px) { .brand span { display: none; } }
.sos { background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 7px 14px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.2); }

/* ── Navigation ── */
.tabs { position: fixed; top: calc(var(--top-h) + env(safe-area-inset-top)); left: 0; bottom: 0; width: var(--nav-w); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; z-index: 900; }
.tabs button { border: 0; background: none; border-radius: 12px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .75rem; font-weight: 600; color: var(--muted); }
.tabs button .ti { font-size: 1.35rem; filter: grayscale(.5); }
.tabs button.active { background: var(--surface-2); color: var(--ink); }
.tabs button.active .ti { filter: none; }
main { position: fixed; top: calc(var(--top-h) + env(safe-area-inset-top)); left: var(--nav-w); right: 0; bottom: 0; }
.view { position: absolute; inset: 0; display: none; }
.view.active { display: block; }
.page { overflow-y: auto; padding: 24px; -webkit-overflow-scrolling: touch; }
.page > .wrap { max-width: 1100px; margin: 0 auto; }

@media (max-width: 760px) {
  :root { --top-h: 52px; }
  .status { display: none; }
  .brand span { font-size: 1.1rem; }
  .tabs { top: auto; right: 0; width: auto; height: calc(62px + env(safe-area-inset-bottom)); flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding: 4px 4px env(safe-area-inset-bottom); justify-content: space-around; }
  .tabs button { flex: 1; padding: 6px 2px; }
  main { left: 0; bottom: calc(62px + env(safe-area-inset-bottom)); }
  .page { padding: 16px; }
  h1 { font-size: 1.5rem; }
  .banners, .obs-info { margin-right: 58px; }
  .banner { font-size: .76rem; padding: 6px 8px; }
}

/* ── Carte ── */
#map { position: absolute; inset: 0; background: #dfe6d5; }
.leaflet-container { font-family: var(--font); }
.map-top { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 500; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.search-wrap { position: relative; max-width: 420px; }
.search-wrap input { box-shadow: var(--shadow); border-radius: 999px; padding-left: 38px; background: var(--surface) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" stroke="%23888" stroke-width="2"><circle cx="7" cy="7" r="5"/><path d="m11 11 4 4"/></svg>') 14px 50% no-repeat; }
.place-results { position: absolute; top: 100%; left: 0; right: 0; margin: 6px 0 0; padding: 6px; list-style: none; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); }
.place-results li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.place-results li:hover, .place-results li.sel { background: var(--surface-2); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: .85rem; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--forest); color: #fff; border-color: var(--forest); }
:root[data-theme="dark"] .chip.on { color: #12150f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.on { color: #12150f; } }
.chip.danger.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.chip select { border: 0; padding: 0 4px; background: transparent; width: auto; font-weight: 600; }
.banners { display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.banner { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: .82rem; box-shadow: var(--shadow); }
.banner button { margin-left: auto; border: 0; background: none; font-size: 1rem; opacity: .6; }

.map-tools { position: absolute; right: 12px; top: 130px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.tool { width: 58px; border: 0; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 8px 4px; font-size: 1.2rem; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tool span { font-size: .66rem; font-weight: 600; color: var(--muted); }
.tool.on { outline: 2px solid var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.layers-pop, .top-pop { position: absolute; right: 80px; top: 130px; z-index: 600; width: 300px; max-height: calc(100% - 240px); overflow: auto; padding: 14px; }
.layers-pop label { display: flex; gap: 8px; align-items: center; padding: 5px 0; font-size: .9rem; }
.layers-pop input { width: auto; }
.layers-pop h4 { margin: 8px 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.map-bottom { position: absolute; left: 12px; right: 84px; bottom: 14px; z-index: 500; display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; pointer-events: none; }
.map-bottom > * { pointer-events: auto; }
.days { display: flex; gap: 4px; background: var(--surface); border-radius: 14px; padding: 5px; box-shadow: var(--shadow); overflow-x: auto; max-width: 100%; }
.day { border: 0; background: none; border-radius: 10px; padding: 5px 9px; min-width: 56px; text-align: center; line-height: 1.15; }
.day b { display: block; font-size: .8rem; }
.day small { font-size: .68rem; color: var(--muted); }
.day .conf { display: block; height: 3px; border-radius: 2px; background: var(--forest-2); margin-top: 4px; opacity: .8; }
.day.on { background: var(--forest); color: #fff; }
.day.on small { color: rgba(255,255,255,.8); }
:root[data-theme="dark"] .day.on { color: #12150f; } :root[data-theme="dark"] .day.on small { color: #12150f; }
.legend { background: var(--surface); border-radius: 14px; padding: 8px 12px; box-shadow: var(--shadow); font-size: .75rem; min-width: 220px; }
.legend .ramp { height: 10px; border-radius: 5px; margin: 4px 0 2px; }
.legend .ticks { display: flex; justify-content: space-between; color: var(--muted); }
.hover-read { position: absolute; z-index: 650; pointer-events: none; background: var(--surface); border-radius: 10px; padding: 6px 10px; box-shadow: var(--shadow); font-size: .8rem; white-space: nowrap; }
.loader { position: absolute; z-index: 700; left: 50%; top: 45%; transform: translate(-50%, -50%); background: var(--surface); border-radius: 16px; padding: 18px 22px; box-shadow: var(--shadow); text-align: center; min-width: 260px; }
.loader .bar { height: 6px; background: var(--surface-2); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.loader .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.spin { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 10px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .map-tools { top: 112px; right: 10px; gap: 6px; }
  .tool { width: 48px; padding: 6px 2px; font-size: 1.05rem; }
  .legend > .muted { display: none; }
  .layers-pop, .top-pop { right: 10px; left: 10px; width: auto; top: 110px; max-height: 55%; }
  .map-bottom { right: 10px; left: 10px; bottom: 10px; }
  .legend { flex: 1; min-width: 0; }
  .leaflet-bottom.leaflet-right { display: none; }
}

/* ── Panneau d'analyse ── */
.sheet { position: absolute; top: 0; right: 0; bottom: 0; width: 460px; max-width: 100%; z-index: 800; background: var(--surface); box-shadow: -8px 0 30px rgba(0,0,0,.15); display: flex; flex-direction: column; }
.sheet-grip { display: none; }
.sheet-body { overflow-y: auto; padding: 18px; flex: 1; }
@media (max-width: 760px) {
  .sheet { top: auto; left: 0; width: 100%; height: 72%; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.2); transition: height .25s; }
  .sheet.full { height: 100%; border-radius: 0; }
  body.sheet-open .leaflet-control-container, body.sheet-open .map-bottom, body.sheet-open .map-tools { display: none; }
  .sheet-grip { display: block; width: 44px; height: 5px; background: var(--line); border-radius: 3px; margin: 8px auto 0; cursor: pointer; flex: none; }
}
.ph-head { display: flex; align-items: flex-start; gap: 10px; }
.ph-head h2 { flex: 1; margin: 0; }
.close { border: 0; background: var(--surface-2); width: 34px; height: 34px; border-radius: 50%; font-size: 1.1rem; flex: none; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.fact { background: var(--surface-2); border-radius: 12px; padding: 8px 10px; }
.fact small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.fact b { font-size: .92rem; }
.section { margin: 18px 0; }
.section > h3 { display: flex; align-items: center; gap: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: .88rem; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--forest); border-color: var(--forest); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #12150f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #12150f; } }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: default; }
.notice { border-radius: 12px; padding: 10px 12px; font-size: .86rem; margin: 10px 0; border: 1px solid var(--line); background: var(--surface-2); }
.notice.warn { background: var(--warn-bg); }
.notice.danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.notice.ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 8px; padding: 6px 12px; font-weight: 600; font-size: .85rem; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.res { border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; overflow: hidden; background: var(--surface); }
.res-row { display: flex; gap: 10px; align-items: center; padding: 8px; cursor: pointer; }
.res-row .ph { width: 48px; height: 48px; flex: none; }
.res-main { flex: 1; min-width: 0; }
.res-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-main small { color: var(--muted); }
.score { text-align: right; flex: none; min-width: 62px; }
.score b { font-size: 1.3rem; font-family: var(--serif); }
.score small { display: block; font-size: .7rem; color: var(--muted); }
.meter { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; border-radius: 3px; }
.res-detail { padding: 4px 12px 12px; border-top: 1px dashed var(--line); display: none; }
.res.open .res-detail { display: block; }
.part { display: grid; grid-template-columns: 150px 1fr 38px; gap: 8px; align-items: center; font-size: .8rem; margin: 4px 0; }
.part .meter { margin: 0; }
.spark { display: flex; gap: 3px; align-items: flex-end; height: 44px; margin: 8px 0 2px; }
.spark div { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.spark-l { display: flex; gap: 3px; font-size: .66rem; color: var(--muted); }
.spark-l span { flex: 1; text-align: center; }
.lvl-0 { color: var(--muted); } .lvl-1 { color: #b08b2a; } .lvl-2 { color: #d08a1e; } .lvl-3 { color: #e0681c; } .lvl-4 { color: #c83a3a; } .lvl-5 { color: #8e2471; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lvl-4 { color: #ff7b7b; } :root:not([data-theme="light"]) .lvl-5 { color: #e48ad0; } }
:root[data-theme="dark"] .lvl-4 { color: #ff7b7b; } :root[data-theme="dark"] .lvl-5 { color: #e48ad0; }

/* ── Photos & badges ── */
.ph { background: var(--surface-2) center/cover no-repeat; border-radius: 10px; overflow: hidden; position: relative; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s; }
.ph.ok img { opacity: 1; }
.ph.none::after { content: '🍄'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; opacity: .5; }
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.ed-excellent { background: #1f6f3f; color: #fff; }
.ed-bon { background: #4c9a52; color: #fff; }
.ed-comestible { background: #c9b458; color: #2a2510; }
.ed-sans { background: #8c8577; color: #fff; }
.ed-toxique { background: #e07b20; color: #fff; }
.ed-mortel { background: #111; color: #fff; outline: 2px solid #d32f2f; }
.tag { display: inline-block; border-radius: 6px; padding: 1px 7px; font-size: .72rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tag.season { background: color-mix(in srgb, var(--ok) 15%, var(--surface)); color: var(--ok); border-color: transparent; }

/* ── Catalogue ── */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.toolbar input[type=search] { max-width: 340px; }
.toolbar select { width: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.sp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; text-align: left; padding: 0; }
.sp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.sp-card .ph { aspect-ratio: 4/3; border-radius: 0; }
.sp-card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.sp-card .latin { font-style: italic; color: var(--muted); font-size: .82rem; }
.sp-card h3 { font-size: 1.02rem; margin: 0; }
.sp-card .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sp-card.dangerous { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; margin-top: 4px; }
.months i { height: 6px; border-radius: 2px; background: var(--forest-2); }
.months.big i { height: 22px; position: relative; }
.months.big span { font-size: .66rem; text-align: center; color: var(--muted); }
.months i.now { outline: 2px solid var(--accent); outline-offset: 1px; }
.group-title { margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; }
.group-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ── Modale (fiche espèce) ── */
.modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal-back { position: absolute; inset: 0; background: rgba(20, 18, 10, .55); backdrop-filter: blur(3px); }
.modal-card { position: relative; background: var(--surface); width: min(980px, 100%); max-height: min(94vh, 100%); overflow-y: auto; border-radius: 20px; box-shadow: var(--shadow); }
@media (max-width: 760px) {
  .modal { place-items: end center; }
  .modal-card { border-radius: 18px 18px 0 0; max-height: calc(100dvh - env(safe-area-inset-top) - 10px); padding-bottom: env(safe-area-inset-bottom); }
  .modal-close { position: sticky; top: 10px; float: right; margin: 10px 10px -48px 0; }
  .sheet-body { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .form-row { grid-template-columns: 1fr; }
  .part { grid-template-columns: 110px 1fr 36px; }
}
.obs-info { max-width: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 7px 10px; font-size: .8rem; box-shadow: var(--shadow); }
.icon-btn.on { background: rgba(156, 196, 154, .35); }
.sheet-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; align-items: start; }
@media (max-width: 760px) { .sheet-hero { grid-template-columns: 1fr; } }
.gallery { background: #111; position: relative; min-height: 300px; }
.gallery .main { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: #222; }
.gallery .thumbs { display: flex; gap: 4px; padding: 6px; overflow-x: auto; background: #111; }
.gallery .thumbs img { width: 62px; height: 48px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: .65; flex: none; }
.gallery .thumbs img.on { opacity: 1; outline: 2px solid #fff; }
.gallery .attr { position: absolute; top: 8px; left: 8px; right: 8px; font-size: .66rem; color: #fff; text-shadow: 0 1px 2px #000; opacity: .8; }
.hero-info { padding: 22px; }
.hero-info .latin { font-style: italic; color: var(--muted); margin-top: -4px; }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 3; background: rgba(0,0,0,.55); color: #fff; border: 0; width: 38px; height: 38px; border-radius: 50%; font-size: 1.2rem; }
.sheet-content { padding: 6px 22px 26px; }
.desc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.desc-item { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.desc-item small { display: block; font-weight: 700; color: var(--forest-2); text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; margin-bottom: 2px; }
.conf-card { display: grid; grid-template-columns: 92px 1fr; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin: 8px 0; background: var(--surface); }
.conf-card .ph { width: 92px; height: 92px; }
.danger-box { background: var(--danger-bg); border: 2px solid var(--danger); border-radius: 14px; padding: 12px 14px; margin: 12px 0; }
.danger-box h3 { color: var(--danger); }
.host-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.compare .col { padding: 16px; }
.compare .col + .col { border-left: 1px solid var(--line); }
.compare .ph { aspect-ratio: 4/3; margin-bottom: 10px; }
.compare dl { margin: 0; }
.compare dt { font-size: .7rem; text-transform: uppercase; color: var(--forest-2); font-weight: 700; margin-top: 10px; letter-spacing: .05em; }
.compare dd { margin: 2px 0 0; font-size: .9rem; }

/* ── Clé d'identification ── */
.idkey { display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .idkey { grid-template-columns: 1fr; } }
.q { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
.q h4 { margin: 0 0 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 6px 10px; font-size: .85rem; font-weight: 500; }
.opt.on { background: var(--forest); color: #fff; border-color: var(--forest); }
:root[data-theme="dark"] .opt.on { color: #12150f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .opt.on { color: #12150f; } }
.match { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; margin-bottom: 8px; cursor: pointer; }
.match .ph { width: 64px; height: 64px; flex: none; }
.match.dangerous { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: color-mix(in srgb, var(--danger-bg) 50%, var(--surface)); }

/* ── Terrain ── */
.cards2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.panel h3 { display: flex; gap: 8px; align-items: center; }
.big-num { font-family: var(--serif); font-size: 2rem; font-weight: 700; }
.compass { width: 110px; height: 110px; border-radius: 50%; border: 3px solid var(--line); display: grid; place-items: center; margin: 8px auto; position: relative; background: var(--surface-2); }
.compass .arrow { width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-bottom: 46px solid var(--accent); transform-origin: 50% 70%; transition: transform .3s; margin-top: -20px; }
.compass .n { position: absolute; top: 4px; font-size: .7rem; font-weight: 700; color: var(--muted); }
.list { list-style: none; margin: 8px 0 0; padding: 0; }
.list li { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.list li:last-child { border-bottom: 0; }
.list li .grow { flex: 1; min-width: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.form-row.one { grid-template-columns: 1fr; }
label.f { font-size: .78rem; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.stat-bars div { display: grid; grid-template-columns: 140px 1fr 50px; gap: 8px; align-items: center; font-size: .82rem; margin: 3px 0; }

/* ── Sécurité ── */
.sos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.sos-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-decoration: none; color: var(--ink); display: block; }
.sos-card b { display: block; font-size: 1.15rem; color: var(--accent); }
.sos-card.main { background: var(--danger); color: #fff; border-color: var(--danger); }
.sos-card.main b { color: #fff; font-size: 1.6rem; }
table.syn { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.syn th, table.syn td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.syn th { font-size: .74rem; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
table.syn tr.grave td:first-child { color: var(--danger); font-weight: 700; }
.rules { counter-reset: r; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.rules li { counter-increment: r; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 12px 48px; position: relative; font-size: .9rem; }
.rules li::before { content: counter(r); position: absolute; left: 12px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 3000; box-shadow: var(--shadow); font-size: .9rem; max-width: 90vw; }
.leaflet-popup-content { font-family: var(--font); }
.scan-cell { transition: opacity .2s; }
.pin { background: none; border: 0; }
.pin div { width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); border: 2px solid #fff; }
.pin div span { transform: rotate(45deg); font-size: 14px; }
