/* AVERVIN styles (version 2.2)
   Colours come from the logo: the deep blue of the "A" and the orange of its speed lines.
   Warm paper background, so it feels like a ticket office rather than a bank.
   Every colour is a variable, so dark mode only has to change the variables. */

:root {
  /* brand */
  --brand: #1E4D78;          /* header, primary buttons */
  --brand-d: #163A5C;
  --brand-tx: #1E4D78;       /* brand colour used as text on cards */
  --brand-l: #E6EEF6;        /* soft blue wash */
  --sky: #3C81B4;            /* the lighter logo blue */
  --accent: #F08A30;         /* logo orange: the main "do it" buttons */
  --accent-d: #C96A17;
  --accent-ink: #2A1704;
  --accent-wash: #FFF3E6;

  /* surfaces */
  --paper: #F5F1EA;
  --card: #FFFFFF;
  --card-2: #FBF8F3;
  --ink: #1C2530;
  --muted: #67717D;
  --line: #E7E0D5;
  --field: #CFC7BA;
  --field-bg: #FFFFFF;
  --shade: rgba(16, 24, 34, .55);
  --shadow: 0 1px 0 rgba(70, 50, 20, .04), 0 8px 22px -16px rgba(20, 35, 55, .35);

  /* status */
  --ok: #1E8754;     --ok-bg: #E2F3E9;   --ok-tx: #126A40;
  --bad: #C2392C;    --bad-bg: #FBE5E1;  --bad-tx: #8E2117;
  --warn: #8A5300;   --warn-bg: #FFF0D4;
  --grey-bg: #ECE8E1; --grey-tx: #4F5967;

  /* money: the same three colours everywhere */
  --c-agent: #1E8754; --c-agent-bg: #E2F3E9;
  --c-av: #2A68AD;    --c-av-bg: #E4EDF8;
  --c-sacco: #C0550B; --c-sacco-bg: #FDECDD;

  /* seats */
  --seat-taken: #DCD6CC; --seat-taken-b: #C3BBAE; --seat-taken-tx: #8A8174;

  --r: 12px;
  --hh: 58px;
  --nav: 66px;
  color-scheme: light;
  font-family: "Archivo", "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
}

:root[data-theme="dark"] {
  --brand: #173A5C;
  --brand-d: #102C47;
  --brand-tx: #8CC0EC;
  --brand-l: #1A2E43;
  --sky: #5E9FD3;
  --accent: #F39A45;
  --accent-d: #B8661E;
  --accent-ink: #231202;
  --accent-wash: #33240F;

  --paper: #0B1219;
  --card: #15202B;
  --card-2: #1B2835;
  --ink: #F1F4F7;
  --muted: #B0BBC7;
  --line: #2E3D4D;
  --field: #4A5A6C;
  --field-bg: #111B25;
  --shade: rgba(0, 0, 0, .65);
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 24px -18px rgba(0, 0, 0, .8);

  --ok: #3FBF7F;     --ok-bg: #12301F;   --ok-tx: #7FDDAA;
  --bad: #FF7E70;    --bad-bg: #3A1B18;  --bad-tx: #FFB1A8;
  --warn: #F3B85A;   --warn-bg: #352812;
  --grey-bg: #222E3A; --grey-tx: #A9B4C0;

  --c-agent: #4CCB8D; --c-agent-bg: #12301F;
  --c-av: #74AEEB;    --c-av-bg: #172B41;
  --c-sacco: #F29550; --c-sacco-bg: #36230F;

  --seat-taken: #2A3846; --seat-taken-b: #3A4A5A; --seat-taken-tx: #7D8B99;
  color-scheme: dark;
}

:root[data-size="lg"] body { zoom: 1.12; }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.42; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

h1 { font-size: 28px; line-height: 1.05; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 19px; line-height: 1.15; font-weight: 800; }
h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.warnc { color: var(--warn); }
.big-num { font-size: 18px; }
a { color: var(--brand-tx); font-weight: 600; }

/* ---------- top bar and nav ---------- */
.top {
  position: sticky; top: 0; z-index: 30; height: calc(var(--hh) + env(safe-area-inset-top));
  background: var(--brand); color: #fff;
  display: flex; align-items: center; gap: 10px; padding: env(safe-area-inset-top) 14px 0;
  box-shadow: inset 0 -4px 0 var(--accent);
}
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 2px; background: var(--sky); opacity: .55; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; letter-spacing: .03em; }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.top .who-name { text-align: right; line-height: 1.15; min-width: 0; }
.top .who-name b { display: block; font-size: 17px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.top .who-name span { font-size: 13.5px; font-weight: 700; opacity: 1; color: var(--accent); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #1E4D78; font-weight: 800; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 2px var(--accent); }
.avatar.big { width: 52px; height: 52px; font-size: 19px; background: var(--brand-l); color: var(--brand-tx); }
.live { width: 9px; height: 9px; border-radius: 50%; background: #5BE49B; flex: none; box-shadow: 0 0 0 3px rgba(91,228,155,.18); }
.live.off { background: #FF8A80; box-shadow: 0 0 0 3px rgba(255,138,128,.18); }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line); display: flex;
}
.nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); position: relative; min-width: 0; }
.nav button svg { width: 23px; height: 23px; }
.nav button.on { color: var(--brand-tx); }
.nav button.on::before { content: ""; position: absolute; top: 0; left: 24%; right: 24%; height: 3px; background: var(--accent); border-radius: 0 0 3px 3px; }
.nav button.cta { color: var(--ink); }
.nav button.cta .plus { width: 46px; height: 46px; margin-top: -20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 3px 0 var(--accent-d), 0 0 0 4px var(--card); }
.nav button.cta .plus svg { width: 24px; height: 24px; }
.nav button.cta.on::before { display: none; }

main { padding: 16px 14px calc(var(--nav) + 28px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }
main.wide { max-width: 980px; }
.pagehead { margin: 4px 0 14px; }
.pagehead p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.pagehead p .badge { margin-left: 6px; vertical-align: 1px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--brand-tx); margin-bottom: 8px; padding: 6px 0; }
.back svg { width: 18px; height: 18px; }

@media (min-width: 760px) {
  .nav { position: sticky; top: var(--hh); bottom: auto; height: 52px; padding: 0 max(14px, calc((100vw - 980px) / 2)); border-top: 0; border-bottom: 1px solid var(--line); justify-content: flex-start; gap: 4px; }
  .nav button { flex: 0 0 auto; flex-direction: row; gap: 8px; padding: 0 18px; font-size: 14px; }
  .nav button.on::before { top: auto; bottom: 0; left: 8px; right: 8px; height: 3px; border-radius: 3px 3px 0 0; }
  .nav button.cta .plus { margin: 0; width: 32px; height: 32px; box-shadow: none; }
  .nav button.cta .plus svg { width: 18px; height: 18px; }
  main { padding-bottom: 40px; }
}

.banner { padding: 10px 14px; font-size: 13.5px; font-weight: 600; text-align: center; }
.banner.off { background: var(--bad-bg); color: var(--bad-tx); }
.banner.info { background: var(--warn-bg); color: var(--warn); }
.banner.rounded { border-radius: var(--r); margin-bottom: 14px; }

/* ---------- surfaces ---------- */
.panel, .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 14px; overflow: hidden; box-shadow: var(--shadow); }
.panel > .ph { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--card-2); }
.panel > .ph h3 { display: flex; align-items: center; }
.panel > .pb { padding: 14px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row.tap { cursor: pointer; width: 100%; text-align: left; }
.row.tap:active { background: var(--brand-l); }
.row .grow, .grow { flex: 1; min-width: 0; }
.row .ttl { font-weight: 700; }
.row .sub { font-size: 13px; color: var(--muted); margin-top: 1px; }
.row.faded { opacity: .6; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 3px; }
.tabnote { margin: -4px 2px 12px; }

/* the "Your sales" card on the agent's home */
.card { padding: 14px 14px 6px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card .figures.flat, .card .moneylines.flat { box-shadow: none; }
.card .linkbtn { display: block; margin: 2px 0 4px; }

.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 14px; overflow: hidden; }
.figures.f2 { grid-template-columns: repeat(2, 1fr); }
.fig { padding: 12px 12px 11px; background: var(--card); }
.fig b { display: block; font-size: 23px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fig span { font-size: 12.5px; color: var(--muted); }
.fig.hl { background: var(--warn-bg); }
.fig.hl b { color: var(--warn); }

.moneylines { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 14px; overflow: hidden; }
.ml { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 14px; border-top: 1px solid var(--line); gap: 10px; }
.ml:first-child { border-top: 0; }
.ml b { font-variant-numeric: tabular-nums; font-size: 17px; white-space: nowrap; }
.ml .num { white-space: nowrap; }

/* ---------- buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: var(--r); font-weight: 700; font-size: 15px; background: var(--brand); color: #fff; text-align: center; text-decoration: none; }
:root[data-theme="dark"] .btn:not(.accent):not(.ghost):not(.soft):not(.dghost):not(.ok):not(.danger) { background: #2B6296; }
.btn:active { transform: translateY(1px); filter: brightness(.95); }
.btn:disabled, .btn.dis { opacity: .45; pointer-events: none; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 54px; font-size: 17px; margin-bottom: 14px; }
.btn.accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 0 var(--accent-d); }
.btn.accent:active { box-shadow: 0 1px 0 var(--accent-d); transform: translateY(2px); }
.btn.ghost { background: var(--card); color: var(--brand-tx); border: 1.5px solid currentColor; }
.btn.soft { background: var(--brand-l); color: var(--brand-tx); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.dghost { background: var(--card); color: var(--bad); border: 1.5px solid var(--bad); }
.btn.ok { background: var(--ok); color: #fff; }
:root[data-theme="dark"] .btn.ok { color: #07210F; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.flip svg { transform: scaleX(-1); }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btns > .btn { flex: 1; }
.linkbtn { color: var(--brand-tx); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; }

.field { margin-bottom: 14px; }
.field > label, .lbl { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--field); border-radius: var(--r); background: var(--field-bg); font-size: 16px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sky) 25%, transparent); }
input.upper { text-transform: uppercase; }
.inl input { width: 90px; min-height: 34px; padding: 2px 8px; display: inline-block; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pwwrap { position: relative; }
.pwwrap button { position: absolute; right: 4px; top: 4px; height: 40px; padding: 0 12px; font-weight: 700; color: var(--brand-tx); font-size: 13px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.switch:first-child { border-top: 0; }
.switch input { width: 24px; height: 24px; accent-color: var(--brand); flex: none; }
.err { color: var(--bad); font-weight: 600; font-size: 14px; margin: 0 0 12px; }

/* an on/off switch that looks like one */
input.toggle { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--seat-taken-b); position: relative; flex: none; cursor: pointer; transition: background .15s; }
input.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
input.toggle:checked { background: var(--ok); }
input.toggle:checked::after { transform: translateX(20px); }
input.toggle:disabled { opacity: .5; }
.switchrow { cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 16px; border-radius: 20px; border: 1.5px solid var(--field); background: var(--card); font-weight: 700; font-size: 14px; color: var(--ink); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.faded { opacity: .5; text-decoration: line-through; }
.chip.add { border-style: dashed; color: var(--brand-tx); }
.seg { display: flex; border: 1.5px solid var(--brand-tx); border-radius: var(--r); overflow: hidden; }
.seg button { flex: 1; min-height: 44px; font-weight: 700; color: var(--brand-tx); background: var(--card); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 6px; font-size: 14px; }
.seg button svg { width: 17px; height: 17px; }
.seg button.on { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .seg button.on { background: #2B6296; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok-tx); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad-tx); }
.badge.grey { background: var(--grey-bg); color: var(--grey-tx); }
.badge.navy { background: var(--brand-l); color: var(--brand-tx); }

/* ---------- tabs: one list at a time ---------- */
.tabs { display: flex; gap: 2px; overflow-x: auto; margin: 4px 0 12px; border-bottom: 2px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; padding: 11px 7px 10px; font-weight: 700; color: var(--muted); white-space: nowrap; border-bottom: 4px solid transparent; margin-bottom: -2px; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 8px 8px 0 0; }
.tabs button.on { color: var(--brand-tx); border-bottom-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.tabs.more, .pills.more { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
.tabs .tc { min-width: 20px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--grey-bg); color: var(--grey-tx); font-size: 11.5px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.tabs button.on .tc { background: var(--accent); color: var(--accent-ink); }

/* segmented period tabs inside a card (Today / Yesterday / 7 days / This month) */
.tabs.seg-tabs { border: 0; background: var(--card-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 3px; margin: 0 0 12px; }
.tabs.seg-tabs button { border: 0; margin: 0; border-radius: 8px; padding: 9px 6px; font-size: 13.5px; flex: 1 1 0; }
.tabs.seg-tabs button.on { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .tabs.seg-tabs button.on { background: #2B6296; }

/* period pills that scroll sideways (Reports, Money) */
.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 1px 1px 3px; }
.pills::-webkit-scrollbar { display: none; }
.pills button { flex: none; min-height: 38px; padding: 0 14px; border-radius: 19px; border: 1.5px solid var(--field); background: var(--card); font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.pills button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme="dark"] .pills button.on { background: #2B6296; border-color: #2B6296; }

/* ---------- vehicles ---------- */
.veh { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); background: transparent; color: inherit; }
.veh:first-child { border-top: 0; }
.veh .time { width: 58px; flex: none; line-height: 1; }
.veh .time b { display: block; font-weight: 800; font-size: 22px; letter-spacing: -.01em; }
.veh .time small { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-top: 3px; }
.veh .mid { flex: 1; min-width: 0; }
.veh .reg { font-weight: 800; letter-spacing: .03em; }
.veh .meta { font-size: 13px; color: var(--muted); }
.veh .cnt { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.veh .cnt b { display: block; font-size: 20px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.veh .cnt small { display: block; font-size: 11.5px; color: var(--muted); }
.veh.sel { background: var(--accent-wash); box-shadow: inset 5px 0 0 var(--accent); }
.veh.off { opacity: .55; }
.bar { height: 6px; border-radius: 3px; background: var(--grey-bg); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--sky); border-radius: 3px; }
.bar i.full { background: var(--bad); }
.vact { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 14px 12px; }
.vact .btn svg { width: 16px; height: 16px; }
.vgroup { padding: 8px 14px; background: var(--brand-l); color: var(--brand-tx); font-weight: 800; font-size: 13.5px; display: flex; align-items: center; }
.stn { color: var(--brand-tx); font-weight: 700; }

/* boarding now: green, alive */
.sech { margin: 20px 0 8px; display: flex; align-items: center; gap: 6px; }
.sech svg { width: 19px; height: 19px; color: var(--brand-tx); }
.pulse { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); margin-right: 8px; animation: pulse 1.8s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(30,135,84,.55); } 70% { box-shadow: 0 0 0 8px rgba(30,135,84,0); } 100% { box-shadow: 0 0 0 0 rgba(30,135,84,0); } }
.boardpanel { border: 2px solid var(--ok); }
.boardpanel .veh { background: color-mix(in srgb, var(--ok) 5%, var(--card)); }
.boardpanel .veh.sel { background: var(--accent-wash); }

/* vehicles that have left: greyed, blurred, stamped LEFT. The buttons stay sharp. */
.leftcard { position: relative; overflow: hidden; background: var(--card-2); }
.panel.leftcard { background: var(--card-2); }
.dimmed { opacity: .42; filter: grayscale(.6); }
.leftcard .wm { position: absolute; right: 16px; top: 18px; font-weight: 800; font-size: 24px; letter-spacing: .08em; color: color-mix(in srgb, var(--brand-tx) 45%, transparent); border: 3px solid color-mix(in srgb, var(--brand-tx) 45%, transparent); border-radius: 8px; padding: 1px 12px; pointer-events: none; z-index: 2; white-space: nowrap; }
.leftcard .vact { position: relative; z-index: 3; }

/* ---------- seat map ---------- */
.van { width: 100%; max-width: 300px; margin: 6px auto 4px; background: var(--card); border: 3px solid var(--brand-tx); border-radius: 34px 34px 16px 16px; padding: 22px 16px 16px; position: relative; }
.van::before { content: ""; position: absolute; top: 9px; left: 28px; right: 28px; height: 5px; border-radius: 3px; background: var(--accent); }
.vangrid { display: grid; grid-template-columns: 1fr 1fr 14px 1fr 1fr; gap: 9px; }
.seat { aspect-ratio: 1 / 1; min-height: 46px; border-radius: 9px; border: 2.5px solid var(--brand-tx); background: var(--card); color: var(--brand-tx); font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; display: grid; place-items: center; position: relative; }
.seat:active { transform: scale(.96); }
.seat.sel { background: var(--accent); border-color: var(--accent-d); color: var(--accent-ink); }
.seat.taken { background: var(--seat-taken); border-color: var(--seat-taken-b); color: var(--seat-taken-tx); pointer-events: none; }
.seat.mine { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme="dark"] .seat.mine { background: #2B6296; border-color: #2B6296; }
.seat.static { pointer-events: none; }
.seat.drv { border-style: dashed; border-color: var(--field); background: var(--card-2); color: var(--muted); pointer-events: none; font-size: 11px; font-weight: 700; }
.seat.gap { visibility: hidden; pointer-events: none; }
.legend { display: flex; gap: 14px; justify-content: center; font-size: 12.5px; color: var(--muted); margin: 8px 0 2px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 13px; height: 13px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; border: 2px solid var(--brand-tx); background: var(--card); }
.legend i.t { background: var(--seat-taken); border-color: var(--seat-taken-b); }
.legend i.s { background: var(--accent); border-color: var(--accent-d); }
.legend i.b { background: var(--brand); border-color: var(--brand); }

/* ---------- tickets ---------- */
.ticket { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; position: relative; box-shadow: var(--shadow); }
.ticket::before { content: ""; display: block; height: 10px; background: repeating-linear-gradient(135deg, var(--accent) 0 14px, var(--sky) 14px 28px); }
.ticket::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: radial-gradient(circle at 6px 8px, var(--paper) 5px, transparent 5.5px) 0 0 / 12px 8px repeat-x; }
.ticket pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14.5px; line-height: 1.55; padding: 16px 16px 22px; white-space: pre-wrap; word-break: break-word; }
.ticket.void pre { color: var(--muted); text-decoration: line-through; }
.stamp { position: absolute; top: 34px; right: 14px; border: 3px solid var(--bad); color: var(--bad); font-weight: 800; letter-spacing: .08em; padding: 2px 10px; border-radius: 6px; font-size: 18px; background: color-mix(in srgb, var(--card) 85%, transparent); }
.success { display: flex; gap: 12px; align-items: center; background: var(--ok-bg); color: var(--ok-tx); border-radius: var(--r); padding: 12px 14px; font-weight: 700; margin-bottom: 14px; }
.success svg { width: 26px; height: 26px; flex: none; }

/* ---------- sheet and toast ---------- */
.shade { position: fixed; inset: 0; z-index: 60; background: var(--shade); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 560px; border-radius: 20px 20px 0 0; max-height: 92vh; overflow-y: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .18s ease-out; border-top: 4px solid var(--accent); }
.sheet h2 { margin-bottom: 4px; }
.sheet .lead { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
@keyframes up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 760px) { .shade { align-items: center; } .sheet { border-radius: 16px; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 24px; font-weight: 600; font-size: 14px; z-index: 80; max-width: 92vw; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
.toast.bad { background: var(--bad); color: #fff; }
@media (min-width: 760px) { .toast { bottom: 28px; } }

/* ---------- tables, lists ---------- */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 12px; text-align: left; border-top: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12.5px; color: var(--muted); font-weight: 700; background: var(--card-2); border-top: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.tot td { font-weight: 800; background: var(--card-2); }
.dtable { border: 1px solid var(--line); border-radius: var(--r); max-height: 40vh; overflow: auto; }
.dtable table { font-size: 12.5px; }
.dtable th, .dtable td { padding: 7px 6px; }
.dtable td:nth-child(2) { white-space: normal; min-width: 70px; }
.dtable th { position: sticky; top: 0; }
.dtable td:first-child, .dtable th:first-child { color: var(--muted); }
.trend { padding: 10px 14px; font-size: 13.5px; font-weight: 600; border-top: 1px solid var(--line); }
.trend.up { background: var(--ok-bg); color: var(--ok-tx); }
.trend.down { background: var(--bad-bg); color: var(--bad-tx); }
details.sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; overflow: hidden; }
details.sec > summary { list-style: none; padding: 14px; font-weight: 800; font-size: 16px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::after { content: "+"; font-size: 22px; color: var(--brand-tx); font-weight: 600; }
details.sec[open] > summary::after { content: "–"; }
details.sec > .body { border-top: 1px solid var(--line); }
.pin { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 34px; font-weight: 800; letter-spacing: .25em; text-align: center; background: var(--warn-bg); color: var(--ink); border-radius: var(--r); padding: 12px 0 12px .25em; margin: 10px 0; }
.spinner { width: 28px; height: 28px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
.spinner.onbrand { border-color: rgba(255,255,255,.25); border-top-color: var(--accent); margin: auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- small pieces ---------- */
.steps { display: flex; gap: 6px; margin: 2px 0 12px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--grey-bg); }
.steps i.on { background: var(--accent); }
.seatno { min-width: 44px; height: 44px; padding: 0 8px; border-radius: 10px; background: var(--brand-l); color: var(--brand-tx); font-weight: 800; font-size: 16px; display: grid; place-items: center; flex: none; text-align: center; line-height: 1.1; font-variant-numeric: tabular-nums; }
.datebar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.datepick { flex: 1; position: relative; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; line-height: 1.2; cursor: pointer; }
.datepick b { display: block; font-size: 17px; }
.datepick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-height: 0; cursor: pointer; }
.bandrow { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.bandrow span { width: 62px; font-size: 13px; font-weight: 700; flex: none; }
.bandrow input { flex: 1; min-width: 0; }
.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tri .btn { flex-direction: column; gap: 4px; min-height: 62px; padding: 0 6px; font-size: 14px; }
.tri .btn svg { width: 22px; height: 22px; }
.npass { color: var(--brand-tx); font-weight: 700; }
.note-av { background: var(--c-av-bg); color: var(--ink); border-left: 4px solid var(--c-av); border-radius: 8px; padding: 9px 12px; font-size: 13.5px; }
.explain { background: var(--card); border: 1px dashed var(--field); border-radius: var(--r); padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.explain p + p { margin-top: 6px; }
.acct { display: flex; align-items: center; gap: 14px; padding: 14px; }
.acct b { font-size: 17px; }
.btns.support .btn { flex: 1 1 30%; }

/* ---------- money colours ---------- */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: currentColor; margin-right: 7px; }
.k-agent { color: var(--c-agent); } .k-av { color: var(--c-av); } .k-sacco { color: var(--c-sacco); }
.ml.k-agent, .ml.k-av, .ml.k-sacco { color: var(--ink); }
.ml.k-agent { border-left: 5px solid var(--c-agent); background: var(--c-agent-bg); }
.ml.k-av    { border-left: 5px solid var(--c-av);    background: var(--c-av-bg); }
.ml.k-sacco { border-left: 5px solid var(--c-sacco); background: var(--c-sacco-bg); }
.ml.k-agent b, .ml.k-agent .dot { color: var(--c-agent); }
.ml.k-av b, .ml.k-av .dot { color: var(--c-av); }
.ml.k-sacco b, .ml.k-sacco .dot { color: var(--c-sacco); }
.fig.k-agent { box-shadow: inset 0 4px 0 var(--c-agent); } .fig.k-av { box-shadow: inset 0 4px 0 var(--c-av); } .fig.k-sacco { box-shadow: inset 0 4px 0 var(--c-sacco); }
.fig.k-agent span, .fig.k-av span, .fig.k-sacco span { color: var(--muted); }
th.k-agent { color: var(--c-agent); } th.k-av { color: var(--c-av); } th.k-sacco { color: var(--c-sacco); }
td.k-sacco { color: var(--c-sacco); font-weight: 700; } td.k-av { color: var(--c-av); font-weight: 700; }
.kline { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 700; }
.legend2 { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; font-weight: 700; margin: 0 0 12px; }
.ml.exline { flex-direction: column; align-items: flex-start; gap: 4px; }

/* ---------- what the agent owes AVERVIN ---------- */
.balance { border-radius: var(--r); margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-left: 6px solid var(--c-av); background: var(--c-av-bg); }
.balance.clear { border-left-color: var(--ok); background: var(--ok-bg); }
.balance .bl { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.balance .bl span { font-weight: 800; font-size: 16px; }
.balance .bl b { font-size: 28px; font-weight: 800; color: var(--c-av); font-variant-numeric: tabular-nums; white-space: nowrap; }
.balance.clear .bl b { color: var(--ok); }
.balance .bs { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.afterbox { background: var(--ok-bg); color: var(--ok-tx); border-radius: var(--r); padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
.afterbox.bad { background: var(--bad-bg); color: var(--bad-tx); }
.listpre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; max-height: 36vh; overflow: auto; white-space: pre; margin-bottom: 14px; }

/* ---------- sign in ---------- */
.auth { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  background: radial-gradient(120% 70% at 85% 0%, #2C6A9E 0%, transparent 60%), linear-gradient(180deg, #1E4D78 0%, #163A5C 100%); }
.auth .hero { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 36px 26px 28px; color: #fff; }
.auth .hero .logocard { background: #fff; border-radius: 22px; padding: 14px 18px 12px; width: min(70vw, 270px); box-shadow: 0 14px 34px rgba(0,0,0,.3); }
.logocard img { width: 100%; height: auto; display: block; }
.auth .slogan { margin-top: 22px; padding-top: 16px; border-top: 4px solid var(--accent); font-size: 18px; line-height: 1.35; font-weight: 600; max-width: 310px; }
.auth .box { background: var(--card); width: 100%; max-width: 460px; margin: 0 auto; border-radius: 22px 22px 0 0; border-top: 6px solid var(--accent); padding: 22px 20px 6px; }
.auth .box h2 { font-size: 22px; margin-bottom: 14px; }
.auth .foot { background: var(--card); width: 100%; max-width: 460px; margin: 0 auto; text-align: center; color: var(--muted); font-size: 12px; padding: 10px 20px calc(16px + env(safe-area-inset-bottom)); }

/* ---------- logo in the header ---------- */
.brand .mark { width: 46px; height: 36px; background: #fff; border-radius: 9px; display: grid; place-items: center; padding: 3px; flex: none; }
.brand .mark img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- printing the passenger manifest ---------- */
#printArea { display: none; }
@media print {
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; }
  body { background: #fff; color: #000; font-size: 12pt; zoom: 1 !important; }
  .pm h1 { font-size: 18pt; margin-bottom: 4px; }
  .pm h2 { font-size: 13pt; margin: 16px 0 6px; }
  .pm p { margin-bottom: 6px; }
  .pm table { margin-bottom: 10px; page-break-inside: avoid; }
  .pm th, .pm td { border: 1px solid #888; padding: 5px 8px; white-space: normal; font-size: 11pt; color: #000; }
  .pm th { background: #eee; color: #000; }
  .pmfoot { margin-top: 18px; font-size: 10pt; color: #444; }
}

@media (max-width: 430px) {
  .tabs { gap: 0; }
  .tabs button { padding: 11px 5px 10px; font-size: 13.5px; gap: 4px; }
}
@media (max-width: 380px) {
  .fig { padding: 10px 8px 9px; }
  .fig b { font-size: 19px; }
  .fig span { font-size: 12px; }
  .balance .bl b { font-size: 24px; }
  .tabs button { padding: 10px 5px; font-size: 13px; }
  .nav button { font-size: 10.5px; }
}

/* ---------- driver run sheet: numbered stops on a route line (like ride-hailing trip timelines) ---------- */
.runsheet { position: relative; padding: 4px 0; max-height: 52vh; overflow-y: auto; }
.rs-stop { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.rs-stop:not(.end)::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 3px; border-radius: 2px; background: var(--line); }
.rs-dot { flex: none; width: 33px; height: 33px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; background: var(--brand-l); color: var(--brand-tx); border: 2px solid var(--brand-tx); position: relative; z-index: 1; }
.rs-stop.walk .rs-dot { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-d); }
.rs-stop.end .rs-dot { background: var(--ok); color: var(--card); border-color: var(--ok); }
.rs-stop.end .rs-name { padding-top: 5px; color: var(--ok-tx); }
.rs-body { flex: 1; min-width: 0; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.rs-stop.end .rs-body { background: none; border: 0; padding: 0; }
.rs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rs-name { font-weight: 800; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-pick { flex: none; font-weight: 800; font-size: 14px; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.rs-bar { height: 6px; border-radius: 3px; background: var(--grey-bg); margin: 9px 0 4px; overflow: hidden; }
.rs-bar span { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.rs-count { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rs-pax { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; }
.rs-pn { font-weight: 700; }
.rs-meta { font-size: 13px; color: var(--muted); margin-top: 2px; word-break: break-word; }

/* 2.4.2: everything straight - no tilt anywhere */
.logocard, .logocard img, .leftcard .wm, .brand, .mark img { transform: none !important; }

.toplogout{margin-left:8px;padding:6px 10px;font-size:.8rem;white-space:nowrap;color:inherit;border:1px solid currentColor;opacity:.9}

/* =====================================================================
   2.7.0: self-booked seats, adverts on tickets, terms, live map, trip summary
   ===================================================================== */
:root { --self: #0F8F86; --self-bg: #DDF4F1; --self-tx: #0B6B64; --walk: #A8701A; --walk-bg: #FBEFD9; --walk-tx: #7A4F0E; }
:root[data-theme="dark"] { --self: #2EC4B6; --self-bg: #123632; --self-tx: #7FE3D9; --walk: #E0A447; --walk-bg: #3A2A12; --walk-tx: #F3C98A; }
.figures.f4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 520px) { .figures.f4 { grid-template-columns: repeat(2, 1fr); } }
.k-self { color: var(--self-tx); }
.badge.self { background: var(--self-bg); color: var(--self-tx); }
.badge.walk { background: var(--walk-bg); color: var(--walk-tx); }
.seat.selfb { background: var(--self); border-color: var(--self); color: #fff; }
.seat.walk { background: var(--walk); border-color: var(--walk); color: #fff; }
.seat.taken.selftaken { background: var(--self-bg); border-color: var(--self); color: var(--self-tx); }
.legend i.st { background: var(--self-bg); border-color: var(--self); }
.legend i.sb { background: var(--self); border-color: var(--self); }
.legend i.w { background: var(--walk); border-color: var(--walk); }
.drvline { padding: 0 14px 10px; color: var(--muted); }
.drvline .pinv { letter-spacing: .12em; color: var(--ink); }
.drvline .linkbtn { margin-left: 6px; }

/* advertisement under the ticket details */
.adbox { border-top: 2px dashed var(--line); padding: 12px 16px 16px; background: var(--card-2); }
.adhead { font-size: 10.5px; letter-spacing: .16em; font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.adimg { display: block; max-width: 100%; max-height: 180px; object-fit: contain; border-radius: 8px; margin: 0 auto 8px; }
.adco { font-weight: 800; }
.admsg { font-size: 14.5px; margin-top: 2px; }
.adcon { font-size: 13px; color: var(--muted); margin-top: 4px; word-break: break-word; }
.adprev img { max-width: 100%; max-height: 160px; margin-top: 8px; border-radius: 8px; border: 1px solid var(--line); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.check { display: flex; gap: 7px; align-items: center; font-size: 14px; min-height: 32px; }
.check input { width: 18px; height: 18px; }

/* terms and conditions */
.termsbox .terms { font-size: 13px; color: var(--ink); margin: 8px 0 4px; }
.termsbox .terms ol, .terms ol { padding-left: 20px; margin-top: 6px; }
.terms li { margin-bottom: 5px; }
.termsd { margin-bottom: 12px; }
.termsd summary { cursor: pointer; font-weight: 700; color: var(--brand-tx); font-size: 14px; padding: 4px 0; }

/* live tracking map */
.livepanel { overflow: hidden; }
.mapslot, .mapbox { height: 52vh; min-height: 280px; max-height: 560px; background: var(--card-2); border-bottom: 1px solid var(--line); }
.mapbox.nomap { height: auto; min-height: 0; }
.liverow-sum { padding: 10px 14px 4px; }
.ldot { flex: none; width: 13px; height: 13px; border-radius: 50%; margin-top: 4px; background: var(--seat-taken-b); }
.ldot.moving { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.ldot.stopped { background: var(--accent); }
.ldot.stale { background: var(--bad); }
.ldot.ended { background: var(--grey-tx); }
.lstate.moving { color: var(--ok-tx); } .lstate.stopped { color: var(--warn); } .lstate.stale { color: var(--bad-tx); } .lstate.ended, .lstate.idle { color: var(--muted); }
.vmark span { display: inline-block; transform: translate(-50%, -50%); background: var(--brand); color: #fff; padding: 3px 9px; border-radius: 12px; font: 800 12px/1.3 "Archivo", system-ui, sans-serif; white-space: nowrap; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.vmark.moving span { background: #1E8754; }
.vmark.stopped span { background: #F08A30; color: #2A1704; }
.vmark.stale span { background: #8A8174; }

@media print {
  .pt { max-width: 440px; margin: 0 auto; border: 1px solid #999; border-radius: 8px; padding: 14px; }
  .pt-head { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid #999; padding-bottom: 8px; margin-bottom: 8px; font-size: 11pt; }
  .pt-head img, .ts-head img { height: 52px; width: auto; }
  .pt pre { white-space: pre-wrap; font: 10.5pt/1.45 ui-monospace, Menlo, Consolas, monospace; margin: 0 0 8px; }
  .adbox { border-top: 1.5px dashed #888; padding: 8px 6px 6px; }
  .adimg { max-height: 140px; }
  .pt-terms { font-size: 8.5pt; color: #444; margin-top: 10px; }
  .ts-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
  .ts-head h1 { margin: 0; }
  .ts table, .adreport table { page-break-inside: auto; width: 100%; border-collapse: collapse; }
  .pm td.tix { font-size: 9pt; word-break: break-word; }
  .pm .kv th { width: 170px; text-align: left; }
  .pmdrv { border: 1px solid #888; padding: 5px 8px; display: inline-block; }
  .sigblock { display: flex; gap: 28px; margin-top: 30px; page-break-inside: avoid; align-items: stretch; }
  .sigl { flex: 1; }
  .sigl p { margin: 0 0 26px !important; }
  .stampbox { width: 180px; min-height: 140px; border: 2px dashed #666; border-radius: 8px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; font-size: 10pt; color: #444; }
}
/* Small phones: the greeting gives way so the Sign out button always fits */
@media (max-width: 380px) { .who-name { display: none; } .toplogout { margin-left: 6px; padding: 6px 8px; } .top .brand { font-size: 16px; gap: 7px; } .top .who { gap: 8px; } }

/* 2.8.0 */
.pinmask { -webkit-text-security: disc; text-security: disc; }
/* seat layouts copied from the real 14- and 18-seater photos */
.van.real { max-width: 340px; padding: 22px 14px 14px; }
.vangrid24 { display: grid; grid-template-columns: repeat(24, 1fr); gap: 10px 3px; }
.vangrid24 .seat { aspect-ratio: auto; height: 58px; min-height: 0; width: 100%; border-radius: 10px 10px 6px 6px; border-bottom-width: 5px; font-size: 18px; }
.vangrid24 .seat.drv { font-size: 12px; }
.destrow { display: grid; grid-template-columns: 1fr 96px auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.destrow input { min-width: 0; }
textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line, #cfd8e0); border-radius: 10px; background: var(--card, #fff); color: inherit; }

.vanpic { position: relative; width: 100%; max-width: 340px; margin: 8px auto; border-radius: 14px; overflow: hidden; background: #e9ecee; line-height: 0; }
.vanpic img { width: 100%; height: auto; display: block; user-select: none; -webkit-user-drag: none; }
.vanpic .seat { position: absolute; transform: translate(-50%, -50%); aspect-ratio: auto; min-height: 0; padding: 0; border-radius: 12px; font-size: 20px; line-height: 1; border: 3px solid rgba(60, 230, 140, .95); background: rgba(60, 230, 140, .10); color: transparent; box-shadow: none; }
.vanpic .seat.sel { background: rgba(255, 170, 0, .82); border-color: #fff; color: #fff; }
.vanpic .seat.taken { background: rgba(200, 30, 30, .78); border-color: rgba(255,255,255,.7); color: #fff; }
.vanpic .seat.taken.selftaken, .vanpic .seat.selfb { background: rgba(30, 90, 200, .8); color: #fff; }
.vanpic .seat.mine { background: rgba(200, 30, 30, .78); color: #fff; }
.vanpic .seat.walk { background: rgba(120, 60, 180, .8); color: #fff; }
.vanpic .seat.static:not(.mine):not(.selfb):not(.walk) { color: transparent; }
.warn-note { background: #fff4d6; border: 1px solid #f0c040; color: #6b4a00; padding: 8px 10px; border-radius: 10px; font-size: 14px; line-height: 1.35; margin: 6px 0 10px; }
.cancel-box { border: 1px solid #e0a4a4; }
.chip-status { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #e8eef5; color: #234; margin-top: 3px; }
.chip-status.review { background: #fff1c9; color: #6b4a00; } .chip-status.left { background: #ffe0d6; color: #8a2a00; } .chip-status.ok { background: #d9f3e3; color: #0b5a2a; } .chip-status.bad { background: #f6dede; color: #8a1a1a; }

/* 2.9.1: one colour set for seats and for the key under them */
:root { --k-free: #3ce68c; --k-pick: #ffaa00; --k-taken: #c81e1e; --k-self: #1e5ac8; --k-walk: #783cb4; }
.legend i { width: 16px; height: 16px; border-radius: 5px; border: 3px solid var(--k-free); background: rgba(60, 230, 140, .18); }
.legend i.s { background: var(--k-pick); border-color: var(--k-pick); }
.legend i.t { background: var(--k-taken); border-color: var(--k-taken); }
.legend i.st, .legend i.sb { background: var(--k-self); border-color: var(--k-self); }
.legend i.b { background: var(--k-taken); border-color: var(--k-taken); }
.legend i.w { background: var(--k-walk); border-color: var(--k-walk); }
.van .seat:not(.drv):not(.taken):not(.sel):not(.mine):not(.selfb):not(.walk) { border-color: var(--k-free); background: rgba(60, 230, 140, .18); }
.van .seat.sel { background: var(--k-pick); border-color: var(--k-pick); color: #fff; }
.van .seat.taken, .van .seat.mine { background: var(--k-taken); border-color: var(--k-taken); color: #fff; }
.van .seat.taken.selftaken, .van .seat.selfb { background: var(--k-self); border-color: var(--k-self); color: #fff; }
.van .seat.walk { background: var(--k-walk); border-color: var(--k-walk); color: #fff; }
.vanpic .seat.sel { background: rgba(255, 170, 0, .88); border-color: var(--k-pick); }
.vanpic .seat.taken, .vanpic .seat.mine { background: rgba(200, 30, 30, .85); border-color: var(--k-taken); }
.vanpic .seat.taken.selftaken, .vanpic .seat.selfb { background: rgba(30, 90, 200, .85); border-color: var(--k-self); }
.vanpic .seat.walk { background: rgba(120, 60, 180, .85); border-color: var(--k-walk); }
.vanpic .seat:not(.taken):not(.sel):not(.mine):not(.selfb):not(.walk) { border-color: var(--k-free); background: rgba(60, 230, 140, .14); }

/* 2.9.4: advertisements side by side in sections on a ticket; the advert progress report fits one page */
.adgrid { display: grid; gap: 0; margin-top: 10px; border: 2px solid var(--line, #cfd8e0); border-radius: 10px; overflow: hidden; }
.adgrid .adsection + .adsection { border-top: 3px dashed var(--line, #9aa5ae); }
.adgrid .adbox { margin: 0; border: 0; border-radius: 0; }
@media (min-width: 560px) { .adgrid.n2 { grid-template-columns: 1fr 1fr; } .adgrid.n2 .adsection + .adsection { border-top: 0; border-left: 3px dashed var(--line, #9aa5ae); } }
@media print {
  @page { size: A4; margin: 10mm; }
  .adreport { font-size: 11px; line-height: 1.3; }
  .adreport h1 { font-size: 18px; margin: 0; } .adreport h2 { font-size: 13px; margin: 8px 0 3px; }
  .adreport .ts-head img { height: 40px; }
  .adreport table th, .adreport table td { padding: 2px 6px; }
  .adreport .adimg { max-height: 90px; width: auto; max-width: 100%; }
  .adreport p { margin: 3px 0; }
  .adreport .sigblock { page-break-inside: avoid; break-inside: avoid; margin-top: 10px; }
  .adreport .stampbox { height: 70px; min-height: 0; width: 130px; }
  .adreport .pmfoot { margin-top: 6px; }
  .pt .adgrid { grid-template-columns: 1fr 1fr; } .pt .adgrid.n3, .pt .adgrid.n4 { grid-template-columns: 1fr; }
}

/* 2.9.6: tickets print in full colour, exactly as on screen, with every advertisement */
@media print {
  *, *::before, *::after { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  html, body, .pt { background: #fff !important; }
  .pt { border: 2px solid var(--accent, #1e4d78); }
  .pt-head { border-bottom: 2px solid var(--accent, #1e4d78); }
  .pt .adbox, .pt .adsection { background: #fff !important; color: #000; }
  .pt .adimg { max-height: 160px; max-width: 100%; width: auto; object-fit: contain; image-rendering: auto; }
  .pt .adgrid { border: 1.5px solid #888; break-inside: avoid; }
  .pt .adsection { break-inside: avoid; }
}


/* 2.9.8: a printed ticket stays small: details on top, adverts side by side in two columns, one page */
@media print {
  .pt { max-width: 560px; padding: 10px 12px; break-inside: avoid; page-break-inside: avoid; }
  .pt-head { padding-bottom: 6px; margin-bottom: 6px; }
  .pt-head img { height: 40px; }
  .pt pre { font-size: 9.5pt; line-height: 1.3; margin: 0 0 6px; }
  .pt .adgrid, .pt .adgrid.n2, .pt .adgrid.n3, .pt .adgrid.n4 { grid-template-columns: 1fr 1fr !important; gap: 0; border: 1.5px solid #888; margin-top: 6px; }
  .pt .adgrid .adsection { border: 0 !important; min-width: 0; }
  .pt .adgrid .adsection:nth-child(even) { border-left: 2px dashed #888 !important; }
  .pt .adgrid .adsection:nth-child(n+3) { border-top: 2px dashed #888 !important; }
  .pt .adbox { padding: 6px 7px; border-top: 1.5px dashed #888; }
  .pt .adgrid .adbox { border-top: 0; }
  .pt .adhead { font-size: 6.5pt; letter-spacing: .1em; margin-bottom: 4px; }
  .pt .adimg { display: block; margin: 0 auto 4px; max-height: 64px; max-width: 100%; width: auto; height: auto; object-fit: contain; }
  .pt > .adbox .adimg { max-height: 90px; }
  .pt .adco { font-size: 8.5pt; line-height: 1.2; margin-top: 2px; }
  .pt .admsg { font-size: 7.5pt; line-height: 1.25; margin-top: 2px; overflow-wrap: anywhere; }
  .pt .adcon { font-size: 7.5pt; margin-top: 3px; overflow-wrap: anywhere; }
  .pt-terms { font-size: 7pt; margin-top: 6px; }
}

/* 3.0.1: small polish that cannot change the layout */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
button, .btn, a, input, select, textarea, label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(232, 131, 42, .75); outline-offset: 2px; }
button:disabled, .btn:disabled { cursor: not-allowed; }
.perm-panel .row { align-items: center; }
.perm-panel [hidden] { display: none !important; }
.perm-state { font-weight: 700; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* 3.0.2: the passenger manifest always prints on one page */
@media print {
  .pm.man { break-inside: avoid; page-break-inside: avoid; }
  .pm.man h1 { font-size: 15pt; margin: 0 0 4px; }
  .pm.man p { font-size: var(--pmf, 10pt); margin: 2px 0 6px; line-height: 1.25; }
  .pm.man table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 0; page-break-inside: auto; }
  .pm.man th, .pm.man td { font-size: var(--pmf, 10pt); padding: 2px 4px; line-height: 1.2; overflow-wrap: anywhere; vertical-align: top; }
  .pm.man tr { break-inside: avoid; page-break-inside: avoid; }
  .pm.man .stn td { background: #dfe7ef; font-weight: 700; }
  .pm.man .by { font-size: .85em; color: #333; }
  .pm.man .c1 { width: 5%; } .pm.man .c2 { width: 33%; } .pm.man .c3 { width: 15%; } .pm.man .c4 { width: 14%; } .pm.man .c5 { width: 7%; } .pm.man .c6 { width: 17%; } .pm.man .c7 { width: 9%; }
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 3.1.0: language chooser */
.langgate { position: fixed; inset: 0; z-index: 99999; background: rgba(16, 38, 58, .96); display: grid; place-items: center; padding: 20px; }
.langbox { background: #fff; color: #10263a; border-radius: 18px; padding: 24px 20px; width: 100%; max-width: 380px; text-align: center; display: grid; gap: 12px; }
.langbox img { height: 56px; margin: 0 auto; }
.langbox h1 { font-size: 22px; margin: 0; } .langbox h1 span { font-size: 18px; color: #e8832a; }
.langbox p { font-size: 13px; color: #55606b; margin: 4px 0 0; }
.langbtns { display: flex; gap: 8px; }

/* 3.1.1: SACCO report graph and comparison print cleanly */
@media print { .pm.ts .sr-last { break-inside: avoid; page-break-inside: avoid; } .pm.ts svg { max-width: 100%; height: auto; } }

/* 3.3.0: seat colours are the same in light and dark mode and always match the key */
:root[data-theme="dark"] .seat.mine, :root[data-theme="dark"] .van .seat.mine { background: var(--k-taken) !important; border-color: var(--k-taken) !important; color: #fff !important; }
:root[data-theme="dark"] .seat.selfb, :root[data-theme="dark"] .van .seat.selfb, :root[data-theme="dark"] .van .seat.taken.selftaken { background: var(--k-self) !important; border-color: var(--k-self) !important; color: #fff !important; }
:root[data-theme="dark"] .seat.walk, :root[data-theme="dark"] .van .seat.walk { background: var(--k-walk) !important; border-color: var(--k-walk) !important; color: #fff !important; }
:root[data-theme="dark"] .van .seat.taken:not(.selftaken) { background: var(--k-taken) !important; border-color: var(--k-taken) !important; color: #fff !important; }
:root[data-theme="dark"] .van .seat.sel { background: var(--k-pick) !important; border-color: var(--k-pick) !important; color: #fff !important; }
.vanpic .seat.mine, .vanpic .seat.taken:not(.selftaken) { background: rgba(200, 30, 30, .85) !important; border-color: var(--k-taken) !important; color: #fff !important; }
.vanpic .seat.selfb, .vanpic .seat.taken.selftaken { background: rgba(30, 90, 200, .85) !important; border-color: var(--k-self) !important; color: #fff !important; }
.vanpic .seat.walk { background: rgba(120, 60, 180, .85) !important; border-color: var(--k-walk) !important; color: #fff !important; }
.vanpic .seat.sel { background: rgba(255, 170, 0, .88) !important; border-color: var(--k-pick) !important; color: #fff !important; }
/* the vehicle trip summary table is compact so more trips fit */
.tablewrap table.tight td, .tablewrap table.tight th { padding: 6px 8px; font-size: 13.5px; line-height: 1.25; }
.pm.ts table td, .pm.ts table th { padding: 2px 5px; }
.hint-tap { background: #e8f2fb; border: 1px solid #b9d5ee; color: #17466f; border-radius: 12px; padding: 10px 12px; font-weight: 600; margin: 0 0 10px; }
/* a printed or downloaded ticket: details on top, the advertisements share the rest of the page */
@media print {
  .pt { max-width: none; width: 100%; box-sizing: border-box; display: flex; flex-direction: column; }
  .pt:has(.adgrid), .pt:has(> .adbox) { min-height: 258mm; }
  .pt > .adbox, .pt > .adgrid { flex: 1 1 auto; }
  .pt > .adbox { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 8mm 8mm; }
  .pt > .adbox .adimg { max-height: 95mm; max-width: 100%; width: auto; height: auto; }
  .pt > .adbox .adco { font-size: 18pt; line-height: 1.2; margin-top: 4mm; }
  .pt > .adbox .admsg { font-size: 13pt; line-height: 1.35; margin-top: 3mm; }
  .pt > .adbox .adcon { font-size: 13pt; margin-top: 4mm; }
  .pt .adgrid, .pt .adgrid.n2, .pt .adgrid.n3, .pt .adgrid.n4 { display: grid; grid-template-columns: 1fr 1fr !important; grid-auto-rows: 1fr; }
  .pt .adgrid.n3 .adsection:nth-child(3) { grid-column: 1 / -1; }
  .pt .adgrid .adsection { display: flex; min-width: 0; }
  .pt .adgrid .adbox { width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 5mm 4mm; box-sizing: border-box; }
  .pt .adgrid.n2 .adimg { max-height: 62mm; } .pt .adgrid.n2 .adco { font-size: 13pt; } .pt .adgrid.n2 .admsg { font-size: 10.5pt; line-height: 1.3; } .pt .adgrid.n2 .adcon { font-size: 10.5pt; }
  .pt .adgrid.n3 .adimg, .pt .adgrid.n4 .adimg { max-height: 34mm; } .pt .adgrid.n3 .adco, .pt .adgrid.n4 .adco { font-size: 11pt; } .pt .adgrid.n3 .admsg, .pt .adgrid.n4 .admsg { font-size: 9pt; line-height: 1.25; } .pt .adgrid.n3 .adcon, .pt .adgrid.n4 .adcon { font-size: 9pt; }
}

/* =====================================================================
   3.4.0
   ===================================================================== */
/* Ticket: details on the left, the vehicle picture on the right, adverts underneath */
.tkrow { display: flex; align-items: flex-start; gap: 6px; }
.tkrow pre { flex: 1 1 auto; min-width: 0; }
.tkpic { flex: 0 0 36%; max-width: 190px; padding: 14px 12px 0 0; }
.tkpic .vanpic.tkp { margin: 0; max-width: none; border-radius: 10px; border: 1px solid var(--line, #ccc); }
.tkpic .tseat { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; background: rgba(200, 30, 30, .92); color: #fff; border: 2px solid #fff; border-radius: 8px; font: 800 13px/1 "Archivo", system-ui, sans-serif; box-shadow: 0 0 0 2px rgba(200, 30, 30, .55); }
.tkpic .tklab { font: 700 12px/1.3 "Archivo", system-ui, sans-serif; text-align: center; margin-top: 6px; color: var(--ink, #000); }
.tkgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px; border: 1px solid var(--line, #ccc); border-radius: 10px; background: #e9ecee; }
.tkgrid .tcell { aspect-ratio: 1; border-radius: 4px; background: #1b1d20; }
.tkgrid .tcell.me { background: rgba(200, 30, 30, .92); color: #fff; display: grid; place-items: center; font: 800 12px/1 "Archivo", system-ui, sans-serif; }
@media (max-width: 400px) { .tkrow pre { font-size: 12.5px; } .tkpic { flex-basis: 34%; padding-right: 8px; } .tkpic .tseat { font-size: 11px; } }
@media print {
  .tkrow { display: flex; align-items: flex-start; }
  .tkpic { flex: 0 0 40mm; max-width: 40mm; padding: 0 0 0 4mm; }
  .tkpic .tklab { font-size: 8pt; color: #000; }
  .tkpic .tseat { font-size: 8pt; }
}

/* SACCO terms (Setup) and the SACCO office fees page */
.optgrp { display: grid; gap: 8px; margin: 0 0 14px; }
.opt { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.opt input[type=radio] { margin-top: 3px; flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.opt .ot { font-weight: 700; } .opt .od { font-size: 13px; color: var(--muted); }
.opt .oin { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 14px; }
.opt .oin input { width: 110px; }
.termsline { font-size: 13px; margin: 2px 0; }
.owedbox { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); margin-bottom: 10px; }
.owedbox b { font-size: 22px; }

/* Printing and PDF downloads always use the light colours, even when the screen is in dark mode */
@media print {
  :root, :root[data-theme="dark"] {
    --brand: #1E4D78; --brand-d: #163A5C; --brand-tx: #1E4D78; --brand-l: #E6EEF6; --sky: #3C81B4; --accent: #F08A30; --accent-d: #C96A17; --accent-ink: #2A1704; --accent-wash: #FFF3E6;
    --paper: #FFFFFF; --card: #FFFFFF; --card-2: #FBF8F3; --ink: #1C2530; --muted: #67717D; --line: #E7E0D5; --field: #CFC7BA; --field-bg: #FFFFFF;
    --ok: #1E8754; --ok-bg: #E2F3E9; --ok-tx: #126A40; --bad: #C2392C; --bad-bg: #FBE5E1; --bad-tx: #8E2117; --warn: #8A5300; --warn-bg: #FFF0D4; --grey-bg: #ECE8E1; --grey-tx: #4F5967;
    --c-agent: #1E8754; --c-agent-bg: #E2F3E9; --c-av: #2A68AD; --c-av-bg: #E4EDF8; --c-sacco: #C0550B; --c-sacco-bg: #FDECDD;
    --seat-taken: #DCD6CC; --seat-taken-b: #C3BBAE; --seat-taken-tx: #8A8174;
    --self: #0F8F86; --self-bg: #DDF4F1; --self-tx: #0B6B64; --walk: #A8701A; --walk-bg: #FBEFD9; --walk-tx: #7A4F0E;
    color-scheme: light;
  }
  html, body, #printArea, #printArea * { color-scheme: light; }
  #printArea { background: #fff !important; color: #1C2530; }
  #printArea table, #printArea td, #printArea th, #printArea tr { background-color: transparent; color: #000; }
  #printArea th { background-color: #eee !important; }
  .pm.man .stn td { background-color: #dfe7ef !important; }
}

.tkkey { display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: rgba(200, 30, 30, .92); border: 1px solid #fff; box-shadow: 0 0 0 1px rgba(200, 30, 30, .6); margin-right: 5px; vertical-align: -1px; }
.tkpic .tseat, .tkkey, .tkgrid .tcell { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* QR code on an advert: very small, beside the text, so the ticket keeps its space */
.adbox::after { content: ""; display: block; clear: both; }
.adqr { float: right; width: 17mm; margin: 0 0 2px 8px; text-align: center; }
.adqr svg { display: block; width: 100%; height: auto; border: 1px solid #ddd; border-radius: 2px; background: #fff; }
.adqr span { display: block; font: 700 7px/1.2 "Archivo", system-ui, sans-serif; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; margin-top: 1px; }
@media print {
  .adqr { width: 13mm; margin: 0 0 0 3mm; } .adqr span { font-size: 5.5pt; color: #444; }
  .pt > .adbox .adqr, .pt .adgrid .adbox .adqr { float: none; margin: 2mm auto 0; width: 15mm; }
}

/* Settings pane on the passenger and driver pages */
.hdrbtn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .14); color: #fff; font: 700 14px/1 "Archivo", system-ui, sans-serif; cursor: pointer; }
.hdrbtn:active { background: rgba(255, 255, 255, .28); }
.setpane { position: fixed; inset: 0; z-index: 400; overflow: auto; background: var(--paper); color: var(--ink); -webkit-overflow-scrolling: touch; padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); }
.setpane-in { max-width: 640px; margin: 0 auto; }
.setpane-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 6px 0 14px; }
.setpane-head h1 { margin: 0; }
.setpane .seg { display: flex; } .setpane .seg button { flex: 1; }
html.set-open { overflow: hidden; }

/* Auto-rotate: the app works in portrait and landscape */
@media (orientation: landscape) and (max-height: 520px) {
  .top { padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 6px; }
  .passenger-main, main { padding-bottom: 24px; }
  .shade .sheet { max-height: 94vh; overflow: auto; }
  .nav, nav.bottom { padding-top: 2px; padding-bottom: max(2px, env(safe-area-inset-bottom)); }
  .pagehead h1 { font-size: 22px; }
}
@media (orientation: landscape) { body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); } }
