:root{
  --bg:#0a0f14;
  --bg-2:#0f1620;
  --surface:#141d29;
  --surface-2:#1b2734;
  --line:rgba(255,255,255,.08);
  --text:#eef3f7;
  --muted:#8a9bad;
  --teal:#2dd4bf;
  --teal-dim:#1b8f82;
  --amber:#f59e0b;
  --danger:#ef4444;
  --radius:18px;
  --shadow:0 16px 40px rgba(0,0,0,.45);
  --safe-bottom:env(safe-area-inset-bottom,0px);
  --safe-top:env(safe-area-inset-top,0px);
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%}
body{
  font-family:"Manrope",system-ui,-apple-system,sans-serif;
  background:#05080b;
  color:var(--text);
  display:flex;align-items:center;justify-content:center;
  min-height:100vh;
}

/* ---------- phone ---------- */
.phone{
  position:relative;
  width:100%;max-width:440px;height:100vh;height:100dvh;
  background:var(--bg);
  overflow:hidden;
  display:flex;flex-direction:column;
}
@media(min-width:480px){
  body{padding:24px}
  .phone{height:900px;max-height:96vh;border-radius:36px;
    box-shadow:0 30px 80px rgba(0,0,0,.6),0 0 0 10px #11161d,0 0 0 11px #2a323d;}
}

/* ---------- view ---------- */
.view{position:absolute;inset:0;display:none;flex-direction:column;
  background:var(--bg);overflow:hidden}
.view--active{display:flex}
.scroll{flex:1;overflow-y:auto;padding:18px 18px 96px;-webkit-overflow-scrolling:touch}

.page-title{font-size:26px;font-weight:800;margin:6px 0 4px;letter-spacing:-.02em}
.page-sub{color:var(--muted);font-size:14px;margin:0 0 18px}

/* ---------- brand ---------- */
.brand{display:flex;align-items:baseline;gap:7px}
.brand__name{font-weight:800;letter-spacing:.14em;font-size:18px}
.brand__tag{font-size:11px;letter-spacing:.34em;text-transform:lowercase;
  color:var(--teal);font-weight:700}
.brand--sm .brand__name{font-size:15px}

.topbar{display:flex;align-items:center;justify-content:center;
  padding:max(30px,var(--safe-top)) 16px 16px;border-bottom:1px solid var(--line);background:var(--bg-2)}

/* ---------- btn ---------- */
.btn{border:0;border-radius:14px;padding:15px 18px;font:inherit;font-weight:700;
  font-size:15px;cursor:pointer;transition:transform .12s ease,filter .12s ease;
  display:inline-flex;align-items:center;justify-content:center;gap:8px}
.btn:active{transform:scale(.97)}
.btn--primary{background:var(--teal);color:#04201d}
.btn--primary:hover{filter:brightness(1.06)}
.btn--ghost{background:var(--surface-2);color:var(--text);border:1px solid var(--line)}
.btn--block{width:100%}

/* ================= HOME ================= */
.home-hero{position:relative;height:54%;min-height:340px;overflow:hidden;
  background:
    radial-gradient(120% 90% at 80% 0%,#ffb24d 0%,transparent 42%),
    linear-gradient(180deg,#f6913a 0%,#a4486a 34%,#3a2f63 64%,#0a0f14 100%);
}
.home-hero__overlay{position:absolute;inset:0;
  background:
    radial-gradient(60% 40% at 78% 22%,rgba(255,221,150,.55),transparent 70%),
    linear-gradient(180deg,transparent 40%,rgba(10,15,20,.2) 70%,var(--bg) 100%);
}
.home-hero__top{position:relative;padding:max(44px,var(--safe-top)) 20px 0;z-index:2}
.home-hero__content{position:absolute;left:20px;right:20px;bottom:26px;z-index:2}
.home-hero__eyebrow{margin:0 0 8px;font-size:12px;font-weight:700;letter-spacing:.12em;
  text-transform:uppercase;color:rgba(255,255,255,.85)}
.home-hero__title{margin:0 0 10px;font-size:30px;line-height:1.12;font-weight:800;
  letter-spacing:-.02em;text-shadow:0 2px 18px rgba(0,0,0,.35)}
.home-hero__sub{margin:0;font-size:14px;line-height:1.45;color:rgba(255,255,255,.9);
  max-width:30ch}
.home-body{flex:1;padding:22px 20px calc(24px + var(--safe-bottom));display:flex;
  flex-direction:column;gap:22px}
.home-actions{display:flex;flex-direction:column;gap:12px}
.home-features{display:flex;flex-direction:column;gap:12px;margin-top:auto}
.feat{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:14px}
.feat__ico{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;
  background:var(--surface);border:1px solid var(--line);font-size:18px}

/* ================= ROUTES ================= */
.routes-list{display:flex;flex-direction:column;gap:16px}
.route-card{position:relative;border-radius:var(--radius);overflow:hidden;
  background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow)}
.route-card__cover{height:112px;position:relative}
.route-card__cover::after{content:"";position:absolute;inset:0;
  background:linear-gradient(180deg,transparent 30%,rgba(20,29,41,.85) 100%)}
.route-card__body{padding:14px 16px 16px}
.route-card__title{margin:0 0 4px;font-size:19px;font-weight:800;letter-spacing:-.01em}
.route-card__desc{margin:0 0 13px;font-size:13.5px;line-height:1.45;color:var(--muted)}
.route-card__meta{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.chip{font-size:12px;font-weight:600;color:var(--text);background:var(--surface-2);
  border:1px solid var(--line);padding:6px 11px;border-radius:999px;
  display:flex;align-items:center;gap:5px}
.chip__label{color:var(--muted)}

/* ================= MAP ================= */
.map{position:absolute;inset:0;background:var(--bg)}
.map-header{position:absolute;top:0;left:0;right:0;z-index:600;
  display:flex;align-items:center;gap:12px;padding:max(30px,var(--safe-top)) 14px 26px;
  background:linear-gradient(180deg,rgba(8,12,17,.92),rgba(8,12,17,0));
  pointer-events:none}
.map-header>*{pointer-events:auto}
.map-header__title{display:flex;flex-direction:column;gap:5px}
.map-header__name{font-size:17px;font-weight:800;letter-spacing:-.01em;
  text-shadow:0 1px 8px rgba(0,0,0,.6)}

.iconbtn{width:40px;height:40px;border-radius:12px;border:1px solid var(--line);
  background:rgba(20,29,41,.85);backdrop-filter:blur(8px);color:var(--text);
  font-size:24px;line-height:1;cursor:pointer;display:grid;place-items:center}

.pill{align-self:flex-start;background:rgba(45,212,191,.16);color:var(--teal);
  border:1px solid rgba(45,212,191,.35);font-size:12px;font-weight:700;
  padding:4px 10px;border-radius:999px}

.filters{position:absolute;top:max(100px,calc(var(--safe-top) + 72px));left:0;right:0;z-index:600;
  display:flex;gap:8px;overflow-x:auto;padding:0 14px 6px;scrollbar-width:none}
.filters::-webkit-scrollbar{display:none}
.filter{flex:0 0 auto;display:flex;align-items:center;gap:6px;
  background:rgba(20,29,41,.9);backdrop-filter:blur(8px);
  border:1px solid var(--line);color:var(--text);font-size:12.5px;font-weight:600;
  padding:8px 12px;border-radius:999px;cursor:pointer;transition:.15s;white-space:nowrap}
.filter--off{opacity:.42;filter:grayscale(.6)}
.filter__dot{width:9px;height:9px;border-radius:50%}

/* map marker */
.marker{display:grid;place-items:center;width:32px;height:32px;border-radius:50% 50% 50% 0;
  transform:rotate(-45deg);box-shadow:0 4px 10px rgba(0,0,0,.5);
  border:2px solid rgba(255,255,255,.9);font-size:15px;cursor:pointer}
.marker__icon{transform:rotate(45deg)}

/* ---- Leaflet ---- */
.leaflet-container{background:var(--bg)!important;font-family:inherit}
.leaflet-control-attribution{font-size:9px!important;background:rgba(8,12,17,.6)!important;
  color:#5a6b7d!important}
.leaflet-control-attribution a{color:#7f93a6!important}
.leaflet-bar a{background:var(--surface)!important;color:var(--text)!important;
  border-color:var(--line)!important}

/* ---------- sheet ---------- */
.sheet{position:absolute;left:0;right:0;bottom:0;z-index:700;
  background:var(--surface);border-top:1px solid var(--line);
  border-radius:22px 22px 0 0;padding:20px 18px calc(20px + var(--safe-bottom));
  box-shadow:0 -16px 40px rgba(0,0,0,.5);
  transform:translateY(115%);transition:transform .32s cubic-bezier(.22,1,.36,1)}
.sheet--open{transform:translateY(0)}
.sheet::before{content:"";position:absolute;top:8px;left:50%;transform:translateX(-50%);
  width:42px;height:4px;border-radius:99px;background:var(--line)}
.sheet__close{position:absolute;top:14px;right:14px;width:30px;height:30px;border-radius:50%;
  border:1px solid var(--line);background:var(--surface-2);color:var(--muted);
  font-size:18px;line-height:1;cursor:pointer}
.sheet__eyebrow{font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;
  color:var(--teal);display:block;margin:6px 0 12px}
.sheet__head{display:flex;align-items:center;gap:13px;margin-bottom:12px}
.sheet__icon{width:46px;height:46px;border-radius:14px;display:grid;place-items:center;
  font-size:22px;flex:0 0 auto;border:2px solid rgba(255,255,255,.85)}
.sheet__name{margin:0;font-size:20px;font-weight:800;letter-spacing:-.01em}
.sheet__cat{font-size:13px;color:var(--muted);font-weight:600}
.sheet__desc{margin:0 0 12px;font-size:14px;line-height:1.5;color:#c6d2dd}
.sheet__tip,.sheet__warn{font-size:13px;line-height:1.45;border-radius:12px;
  padding:11px 13px;margin-bottom:12px;display:flex;gap:9px}
.sheet__tip{background:rgba(45,212,191,.1);border:1px solid rgba(45,212,191,.28);color:#aef0e7}
.sheet__warn{background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.3);color:#ffc4c4}
.sheet__tip::before{content:"💡"}
.sheet__warn::before{content:"⚠️"}
.sheet__tip--hidden,.sheet__warn--hidden{display:none}

/* ================= TABBAR ================= */
.tabbar{position:absolute;bottom:0;left:0;right:0;z-index:800;display:none;
  grid-template-columns:repeat(2,1fr);
  background:rgba(12,18,25,.96);backdrop-filter:blur(14px);
  border-top:1px solid var(--line);
  padding:9px 6px calc(9px + var(--safe-bottom))}
.tabbar--visible{display:grid}
.tab{background:none;border:0;color:var(--muted);font:inherit;font-size:10.5px;
  font-weight:600;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:3px;
  padding:4px;transition:color .15s}
.tab__ico{font-size:20px;filter:grayscale(1);opacity:.6;transition:.15s}
.tab--active{color:var(--teal)}
.tab--active .tab__ico{filter:none;opacity:1}
