/* Drishti Hospital — calm, clean, phone-first. No external fonts. */
:root {
  --bg: #f6f8f9;
  --surface: #ffffff;
  --surface-2: #eef3f5;
  --text: #14232b;
  --muted: #5b6b73;
  --line: #dbe3e7;
  --accent: #0b6e8a;
  --accent-strong: #08566c;
  --accent-soft: #e3f1f5;
  --on-accent: #ffffff;
  --topbar: #0b6e8a;
  --on-topbar: #ffffff;
  --ok: #18794e;
  --ok-soft: #e4f4ec;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --info: #0b6e8a;
  --info-soft: #e3f1f5;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 50, .06), 0 2px 8px rgba(16, 40, 50, .05);
  --tap: 48px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

/* Light theme only (Zuhaib, 24 Nov 2026). Dark mode may come later. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .95rem; color: var(--muted); font-weight: 600; margin-top: .8em; }
p { margin: .3em 0; }
a { color: var(--accent); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); padding: 10px; border-radius: var(--radius-sm); overflow-x: auto; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

.app { min-height: 100vh; }
.boot, .loading { padding: 24px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.grow { flex: 1; min-width: 0; }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-danger { color: var(--danger); }
.spacer { display: inline-block; min-width: 1px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--topbar); color: var(--on-topbar);
}
.topbar-title { flex: 1; font-size: 1.1rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; border: 0; border-radius: 12px;
  background: transparent; color: inherit; font-size: 1.8rem; line-height: 1; text-decoration: none; cursor: pointer;
}
.topbar .icon-btn:active { background: rgba(255, 255, 255, .15); }
.topbar-user {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .15); color: inherit; font-weight: 700; cursor: pointer;
}
.user-menu {
  position: absolute; right: 10px; top: calc(100% + 6px); width: min(280px, calc(100vw - 20px));
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18); padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.user-name { font-weight: 700; margin: 0; }

/* ---------- Layout ---------- */
.view { max-width: 760px; margin: 0 auto; padding: 14px 12px 80px; outline: none; }
.screen-body > * + * { margin-top: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.card > * + * { margin-top: 10px; }
.card > .row-between + *, .card > h3 + * { margin-top: 8px; }
.section-title { margin: 18px 2px 4px; color: var(--muted); font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; }
.list { display: flex; flex-direction: column; gap: 8px; }
.card .list { gap: 0; }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.card .list-row:last-child { border-bottom: 0; }
.list > .card.list-row, .list-row.card { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.link-row { color: inherit; text-decoration: none; }
.link-row:active { background: var(--surface-2); }
.is-void { opacity: .55; }
.is-void strong { text-decoration: line-through; }
.row-between { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-grid > .btn { width: 100%; }
.empty { color: var(--muted); text-align: center; padding: 14px 8px; margin: 0; }
.list-sub { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 2px; }
ul.plain { list-style: none; padding: 0; margin: 4px 0; }
ul.plain li { padding: 2px 0; }
ol.steps { padding-left: 1.3em; }
ol.steps li { margin: 6px 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px); background: var(--surface-2); }
.btn:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tile:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:active { background: var(--accent-strong); }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn-sm { min-height: 40px; padding: 6px 12px; font-size: .9rem; }
.btn-lg { min-height: 56px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.is-busy { position: relative; color: transparent !important; }
.is-busy::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--muted); border-top-color: transparent; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-weight: 600; font-size: .95rem; }
.hint { color: var(--muted); font-size: .85rem; margin: 0; }
input[type=text], input[type=tel], input[type=number], input[type=password], input[type=search], input[type=date], input[type=month], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
}
textarea { min-height: 72px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input.qty { width: 84px; min-width: 0; text-align: right; }
input[disabled] { background: var(--surface-2); }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; }
.form > * + * { margin-top: 12px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; }
.file-input { font: inherit; padding: 8px 0; max-width: 100%; }
.inline-fields { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mini { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-size: .95rem; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }

details > summary { cursor: pointer; }
.summary-btn { list-style: none; font-weight: 700; color: var(--accent); min-height: 32px; display: flex; align-items: center; }
.summary-btn::-webkit-details-marker { display: none; }
details[open] > .summary-btn { margin-bottom: 8px; }
.quick-add { border-top: 1px dashed var(--line); padding-top: 8px; }
.quick-add > summary { color: var(--accent); font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.quick-add > * + * { margin-top: 10px; }

/* ---------- Pickers ---------- */
.picker { display: flex; flex-direction: column; gap: 8px; }
.picker-title { font-weight: 600; margin: 0; }
.picked { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pill { background: var(--accent-soft); color: var(--accent-strong); padding: 6px 12px; border-radius: 999px; font-weight: 600; }
.pick-results { display: flex; flex-direction: column; }
.pick-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  width: 100%; min-height: 48px; padding: 10px 6px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.pick-row:active { background: var(--surface-2); }
.price-row { flex-wrap: nowrap; }
.check-row input { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; }
.price-list { max-height: 55vh; overflow-y: auto; }
.sticky-total {
  position: sticky; bottom: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 -4px 16px rgba(0, 0, 0, .06); z-index: 5;
}

/* ---------- Home ---------- */
.hello h2 { font-size: 1.35rem; margin-bottom: 2px; }
.tile-group { margin-top: 18px; }
.tile-group-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 2px 8px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  min-height: 96px; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; font-weight: 600;
}
.tile:active { background: var(--accent-soft); }
.tile-icon {
  width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-strong); font-size: 1.2rem;
}
.tile-label { line-height: 1.25; }

/* ---------- Badges, banners, stats ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.banner { border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.banner-ok { background: var(--ok-soft); color: var(--ok); }
.banner-warn { background: var(--warn-soft); color: var(--warn); }
.banner-danger { background: var(--danger-soft); color: var(--danger); }
.banner-info { background: var(--info-soft); color: var(--text); }
.banner .btn { align-self: flex-start; }
.error-box { background: var(--danger-soft); color: var(--danger); padding: 14px; border-radius: var(--radius); }
.big-number { font-size: 2rem; font-weight: 800; margin: 2px 0; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  background: var(--surface-2); border-radius: var(--radius-sm); color: var(--text); text-decoration: none;
}
.stat-n { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-l { font-size: .8rem; color: var(--muted); }
.stat-link .stat-l { color: var(--accent); }
progress { width: 100%; height: 14px; border-radius: 999px; overflow: hidden; appearance: none; -webkit-appearance: none; border: 0; background: var(--surface-2); }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
progress.over::-webkit-progress-value { background: var(--danger); }
progress.over::-moz-progress-bar { background: var(--danger); }
progress.done::-webkit-progress-value { background: var(--ok); }
progress.done::-moz-progress-bar { background: var(--ok); }
.progress-box { display: flex; flex-direction: column; gap: 6px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; word-break: break-word; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tbl-num-last td:last-child, .tbl-num-last th:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl-plain thead { display: none; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Tabs, month picker ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tabs-wrap { flex-wrap: wrap; }
.tab {
  flex-shrink: 0; padding: 10px 14px; min-height: 44px; border-radius: 999px; display: inline-flex; align-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem;
}
.tab[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.month-picker { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.month-picker .btn { padding: 8px 10px; font-size: .9rem; }

/* ---------- Visits, tokens ---------- */
.visit-row .visit-main { display: flex; align-items: center; gap: 12px; }
.token-sm {
  min-width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-strong); font-weight: 800; font-size: 1.2rem; flex-shrink: 0;
}
.token-show { text-align: center; padding: 10px 0; }
.token-big { font-size: 6rem; font-weight: 900; line-height: 1; margin: 6px 0; color: var(--accent); font-variant-numeric: tabular-nums; }
.strong-link { font-weight: 700; color: var(--text); text-decoration: none; }
.patient-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.diff { font-weight: 700; font-size: 1.1rem; min-height: 1.4em; }

/* ---------- Rx ---------- */
.rx-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; }
.rx-grid { display: grid; grid-template-columns: 48px repeat(4, minmax(0, 1fr)); gap: 6px; align-items: center; }
.rx-grid input { padding: 8px 4px; text-align: center; min-width: 0; }
.rx-h { font-size: .75rem; font-weight: 700; color: var(--muted); text-align: center; }
.rx-eye { font-weight: 700; font-size: .85rem; }

/* ---------- Misc ---------- */
.pr-line { display: grid; grid-template-columns: 1fr 70px 84px; gap: 6px; }
.pr-line input.qty { width: 100%; }
.stock-row { align-items: center; }
.stock-ins, .price-ins { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.stock-ins input.qty { width: 74px; }
.price-edit { flex-wrap: wrap; }
.photo-preview .thumb { max-width: 140px; max-height: 140px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.bill-photo { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.qr-wrap { display: flex; justify-content: center; background: #fff; padding: 12px; border-radius: var(--radius); }
.qr { width: 220px; height: 220px; }
.secret { word-break: break-all; user-select: all; }
.breakdown { margin-top: 6px; }
.audit-row summary { list-style: none; }
.audit-row summary::-webkit-details-marker { display: none; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px 16px; }
.login-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 24px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
}
.login-card h1 { font-size: 1.4rem; margin: 0; }
.login-logo { width: 72px; height: 72px; border-radius: 18px; }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 100;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px;
}
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; width: 100%; max-width: 480px;
  padding: 12px 14px; border-radius: 12px; background: #14232b; color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  animation: toast-in .18s ease-out;
}
.toast-error { background: #9b1c13; }
.toast-warn { background: #7a4a00; }
.toast-icon {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .2);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem;
}
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Modal ---------- */
.modal {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px); border: 0; padding: 0;
  border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.modal::backdrop { background: rgba(8, 20, 26, .55); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 0 16px; }
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- Print pages ---------- */
.print-bar { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.print-bar input[type=date] { width: auto; flex: 1; }
.print-page { background: #fff; color: #111; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.print-page .muted { color: #555; }
.print-page .tbl th, .print-page .tbl td { border-color: #ddd; }
.print-page .kv dt { color: #555; }
.print-page h3 { margin-top: 14px; }
.print-head { text-align: center; border-bottom: 2px solid #111; padding-bottom: 8px; margin-bottom: 10px; }
.print-head h1 { font-size: 1.3rem; margin: 0; }
.print-head h2 { font-size: 1.05rem; margin: 6px 0 0; }
.print-head p { margin: 0; font-size: .85rem; }
.sign-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 24px 18px; margin-top: 36px; }
.sign-space { min-height: 36px; display: flex; align-items: flex-end; font-size: .85rem; }
.sign-line { border-top: 1px solid #111; padding-top: 4px; font-size: .85rem; }
.print-foot { margin-top: 18px; text-align: right; }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .no-print, .topbar, .toasts, .print-bar, .btn { display: none !important; }
  .view { max-width: none; padding: 0; }
  .screen-body:has(.print-page) > *:not(.print-page) { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; }
  .print-page { border: 0; padding: 0; border-radius: 0; }
  .receipt { max-width: 150mm; margin: 0 auto; }
  .tbl { font-size: 10.5pt; }
  .table-wrap { overflow: visible; }
  a { color: inherit; text-decoration: none; }
}

@media (min-width: 720px) {
  .view { padding-top: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Admin pie charts */
.pie-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 12px; }
.pie-card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 14px; padding: 14px 16px; }
.pie-card h3 { margin: 0; font-size: 1rem; }
.pie-card .big-number { margin: 4px 0 8px; }
.pie-wrap { display: flex; justify-content: center; padding: 6px 0 10px; }
.pie-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pie-legend li { display: grid; grid-template-columns: 14px 1fr auto 44px; align-items: center; gap: 8px; font-size: .95rem; }
.pie-dot { width: 12px; height: 12px; border-radius: 3px; }
.pie-amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pie-pct { text-align: right; color: var(--muted, #667); font-variant-numeric: tabular-nums; }
.pie-wrap svg { transform: rotate(-90deg); }
.pie-wrap path { stroke: var(--surface); stroke-width: .02; }
.dot-opd { background: #2a78d6; } .dot-lab { background: #e8a21b; } .dot-ipd { background: #1e9e6a; } .dot-pharma { background: #c2417c; }

/* ================= v1.1 new look for every screen =================
   Older screens keep their markup; this maps them onto the design system
   (ds.css): Inter, flat white cards on light grey, ink buttons, no shadows. */
:root {
  --bg: #F4F5F7; --surface: #FFFFFF; --surface-2: #F1F3F5; --text: #111418; --muted: #5B6470; --line: #E4E7EB;
  --accent: #111418; --accent-strong: #000000; --accent-soft: #F1F3F5; --on-accent: #FFFFFF;
  --topbar: #F4F5F7; --on-topbar: #111418;
  --ok: #1C6B3F; --ok-soft: #E6F4EC; --warn: #8A4B06; --warn-soft: #FDF0DD; --danger: #8F1D17; --danger-soft: #FDE8E7;
  --info: #1F5BD1; --info-soft: #E8F0FE;
  --radius: 24px; --radius-sm: 14px; --shadow: none; --tap: 48px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
html, body { background: var(--bg); color: var(--text); }
body { -webkit-font-smoothing: antialiased; }
a { color: var(--info); }
h2 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
h3 { font-size: 17px; font-weight: 700; }
.topbar { background: var(--bg); color: var(--ink, #111418); padding: max(14px, env(safe-area-inset-top)) 16px 10px; gap: 10px; }
.topbar-title { text-align: center; font-size: 17px; font-weight: 700; }
.topbar .icon-btn, .back-btn { width: 44px; height: 44px; min-width: 44px; border-radius: 22px; background: #F1F3F5; color: #111418; font-size: 26px; padding-bottom: 3px; }
.topbar .icon-btn:active { background: #E4E7EB; }
.topbar-user { width: 44px; height: 44px; border: none; background: #111418; color: #fff; font-size: 15px; }
.user-menu { border: none; border-radius: 24px; box-shadow: 0 12px 40px rgba(17,20,24,.18); padding: 16px; }
.view { padding: 8px 16px 96px; max-width: 640px; }
.card { border: none; border-radius: 24px; padding: 18px; box-shadow: none; }
.section-title { margin: 22px 4px 8px; color: var(--text); font-size: 18px; font-weight: 800; letter-spacing: -.3px; text-transform: none; }
.list-row { border-bottom-color: var(--line); }
.list > .card.list-row, .list-row.card { border-radius: 20px; border-bottom: none; padding: 14px 16px; }
.btn { min-height: 52px; border-radius: 26px; border: none; background: #F1F3F5; color: var(--text); padding: 10px 20px; }
.btn:active { transform: none; background: #E4E7EB; }
.btn-primary { background: #111418; color: #fff; }
.btn-primary:active { background: #000; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-ghost { background: transparent; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.btn-sm { min-height: 44px; padding: 6px 16px; border-radius: 22px; }
.btn-lg { min-height: 60px; border-radius: 30px; font-size: 17px; font-weight: 700; }
.btn:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tile:focus-visible { outline: 3px solid #2F6FEB; outline-offset: 2px; }
.field > label, .field > .label { font-size: 14px; font-weight: 600; color: var(--muted); }
input[type=text], input[type=tel], input[type=number], input[type=password], input[type=search], input[type=date], input[type=month], input[type=email], select, textarea {
  min-height: 52px; border: 1px solid var(--line); border-radius: 16px; background: #F4F5F7; color: #111418; padding: 12px 14px; -webkit-text-fill-color: #111418; }
input:focus, select:focus, textarea:focus { background: #fff; }
input::placeholder, textarea::placeholder { color: #9AA1AB; -webkit-text-fill-color: #9AA1AB; opacity: 1; }
input[disabled], select[disabled] { background: #F1F3F5; color: #5B6470; -webkit-text-fill-color: #5B6470; }
input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #F4F5F7 inset; -webkit-text-fill-color: #111418; }
.form-error { border-radius: 14px; }
.chip { border: none; background: #fff; font-weight: 600; }
.chip[aria-pressed="true"] { background: #111418; color: #fff; }
.pill { background: #F1F3F5; color: #111418; }
.tile { border: none; border-radius: 26px; box-shadow: none; padding: 16px; min-height: 110px; font-size: 16px; font-weight: 700; }
.tile:active { background: #F1F3F5; }
.tile-icon { width: 44px; height: 44px; border-radius: 14px; background: #F1F3F5; color: #111418; }
.tile-group-title { font-size: 18px; font-weight: 800; letter-spacing: -.3px; color: var(--text); text-transform: none; margin: 4px 4px 10px; }
.badge { border-radius: 12px; padding: 4px 10px; font-size: 13px; }
.banner { border-radius: 20px; }
.banner-info { background: var(--info-soft); color: #1F5BD1; }
.stat { background: #F4F5F7; border-radius: 16px; }
.big-number { font-weight: 800; letter-spacing: -1px; }
.tab { border: none; background: #fff; border-radius: 22px; }
.tab[aria-current="page"] { background: #111418; color: #fff; }
.token-sm { border-radius: 14px; background: #E8F0FE; color: #1F5BD1; }
.token-big { color: #111418; }
.sticky-total { border: none; border-radius: 24px; box-shadow: 0 -8px 24px rgba(17,20,24,.08); }
.toast { background: #111418; border-radius: 18px; box-shadow: 0 12px 30px rgba(17,20,24,.25); }
.toast-error { background: #8F1D17; }
.modal { border-radius: 28px; }
.pie-card { border: none; box-shadow: none; border-radius: 24px; }
.login-card { border: none; box-shadow: none; }
progress::-webkit-progress-value { background: #111418; }
progress::-moz-progress-bar { background: #111418; }
/* stop the page jumping while a screen loads */
.view { min-height: calc(100vh - 70px); }
html { overflow-y: scroll; scrollbar-gutter: stable; }
