:root {
  --bg: #f4f4f2; --panel: #fff; --line: #9a9a96; --ink: #222; --muted: #77766f;
  --fill: #e4e4e0; --accent: #3d6fb4; --warn: #b4733d; --ok: #4f8a5b; --bad: #b33;
}
* { box-sizing: border-box; }
/* L'attribut hidden doit toujours cacher, même un élément dont la classe impose un display */
[hidden] { display: none !important; }
html, body { height: 100%; }
/* Hauteur réelle de l'écran (mode application, barres système d'Android) */
@supports (height: 100dvh) { body { height: 100dvh; } }
body { margin: 0; font: 14px/1.4 system-ui, sans-serif; background: var(--bg); color: var(--ink); display: flex; flex-direction: column; }
header { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 18px; }
.logo small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
nav { display: flex; gap: 4px; overflow-x: auto; }
nav button { border: 1.5px solid transparent; background: none; padding: 7px 12px; font: inherit; cursor: pointer; border-radius: 6px; white-space: nowrap; color: var(--muted); min-height: 40px; }
nav button.on { border-color: var(--ink); color: var(--ink); font-weight: 600; }
nav button[data-t="map"] { font-weight: 700; color: var(--ink); }
.trip { margin-left: auto; color: var(--muted); font-size: 13px; }
.meteo { background: none; border: 1px solid var(--line); border-radius: 14px; padding: 3px 10px; font: inherit; font-size: 13px; color: inherit; cursor: pointer; }
@keyframes capBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.blink { animation: capBlink 1s ease-in-out infinite; }
.meteo .mAlert { color: #c62828; font-weight: 700; animation: capBlink 1s ease-in-out infinite; }
.meteo.alert { border: 2px solid #c62828; background: #fdecea; }
.mRows div { margin: 3px 0; }
.mBig { margin: 8px 0; padding: 8px 10px; border-radius: 6px; background: #c62828; color: #fff; font-weight: 700; }
.warn { color: #c62828; }
.warnRow td { color: #c62828; font-weight: 600; }
.ckList { margin-bottom: 12px; }
.ckCount { font-size: 13px; color: var(--muted); }
.ckCount.ok { color: #2e7d32; font-weight: 600; }
.ckItem { display: flex; align-items: flex-start; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ckItem input { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.ckItem span { flex: 1; }
.ckItem.on span { text-decoration: line-through; color: var(--muted); }
.ckDel { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 4px; }
.tkRow { padding: 6px 8px; margin: 4px 0; border-radius: 6px; }
.tkRow.due { background: #fdecea; color: #c62828; font-weight: 600; }
.tkLog { font-size: 13px; padding: 2px 0; }
.cvRow { display: grid; grid-template-columns: minmax(70px, 1fr) auto auto minmax(70px, 1fr) auto auto; gap: 6px; align-items: center; margin: 5px 0; }
.cvU { font-size: 13px; color: var(--muted); white-space: nowrap; }
.cvX { font-size: 13px; font-weight: 600; }
@media (max-width: 520px) { .cvRow { grid-template-columns: 1fr auto; } .cvEq { display: none; } .cvRow .cvX { grid-column: 1 / -1; } }
.meteo .mOld { color: var(--muted); }
.meteo.mBusy { opacity: .6; }
.trip .tripName { color: var(--ink, inherit); font-weight: 600; }

/* La scène : la carte est toujours là, les autres vues glissent par-dessus */
.stage { --sw: 320px; --dw: 620px; flex: 1; position: relative; display: grid; grid-template-columns: var(--sw) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; min-height: 0; overflow: hidden; }
.steps { grid-column: 1; grid-row: 1 / 3; background: var(--panel); border-right: 1px solid var(--line); padding: 12px; overflow-y: auto; z-index: 1001; }
.stage.nosteps { grid-template-columns: 0 minmax(0, 1fr); }
.stage.nosteps .steps { display: none; }
.mapwrap { grid-column: 2; grid-row: 1; position: relative; min-height: 320px; }
#map { position: absolute; inset: 0; background: #ecebe6; }
#map.adding { cursor: crosshair; }
.timeline { grid-column: 2; grid-row: 2; background: var(--panel); border-top: 1px solid var(--line); padding: 8px 12px; }

.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(var(--dw), 100%); background: var(--bg); border-left: 2px solid var(--ink); box-shadow: -8px 0 24px rgba(0,0,0,.12); overflow-y: auto; padding: 14px; transform: translateX(105%); transition: transform .2s; z-index: 1100; }
.drawer.open { transform: none; }
/* Onglet du haut : la même vue occupe toute la scène, à la place de la carte */
.drawer.page { width: 100%; border-left: 0; box-shadow: none; transition: none; padding: 20px; }
.drawer.page > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.drawer.page .drawer-head { top: -20px; }
.drawer.page #drawerClose { display: none; }
.drawer.dragging, .stage.dragging { transition: none; user-select: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; position: sticky; top: -14px; background: var(--bg); padding: 4px 0; z-index: 1; }
.drawer-head h1 { font-size: 17px; margin: 0; }
.drawer section { display: none; }
.drawer section.on { display: block; }

/* Poignées de redimensionnement (souris et tactile) */
.grip { position: absolute; top: 0; bottom: 0; width: 14px; cursor: ew-resize; touch-action: none; z-index: 2; display: flex; align-items: center; justify-content: center; }
.grip::after { content: ""; width: 4px; height: 44px; border-radius: 4px; background: var(--line); }
.grip:hover::after, .dragging .grip::after { background: var(--ink); }
#drawerGrip { right: calc(min(var(--dw), 100%) - 7px); z-index: 1101; display: none; }
.drawer.open:not(.page) + #drawerGrip { display: flex; }
#stepsGrip { left: calc(var(--sw) - 7px); z-index: 1002; }
.stage.nosteps #stepsGrip { display: none; }

.box { background: var(--panel); border: 1.5px dashed var(--line); border-radius: 6px; padding: 12px; }
.box.real { border-style: solid; border-color: var(--fill); }
.ph { background: var(--fill); border: 1.5px dashed var(--line); border-radius: 4px; color: var(--muted); display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; font-size: 12px; }
h2 { font-size: 15px; margin: 0 0 10px; }
h3 { font-size: 12px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.grid { display: grid; gap: 12px; }
.mt { margin-top: 12px; }
.note { font-size: 12px; color: var(--warn); border-left: 3px solid var(--warn); padding: 4px 8px; margin-top: 8px; background: #fbf4ec; }
.src { font-size: 11px; color: var(--muted); margin-top: 6px; }
.btn { border: 1.5px solid var(--ink); background: var(--panel); border-radius: 6px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; min-height: 36px; color: var(--ink); }
.btn.pri { background: var(--ink); color: #fff; }
.btn.sm { min-height: 28px; padding: 2px 8px; font-size: 12px; }
.btn.on { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn:disabled { opacity: .4; cursor: default; }
.inp { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); width: 100%; }
.lbl { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row .inp { flex: 1; width: auto; min-width: 0; }
.between { justify-content: space-between; }
.chip { display: inline-block; border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; font-size: 11px; background: var(--panel); }
.chip.b { border-color: var(--warn); color: var(--warn); }
.chip.c { border-color: var(--ok); color: var(--ok); }
.chip.f { border-color: var(--accent); color: var(--accent); }
.chip.x { border-color: var(--bad); color: var(--bad); }
button.chip { cursor: pointer; font: inherit; font-size: 12px; padding: 2px 10px; margin-left: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px; border-bottom: 1px solid var(--fill); }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.kpi { text-align: center; }
.kpi b { display: block; font-size: 20px; }
.kpi span { font-size: 12px; color: var(--muted); }
.field { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dotted var(--fill); }
.field i { color: var(--muted); font-style: normal; text-align: right; }
.field b { text-align: right; }
.field .inp { width: 90px; text-align: right; }
.ftin { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.field .ftin .inp { width: 60px; }
.field .ftin .inp.wide { width: 90px; }
.scroll { overflow-x: auto; }
.auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

/* Étapes */
.step { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border: 1px solid var(--fill); border-radius: 4px; margin-bottom: 6px; background: var(--panel); }
.step .n { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.step .n.b { background: var(--warn); } .step .n.c { background: var(--ok); }
.step .d { flex: 1; min-width: 0; }
.step .d b { cursor: pointer; }
.step small { color: var(--muted); display: block; }
.step .dt, .step .nt { font: inherit; font-size: 12px; border: 1px solid var(--fill); border-radius: 4px; padding: 1px 3px; background: var(--panel); color: var(--ink); }
.step .nt { width: 44px; }
.step .dt:hover, .step .nt:hover { border-color: var(--line); }
.step .ctl { display: flex; flex-direction: column; gap: 2px; }
.step .ctl button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; font-size: 13px; }
.leg { font-size: 11px; color: var(--muted); padding: 0 0 6px 38px; }
.leg.long { color: var(--bad); }

/* Superpositions sur la carte */
.layers { position: absolute; top: 10px; left: 10px; z-index: 1000; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 13px; }
/* Menu ouvert : hauteur limitée (les pastilles du bas restent visibles), défilement à l'intérieur */
.layers[open] { max-height: calc(100% - 100px); overflow-y: auto; overscroll-behavior: contain; width: min(330px, calc(100% - 80px)); box-sizing: border-box; }
.layers summary { position: sticky; top: -8px; background: var(--panel); padding: 2px 0; z-index: 1; cursor: pointer; }
.layers label { display: block; padding: 3px 0; }
.tools { position: absolute; top: 10px; right: 10px; z-index: 1000; display: flex; flex-direction: column; gap: 6px; }
.tools .btn { width: 40px; padding: 0; }
#undoBtn { font-size: 20px; font-weight: 700; }
.undo-toast { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 1100; display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; border-radius: 8px; padding: 8px 12px; font-size: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.3); max-width: calc(100% - 32px); }
.undo-toast[hidden] { display: none; }
.undo-toast .btn { background: #fff; color: var(--ink); border-color: #fff; font-weight: 700; white-space: nowrap; }
.hud { position: absolute; left: 10px; bottom: 24px; z-index: 1000; display: flex; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 20px); }
.hud .chip { font-size: 12px; padding: 3px 10px; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 1000; background: var(--warn); color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 13px; display: none; }
.hint.on { display: block; }
.hint-gps { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.hint-gps input { flex: 1; min-width: 150px; margin: 0; padding: 4px 6px; font-size: 14px; }
.pop .gps, .step .gps { display: flex; gap: 6px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--muted, #888); }
.pop .gps input, .step .gps input { margin: 0; flex: 1; font-family: ui-monospace, monospace; font-size: 12px; }
.back-view { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 1000; min-height: 44px; padding: 8px 16px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.back-view[hidden] { display: none; }
/* En mode conduite, le bandeau occupe le haut : le bouton passe en bas (les pastilles y sont cachées) */
.stage.driving .back-view { top: auto; bottom: 24px; }
.leaflet-control-zoom { display: none; }

.mk { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); color: #fff; font: 700 11px system-ui; display: flex; align-items: center; justify-content: center; background: var(--ink); }
.mk.b { background: var(--warn); } .mk.c { background: var(--ok); }
.mk.dest { width: 32px; height: 32px; background: #fff; color: var(--ink); border: 3px solid var(--ink); }
.st { width: 100%; height: 100%; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); font-size: 10px; display: flex; align-items: center; justify-content: center; }
.legend { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11px; color: var(--muted); padding-left: 22px; }
.legend i, .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.mk, .st, .fu, .poi { transform: scale(var(--k, 1)); transition: transform .15s; }
.poi { width: 100%; height: 100%; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; font-size: 11px; line-height: 1; }
.poi.star { border-color: #c79a00; border-width: 3px; }
.poi.guide { border-width: 3px; border-radius: 6px; font-size: 12px; }
.poi.check { opacity: .55; border-style: dashed; }
.pl { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px dotted var(--fill); cursor: pointer; }
.pl:hover { background: var(--bg); }
.pl .i { font-size: 18px; width: 24px; text-align: center; flex: none; }
.pl small { color: var(--muted); display: block; }
.dc-thumb { float: right; max-width: 40%; border-radius: 6px; margin: 0 0 8px 10px; }
.fu { width: 14px; height: 14px; background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.pop b { font-size: 14px; }
.pop input { width: 100%; padding: 4px 6px; margin: 4px 0; border: 1px solid var(--line); border-radius: 4px; font: inherit; }
.pop .row { margin-top: 6px; gap: 4px; }
.pop .resv { margin-top: 6px; padding: 4px 6px; border: 1px dashed var(--line); border-radius: 4px; }
.pop .addr { display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.pop .addr input { margin: 0; flex: 1; }
.pop .addr a.btn { white-space: nowrap; text-decoration: none; }

.days { display: grid; gap: 2px; }
.days div { height: 30px; border-radius: 3px; font-size: 10px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 2px; cursor: pointer; min-width: 22px; }
.d-b { background: #f1dcc6; } .d-c { background: #cfe3d3; } .d-dest { background: var(--ink); color: #fff; }

.gauge { height: 18px; border: 1.5px solid var(--ink); border-radius: 4px; position: relative; background: linear-gradient(90deg, var(--fill) 50%, #fff 50%); }
.gauge::after { content: "seuil 50 %"; position: absolute; left: 50%; top: -18px; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.gauge::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; border-left: 2px solid var(--warn); }
.bar { height: 10px; background: var(--fill); border-radius: 99px; overflow: hidden; margin: 4px 0 8px; }
.bar > div { height: 100%; background: var(--ok); }

/* Tablette portrait : liste d'étapes repliable */
@media (max-width: 900px) {
  .stage { grid-template-columns: 0 minmax(0, 1fr); }
  .steps { display: none; }
  .stage.showsteps .steps { display: block; position: absolute; top: 0; bottom: 0; left: 0; width: min(var(--sw), 100%); box-shadow: 8px 0 24px rgba(0,0,0,.12); }
  #stepsGrip { display: none; }
  .stage.showsteps #stepsGrip { display: flex; }
  .trip { margin-left: 0; width: 100%; }
}
/* Mode conduite */
/* Mode conduite : carte plein écran (étapes, calendrier et pastilles cachés), gros boutons */
.stage.driving { grid-template-columns: 0 minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 0; }
.stage.driving .steps, .stage.driving .timeline, .stage.driving .hud, .stage.driving #stepsGrip, .stage.driving #toggleSteps { display: none; }
.stage.driving .tools { gap: 10px; }
.stage.driving .tools .btn { width: 56px; height: 56px; font-size: 24px; }
.me { width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 3px solid #2a7de1; box-shadow: 0 1px 6px rgba(0,0,0,.5); font-size: 20px; display: flex; align-items: center; justify-content: center; }
.drive { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 1000; width: min(460px, calc(100% - 120px)); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.25); padding: 8px 12px; font-size: 15px; display: grid; gap: 6px; }
.drive > div { line-height: 1.3; }
.drive .big { font-size: 17px; }
.drive span, .drive small { display: block; color: var(--muted, #666); font-size: 13px; }
.drive .big span { font-size: 15px; color: var(--ink); }
.drive .warn { color: #b33; font-weight: 600; }
.drive .warn, .drive .back { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drive .back { color: #2a7de1; font-weight: 600; }
.drive .back small, .drive .back .btn { display: inline; }
.drive .back .btn { margin-left: auto; }

/* Passages bas (hauteur libre) : étiquette sur la carte et ligne du bandeau de conduite */
.clr { display: inline-block; padding: 1px 5px; border-radius: 4px; background: #fff; border: 2px solid #e0661b; color: #b34d0f; font-size: 12px; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.clr.danger { background: #c0392b; border-color: #8e2a1f; color: #fff; }
.drive .lowc { color: #b34d0f; font-weight: 600; }
.drive .lowc.danger { color: #c0392b; }
.drive .lowc small { display: inline; }

/* Mode nuit : carte sombre (plan inversé, satellite assombri), bandeau et boutons sombres */
.stage.night:not(.sat) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }
.stage.night.sat .leaflet-tile-pane { filter: brightness(.6); }
.stage.night .leaflet-container { background: #1b1d1f; }
.stage.night .drive { background: #1f2326; color: #e8e8e8; border-color: #3a3f44; }
.stage.night .drive span, .stage.night .drive small, .stage.night .drive .src { color: #a9b0b6; }
.stage.night .drive .big span { color: #e8e8e8; }
.stage.night .tools .btn:not(.on) { background: #1f2326; color: #e8e8e8; border-color: #3a3f44; }
/* Journal des pleins */
.fillform { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 14px; align-items: end; }
.fillform label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.fillform label.chk { flex-direction: row; align-items: center; gap: 6px; }
.fillform .row { display: flex; gap: 6px; align-items: center; }
.fillform .row .inp { flex: 1; min-width: 0; }
.fillform select.inp { flex: 0 0 auto; }
#fillStats .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 6px; }
#fillTable small { color: var(--muted); }
.field.chk { justify-content: flex-start; gap: 6px; }
/* Budget */
.pop .money { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 4px; font-size: 12px; }
.pop .money label { display: flex; align-items: center; gap: 3px; }
.pop .money input { width: 64px; margin: 0; }
#budgetTable .num { text-align: right; white-space: nowrap; }
#budgetTable tr.total td { border-top: 2px solid var(--line); }
/* Journal de voyage */
.pop .journal { margin-top: 4px; }
.pop .journal summary { cursor: pointer; font-size: 12px; }
.pop .journal textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; }
.jr { padding: 8px 0; border-bottom: 1px solid var(--line); }
.jr b { cursor: pointer; }
.pop .alts { margin-top: 4px; }
.pop .alts summary { cursor: pointer; font-weight: 600; }
.pop .alt { display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.pop .alt > div { flex: 1; min-width: 0; }
.pop .alt small { display: block; color: var(--muted); }
.pop .alt-add { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pop .alt-add input { margin: 0; flex: 1 1 120px; }
.pop .after { display: flex; gap: 6px; align-items: center; margin: 4px 0; font-size: 12px; }
.pop .after select { flex: 1; min-width: 0; font-size: 12px; }

/* ⭐ Mes campings favoris */
.fav-ico { font-size: 24px; line-height: 30px; text-align: center; filter: drop-shadow(0 0 2px #000) drop-shadow(0 0 1px #fff); }
.fav-ico.red { font-size: 30px; color: #e02020; }
.star-red { color: #e02020; }
.fav-btn { margin: 4px 0; }
.fav-btn.on { background: #fff4c2; border-color: #f9a825; }
.fav-list { margin: 4px 0; padding-left: 4px; list-style: none; max-height: 160px; overflow: auto; font-size: 13px; }
.fav-list li { padding: 2px 0; }
.fav-box .alt-add { display: flex; flex-wrap: wrap; gap: 4px; }
.fav-box .alt-add input { flex: 1 1 120px; min-width: 0; }

/* 🔍 Recherche sur la carte */
.search { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 1001; width: min(420px, calc(100% - 120px)); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.3); padding: 6px; }
.search[hidden] { display: none; }
.search-row { display: flex; gap: 6px; }
.search-row input { flex: 1; min-width: 0; margin: 0; padding: 8px; font-size: 16px; }
.search-res { max-height: 55vh; overflow: auto; }
.search-res h4 { margin: 8px 4px 2px; font-size: 11px; text-transform: uppercase; color: var(--muted); }
.search-res button { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--ink); padding: 7px 6px; border-radius: 4px; cursor: pointer; font: inherit; font-size: 14px; }
.search-res button:hover, .search-res button:focus { background: var(--fill); }
.search-res small { display: block; color: var(--muted); font-size: 11px; }
@media (max-width: 600px) { .search { left: 10px; right: 60px; width: auto; transform: none; } }

/* 📅 Aide à la réservation (fiche d'étape) */
.resv-help { margin: 4px 0; }
.resv-help summary { cursor: pointer; font-weight: 600; }
.resv-help > * + * { margin-top: 4px; }
.resv-help .row { flex-wrap: wrap; gap: 4px; }

/* Puces de catégorie de la recherche 🔍 */
.search-cats { display: flex; gap: 4px; overflow-x: auto; padding: 6px 0 2px; scrollbar-width: none; }
.search-cats::-webkit-scrollbar { display: none; }
.search-cats button { flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 14px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.search-cats button.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }

/* 📒 Carnet et calendrier */
.cal-month { margin: 12px 0 4px; text-transform: capitalize; font-size: 14px; }
.cal-item { display: flex; gap: 8px; padding: 6px; border-left: 3px solid var(--line); margin-bottom: 6px; }
.cal-item.soon { border-left-color: var(--warn); }
.cal-item.late { border-left-color: #b33; background: rgba(187, 51, 51, .06); }
.cal-item.done, .note.done { opacity: .55; }
.cal-item .row { margin-top: 4px; flex-wrap: wrap; }
.cal-body { flex: 1; min-width: 0; }
.chip.warn { border-color: #b33; color: #b33; }
.chip.cmp { border-color: #d6338a; color: #d6338a; cursor: pointer; }
.cmp-pin { background: #d6338a; color: #fff; border: 2px solid #fff; border-radius: 50%; width: 20px; height: 20px; font: bold 11px/16px sans-serif; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.note { border-top: 1px solid var(--line); padding: 8px 0; }
.note-text { margin: 4px 0; overflow-wrap: anywhere; }
.note .row { margin-top: 4px; }

/* 👁 Vues de la carte (menu Calques) */
.map-views { flex-wrap: wrap; max-width: 300px; padding-bottom: 6px; }

/* Fiches : poignée de déplacement */
.pop-drag { touch-action: none; cursor: grab; user-select: none; text-align: center; font-size: 12px; color: #777;
  padding: 4px 24px 2px; margin: -1px 0 0; border-bottom: 1px solid var(--line); background: rgba(0,0,0,.04); border-radius: 12px 12px 0 0; }
.pop-drag:active { cursor: grabbing; }
.leaflet-popup-content { overscroll-behavior: contain; }
.leaflet-popup-content-wrapper { position: relative; }
.pop-resize { position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; cursor: nwse-resize; touch-action: none; z-index: 2;
  background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,.35) 50%, rgba(0,0,0,.35) 58%, transparent 58%, transparent 70%, rgba(0,0,0,.35) 70%, rgba(0,0,0,.35) 78%, transparent 78%);
  border-radius: 0 0 12px 0; }

/* Pilot / Flying J avec voies VR : bien visible, grossit avec le zoom comme les étapes */
.pilot-pin { box-sizing: border-box; width: 30px; height: 30px; border-radius: 50%; background: #ff6d00; border: 3px solid #1a1a1a; box-shadow: 0 0 0 2px #fff, 0 2px 5px rgba(0,0,0,.5); font: 16px/24px sans-serif; text-align: center; transform: scale(var(--k, 1)); }

/* 🌙 Carnet des nuits (v1.44) */
.nt-card { border: 1px solid var(--fill); border-radius: 6px; margin: 6px 0; background: var(--panel); }
.nt-card.done { border-left: 4px solid var(--ok); }
.nt-card.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.nt-card > summary { cursor: pointer; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-height: 40px; }
.nt-card .nt-where { color: var(--muted); }
.nt-card .nt-st { color: #d9a400; }
.nt-ed { padding: 4px 10px 10px; display: grid; gap: 8px; }
.nt-f { display: grid; gap: 3px; font-size: 13px; }
.nt-f > span { font-size: 12px; color: var(--muted); }
.nt-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; }
.nt-svc { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.nt-svc label { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; }
.nt-star { border: none; background: none; font-size: 26px; line-height: 1; color: var(--fill); cursor: pointer; padding: 0 2px; }
.nt-star.on { color: #d9a400; }
