:root {
  --bg: #f6f7f9; --panel: #ffffff; --text: #1d2430; --muted: #6b7280; --line: #e3e6eb; --soft: #e8f1f6;
  --accent: #0b6e99; --accent-2: #0a9396;
  --ideal: #157a3a; --good: #4d8a0a; --mid: #b56a00; --bad: #c73a3a; --none: #6b7280;
  --a: #5f7d95; --b: #d84a8f; --both: #7b2cbf; /* a = Simon (bleu-gris), b = Marie (rose) */
  --radius: 14px; --shadow: 0 6px 24px rgba(0,0,0,.14);
  --topbar: calc(56px + env(safe-area-inset-top, 0px)); --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1419; --panel: #171d25; --text: #e6e9ef; --muted: #98a2b3; --line: #2a323d; --soft: #16303d; --accent: #4cc9f0;
    --a: #8fb0c9; --b: #f07ab6; --both: #b48ef0; --bad: #ef6b6b; --ideal: #2fb35e; --good: #7cc22e; --mid: #f0a202; }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); overflow: hidden;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none; -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}
button, a, .item, .day, .chip { touch-action: manipulation; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); }
[hidden] { display: none !important; }
svg.ic { flex: 0 0 auto; vertical-align: -3px; }

/* ---------- barre du haut ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar); z-index: 1100;
  display: flex; align-items: center; gap: 8px; padding: var(--safe-t) 10px 0 12px;
  background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: 0 1px 8px rgba(0,0,0,.08);
}
.brand { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 16px; }
.brand-text small { font-size: 11.5px; color: var(--muted); }
.who { display: flex; gap: 6px; align-items: center; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; opacity: .55; transition: opacity .15s, box-shadow .15s;
}
.avatar.a { background: var(--a); } .avatar.b { background: var(--b); }
.avatar.on { opacity: 1; box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px currentColor; }
.avatar.a.on { color: var(--a); } .avatar.b.on { color: var(--b); }
.avatar span { color: #fff; }
.who .me { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 2px; border-radius: 17px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; font-weight: 600; max-width: 140px; }
.who .me .avatar { width: 28px; height: 28px; font-size: 12px; opacity: 1; box-shadow: none; }
.who .me span.n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .avatar.other { width: 28px; height: 28px; font-size: 12px; opacity: .45; }
.iconbtn {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line); color: var(--text);
}
.iconbtn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.iconbtn { position: relative; }
.iconbtn .cnt { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--both); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--panel); }
.iconbtn.float { background: var(--panel); border: 0; box-shadow: var(--shadow); }
.linkbtn { color: var(--accent); font-weight: 600; font-size: 13.5px; min-height: 40px; display: inline-flex; align-items: center; gap: 4px; padding: 0 4px; }

/* ---------- carte ---------- */
#map { position: fixed; inset: var(--topbar) 0 0 0; z-index: 1; background: #1b3a4b; }
.leaflet-container { font: inherit; }
.leaflet-control-zoom, .leaflet-control-scale { display: none; }   /* sur téléphone : pincer pour zoomer ; la légende occupe le coin */
.leaflet-bottom { bottom: calc(var(--sheet-h, 58vh) + 2px); transition: bottom .25s; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--panel) 85%, transparent); color: var(--muted); }
.leaflet-control-attribution { font-size: 10px; }
.map-tools { position: fixed; right: 10px; top: calc(var(--topbar) + 10px); z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.map-tools #btn-3d { font-weight: 800; font-size: 13px; letter-spacing: .02em; }
.hill-tiles { mix-blend-mode: multiply; }
.view3d { position: fixed; inset: var(--topbar) 0 0 0; z-index: 2; background: #0b1519; }
#gl { position: absolute; inset: 0; }
.v3-hint { position: absolute; left: 50%; top: 60px; transform: translateX(-50%); padding: 7px 12px; border-radius: 16px; background: rgba(0,0,0,.55); color: #fff; font-size: 12.5px; text-align: center; max-width: 80vw; pointer-events: none; transition: opacity .4s; z-index: 2; }
.v3-hint.off { opacity: 0; }
.view3d .maplibregl-ctrl-bottom-right { bottom: calc(var(--sheet-h, 58vh) + 2px); transition: bottom .25s; }
.view3d .maplibregl-ctrl-attrib { font-size: 10px; }
.view3d .maplibregl-marker { cursor: pointer; }
.gl-tip .maplibregl-popup-content { font: 600 12px/1.2 system-ui, sans-serif; background: var(--text); color: var(--panel); padding: 5px 9px; border-radius: 8px; box-shadow: none; }
.gl-tip .maplibregl-popup-tip { display: none; }
/* ---------- itinéraire 3D jour par jour ---------- */
.itin { position: fixed; left: 10px; right: 10px; bottom: calc(var(--sheet-h, 58vh) + 10px); z-index: 1000; background: color-mix(in srgb, var(--panel) 94%, transparent); border-radius: 14px; box-shadow: var(--shadow); padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 8px; transition: bottom .25s; }
.it-days { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.it-days::-webkit-scrollbar { display: none; }
.it-days .chip { flex: 0 0 auto; height: 34px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.it-days .chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--dc); }
.it-days .chip small { font-weight: 500; }
.it-days .chip.on { background: var(--dc); color: #fff; border-color: var(--dc); } .it-days .chip.on i { background: #fff; }
.it-days .it-close { margin-left: auto; width: 36px; height: 36px; }
.it-card { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.it-card .it-n { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.it-card .it-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.it-card .it-t b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it-card .it-t b.link { color: var(--accent); cursor: pointer; }
.it-card .it-t span { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.it-card .it-k { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.it-nav { display: flex; gap: 8px; align-items: center; }
.it-nav .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
.it-nav .iconbtn:disabled, .it-nav .btn:disabled { opacity: .35; }
@media (hover: hover) { .v3-hint { display: none; } }
.legend {
  position: fixed; left: 10px; bottom: calc(var(--sheet-h, 58vh) - 8px); z-index: 1000; display: flex; gap: 8px; align-items: center;
  background: color-mix(in srgb, var(--panel) 92%, transparent); border-radius: 999px; padding: 5px 10px; font-size: 12px; color: var(--muted); transition: bottom .25s;
}
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.layer-chips { position: fixed; left: 10px; top: calc(var(--topbar) + 10px); z-index: 1000; display: flex; gap: 6px; }
.layer-chips button { white-space: nowrap; height: 36px; padding: 0 12px; border-radius: 999px; background: var(--panel); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.layer-chips button.on { color: var(--text); }
.layer-chips button.on .sw { opacity: 1; } .layer-chips .sw { width: 9px; height: 9px; border-radius: 50%; opacity: .3; }
.poi-pin { width: 24px; height: 24px; border-radius: 50%; color: #fff; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.poi-pin.small { width: 12px; height: 12px; border-width: 1.5px; }
.poi-pin.sel { width: 26px; height: 26px; }
.poi-pin.small svg { display: none; }
.leaflet-popup-content-wrapper { border-radius: 12px; font: inherit; background: var(--panel); color: var(--text); }
.leaflet-popup-tip { background: var(--panel); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; line-height: 1.4; }
.poi-pop b { font-size: 14px; display: block; margin-bottom: 2px; }
.poi-pop .k { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.poi-pop .m { color: var(--muted); font-size: 12px; margin-top: 2px; }
.poi-pop .l { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.poi-pop .l a { font-size: 12px; padding: 5px 8px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 4px; }
.nearby { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.nearby li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.nearby .name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nearby .m { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nearby .d { font-size: 12.5px; color: var(--muted); }
.nearby-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.nearby-tabs button { height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.nearby-tabs button.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.user-dot { width: 16px; height: 16px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(37,99,235,.25); }
.spot-tip { font-size: 12px; font-weight: 600; background: var(--text); color: var(--panel); border: 0; border-radius: 8px; padding: 5px 9px; }
.spot-tip::before { display: none; }

/* ---------- panneau glissant ---------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050;
  background: var(--panel); border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
  /* Hauteur fixe (plein écran) et déplacement par translation : aucune remise en page pendant le geste.
     --y : partie cachée sous l'écran ; --pad : même valeur, en bas du contenu, pour atteindre la fin de la liste. */
  height: calc(100vh - var(--topbar) - 6px); height: calc(100dvh - var(--topbar) - 6px);
  --y: calc(100% - 58vh); --pad: calc(42vh - var(--topbar) - 6px);   /* repli vh ; dvh sous @supports (une variable est toujours « valide », pas de double déclaration possible) */
  transform: translateY(var(--y)); transition: transform .25s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; padding-bottom: var(--safe-b);
  will-change: transform;
}
.sheet.peek { --y: calc(100% - 30vh); --pad: calc(70vh - var(--topbar) - 6px); }
.sheet.half { --y: calc(100% - 58vh); --pad: calc(42vh - var(--topbar) - 6px); }
.sheet.full { --y: 0px; --pad: 0px; }
@supports (height: 100dvh) {
  .sheet, .sheet.half { --y: calc(100% - 58dvh); --pad: calc(42dvh - var(--topbar) - 6px); }
  .sheet.peek { --y: calc(100% - 30dvh); --pad: calc(70dvh - var(--topbar) - 6px); }
}
.sheet.dragging { transition: none; }
.panel { padding-bottom: var(--pad, 0px); }
.handle { flex: 0 0 auto; padding: 10px 0 6px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.handle::before { content: ""; width: 42px; height: 5px; border-radius: 3px; background: var(--line); }
.tabs { touch-action: none; }
.panel { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.more { display: block; width: calc(100% - 16px); margin: 8px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--accent); font-weight: 600; }

/* ---------- accessibilité, mouvement, états ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
.skeleton { list-style: none; margin: 0; padding: 0 8px; }
.skeleton li { display: grid; grid-template-columns: 44px 64px 1fr; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.skeleton i { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--line) 25%, var(--bg) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton .sq { width: 44px; height: 44px; } .skeleton .ph { width: 64px; height: 64px; }
.skeleton .ln { height: 12px; margin: 6px 0; } .skeleton .ln.s { width: 60%; } .skeleton .ln.m { width: 85%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.banner { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--topbar) + 10px); z-index: 1200; background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 12px; padding: 10px 14px; font-size: 13px; display: flex; gap: 12px; align-items: center; max-width: min(92vw, 520px); }
.banner .linkbtn { white-space: nowrap; }
.intro { gap: 16px; }
.intro-steps { display: flex; flex-direction: column; gap: 10px; }
.intro-step { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; }
.intro-step .ic-box { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--accent); }
.intro-step h2 { font-size: 16px; margin: 0 0 2px; }
.intro-step p { margin: 0; font-size: 13.5px; color: var(--muted); }
.intro-dots { display: flex; gap: 5px; justify-content: center; }
.intro-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); } .intro-dots i.on { background: var(--accent); }
@media (hover: hover) { .item:hover { background: var(--bg); } }

/* ---------- onglets Explorer / Nos envies ---------- */
.tabs { display: flex; gap: 4px; margin: 0 12px 8px; padding: 3px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); flex: 0 0 auto; }
.tabs button { flex: 1; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.12); color: var(--text); }
.tabs button b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--both); color: #fff; font-size: 11px; display: grid; place-items: center; }
.tabs button b.new { background: var(--bad); }
.tag.new { color: #fff; background: var(--bad); border-color: var(--bad); }
.item .sugg-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--both); }
.item .sugg-row .linkbtn { min-height: 40px; font-size: 12.5px; padding: 0 8px; }
.pill.propose.on { background: var(--both); color: #fff; border-color: var(--both); }
.wtools { display: flex; flex-direction: column; gap: 6px; margin: 0 12px 8px; }
.wfoot { display: flex; flex-direction: column; gap: 8px; padding: 4px 12px 16px; }
.wfoot a, .wfoot button { text-decoration: none; }
.num { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px; position: relative; }
.num small { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; font-size: 10px; font-weight: 700; display: grid; place-items: center; color: #fff; border: 2px solid var(--panel); }
.item .plan { font-size: 12px; color: var(--accent); display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num-pin { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4); }
.num-pin.a { border-color: var(--a); } .num-pin.b { border-color: var(--b); } .num-pin.both { border-color: var(--both); }
.activity { margin: 0 12px 8px; padding: 8px 10px; border-radius: 10px; background: var(--soft); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.activity .h { display: flex; justify-content: space-between; align-items: center; color: var(--accent); font-weight: 600; }
.activity ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.activity li { display: flex; gap: 8px; align-items: baseline; }
.activity li small { color: var(--muted); white-space: nowrap; margin-left: auto; font-variant-numeric: tabular-nums; }
.item .notes { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--muted); }
.item .notes span { display: flex; gap: 5px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .notes i { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; color: #fff; font-style: normal; font-size: 9px; font-weight: 700; display: grid; place-items: center; }
.empty-state { padding: 20px 16px; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* ---------- configuration ---------- */
.config { padding: 0 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.config .card label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.config input[type=text], .config input[type=date], .config input[type=number], .config select { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--panel); color: var(--text); width: 100%; font-weight: 400; font-size: 14px; }
.config .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13.5px; }
.switch small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.switch .tg { flex: 0 0 auto; width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; transition: background .15s; }
.switch .tg::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: left .15s; }
.switch .tg.on { background: var(--accent); } .switch .tg.on::after { left: 21px; }
.config .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.config .btns .btn { flex: 1; min-width: 120px; }
.coords { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.config h2 { font-size: 18px; margin: 4px 0 0; }
.acct { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.acct span { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.acct small { color: var(--muted); }
.acct b#c-invite { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; background: var(--soft); padding: 2px 8px; border-radius: 6px; }
.auto-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.auto-chip.on { color: var(--accent); border-color: var(--accent); }

/* ---------- fiche de lieu (POI) ---------- */
.poi-panel { padding: 0 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.poi-head { display: flex; align-items: flex-start; gap: 10px; }
.poi-head .poi-pin { width: 44px; height: 44px; flex: 0 0 auto; }
.poi-head #poi-zoom { flex: 0 0 auto; }
.poi-head .poi-pin svg { width: 20px; height: 20px; }
.poi-head h2 { margin: 0; font-size: 19px; line-height: 1.2; flex: 1; }
.poi-head .k { font-size: 13px; font-weight: 600; }
.poi-meta { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.poi-meta span { display: flex; align-items: center; gap: 6px; }
.poi-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.poi-actions .btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; text-decoration: none; font-size: 14px; }
.poi-actions .btn.wide { grid-column: 1 / -1; }
.poi-actions .btn.on { background: var(--both); color: #fff; border-color: var(--both); }
.menu { display: flex; flex-direction: column; gap: 4px; }
.menu button { text-align: left; min-height: 48px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.menu button.danger { color: var(--bad); }
.menu .sub { color: var(--muted); font-size: 12px; margin-left: auto; }
.menu a.menu-link { text-decoration: none; color: var(--text); min-height: 48px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; display: flex; align-items: center; gap: 10px; }

/* ---------- séjour ---------- */
.trip { padding: 0 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.card .h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .h h3 { display: flex; align-items: center; gap: 6px; }
.base-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.base-name .home { width: 30px; height: 30px; border-radius: 50%; background: var(--text); color: var(--panel); display: grid; place-items: center; }
.base-search { display: flex; gap: 6px; }
.base-search input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--panel); color: var(--text); }
.sugg { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.sugg button { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.sugg button:last-child { border-bottom: 0; }
.sugg small { color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; }
.stepper b { min-width: 24px; text-align: center; }
.day-card { border-left: 4px solid var(--dc, var(--accent)); }
.day-card .h b { font-size: 15px; }
.day-card .h small { color: var(--muted); font-size: 12px; }
.stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.stops li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 36px 44px; gap: 4px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.stops li.dragging { opacity: .5; background: var(--soft); }
.stops .grip { width: 36px; height: 44px; display: grid; place-items: center; color: var(--muted); touch-action: none; cursor: grab; }
.stops li:last-child { border-bottom: 0; }
.stops .n { width: 24px; height: 24px; border-radius: 50%; background: var(--dc, var(--accent)); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.stops .n.poi { background: var(--muted); }
.stops .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stops .t small { color: var(--muted); }
.stops .d { font-size: 12.5px; color: var(--muted); white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 1.2; }
.stops .d .tm { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; font-style: normal; }
.stops .d .tm.late { color: var(--mid); }
.stops .lk { color: var(--accent); margin-right: 3px; vertical-align: -2px; }
.stops .tide { color: var(--mid); margin-left: 3px; vertical-align: -2px; }
.day-foot .tl { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.day-warn { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--mid); }
.day-warn svg { flex: 0 0 auto; margin-top: 2px; }
.pick .sub.by { color: var(--accent); }
.stops .ib { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.stops .ib:disabled { opacity: .25; }
.day-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.day-foot a { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; font-weight: 600; color: var(--accent); }
.day-foot .sc { display: inline-flex; gap: 4px; align-items: center; }
.day-foot .sc i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pick { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.pick button { text-align: left; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 13.5px; display: flex; gap: 8px; align-items: center; }
.pick button .sub { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.pick h4 { margin: 8px 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.day-pin { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.day-pin.poi { width: 18px; height: 18px; font-size: 9px; }
.home-pin { width: 30px; height: 30px; border-radius: 50%; background: var(--text); color: #fff; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4); }

/* ---------- programme d'une plage ---------- */
.plan-card { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.plan-card .h { display: flex; align-items: center; justify-content: space-between; }
.plan-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.plan-items li { display: grid; grid-template-columns: 24px minmax(0, 1fr) 20px 40px; gap: 8px; align-items: center; font-size: 14px; }
.plan-items .poi-pin { width: 24px; height: 24px; }
.plan-items .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-items .t small { color: var(--muted); }
.plan-items .who { width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.plan-items .who.a { background: var(--a); } .plan-items .who.b { background: var(--b); }
.plan-items .rm { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.plan-add { display: flex; gap: 6px; }
.plan-add input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--panel); color: var(--text); }
.plan-add button { width: 44px; height: 40px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.plan-note { display: flex; flex-direction: column; gap: 4px; }
.plan-note label { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.plan-note textarea { width: 100%; min-height: 56px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel); color: var(--text); resize: vertical; font: inherit; font-size: 13px; }
.plan-note .ro { font-size: 13px; color: var(--text); background: var(--panel); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; }
.nearby li { grid-template-columns: 28px minmax(0, 1fr) auto 44px; }
.nearby .add { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); background: var(--panel); }
.nearby .add.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.dim-spot { opacity: .35; }

/* ---------- jours, profil, recherche ---------- */
.days { display: flex; gap: 6px; padding: 2px 12px 8px; overflow-x: auto; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: 0 0 52px; height: 52px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.1;
}
.day b { font-size: 13px; font-weight: 600; } .day small { font-size: 12px; color: var(--muted); }
.day i { width: 6px; height: 6px; border-radius: 50%; display: block; margin-top: 3px; background: var(--none); }
.day.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.day.on b { font-weight: 700; } .day.on small { color: #fff; opacity: .85; } .day.on i { background: #fff !important; }
.seg { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.seg button {
  flex: 1; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; padding: 0 6px; min-width: 0;
}
.seg button.on { background: var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; color: var(--accent); }
.seg button.on.tone-a { color: var(--a); } .seg button.on.tone-b { color: var(--b); } .seg button.on.tone-both { color: var(--both); }
.toolrow { display: flex; gap: 6px; margin: 0 12px 8px; align-items: center; }
.toolrow .profiles-seg { flex: 1; margin: 0; }
.toolrow .iconbtn.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.search {
  display: flex; align-items: center; gap: 8px; margin: 0 12px 6px; height: 44px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line); padding: 0 12px; color: var(--muted);
}
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; height: 100%; color: var(--text); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { width: 36px; height: 36px; border-radius: 50%; color: var(--muted); font-size: 14px; display: grid; place-items: center; }
.summary { display: flex; justify-content: space-between; align-items: center; padding: 0 14px 6px; font-size: 13px; color: var(--muted); gap: 6px 8px; flex-wrap: wrap; }
.summary .right { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.chip-mini { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 12px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.chip-mini.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.summary b { color: var(--ideal); font-weight: 700; } .summary .warn { color: var(--bad); }

/* ---------- liste ---------- */
.list { list-style: none; margin: 0; padding: 0 8px 12px; }
.item {
  display: grid; grid-template-columns: 44px 64px minmax(0, 1fr) 40px; gap: 8px; align-items: center;
  padding: 8px 6px; border-radius: 12px; cursor: pointer; border-bottom: 1px solid var(--line);
}
.item:active, .item.sel { background: var(--bg); }
.score {
  width: 44px; height: 44px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; background: var(--none); line-height: 1;
}
.score b { font-size: 18px; font-weight: 800; } .score small { font-size: 9.5px; font-weight: 600; margin-top: 2px; opacity: .9; }
.c-ideal { background: var(--ideal); } .c-good { background: var(--good); } .c-mid { background: var(--mid); }
.c-bad { background: var(--bad); } .c-none { background: var(--none); }
.thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--line); display: block; }
.aerial { position: relative; overflow: hidden; background: #1b3a4b; flex: 0 0 auto; }
.aerial img { position: absolute; max-width: none; display: block; opacity: 0; transition: opacity .35s; }
.aerial img.ld { opacity: 1; }
.aerial .scalebar { position: absolute; left: 14px; top: 62px; height: 14px; border: 2px solid #fff; border-top: 0; font-size: 10.5px; line-height: 1; color: #fff; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.8); box-shadow: 0 1px 2px rgba(0,0,0,.5); padding-top: 1px; box-sizing: border-box; pointer-events: none; }
.aerial.thumb { background: var(--soft); }
.aerial .pinpt { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.45), 0 0 0 6px rgba(255,255,255,.35); }
.aerial.thumb .pinpt { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; background: transparent; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.5); }
.aerial.thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), inset 0 -14px 16px -12px rgba(0,0,0,.35); pointer-events: none; }
.aerial.slide { flex: 0 0 100%; scroll-snap-align: start; height: 100%; }
.hero .slides .aerial.slide { width: 100% !important; }
.thumb.empty { background: var(--soft); display: grid; place-items: center; color: var(--muted); }
.item .body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item .name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.item .name span:first-child { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { flex: 0 0 auto; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.item .meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cond { display: flex; gap: 2px 10px; flex-wrap: wrap; font-size: 13px; color: var(--text); min-width: 0; }
.cond span { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.cond .sun { color: var(--mid); } .cond .sea { color: var(--accent); } .cond .mu { color: var(--muted); }
.hearts { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.heart { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; background: none; }
.heart.a { color: var(--a); } .heart.b { color: var(--b); }
.heart.on { border-color: transparent; color: #fff; }
.heart.ro, .pill.ro { opacity: .55; cursor: default; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ideal); margin-right: 2px; box-shadow: 0 0 0 2px var(--panel); }
.sync-dot.err { background: var(--bad); }
.sync-dot.pending { background: var(--mid); }
.sync-dot { cursor: pointer; }
.who .sync-btn { display: flex; align-items: center; height: 34px; padding: 0 4px; }
.heart.a.on { background: var(--a); } .heart.b.on { background: var(--b); }

/* ---------- détail ---------- */
.detail { padding-bottom: 16px; }
.hero { position: relative; height: 250px; overflow: hidden; background: linear-gradient(160deg, #cfe3ee, #e7e3d3); }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero .slides { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-y; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.hero .slides::-webkit-scrollbar { display: none; }
.hero .slides img { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; -webkit-user-drag: none; user-select: none; }
.hero .slides .aerial.slide { scroll-snap-stop: always; }
.hero .slides, .hero .slides * { -webkit-touch-callout: none; }
.hero .dots { position: absolute; left: 0; right: 0; top: 60px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.hero .dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); }
.hero .dots i.on { background: #fff; }
.hero .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 44px; display: grid; place-items: center; color: #fff; opacity: .8; }
.hero .nav.l { left: 0; } .hero .nav.r { right: 0; }
.hero .count { position: absolute; right: 10px; top: 62px; font-size: 11px; color: #fff; background: rgba(0,0,0,.4); padding: 2px 7px; border-radius: 999px; }
@media (hover: none) { .hero .nav { display: none; } }
.hero .shade, .hero .cap, .hero .dots, .hero .count { pointer-events: none; }
.hero .cap a { pointer-events: auto; }
.hero .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,0) 45%, rgba(0,0,0,.72) 100%); }
.hero.nophoto .shade { background: linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.45)); }
.hero .tl, .hero .tr { position: absolute; top: 10px; display: flex; gap: 8px; }
.hero .tl { left: 10px; } .hero .tr { right: 10px; }
.hero .iconbtn { background: rgba(255,255,255,.92); border: 0; color: #1d2430; }
.hero .cap { position: absolute; left: 14px; right: 14px; bottom: 12px; color: #fff; display: flex; flex-direction: column; gap: 4px; }
.hero .cap .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.hero h2 { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.hero .score { width: 52px; height: 52px; border-radius: 14px; flex: 0 0 auto; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.hero .score b { font-size: 20px; }
.hero .sub { font-size: 13px; opacity: .92; } .hero .credit { font-size: 11.5px; opacity: .85; } .hero .credit a { color: #fff; }
.dbody { padding: 12px 12px 0; display: flex; flex-direction: column; gap: 12px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions .spacer { flex: 1; }
.pill { height: 40px; padding: 0 12px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); text-decoration: none; }
.pill.a { color: var(--a); } .pill.b { color: var(--b); }
.pill.a.on { background: var(--a); color: #fff; border-color: var(--a); } .pill.b.on { background: var(--b); color: #fff; border-color: var(--b); }
.pill.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.links { display: flex; gap: 6px; flex-wrap: wrap; }
.links a, .links button { font-size: 13px; padding: 8px 10px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); text-decoration: none; color: var(--text); display: inline-flex; align-items: center; gap: 5px; min-height: 40px; }
.daycards { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; margin: 0 -12px; padding: 2px 12px; }
.daycards::-webkit-scrollbar { display: none; }
.daycard { flex: 0 0 70px; height: 84px; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--text); }
.daycard b { font-size: 12px; white-space: nowrap; } .daycard.on { outline: 2px solid var(--accent); }
.daycard .sc { padding: 0 7px; border-radius: 6px; color: #fff; font-weight: 700; }
.reasons { font-size: 13.5px; color: var(--muted); } .reasons b { color: var(--text); }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.kv div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv b { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kv span { display: flex; align-items: center; gap: 5px; font-size: 13px; white-space: nowrap; overflow: hidden; }
.kv .sun { color: var(--mid); } .kv .sea { color: var(--accent); } .kv .mu { color: var(--muted); }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0; font-weight: 600; }
.sect { display: flex; flex-direction: column; gap: 6px; }
.sect .h { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); }
svg.spark { width: 100%; height: 64px; display: block; }
.advice { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--soft); color: var(--accent); font-size: 12.5px; }
.advice b { font-weight: 700; }
table.hours { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.hours th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
table.hours td { padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.hours tr.night { opacity: .5; }
.desc { font-size: 13px; margin: 0; }

/* ---------- dialogues ---------- */
dialog { border: 0; border-radius: var(--radius); padding: 0; background: var(--panel); color: var(--text); box-shadow: var(--shadow); width: min(92vw, 440px); max-height: 92vh; }
dialog::backdrop { background: rgba(29,36,48,.45); }
dialog.bottom { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 18px 18px 0 0; }
.dlg { padding: 12px 16px calc(16px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; }
.dlg h2 { margin: 0; font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lbl-row { display: flex; justify-content: space-between; align-items: baseline; }
.lbl-row b { font-size: 13px; color: var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: 13px; color: var(--text); }
.chips button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.dlg input[type=text] { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--bg); color: var(--text); width: 100%; }
.row { display: flex; gap: 8px; } .row.wrap { flex-wrap: wrap; }
.btn { padding: 10px 14px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; min-height: 40px; }
.btn.ghost { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.btn.big { height: 48px; font-size: 15px; font-weight: 700; }
.user-row { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: center; }
.dot { width: 18px; height: 18px; border-radius: 50%; } .dot.a { background: var(--a); } .dot.b { background: var(--b); }
.hint { margin: 0; font-size: 12px; color: var(--muted); }

#toast { position: fixed; left: 50%; bottom: min(calc(var(--sheet-h, 58vh) + 8px + var(--safe-b)), calc(100dvh - var(--topbar) - 72px)); transform: translateX(-50%); z-index: 2000; background: var(--text); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; text-align: center; }
#toast.show { opacity: .95; }
.loading { padding: 24px; text-align: center; color: var(--muted); }
.empty-state .btn { align-self: flex-start; }

/* ---------- desktop / tablette : panneau latéral ---------- */
@media (min-width: 900px), (orientation: landscape) and (max-height: 500px) and (min-width: 640px) {
  :root { --sidebar: 440px; }
  #map { inset: var(--topbar) 0 0 var(--sidebar); }
  .sheet, .sheet.peek, .sheet.half, .sheet.full { top: var(--topbar); bottom: 0; left: 0; right: auto; width: var(--sidebar); height: auto; transform: none; --pad: 0px; border-radius: 0; box-shadow: none; border-right: 1px solid var(--line); }
  .layer-chips { left: calc(var(--sidebar) + 58px); }
  .view3d { inset: var(--topbar) 0 0 var(--sidebar); }
  .itin { left: calc(var(--sidebar) + 10px); right: auto; width: min(480px, calc(100vw - var(--sidebar) - 20px)); bottom: 24px; }
  .view3d .maplibregl-ctrl-bottom-right { bottom: 0; }
  .tabs { position: sticky; top: 0; z-index: 2; background: var(--panel); margin: 0; padding: 8px 12px; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); }
  .tabs button { border: 1px solid transparent; } .tabs button.on { border-color: var(--line); }
  .handle { display: none; }
  .leaflet-bottom { bottom: 0; }
  .leaflet-control-zoom, .leaflet-control-scale { display: block; }
  .legend { left: calc(var(--sidebar) + 10px); bottom: 24px; }
  #toast { bottom: 24px; }
  dialog.bottom { margin: auto; width: min(92vw, 440px); border-radius: var(--radius); }
  .days { padding-top: 10px; }
}
@media (orientation: landscape) and (max-height: 500px) and (min-width: 640px) and (max-width: 899px) { :root { --sidebar: 360px; } }
