/* PARK-IT design system V1 — premium smart-city mobility.
   Canonical target: docs/vision/park-it-vision-board-v1.svg
   Dark navy surfaces, electric blue/cyan actions, green live states,
   purple analytics, orange crypto accents, red restriction/danger. */

:root {
  color-scheme: dark;
  --bg-0: #05090f;
  --bg-1: #0a1420;
  --bg-2: #0d1b2a;
  --surface: #12263a;
  --surface-2: #16314a;
  --surface-3: #1b3d5b;
  --border: #1e3a52;
  --border-strong: #2a4f6e;
  --text: #e8eef5;
  --text-dim: #9fc1dd;
  --text-mute: #6b8499;
  --primary: #1f6feb;
  --primary-hi: #3d8bfd;
  --cyan: #22d3ee;
  --green: #2ea043;
  --green-hi: #7ee2a0;
  --purple: #a371f7;
  --purple-hi: #c9a8fb;
  --orange: #f0a648;
  --orange-hi: #ffce85;
  --red: #a04040;
  --red-hi: #e08a8a;
  --gold: #e2c47e;
  --radius: 12px;
  --radius-sm: 8px;
  --glow-primary: 0 0 0 1px rgba(31, 111, 235, 0.35), 0 8px 24px rgba(3, 10, 20, 0.55);
  --glow-cyan: 0 0 18px rgba(34, 211, 238, 0.18);
  --shadow-card: 0 6px 18px rgba(2, 8, 16, 0.5);
  --font: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(31, 111, 235, 0.12), transparent 60%),
    radial-gradient(900px 400px at 10% -5%, rgba(34, 211, 238, 0.07), transparent 55%),
    var(--bg-0);
  color: var(--text);
  min-height: 100vh;
}

/* ---------------------------------------------------------------- layout */

header.app-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.8rem 1.4rem;
  background: linear-gradient(180deg, rgba(18, 38, 58, 0.95), rgba(13, 27, 42, 0.9));
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 0.65rem; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand h1 { font-size: 1.05rem; margin: 0; letter-spacing: 0.14em; font-weight: 700; }
.brand .tag {
  font-size: 0.62rem; color: var(--cyan); letter-spacing: 0.18em;
  text-transform: uppercase; display: block; margin-top: 0.1rem;
}
#session { font-size: 0.8rem; color: var(--text-dim); display: flex; gap: 0.55rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
#session button { padding: 0.35rem 0.75rem; font-size: 0.78rem; }

nav#roles {
  display: flex; gap: 0.5rem; padding: 0.6rem 1.4rem; flex-wrap: wrap;
  background: rgba(15, 32, 50, 0.7); border-bottom: 1px solid var(--border);
  position: sticky; top: 55px; z-index: 25; backdrop-filter: blur(8px);
}
nav#roles a {
  color: var(--text-dim); text-decoration: none; padding: 0.35rem 0.95rem;
  border: 1px solid var(--border); border-radius: 999px; font-size: 0.83rem;
  transition: all 0.15s ease;
}
nav#roles a:hover { border-color: var(--border-strong); color: var(--text); }
nav#roles a.active {
  background: linear-gradient(135deg, var(--primary), #1558c9);
  color: #fff; border-color: transparent;
  box-shadow: 0 0 14px rgba(31, 111, 235, 0.45);
}

main { padding: 1.4rem; max-width: 1240px; margin: 0 auto; }

/* ---------------------------------------------------------------- cards */

section.card {
  background: linear-gradient(180deg, var(--surface), rgba(15, 32, 50, 0.9));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.15rem 1.35rem; margin-bottom: 1.1rem;
  box-shadow: var(--shadow-card);
}
section.card h2 {
  margin: 0 0 0.8rem; font-size: 0.95rem; color: var(--text-dim);
  letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600;
  display: flex; align-items: center; gap: 0.5rem;
}
section.card h2::before {
  content: ''; width: 8px; height: 8px; border-radius: 2px;
  background: var(--primary); box-shadow: 0 0 8px var(--primary);
}
section.card.accent-green h2::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
section.card.accent-purple h2::before { background: var(--purple); box-shadow: 0 0 8px var(--purple); }
section.card.accent-orange h2::before { background: var(--orange); box-shadow: 0 0 8px var(--orange); }
section.card.accent-cyan h2::before { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
section.card.accent-red h2::before { background: var(--red); box-shadow: 0 0 8px var(--red); }

.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ---------------------------------------------------------------- stats */

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.stat {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.9rem 1rem; position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 60%, rgba(34, 211, 238, 0.06));
  pointer-events: none;
}
.stat .k { font-size: 0.68rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.1em; }
.stat .v { font-size: 1.5rem; font-weight: 700; margin-top: 0.25rem; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 0.72rem; color: var(--text-mute); margin-top: 0.15rem; }
.stat.tone-green .v { color: var(--green-hi); }
.stat.tone-purple .v { color: var(--purple-hi); }
.stat.tone-orange .v { color: var(--orange-hi); }
.stat.tone-cyan .v { color: var(--cyan); }
.stat.tone-red .v { color: var(--red-hi); }

/* mini bars for occupancy/revenue without a chart lib */
.bar-track { height: 8px; border-radius: 99px; background: var(--bg-1); border: 1px solid var(--border); overflow: hidden; margin-top: 0.5rem; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--cyan)); transition: width 0.4s ease; }
.fill-0 { width: 0; } .fill-10 { width: 10%; } .fill-20 { width: 20%; } .fill-30 { width: 30%; }
.fill-40 { width: 40%; } .fill-50 { width: 50%; } .fill-60 { width: 60%; } .fill-70 { width: 70%; }
.fill-80 { width: 80%; } .fill-90 { width: 90%; } .fill-100 { width: 100%; }
.hidden { display: none !important; }
.bar-fill.green { background: linear-gradient(90deg, var(--green), var(--green-hi)); }
.bar-fill.purple { background: linear-gradient(90deg, #7a5af8, var(--purple-hi)); }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; margin: 0 -0.4rem; padding: 0 0.4rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
th, td { text-align: left; padding: 0.45rem 0.55rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-dim); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; }
tbody tr:hover { background: rgba(34, 211, 238, 0.04); }
td .row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
td .row-actions button { padding: 0.25rem 0.6rem; font-size: 0.75rem; }

code { background: var(--bg-1); padding: 0.1rem 0.4rem; border-radius: 5px; font-size: 0.78rem; word-break: break-all; border: 1px solid var(--border); }
pre { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.85rem; overflow: auto; font-size: 0.78rem; }

/* ---------------------------------------------------------------- forms */

button, select, input, textarea {
  background: var(--bg-1); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.45rem 0.75rem; font-size: 0.85rem; font-family: inherit;
}
button { cursor: pointer; transition: all 0.12s ease; font-weight: 500; }
button:hover { border-color: var(--border-strong); filter: brightness(1.15); }
button.primary {
  background: linear-gradient(135deg, var(--primary), #1660d8); border-color: transparent;
  box-shadow: 0 2px 10px rgba(31, 111, 235, 0.35);
}
button.primary:hover { filter: brightness(1.15); box-shadow: 0 2px 16px rgba(31, 111, 235, 0.55); }
button.ghost { background: transparent; }
button.danger { border-color: var(--red); color: var(--red-hi); }
button.danger:hover { background: rgba(160, 64, 64, 0.15); }
button:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
a.btn, .btn { display: inline-block; padding: 0.45rem 0.9rem; border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 0.85rem; }

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 1px;
}
input::placeholder { color: var(--text-mute); }

form.inline { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: flex-end; margin: 0.4rem 0 0.8rem; }
label { font-size: 0.72rem; color: var(--text-dim); display: flex; flex-direction: column; gap: 0.25rem; text-transform: uppercase; letter-spacing: 0.05em; }
label input, label select, label textarea { text-transform: none; letter-spacing: normal; }

/* ---------------------------------------------------------------- badges & chips */

.badge {
  display: inline-block; padding: 0.12rem 0.55rem; border-radius: 999px;
  font-size: 0.72rem; border: 1px solid var(--border); color: var(--text-dim);
  white-space: nowrap; letter-spacing: 0.02em;
}
.badge.granted, .badge.published, .badge.active, .badge.confirmed, .badge.resolved,
.badge.succeeded, .badge.paid, .badge.settled, .badge.verified, .badge.ok, .badge.connected {
  border-color: var(--green); color: var(--green-hi); background: rgba(46, 160, 67, 0.1);
}
.badge.denied, .badge.failed, .badge.suspended, .badge.cancelled, .badge.withdrawn,
.badge.disabled, .badge.test_failed, .badge.expired {
  border-color: var(--red); color: var(--red-hi); background: rgba(160, 64, 64, 0.1);
}
.badge.opened, .badge.issued, .badge.pending, .badge.under_review, .badge.registered,
.badge.draft, .badge.requested, .badge.processing, .badge.requires_payment, .badge.attention {
  border-color: #b08a2e; color: var(--gold); background: rgba(176, 138, 46, 0.1);
}
.badge.simulated, .badge.sandbox_capable, .badge.external_only { border-color: var(--purple); color: var(--purple-hi); background: rgba(163, 113, 247, 0.1); }
.badge.live_capable { border-color: var(--cyan); color: var(--cyan); }
.badge.crypto_payment, .badge.tenant_managed { border-color: var(--orange); color: var(--orange-hi); }
.badge.platform_managed { border-color: var(--border-strong); }

.chip-row { display: flex; gap: 0.45rem; flex-wrap: wrap; margin: 0.3rem 0 0.8rem; }
.chip {
  padding: 0.3rem 0.8rem; border-radius: 999px; border: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-dim); background: var(--bg-1); cursor: pointer;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.on { border-color: var(--cyan); color: var(--cyan); background: rgba(34, 211, 238, 0.08); }

/* ---------------------------------------------------------------- provider cards */

.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.9rem; }
.provider-card {
  background: linear-gradient(165deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.55rem;
}
.provider-card .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.provider-card .name { font-weight: 700; font-size: 0.95rem; }
.provider-card .desc { font-size: 0.78rem; color: var(--text-mute); line-height: 1.4; }
.provider-card .caps { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.provider-card .caps span {
  font-size: 0.66rem; color: var(--text-dim); border: 1px solid var(--border);
  padding: 0.08rem 0.45rem; border-radius: 4px; background: var(--bg-1);
}
.provider-card .health { display: flex; align-items: center; gap: 0.45rem; font-size: 0.75rem; color: var(--text-mute); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-mute); flex-shrink: 0; }
.dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.fail { background: var(--red-hi); box-shadow: 0 0 8px var(--red-hi); }
.dot.idle { background: var(--text-mute); }
.provider-card .actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: auto; }
.provider-card .actions button { padding: 0.32rem 0.65rem; font-size: 0.76rem; }

/* ---------------------------------------------------------------- states */

.muted { color: var(--text-mute); }
.fs-xs { font-size: 0.72rem; }
.fs-lg { font-size: 1.25rem; }
.fw-bold { font-weight: 700; }
.mt-sm { margin-top: 0.6rem; }
.subhead { font-size: 0.78rem; color: var(--text-mute); margin: 0.8rem 0 0.4rem; }
.skel-line { height: 0.9rem; margin-bottom: 0.6rem; }
.w-40 { width: 40%; } .w-60 { width: 60%; } .w-78 { width: 78%; } .w-92 { width: 92%; }
.error { color: var(--red-hi); font-size: 0.85rem; white-space: pre-wrap; }
.ok { color: var(--green-hi); font-size: 0.85rem; }
.truth { font-size: 0.68rem; color: var(--purple-hi); text-transform: uppercase; letter-spacing: 0.08em; }

.empty-state { padding: 1.6rem; text-align: center; color: var(--text-mute); border: 1px dashed var(--border); border-radius: var(--radius); font-size: 0.85rem; }
.skeleton {
  border-radius: var(--radius-sm); min-height: 1rem;
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 300% 100%; animation: shimmer 1.4s infinite linear;
}
@keyframes shimmer { to { background-position: -300% 0; } }

.offline-banner {
  display: none; padding: 0.45rem 1.4rem; background: rgba(176, 138, 46, 0.15);
  border-bottom: 1px solid #b08a2e; color: var(--gold); font-size: 0.8rem; text-align: center;
}
body.offline .offline-banner { display: block; }

#toast { font-size: 0.85rem; min-height: 1.2rem; margin-top: 0.4rem; }
#toast a { color: var(--cyan); margin-left: 0.3rem; }

/* ---------------------------------------------------------------- driver flow */

.stepper { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.stepper .step {
  font-size: 0.72rem; padding: 0.25rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-mute);
}
.stepper .step.on { border-color: var(--primary); color: var(--primary-hi); background: rgba(31, 111, 235, 0.1); }

.token-display {
  font-family: ui-monospace, monospace; font-size: 1.5rem; letter-spacing: 0.15em;
  text-align: center; padding: 1rem; background: var(--bg-1);
  border: 1px solid var(--cyan); border-radius: var(--radius);
  color: var(--cyan); box-shadow: var(--glow-cyan); word-break: break-all;
}

/* ---------------------------------------------------------------- in-car */

body.car {
  background: var(--bg-0);
}
.car-shell { max-width: 720px; margin: 0 auto; padding: 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.car-shell .big {
  font-size: 1.35rem; padding: 1.3rem 1.5rem; border-radius: var(--radius);
  text-align: center; font-weight: 700;
}
.car-shell button.big { width: 100%; }
.car-shell .dest-card {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.2rem; font-size: 1.05rem;
}
.car-shell .dest-card .price { color: var(--cyan); font-weight: 700; font-size: 1.2rem; white-space: nowrap; }
.car-shell h1 { font-size: 1.3rem; margin: 0 0 0.2rem; }
.car-shell .sub { color: var(--text-mute); font-size: 0.9rem; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 720px) {
  header.app-bar { padding: 0.7rem 0.9rem; flex-wrap: wrap; }
  nav#roles { top: auto; padding: 0.5rem 0.9rem; }
  main { padding: 0.9rem; }
  section.card { padding: 0.95rem 1rem; }
  .brand h1 { font-size: 0.95rem; }
  .token-display { font-size: 1.1rem; }
  th { font-size: 0.66rem; }
  td, th { padding: 0.4rem 0.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ------------------------------------------------------------- smart map */

.map-wrap { position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-0); }
.map-canvas { display: block; width: 100%; height: 380px; cursor: grab; touch-action: none; }
.map-canvas:active { cursor: grabbing; }
.map-hud { position: absolute; top: 0.6rem; right: 0.6rem; display: flex; flex-direction: column; gap: 0.35rem; }
.map-hud button { width: 2rem; height: 2rem; padding: 0; font-size: 1rem; line-height: 1; background: var(--bg-1); border: 1px solid var(--border); }
.map-attr { position: absolute; left: 0.5rem; bottom: 0.4rem; font-size: 0.62rem; color: var(--text-mute); background: rgba(5,9,15,0.75); padding: 0.1rem 0.4rem; border-radius: 4px; }
.map-legend { position: absolute; right: 0.6rem; bottom: 0.4rem; display: flex; gap: 0.5rem; font-size: 0.66rem; color: var(--text-mute); }
.map-legend i { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.25rem; }
.map-empty { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; padding: 1.4rem; background: var(--bg-0); border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.map-detail { margin-top: 0.8rem; }
.map-detail .row-actions { margin-top: 0.6rem; }
.map-search { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.map-search input { flex: 1 1 16rem; }
@media (max-width: 720px) { .map-canvas { height: 300px; } }

/* ================================================================== */
/* CONSUMER SHELL — guest-first mobile UX (Issue #124).                */
/* Full-viewport map, floating controls, bottom sheet, tab bar.        */
/* The staff console reuses the classic card layout above.             */
/* ================================================================== */

body.consumer {
  overflow: hidden;
  height: 100dvh;
}
#stage {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.consumer #smart-map.map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  border: 0;
  border-radius: 0;
}
body.consumer .map-empty {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 11.25rem);
  left: 0;
  right: 0;
  bottom: 0;
  border: 0;
  border-radius: 0;
  padding: 1rem 1.2rem;
  overflow-y: auto;
  background:
    radial-gradient(900px 460px at 72% 12%, rgba(31, 111, 235, 0.10), transparent 58%),
    var(--bg-0);
}
body.consumer .map-empty strong {
  font-size: 0.86rem;
  color: var(--text);
}
body.consumer .map-empty .muted {
  max-width: 30rem;
  font-size: 0.78rem;
  line-height: 1.45;
}

/* floating top chrome */
#topbar {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 0.6rem);
  left: 0.8rem;
  right: 0.8rem;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.brand-sm {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(10, 20, 32, 0.82);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem 0.4rem 0.45rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
  pointer-events: auto;
}
.brand-sm img { width: 22px; height: 22px; border-radius: 6px; }
.brand-sm span { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; }

#search-form {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 3.6rem);
  left: 0.8rem;
  right: 0.8rem;
  z-index: 20;
  display: flex;
  gap: 0.45rem;
}
#search-input {
  flex: 1;
  padding: 0.75rem 1.05rem;
  font-size: 0.95rem;
  background: rgba(10, 20, 32, 0.92);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
}
#search-submit {
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #1660d8);
  border-color: transparent;
  padding: 0.75rem 1.1rem;
  font-weight: 600;
}
.search-out {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 6.9rem);
  left: 1.2rem;
  z-index: 20;
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-dim);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
#filters {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 8.1rem);
  left: 0.8rem;
  right: 0.8rem;
  z-index: 20;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
#filters::-webkit-scrollbar { display: none; }
#filters .chip {
  background: rgba(10, 20, 32, 0.88);
  backdrop-filter: blur(10px);
  padding: 0.42rem 0.9rem;
  white-space: nowrap;
  font-weight: 500;
}
#filters .chip.on {
  border-color: var(--cyan);
  color: #06121c;
  background: var(--cyan);
}

/* floating action controls */
.fab {
  position: absolute;
  right: 0.9rem;
  bottom: calc(env(safe-area-inset-bottom) + 9.5rem);
  z-index: 20;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: 1.3rem;
  padding: 0;
  background: rgba(10, 20, 32, 0.9);
  border: 1px solid var(--border-strong);
  color: var(--cyan);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card), 0 0 12px rgba(34, 211, 238, 0.25);
}
#zoom-stack {
  position: absolute;
  right: 0.9rem;
  bottom: calc(env(safe-area-inset-bottom) + 13.4rem);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
#zoom-stack button {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  font-size: 1.05rem;
  padding: 0;
  background: rgba(10, 20, 32, 0.9);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
}

/* space rail — compact horizontal list above the sheet/tab bar */
.rail {
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: calc(env(safe-area-inset-bottom) + 4.4rem);
  z-index: 15;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { display: none; }
.rail:empty { display: none; }
.space-row {
  flex: 0 0 auto;
  min-width: 11rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  text-align: left;
  padding: 0.6rem 0.8rem;
  background: rgba(10, 20, 32, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
}
.space-row .space-name { font-weight: 600; font-size: 0.84rem; }
.space-row .space-meta { font-size: 0.68rem; color: var(--text-mute); }
.space-row .space-price { font-size: 0.78rem; color: var(--cyan); font-weight: 700; }

/* bottom sheet */
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 3.5rem);
  z-index: 25;
  max-height: 62dvh;
  overflow-y: auto;
  transform: translateY(110%);
  transition: transform 0.22s ease;
  background: rgba(13, 27, 42, 0.96);
  border-top: 1px solid var(--border-strong);
  border-radius: 18px 18px 0 0;
  backdrop-filter: blur(16px);
  box-shadow: 0 -8px 30px rgba(2, 8, 16, 0.6);
  padding: 0.4rem 1.1rem calc(1rem + env(safe-area-inset-bottom));
}
.sheet.open { transform: translateY(0); }
.sheet-grip {
  width: 2.6rem;
  height: 0.28rem;
  border-radius: 99px;
  background: var(--border-strong);
  margin: 0.35rem auto 0.7rem;
}
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.8rem; }
.sheet-head h2 { margin: 0; font-size: 1.05rem; }
.sheet-x {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: transparent;
  font-size: 0.9rem;
}
.sheet-stats { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.6rem 0; }
.sheet-stats .stat { padding: 0.5rem 0.75rem; font-size: 0.78rem; }
.sheet-stats .stat b { font-size: 1.05rem; }
.sheet-stats .stat.good b { color: var(--green-hi); }
.sheet-stats .stat.warn b, .sheet-stats .stat.warn { color: var(--gold); }
.rules { font-size: 0.8rem; margin: 0.4rem 0; }
.rules-list { margin: 0.4rem 0; padding-left: 1.2rem; font-size: 0.8rem; color: var(--text-dim); }

.cta-row { display: flex; gap: 0.55rem; flex-wrap: wrap; margin: 0.7rem 0 0.2rem; }
.cta {
  flex: 1 1 auto;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--primary), #1660d8);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 18px rgba(31, 111, 235, 0.4);
}
.cta:hover { filter: brightness(1.15); }
.cta-ghost {
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  background: rgba(10, 20, 32, 0.7);
  border: 1px solid var(--border-strong);
}
.cta-ghost.on { border-color: var(--cyan); color: var(--cyan); }

.fld { margin: 0.55rem 0; }
.fld > span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.fld input { width: 100%; margin-top: 0.3rem; font-size: 1rem; padding: 0.7rem 0.9rem; text-transform: uppercase; }
.pills { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.3rem; }
.pill { border-radius: 999px; padding: 0.5rem 1rem; font-size: 0.85rem; }
.pill.on { background: linear-gradient(135deg, var(--primary), #1660d8); border-color: transparent; color: #fff; }

.quote-box { margin: 0.6rem 0; min-height: 1.4rem; }
.quote-total {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 1rem; padding: 0.6rem 0.2rem;
}
.quote-total b { font-size: 1.5rem; color: var(--cyan); }

/* tab pages overlay the map */
#page {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow-y: auto;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(31, 111, 235, 0.12), transparent 60%),
    var(--bg-0);
  padding: calc(env(safe-area-inset-top) + 0.8rem) 0.9rem calc(env(safe-area-inset-bottom) + 4.6rem);
}
.page-card {
  background: linear-gradient(180deg, var(--surface), rgba(15, 32, 50, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow-card);
}
.page-card h2 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.page-card h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.page-card.accent-green { border-color: var(--green); }
.page-card.accent-cyan { border-color: var(--border-strong); }
.page-card .row { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.page-card .row.hist { padding: 0.45rem 0; border-bottom: 1px solid var(--border); font-size: 0.84rem; }
.page-card .price { font-size: 1.3rem; font-weight: 700; color: var(--cyan); margin: 0.3rem 0; }
.page-card .plate {
  font-family: ui-monospace, monospace; letter-spacing: 0.12em;
  background: var(--bg-1); border: 1px solid var(--border-strong);
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 6px; margin: 0.2rem 0;
}
.token-out .token-display { margin-top: 0.6rem; }

/* bottom tab bar */
#tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom));
  background: rgba(10, 20, 32, 0.94);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
#tabbar .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: transparent;
  border: none;
  color: var(--text-mute);
  font-size: 0.68rem;
  padding: 0.45rem 0.2rem;
  letter-spacing: 0.02em;
}
#tabbar .tab .tab-ico { font-size: 1.05rem; line-height: 1; }
#tabbar .tab.active { color: var(--cyan); }

body.consumer #toast {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom) + 4.2rem);
  left: 1rem;
  right: 1rem;
  z-index: 50;
  text-align: center;
  pointer-events: none;
}
body.consumer #toast.ok { color: var(--green-hi); }
body.consumer #toast.error { color: var(--red-hi); }
body.consumer .offline-banner {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 60;
}

