/*
  Two looks, one product:
  - Owner screens (default): light, calm, trustworthy.
  - Gate screen (body.theme-gate): black and yellow like road signs, huge targets, readable in sun and basements.
  Bangla: Noto Sans Bengali ships on Android phones; Nirmala UI on Windows; Hind Siliguri if installed.
*/
:root {
  --font: 'Noto Sans Bengali', 'Hind Siliguri', 'Nirmala UI', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f1f4f7;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --primary: #0f5132;
  --primary-hover: #0b3d26;
  --primary-ink: #ffffff;
  --primary-soft: #f0fdf4;
  --primary-line: #86efac;
  --select: #0f5132;
  --select-ink: #ffffff;
  --select-soft: #f0fdf4;
  --go: #0f5132;
  --go-ink: #ffffff;
  --good: #15803d;
  --good-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --series-1: #2a78d6;
  --chart-surface: #fcfcfb;
  --field-bg: #ffffff;
  --field-ink: #0f172a;
  --logo-bg: #0f5132;
  --logo-ink: #ffffff;
  --logo-dot: #a3e635;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 1px 3px rgb(15 23 42 / 4%);
  color-scheme: light;
}

body.theme-gate {
  --bg: #111214;
  --surface: #1c1d21;
  --surface-2: #27282d;
  --border: #34353b;
  --border-strong: #4a4b52;
  --text: #f4f4f5;
  --text-2: #d4d4d8;
  --muted: #a1a1aa;
  --primary: #facc15;
  --primary-hover: #fde047;
  --primary-ink: #111214;
  --primary-soft: rgb(250 204 21 / 12%);
  --primary-line: #facc15;
  --select: #facc15;
  --select-ink: #111214;
  --select-soft: #facc15;
  --go: #22c55e;
  --go-ink: #052e16;
  --good: #4ade80;
  --good-soft: rgb(74 222 128 / 14%);
  --warn: #facc15;
  --warn-soft: rgb(250 204 21 / 14%);
  --bad: #f87171;
  --bad-soft: rgb(248 113 113 / 16%);
  --field-bg: #ffffff;
  --field-ink: #111214;
  --logo-bg: #0f5132;
  --logo-ink: #ffffff;
  --logo-dot: #a3e635;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1 { font-size: 22px; line-height: 1.3; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 10px; font-weight: 700; }
h3 { font-size: 14px; margin: 18px 0 8px; color: var(--text-2); font-weight: 600; }
a { color: var(--primary); }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; letter-spacing: .5px; }
.bad { color: var(--bad); }
.warn { color: var(--warn); background: var(--warn-soft); padding: 10px 12px; border-radius: var(--radius-sm); }
.empty { color: var(--muted); text-align: center; padding: 20px 8px; margin: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar ---------- */
/* One row on wide screens: brand, lot, menu, actions. The menu drops to its own row when it gets tight,
   and becomes a bottom bar on phones (owner screens). */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 1px 3px rgb(15 23 42 / 6%); }
.theme-gate .topbar { background: var(--bg); border-bottom-color: var(--border); box-shadow: none; }
.topbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 16px; max-width: 1120px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; white-space: nowrap; color: var(--text); text-decoration: none; }
.logo { width: 34px; height: 34px; flex: none; }
.site-box { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 230px; padding: 0 6px 0 10px; height: 40px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text); }
.site-box:focus-within { border-color: var(--primary); }
.site-box .ic { width: 18px; height: 18px; flex: none; color: var(--muted); }
.site-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 14px; font-weight: 700; padding-right: 8px; }
.site-pick { font: inherit; font-size: 14px; font-weight: 700; color: inherit; background: transparent; border: 0; outline: 0; min-width: 0; width: 100%; height: 100%; cursor: pointer; text-overflow: ellipsis; }
.site-pick option { color: #0f172a; background: #fff; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-2); background: transparent; border: 1px solid transparent; border-radius: 999px; padding: 8px 10px; min-width: 40px; min-height: 40px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.lang-switch { display: inline-flex; flex: none; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 999px; }
.lang-switch button { font: inherit; font-size: 13px; font-weight: 700; line-height: 1.4; min-height: 34px; padding: 3px 9px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); cursor: pointer; }
.lang-switch button:hover { background: var(--surface-2); }
.lang-switch button[aria-pressed='true'] { background: var(--primary); color: var(--primary-ink); }
.lang-switch button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.user-chip { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--primary-soft); border: 1px solid var(--border); color: var(--primary); font-weight: 800; font-size: 15px; cursor: default; }
.nav { order: 5; flex: 1 0 100%; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; min-height: 40px; color: var(--text-2); text-decoration: none; border-radius: 999px; white-space: nowrap; font-weight: 700; font-size: 14px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current='page'] { background: var(--primary); color: var(--primary-ink); }
@media (min-width: 1040px) {
  .topbar-row { flex-wrap: nowrap; gap: 10px; }
  .site-box { flex: 0 1 190px; }
  .nav { order: 0; flex: 1 0 auto; justify-content: center; gap: 2px; }
  .nav a { padding: 8px 11px; gap: 6px; }
  .nav a:not([aria-current='page']) .ic { display: none; }
  .topbar-actions { margin-left: 0; }
  .topbar-row:not(:has(.nav)) .topbar-actions { margin-left: auto; }
}
@media (max-width: 560px) {
  .topbar-row { flex-wrap: nowrap; gap: 8px; padding: 8px 12px; }
  .brand-name, .icon-btn .label, .user-chip { display: none; }
  .site-box { flex: 0 1 auto; }
  /* Owner screens on a phone: the menu becomes a bottom bar that always fits. */
  body:not(.theme-gate) .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); overflow: visible; }
  body:not(.theme-gate) .nav a { flex-direction: column; gap: 2px; padding: 8px 2px; font-size: 12px; border-radius: 10px; justify-content: center; text-align: center; }
  body:not(.theme-gate) .nav a .ic { width: 24px; height: 24px; }
  body:not(.theme-gate) .nav a[aria-current='page'] { background: var(--primary-soft); color: var(--primary); }
  body:not(.theme-gate):has(.nav) .main { padding-bottom: 96px; }
  body:not(.theme-gate):has(.nav) .toast { bottom: 88px; }
  /* The gate screen has its own bottom bar, so an owner's menu scrolls on a second row there. */
  .theme-gate .topbar-row:has(.nav) { flex-wrap: wrap; }
}

.main { max-width: 1120px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
/* A group of cards inside a page: same gap as the page itself. Empty groups take no space. */
.flow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.flow:empty, #pane > div:empty { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head .input { width: auto; }

/* ---------- Cards, forms ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0; margin-bottom: 2px; }
.field em { font-weight: 400; font-style: normal; color: var(--muted); }
.field.inline { display: flex; align-items: center; gap: 8px; }
.input { width: 100%; font: inherit; color: var(--field-ink); background: var(--field-bg); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 46px; }
.theme-gate .input { border-color: transparent; }
.input::placeholder { color: #94a3b8; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.theme-gate .input:focus { box-shadow: 0 0 0 3px rgb(250 204 21 / 45%); }
.input.xl { font-size: 22px; font-weight: 700; min-height: 62px; letter-spacing: .3px; }
.input.xl::placeholder { font-size: 16px; font-weight: 500; letter-spacing: 0; }
.input.sm { min-height: 38px; padding: 6px 8px; width: auto; max-width: 110px; }
select.input.sm { max-width: 220px; }
.form-error { color: var(--bad); margin: 0; min-height: 1em; font-size: 14px; font-weight: 500; }
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid3 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.inline-form { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; flex: 1 1 160px; }
/* Phones: search on its own row, status and date side by side, Search button full width. */
@media (max-width: 600px) {
  .filters .input { flex: 1 1 100%; min-width: 0; }
  .filters select.input, .filters input[type='date'] { flex: 1 1 calc(50% - 4px); }
  .filters .btn { flex: 1 1 100%; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); padding: 10px 16px; min-height: 46px; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.go { background: var(--go); border-color: var(--go); color: var(--go-ink); }
.btn.go:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.link { background: none; border: 0; color: var(--primary); padding: 4px; min-height: 0; font-weight: 600; }
.btn.sm { padding: 6px 12px; min-height: 38px; font-size: 14px; }
.btn.xl { font-size: 20px; min-height: 64px; width: 100%; border-radius: var(--radius); }
.btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.theme-gate .btn { background: var(--surface-2); border-color: var(--surface-2); }
.theme-gate .btn.ghost { background: transparent; border-color: var(--border-strong); }
.theme-gate .btn.go { background: var(--go); border-color: var(--go); }
.theme-gate .btn.primary { background: var(--primary); border-color: var(--primary); }

/* ---------- Chips: radio buttons drawn as big buttons ---------- */
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip > span { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 12px 8px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); font-weight: 700; background: var(--surface); min-height: 60px; align-content: center; transition: background .12s, border-color .12s; }
.chip small { font-weight: 500; color: var(--muted); font-size: 12px; }
.chip .ic { width: 28px; height: 28px; }
.chip input:checked + span { border-color: var(--select); background: var(--select-soft); }
.theme-gate .chip > span { background: var(--surface-2); border-color: var(--surface-2); color: var(--text); }
.theme-gate .chip input:checked + span { background: var(--select); border-color: var(--select); color: var(--select-ink); }
.theme-gate .chip input:checked + span small { color: var(--select-ink); opacity: .8; }
.chip input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.chips.vehicles { grid-template-columns: repeat(auto-fit, minmax(min(46%, 130px), 1fr)); }
.chips.vehicles .chip { min-width: 0; }
.chips.vehicles .chip > span { overflow-wrap: anywhere; height: 100%; }
.chips.vehicles .chip > span { min-height: 96px; padding: 12px 6px; }
.chips.vehicles .ic { width: 34px; height: 34px; }
.chips.pay { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chips.pay .chip > span { min-height: 64px; padding: 8px 4px; font-size: 14px; }
.chips.pay .ic { width: 22px; height: 22px; }
.theme-gate .pm-free input:checked + span { background: var(--bad); border-color: var(--bad); color: #fff; }
.pm-free input:checked + span { border-color: var(--bad); background: var(--bad-soft); }

/* ---------- Gate ---------- */
.theme-gate .main { padding-bottom: 104px; max-width: 640px; }
.gatebar { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.sync { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 999px; min-width: 0; flex: 0 1 auto; overflow: hidden; }
.sync .ic { width: 18px; height: 18px; }
.sync.online { background: var(--good-soft); color: var(--good); }
.sync.syncing { background: var(--primary-soft); color: var(--primary); }
.sync.offline { background: var(--warn-soft); color: var(--warn); }
.sync .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-weight: 800; font-size: 14px; white-space: nowrap; }
.pill .ic { width: 18px; height: 18px; }
.pill.full { background: var(--bad); color: #fff; }
#problems:empty, #pane > div:empty { display: none; }
.problems { background: var(--warn-soft); color: var(--text); border-radius: var(--radius-sm); padding: 10px 12px; }
.problems ul { margin: 4px 0 8px; padding-left: 18px; }
#pane { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); background: #0b0b0c; border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.tabbar button { position: relative; display: grid; justify-items: center; gap: 2px; font: inherit; font-size: 12px; font-weight: 700; border: 0; background: transparent; color: var(--muted); padding: 8px 2px; border-radius: 12px; min-height: 60px; cursor: pointer; }
.tabbar button .ic { width: 26px; height: 26px; }
.tabbar button[aria-selected='true'] { color: var(--primary-ink); background: var(--primary); }
.tabbar .badge { position: absolute; top: 2px; right: calc(50% - 26px); min-width: 20px; padding: 0 5px; border-radius: 10px; background: var(--go); color: var(--go-ink); font-size: 11px; line-height: 18px; }
.tabbar button[aria-selected='true'] .badge { background: var(--primary-ink); color: var(--primary); }
@media (min-width: 700px) { .tabbar { left: 50%; right: auto; width: 640px; transform: translateX(-50%); border: 1px solid var(--border); border-bottom: 0; border-radius: 18px 18px 0 0; } }
.ticket { border: 2px solid var(--go); display: grid; gap: 10px; }
.ticket.done { border-color: var(--go); }
.ticket-head { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--good); flex-wrap: wrap; }
.ok { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--go); color: var(--go-ink); }
.ok .ic { width: 16px; height: 16px; }
.ticket-body { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.ticket-code { font: 800 38px/1.05 ui-monospace, Consolas, monospace; letter-spacing: 5px; }
.ticket-plate { font-size: 19px; font-weight: 700; }
.qr { width: 116px; height: 116px; background: #fff; border-radius: 10px; padding: 5px; flex: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.search-row { display: flex; gap: 8px; }
.search-row .btn { flex: none; }
.list { display: grid; gap: 8px; margin-top: 10px; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; min-height: 60px; }
.item:hover, .item:focus-visible { border-color: var(--primary); outline: none; }
.item .ic { width: 26px; height: 26px; color: var(--muted); }
.item-main { min-width: 0; flex: 1; display: grid; }
.item-main b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-main span { font-size: 13px; color: var(--muted); }
.item-side { display: grid; justify-items: end; white-space: nowrap; color: var(--muted); font-size: 13px; }
.item-side b { color: var(--text); font-size: 17px; }
.exit { display: grid; gap: 14px; border: 2px solid var(--primary); }
.exit-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.exit-plate { font-size: 22px; font-weight: 800; }
.fee-big { font-size: 40px; font-weight: 800; color: var(--primary); white-space: nowrap; line-height: 1.1; }
.theme-gate .ticket .fee-big { color: var(--go); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; }
.scanner { margin-top: 10px; display: grid; gap: 8px; }
.scanner video { width: 100%; max-height: 320px; border-radius: var(--radius-sm); background: #000; object-fit: cover; }
.gate-hint { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.gate-hint .ic { width: 22px; height: 22px; }

/* ---------- Owner dashboard ---------- */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tiles .tile.accent { grid-column: 1 / -1; }
  .tile-value { font-size: 24px; }
}
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: grid; gap: 2px; align-content: start; }
.card .tile { box-shadow: none; background: var(--surface-2); border-color: transparent; }
.tile-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.tile-label .ic { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); }
.tile-value { font-size: 28px; font-weight: 800; line-height: 1.2; margin-top: 6px; letter-spacing: -.01em; }
.tile-none { display: block; font-size: 15px; font-weight: 600; color: var(--muted); line-height: 1.4; padding-top: 6px; }
.tile-value small { font-size: 15px; font-weight: 600; color: var(--muted); }
.tile.accent { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.tile.accent .tile-label { color: var(--primary-ink); opacity: .9; }
.tile.accent .tile-label .ic { background: rgb(255 255 255 / 18%); color: var(--primary-ink); }
.meter { height: 7px; background: var(--surface-2); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.callout { display: flex; gap: 14px; align-items: flex-start; }
.callout p { margin: 2px 0 0; }
.callout-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.callout-icon .ic { width: 20px; height: 20px; }
.callout.warn { background: var(--warn-soft); border-color: #fde68a; color: var(--text); padding: 16px 18px; }
.callout.warn .callout-icon { background: var(--warn); color: #fff; }
.callout.good { background: var(--primary-soft); border-color: #bbf7d0; }
.callout.good .callout-icon { background: var(--good); color: #fff; }
.types { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed-time { min-width: 76px; color: var(--muted); font-variant-numeric: tabular-nums; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.status-dot.out { background: var(--muted); }
.status-dot.void { background: var(--bad); }
.pm-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--muted); }

/* Chart: one series, recessive grid, tooltip on hover/tap. */
.chart { position: relative; background: var(--chart-surface); border-radius: var(--radius-sm); }
.chart svg { display: block; width: 100%; height: auto; }
.chart .bar { fill: var(--series-1); }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .baseline { stroke: var(--muted); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit.on { fill: var(--text); fill-opacity: .05; }
.chart-tip { position: absolute; top: 4px; width: 150px; padding: 6px 8px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 13px; text-align: center; pointer-events: none; }
details summary { cursor: pointer; color: var(--text-2); margin-top: 10px; font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; text-transform: none; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot th { color: var(--text); font-size: 14px; border-bottom: 0; }
.table tr.st-void td { opacity: .55; }
.table.rates td, .price-table td { vertical-align: middle; }

/* On phones, wide tables become one small card per row (each value labelled), instead of scrolling sideways. */
@media (max-width: 600px) {
  .table-wrap:has(.stack) { overflow: visible; margin: 0; }
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tfoot, .table.stack tr { display: block; width: 100%; }
  .table.stack tr { border: 1px solid var(--border); border-radius: 12px; padding: 6px 14px; margin-bottom: 10px; background: var(--surface); }
  .table.stack tbody tr:hover td { background: transparent; }
  .table.stack td, .table.stack th { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 7px 0; text-align: right; }
  .table.stack td::before, .table.stack th[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; flex: none; }
  .table.stack td.lead-cell { font-size: 16px; font-weight: 700; justify-content: flex-start; text-align: left; border-bottom: 1px solid var(--border); padding-bottom: 9px; margin-bottom: 2px; }
  .table.stack td.lead-cell::before { content: none; }
  .table.stack td:empty { display: none; }
  .table.stack td.row-actions { justify-content: flex-end; }
  .table.stack td.row-actions::before { content: none; }
  .table.stack tfoot tr { background: var(--primary-soft); border-color: var(--primary-line); }
  .table.stack .input.sm { width: 150px; max-width: 150px; }
  .table.stack tbody .hide-sm { display: none; }
  .table.stack th.lead-cell { justify-content: flex-start; font-size: 16px; }
  .table.stack th.lead-cell::before { content: none; }
}

/* ---------- Login ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: start center; padding: 32px 16px; background: var(--bg); }
.auth { width: 100%; max-width: 440px; display: grid; gap: 16px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; }
.auth-top .brand { font-size: 19px; }
.auth-top .logo { width: 40px; height: 40px; }
.auth-hero { padding: 4px 2px; }
.auth-hero h1 { font-size: 26px; }
.auth-hero p { color: var(--text-2); margin: 6px 0 0; font-size: 16px; }
.auth .card { padding: 22px; }
.auth-points { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; color: var(--text-2); font-size: 14px; }
.auth-points li { display: flex; gap: 10px; align-items: center; }
.auth-points .ic { color: var(--primary); width: 20px; height: 20px; }

/* ---------- Setup wizard ---------- */
.setup { display: grid; gap: 14px; max-width: 720px; width: 100%; margin: 0 auto; }
.setup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.setup-head p { margin: 0 0 4px; font-weight: 600; }
.setup-head .btn.link { white-space: nowrap; }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stepper li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 10px; border-top: 4px solid var(--border); min-width: 0; }
.stepper li span { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: 12px; font-weight: 800; }
.stepper li span .ic { width: 14px; height: 14px; }
.stepper li.now { color: var(--text); border-top-color: var(--primary); }
.stepper li.now span { background: var(--primary); color: var(--primary-ink); }
.stepper li.done { color: var(--text-2); border-top-color: var(--primary); }
.stepper li.done span { background: var(--primary-soft); color: var(--primary); }
@media (max-width: 520px) { .stepper li { font-size: 0; gap: 0; justify-content: center; } }
.place-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.chip.place > span { grid-template-columns: auto 1fr; justify-items: start; text-align: left; column-gap: 12px; padding: 14px; align-content: center; min-height: 78px; }
.chip.place .ic { grid-row: span 2; width: 40px; height: 40px; padding: 8px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); }
.chip.place input:checked + span .ic { background: var(--primary); color: var(--primary-ink); }
.chip.place small { line-height: 1.35; }
.chips.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.chips.two .chip > span { min-height: 84px; padding: 14px; }
.vehicle-list { display: grid; gap: 10px; }
.vehicle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.vehicle-row .ic { width: 28px; height: 28px; color: var(--muted); }
.vehicle-row.on { border-color: var(--primary); background: var(--primary-soft); }
.vehicle-row.on .ic { color: var(--primary); }
.check { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; cursor: pointer; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.spaces { display: flex; align-items: center; gap: 8px; }
.spaces .input { width: 96px; }
.total-line { display: flex; justify-content: space-between; margin: 0; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); font-weight: 600; }
.money-input { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.example { display: flex; gap: 10px; align-items: center; margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--text); font-weight: 600; border: 1px solid #bbf7d0; }
.example .ic { color: var(--primary); }
.setup-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.people li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.add-person { margin-top: 4px; }
.done-card { text-align: center; display: grid; gap: 10px; justify-items: center; }
.done-card .kv { text-align: left; }
.big-check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; }
.big-check .ic { width: 32px; height: 32px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 14px 0 8px; }
.practice { border-style: dashed; }
.practice-out { margin-top: 12px; }
#practice > .btn { margin-top: 12px; }
#practice .chips .btn { width: 100%; }

/* Getting-started checklist on the dashboard */
.checklist { border: 1.5px solid var(--primary-line); background: var(--primary-soft); }
.checklist ul { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; align-items: center; gap: 12px; }
.checklist li.done { color: var(--muted); }
.checklist a { color: var(--primary); font-weight: 700; }
.tick { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); flex: none; }
.tick .ic { width: 14px; height: 14px; }
.checklist li.done .tick { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: .2s; background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 12px; max-width: calc(100% - 32px); z-index: 50; font-weight: 600; box-shadow: 0 8px 24px rgb(0 0 0 / 18%); }
.theme-gate .toast { bottom: 96px; background: #f4f4f5; color: #111214; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #b91c1c; color: #fff; }

@media (min-width: 760px) {
  .main, .flow { gap: 18px; }
  .main { padding: 24px; }
}

/* ---------- Bills and payment ---------- */
.link-card { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.link-card > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.link-card-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.link-card .ic { width: 22px; height: 22px; }
.link-card:hover { border-color: var(--primary-line); }
.due-banner { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); background: #fef2f2; border: 1.5px solid #fca5a5; }
.due-banner > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.due-banner .callout-icon { background: #dc2626; color: #fff; }
.due-banner .btn { pointer-events: none; }
.due-list { display: grid; gap: 12px; }
.due-card { display: grid; gap: 10px; }
.due-card.st-unpaid { border: 2px solid #fca5a5; }
.due-card.st-pending { border: 2px solid #fcd34d; }
.due-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.due-title { font-size: 17px; }
.due-amount { font-size: 26px; font-weight: 800; white-space: nowrap; }
.due-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.due-chip { font-size: 13px; font-weight: 800; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); }
.due-chip.st-unpaid { background: #fee2e2; color: #b91c1c; }
.due-chip.st-pending { background: #fef3c7; color: #92400e; }
.due-chip.st-paid { background: var(--good-soft); color: var(--good); }
.due-note { margin: 0; font-size: 14px; color: var(--text-2); }
.due-note.bad { color: var(--bad); font-weight: 600; }

.pay-dialog { width: min(480px, calc(100% - 24px)); max-height: calc(100% - 24px); border: 0; border-radius: 20px; padding: 20px; background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgb(0 0 0 / 25%); }
.pay-dialog::backdrop { background: rgb(15 23 42 / 55%); }
.pay-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.pay-head h2 { margin: 0; font-size: 22px; }
.pay-methods { margin-bottom: 12px; }
.pay-steps { margin: 0 0 14px; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.pay-steps li { counter-increment: step; display: grid; gap: 6px; padding: 12px 14px 12px 50px; position: relative; background: var(--surface-2); border-radius: 12px; font-weight: 600; color: var(--text-2); }
.pay-steps li::before { content: counter(step, bengali); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 800; }
html[lang='en'] .pay-steps li::before { content: counter(step); }
.copy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.big-number { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.pay-after { margin: 0; font-weight: 600; }
.pay-form { gap: 12px; }

/* Cash with staff */
.cash-list, .handover-log ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.cash-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.cash-who { display: grid; }
.cash-amount { font-size: 20px; }
.receive-form { grid-column: 1 / -1; display: grid; gap: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.short-month { color: var(--bad, #b91c1c); font-weight: 700; margin: 10px 0 0; }
.handover-log li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.cash-got { text-align: right; white-space: nowrap; font-weight: 700; }
.cash-got small { display: block; font-weight: 500; }
.cash-got .bad { color: #b91c1c; }
/* Different amount */
.other-amount { display: grid; gap: 10px; }
.reason-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* Dashboard */
.dash-top { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .dash-top { grid-template-columns: 3fr 2fr; gap: 18px; } }
.hero-money { display: grid; gap: 4px; align-content: start; background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.hero-label { font-weight: 600; font-size: 14px; opacity: .9; }
.hero-amount { font-size: clamp(38px, 9vw, 52px); line-height: 1.15; }
.hero-compare { font-weight: 700; }
.hero-cars { opacity: .9; font-size: 14px; }
.hero-ways { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hero-ways span { background: rgb(255 255 255 / 16%); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.missed { display: grid; gap: 8px; align-content: start; justify-items: start; }
.missed.all-clear { background: var(--primary-soft); border-color: #bbf7d0; justify-items: center; align-content: center; text-align: center; }
.missed.all-clear .callout-icon { background: var(--good); color: #fff; }
.missed.all-clear p { margin: 0; }
.missed.bad-card { background: #fef2f2; border-color: #fca5a5; }
.missed-amount { font-size: 34px; color: #b91c1c; line-height: 1.2; }
.missed ul, .attention ul, .staff { list-style: none; margin: 0; padding: 0; display: grid; width: 100%; }
.missed li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #fecaca; }
.attention { border-color: #fde68a; background: var(--warn-soft); }
.attention a { display: flex; align-items: center; gap: 10px; padding: 9px 0; color: var(--text); text-decoration: none; font-weight: 600; }
.attention a span { flex: 1; }
.attention .ic { width: 20px; height: 20px; flex: none; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-day { display: grid; gap: 4px; justify-items: center; font-size: 12px; color: var(--muted); }
.week-bar { display: flex; flex-direction: column; justify-content: flex-end; width: 100%; max-width: 36px; height: 130px; }
.week-bar i { display: block; width: 100%; }
.week-bar .miss { background: #f87171; border-radius: 4px 4px 0 0; }
.week-bar .got { background: var(--primary); opacity: .55; }
.week-day.last .got { opacity: 1; }
.week-day.last { color: var(--text); font-weight: 700; }
.week-key { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; }
.week-key .key { width: 10px; height: 10px; border-radius: 3px; }
.week-key .key.got { background: var(--primary); }
.week-key .key.miss { background: #f87171; margin-left: 10px; }
.staff li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.staff li:last-child { border-bottom: 0; }
.staff li > div { display: grid; }
.staff-flags { color: #b91c1c; font-size: 13px; font-weight: 600; }
#cash-now[hidden] { display: none; }

/* Dashboard periods, KPI cards and graph */
.dx-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.dx-bar .input { width: auto; }
.dx-bar .input[hidden] { display: none; }
.dx-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.dx-tabs button { font: inherit; font-size: 14px; font-weight: 700; color: var(--text-2); background: transparent; border: 0; border-radius: 10px; padding: 8px 16px; min-height: 40px; cursor: pointer; }
.dx-tabs button[aria-selected="true"] { background: var(--primary); color: var(--primary-ink); }
@media (max-width: 520px) { .dx-tabs { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); } .dx-tabs button { padding: 8px 4px; font-size: 13px; } }
.dx-live { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.dx-live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.dx-live.on::before { background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
.dx-live.off::before { background: #f59e0b; }
.dx-range { margin: 0; font-weight: 600; }
.dx-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 860px) { .dx-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dx-kpi { display: grid; gap: 4px; align-content: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.dx-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.dx-label .ic { width: 28px; height: 28px; padding: 6px; border-radius: 8px; background: var(--surface-2); flex: none; }
.dx-value { font-size: clamp(22px, 6vw, 30px); line-height: 1.25; overflow-wrap: anywhere; }
.dx-none { font-size: 14px; font-weight: 600; color: var(--muted); }
.dx-change { font-size: 12px; color: var(--muted); line-height: 1.4; }
.dx-change b { font-size: 13px; }
.dx-change.up b { color: #15803d; }
.dx-change.down b { color: #b91c1c; }
.dx-money { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.dx-money .dx-label, .dx-money .dx-change, .dx-money .dx-change b { color: var(--primary-ink); }
.dx-money .dx-label .ic { background: rgb(255 255 255 / 18%); }
.dx-ways { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.dx-key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dx-key i { width: 10px; height: 10px; border-radius: 3px; background: var(--primary); }
.dx-key i.miss { background: #f87171; margin-left: 8px; }
.dx-cols { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; }
.dx-col { display: grid; gap: 4px; justify-items: center; font: inherit; background: transparent; border: 0; border-radius: 8px; padding: 4px 0; cursor: pointer; color: var(--muted); min-width: 0; }
.dx-col:hover, .dx-col.on { background: var(--surface-2); }
.dx-num { font-size: 11px; min-height: 16px; white-space: nowrap; }
.dx-stack { display: flex; flex-direction: column; justify-content: flex-end; width: 70%; max-width: 40px; height: 160px; border-bottom: 1px solid var(--border); }
.dx-stack i { display: block; width: 100%; }
.dx-stack .miss { background: #f87171; border-radius: 4px 4px 0 0; }
.dx-stack .got { background: var(--primary); border-radius: 3px 3px 0 0; }
.dx-name { font-size: 11px; min-height: 16px; white-space: nowrap; }
.dx-col.now { color: var(--text); font-weight: 700; }
.dx-tip { margin: 8px 0 0; }

/* Inside now */
.dx-inside { display: flex; flex-direction: column; gap: 12px; }
.dx-inside h2 { margin: 0; }
.dx-inside-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.dx-inside-n { font-size: 40px; line-height: 1; }
.dx-free { font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--primary-soft); color: #166534; }
.dx-inside.busy .dx-free { background: #fef3c7; color: #92400e; }
.dx-inside.full .dx-free { background: #fee2e2; color: #b91c1c; }
.dx-bar-line { display: block; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.dx-bar-line i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.dx-inside.busy .dx-bar-line i { background: #d97706; }
.dx-inside.full .dx-bar-line i, .dx-types li.full .dx-bar-line i { background: #dc2626; }
.dx-types { list-style: none; margin: 0; padding: 0; display: grid; }
.dx-types li { display: grid; grid-template-columns: 22px minmax(0, 7.5em) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.dx-types .ic { width: 20px; height: 20px; color: var(--text-2); }
.dx-types .dx-bar-line { height: 6px; }
.dx-types b { min-width: 4.5em; text-align: right; font-variant-numeric: tabular-nums; }
.dx-types small { font-weight: 600; color: var(--muted); }
.dx-key { flex-wrap: wrap; }
.dx-key b { color: var(--text); }
.dx-key i.miss.none { background: var(--border-strong); }
.dx-stack .miss { flex: none; }

/* Settings */
.set-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.set-tabs button { display: flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 700; color: var(--text-2); background: transparent; border: 0; border-radius: 10px; min-height: 44px; cursor: pointer; }
.set-tabs button:hover { background: var(--surface-2); }
.set-tabs button[aria-selected="true"] { background: var(--primary); color: var(--primary-ink); }
.set-tabs .ic { width: 18px; height: 18px; }
@media (max-width: 520px) { .set-tabs button { flex-direction: column; gap: 2px; font-size: 12px; padding: 6px 2px; } }
.set-panel[hidden], .rate-body[hidden], .rate-body .field[hidden] { display: none !important; }
.set-head h2, .set-head p { margin: 0; }
.set-head p { margin-top: 4px; }
.set-actions { display: flex; justify-content: flex-end; }
.set-actions .btn { min-width: 160px; }
.set-actions.sticky { position: sticky; bottom: 0; background: var(--surface); padding: 10px 0 2px; border-top: 1px solid var(--border); }
@media (max-width: 560px) { .set-actions .btn { width: 100%; } .set-actions.sticky { bottom: 70px; } }
.method-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.method-chips .chip > span { min-height: 44px; min-width: 100px; padding: 8px 18px; align-content: center; }
.rate-list { display: grid; gap: 10px; }
.rate-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.rate-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; background: var(--surface-2); }
.rate-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--surface); color: var(--primary); }
.rate-icon .ic { width: 22px; height: 22px; }
.rate-example { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--text-2); text-align: right; }
.rate-card.off .rate-top { background: transparent; }
.rate-card.off b, .rate-card.off .rate-icon { color: var(--muted); }
.switch { appearance: none; position: relative; flex: none; width: 46px; height: 26px; margin: 0; border-radius: 999px; background: var(--border-strong); cursor: pointer; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.rate-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 14px; border-top: 1px solid var(--border); }
.people { list-style: none; margin: 10px 0 0; padding: 0; display: grid; }
.people li { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
/* A disabled staff member stands out in red, so the owner sees who cannot log in. */
.people li.off { background: var(--bad-soft); border-color: var(--bad); }
.people li.off .person-initial { background: var(--surface); color: var(--bad); }
.people li.off .person-who b { color: var(--bad); }
.people li.off .tag { background: var(--bad); color: #fff; }
.person-actions .btn.bad { color: var(--bad); }
.person-initial { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.person-who { display: grid; flex: 1; min-width: 130px; }
.person-actions { display: flex; gap: 6px; }

/* Themed pop-up (instead of the browser's) */
.ask { width: min(400px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: 0 24px 60px -12px rgb(0 0 0 / 45%); }
.ask::backdrop { background: rgb(2 6 23 / 62%); }
.ask-body { display: grid; gap: 16px; justify-items: center; text-align: center; padding: 24px 20px 20px; }
.ask-body p { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.ask-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); }
.ask-icon.danger { background: #f59e0b; color: #1c1917; }
.ask-icon .ic { width: 28px; height: 28px; }
.ask-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ask-actions .btn { min-height: 52px; }
.btn.danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn.danger:hover { filter: brightness(1.08); }

/* Back to Settings */
.back-row { max-width: 1120px; margin: 0 auto; padding: 12px 16px 0; }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 700; text-decoration: none; }
.back-link:hover { background: var(--surface-2); }
.back-link .ic { width: 18px; height: 18px; transform: rotate(180deg); }
.back-row + .main { padding-top: 12px; }
/* Setup shares the Settings pieces */
.place-grid .chip { display: grid; }
.place-grid .chip > span { height: 100%; align-content: start; }
.place-grid .chip.place small { grid-column: 2; }
.setup .rate-top.still { cursor: default; }
.setup .rate-body { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.setup .vehicle-row .switch { width: 46px; height: 26px; }
.setup .add-person { align-items: end; }

/* Account: who is logged in */
.profile { display: flex; align-items: center; gap: 16px; }
.profile .person-initial { width: 56px; height: 56px; font-size: 22px; }
.profile dl { display: flex; flex-wrap: wrap; gap: 8px 36px; margin: 0; min-width: 0; }
.profile dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.profile dd { margin: 0; font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }

/* Fields side by side keep their own height, even when one has a hint under it */
.grid2 > .field, .grid3 > .field { align-content: start; }
/* Staff rows: room around the initial and the buttons */
.people { gap: 8px; }
.people li { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.rate-body .field > span::first-letter { text-transform: uppercase; }

/* Wordmark: bold, light "my", bold. */
.wm { font-weight: 800; letter-spacing: -.03em; }
.wm i { font-style: normal; font-weight: 300; }

/* Payment methods: a checklist, so it is plain that several can be on and which ones are. */
.method-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.method-chips .chip > span { display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 56px; padding: 10px 14px; text-align: left; }
.method-chips .chip > span::before { content: ''; flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border-strong); background: var(--surface) center / 18px no-repeat; }
.method-chips .chip input:checked + span { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.method-chips .chip input:checked + span::before { border-color: var(--primary); background-color: var(--primary); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.method-hint { margin: 0 0 8px; }

/* Skeleton loaders */
.sk { display: block; max-width: 100%; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 30%, var(--border) 50%, var(--surface-2) 70%) 0 0 / 300% 100%; animation: sk-move 1.4s linear infinite; }
.sk-stack { display: grid; gap: 12px; align-content: start; }
.sk-boot { max-width: 1120px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }
@keyframes sk-move { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* Gate sign downloads */
.sign-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.sign-buttons { display: flex; gap: 8px; }

/* Install app */
.install-banner { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: start; border-color: var(--primary-line); background: var(--primary-soft); }
.install-banner[hidden] { display: none; }
.install-banner-text { display: grid; gap: 2px; }
.install-banner .install-box { grid-column: 1 / -1; }
.install-box { display: grid; gap: 8px; justify-items: start; }
.install-box.center { justify-items: center; text-align: center; }
.install-box:empty { display: none; }
.install-done { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
