*{box-sizing:border-box}
html,body{margin:0;padding:0;height:100%;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:#0f172a;color:#111}
.topbar{position:fixed;top:0;left:0;right:0;z-index:1000;display:flex;justify-content:space-between;align-items:center;padding:10px 14px;background:rgba(15,23,42,.92);backdrop-filter:blur(8px);color:#fff;border-bottom:1px solid rgba(255,255,255,.08)}
.brand{display:flex;gap:10px;align-items:center}
.logo{font-size:28px;background:#f97316;width:44px;height:44px;display:grid;place-items:center;border-radius:12px}
.brand-title{font-weight:800;font-size:18px;letter-spacing:.3px}
.brand-title span{color:#f97316}
.brand-sub{font-size:12px;opacity:.75}
.top-actions{display:flex;gap:8px}
.icon-btn{border:1px solid rgba(255,255,255,.2);background:rgba(255,255,255,.08);color:#fff;padding:8px 12px;border-radius:999px;font-weight:700;cursor:pointer}
.icon-btn.active{background:#f97316;border-color:#f97316}
#map{position:fixed;inset:0;top:64px;z-index:1}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:900;background:#fff;border-radius:20px 20px 0 0;box-shadow:0 -10px 30px rgba(0,0,0,.25);padding:10px 16px 16px;max-height:62vh;overflow:auto}
.sheet-handle{width:44px;height:5px;background:#e2e8f0;border-radius:999px;margin:2px auto 10px}
.tabs{display:flex;gap:8px;margin-bottom:12px}
.tab{flex:1;padding:10px;border-radius:12px;border:2px solid #e2e8f0;background:#f8fafc;font-weight:800;cursor:pointer}
.tab.active{background:#0f172a;color:#fff;border-color:#0f172a}
.field{margin-bottom:12px}
.field label{display:block;font-weight:800;font-size:13px;margin-bottom:6px;color:#334155}
.row{display:flex;gap:8px}
.row input{flex:1;padding:12px;border:2px solid #e2e8f0;border-radius:12px;font-size:15px}
.small-btn{padding:0 14px;border-radius:12px;border:2px solid #0f172a;background:#0f172a;color:#fff;font-weight:800;cursor:pointer}
.hint{font-size:12px;color:#64748b;margin-top:6px}
.search-results{margin-top:6px}
.search-item{padding:10px;border:1px solid #e2e8f0;border-radius:10px;margin-top:6px;cursor:pointer;background:#fff}
.search-item:hover{background:#f1f5f9}
.hidden{display:none!important}
.dir-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.dir-btn{padding:9px 4px;border-radius:10px;border:2px solid #e2e8f0;background:#f8fafc;font-weight:700;cursor:pointer;font-size:13px}
.dir-btn.active{background:#f97316;color:#fff;border-color:#f97316}
.profiles{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.profile{padding:11px 8px;border-radius:12px;border:2px solid #e2e8f0;background:#f8fafc;font-weight:800;cursor:pointer;font-size:13px}
.profile.active{background:#fff7ed;border-color:#f97316;color:#9a3412}
.primary-btn{width:100%;padding:14px;border-radius:14px;border:none;background:#f97316;color:#fff;font-weight:900;font-size:16px;cursor:pointer;box-shadow:0 6px 16px rgba(249,115,22,.35)}
.primary-btn:active{transform:scale(.99)}
.secondary-btn{padding:12px 14px;border-radius:12px;border:2px solid #0f172a;background:#fff;font-weight:800;cursor:pointer}
.danger-btn{padding:12px 14px;border-radius:12px;border:none;background:#dc2626;color:#fff;font-weight:800;cursor:pointer}
.demo-btn{width:100%;margin-top:8px;padding:11px;border-radius:14px;border:2px dashed #cbd5e1;background:#f8fafc;color:#334155;font-weight:900;cursor:pointer}
.demo-btn span{display:block;font-size:11px;font-weight:700;color:#64748b;margin-top:2px}
.route-actions{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:10px}
.start-mini{border:none;background:#f97316;color:#fff;border-radius:10px;padding:9px 12px;font-weight:900;cursor:pointer;white-space:nowrap}
.status{margin-top:10px;font-size:13px;color:#475569;min-height:18px}
.results{margin-top:12px;display:grid;gap:10px}
.route-card{border:2px solid #e2e8f0;border-radius:16px;padding:12px;cursor:pointer;background:#fff}
.route-card:hover{border-color:#f97316}
.route-card.selected{border-color:#f97316;background:#fff7ed}
.route-head{display:flex;justify-content:space-between;align-items:center}
.route-title{font-weight:900}
.badge{background:#0f172a;color:#fff;padding:4px 8px;border-radius:999px;font-size:12px;font-weight:800}
.route-meta{display:flex;gap:12px;flex-wrap:wrap;margin-top:8px;font-size:13px;color:#475569}
.curve-bar{height:8px;background:#e2e8f0;border-radius:999px;overflow:hidden;margin-top:8px}
.curve-fill{height:100%;background:linear-gradient(90deg,#22c55e,#f59e0b,#ef4444)}
.footer-note{margin-top:14px;font-size:11px;color:#94a3b8;text-align:center;line-height:1.4}
input[type=range]{width:100%;accent-color:#f97316;height:28px}

/* Navigation */
.nav-overlay{position:fixed;inset:0;z-index:1200;background:#020617;color:#fff;display:flex;flex-direction:column}
.nav-top{padding:18px;display:flex;justify-content:space-between;gap:12px;align-items:center;background:linear-gradient(180deg,rgba(249,115,22,.25),transparent)}
.nav-instruction{display:flex;gap:14px;align-items:center;flex:1}
.nav-arrow{width:84px;height:84px;border-radius:20px;background:#f97316;display:grid;place-items:center;font-size:52px;font-weight:900;flex-shrink:0}
.nav-instruction-text{font-size:22px;font-weight:900;line-height:1.2}
.nav-street{opacity:.8;margin-top:4px}
.nav-dist-turn{text-align:center;min-width:110px}
.big-num{font-size:36px;font-weight:900;line-height:1}
.unit{opacity:.75;font-size:13px}
.nav-bottom{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;padding:12px 16px}
.nav-stat{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);border-radius:16px;padding:12px;text-align:center}
.stat-num{font-size:24px;font-weight:900}
.stat-label{font-size:12px;opacity:.75}
.nav-actions{display:flex;flex-wrap:wrap;gap:10px;padding:8px 16px 10px;margin-top:auto}
.nav-actions button{flex:1 1 140px}
.nav-safety{padding:0 16px 8px;text-align:center;font-size:12px;color:#cbd5e1}
.nav-status{padding:0 16px 16px;font-size:13px;opacity:.8;text-align:center}

/* Modal */
.modal{position:fixed;inset:0;z-index:1300;background:rgba(2,6,23,.7);display:grid;place-items:center;padding:16px}
.modal-card{background:#fff;border-radius:20px;padding:18px;width:100%;max-width:520px;max-height:86vh;overflow:auto;position:relative}
.modal-close{position:absolute;top:12px;right:12px;width:36px;height:36px;border-radius:999px;border:none;background:#f1f5f9;font-weight:900;cursor:pointer}
.modal-actions{display:grid;gap:8px;margin-top:14px}
.maneuver-list{margin-top:10px;display:grid;gap:6px;font-size:13px}
.maneuver-item{padding:8px 10px;background:#f8fafc;border-radius:10px}

@media(min-width:900px){
  .sheet{left:auto;right:16px;bottom:16px;width:420px;max-height:calc(100vh - 96px);border-radius:20px}
  #map{top:64px}
}
