/* Roadtrip NZ — styles. Mobile d'abord ; panneau latéral flottant au-delà de 900 px. */

:root {
  color-scheme: light;
  --bg: #f3f0e8;
  --surface: #ffffff;
  --surface-2: #f8f6f1;
  --ink: #1b2a30;
  --muted: #5d6d72;
  --line: #e1dcd0;
  --brand: #0f4c5c;
  --brand-2: #1b6f86;
  --brand-soft: #e3eff1;
  --edit: #7a3fb0;
  --edit-soft: #f2eafa;
  --red: #d62828;
  --orange: #ef8a00;
  --green: #2b9348;
  --danger: #b42318;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(20 40 50 / 0.06), 0 4px 16px rgb(20 40 50 / 0.08);
  --topbar-h: 56px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Color Emoji", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--font);
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { line-height: 1.25; margin: 0; }
a { color: var(--brand-2); }
p { margin: 0.4em 0; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.ok { color: var(--green); font-weight: 600; }
.warn { color: #9a5b00; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ boutons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 13.5px; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgb(0 0 0 / 0.05); }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.edit { border-color: var(--edit); color: var(--edit); }
.btn.edit.on { background: var(--edit); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-2) 55%, transparent); outline-offset: 2px; }

/* ------------------------------------------------------------ barre du haut */

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px; padding-top: env(safe-area-inset-top);
  background: var(--brand); color: #fff;
  position: relative; z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; min-width: 0; flex: 1; }
.logo { font-size: 24px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand-text b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { opacity: 0.75; font-size: 12px; }
.seg { display: flex; background: rgb(255 255 255 / 0.14); border-radius: 999px; padding: 3px; }
.seg button {
  border: 0; background: transparent; color: #fff; font: inherit; font-weight: 600;
  padding: 6px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: #fff; color: var(--brand); }
.seg.trips button { display: inline-flex; align-items: baseline; gap: 5px; }
.seg.trips small { font-weight: 600; font-size: 11px; opacity: 0.7; }
.top-actions { display: flex; gap: 6px; align-items: center; flex: 1; justify-content: flex-end; }
.topbar .btn.ghost { color: #fff; border-color: rgb(255 255 255 / 0.3); }
.topbar .btn.ghost:hover { background: rgb(255 255 255 / 0.12); }
.topbar .btn.edit { background: #fff; border-color: #fff; }
.topbar .btn.edit.on { background: var(--edit); border-color: #c9a9ea; color: #fff; }
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px;
  background: var(--surface); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column;
}
.menu-pop button {
  text-align: left; border: 0; background: none; font: inherit; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--ink);
}
.menu-pop button:hover { background: var(--surface-2); }

/* ------------------------------------------------------------ barre d'édition */

.editbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 12px; background: var(--edit-soft); border-bottom: 1px solid #dccbef;
  font-size: 13.5px; position: relative; z-index: 999;
}
.editbar-status { font-weight: 700; color: var(--edit); }
.editbar-status.dirty { color: #b25e00; }
.editbar-hint { color: var(--muted); }

/* ------------------------------------------------------------ vues */

.topbar, .editbar { flex: none; }
main { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; display: none; }
body[data-view="map"] #view-map { display: block; }
body[data-view="list"] #view-list { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#map { position: absolute; inset: 0; background: #dfe9ec; }

/* ------------------------------------------------------------ panneau de carte */

.map-panel {
  position: absolute; z-index: 1001;
  left: 12px; top: 12px; bottom: 12px; width: 370px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.sheet-handle { display: none; }
.panel-body { overflow-y: auto; padding: 14px 14px 18px; flex: 1; -webkit-overflow-scrolling: touch; }
.panel-head h2 { font-size: 19px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 2px; font-weight: 600; }
.totals { color: var(--muted); font-size: 13.5px; margin: 4px 0 8px; }
.summary { color: #33474d; }
.detail-nav { display: flex; gap: 4px; align-items: center; margin: -4px -4px 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); opacity: 0.35; }
.chip.on { color: var(--ink); border-color: color-mix(in srgb, var(--c, var(--brand-2)) 55%, var(--line)); background: color-mix(in srgb, var(--c, var(--brand-2)) 9%, white); }
.chip.on i { opacity: 1; }
.chips.layers .chip.on { --c: var(--brand-2); }

.day-index { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.day-row, .stop-row, .camp-row {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  border: 0; background: none; padding: 8px; border-radius: 10px; font: inherit; color: inherit; cursor: pointer;
}
.day-row:hover, .stop-row:hover, .camp-row:hover { background: var(--surface-2); }
.day-num {
  flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 14px;
}
.day-main, .stop-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.day-title, .stop-name { font-weight: 650; }
.day-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-meta, .stop-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots { display: flex; gap: 3px; flex-wrap: wrap; max-width: 46px; justify-content: flex-end; }
.dots i { width: 7px; height: 7px; border-radius: 50%; }

.stops { list-style: none; padding: 0; margin: 8px 0; }
.stops li.filtered { opacity: 0.4; }
.num {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); color: #fff; font-weight: 800; font-size: 13px;
}
.camp-ico { flex: none; width: 26px; text-align: center; font-size: 18px; }
.camp-row.alt { opacity: 0.8; }
.alts-title { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 12px 0 2px; }
.panel-actions { margin-top: 14px; }

/* ------------------------------------------------------------ marqueurs */

.mk {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 3px solid var(--c); box-shadow: 0 2px 6px rgb(0 0 0 / 0.3);
  font-size: 15px; position: relative;
}
.mk-red { --c: var(--red); }
.mk-orange { --c: var(--orange); }
.mk-green { --c: var(--green); }
.mk.idea { border-style: dashed; background: #fbfbf8; }
.mk.faded, .mk-camp.faded { opacity: 0.45; filter: grayscale(0.4); }
.mk-num {
  position: absolute; top: -9px; right: -9px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: var(--c); color: #fff; font: 800 11px/18px var(--font); text-align: center;
  border: 1.5px solid #fff;
}
.mk-camp {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand); border: 2px solid #fff; box-shadow: 0 2px 6px rgb(0 0 0 / 0.35); font-size: 15px; position: relative;
}
.mk-camp.alt { width: 24px; height: 24px; background: #fff; border: 2px solid var(--brand); font-size: 12px; border-radius: 6px; }
.mk-camp.warn { background: #6d6d6d; }
.mk-camp small {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 2px;
  background: var(--brand); color: #fff; font: 700 10px/1.4 var(--font); padding: 0 5px; border-radius: 6px; white-space: nowrap;
}
.mk-flag { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); display: grid; place-items: center; box-shadow: 0 2px 6px rgb(0 0 0 / 0.3); }
.map-btn {
  width: 34px; height: 34px; border: 2px solid rgb(0 0 0 / 0.2); border-radius: 4px; background: #fff;
  font-size: 16px; cursor: pointer; background-clip: padding-box;
}
.leaflet-control-layers-toggle { width: 34px !important; height: 34px !important; }
body.editing #map { cursor: crosshair; }
.z-low .mk { transform: scale(0.6); }
.z-low .mk-camp { transform: scale(0.8); }
.z-low .mk-camp small, .z-low .mk-num { display: none; }

/* popups */
.nz-popup .leaflet-popup-content-wrapper { border-radius: 14px; }
.nz-popup .leaflet-popup-content { margin: 12px 14px; font: 14px/1.45 var(--font); }
.pop-title { font-weight: 750; font-size: 15.5px; margin-bottom: 6px; }
.pop-desc { margin: 6px 0; color: #33474d; }
.pop-tips { margin: 6px 0; font-size: 13px; color: #5a4a20; background: #fff7e3; padding: 6px 8px; border-radius: 8px; }
.pop-amen { margin: 6px 0; font-size: 16px; letter-spacing: 3px; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pop-actions .btn { color: var(--ink); }
.pop-actions a.btn { color: var(--ink); }
.pop-add { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.pop-add select { width: 100%; }

/* ------------------------------------------------------------ badges */

.badges { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: #3d5056; border: 1px solid var(--line);
}
.badge.prio { background: color-mix(in srgb, var(--c) 12%, white); color: color-mix(in srgb, var(--c) 80%, black); border-color: color-mix(in srgb, var(--c) 35%, white); }
.badge.prio::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.badge.camp { background: var(--brand-soft); color: var(--brand); border-color: #c5dde2; }
.badge.hot { background: #fdecea; color: #a1281c; border-color: #f4c5bf; }

/* ------------------------------------------------------------ vue liste */

.list-wrap { max-width: 820px; margin: 0 auto; padding: 16px 14px 80px; display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 16px; }
.trip-head h1 { font-size: 24px; }
.trip-head-top { display: flex; gap: 10px; align-items: flex-start; }
.lead { color: #33474d; font-size: 15.5px; }
.note { padding: 9px 12px; border-radius: 10px; font-size: 13.5px; }
.note.warn { background: #fff4e0; color: #6b4300; }
.notes summary { cursor: pointer; font-weight: 650; padding: 4px 0; }
.notes div { color: #33474d; font-size: 14px; }

.endpoint { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.endpoint-ico { font-size: 24px; }

.day { scroll-margin-top: 12px; }
.day.today { outline: 3px solid var(--brand-2); }
.day-head { display: flex; gap: 12px; align-items: flex-start; }
.day-head h2 { font-size: 19px; }
.day-badge {
  flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 17px;
}
.day-links { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.from { font-size: 13px; margin: 8px 0 0; }

.timeline { list-style: none; margin: 6px 0 0; padding: 0 0 0 14px; border-left: 3px solid var(--line); }
.timeline.plain { border-left: 0; padding-left: 0; }
.stop { position: relative; padding: 4px 0 4px 14px; scroll-margin-top: 12px; }
.timeline:not(.plain) .stop::before {
  content: ""; position: absolute; left: -23.5px; top: 24px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--c); border: 3px solid var(--surface);
}
.timeline:not(.plain) .stop:has(.leg)::before { top: 50px; }
.stop.filtered { opacity: 0.45; }
.leg { font-size: 12.5px; color: var(--muted); margin: 0 0 4px; }
.stop-card { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; border: 1px solid transparent; }
.stop-top { display: flex; gap: 10px; align-items: flex-start; }
.stop-ico { font-size: 20px; line-height: 1.2; flex: none; width: 26px; text-align: center; }
h3.stop-name { font-size: 16px; }
.desc { color: #2f4248; font-size: 14.5px; }
.tips { font-size: 13.5px; color: #5a4a20; background: #fff7e3; padding: 7px 10px; border-radius: 9px; }
.amen { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--muted); margin: 4px 0; }
.row-actions { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; max-width: 50%; }
.tbtn {
  width: 32px; height: 32px; display: inline-grid; place-items: center;
  border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; text-decoration: none; font-size: 15px;
}
.tbtn:hover { background: rgb(0 0 0 / 0.06); border-color: var(--line); }
.tbtn.danger:hover { background: #fdecea; }
.tbtn.wide { width: auto; padding: 0 10px; }

.night { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.night-title { font-weight: 750; color: var(--brand); margin: 0 0 6px; }
.camp-card { background: var(--brand-soft); border-radius: 12px; padding: 10px 12px; scroll-margin-top: 12px; }
.camp-card.alt { background: var(--surface-2); margin-top: 8px; }
.camp-card.forbidden { background: #f3f3f3; }
.camp-card.forbidden h3 { text-decoration: line-through; text-decoration-color: rgb(180 35 24 / 0.5); }
.alts { margin-top: 8px; }
.alts summary { cursor: pointer; font-size: 13.5px; font-weight: 650; color: var(--brand-2); padding: 4px 0; }
.ideas h2 { font-size: 19px; }
.credits { font-size: 12px; text-align: center; }
.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px var(--orange); } 100% { box-shadow: none; } }

/* éléments propres au mode édition */
body.editing .stop-card { border-color: #e6daf3; }
.add-btn {
  border: 2px dashed #cbb6e6; background: var(--edit-soft); color: var(--edit); font: inherit; font-weight: 650;
  border-radius: 12px; padding: 12px; cursor: pointer; width: 100%;
}
.add-btn.sm { padding: 8px; margin-top: 8px; font-size: 14px; }
.add-btn:hover { background: #eadcf8; }

/* ------------------------------------------------------------ tiroir d'édition */

.drawer {
  position: fixed; z-index: 2000; top: 0; right: 0; bottom: 0; width: min(480px, 100vw);
  background: var(--surface); box-shadow: -8px 0 30px rgb(0 0 0 / 0.18);
  transform: translateX(105%); transition: transform 0.22s ease; visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer form { height: 100%; display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; padding-top: calc(12px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 17px; flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.drawer-foot { display: flex; gap: 8px; padding: 12px 14px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface-2); }

.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 13px; font-weight: 650; color: #3d5056; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #cfc9bb; border-radius: 10px; padding: 9px 11px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); outline: 2px solid color-mix(in srgb, var(--brand-2) 25%, transparent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; }
.search-row { display: flex; gap: 6px; }
.geo-results { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.geo-item, .pick-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left;
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 10px; font: inherit; cursor: pointer; color: inherit;
}
.geo-item span, .pick-item span { font-size: 12.5px; color: var(--muted); }
.geo-item:hover, .pick-item:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.pick-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-top: 6px; }
.mini-map { height: 220px; border-radius: 12px; border: 1px solid var(--line); }
.prio-pick { display: flex; flex-direction: column; gap: 6px; }
.prio-pick label { cursor: pointer; }
.prio-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.prio-pick span {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px;
  border: 2px solid var(--line); font-weight: 600;
}
.prio-pick i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.prio-pick input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, white); }
.prio-pick input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--c) 40%, transparent); }
.amen-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.amen-pick label { cursor: pointer; }
.amen-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.amen-pick span { display: inline-block; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; }
.amen-pick input:checked + span { background: var(--brand-soft); border-color: var(--brand-2); color: var(--brand); font-weight: 600; }

/* ------------------------------------------------------------ dialogues */

.dialog {
  border: 0; border-radius: 16px; padding: 18px; width: min(640px, calc(100vw - 24px));
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.3); color: var(--ink);
}
.dialog.small { width: min(400px, calc(100vw - 24px)); }
.dialog.wide { width: min(1000px, calc(100vw - 24px)); height: min(90dvh, 900px); display: none; flex-direction: column; gap: 8px; }
.dialog.wide[open] { display: flex; }
.dialog::backdrop { background: rgb(15 30 40 / 0.45); }
.dialog h2 { font-size: 19px; margin-bottom: 6px; }
.dialog form { display: flex; flex-direction: column; gap: 10px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.json-tools { display: flex; gap: 6px; flex-wrap: wrap; }
#json-text { flex: 1; min-height: 200px; font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; tab-size: 2; }
.json-report { max-height: 160px; overflow-y: auto; font-size: 13.5px; }
.json-report ul { margin: 4px 0; padding-left: 20px; }
.history { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; max-height: 60dvh; overflow-y: auto; }
.history li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.history .muted { display: block; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px);
  z-index: 3000; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px;
  font-weight: 600; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: #1f6f3c; }
.toast.error { background: var(--danger); }

/* ------------------------------------------------------------ mobile */

@media (max-width: 899px) {
  :root { --topbar-h: 52px; }
  .seg button { padding: 6px 11px; }
  .brand-text small { display: none; }
  .map-panel {
    left: 0; right: 0; bottom: 0; top: auto; width: auto;
    border-radius: 18px 18px 0 0; box-shadow: 0 -4px 20px rgb(0 0 0 / 0.18);
    transition: height 0.22s ease; padding-bottom: env(safe-area-inset-bottom);
  }
  .map-panel[data-sheet="peek"] { height: 168px; }
  .map-panel[data-sheet="half"] { height: 52%; }
  .map-panel[data-sheet="full"] { height: calc(100% - 8px); }
  .sheet-handle {
    display: grid; place-items: center; flex: none; height: 22px; border: 0; background: none; cursor: pointer; padding: 0;
  }
  .sheet-handle i { width: 42px; height: 5px; border-radius: 3px; background: #c9c4b8; }
  .panel-body { padding-top: 0; }
  #view-map .leaflet-bottom { bottom: 168px; transition: bottom 0.22s ease; }
  #view-map[data-sheet="half"] .leaflet-bottom { bottom: 52%; }
  #view-map[data-sheet="full"] .leaflet-bottom { bottom: 100%; }
  .hide-sm { display: none; }
  .row-actions { max-width: 45%; }
  .day-badge { width: 40px; height: 40px; font-size: 15px; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .editbar { padding: 6px 10px; }
}
@media (max-width: 1100px) {
  .brand-text { display: none; }
  .brand { flex: 0 0 auto; }
}
@media (max-width: 640px) {
  .topbar { gap: 6px; padding: 0 8px; }
  .brand { display: none; }
  .seg.views span { display: none; }
  .seg button { padding: 6px 10px; }
  .seg.trips small { display: none; }
  .top-actions { flex: 0 0 auto; }
}
@media (max-width: 360px) {
  .seg button { padding: 6px 8px; font-size: 14px; }
}
