:root {
  color-scheme: light;
  --bg: #f5f2ed;
  --surface: #ffffff;
  --surface-2: #efeae3;
  --ink: #1c1915;
  --ink-2: #57504a;
  --muted: #847b72;
  --line: #e3dcd2;
  --accent: #b4502a;
  --accent-ink: #ffffff;
  --accent-soft: #f5e1d6;
  --pin: #e8673a;
  --warn-bg: #fcefd2;
  --warn-ink: #7a4d00;
  --danger: #b3261e;
  --fc-bg: #e3eefb;
  --fc-ink: #1d4f8a;
  --toast-bg: #221e1a;
  --toast-ink: #f6f1ea;
  --shadow: 0 6px 24px rgba(40, 28, 18, 0.16), 0 1px 3px rgba(40, 28, 18, 0.12);
  --h0: #efeae3;
  --h1: #f6d3c0;
  --h2: #eda784;
  --h3: #db7a51;
  --h4: #bb552c;
  --h5: #8a3817;
  --h-ink-lo: #1c1915;
  --h-ink-hi: #ffffff;
  --winter: #6d8ca6;
  --spring: #5f9452;
  --summer: #c9952a;
  --fall: #b0602f;
  --top: 52px;
  --tabs: 60px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #12100e;
    --surface: #1c1916;
    --surface-2: #27221e;
    --ink: #f1ebe4;
    --ink-2: #c7bdb2;
    --muted: #91877d;
    --line: #342e29;
    --accent: #e57a4e;
    --accent-ink: #1a0f0a;
    --accent-soft: #3d271b;
    --pin: #f07a4a;
    --warn-bg: #3a2e14;
    --warn-ink: #f2cf83;
    --danger: #f28b82;
    --fc-bg: #1f2f45;
    --fc-ink: #9cc3f0;
    --toast-bg: #f1ebe4;
    --toast-ink: #1c1915;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
    --h0: #29241f;
    --h1: #6a3923;
    --h2: #964629;
    --h3: #c3582e;
    --h4: #e9794a;
    --h5: #f9ad88;
    --h-ink-lo: #f1ebe4;
    --h-ink-hi: #1a0f0a;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
input.mono { font-size: 15px; }
.mono::placeholder { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Shell */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: calc(var(--top) + var(--safe-t)); padding: var(--safe-t) 12px 0 16px;
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: 0.08em; font-size: 17px; }
.toptabs { display: none; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.views { position: fixed; left: 0; right: 0; top: calc(var(--top) + var(--safe-t)); bottom: calc(var(--tabs) + var(--safe-b)); overflow: hidden; }
.tab-pane { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tab-pane.offstage { visibility: hidden; pointer-events: none; }
.bottomtabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabs) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
}
.bottomtabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
}
.bottomtabs a.on { color: var(--accent); }
.fab {
  position: fixed; z-index: 25; right: 16px; bottom: calc(var(--tabs) + var(--safe-b) + 16px);
  width: 60px; height: 60px; border-radius: 50%; border: 0;
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow);
  display: grid; place-items: center;
}
.fab:active { transform: scale(0.96); }
body.card-open .fab { display: none; }

@media (min-width: 900px) {
  .toptabs { display: flex; gap: 4px; }
  .toptabs a {
    display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px;
    color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px;
  }
  .toptabs a:hover { background: var(--surface-2); }
  .toptabs a.on { background: var(--accent-soft); color: var(--accent); }
  .bottomtabs { display: none; }
  .views { bottom: 0; }
}

/* Buttons */
.btn {
  height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); font-weight: 650;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.btn.small { height: 36px; padding: 0 14px; font-size: 15px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: 0.5; cursor: default; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--ink);
  display: inline-grid; place-items: center; flex: none; padding: 0;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.tiny { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn.outline { border: 1px solid var(--line); background: var(--surface); }
.icon-btn.on-map { background: rgba(22, 19, 16, 0.74); color: #fff; backdrop-filter: blur(6px); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.icon-btn:disabled { opacity: 0.5; }
.install-chip {
  height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; font-weight: 650; display: inline-flex; align-items: center; gap: 6px;
}
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* Overlay sheet: full screen on phones, side drawer on desktop */
.overlay { position: fixed; inset: 0; z-index: 50; }
.sheet { position: absolute; inset: 0; background: var(--surface); animation: sheet-up 0.22s ease-out; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 900px) {
  .overlay { background: rgba(20, 16, 12, 0.28); }
  .sheet { left: auto; width: 460px; border-left: 1px solid var(--line); box-shadow: var(--shadow); animation-name: sheet-in; }
  @keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
.sheet-body { display: flex; flex-direction: column; height: 100%; }
.sheet-head {
  display: flex; align-items: center; gap: 8px; padding: calc(6px + var(--safe-t)) 8px 6px;
  min-height: calc(56px + var(--safe-t)); border-bottom: 1px solid var(--line);
}
.sheet-head h2 { flex: 1; margin: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head .btn { margin-right: 4px; }
.sheet-scroll { flex: 1; overflow-y: auto; padding: 16px 16px calc(32px + var(--safe-b)); }
@media (min-width: 900px) { .sheet-head { padding-top: 6px; min-height: 56px; } }

/* Form */
.field { margin-bottom: 20px; position: relative; }
.field > label, .mini-label { display: block; font-size: 13px; font-weight: 650; color: var(--ink-2); margin: 0 0 6px 2px; }
input:not([type="checkbox"]), select, textarea {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); font-size: 16px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input.invalid, textarea.invalid { border-color: var(--danger); }
input[type="date"] { appearance: none; -webkit-appearance: none; display: block; min-width: 0; }
textarea { height: auto; min-height: 112px; padding: 12px 14px; line-height: 1.45; resize: vertical; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }
.input-row .icon-btn { width: 48px; height: 48px; color: var(--accent); }
.combo { position: relative; }
.combo-icon { position: absolute; left: 14px; top: 15px; color: var(--muted); pointer-events: none; }
.combo input { padding-left: 42px; padding-right: 64px; }
.badge.new {
  position: absolute; right: 10px; top: 13px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
}
.menu {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.menu li { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; cursor: pointer; min-height: 46px; }
.menu li.hi { background: var(--surface-2); }
.menu-main { flex: 1; font-weight: 550; }
.menu-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.menu-count { color: var(--muted); font-size: 12px; min-width: 14px; text-align: right; }
.menu li.add-new { color: var(--accent); border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.err { color: var(--danger); font-size: 14px; margin: 6px 2px 0; }
.note { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2); margin: 8px 2px 0; }
.note.subtle { color: var(--muted); font-size: 13px; }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 10px; border-radius: 10px; margin-left: 0; }
.chipbox {
  position: relative; min-height: 48px; padding: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: text;
}
.chipbox:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.chipbox input { flex: 1; min-width: 110px; height: 34px; border: 0; padding: 0 6px; background: transparent; }
.chipbox input:focus { outline: none; }
.chip {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px 3px 3px 11px; border-radius: 999px;
  background: var(--accent-soft); font-size: 14px; font-weight: 550;
}
.chip.static { padding: 4px 11px; }
.chip-x { width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; color: var(--ink-2); padding: 0; }
.trip-form .btn.danger { width: 100%; margin-top: 8px; }

/* Weather */
.wx { display: flex; align-items: center; gap: 8px; margin: 10px 2px 0; font-size: 15px; color: var(--ink); }
.wx.muted { color: var(--muted); font-size: 14px; }
.wx-precip { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-2); }
.wx-mini { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 13px; flex: none; }
.tag {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 6px;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.tag.forecast { background: var(--fc-bg); color: var(--fc-ink); }

/* Toast + banners */
.toast {
  position: fixed; z-index: 400; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabs) + var(--safe-b) + 18px);
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 999px; background: var(--toast-bg); color: var(--toast-ink);
  font-size: 15px; font-weight: 550; box-shadow: var(--shadow); animation: toast-in 0.2s ease-out;
}
.toast.warn { background: var(--warn-bg); color: var(--warn-ink); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (min-width: 900px) { .toast { bottom: 24px; } }
.banner {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(var(--top) + var(--safe-t) + 8px);
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14px; font-weight: 600;
}
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 14px; top: calc(8px + var(--safe-t)); }

/* Trips list */
.trips-tools { position: sticky; top: 0; z-index: 5; padding: 12px 16px 8px; background: var(--bg); }
.search {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 6px 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--muted);
}
.search:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
.search input { border: 0; height: 44px; padding: 0; background: transparent; color: var(--ink); }
.search input:focus { outline: none; }
.search input::-webkit-search-cancel-button { display: none; }
.filters { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filters::-webkit-scrollbar { display: none; }
.pill {
  flex: none; height: 34px; width: auto; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.pill.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
select.pill { appearance: none; -webkit-appearance: none; padding-right: 11px; text-align: center; }
.trips-list { padding: 0 16px 120px; max-width: 760px; margin: 0 auto; }
.trips-tools > * { max-width: 728px; margin-left: auto; margin-right: auto; }
.result-count { font-size: 13px; color: var(--muted); margin: 6px 4px 0; }
.year-head { display: flex; justify-content: space-between; margin: 18px 4px 6px; font-size: 13px; font-weight: 750; color: var(--ink-2); letter-spacing: 0.02em; }
.trips-list ul, .sel-panel ul {
  list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.trips-list li + li, .sel-panel li + li { border-top: 1px solid var(--line); }
.trip-row {
  width: 100%; min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border: 0; background: none; text-align: left;
}
.trip-row:hover { background: var(--surface-2); }
.trip-date { width: 54px; flex: none; font-size: 13px; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.trip-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trip-name { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-row > .icon { color: var(--muted); flex: none; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.list-foot { display: flex; justify-content: center; margin: 28px 0 0; }

/* Year at a glance */
.year-view { padding: 16px 12px 120px; max-width: 760px; margin: 0 auto; }
.stats { display: flex; gap: 10px; }
.stats > div { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.stats b { display: block; font-size: 24px; font-weight: 750; line-height: 1.15; }
.stats span { font-size: 13px; color: var(--ink-2); }
.heat { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 10px 8px; }
.heat-row { display: grid; grid-template-columns: 42px repeat(12, minmax(0, 1fr)) 28px; gap: 3px; align-items: center; margin-bottom: 3px; }
.band {
  font-size: 10.5px; font-weight: 650; color: var(--ink-2);
  border-top: 3px solid; padding-top: 3px; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: clip;
}
.band.winter { border-color: var(--winter); }
.band.spring { border-color: var(--spring); }
.band.summer { border-color: var(--summer); }
.band.fall { border-color: var(--fall); }
.heat-gap { text-align: left; padding-left: 14px; color: var(--muted); font-size: 13px; line-height: 14px; letter-spacing: 0.2em; }
.heat-m { text-align: center; font-size: 12px; font-weight: 650; color: var(--muted); }
.heat-y { font-size: 13px; font-weight: 650; color: var(--ink-2); text-align: left; background: none; border: 0; padding: 0; font-variant-numeric: tabular-nums; }
button.heat-y:hover, .heat-y.sel { color: var(--accent); }
.heat-t { font-size: 13px; font-weight: 650; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.cell {
  aspect-ratio: 1; min-height: 22px; border: 0; border-radius: 6px; padding: 0;
  font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--h-ink-lo); background: var(--h0);
}
.cell:disabled { cursor: default; }
.cell:not(:disabled):hover { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--ink-2); }
.cell.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.l1 { background: var(--h1); }
.l2 { background: var(--h2); }
.l3 { background: var(--h3); color: var(--h-ink-hi); }
.l4 { background: var(--h4); color: var(--h-ink-hi); }
.l5 { background: var(--h5); color: var(--h-ink-hi); }
@media (prefers-color-scheme: dark) {
  .l1, .l2, .l3 { color: var(--h-ink-lo); }
  .l4, .l5 { color: var(--h-ink-hi); }
}
.profile { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); align-items: end; }
.profile .heat-y { align-self: end; padding-bottom: 2px; }
.bar-cell { height: 56px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.bar { width: 72%; min-height: 2px; background: var(--h4); border-radius: 4px 4px 0 0; }
.bar-n { order: -1; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin: 8px 6px 0; font-size: 12px; color: var(--muted); }
.legend i { width: 16px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .l1 { background: var(--h1); } .legend .l2 { background: var(--h2); } .legend .l3 { background: var(--h3); }
.legend .l4 { background: var(--h4); } .legend .l5 { background: var(--h5); }
.sel-panel { margin-top: 14px; }
.sel-panel h3 { display: flex; align-items: center; gap: 4px; margin: 0 4px 8px; font-size: 16px; }
.sel-panel h3 .icon-btn { margin-left: auto; }
@media (min-width: 600px) {
  .heat-row { grid-template-columns: 52px repeat(12, minmax(0, 1fr)) 36px; gap: 5px; margin-bottom: 5px; }
  .cell { font-size: 13px; border-radius: 8px; }
}

/* Map */
.map-view { position: absolute; inset: 0; }
.map-el { position: absolute; inset: 0; background: #2b2723; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 10px; }
path.canyon-pin { fill: var(--pin); }
.leaflet-tooltip { font-weight: 600; font-size: 13px; }
@media (pointer: coarse) { .leaflet-control-zoom { display: none; } }
.pin-icon svg path { fill: var(--pin); stroke: #fff; stroke-width: 2.5; }
.pin-icon svg circle { fill: #fff; }
.pin-icon { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45)); }
.canyon-card {
  position: absolute; z-index: 600; left: 10px; right: 10px; bottom: 10px; max-height: 60%; overflow-y: auto;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 14px 14px;
}
@media (min-width: 900px) { .canyon-card { right: auto; width: 380px; left: 16px; bottom: 16px; } }
.cc-head { display: flex; align-items: center; gap: 8px; }
.cc-head h2 { flex: 1; margin: 0; font-size: 20px; }
.cc-name-input { flex: 1; height: 42px; font-weight: 650; }
.cc-aliases { font-size: 14px; margin-top: 2px; }
.cc-coords { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 14px; color: var(--ink-2); }
.cc-coords .icon-btn { color: var(--accent); }
.cc-trips { list-style: none; margin: 6px 0 0; padding: 0; }
.link-row {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 2px; border: 0; background: none;
  border-bottom: 1px solid var(--line); text-align: left;
}
.link-row > span:first-child { font-weight: 600; }
.link-row > .muted { flex: 1; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.link-row > .icon { margin-left: auto; color: var(--muted); }
.cc-actions { display: flex; gap: 8px; margin-top: 12px; }
.cc-edit { margin-top: 10px; }

/* Pin picker */
.picker { position: fixed; inset: 0; z-index: 200; background: #000; }
.picker-map { position: absolute; inset: 0; }
.picker-top { position: absolute; z-index: 500; top: calc(12px + var(--safe-t)); left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.picker-title {
  background: rgba(22, 19, 16, 0.74); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 650;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62%; backdrop-filter: blur(6px);
}
.picker-bar {
  position: absolute; z-index: 500; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b));
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
}
@media (min-width: 900px) { .picker-bar { left: 50%; right: auto; transform: translateX(-50%); width: 460px; } }
.picker-coords { flex: 1; font-size: 14px; color: var(--ink-2); }
.picker .leaflet-control-zoom { margin-bottom: 84px; }

/* Trip detail */
.detail-date { font-size: 17px; font-weight: 650; }
.detail-people { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 0; color: var(--ink-2); }
.detail-notes { margin-top: 16px; line-height: 1.5; }
.detail-notes p { margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.minimap { display: block; width: 100%; height: 150px; margin: 16px 0 8px; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: #2b2723; }
.minimap > div { width: 100%; height: 100%; pointer-events: none; }
.minimap .leaflet-control-attribution { display: none; }
.detail-coords { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.detail-others h3 { font-size: 14px; color: var(--ink-2); margin: 20px 0 4px; }
.detail-others ul { list-style: none; margin: 0; padding: 0; }

/* Login, offline, splash, popover */
.login, .offline, .splash { min-height: 100dvh; display: grid; place-items: center; padding: 24px; text-align: center; }
.login form { width: min(320px, 100%); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.login img { border-radius: 18px; }
.login h1 { margin: 0 0 8px; letter-spacing: 0.1em; font-size: 22px; }
.login .btn { width: 100%; }
.offline { align-content: center; gap: 6px; color: var(--ink-2); }
.offline h2 { margin: 8px 0 0; color: var(--ink); }
.offline p { margin: 0 0 12px; }
.views .offline { min-height: 100%; }
.popover-backdrop { position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, 0.35); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.popover { background: var(--surface); border-radius: 16px; padding: 16px; max-width: 380px; width: 100%; box-shadow: var(--shadow); }
.popover p { margin: 0; line-height: 1.5; }
@media (min-width: 900px) { .popover-backdrop { align-items: flex-start; justify-content: flex-end; padding-top: 64px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
