:root {
  color-scheme: dark;
  --night:#111717;
  --ink:#182120;
  --ink2:#202d2b;
  --line:#3e514e;
  --frost:#f1f6ee;
  --mist:#b2c3b9;
  --ice:#aee4d5;
  --beacon:#bce77a;
  --beacon-ink:#1a260f;
  --accent-soft:#293b29;
  --ok:#92e4a7;
  --bad:#ffa79d;
  --r:16px;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  background:var(--night);
  color:var(--frost);
}

* { box-sizing:border-box }
[hidden] { display:none !important }
body { margin:0 }
h1,h2,h3,p,dl,dd { margin:0 }
h1 { font-size:clamp(1.8rem, 4.1vw, 2.75rem); font-weight:770; line-height:1.12; letter-spacing:-.044em; text-wrap:balance }
h2 { font-size:1.27rem; line-height:1.27; font-weight:730; letter-spacing:-.025em }
h3 { font-size:1.07rem; line-height:1.35; font-weight:700 }
a { color:var(--ice); text-underline-offset:.18em; overflow-wrap:anywhere }
button,input,select,textarea { font:inherit; color:inherit }
button,input,select,textarea { min-height:44px }
button,select { cursor:pointer }
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,a:focus-visible,summary:focus-visible { outline:2px solid var(--beacon); outline-offset:3px }
input,select,textarea { min-width:0; width:100%; border:1px solid var(--line); border-radius:10px; background:#141d1c; padding:9px 11px }
input::placeholder,textarea::placeholder { color:var(--mist); opacity:.75 }
select { appearance:none; padding-right:30px; background-image:linear-gradient(45deg,transparent 50%,var(--mist) 50%),linear-gradient(135deg,var(--mist) 50%,transparent 50%); background-position:calc(100% - 17px) center,calc(100% - 12px) center; background-size:5px 5px; background-repeat:no-repeat }
textarea { resize:vertical; min-height:82px }
input[type=checkbox] { min-height:1.3rem; width:1.3rem; height:1.3rem; flex:0 0 auto; accent-color:var(--beacon) }
button:disabled { opacity:.65; cursor:wait }
fieldset { min-width:0; margin:0; padding:0; border:0 }
label,legend,.field-label { font-size:.92rem; font-weight:620 }
legend { margin-bottom:8px }
small,.small { font-size:.88rem }
.muted { color:var(--mist) }
.amount { font-variant-numeric:tabular-nums; font-weight:750; white-space:nowrap }
.error { color:var(--bad); overflow-wrap:anywhere }
.error:empty { display:none }
.skip-link { position:fixed; top:8px; left:8px; transform:translateY(-150%); padding:12px; background:var(--ink); z-index:5 }
.skip-link:focus { transform:none }

.topbar { border-bottom:1px solid #34433e; background:#151d1b }
.top-inner,.workspace { max-width:1200px; margin:auto; padding-inline:max(24px,env(safe-area-inset-left,0px)) max(24px,env(safe-area-inset-right,0px)) }
.top-inner { min-height:73px; display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; padding-block:10px }
.identity,.account { display:flex; align-items:center; gap:12px; min-width:0; flex-wrap:wrap }
.brand { font-size:1.41rem; font-weight:840; letter-spacing:-.045em; line-height:1 }
.brand span { color:var(--beacon) }
.brand-mark { position:relative; display:block; width:36px; height:36px; border-radius:9px; background:var(--beacon); flex:none }
.brand-mark::before { content:""; position:absolute; top:12px; left:8px; width:19px; height:4px; border-radius:3px; background:var(--beacon-ink); transform:rotate(-29deg) }
.brand-mark::after { content:""; position:absolute; top:21px; left:15px; width:13px; height:4px; border-radius:3px; background:var(--beacon-ink); transform:rotate(-29deg) }
.region { color:var(--mist); font-size:.89rem; padding-left:12px; border-left:1px solid var(--line) }
.account select { width:auto; max-width:100%; min-height:44px }
.account-person { display:flex; align-items:baseline; gap:7px; flex-wrap:wrap }
.account-person strong { font-size:.93rem }
.mode { color:var(--beacon); font-size:.89rem }
.workspace { padding-bottom:max(44px,env(safe-area-inset-bottom,0px)) }
.navigation { display:flex; gap:8px 12px; flex-wrap:wrap; padding-top:15px; margin-bottom:20px; border-bottom:1px solid #34433e }
.nav-button { min-height:49px; color:var(--mist); background:transparent; border:0; border-bottom:3px solid transparent; padding:9px 12px; font-weight:650 }
.nav-button[aria-current=page] { color:var(--beacon); border-bottom-color:var(--beacon) }
#main { min-width:0 }
#main:focus { outline:none }
.notice { background:#233531; border:1px solid var(--line); border-left:4px solid var(--ice); border-radius:10px; padding:10px 14px; margin-block:12px; overflow-wrap:anywhere }
.notice[data-error=true] { color:var(--bad); border-left-color:var(--bad) }
.hero { position:relative; display:flex; justify-content:space-between; align-items:end; gap:16px; padding:25px 0 22px }
.hero p { color:var(--mist); margin-top:8px; max-width:58ch }
.hero .hero-stats { flex:none }
.columns { display:grid; gap:20px; align-items:start; grid-template-columns:minmax(0,2fr) minmax(260px,1fr) }
.trip-layout { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); grid-template-areas:"area form" "summary form"; gap:16px 20px; align-items:start }
.trip-map-panel { grid-area:area }
.trip-form { grid-area:form }
.trip-summary { grid-area:summary }
.auth-layout { margin:clamp(32px,7vw,90px) auto 0; max-width:960px; display:grid; align-items:center; gap:22px; grid-template-columns:1.15fr 1fr }
.auth-intro { min-height:332px; display:flex; flex-direction:column; justify-content:center; padding:clamp(22px,5vw,50px); border:1px solid #465d4c; border-radius:20px; background:radial-gradient(ellipse at 84% 13%,#314b37,transparent 68%),linear-gradient(140deg,#20352c,#192622 70%); overflow:hidden; position:relative }
.auth-intro h1 { font-size:clamp(2rem,4.7vw,3.65rem); max-width:12ch }
.auth-intro p { color:var(--mist); margin-top:14px; max-width:33ch }
.auth-roles { display:grid; gap:8px }
.demo-options { display:grid; gap:8px }
.demo-options .button { justify-content:space-between; width:100% }
.stack { display:grid; gap:16px; min-width:0 }
.stack.tight { gap:10px }
.panel { min-width:0; background:var(--ink); border:1px solid #394942; border-radius:var(--r); padding:clamp(15px,2.6vw,23px) }
.panel + .panel { margin-top:0 }
.panel-title,.row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 12px }
.panel-title { margin-bottom:14px }
.panel-title p { margin-top:3px }
.fields { display:grid; gap:13px; grid-template-columns:repeat(2,minmax(0,1fr)) }
.field { display:grid; align-content:start; min-width:0; gap:5px }
.field.wide,.wide { grid-column:1 / -1 }
.check { min-height:44px; display:flex; align-items:center; gap:10px; font-weight:500 }
.choice-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px }
.choice { display:flex; align-items:center; gap:11px; text-align:left; border:1px solid var(--line); background:#1c2926; border-radius:12px; padding:13px; font-size:.99rem; font-weight:720 }
.choice[aria-pressed=true] { border-color:var(--beacon); background:var(--accent-soft); color:#dcf5b3 }
.choice-icon { display:grid; place-items:center; width:31px; height:31px; border-radius:8px; background:#2b413a; color:var(--ice); font-weight:850; flex:none }
.choice[aria-pressed=true] .choice-icon { background:var(--beacon); color:var(--beacon-ink) }
.button { display:inline-flex; justify-content:center; align-items:center; border:1px solid var(--line); border-radius:10px; padding:8px 13px; background:var(--ink2); color:var(--frost); font-weight:660; line-height:1.25; text-align:center; text-decoration:none }
.button:hover { border-color:var(--ice); background:#2a4239 }
.button:active,.choice:active,.nav-button:active { opacity:.8 }
.button.primary { background:var(--beacon); border-color:var(--beacon); color:var(--beacon-ink) }
.button.primary:hover { background:#d1f29c }
.button.danger { color:var(--bad) }
.button.full { width:100% }
.actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px }
.pill { display:inline-flex; min-height:24px; align-items:center; gap:7px; border-radius:999px; padding:3px 9px; font-size:.86rem; font-weight:670; color:var(--ice); background:#293d37; text-wrap:balance }
.pill.amber { color:#ffe1a0; background:#41331e }
.pill.good { color:var(--ok); background:#153b33 }
.pill.bad { color:var(--bad); background:#412b31 }
.rule { border-top:1px solid var(--line); padding-top:12px; margin-top:0 }
.empty { min-height:100px; display:grid; align-content:center; padding:16px; border:1px dashed var(--line); border-radius:12px; color:var(--mist) }
.quote-value { font-size:1.75rem; line-height:1.2; letter-spacing:-.035em; color:var(--beacon) }
.price-panel { background:#202f26; border-color:#4c624d }
.pickup-display { color:var(--beacon); background:var(--accent-soft) }
.compact-quote { display:none }
.facts { display:flex; flex-wrap:wrap; gap:9px 20px }
.facts dt { font-size:.86rem; color:var(--mist) }
.facts dd { max-width:54ch; overflow-wrap:anywhere }
.order { display:grid; gap:13px }
.order-headline { display:flex; align-items:center; flex-wrap:wrap; gap:5px 11px }
.order-id { font-size:.88rem; color:var(--mist) }
.order-price { text-align:right }
.order-price .amount { display:block; font-size:1.32rem; line-height:1.2; color:var(--beacon) }
.order-price small { color:var(--mist) }
.offer { display:grid; align-items:center; gap:9px; grid-template-columns:minmax(0,1fr) auto auto; padding:12px; border:1px solid var(--line); border-radius:11px; background:#1d2d28 }
.offer .amount { color:var(--beacon); font-size:1.25rem; letter-spacing:-.03em }
.log { margin:0; padding-left:18px; display:grid; gap:7px; color:var(--mist); overflow-wrap:anywhere }
details > summary { color:var(--ice); cursor:pointer; min-height:44px; line-height:1.4; padding-block:11px }
details > form,details > .log { margin-top:4px }
.stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin-bottom:16px }
.stat { background:var(--ink2); border:1px solid var(--line); border-radius:12px; padding:12px 14px }
.stat strong { display:block; font-size:clamp(1.25rem,3vw,1.7rem); line-height:1.25 }
.stat span { color:var(--mist); font-size:.89rem }
.ledger { width:100%; border-collapse:collapse; font-size:.9rem }
.ledger th,.ledger td { text-align:left; padding:8px 6px; border-bottom:1px solid var(--line) }
.ledger th { color:var(--mist); font-weight:620 }
.ledger td:nth-child(2),.ledger th:nth-child(2) { text-align:right }
.map { position:relative; min-height:248px; overflow:hidden; border:1px solid #485e51; border-radius:13px; background:#293930; isolation:isolate }
.trip-map-panel .map { min-height:clamp(250px,29vw,350px) }
.map::before,.map::after { content:""; position:absolute; inset:0; pointer-events:none; z-index:-1 }
.map::before {
  inset:-32%; transform:rotate(-17deg);
  background:repeating-linear-gradient(0deg,#6277674f 0px 2px,transparent 2px 31px),
    repeating-linear-gradient(90deg,#5d74654f 0px 2px,transparent 2px 41px),
    repeating-linear-gradient(0deg,#3e534666 0px 15px,transparent 15px 48px);
}
.map::after {
  background:#234e52;
  clip-path:polygon(91% 0,100% 0,100% 100%,55% 100%,59% 91%,66% 78%,68% 65%,73% 55%,80% 48%,85% 37%,88% 22%,87% 11%);
}
.pin { position:absolute; left:var(--px); top:var(--py); transform:translate(-50%,-50%); background:#1e3029; color:var(--frost); padding:6px 9px; min-height:44px; border-radius:9px; border:1px solid #819b88; white-space:nowrap; font-size:.85rem; font-weight:670; box-shadow:0 3px 10px #10191494 }
.pin:hover { border-color:var(--beacon) }
.pin[aria-pressed=true] { background:var(--beacon); border-color:var(--beacon); color:var(--beacon-ink); font-weight:750; z-index:2 }
.filter-summary { min-height:24px; font-size:.9rem; color:var(--mist) }
.link-result { overflow-wrap:anywhere; background:#141d1c; padding:10px; border-radius:8px }

@media (max-width:820px) {
  .columns { grid-template-columns:minmax(0,1fr) }
  .columns.driver-columns aside { order:-1 }
  .trip-layout { grid-template-columns:minmax(0,1fr); grid-template-areas:"area" "form" "summary" }
  .compact-quote { display:grid; padding:12px; background:#203328; border-radius:11px }
  .wide-quote { display:none }
  .auth-layout { grid-template-columns:minmax(0,1fr); max-width:560px }
  .auth-intro { min-height:220px }
}
@media (max-width:490px) {
  .top-inner,.workspace { padding-inline:max(14px,env(safe-area-inset-left,0px)) max(14px,env(safe-area-inset-right,0px)) }
  .top-inner { gap:8px }
  .account { width:100%; gap:8px; justify-content:space-between }
  .account select { max-width:72% }
  .navigation { margin-bottom:9px; padding-top:6px; gap:0 8px }
  .nav-button { padding-inline:8px; font-size:.91rem }
  .hero { align-items:start; flex-direction:column; padding:17px 0 16px }
  .choice { padding:8px 7px; gap:6px; font-size:.90625rem }
  .choice-icon { width:23px; height:23px }
  .offer { grid-template-columns:minmax(0,1fr) auto }
  .offer .button { grid-column:1 / -1 }
  .fields { gap:10px }
  .stats { gap:5px }
  .stat { padding:8px }
  .stat span { font-size:.83rem }
}
@media (max-width:359px) {
  .fields,.choice-grid { grid-template-columns:minmax(0,1fr) }
  .pin { font-size:.72rem }
  .stats { grid-template-columns:1fr }
}
@media (prefers-reduced-motion: no-preference) {
  .button,.choice,.nav-button { transition:background-color 120ms,border-color 120ms,color 120ms }
}
