/* Terra Drive — driver app (mobile-first). Tokens come from /ui.css. */
html, body { height: 100%; }
body { overscroll-behavior-y: none; background: var(--navy-950); }
body.route-home { overflow: hidden; }

.app { position: relative; min-height: 100%; overflow-x: hidden; max-width: 640px; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; }
@media (min-width: 680px) { .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 600; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--gutter) 10px;
  background: rgba(11, 21, 38, .94); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -.01em; font-size: 1.05rem; color: var(--ink); white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.topbar .spacer { flex: 1; }
.topbar .founder-badge { font-size: .74rem; padding: 4px 9px 4px 6px; white-space: nowrap; flex: none; }
.topbar .founder-badge:not(:has(.fb-text)) { padding: 5px; }
#founderSlot, #langSlot { flex: none; }
.brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar .founder-badge svg { width: 16px; height: 16px; }
.demo-chip { background: #d62828; color: #fff; font: 800 .66rem/1 var(--font); letter-spacing: .12em; padding: 5px 7px; border-radius: 5px; }
@media (max-width: 380px) { .topbar .founder-badge .fb-text { display: none; } }

/* Connection banner */
.banner { display: none; padding: 8px var(--gutter); font-size: .88rem; text-align: center; background: #4a3410; color: #ffdca3; border-bottom: 1px solid rgba(242, 169, 59, .3); }
.banner.show { display: block; }
.banner.ok { background: #0f3a28; color: #b9f3d6; border-color: rgba(60, 207, 142, .3); }

/* Main view */
.view { flex: 1; padding: 18px var(--gutter) calc(96px + env(safe-area-inset-bottom, 0px)); }
.view h1 { font-size: 1.6rem; }
.view-narrow { max-width: 460px; margin: 0 auto; }
.screen-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.screen-title h1, .screen-title h2 { margin: 0; }
.back-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.back-btn svg { width: 20px; height: 20px; }

/* Map (home) */
.map-wrap { display: none; position: fixed; z-index: 1; left: 0; right: 0; top: 0; bottom: 0; max-width: 640px; margin: 0 auto; }
body.route-home .map-wrap { display: block; }
#map { position: absolute; inset: 0; background: #0d1a2c; }
.map-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px; color: var(--muted); font-size: .95rem;
  background: radial-gradient(circle at 50% 40%, #16294a 0, #0b1526 70%); }
body.route-home .view { position: fixed; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; z-index: 500; padding: 0 0 calc(70px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
body.route-home .view > * { pointer-events: auto; }
.leaflet-container { font: inherit; background: #0d1a2c; }
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.55); }
.leaflet-control-attribution { background: rgba(11, 21, 38, .8) !important; color: var(--ink-3) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }
.leaflet-bar a { background: var(--navy-800) !important; color: var(--ink) !important; border-color: var(--line) !important; }
.me-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--amber); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(242, 169, 59, .28), 0 2px 8px rgba(0, 0, 0, .5); }
.me-dot.off { background: var(--ink-4); box-shadow: 0 0 0 6px rgba(139, 154, 179, .2); }
.pin { width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .5); }
.pin span { transform: rotate(45deg); font-weight: 800; font-size: 13px; color: #fff; }
.pin.pickup { background: #c97a12; }
.pin.dropoff { background: #2f7de1; }
.recenter { position: absolute; right: 12px; z-index: 450; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--navy-800); color: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-s); cursor: pointer; }
.recenter svg { width: 22px; height: 22px; }

/* Bottom sheet (home) */
.sheet { background: var(--surface); border-top: 1px solid var(--line-2); border-radius: 24px 24px 0 0; padding: 10px var(--gutter) 16px; box-shadow: 0 -12px 40px rgba(0, 0, 0, .45); max-height: 72vh; overflow-y: auto; }
.sheet .grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 12px; }
.status-line { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-4); flex: none; }
.status-dot.on { background: var(--green); box-shadow: 0 0 0 0 rgba(60, 207, 142, .6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(60, 207, 142, .55); } 70% { box-shadow: 0 0 0 12px rgba(60, 207, 142, 0); } 100% { box-shadow: 0 0 0 0 rgba(60, 207, 142, 0); } }
.status-line h2 { margin: 0; font-size: 1.25rem; }
.online-btn { margin-top: 14px; min-height: 64px; font-size: 1.2rem; border-radius: 18px; }
.online-btn.go-off { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-2); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.mini-stat { background: var(--surface-2); border-radius: 12px; padding: 10px; text-align: center; }
.mini-stat b { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.mini-stat span { font-size: .74rem; color: var(--muted); }
.notice { border-radius: 12px; padding: 10px 12px; font-size: .9rem; margin-top: 12px; background: var(--surface-2); color: var(--ink-2); }
.notice.warn { background: var(--amber-soft); color: var(--amber-2); }
.notice.err { background: var(--red-soft); color: #ffc2c2; }
.notice.ok { background: var(--green-soft); color: #b9f3d6; }
.freedom { font-size: .8rem; color: var(--muted); margin-top: 12px; text-align: center; }

/* Offer overlay */
.offer-layer { position: fixed; inset: 0; z-index: 2000; display: none; align-items: flex-end; justify-content: center; background: rgba(3, 8, 16, .62); }
.offer-layer.show { display: flex; }
.offer {
  width: 100%; max-width: 640px; background: var(--navy-850); border-top: 2px solid var(--amber); border-radius: 26px 26px 0 0;
  padding: 18px var(--gutter) calc(18px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -20px 60px rgba(0, 0, 0, .6);
  animation: offer-in .25s ease-out; max-height: 94vh; overflow-y: auto;
}
@keyframes offer-in { from { transform: translateY(40px); opacity: .3; } to { transform: none; opacity: 1; } }
.offer-head { display: flex; align-items: center; gap: 14px; }
.offer-head h2 { margin: 0; font-size: 1.15rem; }
.countdown { position: relative; width: 62px; height: 62px; flex: none; }
.countdown svg { width: 62px; height: 62px; transform: rotate(-90deg); }
.countdown circle { fill: none; stroke-width: 6; }
.countdown .track { stroke: var(--surface-3); }
.countdown .bar { stroke: var(--amber); stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .25s; }
.countdown.low .bar { stroke: var(--red); }
.countdown b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.offer-pay { margin: 14px 0 6px; text-align: center; }
.offer-pay .big { font-size: 2.6rem; font-weight: 800; color: var(--amber-2); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.offer-pay .lbl { font-size: .85rem; color: var(--muted); }
.breakdown { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .95rem; font-variant-numeric: tabular-nums; }
.breakdown td { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.breakdown td:last-child { text-align: right; font-weight: 600; }
.breakdown tr.total td { border-bottom: 0; border-top: 1px solid var(--line-2); font-weight: 800; font-size: 1.05rem; color: var(--amber-2); padding-top: 10px; }
.breakdown .neg { color: var(--ink-2); }
.breakdown .zero { color: var(--green); }
.route { margin: 12px 0; position: relative; padding-left: 26px; }
.route::before { content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--amber), var(--blue)); }
.route .stop { position: relative; margin-bottom: 12px; }
.route .stop:last-child { margin-bottom: 0; }
.route .stop::before { content: ""; position: absolute; left: -24px; top: 5px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--amber); background: var(--navy-850); }
.route .stop.drop::before { border-color: var(--blue); }
.route .stop small { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; font-weight: 700; }
.route .stop b { display: block; }
.route .stop .addr { color: var(--ink-2); font-size: .9rem; }
.offer-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.offer-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; margin-top: 14px; }
.offer-actions .btn { min-height: 62px; font-size: 1.15rem; border-radius: 16px; }
.no-penalty { text-align: center; font-size: .85rem; color: var(--green); margin-top: 10px; font-weight: 600; }

/* Active delivery */
.stepper { display: flex; gap: 4px; margin: 6px 0 14px; }
.stepper i { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); }
.stepper i.done { background: var(--amber); }
.stepper i.now { background: linear-gradient(90deg, var(--amber), var(--surface-3)); }
.nav-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.nav-links a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 58px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink); font-size: .8rem; font-weight: 600; text-decoration: none; }
.nav-links a svg { width: 20px; height: 20px; color: var(--amber-2); }
.dest { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; }
.dest small { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; font-weight: 700; }
.dest h3 { margin: 2px 0 2px; font-size: 1.1rem; }
.dest p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.items-list { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: .92rem; }
.step-btn { margin-top: 14px; min-height: 64px; font-size: 1.15rem; border-radius: 18px; }
.photo-box { margin-top: 12px; border: 2px dashed var(--line-2); border-radius: 16px; min-height: 160px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--navy-950); position: relative; }
.photo-box img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.photo-box .ph { color: var(--muted); text-align: center; padding: 20px; }
.photo-box .ph svg { width: 40px; height: 40px; display: block; margin: 0 auto 6px; color: var(--amber-2); }
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.result-card { text-align: center; padding: 26px 18px; }
.result-card .icon { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--green-soft); color: var(--green); }
.result-card .icon svg { width: 34px; height: 34px; }
.result-card .icon.warn { background: var(--amber-soft); color: var(--amber-2); }
.result-card .amount { font-size: 2.2rem; font-weight: 800; color: var(--amber-2); font-variant-numeric: tabular-nums; }

/* Onboarding */
.progress { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin: 8px 0 18px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--amber-2)); border-radius: 4px; transition: width .3s; }
.step-list { list-style: none; margin: 0; padding: 0; }
.step-item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 10px; cursor: pointer; min-height: 68px; color: var(--ink); width: 100%; text-align: left; font: inherit; }
.step-item:hover { border-color: var(--line-2); }
.step-item .ico { width: 36px; height: 36px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--ink-3); font-weight: 800; }
.step-item.done .ico { background: var(--green-soft); color: var(--green); }
.step-item.next { border-color: rgba(242, 169, 59, .55); box-shadow: 0 0 0 3px var(--amber-soft); }
.step-item .ico svg { width: 20px; height: 20px; }
.step-item b { display: block; }
.step-item small { color: var(--muted); }
.step-item .chev { margin-left: auto; color: var(--ink-4); }
.step-item[aria-disabled="true"] { cursor: default; }
.founder-card { background: linear-gradient(140deg, #2a1d07 0%, #12223b 65%); border: 1px solid rgba(255, 196, 107, .35); border-radius: 20px; padding: 16px; margin-bottom: 16px; }
.founder-card h3 { color: #ffd99a; margin-bottom: 6px; }
.founder-card p { font-size: .9rem; color: var(--ink-2); margin-bottom: 8px; }
.founder-count { font-weight: 800; font-size: 1.05rem; color: var(--amber-2); font-variant-numeric: tabular-nums; }
.founder-meter { height: 6px; background: rgba(255, 255, 255, .08); border-radius: 3px; overflow: hidden; margin: 6px 0 8px; }
.founder-meter i { display: block; height: 100%; background: var(--amber); }
.legal-box { background: var(--navy-950); border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; font-size: .9rem; color: var(--ink-2); max-height: 46vh; overflow-y: auto; }
.legal-box h3 { color: var(--ink); font-size: 1rem; }
.legal-box ul { padding-left: 18px; margin: 0 0 10px; }
.legal-box li { margin-bottom: 6px; }
.signature-preview { font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", cursive; font-size: 1.6rem; color: var(--amber-2); min-height: 2.2rem; border-bottom: 1px solid var(--line-2); margin-bottom: 14px; padding: 0 4px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--navy-950); border: 1px solid var(--line-2); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.seg button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font: 600 .95rem var(--font); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--amber); color: var(--amber-ink); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* Zones picker */
.zone-map { height: 300px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line-2); margin-bottom: 14px; position: relative; background: #0d1a2c; }
.zone-group h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 8px; }
.zone-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px; cursor: pointer; min-height: 60px; }
.zone-row input { width: 24px; height: 24px; accent-color: var(--amber); flex: none; }
.zone-row.on { border-color: rgba(242, 169, 59, .6); background: #1a2232; }
.zone-row b { display: block; }
.zone-row small { color: var(--muted); }
.zone-row .pill { margin-left: auto; flex: none; }
.zone-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.zone-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.sticky-save { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); padding-top: 10px; background: linear-gradient(transparent, var(--bg) 30%); }

/* Lists / tables */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; background: var(--navy-950); border: 1px solid var(--line-2); border-radius: 14px; padding: 4px; }
.tabs button { flex: 1; min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font: 600 .92rem var(--font); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--ink); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.stat span { display: block; font-size: .78rem; color: var(--muted); }
.stat b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat.hero { grid-column: 1 / -1; background: linear-gradient(140deg, #22324f, #16243c); }
.stat.hero b { font-size: 2rem; color: var(--amber-2); }
.list { list-style: none; margin: 0; padding: 0; }
.list-item { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; }
.list-item .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.list-item .top b { font-variant-numeric: tabular-nums; }
.list-item .sub { font-size: .82rem; color: var(--muted); }
.list-item .split { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .84rem; color: var(--ink-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.menu { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 0 16px; min-height: 58px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); font: 500 1rem var(--font); text-align: left; text-decoration: none; cursor: pointer; }
.menu li:last-child a, .menu li:last-child button { border-bottom: 0; }
.menu svg { width: 20px; height: 20px; color: var(--amber-2); flex: none; }
.menu .chev { margin-left: auto; color: var(--ink-4); }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.table th:first-child, .table td:first-child { text-align: left; }
.table th { color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.toggle-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 56px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--amber); }
.switch input:checked + span::after { transform: translateX(24px); }
.switch input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; margin-bottom: 8px; }
details.faq summary { min-height: 54px; display: flex; align-items: center; cursor: pointer; font-weight: 600; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; margin-left: auto; color: var(--amber-2); font-size: 1.3rem; }
details.faq[open] summary::after { content: "−"; }
details.faq p { color: var(--ink-2); font-size: .94rem; }

/* Auth */
.auth-hero { text-align: center; padding: 18px 0 10px; }
.auth-hero .mark { width: 64px; height: 64px; margin: 0 auto 12px; }
.auth-hero h1 { font-family: var(--font-display); font-size: 2.1rem; margin-bottom: 6px; }
.auth-hero p { color: var(--ink-2); font-size: .98rem; }
.auth-switch { text-align: center; margin-top: 14px; }
.auth-switch button { background: none; border: 0; color: var(--amber-2); font: 600 .95rem var(--font); cursor: pointer; padding: 10px; }

/* Tab bar */
.tabbar {
  position: fixed; z-index: 900; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(11, 21, 38, .97); border-top: 1px solid var(--line-2);
  padding-bottom: env(safe-area-inset-bottom, 0px); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 62px; color: var(--ink-3); font-size: .72rem; font-weight: 600; text-decoration: none; }
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a[aria-current="page"] { color: var(--amber-2); }
.tabbar.hidden { display: none; }

.skeleton { height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; margin: 10px 0; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.err-card { text-align: center; padding: 30px 18px; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

/* No tab bar (signed out / onboarding): reclaim the bottom space */
body.no-tabs .view { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
body.no-tabs .sticky-save { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }

/* Tight top bar on small phones */
.topbar .lang-switch button { padding: 7px 7px; min-width: 30px; }
@media (max-width: 400px) { .topbar { gap: 7px; } .brand { font-size: .98rem; } .brand-mark { width: 26px; height: 26px; } }

/* ---- Nov 6 driver-persona review ---------------------------------------------------------------------------- */
/* Header at 360–420 px: the founder badge + EN/RU/UZ switch no longer truncate the brand to "Terra Dı" — the word
   mark hides (the logo stays) when the badge is shown on a narrow phone. */
@media (max-width: 430px) { .topbar:has(#founderSlot .founder-badge) .brand-name { display: none; } }
@media (max-width: 340px) { .brand-name { display: none; } }
/* tap targets ≥ 44 px on a cheap phone */
.topbar .lang-switch button { min-width: 44px; min-height: 44px; padding: 0 8px; }
.tap { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.foot-links .tap { padding: 0 6px; }
.check.tap-row { min-height: 44px; padding: 6px 0; }
.check input { width: 26px; height: 26px; }
/* translated upload button over the hidden native input */
.file-btn { display: flex; gap: 10px; align-items: center; justify-content: center; min-height: 52px; border: 2px dashed var(--line-2); }
.file-btn svg { width: 22px; height: 22px; }
.pdf-chip { display: flex; gap: 8px; align-items: center; padding: 14px; color: var(--ink); }
.pdf-chip svg { width: 22px; height: 22px; }
/* validation: message next to the field that is wrong */
.field-err { margin: 6px 0 0; font-size: .88rem; }
[aria-invalid="true"] { border-color: var(--red, #ff5a5a) !important; box-shadow: 0 0 0 2px rgba(255, 90, 90, .25); }
.seg.seg-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 480px) { .seg.seg-4 { grid-template-columns: repeat(4, 1fr); } }
.pill-violet { background: rgba(169, 139, 255, .15); color: #c9b8ff; }
.pill-strong { background: var(--surface-3); color: var(--ink); font-weight: 800; }
.pill-strong.pill-red { background: var(--red-soft); color: #ffb3b3; }
.drop-area { display: block; font-size: .85rem; color: var(--ink-2); }
.breakdown tr.note td { font-size: .78rem; color: var(--muted); text-align: left; padding-top: 6px; }
/* map pins: icons, not letters */
.pin span { display: flex; }
.pin span svg { color: #fff; }
/* emergency + "can't complete" + support */
.sos { margin-left: 10px; min-width: 52px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: #c62828; color: #fff; font-weight: 900; letter-spacing: .06em; text-decoration: none; flex: none; }
.issue-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.issue-grid .btn { min-height: 44px; white-space: normal; }
.support-row { display: flex; flex-wrap: wrap; gap: 8px; }
.support-row .btn { min-height: 44px; }
.session-card { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--navy-950); }
.session-card .mini-stats { margin-top: 6px; }
.stat.warn b { color: var(--amber-2); }
.req-box summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.req-list { margin: 8px 0 0; padding-left: 20px; }
.req-list li { margin-bottom: 6px; }
.founder-card.standard { border-color: var(--line-2); background: var(--navy-900, #0e1830); }
.founder-badge.lapsed { opacity: .6; filter: grayscale(.6); }
/* FCRA disclosure: in the normal page flow (no small nested scroll box), nothing else on the screen */
.disclosure { background: var(--navy-950); border: 1px solid var(--line-2); border-radius: 14px; padding: 16px; font-size: 1rem; line-height: 1.6; color: var(--ink); margin-bottom: 14px; }
.disclosure p { margin: 0 0 12px; }
/* tax tables fit a 360–390 px phone: short headers and tighter cells */
.table-wrap.compact .table th, .table-wrap.compact .table td { padding: 8px 6px; font-size: .86rem; white-space: nowrap; }
.table .total td { font-weight: 800; border-top: 1px solid var(--line-2); }
