/* TaxiApp — RTL-first design system. Logical properties (inline-start/end) are used throughout. */
:root {
  --ink-950: #0b101b;
  --ink-900: #0f1522;
  --ink-800: #182033;
  --ink-700: #26304a;
  --ink-500: #5b6680;
  --ink-400: #8590a8;
  --ink-200: #d9dde6;
  --ink-100: #eceef3;
  --paper: #f6f4ef;
  --surface: #ffffff;
  --gold-600: #b8891f;
  --gold-500: #d4a43a;
  --gold-400: #e3bd62;
  --gold-100: #f8efd9;
  --green-600: #1f7a52;
  --green-100: #e2f3ea;
  --red-600: #b42a2a;
  --red-100: #fbe6e6;
  --amber-700: #8a5a00;
  --amber-100: #fff1d6;
  --blue-600: #2e5aac;
  --blue-100: #e5ecfa;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 21, 34, .05), 0 6px 24px rgba(15, 21, 34, .06);
  --font: "Heebo", "Assistant", "Rubik", "Segoe UI", "Arial Hebrew", system-ui, -apple-system, Arial, sans-serif;
  --sidebar-w: 256px;
  --tabbar-h: 66px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55;
  color: var(--ink-900); background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .25em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
a { color: var(--ink-900); }
a.link { color: var(--gold-600); text-decoration: none; font-weight: 600; font-size: .92rem; }
a.link:hover { text-decoration: underline; }
.muted { color: var(--ink-500); }
.small { font-size: .85rem; }
hr { border: 0; border-top: 1px solid var(--ink-100); margin: 1.25rem 0; }
code.details { display: block; font-size: .78rem; color: var(--ink-500); margin-top: .2rem; word-break: break-all; }
.icon { width: 20px; height: 20px; flex: none; }
.icon-xl { width: 44px; height: 44px; color: var(--ink-400); }
.skip-link { position: absolute; inset-inline-start: -999px; top: 0; background: var(--gold-500); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { inset-inline-start: 0; }
:focus-visible { outline: 3px solid var(--gold-400); outline-offset: 2px; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; }
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, var(--gold-400), var(--gold-600)); color: var(--ink-950);
  font-weight: 900; font-size: 1.05rem; box-shadow: inset 0 -2px 0 rgba(0,0,0,.15);
}
.brand-mark-lg { width: 64px; height: 64px; font-size: 2rem; border-radius: 18px; }

/* ---------- app shell ---------- */
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-w);
  background: var(--ink-900); color: #fff; display: flex; flex-direction: column;
  padding: 1.4rem 1rem; z-index: 20;
}
.sidebar .brand { padding: 0 .5rem 1.4rem; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 1rem; }
.side-nav { display: flex; flex-direction: column; gap: .25rem; }
.side-nav a, .side-link {
  display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.72); text-decoration: none; font-weight: 500; font-size: .97rem;
  background: none; border: 0; width: 100%; font-family: inherit; cursor: pointer; text-align: start;
}
.side-nav a:hover, .side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: rgba(212,164,58,.14); color: var(--gold-400); }
.side-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 1rem; display: flex; flex-direction: column; gap: .25rem; }
.who { display: flex; align-items: center; gap: .7rem; padding: .3rem .5rem .8rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-700); color: var(--gold-400); font-weight: 700; flex: none; }
.who-text { display: flex; flex-direction: column; min-width: 0; }
.who-text strong { font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text small { color: rgba(255,255,255,.55); }

.topbar, .tabbar { display: none; }
.content { margin-inline-start: var(--sidebar-w); padding: 2rem clamp(1rem, 3vw, 2.5rem) 3rem; max-width: calc(1120px + var(--sidebar-w)); }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head p { margin: .3rem 0 0; }
.eyebrow { color: var(--gold-600); font-weight: 600; font-size: .9rem; margin: 0 0 .1rem !important; }
.back { display: inline-flex; align-items: center; gap: .25rem; color: var(--ink-500); text-decoration: none; font-size: .9rem; margin-bottom: .4rem; }
.back .icon { width: 16px; height: 16px; }

/* ---------- cards & stats ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.35rem; margin-bottom: 1.25rem; border: 1px solid rgba(15,21,34,.04); }
.card.subtle { background: transparent; box-shadow: none; border: 1px dashed var(--ink-200); }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 520px; }
.pad { padding: 1rem 1.35rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.card-head h2 { margin: 0; }
.card-head.pad { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .2rem; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset-block-start: 0; inset-inline-start: 0; width: 4px; height: 100%; background: linear-gradient(var(--gold-400), var(--gold-600)); }
.stat-label { color: var(--ink-500); font-size: .88rem; }
.stat-value { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--ink-400); font-size: .8rem; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.grid-2.align-start { align-items: start; gap: 1.25rem; }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem 1.5rem; margin: 0 0 1rem; }
.kv dt { color: var(--ink-500); font-size: .85rem; }
.kv dd { margin: .15rem 0 0; font-weight: 500; }

.empty { text-align: center; padding: 2rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.error-code { font-size: 3rem; font-weight: 900; color: var(--gold-500); line-height: 1; }

/* ---------- lists ---------- */
.trip-list, .simple-list { list-style: none; margin: 0; padding: 0; }
.trip-list li + li, .simple-list li + li { border-top: 1px solid var(--ink-100); }
.trip-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem .25rem; text-decoration: none; color: inherit; flex-wrap: wrap; }
.trip-row:hover { background: var(--paper); border-radius: var(--radius-sm); }
.trip-route { display: flex; align-items: center; gap: .5rem; font-weight: 600; min-width: 0; flex: 1 1 260px; }
.trip-route span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-arrow { color: var(--gold-600); flex: none; }
.trip-meta { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.trip-fare { font-variant-numeric: tabular-nums; min-width: 80px; text-align: end; }
.simple-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 0; }
.simple-list li > div, .simple-list li > a { display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: inherit; }

.route-block { margin-bottom: 1.25rem; }
.route-point { display: flex; gap: .8rem; align-items: flex-start; }
.route-point p { margin: 0; font-weight: 600; font-size: 1.05rem; }
.dot { width: 14px; height: 14px; border-radius: 50%; margin-top: .3rem; flex: none; }
.dot-start { border: 3px solid var(--gold-500); }
.dot-end { background: var(--ink-900); }
.route-line { border-inline-start: 2px dashed var(--ink-200); height: 22px; margin-inline-start: 6px; }
.notes { background: var(--paper); border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: 1rem; }
.notes p { white-space: pre-line; margin: 0; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: start; font-weight: 600; color: var(--ink-500); font-size: .82rem; padding: .7rem 1.35rem; background: #faf9f6; border-bottom: 1px solid var(--ink-100); white-space: nowrap; }
.table td { padding: .8rem 1.35rem; border-bottom: 1px solid var(--ink-100); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table a { text-decoration: none; }
.table a:hover { color: var(--gold-600); }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-active, .badge-completed { background: var(--green-100); color: var(--green-600); }
.badge-pending, .badge-planned { background: var(--amber-100); color: var(--amber-700); }
.badge-suspended, .badge-cancelled { background: var(--red-100); color: var(--red-600); }
.badge-approved { background: var(--green-100); color: var(--green-600); }
.badge-manual_review, .badge-queued, .badge-processing, .badge-open, .badge-assigned { background: var(--amber-100); color: var(--amber-700); }
.badge-rejected, .badge-expired { background: var(--red-100); color: var(--red-600); }
.badge-role { background: var(--ink-100); color: var(--ink-700); }

/* ---------- forms ---------- */
.form fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
.form legend { font-weight: 700; margin-bottom: .75rem; color: var(--ink-700); font-size: .95rem; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .9rem; color: var(--ink-700); }
.req { color: var(--gold-600); }
input, select, textarea {
  font: inherit; font-size: 16px; /* 16px prevents iOS zoom */
  width: 100%; padding: .72rem .9rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--ink-200); background: #fff; color: var(--ink-900);
  transition: border-color .15s, box-shadow .15s; min-height: 48px;
}
textarea { min-height: 96px; resize: vertical; }
input[dir="ltr"] { text-align: left; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 4px rgba(212,164,58,.18); }
input:disabled { background: var(--ink-100); color: var(--ink-500); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red-600); }
.error-text { color: var(--red-600); font-size: .85rem; margin: 0; }
.hint { color: var(--ink-400); font-size: .82rem; margin: 0; }
.check { flex-direction: row; }
.check label, label.check { display: flex; gap: .55rem; align-items: center; font-weight: 500; }
.check input[type="checkbox"], label.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--gold-600); flex: none; }
.actions { display: flex; gap: .75rem; justify-content: flex-start; }
.inline-form { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.inline-form .field { margin: 0; flex: 1 1 160px; }
.inline-form label.check { flex-basis: 100%; }

.filters { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; padding: 1rem 1.35rem; }
.filters .field { margin: 0; flex: 1 1 150px; }
.filters .field.grow { flex: 3 1 240px; }
.filter-actions { display: flex; gap: .5rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 700; font-size: .95rem; padding: .72rem 1.25rem; min-height: 48px;
  border-radius: var(--radius-sm); border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .05s, background .15s, box-shadow .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--gold-400), var(--gold-500)); color: var(--ink-950); box-shadow: 0 2px 10px rgba(212,164,58,.35); }
.btn-primary:hover { background: var(--gold-500); }
.btn-secondary { background: var(--ink-900); color: #fff; }
.btn-secondary:hover { background: var(--ink-800); }
.btn-ghost { background: transparent; border-color: var(--ink-200); color: var(--ink-700); }
.btn-ghost:hover { background: var(--ink-100); }
.btn-danger { background: var(--surface); border-color: var(--red-600); color: var(--red-600); }
.btn-danger:hover { background: var(--red-100); }
.btn-sm { min-height: 38px; padding: .4rem .9rem; font-size: .88rem; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; color: inherit; padding: .5rem; cursor: pointer; border-radius: 8px; display: grid; place-items: center; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; padding-top: 1rem; font-size: .9rem; flex-wrap: wrap; }

/* ---------- flash ---------- */
.flashes { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.flash { padding: .8rem 1rem; border-radius: var(--radius-sm); font-weight: 500; border-inline-start: 4px solid; }
.flash-success { background: var(--green-100); color: var(--green-600); }
.flash-error { background: var(--red-100); color: var(--red-600); }
.flash-info { background: var(--blue-100); color: var(--blue-600); }
.notice { background: var(--gold-100); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 1rem; }
.notice p { margin: .3rem 0 0; }

/* ---------- public / auth ---------- */
.public-main { min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(380px, 520px); }
.auth-wrap.single { grid-template-columns: 1fr; place-items: center; padding: 1rem; }
.auth-hero {
  background:
    radial-gradient(1200px 500px at 80% 10%, rgba(212,164,58,.22), transparent 60%),
    radial-gradient(800px 600px at 10% 90%, rgba(46,90,172,.18), transparent 60%),
    var(--ink-950);
  color: #fff; display: grid; place-items: center; padding: 2rem; position: relative; overflow: hidden;
}
.auth-hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 10px;
  background: repeating-linear-gradient(90deg, var(--gold-500) 0 22px, var(--ink-950) 22px 44px); opacity: .8;
}
.auth-hero-inner { text-align: center; }
.auth-hero h2 { font-size: 2.6rem; margin-top: 1rem; letter-spacing: .02em; }
.auth-hero p { color: rgba(255,255,255,.7); font-size: 1.1rem; }
.auth-card { background: var(--surface); padding: clamp(1.5rem, 5vw, 3.5rem); display: flex; flex-direction: column; justify-content: center; width: 100%; }
.auth-wrap.single .auth-card { max-width: 460px; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.auth-card h1 { font-size: 1.8rem; }
.auth-card .form { margin-top: 1.25rem; }
.auth-switch { text-align: center; margin-top: 1.25rem; color: var(--ink-500); }
.auth-switch a { color: var(--gold-600); font-weight: 700; }
.auth-brand-mobile { display: none; }

code.temp-pass { font-size: 1.2rem; font-weight: 700; background: #fff; padding: .3rem .7rem; border-radius: 8px; user-select: all; }
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--ink-100); }
.bars li:last-child { border-bottom: 0; }
.bar-track { height: 10px; background: var(--ink-100); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-600), var(--gold-400)); border-radius: 999px; }
.bar-val { font-variant-numeric: tabular-nums; text-align: end; min-width: 120px; font-size: .9rem; }
.bar-val small { display: block; color: var(--ink-500); }
.totals { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: .92rem; }

/* pricing & offers */
.price-box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; background: var(--paper); border-radius: var(--radius-sm); padding: .8rem 1rem; margin: .8rem 0; }
.price-box div { display: flex; flex-direction: column; }
.price-box strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.price-box.locked { background: var(--gold-100); }
.lock-note { grid-column: 1 / -1; margin: .2rem 0 0; display: flex; align-items: center; gap: .3rem; }
.lock-note .icon { width: 14px; height: 14px; }
.offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.offer { margin: 0; }
.offer.price-changed { box-shadow: 0 0 0 3px var(--gold-400), var(--shadow); }
.banner-ok { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; border-inline-start: 4px solid var(--green-600); }
.banner-ok p { margin: 0; }
.table .icon { width: 14px; height: 14px; vertical-align: -2px; color: var(--gold-600); }

/* notifications, AI */
.side-link .count, .bell .count { background: var(--gold-500); color: var(--ink-950); border-radius: 999px; font-size: .72rem; font-weight: 800; padding: 0 .45rem; margin-inline-start: auto; }
.bell { position: relative; }
.bell .count { position: absolute; top: 0; inset-inline-end: 0; }
.topbar-actions { display: flex; align-items: center; gap: .25rem; }
.notif-list li.unread strong { color: var(--ink-950); }
.notif-list li.unread { border-inline-start: 3px solid var(--gold-500); padding-inline-start: .75rem; }
.notice.renewal { border-inline-start: 4px solid var(--amber-700); }
.ai-note { background: var(--blue-100); color: var(--blue-600); border-radius: var(--radius-sm); padding: .6rem .9rem; }
details.fields { margin: .5rem 0 1rem; }
details.fields summary { cursor: pointer; color: var(--gold-600); font-weight: 600; margin-bottom: .6rem; }
.align-end { align-items: end; }
fieldset.seg { border: 0; padding: 0; display: flex; flex-direction: row; gap: 1rem; align-items: center; flex-wrap: wrap; }
fieldset.seg legend { font-weight: 600; font-size: .9rem; color: var(--ink-700); margin-bottom: .35rem; width: 100%; }
select[multiple] { min-height: 90px; }
.inline-form .grow-3 { flex: 3 1 260px; }
.guideline { width: 100%; }
.guideline .field { margin: 0; }
li.inactive { opacity: .55; }

/* customer */
.book-cta { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: inherit; border: 2px solid var(--gold-400); }
.book-cta .brand-mark { width: 52px; height: 52px; }
.quote { background: var(--gold-100); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0; }
.quote-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.quote-price { font-size: 2rem; font-variant-numeric: tabular-nums; }
.searching { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; background: var(--blue-100); border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: 1rem; color: var(--blue-600); }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--blue-600); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46,90,172,.5); } 100% { box-shadow: 0 0 0 14px rgba(46,90,172,0); } }
.driver-card { display: flex; gap: 1rem; align-items: center; background: var(--paper); border-radius: var(--radius-sm); padding: .9rem 1rem; margin-bottom: 1rem; }
.driver-card .avatar { width: 52px; height: 52px; font-size: 1.3rem; }
.driver-card p { margin: 0; }
.source-tag { font-size: .75rem; font-weight: 700; padding: .1rem .55rem; border-radius: 999px; background: var(--ink-100); color: var(--ink-700); }
.source-tag.customer { background: var(--blue-100); color: var(--blue-600); }
.changed-since { color: var(--amber-700); font-weight: 700; font-size: .85rem; }

/* width steps (CSP forbids inline styles) */
.w-0{width:0%} .w-5{width:5%} .w-10{width:10%} .w-15{width:15%} .w-20{width:20%} .w-25{width:25%} .w-30{width:30%} .w-35{width:35%} .w-40{width:40%} .w-45{width:45%} .w-50{width:50%} .w-55{width:55%} .w-60{width:60%} .w-65{width:65%} .w-70{width:70%} .w-75{width:75%} .w-80{width:80%} .w-85{width:85%} .w-90{width:90%} .w-95{width:95%} .w-100{width:100%}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  :root { --sidebar-w: 220px; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between;
    background: var(--ink-900); color: #fff; padding: .7rem 1rem; padding-top: max(.7rem, env(safe-area-inset-top));
  }
  .content { margin: 0; padding: 1.25rem 1rem calc(var(--tabbar-h) + 2rem + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
    background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--ink-100);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-500); text-decoration: none; font-size: .72rem; font-weight: 600; }
  .tabbar a.active { color: var(--ink-900); }
  .tabbar a.active .icon { color: var(--gold-600); }
  .tabbar a.tab-primary .icon { background: var(--gold-500); color: var(--ink-950); border-radius: 12px; width: 36px; height: 30px; padding: 4px 8px; }
  .hide-mobile { display: none !important; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: 1.4rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .stat { padding: .9rem 1rem; }
  .stat-value { font-size: 1.3rem; }
  .card { padding: 1.1rem; }
  .table th, .table td { padding: .7rem 1rem; }
  .trip-meta { width: 100%; justify-content: space-between; }
  .sticky-actions { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + .5rem); }
  .sticky-actions .btn { width: 100%; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-card { min-height: 100vh; justify-content: flex-start; padding-top: 2.5rem; }
  .auth-brand-mobile { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; margin-bottom: 2rem; }
  .filters .filter-actions { width: 100%; }
  .filters .filter-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.notice.notice-error { background: var(--red-100, #fde8e8); border-inline-start: 4px solid var(--red-700, #b42318); }
.meter-notice { font-size: .92rem; }
.legal h2 { font-size: 1.05rem; margin: 1.2rem 0 .4rem; }
.legal p, .legal li { line-height: 1.65; }
.legal ul { padding-inline-start: 1.2rem; }

.install-banner { display: flex; align-items: center; gap: .75rem; background: #fff; border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1rem; box-shadow: 0 2px 10px rgba(15,21,34,.08); border-inline-start: 4px solid #c99a2e; }
.install-banner[hidden] { display: none; }
.install-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.install-close { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: inherit; padding: 0 .25rem; }

/* Live dispatch */
.online-card { display: grid; gap: .75rem; }
.online-state { display: flex; gap: .75rem; align-items: center; }
.online-dot { width: 14px; height: 14px; border-radius: 50%; background: #9aa3b2; flex: none; }
.online-card.is-online { border-inline-start: 4px solid #1f9d55; }
.online-card.is-online .online-dot { background: #1f9d55; box-shadow: 0 0 0 0 rgba(31,157,85,.6); animation: pulse-dot 1.6s infinite; }
@keyframes pulse-dot { 70% { box-shadow: 0 0 0 10px rgba(31,157,85,0); } 100% { box-shadow: 0 0 0 0 rgba(31,157,85,0); } }
.online-btn { font-size: 1.1rem; padding: .9rem; }
.offer-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(11,16,27,.92); display: flex; align-items: flex-end; justify-content: center; padding: 1rem; }
.offer-overlay[hidden] { display: none; }
.offer-card { background: #fff; width: 100%; max-width: 480px; border-radius: 20px; padding: 1.25rem; display: grid; gap: .5rem; position: relative; animation: offer-in .25s ease-out; max-height: 100%; overflow: auto; }
@keyframes offer-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.offer-price { font-size: 2.2rem; margin: 0; }
.offer-eta { font-weight: 700; color: #1f9d55; margin: 0; }
.offer-accept { font-size: 1.25rem; padding: 1rem; }
.offer-timer { position: absolute; top: 1rem; inset-inline-end: 1rem; width: 56px; height: 56px; display: grid; place-items: center; }
.offer-timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.offer-timer circle { fill: none; stroke-width: 4; }
.offer-timer .track { stroke: #e7e9ee; }
.offer-timer .bar { stroke: #c99a2e; transition: stroke-dashoffset 1s linear; }
.offer-timer span { font-weight: 800; font-size: 1.1rem; }
body.offer-open { overflow: hidden; }

/* Booking screen (Gett-style) */
.booking-page .content { padding-top: 0; }
.bk-map { position: relative; margin: 0 -1rem; height: 34vh; min-height: 200px; background: linear-gradient(160deg, #efe9dc, #e4dccb); overflow: hidden; }
.bk-map img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bk-map-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-500); font-size: .95rem; }
.bk-sheet { position: relative; margin: -1.25rem -1rem 0; background: var(--surface); border-radius: 22px 22px 0 0; padding: 1.25rem 1rem 1rem; box-shadow: 0 -6px 20px rgba(15,21,34,.08); }
.bk-title { font-size: 1.35rem; margin: 0 0 .75rem; }
.bk-route { position: relative; border: 1.5px solid var(--ink-200); border-radius: 16px; padding: .25rem .9rem; padding-inline-end: 3rem; }
.bk-row { display: flex; align-items: center; gap: .75rem; }
.bk-row input { flex: 1; border: 0; outline: 0; font-size: 1.05rem; padding: .85rem 0; background: transparent; min-width: 0; }
.bk-row.has-error input::placeholder { color: var(--red-600); }
.bk-sep { height: 1px; background: var(--ink-100); margin-inline-start: 2.1rem; }
.bk-ico { width: 1.35rem; height: 1.35rem; color: var(--ink-900); flex: none; }
.bk-ico svg { width: 100%; height: 100%; }
.bk-ico-flag { color: var(--gold-600); }
.bk-swap { position: absolute; inset-inline-end: .6rem; top: 50%; transform: translateY(-50%); width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid var(--ink-200); background: var(--surface); font-size: 1.1rem; cursor: pointer; }
.bk-suggest, .bk-quick { list-style: none; margin: .5rem 0 0; padding: 0; }
.bk-suggest[hidden], .bk-quick[hidden] { display: none; }
.bk-suggest button, .bk-quick button { display: flex; gap: .85rem; align-items: center; width: 100%; text-align: start; background: none; border: 0; border-bottom: 1px solid var(--ink-100); padding: .8rem .2rem; font: inherit; color: inherit; cursor: pointer; }
.bk-suggest small { display: block; color: var(--ink-500); font-size: .85rem; }
.bk-q-ico { width: 2rem; height: 2rem; border-radius: 50%; background: var(--ink-100); display: grid; place-items: center; flex: none; font-size: .95rem; }
.bk-h { font-size: 1.05rem; margin: 1.1rem 0 .25rem; }
.bk-cars { display: grid; gap: .5rem; margin-top: .5rem; }
.bk-car { display: flex; align-items: center; gap: .75rem; border: 1.5px solid var(--ink-200); border-radius: 14px; padding: .8rem .9rem; cursor: pointer; }
.bk-car input { accent-color: var(--ink-900); }
.bk-car:has(input:checked) { border-color: var(--ink-900); background: var(--paper); }
.bk-car.disabled { opacity: .45; cursor: not-allowed; }
.bk-car-name { flex: 1; font-weight: 600; }
.bk-car-price { font-weight: 800; }
.bk-details { display: grid; gap: .75rem; margin-top: 1rem; }
.bk-when, .bk-pay { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.bk-chip { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--ink-200); border-radius: 999px; padding: .4rem .85rem; cursor: pointer; }
.bk-chip:has(input:checked) { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }
.bk-chip input { position: absolute; opacity: 0; pointer-events: none; }
.bk-pay[hidden] { display: none; }
.bk-counters { display: flex; gap: 1rem; }
.bk-counters label { display: flex; align-items: center; gap: .5rem; }
.bk-counters input { width: 4.2rem; padding: .45rem; border: 1px solid var(--ink-200); border-radius: 10px; text-align: center; }
.bk-notes textarea { width: 100%; margin-top: .5rem; border: 1px solid var(--ink-200); border-radius: 10px; padding: .6rem; }
.bk-footer { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 64px); background: var(--surface); padding-top: .75rem; margin-top: 1rem; }
.bk-go { font-size: 1.1rem; padding: 1rem; }
.bk-footer .meter-notice { font-size: .82rem; padding: .6rem .8rem; }
.booking-page { overflow-x: hidden; }
.bk-map img[hidden] { display: none; }
.bk-row input, .bk-row input:focus { border: 0; box-shadow: none; min-height: 0; padding-inline: 0; border-radius: 0; }
.bk-car input { width: 1.25rem; height: 1.25rem; min-height: 0; flex: none; padding: 0; }
.bk-chip { position: relative; }
.bk-chip input { width: 1px; height: 1px; min-height: 0; padding: 0; inset: 0; }
.bk-counters input { min-height: 0; }
.bk-when input[type="datetime-local"] { width: auto; flex: 1; min-width: 12rem; }
.bk-footer { z-index: 5; }

.zone-form { display: grid; gap: .5rem; border-top: 1px solid var(--ink-100); padding-top: .75rem; }
.zone-list { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.zone-list .check { display: inline-flex; gap: .4rem; align-items: center; }
.zone-form:has(input[value="location"]:checked) .zone-list { opacity: .5; }
.live-map { margin: .75rem 0; border-radius: 14px; overflow: hidden; background: #ece6d8; aspect-ratio: 16/9; }
.live-map img { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-eta { font-weight: 800; color: var(--green-600); margin: .25rem 0; }

.zone-tag { display: inline-flex; align-items: center; gap: .3rem; background: var(--ink-900); color: #fff; border-radius: 999px; padding: .3rem .4rem .3rem .8rem; font-size: .9rem; }
.zone-tag button { background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 50%; width: 1.4rem; height: 1.4rem; cursor: pointer; line-height: 1; }
.zone-search { display: grid; gap: .4rem; }
.zone-search #zone-airport { justify-self: start; background: none; font: inherit; }

.bk-ico-stop { display: grid; place-items: center; font-size: 1.6rem; color: var(--ink-500); }
.bk-x { background: none; border: 0; font-size: 1.4rem; color: var(--ink-500); cursor: pointer; padding: 0 .3rem; }
.bk-add-stop { background: none; border: 0; color: var(--blue-600); font-weight: 700; padding: .55rem .2rem 0; cursor: pointer; font: inherit; font-weight: 700; }
.bk-add-stop[hidden] { display: none; }
.pin-overlay { position: fixed; inset: 0; z-index: 1100; background: var(--surface); display: flex; flex-direction: column; gap: .6rem; padding: .75rem; }
.pin-overlay[hidden] { display: none; }
.pin-head { display: flex; align-items: center; gap: .75rem; }
.pin-map { position: relative; flex: 1; min-height: 0; overflow: hidden; border-radius: 14px; background: #ece6d8; display: grid; place-items: center; }
.pin-map img { width: 100%; max-width: min(100%, 70vh); aspect-ratio: 1; object-fit: cover; cursor: crosshair; }
.pin-mark { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -30px 0 0 -15px; border-radius: 50% 50% 50% 0; background: var(--ink-900); transform: rotate(-45deg); box-shadow: 0 3px 8px rgba(0,0,0,.3); pointer-events: none; }
.pin-mark::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #fff; }
.pin-zoom { position: absolute; inset-inline-start: .6rem; bottom: .6rem; display: grid; gap: .35rem; }
.pin-zoom button { width: 2.6rem; height: 2.6rem; border-radius: 10px; border: 1px solid var(--ink-200); background: #fff; font-size: 1.3rem; cursor: pointer; }
.pin-addr { min-height: 1.4em; margin: 0; text-align: center; }

.stops-list { margin: .25rem 0 .5rem; padding-inline-start: 1.6rem; }
.stops-list ol { margin: .2rem 0 0; padding-inline-start: 1.1rem; }
.qp-paste { display: grid; gap: .4rem; background: var(--paper); border-radius: 12px; padding: .8rem; margin-bottom: 1rem; }
.qp-paste textarea { min-height: 64px; }
.qp-paste button { justify-self: start; }
.qp-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 .5rem; }
.qp-chips .bk-chip { background: #fff; font: inherit; font-size: .9rem; }
.qp-addr { position: relative; }
.qp-addr .bk-suggest { margin-top: -.5rem; margin-bottom: .5rem; background: #fff; border: 1px solid var(--ink-100); border-radius: 10px; padding: 0 .5rem; }
.qp-private { border: 1px dashed var(--ink-200); border-radius: 12px; padding: .7rem .9rem; margin: .5rem 0 1rem; }
.qp-private summary { cursor: pointer; }

.state-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.state-btn { border: 1.5px solid var(--ink-200); background: #fff; border-radius: 12px; padding: .85rem .3rem; font: inherit; font-weight: 800; cursor: pointer; }
.state-btn.free.on { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.state-btn.busy.on { background: #d97706; border-color: #d97706; color: #fff; }
.state-btn.off.on { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.online-card.state-busy { border-inline-start: 4px solid #d97706; }
.online-card.state-busy .online-dot { background: #d97706; }
.handover { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.contact-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.commission-box { border: 1.5px solid var(--gold-400); background: var(--gold-100); border-radius: 12px; padding: .9rem; margin-top: .75rem; display: grid; gap: .5rem; }
.need-box { background: var(--blue-100); border-radius: 10px; padding: .55rem .8rem; font-weight: 700; }

.bk-notes { display: grid; gap: .4rem; }
.bk-notes textarea { width: 100%; border: 1px solid var(--ink-200); border-radius: 10px; padding: .6rem; min-height: 64px; }
#bk-need .bk-chip.on { background: var(--ink-900); color: #fff; }
#bk-wc[hidden], #bk-wc-hint[hidden] { display: none; }

.future-banner { background: #1e3a8a; color: #fff; font-weight: 800; font-size: 1.05rem; border-radius: 12px; padding: .75rem 1rem; margin: 0 0 1rem; text-align: center; letter-spacing: .01em; }
.future-banner[hidden] { display: none; }
.future-chip { display: inline-block; background: #1e3a8a; color: #fff; font-weight: 800; border-radius: 999px; padding: .3rem .8rem; margin: 0 0 .4rem; font-size: .92rem; }
.future-chip[hidden] { display: none; }
.offer-card .future-chip { font-size: 1.05rem; }

.wn-overlay { position: fixed; inset: 0; z-index: 1200; background: rgba(11,16,27,.75); display: grid; place-items: center; padding: 1rem; }
.wn-card { background: #fff; border-radius: 20px; padding: 1.4rem; max-width: 440px; width: 100%; max-height: 90vh; overflow: auto; }
.wn-card h2 { margin: .2rem 0 .6rem; }
.wn-card ul { margin: 0 0 1rem; padding-inline-start: 1.2rem; display: grid; gap: .35rem; }

.wa-fab { position: fixed; inset-inline-start: 1rem; bottom: calc(env(safe-area-inset-bottom) + 1rem); z-index: 900; display: inline-flex; align-items: center; gap: .45rem; background: #25d366; color: #fff; text-decoration: none; font-weight: 800; border-radius: 999px; padding: .6rem .9rem .6rem .75rem; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.wa-fab svg { width: 1.5rem; height: 1.5rem; }
body.app .wa-fab { bottom: calc(env(safe-area-inset-bottom) + var(--tabbar-h, 64px) + .75rem); }
@media (min-width: 861px) { body.app .wa-fab { bottom: 1.25rem; } }
body.offer-open .wa-fab, body.booking-page .wa-fab span { display: none; }
body.booking-page .wa-fab { padding: .6rem; }
/* WhatsApp button never covers content or popups */
body { padding-bottom: calc(env(safe-area-inset-bottom) + 4.5rem); }
body.offer-open .wa-fab { display: none; }
