/* TengoMaps app styles. Emerald, glass, motion. Light by day, dark at night. */
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/inter-400.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/inter-500.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/inter-600.woff") format("woff"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/inter-700.woff") format("woff"); }
@font-face { font-family: "Inter Display"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/inter-display-600.woff") format("woff"); }
@font-face { font-family: "Inter Display"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/inter-display-700.woff") format("woff"); }

:root {
  --em-50: #ecfdf5; --em-100: #d1fae5; --em-200: #a7f3d0; --em-300: #6ee7b7; --em-400: #34d399;
  --em-500: #10b981; --em-600: #059669; --em-700: #047857; --em-800: #065f46; --em-900: #064e3b; --em-950: #022c22;
  --red: #e5484d; --amber: #f5a524; --blue: #0090ff; --violet: #8e4ec6;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Inter Display", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --r-xs: 10px; --r-sm: 14px; --r: 18px; --r-lg: 24px; --r-xl: 30px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --t-fast: 160ms; --t: 280ms; --t-slow: 520ms;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --top-h: 64px;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root { --spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1); }
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff; --bg-2: #f4f7f5; --bg-3: #e9efec;
  --ink: #0b1410; --ink-2: #47564f; --ink-3: #7b8a83;
  --line: rgba(11, 20, 16, .08); --line-2: rgba(11, 20, 16, .14);
  --glass: rgba(255, 255, 255, .74); --glass-2: rgba(255, 255, 255, .9); --glass-line: rgba(255, 255, 255, .7);
  --accent: var(--em-600); --accent-2: var(--em-500); --accent-ink: #ffffff; --accent-soft: rgba(16, 185, 129, .12);
  --shadow-1: 0 1px 2px rgba(2, 44, 34, .06), 0 2px 10px rgba(2, 44, 34, .06);
  --shadow-2: 0 12px 36px rgba(2, 44, 34, .14), 0 3px 10px rgba(2, 44, 34, .08);
  --shadow-3: 0 30px 80px rgba(2, 44, 34, .22), 0 8px 24px rgba(2, 44, 34, .1);
  --scrim: rgba(3, 12, 9, .28);
  --nav: linear-gradient(135deg, #064e3b 0%, #047857 55%, #059669 100%);
  --chip: #ffffff; --chip-hover: #f2f5f3; --chip-on: #0b1410; --chip-on-ink: #ffffff;
  --chip-shadow: 0 1px 2px rgba(11, 20, 16, .14), 0 0 0 1px rgba(11, 20, 16, .06);
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050807; --bg-2: #0b1210; --bg-3: #121b18;
  --ink: #f1f7f4; --ink-2: #a8b7b0; --ink-3: #6e7e77;
  --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .14);
  --glass: rgba(12, 18, 16, .68); --glass-2: rgba(14, 21, 19, .9); --glass-line: rgba(255, 255, 255, .08);
  --accent: var(--em-400); --accent-2: var(--em-500); --accent-ink: #022c22; --accent-soft: rgba(52, 211, 153, .14);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 10px rgba(0, 0, 0, .3);
  --shadow-2: 0 14px 40px rgba(0, 0, 0, .5), 0 3px 10px rgba(0, 0, 0, .35);
  --shadow-3: 0 30px 90px rgba(0, 0, 0, .6), 0 8px 24px rgba(0, 0, 0, .4);
  --scrim: rgba(0, 0, 0, .5);
  --nav: linear-gradient(135deg, #022c22 0%, #064e3b 55%, #047857 100%);
  --chip: #1d2224; --chip-hover: #262c2e; --chip-on: #f1f7f4; --chip-on-ink: #0b1410;
  --chip-shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .07);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
html { background: var(--bg); }
body {
  font: 15px/1.45 var(--font); color: var(--ink); background: var(--bg);
  overflow: hidden; overscroll-behavior: none; -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
small { color: var(--ink-3); font-size: 12.5px; }
h3 { font: 600 15px/1.3 var(--font-display); letter-spacing: -.01em; margin: 18px 0 8px; }
input, select, textarea { min-width: 0; }
::selection { background: var(--accent-soft); }
.muted { color: var(--ink-3); }
.em { color: var(--accent); }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.small { font-size: 13px; }

/* ------------------------------------------------------------------ map */
#map { position: fixed; inset: 0; background: var(--bg-2); }
.maplibregl-ctrl-attrib { font-size: 10px !important; background: var(--glass) !important; border-radius: 8px 0 0 0; backdrop-filter: blur(10px); }
[data-theme="dark"] .maplibregl-ctrl-attrib { color: var(--ink-3); }
[data-theme="dark"] .maplibregl-ctrl-attrib a { color: var(--ink-2); }
.map-problem { position: fixed; inset: 0; display: grid; place-items: center; padding: 32px; text-align: center; color: var(--ink-2); background: var(--bg-2); z-index: 1; }

/* ------------------------------------------------------------------ glass */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--glass-line); box-shadow: var(--shadow-2);
}

/* ------------------------------------------------------------------ top bar and search */
.top { position: fixed; top: calc(10px + var(--safe-t)); left: 10px; right: 10px; z-index: 30; display: flex; flex-direction: column; gap: 8px; transition: transform var(--t) var(--ease), opacity var(--t) var(--ease); }
.askbar {
  display: flex; align-items: center; gap: 2px; height: 54px; padding: 0 6px; border-radius: 999px;
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--spring);
}
.askbar:focus-within { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-2); }
.askbar input { flex: 1; height: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; padding: 0 4px; }
.askbar input::placeholder { color: var(--ink-3); }
.askbar input::-webkit-search-cancel-button { display: none; }
.askbar.listening { box-shadow: 0 0 0 3px rgba(229, 72, 77, .25), var(--shadow-2); }
.askbar.listening::after, .askbar.thinking::after {
  content: ""; position: absolute; inset: auto 22px 6px 22px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 200% 100%; animation: shimmer 1.1s linear infinite;
}
.askbar { position: relative; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); flex: none; transition: background var(--t-fast), transform var(--t-fast) var(--spring); }
.icon-btn:hover { background: var(--accent-soft); color: var(--ink); }
.icon-btn:active { transform: scale(.9); }
.plan-btn { color: var(--accent); }
.plan-btn .icw { filter: drop-shadow(0 0 6px rgba(16, 185, 129, .45)); }
.avatar-btn { padding: 3px; }
.avatar {
  --a1: var(--em-400); --a2: var(--em-700);
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--a1), var(--a2)); color: #fff; font: 700 14px/1 var(--font-display); letter-spacing: -.02em;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.avatar.big { width: 72px; height: 72px; font-size: 28px; }
.avatar.guest { background: var(--bg-3); color: var(--ink-3); box-shadow: none; }

.cats-wrap { position: relative; min-width: 0; }
.cats {
  display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  padding: 2px 10px 8px; margin: 0 -10px; scroll-padding-inline: 10px;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px 0 11px; border: 0; border-radius: 999px;
  white-space: nowrap; flex: none; font: 500 13.5px/1 var(--font); letter-spacing: -.005em; color: var(--ink);
  background: var(--chip); box-shadow: var(--chip-shadow); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--spring);
}
.cat .ci { display: grid; place-items: center; color: var(--ink-2); flex: none; }
.cat:hover { background: var(--chip-hover); }
.cat:active { transform: scale(.96); }
.cat:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cat.on { background: var(--chip-on); color: var(--chip-on-ink); }
.cat.on .ci { color: inherit; }
.cats-arrow {
  position: absolute; top: 2px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--chip); color: var(--ink); box-shadow: var(--chip-shadow), 0 4px 14px rgba(0, 0, 0, .12); cursor: pointer;
}
.cats-arrow:hover { background: var(--chip-hover); }
.cats-arrow.prev { left: 0; }
.cats-arrow.next { right: 0; }
.cats-wrap.more-r .cats { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 64px), transparent calc(100% - 8px)); mask-image: linear-gradient(90deg, #000 calc(100% - 64px), transparent calc(100% - 8px)); }
.cats-wrap.more-l .cats { -webkit-mask-image: linear-gradient(90deg, transparent 8px, #000 64px); mask-image: linear-gradient(90deg, transparent 8px, #000 64px); }
.cats-wrap.more-l.more-r .cats { -webkit-mask-image: linear-gradient(90deg, transparent 8px, #000 64px, #000 calc(100% - 64px), transparent calc(100% - 8px)); mask-image: linear-gradient(90deg, transparent 8px, #000 64px, #000 calc(100% - 64px), transparent calc(100% - 8px)); }
@media (hover: none) { .cats-arrow { display: none !important; } }

.results { border-radius: var(--r-lg); max-height: min(60vh, 520px); overflow: auto; padding: 6px; animation: drop var(--t) var(--ease); }
.res-title { font: 600 11.5px/1 var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 12px 12px 6px; }
.res { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; text-align: left; transition: background var(--t-fast); }
.res:hover, .res:focus-visible { background: var(--accent-soft); outline: none; }
.res-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--bg-3); color: var(--ink-2); }
.res-text { display: flex; flex-direction: column; min-width: 0; }
.res-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-empty { padding: 18px 14px; color: var(--ink-3); }

.net-chip {
  position: fixed; top: calc(76px + var(--safe-t)); left: 50%; transform: translate(-50%, -12px); opacity: 0; z-index: 31; pointer-events: none;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--ink); color: var(--bg);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--spring);
}
.net-chip.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ floating buttons */
.fabs { position: fixed; right: 12px; bottom: calc(108px + var(--safe-b)); z-index: 20; display: flex; flex-direction: column; gap: 10px; transition: transform var(--t) var(--ease), opacity var(--t); }
.fab { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; color: var(--ink); transition: transform var(--t-fast) var(--spring), background var(--t-fast); }
.fab:active { transform: scale(.88); }
.fab.active { color: var(--accent); }
.fab-warn { background: linear-gradient(145deg, #ffb547, #f5a524); color: #2b1600; border: 0; box-shadow: 0 10px 26px rgba(245, 165, 36, .38); }
.fab-warn:active { transform: scale(.88) rotate(-8deg); }
.sos-fab {
  position: fixed; left: 12px; bottom: calc(108px + var(--safe-b)); z-index: 20; width: 56px; height: 56px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff6b6f, #e5484d 60%, #b9262b); color: #fff; font: 800 14px/1 var(--font-display); letter-spacing: .04em;
  box-shadow: 0 10px 30px rgba(229, 72, 77, .45); transition: transform var(--t-fast) var(--spring);
}
.sos-fab::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(229, 72, 77, .45); animation: pulse 2.4s var(--ease) infinite; }
.sos-fab:active { transform: scale(.9); }
body.sheet-open .fabs, body.sheet-open .sos-fab { opacity: 0; pointer-events: none; transform: translateY(16px); }

.speedo {
  position: fixed; left: 12px; bottom: calc(176px + var(--safe-b)); z-index: 21; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; text-align: center; background: var(--glass-2); box-shadow: var(--shadow-2); border: 3px solid var(--line-2);
  font: 700 22px/1 var(--font-display); font-variant-numeric: tabular-nums; transition: border-color var(--t), color var(--t);
}
.speedo small { display: block; font: 600 9px/1 var(--font); color: var(--ink-3); margin-top: 2px; text-transform: uppercase; }
.speedo.over { border-color: var(--red); color: var(--red); animation: nudge .6s var(--spring); }
.speedo .limit { position: absolute; right: -10px; top: -8px; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--red); color: #111; font: 700 11px/22px var(--font); }

/* ------------------------------------------------------------------ buttons and inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 14px;
  font-weight: 600; letter-spacing: -.005em; background: var(--bg-3); color: var(--ink); white-space: nowrap;
  transition: transform var(--t-fast) var(--spring), background var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
}
.btn:hover { background: var(--line-2); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: linear-gradient(180deg, var(--em-500), var(--em-600)); color: #fff; box-shadow: 0 8px 22px rgba(5, 150, 105, .3), inset 0 1px 0 rgba(255, 255, 255, .25); }
[data-theme="dark"] .btn.primary { background: linear-gradient(180deg, var(--em-400), var(--em-500)); color: var(--em-950); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.danger { background: var(--red); color: #fff; }
.btn.glassy { background: var(--glass); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px var(--glass-line); }
.btn.big { height: 54px; font-size: 16px; border-radius: 16px; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn.wide { width: 100%; }
.link { color: var(--accent); font-weight: 600; }
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg);
  outline: 0; transition: border-color var(--t-fast), box-shadow var(--t-fast); font-size: 16px;
}
textarea.input { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.field > label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.row { display: flex; align-items: center; gap: 8px; }
.row.end { justify-content: flex-end; }
.row.gap { gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; margin: 14px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 999px; font-weight: 500; font-size: 13.5px; background: var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line); transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--spring);
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.seg { display: flex; padding: 4px; border-radius: 14px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); gap: 2px; }
.seg button { flex: 1; min-width: 0; height: 36px; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: background var(--t), color var(--t), box-shadow var(--t); }
.seg button.on { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-1); }
[data-theme="dark"] .seg button.on { background: var(--bg-3); }
.toggle { display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.switch { width: 50px; height: 30px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background var(--t) var(--ease); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform var(--t) var(--spring); }
.toggle input:checked + .switch { background: var(--em-500); }
.toggle input:checked + .switch::after { transform: translateX(20px); }
.toggle input:focus-visible + .switch { box-shadow: 0 0 0 3px var(--accent-soft); }
.badge, .tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--bg-3); color: var(--ink-2); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge.ok, .ok { color: var(--em-700); }
.badge.ok { background: var(--accent-soft); }
[data-theme="dark"] .badge.ok, [data-theme="dark"] .ok { color: var(--em-300); }
.badge.warn, .warn { color: #a35d00; }
.badge.warn { background: rgba(245, 165, 36, .16); }
[data-theme="dark"] .badge.warn, [data-theme="dark"] .warn { color: #ffc76b; }
.badge.danger { background: rgba(229, 72, 77, .14); color: var(--red); }
.pro-badge { height: 20px; padding: 0 8px; border-radius: 999px; font: 700 10.5px/20px var(--font); letter-spacing: .06em; color: #fff; background: linear-gradient(120deg, var(--em-500), #14b8a6 50%, var(--em-700)); box-shadow: 0 4px 12px rgba(16, 185, 129, .35); }
.verify { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; font-size: 12.5px; }
.card { border-radius: var(--r); background: var(--bg-2); padding: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.note { font-size: 13px; color: var(--ink-2); background: var(--bg-2); border-radius: 14px; padding: 12px 14px; }
.privacy { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { border-radius: 14px; background: var(--bg-2); padding: 10px 12px; }
.kpi b { display: block; font: 700 18px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.kpi small { font-size: 11.5px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--ink-3); padding: 14px 0; }
.ic { display: inline-grid; place-items: center; }
.icw { display: inline-grid; place-items: center; line-height: 0; }
.progress { height: 6px; border-radius: 6px; background: var(--bg-3); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--em-400), var(--em-600)); transition: width var(--t) var(--ease); }

/* ------------------------------------------------------------------ bottom sheet (detents) */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(92dvh - var(--safe-t)); display: flex; flex-direction: column;
  background: var(--glass-2); -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-3); border: 1px solid var(--glass-line); border-bottom: 0;
  transform: translateY(105%); transition: transform var(--t-slow) var(--spring); will-change: transform; touch-action: pan-y;
}
/* --hide is the part of the sheet below the screen edge at the half and peek heights; the body gets the same
   extra space at the end so its last buttons can always be scrolled into view */
.sheet.open { --hide: calc(92dvh - var(--safe-t) - 56dvh); transform: translateY(var(--hide)); }
.sheet.open.peek { --hide: calc(92dvh - var(--safe-t) - 32dvh); }
.sheet.open.full { --hide: 0px; }
.sheet.dragging { transition: none; }
.grip { height: 22px; flex: none; display: grid; place-items: center; cursor: grab; touch-action: none; }
.grip::before { content: ""; width: 40px; height: 5px; border-radius: 5px; background: var(--line-2); }
.sheet-head { display: flex; align-items: center; gap: 4px; padding: 0 10px 6px 16px; flex: none; touch-action: none; }
.sheet-head .back { display: none; margin-left: -8px; }
.sheet.has-back .sheet-head .back { display: grid; }
.sheet-title { flex: 1; margin: 0; font: 700 22px/1.2 var(--font-display); letter-spacing: -.025em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 16px calc(28px + var(--safe-b) + var(--hide, 0px)); overscroll-behavior: contain; }
.sheet-body > * { animation: rise var(--t-slow) var(--ease) backwards; }
.sheet-body > *:nth-child(2) { animation-delay: 30ms; }
.sheet-body > *:nth-child(3) { animation-delay: 60ms; }
.sheet-body > *:nth-child(4) { animation-delay: 90ms; }
.sheet-body > *:nth-child(5) { animation-delay: 120ms; }
.sheet-body > *:nth-child(n+6) { animation-delay: 150ms; }
@media (min-width: 900px) {
  .sheet { left: 12px; right: auto; top: calc(130px + var(--safe-t)); bottom: 12px; width: 420px; height: auto; border-radius: var(--r-xl); border-bottom: 1px solid var(--glass-line); transform: translateX(-110%); }
  .sheet.open, .sheet.open.peek, .sheet.open.full { transform: none; --hide: 0px; }
  .grip { display: none; }
  .sheet-head { padding-top: 14px; }
  .top { right: auto; width: 420px; }
  body.sheet-open .fabs, body.sheet-open .sos-fab { opacity: 1; pointer-events: auto; transform: none; }
}

/* ------------------------------------------------------------------ drawer */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity var(--t) var(--ease); }
.drawer-card {
  position: absolute; z-index: 1; top: 0; bottom: 0; left: 0; width: min(340px, 86vw); background: var(--glass-2); backdrop-filter: blur(28px) saturate(170%);
  padding: calc(18px + var(--safe-t)) 14px calc(18px + var(--safe-b)); display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
  transform: translateX(-104%); transition: transform var(--t-slow) var(--spring); box-shadow: var(--shadow-3); border-right: 1px solid var(--glass-line);
}
.drawer.open .drawer-scrim { opacity: 1; }
.drawer.open .drawer-card { transform: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; font: 700 20px/1 var(--font-display); letter-spacing: -.03em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand .em { color: var(--accent); }
.profile-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 8px; width: 100%; text-align: left; }
.profile-card b { display: block; font: 600 15px/1.25 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-item { display: flex; align-items: center; gap: 14px; padding: 12px 10px; border-radius: 14px; font-weight: 500; text-align: left; width: 100%; transition: background var(--t-fast); }
.drawer-item:hover { background: var(--accent-soft); }
.drawer-item:active { background: var(--line-2); }
.drawer-item .icw { color: var(--ink-2); }
.drawer-item .badge, .drawer-item .pro-badge { margin-left: auto; }
.drawer-card small { padding: 10px 10px 0; }

/* ------------------------------------------------------------------ places and routes */
.place-title { font: 700 26px/1.15 var(--font-display); letter-spacing: -.03em; margin: 2px 0 4px; }
.route-dest { font-weight: 600; }
.routes { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.route-card {
  position: relative; border-radius: var(--r); padding: 14px 14px 14px 18px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  text-align: left; width: 100%; transition: box-shadow var(--t), transform var(--t-fast) var(--spring);
}
.route-card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--line-2); }
.route-card.on { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow-2); }
.route-card.on::before { background: var(--accent); }
.route-card:active { transform: scale(.985); }
.route-top { display: flex; align-items: baseline; gap: 10px; }
.route-time { font: 700 24px/1.1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.route-sub { color: var(--ink-3); font-size: 13.5px; }
.avoid { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.mode-seg { margin: 4px 0 10px; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.step-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-2); flex: none; color: var(--accent); }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; color: var(--ink-3); font-size: 13px; }

/* AI trip planner (Pro) */
.planner {
  position: relative; border-radius: var(--r-lg); padding: 16px; margin: 6px 0 12px; background: var(--bg);
  box-shadow: var(--shadow-1);
}
.planner::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(120deg, var(--em-400), #14b8a6, #22d3ee, var(--em-600)); background-size: 300% 300%; animation: flow 6s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.planner-head { display: flex; align-items: center; gap: 10px; font: 700 17px/1.2 var(--font-display); letter-spacing: -.02em; }
.planner-head .spark { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--em-400), #0d9488); box-shadow: 0 6px 16px rgba(13, 148, 136, .35); }
.brief { border-radius: var(--r); padding: 14px; background: linear-gradient(160deg, var(--accent-soft), transparent 70%); box-shadow: inset 0 0 0 1px var(--line); margin: 10px 0; }
.brief h4 { margin: 0 0 6px; font: 700 17px/1.25 var(--font-display); letter-spacing: -.02em; }
.brief ul { margin: 8px 0 0; padding-left: 18px; }
.brief li { margin: 3px 0; }
.brief .warn-list li { color: #a35d00; }
[data-theme="dark"] .brief .warn-list li { color: #ffc76b; }
.wx-strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.wx-cell { flex: none; min-width: 64px; border-radius: 14px; background: var(--bg-2); padding: 8px; text-align: center; font-size: 12px; }
.wx-cell b { display: block; font: 700 14px/1.2 var(--font-display); }
.wx-cell.bad { background: rgba(0, 144, 255, .12); box-shadow: inset 0 0 0 1px rgba(0, 144, 255, .25); }
.wx-cell.storm { background: rgba(142, 78, 198, .14); box-shadow: inset 0 0 0 1px rgba(142, 78, 198, .3); }
.wx-icon { font-size: 20px; line-height: 1.2; display: block; }

/* account and Pro */
.acct-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px 0 14px; }
.acct-head .uname { font: 700 22px/1.2 var(--font-display); letter-spacing: -.03em; }
.gbtn { display: flex; justify-content: center; min-height: 44px; }
.paywall-hero {
  border-radius: var(--r-lg); padding: 22px 18px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, #10b981 0%, #047857 45%, #022c22 100%); box-shadow: var(--shadow-2);
}
.paywall-hero h4 { font: 700 26px/1.1 var(--font-display); letter-spacing: -.035em; margin: 8px 0 6px; }
.paywall-hero p { margin: 0; opacity: .85; }
.paywall-hero::after { content: ""; position: absolute; width: 240px; height: 240px; right: -70px; top: -90px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .28), transparent 65%); animation: float 7s ease-in-out infinite; }
.perks { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.perks li { display: flex; gap: 12px; align-items: flex-start; }
.perks .icw { width: 30px; height: 30px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.plan { border-radius: var(--r); padding: 14px; text-align: left; box-shadow: inset 0 0 0 1px var(--line-2); background: var(--bg); transition: box-shadow var(--t), transform var(--t-fast) var(--spring); }
.plan.on { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow-1); }
.plan b { display: block; font: 700 20px/1.2 var(--font-display); letter-spacing: -.02em; }

/* ------------------------------------------------------------------ navigation */
.nav-top {
  position: fixed; top: calc(10px + var(--safe-t)); left: 10px; right: 10px; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r-lg); color: #fff; background: var(--nav); box-shadow: var(--shadow-3); animation: drop var(--t-slow) var(--spring);
}
.nav-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .14); flex: none; }
.nav-main { flex: 1; min-width: 0; }
.nav-dist { font: 700 30px/1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.nav-text { font-weight: 600; font-size: 16px; line-height: 1.25; opacity: .92; margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
.nav-then { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; background: rgba(0, 0, 0, .18); font-size: 13px; font-weight: 600; flex: none; }
.nav-bottom { position: fixed; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); z-index: 30; border-radius: var(--r-lg); padding: 12px 12px 12px 18px; display: flex; align-items: center; gap: 12px; animation: rise var(--t-slow) var(--spring); }
.nav-info { flex: 1; min-width: 0; }
.nav-eta { font: 700 24px/1.1 var(--font-display); color: var(--accent); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.nav-remain { color: var(--ink-3); font-size: 13.5px; }
.recenter { position: fixed; right: 12px; bottom: calc(96px + var(--safe-b)); z-index: 29; height: 44px; padding: 0 16px; border-radius: 999px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; animation: pop var(--t) var(--spring); }
body.navigating .top, body.navigating .fabs #dlBtn, body.navigating #layersBtn { display: none; }
body.navigating .fabs { bottom: calc(96px + var(--safe-b)); }
body.navigating .sos-fab { bottom: calc(96px + var(--safe-b)); }
body.navigating #toast { top: calc(120px + var(--safe-t)); }
body.navigating .maplibregl-ctrl-bottom-right { bottom: calc(80px + var(--safe-b)); }

/* ------------------------------------------------------------------ markers */
.user-puck { position: relative; width: 26px; height: 26px; }
.user-puck .acc { position: absolute; left: 50%; top: 50%; border-radius: 50%; background: rgba(16, 185, 129, .14); border: 1px solid rgba(16, 185, 129, .35); transform: translate(-50%, -50%); pointer-events: none; }
.user-puck .dot { position: absolute; inset: 3px; border-radius: 50%; background: var(--em-500); border: 3px solid #fff; box-shadow: 0 2px 10px rgba(2, 44, 34, .4); }
.user-puck .dot::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid rgba(16, 185, 129, .5); animation: ripple 2.2s var(--ease) infinite; }
.user-puck .cone { position: absolute; left: 50%; bottom: 50%; width: 60px; height: 60px; transform-origin: 50% 100%; margin-left: -30px; background: radial-gradient(circle at 50% 100%, rgba(16, 185, 129, .45), transparent 70%); clip-path: polygon(50% 100%, 18% 0, 82% 0); }
.user-puck.sim .dot { background: var(--violet); }
.mk { display: grid; place-items: center; }
.dest-pin, .result-pin, .hz-pin, .sos-pin { cursor: pointer; animation: pin-drop var(--t-slow) var(--spring) backwards; transform-origin: 50% 100%; }
.dest-pin svg { filter: drop-shadow(0 6px 10px rgba(2, 44, 34, .35)); }
.result-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); display: grid; place-items: center; background: var(--c, var(--accent)); border: 2px solid #fff; box-shadow: var(--shadow-2); }
.result-pin > * { transform: rotate(45deg); color: #fff; }
.hz-pin { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--c, var(--amber)); color: #fff; border: 3px solid #fff; box-shadow: 0 8px 18px rgba(0, 0, 0, .25); }
.sos-pin { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font: 800 11px/1 var(--font-display); border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(229, 72, 77, .25); animation: pin-drop var(--t-slow) var(--spring) backwards, beacon 1.6s ease-out infinite; }
.sos-area { border-radius: 50%; background: rgba(229, 72, 77, .14); border: 2px dashed rgba(229, 72, 77, .55); }

/* ------------------------------------------------------------------ reports (Waze style) */
.hz-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 12px; }
.hz-choice { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: var(--r); background: var(--bg-2); font-weight: 600; font-size: 13px; text-align: center; transition: transform var(--t-fast) var(--spring), box-shadow var(--t); }
.hz-choice:active { transform: scale(.92); }
.hz-choice.on { box-shadow: inset 0 0 0 2px var(--c, var(--accent)); background: var(--bg); }
.hz-ic { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c, var(--amber)); box-shadow: 0 10px 22px color-mix(in srgb, var(--c, #f5a524) 40%, transparent); }
.hz-ic.big { width: 64px; height: 64px; }
.hz-head { display: flex; align-items: center; gap: 14px; }
.hz-grid .hz-choice { animation: pop var(--t-slow) var(--spring) backwards; }
.hz-grid .hz-choice:nth-child(2) { animation-delay: 25ms; }
.hz-grid .hz-choice:nth-child(3) { animation-delay: 50ms; }
.hz-grid .hz-choice:nth-child(4) { animation-delay: 75ms; }
.hz-grid .hz-choice:nth-child(5) { animation-delay: 100ms; }
.hz-grid .hz-choice:nth-child(6) { animation-delay: 125ms; }
.hz-grid .hz-choice:nth-child(n+7) { animation-delay: 150ms; }

/* ------------------------------------------------------------------ safety: SOS, lost mode, chat */
.sos-big {
  width: 100%; border-radius: var(--r-lg); padding: 18px; display: flex; align-items: center; gap: 16px; text-align: left; color: #fff;
  background: radial-gradient(130% 160% at 0% 0%, #ff6b6f, #e5484d 50%, #a8232a); box-shadow: 0 16px 40px rgba(229, 72, 77, .38); transition: transform var(--t-fast) var(--spring);
}
.sos-big b { display: block; font: 700 22px/1.15 var(--font-display); letter-spacing: -.02em; }
.sos-big:active { transform: scale(.97); }
.safety-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.safety-tile { border-radius: var(--r); padding: 14px; text-align: left; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 8px; transition: transform var(--t-fast) var(--spring); }
.safety-tile:active { transform: scale(.97); }
.safety-tile .icw { width: 38px; height: 38px; border-radius: 12px; color: #fff; background: var(--c, var(--accent)); }
.safety-tile b { font: 600 15px/1.25 var(--font-display); }
.pluscode { font: 700 30px/1.1 var(--font-display); letter-spacing: .02em; text-align: center; padding: 14px; border-radius: var(--r); background: var(--bg-2); font-variant-numeric: tabular-nums; }
.compass { width: 160px; height: 160px; margin: 8px auto; border-radius: 50%; position: relative; background: radial-gradient(circle, var(--bg) 55%, var(--bg-2)); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); }
.compass .needle { position: absolute; left: 50%; top: 14px; bottom: 50%; width: 0; transform-origin: 50% 100%; transition: transform var(--t) var(--ease); }
.compass .needle::before { content: ""; position: absolute; left: -12px; top: 0; border: 12px solid transparent; border-bottom: 56px solid var(--accent); border-top: 0; }
.compass .dist { position: absolute; inset: auto 0 22px; text-align: center; font: 700 16px/1 var(--font-display); }
.helper-card { border-radius: var(--r); padding: 14px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); display: flex; flex-direction: column; gap: 8px; }
.helper-card .row b { font: 600 15px/1.2 var(--font-display); }
.msgs { display: flex; flex-direction: column; gap: 8px; padding: 6px 0; }
.msg { max-width: 86%; align-self: flex-start; border-radius: 18px 18px 18px 6px; padding: 9px 12px; background: var(--bg-2); animation: rise var(--t) var(--ease) backwards; }
.msg.mine { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: linear-gradient(180deg, var(--em-500), var(--em-600)); color: #fff; }
.msg.mine .muted { color: rgba(255, 255, 255, .75); }
.msg.mine .msg-body a { color: #fff; text-decoration: underline; }
.msg.sos { background: rgba(229, 72, 77, .12); box-shadow: inset 0 0 0 1px rgba(229, 72, 77, .35); }
.msg-head { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.msg-head .link { font-size: 12px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.composer { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: calc(-28px - var(--safe-b)); background: var(--glass-2); padding: 10px 0 calc(10px + var(--safe-b)); }
.composer .input { min-height: 46px; height: 46px; border-radius: 999px; }
.contact { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.contact .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mesh-stage { display: flex; flex-direction: column; gap: 10px; }
.mesh-status { font-weight: 600; }
.qr-box, .qr { display: grid; place-items: center; }
.qr { background: #fff; border-radius: var(--r); padding: 14px; width: min(280px, 80vw); margin: 0 auto; box-shadow: var(--shadow-1); }
.qr svg { width: 100%; height: auto; }
.scan-video { width: 100%; border-radius: var(--r); background: #000; aspect-ratio: 1; object-fit: cover; }
.read-code { width: 100%; }

/* ------------------------------------------------------------------ downloads */
.region, .pack { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.region-main, .pack-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; }
.region-main .icw { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.region-main small { display: block; }
.region-main:disabled { opacity: .6; }

/* ------------------------------------------------------------------ toast, modal */
#toast {
  position: fixed; top: calc(76px + var(--safe-t)); left: 50%; z-index: 60; width: max-content; max-width: min(92vw, 520px); transform: translate(-50%, -20px) scale(.96); opacity: 0;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 18px; border-radius: 18px; background: var(--ink); color: var(--bg);
  box-shadow: var(--shadow-3); pointer-events: none; transition: opacity var(--t) var(--ease), transform var(--t) var(--spring); font-weight: 500;
}
#toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.toast-btn { color: var(--em-400); font-weight: 700; padding: 6px 4px; white-space: nowrap; }
[data-theme="dark"] .toast-btn { color: var(--em-700); }
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: var(--scrim); animation: fade var(--t) var(--ease); }
.modal-card { width: min(420px, 100%); border-radius: var(--r-lg); background: var(--bg); padding: 20px; box-shadow: var(--shadow-3); animation: pop var(--t) var(--spring); }
.modal-card p { margin: 0 0 16px; font-size: 16px; }

/* ------------------------------------------------------------------ v2 shell: splash, planner pill, weather chip */
.splash {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(120% 80% at 50% 0%, var(--bg-2), var(--bg)); transition: opacity .6s var(--ease), visibility .6s;
}
.splash img { width: 84px; height: 84px; border-radius: 24px; box-shadow: 0 18px 50px rgba(5, 150, 105, .35); animation: pop .7s var(--spring) both; }
.splash-word { font: 700 30px/1 var(--font-display); letter-spacing: -.04em; animation: rise .7s var(--ease) .1s both; }
.splash-word span { color: var(--accent); }
.splash-bar { width: 120px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
body.ready .splash { opacity: 0; visibility: hidden; pointer-events: none; }

.plan-pill {
  position: fixed; left: 50%; bottom: calc(22px + var(--safe-b)); z-index: 20; transform: translateX(-50%);
  height: 50px; padding: 0 18px 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 10px;
  font: 600 15px/1 var(--font-display); letter-spacing: -.01em; color: var(--ink); white-space: nowrap; max-width: calc(100vw - 32px);
  transition: transform var(--t) var(--spring), opacity var(--t); animation: pill-in var(--t-slow) var(--ease) .2s backwards;
}
.plan-pill > span:not(.pro-badge) { overflow: hidden; text-overflow: ellipsis; }
.plan-pill .icw { color: var(--accent); filter: drop-shadow(0 0 8px rgba(16, 185, 129, .55)); }
.plan-pill::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: linear-gradient(120deg, var(--em-400), #14b8a6, #22d3ee, var(--em-600), var(--em-400)); background-size: 300% 300%; animation: flow 5s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.plan-pill:active { transform: translateX(-50%) scale(.96); }
body.sheet-open .plan-pill, body.navigating .plan-pill, body.searching .plan-pill { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(16px); }
body.navigating .cats-wrap, body.searching .cats-wrap { display: none; }
@media (min-width: 900px) {
  .top { right: 10px; width: auto; display: grid; grid-template-columns: 420px minmax(0, 1fr); column-gap: 10px; row-gap: 8px; align-items: start; pointer-events: none; }
  .top > * { pointer-events: auto; }
  .top .askbar { grid-column: 1; grid-row: 1; }
  .top .cats-wrap { grid-column: 2; grid-row: 1; align-self: center; margin-right: 64px; pointer-events: none; }
  .top .cats { margin: 0; padding: 4px 2px 6px; pointer-events: none; }
  .top .cat, .top .cats-arrow { pointer-events: auto; }
  .top .cats-arrow { top: 4px; }
  .top .results { grid-column: 1; grid-row: 2; }
  .sheet { top: calc(76px + var(--safe-t)); }
  .plan-pill { left: auto; right: 80px; transform: none; }
  .plan-pill:active { transform: scale(.96); }
  body.sheet-open .plan-pill { opacity: 1; pointer-events: auto; transform: none; }
}

.wx-chip { padding: 0 13px 0 11px; gap: 6px; font-variant-numeric: tabular-nums; }
.wx-chip.alert .ci { color: var(--amber); }
.wx-icon-sm { font-size: 17px; line-height: 1; }
.wx-hero { display: flex; align-items: center; gap: 14px; margin: 4px 0 10px; }
.wx-big { font-size: 46px; line-height: 1; }
.wx-hero b { display: block; font: 700 34px/1 var(--font-display); letter-spacing: -.03em; }
.wx-line { margin: 4px 0 8px; }

.upsell {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; margin: 12px 0 4px; padding: 12px 14px; border-radius: var(--r);
  background: linear-gradient(120deg, var(--accent-soft), transparent 80%); box-shadow: inset 0 0 0 1px var(--line); transition: transform var(--t-fast) var(--spring);
}
.upsell:active { transform: scale(.985); }
.upsell b { display: block; font: 600 14.5px/1.3 var(--font-display); }
.upsell .spark { width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--em-400), #0d9488); flex: none; }

/* navigation extras */
.nav-act { width: 44px; height: 44px; background: var(--bg-3); color: var(--ink); }
.nav-act.warn { background: linear-gradient(145deg, #ffb547, #f5a524); color: #2b1600; }
.speedo b { font: 700 22px/1 var(--font-display); }
.speedo.us .limit, .speedo .limit.us {
  border-radius: 6px; width: 34px; height: 42px; right: -16px; top: -14px; border: 2px solid #111; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font: 800 15px/1 var(--font); gap: 1px; box-shadow: var(--shadow-1);
}
.speedo .limit i { font: 700 5.5px/1.05 var(--font); font-style: normal; letter-spacing: .02em; text-align: center; width: 26px; }
.speedo .limit:not(.us) { display: grid; place-items: center; }
body[data-mode="walk"] .speedo { display: none; }

/* SOS markers, verified badges, lost mode */
.sos-beacon { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; border: 3px solid #fff; box-shadow: 0 10px 24px rgba(229, 72, 77, .45); cursor: pointer; animation: pin-drop var(--t-slow) var(--spring) backwards; }
.sos-beacon b { font: 800 11px/1 var(--font-display); letter-spacing: .04em; position: relative; }
.sos-beacon .ring { position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(229, 72, 77, .6); animation: ripple 2s var(--ease) infinite; }
.sos-beacon .ring.r2 { animation-delay: 1s; }
.sos-beacon.exact { background: #b9262b; }
.vcheck { width: 15px; height: 15px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--em-500); color: #fff; flex: none; }
.msg.mine .vcheck { background: #fff; color: var(--em-600); }
.compass-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: pop var(--t-slow) var(--spring) backwards; }
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: inline; }

/* ------------------------------------------------------------------ confetti and animations */
.confetti { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pill-in { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pulse { 0% { transform: scale(.9); opacity: .9; } 70% { transform: scale(1.35); opacity: 0; } 100% { opacity: 0; } }
@keyframes ripple { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .5); } 100% { box-shadow: 0 0 0 26px rgba(229, 72, 77, 0); } }
@keyframes pin-drop { from { opacity: 0; transform: translateY(-24px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes flow { to { background-position: 300% 0; } }
@keyframes float { 50% { transform: translate(-16px, 14px); } }
@keyframes nudge { 30% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* The app compares this with its own version: an older copy of this file (kept by a browser or a server cache)
   makes it clear its offline copy and load the files again. */
/* Free account screen (accounts required) and the card over a shared place */
.gate { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; overflow-y: auto;
  padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 52%, transparent); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  animation: fade var(--t) var(--ease); }
.gate-panel { width: min(420px, 100%); display: grid; gap: 10px; text-align: center; padding: 28px 22px 18px; border-radius: var(--r-xl);
  background: var(--glass-2); border: 1px solid var(--glass-line); box-shadow: var(--shadow-3); animation: rise var(--t-slow) var(--spring); }
.gate-logo { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 2px; }
.gate h1 { font: 700 26px/1.15 var(--font-display); letter-spacing: -.02em; margin: 0; color: var(--ink); }
.gate-sub { margin: 0 0 4px; color: var(--ink-2); }
.gate-points { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 10px; text-align: left; }
.gate-points li { display: flex; gap: 12px; align-items: center; color: var(--ink); }
.gate-points .icw { width: 34px; height: 34px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); flex: none; }
.gate-pro { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.gate-pro svg { color: var(--accent); }
.gate-sos { justify-self: center; display: inline-flex; gap: 8px; align-items: center; margin-top: 4px; padding: 10px 18px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer;
  color: var(--red); background: color-mix(in srgb, var(--red) 9%, transparent); border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); }
.gate-sos:hover { background: color-mix(in srgb, var(--red) 15%, transparent); }
.gate-legal { margin: 4px 0 0; font-size: 12px; color: var(--ink-3); }
.gate-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.gate-card { position: fixed; z-index: 32; left: 10px; right: 10px; top: calc(10px + var(--safe-t)); max-width: 520px; margin: 0 auto; display: grid; gap: 10px; padding: 14px;
  border-radius: var(--r-lg); background: var(--glass-2); border: 1px solid var(--glass-line); box-shadow: var(--shadow-2);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); animation: drop var(--t) var(--ease); }
.gate-card > .row > .icw { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.gate-card .grow small { display: block; }
.gate-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gate-card-actions .btn { min-width: 0; min-height: 44px; padding: 8px 12px; justify-content: center; text-align: center; white-space: normal; line-height: 1.2; }
body.gated-lite .top, body.gated-lite .cats-wrap { display: none; }
/* Your data: sign up choice and history list */
.check-line { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); cursor: pointer; line-height: 1.35; }
.check-line input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.history-list { display: grid; gap: 2px; margin-bottom: 12px; }
.history-item { display: flex; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.history-item:last-child { border-bottom: 0; }
.history-item > .icw { width: 36px; height: 36px; border-radius: 12px; background: var(--bg-2); color: var(--ink-2); flex: none; }
.history-main { display: grid; gap: 2px; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; min-width: 0; }
.history-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-main:disabled { cursor: default; }
:root { --tm-version: "2.0.6"; }
