/* Red S. VTC — design system (white/graphite, operator accent via --brand). No external fonts. */
:root {
  --brand: #E11D48; --brand-dark: #BE123C; --brand-ink: #fff;
  --bg: #F6F7F9; --surface: #FFFFFF; --surface-2: #F1F3F6; --line: #E3E6EB; --line-strong: #CBD1DA;
  --ink: #12161C; --ink-2: #3B4452; --muted: #6B7585;
  --ok: #0E8A4F; --ok-bg: #E6F6EE; --warn: #9A5B00; --warn-bg: #FFF4DE; --bad: #B42318; --bad-bg: #FDECEA; --info: #1D4ED8; --info-bg: #E8EFFE;
  --side: #161A21; --side-ink: #C9CFD8; --side-active: #232934;
  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
  --shadow-lg: 0 10px 40px rgba(16,24,40,.18);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1116; --surface: #161A21; --surface-2: #1C212A; --line: #262C37; --line-strong: #333B48;
    --ink: #EEF1F5; --ink-2: #C3CAD5; --muted: #8C96A6;
    --ok-bg: #0F2A1E; --warn-bg: #2B2110; --bad-bg: #2E1514; --info-bg: #142040; --ok: #3DD68C; --warn: #F2B65C; --bad: #FF7A6E; --info: #8AB4FF;
    --side: #0B0D11; --side-active: #1A1F27; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1116; --surface: #161A21; --surface-2: #1C212A; --line: #262C37; --line-strong: #333B48;
  --ink: #EEF1F5; --ink-2: #C3CAD5; --muted: #8C96A6;
  --ok-bg: #0F2A1E; --warn-bg: #2B2110; --bad-bg: #2E1514; --info-bg: #142040; --ok: #3DD68C; --warn: #F2B65C; --bad: #FF7A6E; --info: #8AB4FF;
  --side: #0B0D11; --side-active: #1A1F27; color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: .9em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic.sm { width: 16px; height: 16px; } .ic.lg { width: 28px; height: 28px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 .95rem var(--font); cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .85rem; }
.btn-lg { min-height: 54px; font-size: 1.05rem; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Forms */
.field { margin-bottom: 14px; }
.field label, .label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ink-2); }
.input, input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=datetime-local], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; }
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.field-error { color: var(--bad); font-size: .85rem; margin: 4px 0 0; }
.help { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; }

/* Cards, stats, tables */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid > .card, .btn-row > .card { margin-top: 0; } /* grids space their children with gap */
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-h h2, .card-h h3 { margin: 0; }
.stat { display: flex; gap: 14px; align-items: center; }
.stat .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.stat .v { font-size: 1.45rem; font-weight: 750; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: .85rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .92rem; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; background: var(--info-bg); color: var(--info); }
.badge-ok { background: var(--ok-bg); color: var(--ok); } .badge-warn { background: var(--warn-bg); color: var(--warn); } .badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-brand { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.alert { padding: 12px 14px; border-radius: var(--r-sm); margin-bottom: 14px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-bg); color: var(--ok); } .alert-bad { background: var(--bad-bg); color: var(--bad); } .alert-warn { background: var(--warn-bg); color: var(--warn); } .alert-info { background: var(--info-bg); color: var(--info); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ic { width: 40px; height: 40px; opacity: .5; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 6px 12px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 12px 8px; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar form { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--brand); border-color: var(--brand); text-decoration: none; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.chart .col i { width: 100%; max-width: 34px; background: var(--brand); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.chart .col small { font-size: .7rem; white-space: nowrap; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.checklist li:last-child { border: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--line-strong); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.secret { font-family: var(--mono); background: var(--surface-2); padding: 10px; border-radius: 8px; word-break: break-all; }
.demo-banner { background: repeating-linear-gradient(45deg, #FFF4DE, #FFF4DE 12px, #FFEBC2 12px, #FFEBC2 24px); color: #6B4200; text-align: center; font-size: .82rem; font-weight: 700; padding: 4px 8px; }
.sandbox-badge { display: inline-block; background: #FFF4DE; color: #6B4200; border: 1px dashed #D9A441; border-radius: 6px; font-size: .72rem; font-weight: 800; padding: 1px 6px; letter-spacing: .04em; }

/* Back-office shell */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.1rem; padding: 6px 8px 16px; }
.side .logo img { height: 30px; width: auto; }
.side .logo .mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: #fff; }
.side nav a { display: flex; align-items: center; gap: 10px; color: var(--side-ink); padding: 9px 10px; border-radius: 10px; font-size: .92rem; text-decoration: none; }
.side nav a:hover { background: var(--side-active); color: #fff; }
.side nav a.on { background: var(--brand); color: #fff; }
.side nav .sec { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #7C8594; padding: 14px 10px 6px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 15%, var(--surface-2)); color: var(--brand); display: grid; place-items: center; font-weight: 800; }
.content { padding: 24px; max-width: 1400px; }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-h h1 { margin: 0; }
.menu-btn { display: none; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; inset: 0 auto 0 0; width: 270px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; }
  .content { padding: 16px; }
  .topbar { padding: 10px 16px; }
}
.assist-bar { background: #1D4ED8; color: #fff; padding: 6px 16px; font-size: .85rem; display: flex; gap: 12px; align-items: center; justify-content: center; }
.assist-bar button { background: #fff; color: #1D4ED8; border: 0; border-radius: 6px; padding: 2px 10px; font-weight: 700; cursor: pointer; }

/* Minimal / auth */
.center-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 420px; }
.brand-head { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; font-weight: 800; font-size: 1.35rem; }
.brand-head .mark { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; }

/* Public landing */
.pub-nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; max-width: 1200px; margin: 0 auto; gap: 12px; flex-wrap: wrap; }
.pub-nav .links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.hero { max-width: 1200px; margin: 0 auto; padding: 40px 24px 60px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -.03em; }
.hero h1 em { color: var(--brand); font-style: normal; }
.hero .lead { font-size: 1.15rem; color: var(--ink-2); }
.phone-mock { background: var(--surface); border-radius: 34px; border: 10px solid #12161C; box-shadow: var(--shadow-lg); padding: 16px; max-width: 330px; margin: 0 auto; }
.section { max-width: 1200px; margin: 0 auto; padding: 40px 24px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .features { grid-template-columns: 1fr; } }
.footer { border-top: 1px solid var(--line); padding: 24px; text-align: center; color: var(--muted); font-size: .85rem; }

/* PWA (passenger / driver) */
.pwa { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.pwa-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 5; }
.pwa-top .brand { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.pwa-top .brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.pwa-body { position: relative; flex: 1; min-height: 0; }
.map { position: absolute; inset: 0; background: var(--surface-2); z-index: 0; isolation: isolate; }
.map.nomap { display: grid; place-items: center; color: var(--muted); font-size: .9rem; text-align: center; padding: 20px; background: linear-gradient(180deg, var(--surface-2), var(--bg)); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 78%; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.12); padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); z-index: 10; }
.sheet.full { top: 0; max-height: none; border-radius: 0; }
.sheet .grip { width: 44px; height: 5px; border-radius: 9px; background: var(--line-strong); margin: 2px auto 12px; }
.sheet h2 { font-size: 1.15rem; }
.pwa-nav { display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 15; }
.pwa-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; color: var(--muted); font-size: .72rem; font-weight: 600; text-decoration: none; min-height: 52px; justify-content: center; }
.pwa-nav a.on { color: var(--brand); }
.place-input { display: flex; align-items: center; gap: 10px; padding: 4px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); margin-bottom: 8px; }
.place-input input { border: 0; min-height: 46px; padding: 0; box-shadow: none !important; background: transparent; }
.place-input .pin { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--ink-2); flex: none; }
.place-input .pin.dest { border-color: var(--brand); background: var(--brand); }
.suggest { list-style: none; margin: 0 0 8px; padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.suggest li button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px 12px; background: var(--surface); border: 0; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; color: var(--ink); min-height: 48px; }
.suggest li:last-child button { border-bottom: 0; }
.suggest li button:hover { background: var(--surface-2); }
.suggest small { display: block; color: var(--muted); }
.choice { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--r); background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: var(--ink); margin-bottom: 10px; min-height: 64px; }
.choice.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.choice .t { font-weight: 700; } .choice .s { color: var(--muted); font-size: .85rem; }
.choice .p { margin-left: auto; font-weight: 800; white-space: nowrap; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }
.chip { flex: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 14px; background: var(--surface); font: 600 .88rem var(--font); cursor: pointer; color: var(--ink); min-height: 40px; }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.offer { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; background: var(--surface); animation: pop .25s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.offer .who { flex: 1; min-width: 0; }
.offer .price { text-align: right; }
.offer .price b { font-size: 1.1rem; display: block; }
.big-price { font-size: 2rem; font-weight: 850; color: var(--brand); letter-spacing: -.02em; }
.otp { font-family: var(--mono); font-size: 2rem; font-weight: 800; letter-spacing: .3em; background: var(--surface-2); padding: 8px 16px; border-radius: 12px; display: inline-block; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--brand); transition: width 1s linear; }
.steps { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin: 6px 0 12px; }
.steps .on { color: var(--brand); font-weight: 700; }
.net-banner { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 30; background: #12161C; color: #fff; border-radius: 999px; padding: 6px 14px; font-size: .82rem; display: none; }
.net-banner.show { display: block; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 10px; height: 64px; margin-bottom: 10px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); margin: 10px auto; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 50%, transparent); } 100% { box-shadow: 0 0 0 28px transparent; } }
.toast-host { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); }
.toast { background: #12161C; color: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-lg); font-size: .92rem; animation: pop .2s; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90; display: grid; place-items: end center; }
.modal { background: var(--surface); width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; }
@media (min-width: 700px) { .modal-back { place-items: center; } .modal { border-radius: 22px; } }
.stars { display: flex; gap: 6px; justify-content: center; }
.stars button { font-size: 2rem; background: none; border: 0; cursor: pointer; color: var(--line-strong); min-width: 44px; min-height: 44px; }
.stars button.on { color: #F5A524; }

/* Driver */
.tier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.tier { min-height: 64px; border-radius: var(--r); border: 2px solid var(--line-strong); background: var(--surface); font: 800 1.05rem var(--font); color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tier small { font-weight: 600; font-size: .72rem; color: var(--muted); }
.tier.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.tier.on small { color: rgba(255,255,255,.85); }
.online-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--surface-2); margin-bottom: 12px; }
.switch { position: relative; width: 62px; height: 36px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 28px; height: 28px; left: 4px; top: 4px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(26px); }
.switch input:focus-visible + span { outline: 3px solid var(--brand); }

/* Chat simulator */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; padding: 12px; background: var(--surface-2); border-radius: var(--r); }
.msg { max-width: 80%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; font-size: .92rem; }
.msg.in { align-self: flex-end; background: #DCF8C6; color: #12161C; border-bottom-right-radius: 4px; }
.msg.out { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }

/* Installer */
.install { max-width: 860px; margin: 0 auto; padding: 24px 16px 60px; }
.req { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }

.leaflet-container { font: inherit; }
.marker-car { width: 30px; height: 30px; border-radius: 50%; background: #12161C; color: #fff; display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.marker-car.busy { background: var(--brand); }
.marker-pin { width: 18px; height: 18px; border-radius: 50%; background: var(--brand); border: 4px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.marker-pin.start { background: #12161C; }
#live-map, #zone-map { z-index: 0; isolation: isolate; }

/* ===================================================================================
   Layout robustness layer — nothing may overflow its container (v0.1.1 UI pass)
   =================================================================================== */
/* 1. Flex/grid children may shrink below their content width */
.grid > *, .btn-row > *, .card-h > *, .stat > *, .toolbar > *, .toolbar form > *, .who > *, .page-h > *,
.offer > *, .choice > *, .place-input > *, .online-toggle > *, .req > *, .checklist li > *, .kv > * { min-width: 0; }
/* 2. Long words, URLs, references and codes wrap instead of pushing the layout */
body { overflow-wrap: break-word; }
h1, h2, h3, h4, p, dd, dt, li, td, label, legend, .t, .s, .who, .muted, .help, .alert, .badge { overflow-wrap: anywhere; }
code, .mono, .secret { overflow-wrap: anywhere; word-break: break-all; }
.badge { white-space: normal; max-width: 100%; }
.btn { max-width: 100%; white-space: normal; text-align: center; line-height: 1.2; }
img, video, canvas { max-width: 100%; height: auto; }
.main, .content { min-width: 0; max-width: 100%; }
.card { min-width: 0; max-width: 100%; }

/* 3. Amounts: the number keeps its size, the currency shrinks first; whole block auto-fits (JS) */
.amt { display: inline-flex; align-items: baseline; gap: .22em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amt .amt-v { white-space: nowrap; }
.amt .amt-c { font-size: .62em; font-weight: 600; opacity: .75; letter-spacing: .02em; white-space: nowrap; }
[data-fit] { display: block; white-space: nowrap; max-width: 100%; overflow: hidden; }
td.num .amt, th.num .amt { justify-content: flex-end; }
.stat .v { font-size: clamp(1.05rem, 2.4vw, 1.45rem); }
.stat .l { overflow-wrap: anywhere; }
.big-price { font-size: clamp(1.4rem, 8vw, 2rem); line-height: 1.15; }

/* 4. Topbar & sidebar on small screens */
.topbar { flex-wrap: wrap; row-gap: 8px; }
.topbar > * { min-width: 0; }
.topbar .who { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
@media (max-width: 980px) {
  .side:not(.open) { visibility: hidden; }
  .topbar .btn-row .btn span.lbl { display: none; }
}
@media (max-width: 640px) {
  .topbar .btn-row { display: none; }
  .page-h h1 { font-size: 1.3rem; }
  .content { padding: 12px; }
  .card { padding: 14px; }
  .toolbar input, .toolbar select, .toolbar form { width: 100%; min-width: 0; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  fieldset { padding: 12px; }
}
/* 5. Tables: scroll inside their frame only; amounts and states never wrap mid-value */
.table-wrap { max-width: 100%; -webkit-overflow-scrolling: touch; }
td.num, th.num, td .badge { white-space: nowrap; }
td { overflow-wrap: anywhere; }
/* 6. Mobile PWA blocks */
.offer .who strong, .offer .who small { display: inline; }
.offer .price { flex: none; max-width: 48%; text-align: right; }
.offer .price b { display: block; }
.choice .p { flex: none; max-width: 45%; }
.tier-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 96px), 1fr)); }
.tier { padding: 8px 6px; min-width: 0; overflow: hidden; }
.otp { max-width: 100%; letter-spacing: .2em; }
.sheet { overflow-x: hidden; }
.place-input input { min-width: 0; }
.pwa-top { min-width: 0; }
.pwa-top .brand { min-width: 0; overflow: hidden; }
.pwa-top .brand > span:not(.mark) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .logo span:not(.mark) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-head { min-width: 0; }
.brand-head > span:not(.mark) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart .col small { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.phone-mock { max-width: min(330px, 100%); }
.hero, .section, .pub-nav { max-width: 100%; }
.req small { text-align: right; overflow-wrap: anywhere; }
/* auto-fit targets measure on one line */
.stat .v, .big-price, .offer .price b, .choice .p { white-space: nowrap; overflow: hidden; }
.choice .p br + small, .choice .p small { display: inline-block; }
.center-wrap > * { min-width: 0; width: 100%; }
.auth-card { margin: 0 auto; }
.install { overflow-wrap: anywhere; }
/* Responsive grid columns based on real room (sidebar included). Wide cards spanning 2 tracks
   fall back to a full row when there is a single column. */
.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1360px) { .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1180px) and (max-width: 1359px) { .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) and (min-width: 700px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .g3 > [style*="span 2"] { grid-column: 1 / -1 !important; } }
@media (max-width: 600px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } .grid > [style*="span"] { grid-column: auto !important; } }
@media (max-width: 420px) { .stat .ico { width: 36px; height: 36px; } .stat { gap: 10px; } }
/* Shell sidebar takes 252px: the content area is narrower than the viewport */
@media (min-width: 981px) and (max-width: 1100px) { .content .g2 { grid-template-columns: minmax(0, 1fr); } }
/* Driver tiers: amount and net each fit their own line */
.tier small { display: block; white-space: nowrap; max-width: 100%; overflow: hidden; }
.tier .amt { max-width: 100%; }
/* Chips wrap instead of being cut at the edge */
.chips { flex-wrap: wrap; overflow-x: visible; }
.chip { flex: 0 1 auto; max-width: 100%; white-space: normal; text-align: left; }
/* PWA header: brand name ellipsis, badges and controls never clipped */
.pwa-top .brand { overflow: visible; flex: 1 1 auto; }
.pwa-top .brand > span:not(.mark):not(.badge) { flex: 1 1 auto; min-width: 0; }
.pwa-top .brand .badge, .pwa-top .brand .mark { flex: none; }
.pwa-top .btn-row { flex: none; flex-wrap: nowrap; gap: 4px; }
.pwa-top .btn-sm { padding: 0 8px; }
.pwa-top .brand .badge { overflow: visible; text-overflow: clip; white-space: nowrap; }
.tier-amt, .tier-net { display: block; width: 100%; white-space: nowrap; overflow: hidden; text-align: center; }
.tier-amt { font-weight: 800; }
.tier-net { font-size: .74rem; font-weight: 600; color: var(--muted); }
.tier.on .tier-net { color: rgba(255,255,255,.88); }
.tier small { line-height: 1; }
.tier .amt { max-width: none; }
