/* =====================================================================
   ALIKO — DESIGN SYSTEM
   A single, coherent visual language: near-black surfaces, one signal
   color (route-orange) for action and "you are here" moments, calm
   neutral type for everything else. Built for a wayfinding product,
   not a generic SaaS template.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root{
  --bg:            #0A0C10;
  --bg-raised:     #12151B;
  --surface:       #171B23;
  --surface-2:     #1D222C;
  --line:          rgba(255,255,255,.09);
  --line-strong:   rgba(255,255,255,.16);

  --ink:           #F4F5F7;
  --ink-dim:       #A6ADB9;
  --ink-faint:     #6B7280;

  --route:         #FF5A1F;
  --route-dim:     #C9440F;
  --signal-green:  #33D17A;
  --signal-amber:  #F5B942;
  --signal-red:    #FF5C5C;
  --signal-violet: #9B8CFF;

  --radius-sm:  10px;
  --radius:     16px;
  --radius-lg:  24px;
  --radius-full: 999px;

  --shadow-card: 0 12px 32px rgba(0,0,0,.35);
  --shadow-float: 0 18px 48px rgba(0,0,0,.5);

  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

*{ box-sizing: border-box; }
html{ background: var(--bg); scroll-behavior: smooth; }
body{
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4,.display{ font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
a{ color: inherit; text-decoration: none; }
button, input, select, textarea{ font: inherit; color: inherit; }
button{ cursor: pointer; }
img{ max-width: 100%; display: block; }
::selection{ background: var(--route); color: #fff; }

.hidden{ display: none !important; }
.muted{ color: var(--ink-dim); }
.faint{ color: var(--ink-faint); }

header.site{
  position: sticky; top: 0; z-index: 500;
  background: rgba(10,12,16,.82);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.site-inner{
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
}
.brand{ font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; }
.brand em{ font-style: normal; color: var(--route); }
.hamburger-btn{ background: none; border: none; color: var(--ink); font-size: 20px; padding: 4px 6px; line-height: 1; }
.top-login-link{ font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none; }
.top-login-link:hover{ color: var(--route); }
.auth-box{ display: flex; align-items: center; gap: 12px; font-size: 13px; white-space: nowrap; margin-left: auto; }
.auth-box a, .auth-box button{ border: none; background: none; font-weight: 700; color: var(--ink); }
.auth-box a:hover, .auth-box button:hover{ color: var(--route); }
.notif-wrap{ position: relative; }

/* Side drawer — replaces the old full-width top tab row. Every nav
   destination lives here now, off-screen until opened. */
.drawer-backdrop{
  position: fixed; inset: 0; z-index: 899; background: rgba(5,7,10,.6); backdrop-filter: blur(4px);
  opacity: 1; transition: opacity .25s ease;
}
.drawer-backdrop.hidden{ display: none; }
.side-drawer{
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 900; width: min(300px, 84vw);
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px;
  transform: translateX(-100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  box-shadow: var(--shadow-float);
}
.side-drawer.open{ transform: translateX(0); }
.drawer-top{ display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.drawer-close{ background: none; border: none; color: var(--ink-dim); font-size: 18px; }
.drawer-links{ display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.drawer-link{
  display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 600; color: var(--ink-dim);
}
.drawer-link:hover{ background: rgba(255,255,255,.05); color: var(--ink); }
.drawer-link.active{ background: rgba(255,90,31,.1); color: var(--route); }
.drawer-icon{ font-size: 16px; width: 22px; text-align: center; }
.drawer-bottom{ padding-top: 14px; border-top: 1px solid var(--line); margin-top: 10px; }
.drawer-user{ font-size: 13.5px; margin-bottom: 10px; }
body.drawer-open{ overflow: hidden; }

/* Uber-style persistent bottom tab bar — phones only (see media query) */
.bottom-tabs{
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 480;
  background: rgba(10,12,16,.96); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.bottom-tab{
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; color: var(--ink-faint); font-size: 10.5px; font-weight: 600; padding: 4px 6px;
}
.bottom-tab span{ font-size: 18px; }
.bottom-tab.active{ color: var(--route); }

.notif-bell{
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: flex; align-items: center; justify-content: center; position: relative; font-size: 16px;
}
.notif-dot{ position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--route); box-shadow: 0 0 0 3px rgba(255,90,31,.25); }
.notif-panel{
  position: absolute; right: 0; top: 44px; width: 300px; max-height: 360px; overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-float); padding: 6px;
}
.notif-item{ padding: 10px 12px; border-radius: var(--radius-sm); font-size: 12.5px; }
.notif-item:not(.read){ background: rgba(255,90,31,.07); }
.notif-item time{ display: block; color: var(--ink-faint); font-size: 10.5px; margin-top: 3px; }

main.shell{ max-width: 1180px; margin: 0 auto; padding: 32px 24px 100px; }
main.shell.narrow{ max-width: 620px; }
main.shell.wide{ max-width: 1400px; }
.page-title{ font-size: 30px; margin-bottom: 4px; }
.page-sub{ color: var(--ink-dim); font-size: 14px; margin-bottom: 24px; }

.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px; border-radius: var(--radius-full);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 13.5px; transition: .15s;
}
.btn:hover{ background: var(--surface-2); transform: translateY(-1px); }
.btn:disabled{ opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary{ background: var(--route); border-color: var(--route); color: #fff; box-shadow: 0 10px 26px rgba(255,90,31,.28); }
.btn.primary:hover{ background: #FF6A35; }
.btn.ghost{ background: transparent; border-color: var(--line); }
.btn.danger{ background: var(--signal-red); border-color: var(--signal-red); color: #1a0000; }
.btn.small{ padding: 7px 13px; font-size: 12px; }
.btn.block{ width: 100%; }

.field{ margin-bottom: 14px; }
.field label{ display: block; font-size: 12px; font-weight: 700; color: var(--ink-dim); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select, .field textarea{
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--bg-raised); color: var(--ink); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus{ border-color: var(--route); box-shadow: 0 0 0 3px rgba(255,90,31,.15); }
.field-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
fieldset{ border: none; padding: 0; margin: 0 0 26px; }
legend{ font-family: var(--font-display); font-weight: 800; font-size: 15px; padding-bottom: 8px; margin-bottom: 14px; border-bottom: 1px solid var(--line); width: 100%; }

.card{ background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow-card); }
.card h3{ font-size: 15px; margin-bottom: 12px; }
.auth-card{ max-width: 420px; margin: 40px auto; }
.note{ font-size: 12.5px; color: var(--ink-dim); background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; }
.error-box{ font-size: 13px; color: var(--signal-red); background: rgba(255,92,92,.08); border: 1px solid rgba(255,92,92,.3); border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 14px; }
.empty{ padding: 50px 20px; text-align: center; color: var(--ink-dim); }
.loading{ padding: 50px 20px; text-align: center; color: var(--ink-faint); font-size: 13px; }

.badge{ display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: var(--radius-full); letter-spacing: .03em; }
.badge.verified{ color: var(--signal-green); background: rgba(51,209,122,.12); }
.badge.premium{ color: var(--signal-violet); background: rgba(155,140,255,.14); }
.badge.pending{ color: var(--signal-amber); background: rgba(245,185,66,.13); }
.badge.open{ color: var(--signal-green); background: rgba(51,209,122,.12); }
.badge.closed{ color: var(--ink-faint); background: rgba(255,255,255,.06); }
.chip-row{ display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.chip{ padding: 7px 13px; border-radius: var(--radius-full); border: 1px solid var(--line); background: var(--surface); color: var(--ink-dim); font-size: 12.5px; font-weight: 600; }
.chip.active{ background: var(--route); border-color: var(--route); color: #fff; }
.chip.tag{ background: var(--bg-raised); }

.search-hero{ padding: 10px 0 30px; }
.search-hero h1{ font-size: clamp(30px, 4vw, 44px); max-width: 620px; margin-bottom: 8px; }
.search-hero h1 em{ font-style: normal; color: var(--route); }
.search-bar-wrap{ position: relative; max-width: 640px; margin-top: 22px; }
.search-bar{
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-full);
  padding: 6px 8px 6px 18px;
}
.search-bar input{ flex: 1; border: none; background: none; outline: none; color: var(--ink); font-size: 15px; padding: 10px 0; }
.suggest-box{
  position: absolute; left: 0; right: 0; top: 58px; z-index: 40;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-float); overflow: hidden; display: none;
}
.suggest-item{ padding: 12px 16px; border-bottom: 1px solid var(--line); }
.suggest-item:last-child{ border-bottom: none; }
.suggest-item:hover{ background: rgba(255,255,255,.04); }

.toolbar-row{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 18px 0 6px; }
.toolbar-row select{ padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); font-size: 12.5px; }
.switch-label{ display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-dim); }

.result-count{ font-size: 12.5px; color: var(--ink-faint); margin: 14px 0 8px; }
.directory{ display: flex; flex-direction: column; gap: 8px; }
.row{
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: .15s;
}
.row:hover{ border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-card); }
.plate{
  width: 46px; height: 46px; flex: none; border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--route), var(--route-dim));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 11px; text-align: center; line-height: 1.1;
}
.row-main{ flex: 1; min-width: 0; }
.row-name{ display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-weight: 700; font-size: 14.5px; }
.row-meta, .row-loc{ font-size: 12px; color: var(--ink-dim); margin-top: 2px; }
.row-dist{ font-weight: 700; font-size: 13px; color: var(--ink); white-space: nowrap; }

.map-toggle-wrap{ height: 0; overflow: hidden; border-radius: var(--radius-lg); transition: height .3s; margin-top: 14px; }
.map-toggle-wrap.open{ height: 420px; }
#resultsMap{ height: 100%; border-radius: var(--radius-lg); }

.profile-top{ display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.back-link{ display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-dim); margin-bottom: 18px; background: none; border: none; }
.back-link:hover{ color: var(--ink); }
.profile-name{ font-size: clamp(26px, 3.5vw, 36px); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-meta{ color: var(--ink-dim); font-size: 13.5px; margin-top: 6px; }
.profile-desc{ font-size: 14.5px; color: var(--ink-dim); max-width: 620px; margin: 14px 0 20px; line-height: 1.7; }
.action-row{ display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.icon-btn{ width: 40px; height: 40px; border-radius: var(--radius-full); border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: center; }

.profile-grid{ display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 20px; margin-bottom: 20px; }
@media (max-width: 880px){ .profile-grid{ grid-template-columns: 1fr; } }

.address-plate{
  background: linear-gradient(155deg, var(--surface-2), var(--bg-raised));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 16px;
}
.addr-label{ font-size: 10px; font-weight: 800; color: var(--ink-faint); letter-spacing: .06em; text-transform: uppercase; }
.addr-val{ font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--route); margin-top: 4px; }
.addr-val.small{ font-size: 13px; color: var(--ink); font-family: var(--font-body); font-weight: 600; }

.map-card{ position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-card); min-height: 320px; }
#map{ height: 100%; min-height: 320px; background: var(--bg-raised); }
.map-label{ position: absolute; top: 12px; left: 12px; z-index: 10; display: flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: var(--radius-full); background: rgba(10,12,16,.82); backdrop-filter: blur(10px); font-size: 10.5px; font-weight: 700; }
.live-dot{ width: 6px; height: 6px; border-radius: 50%; background: var(--signal-green); box-shadow: 0 0 0 4px rgba(51,209,122,.15); }

.photo-strip{ display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 20px; }
.photo-card{ position: relative; flex: 0 0 160px; height: 110px; border-radius: var(--radius); overflow: hidden; background: var(--bg-raised); border: 1px solid var(--line); }
.photo-card img{ width: 100%; height: 100%; object-fit: cover; }
.photo-card span{ position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 5px 8px; border-radius: var(--radius-sm); background: rgba(0,0,0,.6); font-size: 10px; }

.confidence-row{ display: flex; align-items: center; gap: 18px; }
.confidence-num{ font-family: var(--font-display); font-size: 38px; font-weight: 800; color: var(--signal-green); }
.confidence-bar{ flex: 1; height: 8px; border-radius: var(--radius-full); background: var(--bg-raised); overflow: hidden; }
.confidence-fill{ height: 100%; background: linear-gradient(90deg, var(--signal-green), #7fe3ab); }
.confidence-meta{ font-size: 12px; color: var(--ink-faint); margin-top: 4px; }
.arrival-row{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.review{ padding: 16px 0; border-bottom: 1px solid var(--line); }
.review:last-child{ border-bottom: none; }
.review-top{ display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; }
.stars{ color: var(--signal-amber); letter-spacing: 1px; }
.review-date{ color: var(--ink-faint); font-weight: 400; font-size: 11px; }
.review-text{ font-size: 13.5px; color: var(--ink-dim); margin-top: 5px; }
.owner-reply{ margin-top: 8px; padding: 10px 13px; border-left: 2px solid var(--route); background: rgba(255,90,31,.05); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 12.5px; }
.hours-row{ display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.hours-row:last-child{ border-bottom: none; }

#navPanel{
  position: fixed; inset: 0; z-index: 5000; background: #05070A;
  display: flex; flex-direction: column;
}
body.nav-open{ overflow: hidden; }
#navMap{ flex: 1; }
.nav-topbar{
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  padding: calc(16px + env(safe-area-inset-top)) 16px 40px;
  background: linear-gradient(to bottom, rgba(5,7,10,.6), transparent);
  display: flex; align-items: flex-start; gap: 12px; pointer-events: none;
}
.nav-topbar > *{ pointer-events: auto; }
.nav-exit{ width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(20,23,28,.9); color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(12px); }
.nav-instruction{
  flex: 1; display: flex; align-items: center; gap: 14px;
  background: rgba(15,18,23,.92); backdrop-filter: blur(16px);
  border-radius: var(--radius-lg); padding: 14px 18px; box-shadow: var(--shadow-float);
}
.nav-instruction-icon{ width: 52px; height: 52px; flex: none; border-radius: var(--radius); background: var(--route); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; }
.nav-instruction-text{ min-width: 0; }
.nav-instruction-dist{ font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--ink-dim); }
.nav-instruction-main{ font-family: var(--font-display); font-weight: 800; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-instruction-road{ font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-gps-pill{ position: absolute; top: calc(96px + env(safe-area-inset-top)); left: 16px; z-index: 20; display: flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: var(--radius-full); background: rgba(15,18,23,.85); font-size: 10.5px; font-weight: 700; backdrop-filter: blur(10px); }
.nav-gps-dot{ width: 7px; height: 7px; border-radius: 50%; background: var(--signal-green); }
.nav-gps-dot.warn{ background: var(--signal-amber); }
.nav-gps-dot.bad{ background: var(--signal-red); }
.nav-banner{ position: absolute; top: calc(140px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 25; padding: 8px 14px; border-radius: var(--radius-full); background: rgba(245,185,66,.95); color: #241800; font-size: 11.5px; font-weight: 700; display: none; white-space: nowrap; }
.nav-banner.rerouting{ background: rgba(15,18,23,.92); color: #fff; }

.nav-recenter{ position: absolute; right: 16px; bottom: calc(180px + env(safe-area-inset-bottom)); z-index: 20; width: 48px; height: 48px; border-radius: 50%; border: none; background: rgba(15,18,23,.92); color: #fff; font-size: 22px; backdrop-filter: blur(10px); box-shadow: var(--shadow-card); }

/* Locating-you overlay: shown until the first GPS fix arrives, so the
   screen never feels frozen while a lock is acquired. */
.nav-acquiring{
  position: absolute; inset: 0; z-index: 15; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(circle at 50% 42%, rgba(255,90,31,.14), rgba(5,7,10,.94) 65%);
  transition: opacity .4s ease, visibility .4s ease;
}
.nav-acquiring.hidden{ opacity: 0; visibility: hidden; pointer-events: none; }
.nav-radar{ position: relative; width: 78px; height: 78px; }
.nav-radar span{
  position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--route); opacity: 0;
  animation: navRadarPulse 2.1s ease-out infinite;
}
.nav-radar span:nth-child(2){ animation-delay: .5s; }
.nav-radar span:nth-child(3){ animation-delay: 1s; }
.nav-radar::after{
  content: ''; position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; margin: -7px;
  border-radius: 50%; background: var(--route); box-shadow: 0 0 20px rgba(255,90,31,.9);
}
@keyframes navRadarPulse{ 0%{ transform: scale(.3); opacity: .9; } 100%{ transform: scale(2.4); opacity: 0; } }
.nav-acquiring-text{ font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--ink-dim); letter-spacing: .02em; }

/* Compass + 2D/3D + Walk/Drive controls, stacked top-right under the
   instruction card — small consistent icons rather than a big banner bar,
   so the map itself stays the largest thing on screen. */
.nav-side-controls{
  position: absolute; right: 16px; top: calc(148px + env(safe-area-inset-top)); z-index: 20;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.nav-compass, .nav-tilt-btn, .nav-mode-icon{
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.1);
  background: rgba(15,18,23,.92); color: #fff; backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-card);
  font-size: 16px; line-height: 1;
}
.nav-tilt-btn{ font-family: var(--font-display); font-weight: 800; font-size: 11px; letter-spacing: .02em; }
.nav-compass svg{ width: 24px; height: 24px; transition: transform .25s ease; }
.nav-mode-icon.active{ background: var(--route); border-color: var(--route); }

.nav-bottom{
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(5,7,10,.98), rgba(5,7,10,.85), transparent);
}
.nav-progress-track{ height: 3px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; margin-bottom: 8px; }
.nav-progress-fill{ height: 100%; width: 2%; border-radius: 2px; background: linear-gradient(90deg, #FFC58A, #FF5A1F); transition: width .5s ease; }
.nav-stats{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }

/* Weather / battery-saver chips, top-left under the instruction card */
.nav-chips{ position: absolute; left: 16px; top: calc(148px + env(safe-area-inset-top)); z-index: 20; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.nav-chip{
  padding: 6px 12px; border-radius: 999px; background: rgba(15,18,23,.92); color: #fff; font-size: 12px;
  font-family: var(--font-display); font-weight: 700; backdrop-filter: blur(10px); box-shadow: var(--shadow-card);
}
.nav-chip.hidden{ display: none; }

/* Alternative-route chip */
.nav-alt-chip{
  position: absolute; left: 50%; top: calc(148px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 21;
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 999px;
  background: rgba(15,18,23,.95); color: #fff; font-size: 12px; font-family: var(--font-display); font-weight: 700;
  box-shadow: var(--shadow-card);
}
.nav-alt-chip.hidden{ display: none; }
.nav-alt-chip button{ padding: 6px 12px; border-radius: 999px; border: none; background: var(--route); color: #fff; font-weight: 800; font-size: 11px; }

/* Last-mile indoor guidance card */
.nav-final-approach{
  position: absolute; left: 16px; right: 16px; bottom: calc(190px + env(safe-area-inset-bottom)); z-index: 20;
  background: rgba(15,18,23,.95); border: 1px solid rgba(255,90,31,.35); border-radius: 16px; padding: 12px 14px;
  backdrop-filter: blur(10px); box-shadow: var(--shadow-card);
}
.nav-final-approach.hidden{ display: none; }
.nav-final-approach .fa-title{ font-family: var(--font-display); font-weight: 800; color: var(--route); font-size: 12px; margin-bottom: 6px; letter-spacing: .02em; }
.nav-final-approach .fa-row{ display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-dim); padding: 3px 0; }
.nav-final-approach .fa-row strong{ color: #fff; font-weight: 700; }
.nav-stat{ background: rgba(255,255,255,.06); border-radius: var(--radius); padding: 8px 4px; text-align: center; }
.nav-stat strong{ display: block; font-family: var(--font-display); font-size: 14px; }
.nav-stat span{ font-size: 8px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.nav-dest-row{ display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.06); border-radius: var(--radius); padding: 8px 13px; margin-bottom: 8px; }
.nav-dest-dot{ width: 10px; height: 10px; border-radius: 50%; background: #fff; flex: none; }
.nav-dest-row strong{ display: block; font-size: 13px; }
.nav-dest-row span{ font-size: 11px; color: var(--ink-faint); }
.nav-actions{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.nav-action-btn{ padding: 10px 4px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.nav-action-btn.primary{ background: #fff; color: #111; }

/* Uber-style live position puck: a soft directional beam under a solid
   dot, position-interpolated in JS so it glides between GPS fixes
   instead of jumping. Accuracy is drawn as a real map layer (metres-
   accurate), not this CSS, so the ring below is purely the "beam". */
.aliko-puck{ position: relative; width: 40px; height: 40px; }
.aliko-puck .puck-beam{
  position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px;
  background: conic-gradient(from 180deg at 50% 50%, rgba(255,90,31,.55), rgba(255,90,31,0) 50%, rgba(255,90,31,0) 100%);
  border-radius: 50%; transform-origin: 50% 50%; transition: transform .1s linear;
}
.aliko-puck .puck-dot{
  position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border-radius: 50%; background: linear-gradient(160deg, #fff, #FF5A1F 55%, #C9440F);
  border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.45), 0 0 0 5px rgba(255,90,31,.18);
}

.aliko-dest-pin{ position: relative; width: 34px; height: 48px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.aliko-dest-pin svg{ position: relative; z-index: 1; }
.aliko-dest-pin .pin-shadow{
  position: absolute; left: 50%; bottom: 2px; width: 18px; height: 6px; margin-left: -9px;
  background: rgba(0,0,0,.45); border-radius: 50%; filter: blur(2px);
}

.arrival-overlay{ position: fixed; inset: 0; z-index: 6000; background: rgba(5,7,10,.85); backdrop-filter: blur(16px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.arrival-card{ width: min(440px, 100%); background: var(--surface-2); border-radius: var(--radius-lg); padding: 30px; text-align: center; box-shadow: var(--shadow-float); }
.arrival-check{ width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--signal-green); color: #06210f; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; }
.arrival-title{ font-size: 24px; }
.arrival-sub{ color: var(--ink-dim); font-size: 13.5px; margin-top: 6px; }
.arrival-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 20px 0; text-align: left; }
.arrival-grid > div{ background: var(--bg-raised); border-radius: var(--radius-sm); padding: 10px 12px; }

/* In-navigation arrival state: a bottom sheet, not a full-screen veil, so
   the live map (and your position on it) stays visible behind it. */
.nav-arrival-sheet-overlay{
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6000;
  display: flex; justify-content: center; pointer-events: none;
}
.nav-arrival-sheet-overlay .nav-arrival-sheet{ pointer-events: auto; }
.nav-arrival-sheet{
  width: min(480px, 100%); background: var(--surface-2); border-radius: 20px 20px 0 0;
  padding: 22px 24px calc(22px + env(safe-area-inset-bottom)); text-align: center;
  box-shadow: 0 -14px 44px rgba(0,0,0,.55); border-top: 1px solid rgba(255,255,255,.08);
  animation: navArrivalUp .32s cubic-bezier(.2,.8,.2,1);
}
@keyframes navArrivalUp{ from{ transform: translateY(100%); } to{ transform: translateY(0); } }
.arrival-rate-row{ display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0; font-size: 13px; color: var(--ink-dim); }
.arrival-rate-row .aliko-star-input{ font-size: 20px; }

.stat-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card{ background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat-num{ font-family: var(--font-display); font-size: 24px; font-weight: 800; }
.stat-label{ font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.admin-row{ display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line); }
.admin-row:last-child{ border-bottom: none; }
select.owner-select{ max-width: 300px; margin-bottom: 18px; }
.gps-box{ background: var(--bg-raised); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.gps-status{ font-size: 12.5px; color: var(--ink-dim); margin-top: 8px; }
.trend-bars{ display: flex; align-items: flex-end; gap: 4px; height: 100px; }
.trend-bars > div{ flex: 1; background: var(--route); border-radius: 3px 3px 0 0; min-height: 3px; }
.bar-row{ display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bar-row .label{ width: 150px; font-size: 12px; color: var(--ink-dim); flex: none; }
.bar-row .track{ flex: 1; height: 12px; border-radius: 6px; background: var(--bg-raised); overflow: hidden; }
.bar-row .fill{ height: 100%; background: var(--route); }
.bar-row .val{ width: 26px; font-size: 11px; text-align: right; }

.leaflet-container{ background: var(--bg-raised); font-family: var(--font-body); }
.leaflet-control-attribution{ background: rgba(0,0,0,.55) !important; color: #aab !important; }
.leaflet-control-attribution a{ color: #fff !important; }
.leaflet-control-zoom a{ background: var(--surface) !important; color: #fff !important; border-color: var(--line) !important; }

@media (max-width: 720px){
  .site-inner{ padding: 10px 14px; }
  main.shell{ padding: 18px 14px 96px; } /* extra bottom padding clears the bottom tab bar */
  .address-plate{ grid-template-columns: repeat(2, 1fr); }
  .profile-name{ font-size: 22px; }

  /* Fix: category chips no longer wrap into several tall rows — they
     scroll horizontally in one row instead, the same pattern Uber Eats/
     Google/most apps use for a category strip on a phone. */
  .chip-row{ flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-bottom: 12px; }
  .chip-row::-webkit-scrollbar{ display: none; }
  .chip{ flex: none; }

  .toolbar-row{ gap: 8px; margin: 12px 0 4px; }
  .toolbar-row select, .toolbar-row .btn{ font-size: 12px; padding: 7px 10px; }
  #clearFiltersBtn{ order: 3; } /* keep Map view pinned right, Clear filters wraps under the select/checkbox */

  .action-row{ gap: 6px; }
  .action-row .btn{ padding: 9px 12px; font-size: 12.5px; }
  .profile-top{ gap: 10px; }
  .stat-grid{ grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card{ padding: 10px; }
  .admin-row{ flex-direction: column; align-items: stretch; }
  .admin-row > div:last-child{ justify-content: flex-start; }

  /* Uber-style bottom tab bar takes over the primary navigation role on
     phones; the drawer becomes the "More" overflow. */
  .bottom-tabs{ display: flex; }
}

@media (max-width: 380px){
  /* Extra-small phones (iPhone SE and similar) — tighten further rather
     than letting cards/buttons overflow or wrap awkwardly. */
  .site-inner{ padding: 8px 10px; gap: 8px; }
  .brand{ font-size: 17px; }
  main.shell{ padding: 14px 10px 96px; }
  .profile-name{ font-size: 19px; }
  h1{ font-size: 21px; } h2{ font-size: 17px; }
  .card{ padding: 14px; }
  .stat-grid{ grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .action-row .btn{ padding: 8px 10px; font-size: 12px; }
  .bottom-tab{ font-size: 9.5px; }
  .bottom-tab span{ font-size: 16px; }
}

/* Native date/time inputs (business hours form) default to the OS's
   light-mode widget regardless of page theme unless told otherwise —
   this was the "hours showing white/unclear" bug on the dashboard. */
:root{ color-scheme: dark; }
input[type="time"], input[type="date"]{
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 8px 10px; color-scheme: dark;
}
