:root {
  --bg: #061315;
  --surface: #0b2020;
  --surface-strong: #102c29;
  --lime: #c9f100;
  --cyan: #16e0d0;
  --purple: #b56cff;
  --yellow: #ffd43b;
  --text: #f5f4eb;
  --muted: #91a3a0;
  --danger: #ff5e57;
  --line: rgba(164, 199, 191, .18);
  --shadow: 0 18px 50px rgba(0, 0, 0, .36);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -10%, rgba(22, 224, 208, .12), transparent 32rem),
    radial-gradient(circle at 95% 15%, rgba(181, 108, 255, .08), transparent 28rem),
    linear-gradient(180deg, #061315, #071817 65%, #061315);
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--cyan), transparent 35%); outline-offset: 2px; }
.app-shell { width: min(100%, 560px); min-height: 100vh; margin: 0 auto; position: relative; border-inline: 1px solid rgba(255,255,255,.04); }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; padding: 11px 18px;
  background: rgba(6, 19, 21, .82); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.brand img { width: 44px; height: 52px; filter: drop-shadow(0 0 12px rgba(201,241,0,.28)); }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { font-size: 22px; letter-spacing: -.8px; font-style: italic; }
.brand-copy small { margin-top: 6px; color: var(--cyan); font-weight: 700; }
.brand-copy em { color: var(--lime); font-style: normal; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.icon-button, .avatar-button { border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.icon-button { width: 38px; height: 38px; border-radius: 13px; font-size: 23px; }
.avatar-button { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(145deg, var(--purple), #553077); font-weight: 900; box-shadow: 0 0 0 3px rgba(181,108,255,.15); }
main { min-height: calc(100vh - 150px); padding: 22px 17px calc(102px + var(--safe-bottom)); }
.loading-screen { min-height: 60vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.loading-symbol { width: 84px; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-8px) scale(1.04); filter: drop-shadow(0 0 18px var(--lime)); } }

.eyebrow { margin: 0 0 7px; color: var(--lime); font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(29px, 8vw, 38px); line-height: 1.02; letter-spacing: -1.25px; }
h2 { margin: 0; font-size: 20px; letter-spacing: -.45px; }
.lede { color: var(--muted); margin: 8px 0 20px; line-height: 1.5; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin: 25px 1px 12px; }
.section-head button { border: 0; background: transparent; color: var(--lime); cursor: pointer; font-weight: 800; }

.search-wrap { position: relative; margin: 18px 0 12px; }
.search-wrap::before { content: '⌕'; position: absolute; left: 16px; top: 11px; color: var(--muted); font-size: 22px; }
.search-wrap input { width: 100%; min-height: 48px; padding: 0 16px 0 47px; color: var(--text); background: rgba(8,25,26,.88); border: 1px solid rgba(94,143,137,.38); border-radius: 15px; }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 1px 8px; scrollbar-width: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); padding: 9px 14px; cursor: pointer; font-size: 13px; font-weight: 800; }
.chip.active { background: var(--lime); border-color: var(--lime); color: #122000; box-shadow: 0 0 20px rgba(201,241,0,.15); }

.hero-card, .panel, .stop-card, .progress-card, .decision-card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(15,42,39,.95), rgba(7,24,25,.96)); box-shadow: var(--shadow); }
.hero-card { border-radius: var(--radius); overflow: hidden; }
.hero-art { height: 180px; position: relative; display: flex; align-items: end; padding: 18px; background:
  linear-gradient(0deg, rgba(5,18,18,.95), transparent 70%),
  radial-gradient(circle at 72% 25%, rgba(255,212,59,.75) 0 5%, transparent 6%),
  linear-gradient(145deg, #35635c 0 25%, #163b38 25% 47%, #24483f 47% 65%, #102521 65%); }
.hero-art::after { content: ''; position: absolute; inset: auto 0 0; height: 42%; background: repeating-linear-gradient(100deg, rgba(7,18,18,.35) 0 3px, transparent 3px 32px); clip-path: polygon(0 55%,100% 0,100% 100%,0 100%); }
.top-pick { position: absolute; z-index: 2; top: 14px; left: 14px; padding: 7px 10px; border-radius: 8px; background: var(--purple); color: white; font-size: 11px; font-weight: 950; letter-spacing: .05em; }
.hero-art-copy { position: relative; z-index: 2; }
.hero-art-copy small { color: var(--cyan); font-weight: 800; }
.hero-card-body { padding: 17px; }
.stop-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rating { color: var(--yellow); background: rgba(255,212,59,.09); border: 1px solid rgba(255,212,59,.17); padding: 6px 9px; border-radius: 10px; font-weight: 900; white-space: nowrap; }
.meta { display: flex; flex-wrap: wrap; gap: 7px 12px; margin: 9px 0; color: var(--muted); font-size: 13px; }
.facility-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.facility { min-width: 33px; height: 33px; display: inline-grid; place-items: center; border-radius: 9px; background: rgba(4,17,17,.72); border: 1px solid var(--line); font-size: 12px; font-weight: 900; }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.tag { padding: 5px 8px; background: rgba(201,241,0,.08); color: #b7d97a; border-radius: 7px; font-size: 11px; font-weight: 800; }
.primary-button, .secondary-button { min-height: 48px; border-radius: 14px; padding: 0 18px; cursor: pointer; font-weight: 950; border: 1px solid transparent; }
.primary-button { color: #152000; background: linear-gradient(135deg, var(--lime), #a8d600); box-shadow: 0 10px 26px rgba(166,215,0,.16); }
.secondary-button { background: transparent; border-color: var(--purple); color: #d9b9ff; }
.button-row { display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; margin-top: 16px; }
.stop-list { display: grid; gap: 10px; }
.stop-card { padding: 15px; border-radius: 17px; box-shadow: none; cursor: pointer; transition: transform .2s, border-color .2s; }
.stop-card:hover { transform: translateY(-2px); border-color: rgba(22,224,208,.42); }

.map-shell { position: relative; margin: 17px -17px -20px; height: calc(100vh - 196px); min-height: 520px; overflow: hidden; border-block: 1px solid var(--line); }
#map { position: absolute; inset: 0; background: #0b2324; }
.map-overlay { position: absolute; z-index: 4; inset: 12px 13px auto; display: grid; gap: 9px; pointer-events: none; }
.map-search { pointer-events: auto; display: flex; align-items: center; gap: 9px; background: rgba(7,22,23,.9); backdrop-filter: blur(12px); border: 1px solid var(--line); padding: 10px 13px; border-radius: 14px; box-shadow: var(--shadow); }
.map-legend { justify-self: end; background: rgba(7,22,23,.9); padding: 7px 9px; border-radius: 10px; color: var(--muted); font-size: 11px; }
.map-bottom-card { position: absolute; z-index: 5; left: 13px; right: 13px; bottom: 15px; padding: 15px; border-radius: 19px; background: rgba(7,25,25,.95); border: 1px solid var(--line); box-shadow: 0 18px 60px rgba(0,0,0,.55); backdrop-filter: blur(15px); }
.map-marker { width: 42px; height: 52px; display: grid; place-items: start center; padding-top: 8px; color: #172100; font-weight: 950; background: var(--lime); border: 3px solid #e5ff55; border-radius: 50% 50% 50% 8px; transform: rotate(-45deg); box-shadow: 0 0 0 5px rgba(201,241,0,.13), 0 8px 25px rgba(0,0,0,.45); }
.map-marker span { transform: rotate(45deg); }
.maplibregl-ctrl-group { background: var(--surface) !important; }
.maplibregl-popup-content { color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.maplibregl-popup-tip { border-top-color: var(--surface) !important; }

.decision-card { margin-top: 19px; border-radius: 24px; overflow: hidden; }
.decision-top { padding: 21px; background: linear-gradient(135deg, rgba(201,241,0,.17), rgba(22,224,208,.06)); border-bottom: 1px solid var(--line); }
.decision-action { display: inline-flex; color: #152000; background: var(--lime); padding: 7px 11px; border-radius: 9px; font-size: 12px; font-weight: 950; letter-spacing: .08em; }
.decision-top h2 { font-size: 29px; margin-top: 13px; }
.decision-body { padding: 20px; }
.reason-list { list-style: none; padding: 0; margin: 15px 0 0; display: grid; gap: 10px; }
.reason-list li { display: flex; gap: 10px; align-items: center; color: #c9d7d3; }
.reason-list li::before { content: '✓'; color: var(--lime); font-weight: 950; }
.profile-toggle-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin-top: 17px; }
.profile-toggle { display: flex; align-items: center; gap: 10px; min-height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px; cursor: pointer; color: var(--muted); font-weight: 800; }
.profile-toggle.active { color: var(--text); border-color: var(--cyan); background: rgba(22,224,208,.08); }

.empty-state { min-height: 48vh; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty-icon { font-size: 55px; color: var(--purple); }
.progress-card { padding: 18px; border-radius: 20px; margin-top: 18px; }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-avatar { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; font-size: 24px; font-weight: 950; background: linear-gradient(145deg,var(--purple),#4c2b69); border: 3px solid rgba(255,255,255,.12); }
.level { margin-left: auto; color: var(--purple); font-weight: 950; font-size: 25px; }
.progress-track { height: 9px; margin: 18px 0 7px; background: #142826; border-radius: 999px; overflow: hidden; }
.progress-track span { display: block; width: 48%; height: 100%; background: linear-gradient(90deg,var(--lime),var(--cyan)); border-radius: inherit; }
.progress-stats { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.badge-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 13px; }
.badge { min-height: 112px; display: grid; place-content: center; justify-items: center; text-align: center; padding: 9px; border: 1px solid var(--line); background: rgba(8,24,24,.7); border-radius: 15px; }
.badge span { font-size: 36px; filter: drop-shadow(0 0 8px rgba(201,241,0,.22)); }
.badge b { margin-top: 7px; font-size: 11px; }
.badge.locked { filter: grayscale(1); opacity: .42; }
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 12px; }
.stat { padding: 13px 8px; text-align: center; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.stat strong { display: block; color: var(--lime); font-size: 22px; }
.stat small { color: var(--muted); }

.bottom-nav {
  position: fixed; z-index: 40; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, 560px); height: calc(72px + var(--safe-bottom)); padding: 8px 8px var(--safe-bottom);
  display: grid; grid-template-columns: repeat(5,1fr); background: rgba(5,17,18,.94); backdrop-filter: blur(24px); border-top: 1px solid var(--line);
}
.nav-item { border: 0; background: transparent; color: #788b88; display: grid; place-content: center; gap: 4px; cursor: pointer; }
.nav-item span { font-size: 21px; line-height: 1; }
.nav-item b { font-size: 10px; }
.nav-item.active { color: var(--lime); }
.nav-main span { width: 38px; height: 38px; display: grid; place-items: center; margin: -19px auto 0; border-radius: 50%; background: var(--lime); color: #132000; border: 5px solid #071718; box-shadow: 0 0 20px rgba(201,241,0,.3); }
.offline-banner { position: fixed; z-index: 100; top: 0; left: 50%; transform: translate(-50%,-110%); width: min(100%,560px); padding: 9px; text-align: center; background: var(--yellow); color: #231d00; font-weight: 900; transition: transform .25s; }
.offline-banner.show { transform: translate(-50%,0); }
.toast { position: fixed; z-index: 110; left: 50%; bottom: 90px; transform: translate(-50%,30px); max-width: calc(100% - 34px); padding: 11px 15px; border-radius: 12px; background: #eaf6ee; color: #102018; font-weight: 800; opacity: 0; pointer-events: none; transition: .25s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (min-width: 760px) {
  body { padding-block: 22px; }
  .app-shell { min-height: calc(100vh - 44px); border-radius: 28px; overflow: clip; box-shadow: 0 35px 110px rgba(0,0,0,.45); }
  .topbar { top: 22px; border-radius: 28px 28px 0 0; }
  .bottom-nav { bottom: 22px; border-radius: 0 0 28px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.location-row { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:14px 0; color:var(--muted); font-size:11px; }
.location-button { min-height:40px; border:1px solid var(--line); border-radius:12px; padding:0 13px; background:var(--surface); color:var(--cyan); font-weight:900; cursor:pointer; }
.location-button.active { border-color:var(--lime); color:var(--lime); box-shadow:0 0 18px rgba(201,241,0,.1); }
.location-button.wide { width:100%; margin-top:14px; }
.distance { color:var(--cyan)!important; font-weight:900; }
.stop-card.compact { display:flex; padding:0; overflow:hidden; min-height:90px; }
.stop-card-content { flex:1; min-width:0; padding:14px; }
.stop-thumb { width:112px; min-height:90px; object-fit:cover; background:var(--surface-strong); }
.hero-photo { position:relative; height:210px; display:flex; align-items:end; padding:15px; background-size:cover; background-position:center; }
.hero-photo small { position:relative; z-index:2; max-width:75%; color:#d4dfdc; font-size:9px; text-shadow:0 1px 4px #000; }
.map-title { display:flex; align-items:center; justify-content:space-between; }
.map-search input { flex:1; border:0; outline:0; background:transparent; color:var(--text); }
.map-bottom-card>p { color:var(--muted); text-align:center; }
.back-button { border:0; background:transparent; color:var(--cyan); font-weight:900; padding:0; margin-bottom:16px; cursor:pointer; }
.detail-photo { height:250px; margin:0 -17px 18px; background-size:cover; background-position:center; border-block:1px solid var(--line); }
.detail-meta { margin-bottom:18px; }
.detail-panel { padding:18px; border-radius:20px; }
.facility-row.large .facility { min-width:46px; height:40px; }
.detail-panel dl { margin:18px 0; border-top:1px solid var(--line); }
.detail-panel dl>div { display:flex; justify-content:space-between; gap:16px; padding:11px 0; border-bottom:1px solid var(--line); }
.detail-panel dt { color:var(--muted); }.detail-panel dd { margin:0; text-align:right; font-weight:800; }
.attribution { color:var(--muted); font-size:10px; line-height:1.5; }.attribution a { color:var(--cyan); }
.sticky-action { position:sticky; bottom:82px; display:grid; grid-template-columns:1fr 1.35fr; gap:9px; margin-top:18px; padding:10px; border:1px solid var(--line); border-radius:17px; background:rgba(5,17,18,.9); backdrop-filter:blur(14px); }
.loading-panel { padding:20px; margin-top:18px; }
@media(max-width:390px){.stop-thumb{width:90px}.location-row{align-items:flex-start;flex-direction:column}.hero-photo{height:185px}}
