/* OùBus — "Hiver" identity. Two modes: Jour (light, default) and Nuit (dark,
   [data-theme="dark"]). Tangerine carries actions and buses; mint/teal carries
   transit data (route line, stops, ETAs); plum is the ink. */
:root {
  --surface: #ffffff;        /* panel, sheet */
  --card: #fff4e8;
  --card-live: #e2f6f2;
  --fg: #2e2452;
  --muted: #6e6590;
  --line: #e9dfd2;
  --action: #ff8552;         /* buttons, badges, bus markers */
  --action-fg: #2e2452;
  --transit: #0e8f84;        /* route line, ETAs, selected stop */
  --pin-bg: #2e2452;         /* bus number pill */
  --pin-fg: #ffb68f;
  --stale: #9a93ac;
  --error: #c62e2e;
  --shadow: 0 6px 24px rgba(46, 36, 82, .16);
  --font: Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
[data-theme="dark"] {
  --surface: #2d2352;
  --card: rgba(255, 246, 236, .07);
  --card-live: rgba(123, 224, 214, .12);
  --fg: #fff6ec;
  --muted: #b9b0d6;
  --line: rgba(255, 246, 236, .22);
  --action: #ffa06e;
  --action-fg: #221a3f;
  --transit: #7be0d6;
  --pin-bg: #221a3f;
  --pin-fg: #ffa06e;
  --stale: #8a85a0;
  --error: #ff9b9b;
  --shadow: 0 6px 24px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: var(--font); color: var(--fg); }
/* display:flex/grid on panel rows would otherwise override the hidden attribute */
[hidden] { display: none !important; }
#map { position: absolute; inset: 0; background: #f5efe5; }
[data-theme="dark"] #map { background: #191330; }

.panel {
  position: absolute; z-index: 2;
  top: max(10px, env(safe-area-inset-top, 0px));
  left: max(10px, env(safe-area-inset-left, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  max-width: 400px;
  max-height: calc(100dvh - 90px);
  overflow-y: auto;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow);
  padding: 9px 11px; display: grid; gap: 8px;
}
/* Rows must be able to shrink below their content's intrinsic width, or a
   dropdown's longest option drags every row wider than the panel. */
.panel > * { min-width: 0; }

.search { display: flex; align-items: center; gap: 8px; margin: 0; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; font: 700 17px/1 var(--font); color: var(--fg); background: transparent; }
.search input::placeholder { color: var(--muted); }
.badge {
  font: 800 11px/1 var(--font); letter-spacing: .07em; padding: 6px 8px; border-radius: 10px;
  background: var(--action); color: var(--action-fg); border: 0; cursor: default;
}
.badge.switchable { cursor: pointer; }
.badge.switchable:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.dir-select {
  appearance: none; -webkit-appearance: none;
  font: 800 12px/1.2 var(--font); color: var(--fg);
  background-color: var(--card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236e6590' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 10px;
  border: 0; border-radius: 999px; padding: 9px 26px 9px 12px;
  max-width: 110px; cursor: pointer;
}
[data-theme="dark"] .dir-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23b9b0d6' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
.dir-select:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.clear-btn {
  flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 999px;
  font: 700 13px/24px var(--font); cursor: pointer;
  background: var(--card); color: var(--muted);
}
.clear-btn:hover { background: color-mix(in srgb, var(--action) 18%, transparent); color: var(--action); }
.clear-btn:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.go {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: 12px; background: var(--action); color: var(--action-fg); cursor: pointer;
}
.go:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* Autosuggest: rows under the search field, same shape as the My stops menu. */
.suggest { display: grid; gap: 2px; }
.suggest-row {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0;
  font: 700 12px/1.2 var(--font); padding: 6px 8px; border: 0; border-radius: 10px;
  background: transparent; color: var(--fg); cursor: pointer; text-align: left;
}
.suggest-row:hover, .suggest-row[aria-selected="true"] { background: var(--card); }
.suggest-row:focus-visible { outline: 2px solid var(--action); outline-offset: -2px; }
.suggest-badge {
  flex: none; min-width: 26px; text-align: center;
  font: 800 11px/1 var(--font); padding: 5px 7px; border-radius: 8px;
  background: var(--action); color: var(--action-fg);
}
.suggest-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }

/* Chips wrap instead of overflow-scrolling: a hidden scrollbar is unreachable
   with a mouse. 4+ favorites collapse into the .favs-toggle dropdown. */
.fav-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fav-chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  font: 700 12px/1 var(--font); padding: 4px 11px 4px 4px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg); cursor: pointer;
  white-space: nowrap;
}
.fav-chip:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.chip-badge {
  font: 800 11px/1 var(--font); padding: 5px 7px; border-radius: 999px;
  background: var(--transit); color: var(--surface);
}
.chip-label { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }

.favs-caret { color: var(--muted); font-size: 10px; }
.fav-menu { width: 100%; display: grid; gap: 2px; }
.fav-row {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0;
  font: 700 12px/1.2 var(--font); padding: 6px 8px; border: 0; border-radius: 10px;
  background: transparent; color: var(--fg); cursor: pointer; text-align: left;
}
.fav-row:hover { background: var(--card); }
.fav-row:focus-visible { outline: 2px solid var(--action); outline-offset: -2px; }
.fav-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fav-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-row-dir { font-weight: 600; font-size: 11px; color: var(--muted); }

.fav-btn {
  flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0;
}
.fav-btn.on { color: var(--action); }
.fav-btn:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

label.toggle { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
label.toggle input { width: 16px; height: 16px; accent-color: var(--action); }
.route-head { display: flex; align-items: center; gap: 7px; min-width: 0; margin-right: auto; }
.route-mini { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-chip {
  font: 800 10.5px/1 var(--font); padding: 5px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--card-live); color: var(--transit);
}
.rel-chip.mixed { background: var(--card); color: var(--muted); }
.rel-chip.bad { background: color-mix(in srgb, var(--action) 18%, transparent); color: var(--action); }
.forget-btn {
  flex: none; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 999px;
  font: 700 14px/20px var(--font); cursor: pointer;
  background: var(--card); color: var(--muted);
}
.forget-btn:hover { background: color-mix(in srgb, var(--action) 18%, transparent); color: var(--action); }
.forget-btn:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.note { font-size: 12px; color: var(--muted); line-height: 1.4; }
.note.error { color: var(--error); }

.round-btn {
  position: absolute; z-index: 2;
  right: max(10px, env(safe-area-inset-right, 0px));
  bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 110px);
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--action); border: 0; box-shadow: var(--shadow); cursor: pointer;
}
.round-btn:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.round-btn.active { background: var(--action); color: var(--action-fg); }

.sheet {
  position: absolute; z-index: 3;
  left: 0; right: 0; bottom: 0;
  max-height: 46dvh;
  display: grid; grid-template-rows: auto 1fr; gap: 8px;
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
  padding: 12px 14px calc(10px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 640px) {
  .sheet { left: 12px; right: auto; bottom: 12px; width: 380px; border-radius: 20px; }
}
.sheet-head { display: flex; align-items: center; gap: 8px; }
.sheet-titles { display: grid; min-width: 0; margin-right: auto; }
.sheet-titles b { font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-close {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: var(--card); color: var(--fg); font-size: 13px; cursor: pointer;
}
.back {
  flex: none; font: 800 12px/1 var(--font); padding: 6px 10px; border-radius: 999px;
  border: 1.5px solid var(--action); background: var(--surface); color: var(--action); cursor: pointer;
}
.back:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

.cards { display: grid; gap: 6px; overflow-y: auto; align-content: start; }
.card {
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%;
  border: 0; border-radius: 14px; padding: 9px 10px;
  background: var(--card); color: var(--fg); cursor: pointer; font-family: var(--font);
}
.card[aria-pressed="true"] { background: var(--card-live); box-shadow: inset 0 0 0 1.5px var(--transit); }
.card:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.card .route-badge {
  flex: none; font: 800 12px/1 var(--font); padding: 5px 7px; border-radius: 8px;
  background: var(--action); color: var(--action-fg);
}
.card .eta { font: 800 15px/1.1 var(--font); color: var(--transit); min-width: 56px; }
.card .live-dot {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--transit); animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--transit) 45%, transparent); }
  50% { box-shadow: 0 0 0 5px transparent; }
}
.card .meta { font-size: 12px; color: var(--muted); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; }
.card .last-bus {
  flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
  font: 800 10.5px/1 var(--font); padding: 4px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--action) 18%, transparent); color: var(--action); white-space: nowrap;
}
.card .last-bus svg { flex: none; }
.hour-hint { color: var(--action); font-weight: 700; }
.card.untracked { cursor: default; }
.card.ride { cursor: default; }
.ride-del {
  flex: none; margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 0;
  background: transparent; color: var(--muted); font-size: 12px; cursor: pointer;
}
.ride-del:hover, .ride-del:focus-visible { color: var(--error); outline: none; }
a.lost-found { display: block; padding: 6px 2px; color: var(--transit); text-decoration: underline; }
a.pill-btn { text-decoration: none; display: inline-flex; }

.board-btn {
  margin: 7px 6px 0 0; font: 800 12px/1 var(--font); padding: 7px 11px; border-radius: 999px;
  border: 0; background: var(--action); color: var(--action-fg); cursor: pointer;
}
.board-btn:disabled { background: var(--card); color: var(--transit); cursor: default; }
.share-btn {
  margin-top: 7px; font: 800 12px/1 var(--font); padding: 6px 10px; border-radius: 999px;
  border: 1.5px solid var(--action); background: transparent; color: var(--action); cursor: pointer;
}
.popup-friend { display: block; margin: 2px 0; font-weight: 800; color: var(--transit); }

/* Shared-ride banner: the recipient's "your friend is on this bus" status. */
.ride-banner {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
  background: var(--card-live); border-radius: 12px; padding: 9px 11px;
  font: 700 13px/1.3 var(--font); color: var(--fg);
}
.ride-banner .lead { display: block; }
.ride-banner .next { display: block; font-size: 12px; color: var(--muted); }
.ride-banner .eta-line { display: block; color: var(--transit); font-weight: 800; }
.ride-banner.over { background: var(--card); color: var(--muted); }
.ride-banner .dismiss {
  margin-left: auto; flex: none; border: 0; background: transparent; cursor: pointer;
  font: 700 13px/1 var(--font); color: var(--muted); padding: 2px 4px;
}

/* Exit-stop picker: shown when sharing a ride, to declare where you get off. */
.exit-picker {
  position: absolute; z-index: 4;
  bottom: 0; left: 0; right: 0; margin: 0 auto; max-width: 480px;
  max-height: 55dvh; display: grid; grid-template-rows: auto 1fr;
  background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
  padding: 13px 14px max(12px, env(safe-area-inset-bottom, 0px));
}
.exit-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.exit-picker-head b { font-size: 16px; }
.exit-picker-list { overflow-y: auto; display: grid; gap: 5px; align-content: start; }
/* Ring on the map at the declared exit stop, while the ride is live. */
.exit-stop-marker { width: 26px; height: 26px; pointer-events: none; }
.exit-stop-marker::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 5px solid var(--action);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 30%, transparent), 0 2px 8px rgba(0, 0, 0, .25);
}

.exit-stop-row {
  display: flex; align-items: center; gap: 9px; text-align: left;
  border: 0; border-radius: 11px; padding: 10px 11px; cursor: pointer;
  background: var(--card); color: var(--fg); font: 700 14px/1.25 var(--font);
}
.exit-stop-row.skip { background: transparent; color: var(--muted); }
.exit-stop-row:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.exit-stop-row .stop-dot {
  flex: none; width: 11px; height: 11px; border-radius: 50%;
  background: var(--surface); box-shadow: inset 0 0 0 3px var(--transit);
}

.bottom-bar {
  position: absolute; z-index: 2;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  left: max(10px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; gap: 6px;
}
.pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 800 12px/1 var(--font); letter-spacing: .04em; padding: 10px 13px; border-radius: 999px;
  background: var(--surface); color: var(--fg); border: 1px solid var(--line); cursor: pointer; box-shadow: var(--shadow);
  white-space: nowrap;
}
.pill-btn:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.pill-btn[aria-expanded="true"] { background: var(--card); }
.pill-btn svg { display: block; flex: none; }
.lang { color: var(--muted); }

.metro-panel {
  position: absolute; z-index: 2;
  left: max(10px, env(safe-area-inset-left, 0px));
  bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 46px);
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
  padding: 11px 13px; display: grid; gap: 9px; min-width: 185px;
}
.metro-row { display: flex; align-items: center; gap: 8px; font: 700 13px/1.2 var(--font); cursor: pointer; }
.metro-row.all { font-weight: 800; }
.metro-row input { width: 16px; height: 16px; accent-color: var(--action); margin: 0; }
.metro-row.dim { opacity: .45; }
.metro-swatch { flex: none; width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }

/* No `position` here: MapLibre positions the marker element absolutely itself,
   and overriding it drops markers into normal flow, far off their lng/lat. */
.bus-marker { width: 34px; height: 34px; cursor: pointer; }
.bus-marker .body {
  position: absolute; inset: 0; border-radius: 50% 50% 50% 12px; background: var(--action); color: var(--action-fg);
  display: grid; place-items: center;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--action) 25%, transparent), 0 4px 14px rgba(0, 0, 0, .4);
  transition: background .5s;
}
.bus-marker .body svg { width: 20px; height: 20px; fill: var(--action-fg); }
.bus-marker .num {
  position: absolute; left: 50%; top: -9px; transform: translateX(-50%);
  font: 800 10px/1 var(--font); color: var(--pin-fg); background: var(--pin-bg); padding: 2px 6px; border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: color .5s;
}
/* Heading chevron: rotates with the bus bearing. */
.bus-marker .dir { position: absolute; inset: -7px; transform: rotate(0deg); transition: transform .3s linear; }
.bus-marker .dir::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 0; height: 0; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 8px solid var(--action);
}
.bus-marker.stale .body { background: var(--stale); box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.bus-marker.stale .num { color: var(--stale); }
.bus-marker.stale .dir::before { border-bottom-color: var(--stale); }

.user-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--transit); border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--transit) 40%, transparent), 0 1px 6px rgba(0, 0, 0, .3);
}

/* First-visit guided tour: the spotlight's giant box-shadow is the backdrop,
   so the highlighted control stays at full brightness inside it. */
.tour-overlay { position: fixed; inset: 0; z-index: 50; }
.tour-spotlight {
  position: absolute; border-radius: 18px; pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(46, 36, 82, .55);
  transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease;
}
[data-theme="dark"] .tour-spotlight { box-shadow: 0 0 0 200vmax rgba(10, 6, 26, .7); }
.tour-panel {
  position: absolute; width: min(320px, calc(100vw - 24px));
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow);
  padding: 14px 16px; display: grid; gap: 10px;
}
.tour-panel h2 { margin: 0; padding-right: 64px; font-size: 16px; font-weight: 800; }
.tour-panel p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.tour-lang {
  position: absolute; top: 12px; right: 12px;
  font: 800 11px/1 var(--font); padding: 6px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer;
}
.tour-lang:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.tour-dots { display: flex; gap: 5px; }
.tour-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tour-dot.on { background: var(--action); }
.tour-nav { display: flex; align-items: center; gap: 8px; }
.tour-skip {
  margin-right: auto; padding: 6px 0; border: 0; background: none;
  font: 700 12px/1 var(--font); color: var(--muted); text-decoration: underline; cursor: pointer;
}
.tour-skip:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.tour-nav.done .tour-skip { visibility: hidden; }
.tour-btn {
  font: 800 12px/1 var(--font); padding: 9px 14px; border-radius: 999px; cursor: pointer;
}
.tour-btn.next { border: 0; background: var(--action); color: var(--action-fg); }
.tour-btn.prev { border: 1.5px solid var(--line); background: transparent; color: var(--fg); }
.tour-btn:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* "Add to home screen" guide (install.js): modal screenshot carousel, one
   step at a time with scroll-snap, reusing the tour's dot/button styles. */
.ig-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 12px;
  background: rgba(46, 36, 82, .55);
}
[data-theme="dark"] .ig-overlay { background: rgba(10, 6, 26, .7); }
.ig-card {
  width: min(340px, 100%); height: min(620px, 100dvh - 24px);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow);
  padding: 14px;
}
.ig-head { display: flex; align-items: center; gap: 8px; }
.ig-head h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 800; }
.ig-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 100%;
  grid-template-rows: 100%; /* otherwise the implicit row grows to the image's intrinsic height */
  height: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.ig-track::-webkit-scrollbar { display: none; }
.ig-slide {
  margin: 0; min-width: 0;
  display: flex; flex-direction: column; gap: 8px;
  scroll-snap-align: center; scroll-snap-stop: always;
}
/* The image is absolutely positioned inside a flexing frame: iOS Safari does
   not reliably resolve an img's percentage height inside grid/flex tracks and
   lets it overflow to its intrinsic height, under the caption. */
.ig-frame {
  flex: 1; min-height: 0; position: relative;
  border-radius: 12px; background: var(--card);
}
.ig-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
}
.ig-slide figcaption {
  min-height: 42px; padding: 0 4px; text-align: center;
  font: 700 13px/1.45 var(--font); color: var(--fg);
}
.ig-nav { display: flex; align-items: center; gap: 8px; }
.ig-nav .tour-dots { margin-right: auto; }
.ig-nav .tour-btn.prev:disabled { opacity: .4; cursor: default; }

/* One-time "add to home screen" nudge above the bottom bar. */
.ig-nudge {
  position: absolute; z-index: 2;
  left: max(10px, env(safe-area-inset-left, 0px));
  bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 46px);
  max-width: min(330px, calc(100vw - 20px));
  display: flex; align-items: center; gap: 4px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow);
  padding: 4px 6px;
  animation: ig-nudge-in .35s ease;
}
@keyframes ig-nudge-in { from { opacity: 0; transform: translateY(8px); } }
.ig-nudge-text {
  display: flex; align-items: center; gap: 7px;
  border: 0; background: transparent; cursor: pointer; text-align: left;
  font: 700 13px/1.4 var(--font); color: var(--fg); padding: 6px 2px 6px 6px;
}
.ig-nudge-text svg { flex: none; }
.ig-nudge .dismiss {
  flex: none; align-self: flex-start; border: 0; background: transparent; cursor: pointer;
  font: 700 13px/1 var(--font); color: var(--muted); padding: 8px 6px;
}
.ig-nudge-text:focus-visible, .ig-nudge .dismiss:focus-visible {
  outline: 2px solid var(--action); outline-offset: 2px; border-radius: 8px;
}

.maplibregl-popup-content {
  font-family: var(--font); font-size: 13px; border-radius: 14px; padding: 10px 12px;
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow);
}
.maplibregl-popup-content b { display: block; font-size: 14px; font-weight: 800; margin-bottom: 2px; }
.popup-age { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.maplibregl-popup-tip { border-top-color: var(--surface) !important; border-bottom-color: var(--surface) !important; }
.maplibregl-popup-close-button { color: var(--muted); }
