/* app.css — P.Driver Broker Upload
 * Mobile-first. Phones get a bottom tab bar; ≥ 960px gets a sidebar. */

:root {
  --blue: #2563eb; --blue-700: #1d4ed8; --blue-50: #eff6ff; --blue-100: #dbeafe;
  --bg: #f3f5f9; --card: #ffffff; --line: #e5e8ef; --line-2: #eef1f6;
  --text: #0f172a; --muted: #5b6b82; --muted-2: #94a3b8;
  --green: #16a34a; --green-50: #ecfdf5; --green-100: #d1fae5;
  --amber: #d97706; --amber-50: #fffbeb; --amber-100: #fef3c7;
  --red: #dc2626; --red-50: #fef2f2; --red-100: #fee2e2;
  --navy: #0b1730;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .18);
  --r: 16px; --r-sm: 10px; --r-xs: 8px;
  --top-h: 56px; --tab-h: 64px; --side-w: 236px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Noto Sans Thai", "Noto Sans Myanmar", "Myanmar Text", "Padauk", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* No sideways page scroll on phones — on html only. Set on body as well, it turns body
   into its own scroll box and nothing sticks any more: the top bar scrolled away with
   the page and the desktop card panel stopped following the list. */
html { overflow-x: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
html[lang="my"] body { line-height: 1.75; }
html[lang="th"] body { line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 750; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.sm { width: 16px; height: 16px; }
.flag { width: 28px; height: 20px; border-radius: 3px; display: block; box-shadow: 0 0 0 1px rgba(15, 23, 42, .12) inset; }

/* ---------- chrome ---------- */
/* Installed on a phone the page runs under the status bar (clock, battery, the
   Dynamic Island), so the bar keeps that strip free: env() is 0 in a normal browser tab. */
.topbar {
  position: sticky; top: 0; z-index: 30; height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 850; font-size: 17px; letter-spacing: .01em; }
.brand .mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--blue), #60a5fa); color: #fff; display: grid; place-items: center; font-weight: 900; }
.brand .portal { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 2px; }
.topbar .spacer { flex: 1; }
.langs { display: flex; gap: 6px; }
.langs button {
  width: 42px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 9px;
  display: grid; place-items: center; padding: 0; opacity: .7; transition: .15s;
}
.langs button:hover { opacity: 1; }
.langs button.active { opacity: 1; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
.topbar .menu-link { margin-right: 4px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); max-width: 160px; }
.user-chip b { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { color: var(--text); background: var(--line-2); }

.shell { display: block; }
.sidenav { display: none; }
.view { width: 100%; min-width: 0; padding: 16px 14px calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); max-width: 1160px; margin: 0 auto; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 650; color: var(--muted); position: relative; }
.tabbar a.active { color: var(--blue); }
.tabbar a .icon { width: 24px; height: 24px; }
.badge-dot { position: absolute; top: 8px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }

@media (max-width: 600px) {
  .brand .portal, .user-chip { display: none; }
  .langs button { width: 38px; }
  .topbar { gap: 8px; padding-left: 10px; padding-right: 10px; }
}
/* The broker's bar has a key and a log-out button: on a narrow phone the "P" mark stays,
   the name steps aside so the flags and both buttons fit. */
@media (max-width: 400px) { .topbar .brand-name { display: none; } }
/* "Show password" under the password boxes. */
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--muted); margin: 0 0 4px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); flex: none; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: calc(100vh - var(--top-h) - env(safe-area-inset-top)); }
  .sidenav { display: block; background: var(--navy); padding: 16px 12px; color: #c9d3e6; }
  .sidenav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; font-weight: 600; margin: 3px 0; color: inherit; }
  .sidenav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
  .sidenav a.active { background: rgba(255, 255, 255, .14); color: #fff; }
  .sidenav .badge-dot { position: static; margin-left: auto; }
  .sidenav[hidden] + .view { grid-column: 1 / -1; }   /* logged out: no sidebar column */
  .tabbar { display: none; }
  .view { padding: 28px 28px 40px; }
  h1 { font-size: 28px; }
}

/* ---------- primitives ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.card.tight { padding: 0; overflow: hidden; }
.card + .card, .stack > * + * { margin-top: 14px; }
/* …but a grid already spaces its children, and that stray top margin made every card
   after the first shorter than its neighbours. */
.grid > .card + .card, .summary-chips > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
.grid.two { grid-template-columns: 1fr; }
.grid.four { grid-template-columns: repeat(2, 1fr); }
/* Three equal tiles on one row at every width — they hold a word and a number, so they
   stay legible even on a phone. */
.grid.three { grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 720px) { .grid.three { gap: 14px; } }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.four { grid-template-columns: repeat(4, 1fr); } .grid.split { grid-template-columns: 1.15fr .85fr; } }
/* Phones: a user row is the name on one line and its buttons on the next. */
@media (max-width: 639px) {
  #usersCard .list-row { flex-wrap: wrap; row-gap: 8px; }
  #usersCard .list-row .main { flex-basis: calc(100% - 24px); }
  #usersCard .list-row .btn { margin-left: 0; }
  #usersCard .list-row .dot + .main { flex-basis: calc(100% - 24px); }
}
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
@media (max-width: 639px) { .page-head { margin-bottom: 12px; } .page-head .btn { min-height: 40px; } }
.page-head p { color: var(--muted); margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 15px; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .05s; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--blue-700); }
.btn.secondary { background: #fff; border-color: var(--line); color: var(--text); }
.btn.secondary:hover:not(:disabled) { background: var(--line-2); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--line-2); color: var(--text); }
.btn.success { background: var(--green); color: #fff; }
.btn.danger { background: var(--red-50); color: #b91c1c; border-color: var(--red-100); }
.btn.danger:hover:not(:disabled) { background: var(--red-100); }
.btn.warn { background: var(--amber-50); color: #b45309; border-color: var(--amber-100); }
.btn.lg { min-height: 56px; font-size: 17px; padding: 0 24px; border-radius: 14px; }
.btn.sm { min-height: 36px; font-size: 13.5px; padding: 0 12px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn .icon { width: 18px; height: 18px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field .hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 5px; font-weight: 400; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; outline: none;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-100); }
textarea.input { min-height: 80px; resize: vertical; }
.input.num { width: 96px; text-align: center; font-weight: 700; }
.input.error { border-color: var(--red); }
.form-error { color: #b91c1c; background: var(--red-50); border: 1px solid var(--red-100); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 750; white-space: nowrap; line-height: 1.3; }
.pill.submitted { background: var(--blue-50); color: #1d4ed8; }
.pill.returned { background: var(--amber-50); color: #b45309; }
.pill.completed { background: var(--green-50); color: #15803d; }
.pill.rejected { background: #f1f5f9; color: #475569; }
.pill.low { background: var(--red-50); color: #b91c1c; }
.pill.resub { background: #f5f3ff; color: #6d28d9; }
.pill.neutral { background: var(--line-2); color: var(--muted); }
/* how far staff have got with a card: sent → downloaded → registered */
.pill.downloaded { background: #eef2ff; color: #4338ca; }
.pill.registered { background: var(--green-50); color: #15803d; }
.pill .icon.sm { width: 14px; height: 14px; }
/* motorcycle / car */
.veh { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; white-space: nowrap; }
.veh.moto { color: #0f766e; }
.veh.car { color: #7c2d12; }
.veh .short { display: none; }
@media (max-width: 639px) { .tbl .veh .long { display: none; } .tbl .veh .short { display: inline; } }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

.stat-card .label { font-size: 12px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 639px) {
  .grid.three .card { padding: 13px 11px; }
  .grid.three .stat-card .label { font-size: 11.5px; letter-spacing: .02em; }
  .grid.three .stat-card .value { font-size: 26px; }
}
.stat-card .value { font-size: 30px; font-weight: 850; margin-top: 4px; letter-spacing: -.02em; }
.stat-card.warn .value { color: #b91c1c; }
.stat-card.ok .value { color: var(--green); }
.stat-card.accent .value { color: var(--blue); }

.progress { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), #60a5fa); transition: width .3s; }
.progress.full > i { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.progress.green > i { background: linear-gradient(90deg, #16a34a, #4ade80); }
.progress.red > i { background: linear-gradient(90deg, #dc2626, #f87171); }

.alert { border-radius: 14px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.alert .icon { width: 22px; height: 22px; margin-top: 1px; }
.alert.warn { background: var(--amber-50); border: 1px solid var(--amber-100); color: #78350f; }
.alert.info { background: var(--blue-50); border: 1px solid var(--blue-100); color: #1e3a8a; }
.alert.danger { background: var(--red-50); border: 1px solid var(--red-100); color: #7f1d1d; }
.alert.ok { background: var(--green-50); border: 1px solid var(--green-100); color: #14532d; }
.alert b { display: block; margin-bottom: 2px; }
.alert .actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line-2); min-height: 60px; }
.list-row:first-child { border-top: 0; }
.list-row.clickable { cursor: pointer; border-radius: 10px; margin: 0 -8px; padding: 12px 8px; }
.list-row.clickable:hover { background: var(--line-2); }
.list-row .thumb { width: 52px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--line-2); flex: none; border: 1px solid var(--line); }
.list-row.sub { flex-wrap: wrap; }
.list-row .main { flex: 1; min-width: 0; }
.list-row .note { flex-basis: 100%; font-size: 13.5px; color: #b45309; background: var(--amber-50); border-radius: 8px; padding: 6px 10px; }
.list-row .btn.full { flex-basis: 100%; }
.list-row .main b { display: block; }
.list-row .meta { font-size: 12.5px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty .icon { display: block; width: 36px; height: 36px; color: var(--muted-2); margin: 0 auto 8px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; max-width: min(92vw, 420px); text-align: center; }
.toast.error { background: #991b1b; }
.toast.ok { background: #166534; }
@media (min-width: 960px) { .toast { bottom: 24px; } }

/* modal: bottom sheet on phones, centred dialog on desktop */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); }
.modal h2 { margin-bottom: 12px; }
.modal .actions { display: flex; gap: 10px; margin-top: 16px; }
.modal .actions .btn { flex: 1; }
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: calc(20px + env(safe-area-inset-top)) 20px 20px; }
  .modal { width: min(520px, 100%); border-radius: 18px; padding: 24px; }
  .modal.wide { width: min(760px, 100%); }
}

/* ---------- login ---------- */
/* The sign-in screen fills the window: the page padding and width cap made its background
   a box with visible edges. (Browsers without :has() keep the old look — harmless.) */
.view:has(> .login-wrap) { padding: 0; max-width: none; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); background: radial-gradient(1000px 500px at 10% -10%, #dbeafe 0, transparent 60%), var(--bg); }
.login-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 26px 22px; }
.login-card .langs { justify-content: flex-end; }
.login-card .brand { justify-content: center; font-size: 22px; margin: 16px 0 4px; }
.login-card .sub { text-align: center; color: var(--muted); margin-bottom: 20px; }
.login-card .mode { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 16px; }
.login-card .demo { margin-top: 12px; padding: 10px 12px; background: var(--line-2); border-radius: 10px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* ---------- broker home ---------- */
.quota-card { background: linear-gradient(135deg, #1e40af, #2563eb 55%, #3b82f6); color: #fff; border: 0; }
.quota-card .label { font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.quota-card .big { font-size: 40px; font-weight: 850; letter-spacing: -.02em; line-height: 1.1; margin-top: 6px; }
.quota-card .big small { font-size: 16px; font-weight: 600; opacity: .85; margin-left: 4px; }
.quota-card .progress { background: rgba(255, 255, 255, .25); margin: 14px 0 8px; }
.quota-card .progress > i { background: #fff; }
.quota-card .progress.full > i { background: #fbbf24; }
.quota-card .deadline { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .25); font-size: 13.5px; font-weight: 650; }
/* the rule under the broker's calendar */
.deadline-rule { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: #b45309; font-weight: 650; }
/* what the student learns to drive: two big, unmistakable choices */
.vehicle-pick { margin-bottom: 14px; }
.vehicle-pick .vp-q { font-weight: 750; margin-bottom: 8px; }
.vp-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vp { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 68px; padding: 8px 10px; line-height: 1.25; white-space: nowrap;
      border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--muted); font: inherit; font-weight: 750; cursor: pointer;
      transition: background .12s, border-color .12s, color .12s; }
.vp .icon { width: 26px; height: 26px; }
.vp.on { background: var(--blue-50); border-color: var(--blue); color: var(--blue-700); box-shadow: inset 0 0 0 1px var(--blue); }
.vp .tick { position: absolute; top: 6px; right: 6px; width: 14px; height: 14px; }
.vp:disabled { opacity: .6; cursor: default; }
.preview-wrap + .score-box + .vehicle-pick, .score-box + .vehicle-pick { margin-top: 14px; }
.quota-card .foot { display: flex; justify-content: space-between; font-size: 13.5px; opacity: .95; }
.quota-card .foot b { font-size: 16px; }
.quota-card.empty-quota { background: linear-gradient(135deg, #7c2d12, #b45309); }
.cta { margin: 14px 0; }
.summary-chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.summary-chips .card { padding: 12px 10px; text-align: center; }
.summary-chips .value { font-size: 22px; font-weight: 800; }
.summary-chips .label { font-size: 12px; color: var(--muted); font-weight: 650; }

/* ---------- submit ---------- */
.dropzone { border: 2px dashed #c3cfe3; border-radius: 18px; background: #fbfcff; padding: 28px 18px; text-align: center; }
.dropzone > .icon { width: 44px; height: 44px; color: var(--blue); margin: 0 auto 8px; }
.dropzone .btns { display: grid; gap: 10px; margin-top: 18px; }
@media (min-width: 640px) { .dropzone .btns { grid-template-columns: 1fr 1fr; } }
.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.checklist ul { list-style: none; margin: 6px 0 0; padding: 0; }
.checklist li { display: flex; gap: 8px; align-items: center; font-size: 13.5px; padding: 3px 0; }
.checklist li .icon { width: 16px; height: 16px; }
.checklist .good li .icon { color: var(--green); }
.checklist .bad li .icon { color: var(--red); }
.checklist h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.preview-wrap { position: relative; border-radius: 14px; overflow: hidden; background: #0f172a; }
.preview-wrap img { width: 100%; max-height: 62vh; object-fit: contain; margin: 0 auto; }
.score-box { border-radius: 14px; padding: 14px 16px; margin-top: 14px; display: flex; gap: 14px; align-items: center; }
.score-box.checking { background: var(--line-2); }
.score-box.pass { background: var(--green-50); border: 1px solid var(--green-100); }
.score-box.fail { background: var(--red-50); border: 1px solid var(--red-100); }
.score-box .verdict { width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.score-box .verdict .icon { width: 30px; height: 30px; stroke-width: 3; }
.score-box.pass .verdict { background: var(--green); }
.score-box.fail .verdict { background: var(--red); }
.score-box .txt b { display: block; font-size: 18px; }
.score-box .txt .hints { margin-top: 4px; font-size: 13.5px; }
.score-box.pass .txt b { color: #15803d; }
.score-box.fail .txt b { color: #b91c1c; }
/* Photo fine, ID number not: amber — advice to retake, never a block. */
.score-box.warn { background: var(--amber-50); border: 1px solid var(--amber-100); }
.score-box.warn .verdict { background: var(--amber); }
.score-box.warn .txt b { color: #b45309; }
.score-box.warn .txt .hints { color: #78350f; }
.score-box .txt .sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 14px; font-weight: 650; color: #15803d; }
.photo-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 14px; }
/* Long labels (Burmese "choose another photo") wrap inside their half instead of widening the grid past the card. */
.photo-actions .btn { min-width: 0; white-space: normal; text-align: center; }
@media (max-width: 380px) { .photo-actions .btn { padding: 0 10px; gap: 6px; } }
.photo-actions .btn.block-2 { grid-column: 1 / -1; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.success-card { text-align: center; padding: 30px 18px; }
.success-card .check { width: 72px; height: 72px; border-radius: 50%; background: var(--green-50); color: var(--green); display: grid; place-items: center; margin: 0 auto 14px; }
.success-card .check .icon { width: 36px; height: 36px; stroke-width: 2.5; }
.success-card .bk { font-size: 34px; font-weight: 850; letter-spacing: -.01em; margin: 6px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; text-align: left; margin: 14px auto 0; max-width: 320px; }
.kv span:nth-child(odd) { color: var(--muted); }

/* ---------- several photos at once (gallery) ---------- */
.batch-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.batch-head b { font-size: 18px; }
.batch-hint { margin: 2px 0 12px; }
.batch .alert { margin-top: 12px; }
.batch .batch-hint + .alert { margin: 0 0 12px; }
.blist { display: grid; gap: 10px; }
.brow { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.brow.pass { border-color: #bbf7d0; }
.brow.warn { background: var(--amber-50); border-color: #fde68a; }
.brow.fail { background: var(--red-50); border-color: #fecaca; }
.brow.sent { background: var(--green-50); border-color: var(--green-100); }
.brow.sending { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-100); }
.brow .tw { position: relative; flex: none; }
.brow .bthumb { display: block; width: 72px; height: 54px; object-fit: cover; border-radius: 8px; background: var(--line-2); border: 1px solid var(--line); }
.brow .bthumb.ph { display: grid; place-items: center; color: var(--muted-2); }
.brow .bthumb.ph .spinner { width: 18px; height: 18px; border-width: 2.5px; }
.brow .bnum { position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--navy); color: #fff; font-size: 11.5px; font-weight: 800; line-height: 1; display: grid; place-items: center; }
.brow .bmain { flex: 1 1 0; min-width: 0; }
.brow .bmain > b.mono { font-size: 17px; }
.brow .bverdict { display: flex; align-items: flex-start; gap: 6px; font-weight: 750; line-height: 1.35; }
.brow .bverdict > .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; stroke-width: 2.6; }
.brow .bverdict > .spinner { width: 16px; height: 16px; border-width: 2.5px; margin-top: 2px; }
.brow.pass .bverdict, .brow.sent .bverdict { color: #15803d; }
.brow.warn .bverdict { color: #b45309; }
.brow.fail .bverdict { color: #b91c1c; }
.brow.busy .bverdict { color: var(--muted); }
.brow .bsub { margin-top: 3px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.brow .bsub.ok { color: #15803d; font-weight: 650; }
.brow .bsub.warn { color: #b45309; font-weight: 650; }
.brow .bsub.bad { color: #b91c1c; font-weight: 650; }
.brow .bx { flex: none; width: 36px; height: 36px; margin: -4px -4px 0 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.brow .bx:hover { background: var(--line-2); color: var(--text); }
.brow .bx .icon { width: 20px; height: 20px; }
/* Vehicle and retake buttons get a line of their own: at 360 px there is no room beside the photo. */
.brow .bveh, .brow .bact { flex-basis: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.brow .bveh button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px;
                     background: #fff; color: var(--muted); font: inherit; font-size: 14.5px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.brow .bveh button .icon { width: 20px; height: 20px; }
.brow .bveh button.on { background: var(--blue-50); border-color: var(--blue); color: var(--blue-700); box-shadow: inset 0 0 0 1px var(--blue); }
.brow .bveh button:disabled { opacity: .6; cursor: default; }
.brow .bact .btn { min-width: 0; white-space: normal; text-align: center; line-height: 1.25; padding: 4px 8px; }
.brow .bact .btn.wide { grid-column: 1 / -1; }
.batch-add { width: 100%; margin-top: 12px; border-style: dashed; border-color: #c3cfe3; color: var(--blue-700); }
.batch-progress { margin-top: 14px; }
.success-card .blist { text-align: left; max-width: 420px; margin: 18px auto 0; }
.success-card .batch-note { max-width: 420px; margin: 14px auto 0; text-align: left; }
.dropzone .alert { margin-top: 16px; text-align: left; }
/* ---------- chat ---------- */
.chat-page { display: flex; flex-direction: column; min-height: calc(100dvh - var(--top-h) - var(--tab-h) - 16px - env(safe-area-inset-bottom)); }
.chat-page .page-head { margin-bottom: 4px; }
.chat-list { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 4px 0 12px; }
.chat-empty { margin: auto; padding: 30px 12px; text-align: center; color: var(--muted); max-width: 340px; }
.chat-empty .icon { width: 42px; height: 42px; color: var(--muted-2); margin: 0 auto 8px; display: block; }
.chat-empty .spinner { margin: 0 auto; }
.chat-earlier { text-align: center; margin-bottom: 4px; }
.chat-day { text-align: center; margin: 10px 0 6px; }
.chat-day span { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #e3e8f0; color: var(--muted); font-size: 12px; font-weight: 650; }
.msg { display: flex; flex-direction: column; max-width: min(82%, 540px); margin-top: 2px; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; align-items: flex-start; }
.msg .bubble { padding: 9px 13px; border-radius: 18px; line-height: 1.45; overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.msg.theirs .bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg .txt { white-space: pre-wrap; }
.msg .mmeta { margin: 2px 6px 0; font-size: 11.5px; color: var(--muted); }
.msg .mtag { display: flex; align-items: center; gap: 4px; margin: 0 6px 3px; font-size: 12px; font-weight: 700; color: #b45309; }
/* A quota ask or answer: a small card, the same on both sides. */
.msg.k-quota .bubble, .msg.k-quota-answer .bubble { background: #fff; color: var(--text); border: 1px solid var(--line); min-width: 220px; }
.msg.mine.k-quota .bubble { border-color: var(--blue-100); }
.qb .qh { display: flex; align-items: center; gap: 6px; }
.qb .qh .icon { color: var(--blue); }
.qb.answer .qh .icon { color: var(--green); }
.qb.answer.no .qh .icon { color: #b45309; }
.qb .qd { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.qb .qn { margin-top: 4px; font-size: 13.5px; font-style: italic; }
.qb .qs { margin-top: 6px; }
.qb .qacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 200px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.voice .vplay { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .22); }
.msg.theirs .voice .vplay { background: var(--blue-50); color: var(--blue); }
.voice .vplay .icon { width: 18px; height: 18px; }
.voice .vbar { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.msg.theirs .voice .vbar { background: var(--line); }
.voice .vbar i { display: block; width: 0; height: 100%; background: currentColor; transition: width .25s linear; }
.msg.theirs .voice .vbar i { background: var(--blue); }
.voice .vtime { min-width: 36px; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.voice.expired { min-width: 0; gap: 6px; cursor: default; font-size: 13.5px; opacity: .85; }
/* The writing bar stays at the bottom of the screen, just above the tab bar. */
.chat-compose { position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index: 5; padding: 8px 0; background: var(--bg); }
.chat-compose .cq { margin-bottom: 8px; }
.chat-compose .cq .chip { display: inline-flex; align-items: center; gap: 6px; color: var(--blue-700); border-color: var(--blue-100); background: #fff; }
.cbar { display: flex; align-items: flex-end; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.cbar .ctext { flex: 1; min-width: 0; max-height: 132px; padding: 9px 4px; border: 0; outline: 0; resize: none; background: transparent; font: inherit; line-height: 1.4; }
.cbtn { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--text); cursor: pointer; }
.cbtn .icon { width: 21px; height: 21px; }
.cbtn.send { background: var(--blue); color: #fff; }
.cbtn.mic { background: var(--blue-50); color: var(--blue); }
.cbtn.ghost { background: transparent; color: var(--muted); }
.cbtn.ghost:hover:not(:disabled) { background: var(--line-2); color: var(--text); }
/* A photo: the picture is the bubble, a thin frame around it; a tap opens it full screen. */
.msg.k-photo .bubble { padding: 3px; }
.cphoto { display: block; padding: 0; border: 0; background: none; line-height: 0; cursor: zoom-in; }
.cphoto img { display: block; width: min(240px, 62vw); height: auto; max-height: 340px; object-fit: cover; border-radius: 15px; background: var(--line-2); }
.cbtn:disabled { opacity: .6; cursor: default; }
.cbtn[hidden] { display: none; }
.cbtn .spinner { width: 18px; height: 18px; border-width: 2.5px; }
.cbar.rec { padding-left: 5px; }
.crec { flex: 1; display: flex; align-items: center; gap: 10px; height: 42px; color: var(--red); }
.crec b { font-variant-numeric: tabular-nums; }
.crec span:last-child { color: var(--muted); font-weight: 600; font-size: 14px; }
.rdot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); animation: rec-pulse 1s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: .25; } }
.cfail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 8px 6px 12px; border-radius: 12px; background: var(--red-50); color: #b91c1c; font-size: 14px; font-weight: 650; }
.cfail .btn.secondary { margin-left: auto; }
/* Admins: conversations on the left, the open one on the right; a phone shows one at a time. */
.bc-voice-row { margin-top: 2px; }
.bc-voice { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; border: 1px solid var(--line); border-radius: 14px; }
.bc-voice .voice { flex: 1; min-width: 0; }
.bc-voice .voice .vplay { background: var(--blue-50); color: var(--blue); }
.bc-voice .voice .vbar { background: var(--line); }
.bc-voice .voice .vbar i { background: var(--blue); }
.chat-alerts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; padding: 10px 14px; font-size: 14px; }
.chat-split { display: grid; gap: 14px; }
.conv-list { padding: 6px; }
.conv-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; }
.conv-row:hover { background: var(--line-2); }
.conv-row.on { background: var(--blue-50); }
/* The space is kept on every row so the names line up; it fills red on unread ones only. */
.conv-row .udot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.conv-row.unread .udot { background: var(--red); }
.conv-row .cmain { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-row .cprev { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-row.unread .cmain b { font-weight: 850; }
.conv-row.unread .cprev { color: var(--text); font-weight: 600; }
.conv-row .cside { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.conv-row .ctime { font-size: 11.5px; color: var(--muted); }
.conv-row .badge-dot { position: static; }
.conv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.conv-head b { font-size: 17px; }
@media (max-width: 959px) {
  .chat-split.has-open .conv-col { display: none; }
  .chat-split:not(.has-open) .conv-pane { display: none; }
  /* no strip of page under the writing bar: it meets the tab bar */
  .view:has(> .chat-page), .view:has(.chat-split.has-open) { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
}
@media (min-width: 960px) {
  .chat-split { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
  .conv-col { position: sticky; top: calc(var(--top-h) + 12px); max-height: calc(100vh - var(--top-h) - 24px); overflow: auto; }
  .conv-head .back { display: none; }
  .chat-compose { bottom: 0; }
  .chat-page { min-height: calc(100vh - var(--top-h) - 160px); }
  /* On a computer the open conversation is a panel of its own, as in a desktop chat app:
     the messages scroll inside it, the page title and the list stay put. */
  .chat-page.staff { height: calc(100vh - var(--top-h) - 190px); min-height: 440px; }
  .chat-page.staff .chat-list { min-height: 0; overflow-y: auto; padding-right: 6px; }
  .chat-page.staff .chat-compose { position: static; }
}

/* Admin tools above the writing bar: the bank-account picture (any screen) and the
   calculator (a computer only: a wide screen with a mouse — phones never show it). */
.chat-compose .cq { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-compose .cq .chip.on { background: var(--blue-50); border-color: var(--blue); }
.chat-compose .cq .calc-chip, .calc { display: none; }
@media (min-width: 960px) and (pointer: fine) {
  .chat-page.staff .chat-compose { position: relative; }
  .chat-page.staff .chat-compose .cq .calc-chip { display: inline-flex; }
  .chat-page.staff .calc:not([hidden]) { display: block; }
  .conv-pane { container-type: inline-size; }
}
/* While it is open the messages make room for it, when the panel is wide enough to spare it;
   on a narrower one it floats over them and can be closed. */
@container (min-width: 600px) { .chat-page.staff.calc-open .chat-list { padding-right: 226px; } }
.calc { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 6; width: 212px; padding: 6px 8px 8px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); }
.calc:focus { outline: none; }
.calc-top { display: flex; align-items: center; justify-content: space-between; padding: 0 0 4px 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.calc-x { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.calc-x:hover { background: var(--line-2); color: var(--text); }
.calc-x .icon { width: 15px; height: 15px; }
/* A long sum keeps its end in view: the overflow goes off the left. */
.calc-screen { margin-bottom: 6px; padding: 5px 10px; border-radius: 10px; background: var(--line-2); font-variant-numeric: tabular-nums; }
.calc-expr, .calc-val { display: flex; justify-content: flex-end; overflow: hidden; white-space: nowrap; }
.calc-expr { min-height: 18px; font-size: 12.5px; color: var(--muted); }
.calc-val { font-size: 23px; font-weight: 800; line-height: 1.25; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.ck { height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 15px; font-weight: 700; line-height: 1; color: var(--text); cursor: pointer; }
.ck:hover { background: var(--line-2); }
.ck:active { transform: translateY(1px); }
.ck.op { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); }
.ck.fn { color: var(--muted); }
.ck.eq { grid-row: span 2; height: auto; background: var(--blue); border-color: var(--blue); color: #fff; }
.ck.eq:hover { background: var(--blue-700); }
.ck.zero { grid-column: span 2; }
.calc-put { width: 100%; margin-top: 6px; }
/* The bank-account box. */
.bank-img { display: block; width: 100%; max-height: 52vh; object-fit: contain; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--line-2); }
.bank-empty { display: grid; place-items: center; gap: 8px; min-height: 140px; padding: 22px 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.bank-empty .icon { width: 36px; height: 36px; color: var(--muted-2); }
.bank-acts { flex-wrap: wrap; }
@media (max-width: 639px) { .bank-acts #bankChange { flex-basis: 100%; } }

/* "Too many photos": solid red, the one message on this page that must not be missed. */
.alert.alarm { background: var(--red); border: 1px solid #b91c1c; color: #fff; box-shadow: 0 0 0 3px var(--red-100); }
.alert.alarm .icon { color: #fff; }
.modal.alarm { text-align: center; border-top: 6px solid var(--red); }
.modal.alarm .alarm-icon { width: 64px; height: 64px; margin: 4px auto 12px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; }
.modal.alarm .alarm-icon .icon { width: 34px; height: 34px; stroke-width: 2.5; }
.modal.alarm h2 { color: #b91c1c; }
.modal.alarm p { color: #7f1d1d; font-size: 16px; }
.btn.alarm { background: var(--red); color: #fff; }
.btn.alarm:hover:not(:disabled) { background: #b91c1c; }

/* ---------- staff queue ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters .input { min-height: 40px; width: auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 650; color: var(--muted); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip.warn.active { background: #b91c1c; border-color: #b91c1c; }
.queue-layout { display: grid; gap: 14px; }
.queue-layout > * { min-width: 0; }
@media (min-width: 1100px) { .queue-layout.with-detail { grid-template-columns: minmax(470px, 1.1fr) minmax(380px, 1fr); align-items: start; } .queue-layout .detail { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top) + 16px); } }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 750; text-transform: uppercase; letter-spacing: .04em; padding: 12px 12px; background: var(--slate-50, #f8fafc); border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap; }
.tbl td:last-child { white-space: normal; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover { background: var(--line-2); }
.tbl tr.selected { background: var(--blue-50); }
.tbl tr.lowrow td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.tbl .thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; background: var(--line-2); border: 1px solid var(--line); }
.tbl input[type=checkbox] { width: 18px; height: 18px; }
/* Phones: the same rows as a two-line list instead of a sideways-scrolling table. */
@media (max-width: 639px) {
  .tbl, .tbl tbody { display: block; }
  .tbl thead { display: none; }
  .tbl tr { display: grid; grid-template-columns: auto auto 1fr auto; grid-template-areas: "cb thumb id score" "cb thumb who status"; column-gap: 10px; row-gap: 3px; align-items: center; padding: 9px 6px; border-bottom: 1px solid var(--line-2); }
  .tbl tr.lowrow { box-shadow: inset 3px 0 0 var(--red); }
  .tbl tr.lowrow td:first-child { box-shadow: none; }
  .tbl td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; }
  .tbl td:nth-child(1) { grid-area: cb; }
  .tbl td:nth-child(2) { grid-area: thumb; }
  .tbl td:nth-child(3) { grid-area: id; }
  .tbl td:nth-child(3) .small { white-space: normal; }        /* long "for <day>" lines wrap instead of running under the vehicle */
  .tbl td:nth-child(4) { grid-area: who; font-size: 13px; color: var(--muted); }
  .tbl td:nth-child(4) .row { display: flex; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tbl td:nth-child(5) { grid-area: score; text-align: right; }
  .tbl td:nth-child(6) { grid-area: status; justify-self: end; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
  .tbl td:nth-child(3) b.mono { white-space: nowrap; }   /* a booking id never breaks at its hyphen; "for <day>" may */
  .tbl td:nth-child(6) .pill { font-size: 11.5px; padding: 3px 8px; }
  .tbl td[colspan] { grid-column: 1 / -1; }
  .tbl .thumb { width: 50px; height: 38px; }
  .kbd-hint { display: none; }
  .filters .input[type=date] { flex: 1; }
  .filters #qSearch { width: 100% !important; }
}
.score { font-weight: 800; font-variant-numeric: tabular-nums; }
.score.low { color: #b91c1c; }
.score.ok { color: #15803d; }
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--navy); color: #fff; border-radius: 12px; margin-bottom: 12px; }
.bulkbar .btn { min-height: 38px; }
/* More quota: the broker's form and the staff's requests card on the dashboard. */
.req-form { margin-top: 14px; }
.req-form h2 { margin-bottom: 2px; }
.req-form .deadline-rule { margin: 4px 0 12px; }
.field > span.stepper { display: flex; align-items: center; gap: 8px; margin: 0; font-size: inherit; font-weight: 400; }
.stepper .btn { width: 48px; padding: 0; font-size: 22px; }
.stepper .input.num { font-size: 18px; }
.req-item .reply { color: var(--text); }
/* A card the broker took back: still listed, crossed out and greyed, out of the quota. */
/* Deleted by the broker: kept, greyed and crossed out, at the bottom of its list. The note
   naming the card that took its place stays readable. */
.pill.deleted { background: #f1f5f9; color: #64748b; }
.list-row.sub.is-deleted .thumb, .list-row.sub.is-deleted .main > b, .list-row.sub.is-deleted .meta { opacity: .5; }
.list-row.sub.is-deleted .main > b, .list-row.sub.is-deleted .meta { text-decoration: line-through; }
.tbl tr.deleted td { opacity: .6; }
.tbl tr.deleted b.mono, .tbl tr.deleted td > .small { text-decoration: line-through; }
.list-row.sub .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.btn.del { background: #fff; color: #b91c1c; border: 1px solid #fca5a5; }
.btn.del:hover { background: #fef2f2; }
.link-note { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: #64748b; }
.link-note.new { color: var(--blue); }
.link-note .icon { width: 13px; height: 13px; flex: none; }
.link-note .id { white-space: nowrap; }
/* The smallest phones: the status and Delete move under the text, which gets the full width. */
@media (max-width: 359px) { .list-row.sub .side { flex-direction: row; align-items: center; justify-content: flex-end; flex-basis: 100%; } }
.thumb-btn { position: relative; flex: none; padding: 0; border: 0; background: none; border-radius: 8px; cursor: zoom-in; line-height: 0; }
.thumb-btn .zoom-hint { position: absolute; right: -6px; bottom: -6px; width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(15, 23, 42, .3); }
/* The line from a deleted card to the card sent in its place (drawLinks() in app.js). */
.link-host { position: relative; }
.link-host.has-links { padding-left: calc(var(--lanes, 1) * 7px + 12px); }
.link-line { position: absolute; display: block; border: 2px solid #94a3b8; border-right: 0; border-radius: 9px 0 0 9px; pointer-events: none; }
.link-line::after { content: ''; position: absolute; right: -7px; top: -6px; border: 5px solid transparent; border-left: 7px solid #94a3b8; border-right: 0; }
.link-line.down::after { top: auto; bottom: -6px; }
/* The broker's photo, full screen: fitted first, a tap zooms in (drag to move), × closes. */
.viewer { position: fixed; inset: 0; z-index: 80; background: #0b1120; display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px 16px; color: #cbd5e1; font-size: 14px; }
.viewer-bar b { color: #fff; font-size: 16px; }
.viewer-x { margin-left: auto; width: 46px; height: 46px; flex: none; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; display: grid; place-items: center; cursor: pointer; }
.viewer-x .icon { width: 24px; height: 24px; }
.viewer-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; overflow: hidden; }
.viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; cursor: zoom-in; }
.viewer-hint { margin: 0; text-align: center; color: #94a3b8; font-size: 13px; padding: 4px 16px calc(14px + env(safe-area-inset-bottom)); }
.viewer.zoomed .viewer-body { display: block; overflow: auto; }
.viewer.zoomed .viewer-body img { max-width: none; max-height: none; width: 250%; cursor: zoom-out; }
/* A waiting request's cancel button goes to its own line when the row is narrow: in Burmese
   it is long enough to squeeze the date and the ask into a one-word column beside it. */
.req-item { flex-wrap: wrap; }
.req-item .main { flex: 1 1 150px; }
.req-item [data-action="req-cancel"] { margin-left: auto; }
.list-row .main b.inline { display: inline; }
.req-card { margin-bottom: 14px; border: 1px solid #bfdbfe; }
.req-card h2 .pill { vertical-align: 2px; }
.req-row { flex-wrap: wrap; }
.req-row .req-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.stepper .of { margin-left: 4px; white-space: nowrap; }
.req-row.late .main { opacity: .7; }
.req-row .late-note { color: #b45309; }
@media (max-width: 640px) {
  .req-row .req-actions { width: 100%; }
  .req-row .req-actions .btn { flex: 1 1 0; min-height: 42px; }
  .req-row .req-actions .btn.success { flex-basis: 100%; }
  .req-row .req-actions .btn.ghost { border-color: var(--line); }
}
/* "Use it like an app": the broker's home screen icon. */
.install-card { display: flex; align-items: flex-start; gap: 12px; border: 1px solid #bfdbfe; background: #eff6ff; margin-bottom: 14px; }
.install-card .ic-icon { color: var(--blue); flex: none; margin-top: 2px; }
.install-card .ic-main { flex: 1; min-width: 0; }
.install-card .ic-main p { margin: 4px 0 0; }
.install-card .ic-main .btn { margin-top: 10px; }
.install-card .icon-btn { flex: none; margin: -6px -6px 0 0; }
.install-card .ios-share { display: inline-flex; vertical-align: -3px; color: var(--blue); }
.install-under:empty { display: none; }
.install-under { width: min(420px, 100%); }
.install-under .install-card { margin: 14px 0 0; }
.detail .dhead { margin-bottom: 10px; }
/* Phones and tablets: an opened card is a sheet over the list (owner, 2026-11-01). It used
   to sit under the whole list, and opening one scrolled the page all the way down to it;
   now the list stays put underneath and ✕ goes back to the same place. The booking number,
   ‹ › and ✕ stay at the top while the sheet scrolls. Above the bars, below dialogs (50). */
@media (max-width: 1099px) {
  .queue-layout.with-detail .detail { position: fixed; inset: 0; z-index: 45; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: #fff; }
  .queue-layout.with-detail .detail > .card { min-height: 100%; padding: 0 16px calc(20px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; box-shadow: none; }
  .queue-layout.with-detail .detail .dhead { position: sticky; top: 0; z-index: 3; margin: 0 -16px 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: #fff; border-bottom: 1px solid var(--line-2); }
}
.detail .photo { border-radius: 12px; overflow: hidden; background: #0f172a; position: relative; }
.detail .photo img { width: 100%; max-height: 70vh; object-fit: contain; margin: 0 auto; transition: transform .2s; cursor: zoom-in; }
.detail .photo img.zoomed { max-height: none; cursor: zoom-out; }
.detail .photo .tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.detail .photo .tools .btn { min-height: 34px; padding: 0 10px; background: rgba(255, 255, 255, .92); }
.detail .meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; margin-top: 14px; font-size: 14px; }
.detail .meta .lbl { color: var(--muted); font-size: 12px; display: block; }
.detail .meta b { font-size: 15px; }
.detail .act { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
/* Two columns that may shrink, labels that may wrap: on a phone the Thai labels are
   wider than half the card, and 1fr columns grew past its edge instead. */
.detail .act .btn { min-width: 0; white-space: normal; text-align: center; line-height: 1.25; padding: 6px 10px; }
.detail .act .btn.wide { grid-column: 1 / -1; }
.timeline { margin-top: 14px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.timeline .ev { display: flex; gap: 10px; padding: 6px 0; font-size: 13.5px; }
.timeline .ev time { color: var(--muted); white-space: nowrap; font-size: 12.5px; width: 92px; flex: none; }
.timeline .ev .msg { color: var(--muted); }
.nav-pair { display: flex; gap: 8px; }
.detail .veh-line { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail .linkish { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.nav-pair .btn { flex: 1; }
.reason-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.reason-chips .chip { padding: 9px 14px; font-size: 14px; }
.reason-chips .chip.active { background: var(--amber); border-color: var(--amber); }

/* ---------- brokers & calendar ---------- */
#brokerList { display: grid; grid-template-columns: 1fr; column-gap: 24px; }
@media (min-width: 760px) {
  #brokerList { grid-template-columns: 1fr 1fr; }
  #brokerList .broker-row:nth-child(2) { border-top: 0; }   /* top of the second column */
}
.broker-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-2); min-width: 0; }
.broker-row:first-child { border-top: 0; }
.broker-row > div { min-width: 0; }
.broker-row b { overflow-wrap: anywhere; }
.broker-row .usage { min-width: 120px; }
.broker-row .usage .progress { margin-top: 4px; height: 7px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-head h2 { min-width: 160px; text-align: center; }
.cal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
@media (min-width: 640px) { .calendar { gap: 6px; } }
.cal-dow { text-align: center; font-size: 11.5px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 4px 0; }
.cal-day { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 4px 3px; min-height: 62px; min-width: 0; cursor: pointer; transition: box-shadow .15s; }
.cal-day .tot { margin-top: 2px; display: flex; flex-direction: column; gap: 1px; font-variant-numeric: tabular-nums; line-height: 1.3; letter-spacing: -.01em; }
.cal-day .tot .n { font-size: 10.5px; font-weight: 800; color: var(--blue-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day .tot .q { font-size: 10px; font-weight: 650; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day .tot .n.long, .cal-day .tot .q.long, .cal-day .tot .n.mid, .cal-day .tot .q.mid { display: none; }
.cal-day .tot .n.tiny { font-size: 13px; }
.cal-day .tot .q.tiny { font-size: 12px; }
.cal-legend-phone { margin-top: 8px; }
.cal-day .tot.closed { font-size: 10.5px; color: var(--muted); font-weight: 700; }
@media (min-width: 640px) {
  .cal-day { padding: 6px 8px; min-height: 76px; border-radius: 10px; }
  .cal-day .tot { letter-spacing: 0; }
  .cal-day .tot .n { font-size: 12px; }
  .cal-day .tot .q { font-size: 11.5px; }
  .cal-day .tot .n.mid, .cal-day .tot .q.mid { display: block; }
  .cal-day .tot .n.tiny, .cal-day .tot .q.tiny { display: none; }
  .cal-day .tot.closed { font-size: 12px; }
  .cal-legend-phone { display: none; }
}
/* The full wording only once a day cell is wide enough to hold it; narrower screens
   get the same two numbers with the unit word dropped. */
@media (min-width: 1040px) {
  .cal-day .tot .n { font-size: 13px; }
  .cal-day .tot .q { font-size: 12.5px; }
  .cal-day .tot .n.long, .cal-day .tot .q.long { display: block; }
  .cal-day .tot .n.mid, .cal-day .tot .q.mid { display: none; }
}
.cal-day.closed { background: #f1f3f7; }
.cal-day:hover { box-shadow: 0 0 0 2px var(--blue-100); }
.cal-day.other { opacity: .35; }
.cal-day.today { border-color: var(--blue); }
.cal-day.today .d { color: var(--blue); }
.cal-day.in-week { background: var(--blue-50); }
.cal-day.past { background: #fafbfd; }
.cal-day .d { font-weight: 800; font-size: 13px; }
.cal-day .q { display: flex; align-items: center; gap: 5px; font-size: 12px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.cal-day .q .dot { width: 8px; height: 8px; }
.cal-day .q b.set { text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 2px; }
.cal-day .q .used { color: var(--muted); font-size: 11px; margin-left: auto; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; margin: 10px 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.roster-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.roster { border-collapse: separate; border-spacing: 0; font-size: 13.5px; width: 100%; }
.roster th, .roster td { padding: 3px 2px; text-align: center; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.roster th { font-size: 12px; color: var(--muted); font-weight: 750; padding: 6px 2px; }
.roster th.name, .roster td.name { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; padding-left: 0; padding-right: 8px; }
.roster td.name .nm { display: inline-block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.roster th.today, .roster td.today { background: var(--blue-50); }
.roster th.wkend, .roster td.wkend { background: #fafbfd; }
.roster th.today.wkend, .roster td.today.wkend { background: var(--blue-50); }
.roster .cell { min-width: 44px; min-height: 38px; border: 1px solid transparent; border-radius: 8px; background: transparent; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; padding: 2px 6px; }
.roster .cell:hover { border-color: var(--blue); background: #fff; }
.roster .cell b.set { text-decoration: underline; text-underline-offset: 2px; }
.roster .uq span { font-weight: 600; color: var(--muted); font-size: .85em; }
.roster .cell.full .uq { color: #b91c1c; }
@media (max-width: 639px) { .roster { font-size: 12.5px; } .roster .cell { min-width: 36px; min-height: 36px; padding: 2px 3px; } .roster td.name .nm { max-width: 96px; } }
/* Phones: the table runs to the card's edges. The left gutter sits INSIDE the sticky name
   column, not as padding on the scroller — sticky cells stop at the padding edge, so days
   scrolled past showed through an 18px strip to the left of the names. */
.month-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -18px; padding: 0 18px 0 0; }
.roster.month th, .roster.month td { min-width: 28px; padding: 3px 1px; font-size: 12.5px; }
.roster.month th.name, .roster.month td.name { box-shadow: 2px 0 0 var(--line-2); padding-left: 18px; }
.roster.month th.day { font-size: 11px; line-height: 1.1; padding: 5px 1px 4px; }
.roster.month th .wd { display: block; font-size: 9px; color: var(--muted-2); font-weight: 650; margin-bottom: 2px; }
.roster.month th.day.today { background: var(--blue); color: #fff; border-radius: 6px; }
.roster.month th.day.today .wd { color: #dbeafe; }
.roster.month td.has { background: var(--blue-50); }
.roster.month td.full { background: var(--blue-100); }
.roster.month td.off { background: #f1f3f7; }
.roster.month td.today { box-shadow: inset 1px 0 0 var(--blue), inset -1px 0 0 var(--blue); }
.roster.month .cell { width: 100%; min-width: 28px; min-height: 30px; padding: 0; border-radius: 6px; color: var(--blue-700); font-weight: 800; font-size: 13px; }
.roster.month td.full .cell { color: #1e3a8a; }
.roster.month td.total { font-size: 12.5px; }
.roster.month th.total { min-width: 40px; }
.roster.month td.name .nm { max-width: 84px; font-size: 12.5px; font-weight: 650; }
@media (min-width: 640px) { .roster.month td.name .nm { max-width: 150px; } .month-scroll { margin: 0; padding: 0; } .roster.month th.name, .roster.month td.name { padding-left: 1px; } }
.roster .cell b.off { color: var(--muted); opacity: .55; font-weight: 500; }
.roster .cell small { font-size: 10px; color: var(--muted); font-weight: 600; }
.roster .cell.full b { color: #b91c1c; }
.roster .cell.some b.uq { color: #15803d; }   /* sent some of the day's quota, not all */
.roster td.total { font-weight: 800; }
.roster tr.foot td { border-top: 2px solid var(--line); border-bottom: 0; }
/* The week roster's totals — the right-hand column and the bottom row — on a wash of red
   so the weekly figures separate from the per-day cells. Scoped to that one table by id:
   the month and day tables have total rows of their own and stay neutral. */
#weekTable th.total, #weekTable td.total { background: rgba(220, 38, 38, .07); }
#weekTable tr.foot td { background: rgba(220, 38, 38, .07); }
/* The name column is sticky, so it needs an OPAQUE colour or the cells scrolling
   underneath show through it: this is the same wash flattened onto white. */
#weekTable tr.foot td.name { background: #fdf0f0; }
#weekTable tr.foot td.total { background: rgba(220, 38, 38, .14); }
.day-editor .brow { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); }
.day-editor .brow:first-child { border-top: 0; }
.day-editor .brow .input { min-height: 42px; }
.day-editor .brow .who { min-width: 0; }
.day-editor .std { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 2px; }
.day-editor .linkish { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.day-editor .linkish .icon.sm { width: 13px; height: 13px; }
/* Text-sized buttons get a finger-sized hit area without moving anything. */
.detail .linkish, .day-editor .linkish { position: relative; }
.detail .linkish::after, .day-editor .linkish::after { content: ''; position: absolute; inset: -9px -8px; }
.day-editor .brow .input.num { width: 84px; }
.day-editor .chip .dot { margin-right: 6px; }
.wday .q b.off { color: var(--muted); opacity: .55; font-weight: 500; }
.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-row button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.color-row button.active { box-shadow: 0 0 0 2px var(--text); }

/* ---------- settings ---------- */
.setting { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-2); }
.setting:first-of-type { border-top: 0; }
.setting .desc b { display: block; }
.setting .desc span { font-size: 13px; color: var(--muted); }
.switch { position: relative; width: 50px; height: 30px; border-radius: 15px; background: #cbd5e1; border: 0; flex: none; transition: .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch.on { background: var(--green); }
.switch.on::after { left: 23px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 8px 12px; font-weight: 650; font-size: 13.5px; color: var(--muted); }
.seg button.active { background: var(--navy); color: #fff; }

.zoom-overlay { position: fixed; inset: 0; z-index: 70; background: #000; display: grid; place-items: center; overflow: auto; }
.zoom-overlay img { max-width: none; width: auto; height: auto; transform-origin: center; }
.zoom-overlay .close { position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 14px; }

/* ---------- dashboard: next 7 days ---------- */
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(152px, 1fr)); gap: 10px; margin-top: 14px; overflow-x: auto; padding-bottom: 6px; }
.wday { border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; cursor: pointer; min-width: 152px; background: #fff; transition: box-shadow .15s; }
.wday:hover { box-shadow: 0 0 0 2px var(--blue-100); }
.wday.today { border-color: var(--blue); background: var(--blue-50); }
.wday.past { opacity: .55; }
.wday .d { font-weight: 800; font-size: 15px; margin-bottom: 7px; }
.wday .sum { display: flex; align-items: baseline; gap: 2px; flex-wrap: wrap; margin-bottom: 7px; padding-bottom: 7px; border-bottom: 1px solid var(--line-2); }
.wday .sum b { font-size: 21px; }
.wday .sum .fl { width: 100%; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.wday.full .sum b { color: #b91c1c; }
.wday .more { font-size: 12.5px; color: var(--blue); font-weight: 600; margin-top: 5px; }
.wday.today .d { color: var(--blue); }
.wday .q { display: flex; align-items: center; gap: 6px; font-size: 13.5px; padding: 3.5px 0; }
.wday .q .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.wday .q b .muted { font-weight: 600; color: var(--muted); }
.wday .q.lowq b { color: #b45309; }
.wday .q.zero b { color: #b91c1c; }

/* ---------- broker: booking day ---------- */
/* the broker's month: places left per day, tap to choose */
.bcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.bcal-day { position: relative; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-height: 52px; padding: 4px 4px 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bcal-day .d { font-size: 11px; font-weight: 700; color: var(--muted); align-self: flex-start; line-height: 1; }
.bcal-day b { font-size: 17px; line-height: 1.1; color: var(--green); font-variant-numeric: tabular-nums; }
.bcal-day b.off { color: var(--muted); font-weight: 500; }
.bcal-day.full b { color: #b91c1c; }
.bcal-day.today { border-color: var(--blue); }
.bcal-day.today .d { color: var(--blue); }
.bcal-day.selected { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-100); }
.bcal-day.selected .d, .bcal-day.selected b, .bcal-day.selected b.off { color: #fff; }
.bcal-day:disabled { background: #f3f5f9; border-color: transparent; cursor: default; opacity: .6; }
.bcal-day.other { visibility: hidden; }
.bcal-day b.uq { font-size: 15px; }
.bcal-day b.uq span { font-size: 11px; color: var(--muted); font-weight: 600; }
.bcal-day.past b, .bcal-day.past b.uq span { color: var(--muted); }
.bcal-day.selected b.uq span { color: rgba(255,255,255,.8); }
.wd-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
/* On = light blue and solid. Off = white, greyed and struck through in red, so the two
   states read at a glance instead of differing only in shade. */
.wd-row button { position: relative; min-width: 44px; min-height: 38px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.wd-row button::after {
  content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; border-radius: 2px;
  background: var(--red); transform: translateY(-50%) rotate(-12deg); opacity: .9;
}
.wd-row button.active { background: var(--blue-50); border-color: var(--blue); color: var(--blue-700); box-shadow: inset 0 0 0 1px var(--blue); }
.wd-row button.active::after { display: none; }
/* The weekly quota rows in the broker dialog. "taken" = that day belongs to another row:
   grey, not struck — it is not a day off. */
.wk-row + .wk-row { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.wk-top { display: flex; align-items: center; gap: 8px; }
.wk-top .icon-btn { margin-left: auto; }
.wd-row button.taken { background: #f1f5f9; border-color: #e2e8f0; color: var(--muted-2); font-weight: 600; }
.wd-row button.taken::after { display: none; }
.wk-add { margin-top: 10px; max-width: 100%; white-space: normal; text-align: left; line-height: 1.3; padding-top: 6px; padding-bottom: 6px; }   /* long in Burmese */
.wk-err { margin: 10px 0 0; }
.notice-card { margin-top: 14px; background: #fffbeb; border-color: #fde68a; }
.notice-card h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; color: #92400e; }
.notice-card h2 .icon { width: 18px; height: 18px; }
.notice-card p { margin-top: 6px; line-height: 1.55; white-space: normal; }
textarea.input { min-height: 72px; resize: vertical; font: inherit; line-height: 1.45; padding: 10px 12px; }
.locked-card { text-align: center; color: var(--muted); padding: 22px 16px; margin-top: 14px; }
.locked-card .icon { width: 28px; height: 28px; margin: 0 auto 8px; display: block; }
.daybar { display: flex; align-items: stretch; gap: 8px; }
.daybar .btn { min-width: 48px; padding: 0; }
.daypick { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; position: relative; text-align: center; }
.daypick .d { font-weight: 800; font-size: 15px; line-height: 1.25; }
.daypick .tag { font-size: 12px; color: var(--blue); font-weight: 700; }
.daypick input[type=date] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* ---------- submit: the virtual card ---------- */
.vcard { max-width: 300px; margin: 0 auto 4px; cursor: pointer; }
.vcard svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 14px rgba(224, 120, 154, .18)); }
.vcard:active svg { transform: scale(.985); }
.dropzone { padding: 22px 16px 18px; }

/* ---------- purged photos ---------- */
.thumb.purged { display: grid; place-items: center; color: var(--muted-2); }
.detail .photo.purged-box { display: grid; place-items: center; gap: 8px; padding: 36px 20px; color: #cbd5e1; text-align: center; min-height: 200px; }
.detail .photo.purged-box .icon { width: 40px; height: 40px; }
.detail .photo.purged-box p { color: #cbd5e1; font-size: 14px; }

/* ---------- push card ---------- */
.push-card .icon { color: var(--green); }
.push-card .btn .icon { color: inherit; }   /* the green is for the "on" tick, not the button's icon */

/* ---------- staff: day ---------- */
.daily-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* ‹ date › stay on one line however narrow the phone (the date box gives way); the two
   quick chips move as a pair, to the right, or onto the next line. */
.daily-bar .input[type=date] { width: auto; min-height: 38px; flex: 1 1 110px; min-width: 0; max-width: 220px; }
.daily-quick { display: flex; gap: 8px; margin-left: auto; }
.daily-date { margin-top: 14px; }
.daily-deadline { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13.5px; font-weight: 650; }
.daily-deadline.open { color: var(--green); }
.daily-deadline.closed { color: var(--muted); }
.grid.tiles { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; margin-top: 14px; }
.grid.tiles .stat-card { padding: 12px 13px; }
.grid.tiles .stat-card .label { display: flex; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.grid.tiles .stat-card .value { font-size: 26px; }
.stat-card .value small { font-size: 14px; font-weight: 650; color: var(--muted); margin-left: 2px; }
.roster.daily th { white-space: nowrap; }
.roster.daily th .icon { vertical-align: -3px; margin-right: 4px; }
.roster.daily td { padding: 9px 8px; font-size: 14px; }
.roster.daily td small { color: var(--muted); font-weight: 600; font-size: 12px; }
.roster.daily td .zero { color: var(--muted-2); }
.roster.daily td.full b { color: #b91c1c; }
.roster.daily td.warn { color: #b45309; font-weight: 800; }
.roster.daily tr.clickable { cursor: pointer; }
.roster.daily tr.clickable:hover td { background: var(--blue-50); }
.roster.daily tr.foot td { background: #f8fafc; }
/* A broker opened in place: their cards, with the card list's own actions. */
.roster.daily .chev { display: inline-flex; color: var(--muted); }
.roster.daily .chev .icon { width: 16px; height: 16px; transition: transform .15s; }
.roster.daily tr.open .chev .icon { transform: rotate(90deg); }   /* the same arrow, pointing down when open */
.roster.daily tr.open td { background: var(--blue-50); }
.roster.daily tr.dcards-row > td { padding: 0 0 12px; text-align: left; white-space: normal; background: var(--blue-50); }
.dcards { position: sticky; left: 0; width: var(--dw, 100%); box-sizing: border-box; padding: 4px 6px 0; display: grid; gap: 8px; }
.dcard { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.dcard .thumb { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--line-2); border: 1px solid var(--line); flex: none; display: grid; place-items: center; color: var(--muted); }
.dcard .dmain { flex: 1 1 170px; min-width: 0; }
.dcard .dtags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; font-size: 13px; }
.dcard .dact { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.dcard.is-deleted .thumb, .dcard.is-deleted .dmain { opacity: .5; }
.dcard.is-deleted .dmain > b { text-decoration: line-through; }
.dcards-foot { display: flex; justify-content: flex-end; }
.dcards-head { display: flex; justify-content: flex-start; }
@media (max-width: 600px) { .dcard .dact { flex-basis: 100%; justify-content: flex-start; } }
