/* Flat, dark-only theme. Surfaces are separated by fill, never by shadow, gradient, blur or glow. */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0b0b0c;
  --surface: #161618;
  --surface-2: #202023;
  --surface-3: #2a2a2e;
  --divider: #232326;
  --text: #f2f2f3;
  --muted: #8e8e96;
  --primary: #f2f2f3;
  --primary-text: #0b0b0c;
  --positive: #4fc27b;
  --negative: #f0645a;
  --warning: #e3ad45;
  --radius: 18px;
  --radius-sm: 14px;
  --tabbar-h: 76px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--text); }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.15; font-weight: 650; letter-spacing: -0.02em; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.hidden { display: none !important; }
.num, .amount, .big, .kv dd { font-variant-numeric: tabular-nums; }
.pos { color: var(--positive); }
.neg { color: var(--negative); }

/* --- Layout -------------------------------------------------------------- */
.shell { max-width: 640px; margin: 0 auto; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 14px) 20px 12px;
  background: var(--bg);
}
.topbar h1 { flex: 1; margin: 0; font-size: 1.85rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 8px 20px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px); }
.content.no-tabs { padding-bottom: calc(env(safe-area-inset-bottom) + 28px); }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg);
  border-top: 1px solid var(--divider);
}
.tabbar a {
  flex: 1; max-width: 150px; height: var(--tabbar-h); position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: var(--muted); text-decoration: none; font-size: 0.75rem; font-weight: 550;
}
.tabbar a.active { color: var(--text); }
.tabbar svg { width: 26px; height: 26px; }
.tabbar .badge { position: absolute; top: 10px; left: calc(50% + 8px); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--negative); color: #fff;
  font-size: 0.72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}

.center-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 24px) 20px calc(env(safe-area-inset-bottom) + 24px);
}
.narrow { width: 100%; max-width: 440px; }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.brand img { width: 48px; height: 48px; border-radius: 13px; }
.brand strong { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.02em; }

/* --- Cards & lists ------------------------------------------------------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card > p:last-child { margin-bottom: 0; }
.section-title { font-size: 1.05rem; font-weight: 650; color: var(--text); margin: 30px 4px 12px; letter-spacing: -0.015em; display: flex; align-items: center; gap: 8px; }
.list { background: var(--surface); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; min-height: 72px;
  border: 0; text-decoration: none; color: inherit; background: none; width: 100%; text-align: left;
  position: relative;
}
/* Inset dividers, aligned with the text rather than the avatar. */
.row + .row::before { content: ""; position: absolute; top: 0; left: 78px; right: 0; border-top: 1px solid var(--divider); }
a.row:active, button.row:active { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { color: var(--muted); font-size: 0.9rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub.wrap { white-space: normal; }
.row .amount { font-weight: 600; font-size: 1.05rem; white-space: nowrap; }
.row > svg:last-child { color: var(--muted); width: 18px; height: 18px; flex: none; }
.avatar {
  width: 46px; height: 46px; flex: none; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--text);
  display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 1.05rem; overflow: hidden;
}
.avatar svg { width: 22px; height: 22px; color: var(--muted); }
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.hero { padding: 10px 4px 26px; }
.hero .label { color: var(--muted); font-size: 1rem; font-weight: 500; }
.hero .big { font-size: 3.4rem; font-weight: 700; letter-spacing: -0.045em; line-height: 1.05; margin: 8px 0 12px; }
.hero .meta { color: var(--muted); font-size: 0.9rem; display: flex; align-items: center; gap: 7px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--positive); }
.live-dot.off { background: var(--warning); }

.tx-date { font-size: 0.95rem; color: var(--muted); font-weight: 600; padding: 18px 4px 8px; }
.pill { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.pill.ok { background: rgb(79 194 123 / 14%); color: var(--positive); }
.pill.warn { background: rgb(227 173 69 / 14%); color: var(--warning); }
.pill.bad { background: rgb(240 100 90 / 14%); color: var(--negative); }

.banner { display: block; border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; font-size: 0.95rem; background: var(--surface-2); text-decoration: none; color: var(--text); }
.banner.warn { background: rgb(227 173 69 / 12%); color: var(--warning); }
.banner.error { background: rgb(240 100 90 / 12%); color: var(--negative); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--muted); margin-bottom: 10px; }
.empty h2 { color: var(--text); }

/* --- Forms --------------------------------------------------------------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 0.9rem; font-weight: 550; margin-bottom: 8px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="search"], input[type="date"], input[type="time"], input:not([type]), select, textarea {
  width: 100%; height: 56px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--surface-2); outline: none; font-size: 17px; /* >=16px stops iOS zooming */
  -webkit-appearance: none; appearance: none;
}
textarea { height: auto; min-height: 96px; padding: 14px 16px; resize: vertical; }
.card input[type="text"], .card input[type="email"], .card input[type="password"], .card input[type="tel"], .card input:not([type]), .card select, .card textarea { background: var(--surface-3); }
input:focus, select:focus, textarea:focus { border-color: var(--muted); }
input::placeholder, textarea::placeholder { color: #66666d; }
input.code { text-align: center; font-size: 1.75rem; letter-spacing: 0.4em; font-weight: 600; font-variant-numeric: tabular-nums; }
input.amount-input { font-size: 2rem; font-weight: 650; height: 72px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 1rem; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }
.error-text { color: var(--negative); font-size: 0.95rem; margin: -4px 0 14px; }
.error-text:empty { display: none; }
.inline { display: flex; gap: 10px; align-items: center; }
.inline > * { margin-bottom: 0; }
.segmented { display: flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 16px; gap: 4px; }
.card .segmented { background: var(--surface-3); }
.segmented button { flex: 1; min-height: 44px; padding: 8px; border: 0; border-radius: 11px; background: none; font-weight: 600; color: var(--muted); cursor: pointer; }
.segmented button.on { background: var(--text); color: var(--bg); }

.switch-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; min-height: 64px; position: relative; }
.switch-row + .switch-row::before { content: ""; position: absolute; top: 0; left: 18px; right: 0; border-top: 1px solid var(--divider); }
.switch-row .grow { flex: 1; min-width: 0; }
.switch-row .title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-row .muted.small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-row .btn { white-space: nowrap; }
.switch-row .amount { font-weight: 600; white-space: nowrap; }
.card .list { background: var(--surface-2); }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); cursor: pointer; transition: background 0.15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--text); transition: transform 0.15s; }
.switch input:checked + span { background: var(--positive); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: var(--radius-sm); border: 0;
  background: var(--surface-2); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--text);
}
.card .btn { background: var(--surface-3); }
.btn svg { width: 20px; height: 20px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn:active { opacity: 0.8; }
.btn.primary, .card .btn.primary { background: var(--primary); color: var(--primary-text); }
.btn.approve, .card .btn.approve { background: var(--positive); color: #06180d; }
.btn.deny, .card .btn.deny { background: rgb(240 100 90 / 16%); color: var(--negative); }
.btn.danger { color: var(--negative); }
.btn.ghost, .card .btn.ghost { background: transparent; color: var(--muted); }
.btn.block { width: 100%; }
.btn.small { min-height: 42px; padding: 0 16px; font-size: 0.95rem; border-radius: 12px; }
.btn + .btn { margin-left: 8px; }
.btn.block + .btn.block { margin: 10px 0 0; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; color: var(--text); cursor: pointer; flex: none; text-decoration: none;
}
.icon-btn:active { background: var(--surface-3); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.spin svg { animation: spin 0.9s linear infinite; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row .btn + .btn { margin-left: 0; }
/* Two equal, big buttons side by side: the one-tap approve/deny pattern. */
.decide { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.decide .btn + .btn { margin-left: 0; }

/* --- Payments & requests ----------------------------------------------- */
.req-card .amount-big { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.req-card .meta-line { color: var(--muted); font-size: 0.92rem; margin-bottom: 10px; }
.req-card .message { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.req-card .head { display: flex; align-items: flex-start; gap: 10px; }
.req-card .head .grow { flex: 1; min-width: 0; }
.people { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.people .person { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; }
.people .person .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .reason { color: var(--muted); font-size: 0.88rem; margin: -4px 0 0 0; }
.choice-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.choice-list .check { margin: 0; padding: 12px 14px; background: var(--surface-3); border-radius: 12px; }
.payee-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: none; }
.payee-chips button { flex: none; border: 0; border-radius: 999px; padding: 10px 14px; background: var(--surface-3); font-weight: 550; cursor: pointer; }
.payee-chips button.on { background: var(--text); color: var(--bg); }

/* --- Misc ---------------------------------------------------------------- */
.qr { display: block; width: 232px; height: 232px; margin: 10px auto 14px; border-radius: var(--radius-sm); background: #fff; padding: 8px; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; word-break: break-all; background: var(--surface-3); padding: 12px; border-radius: 12px; text-align: center; }
.copy-box { display: flex; gap: 10px; }
.copy-box input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; /* smaller makes iOS zoom in */ }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.steps { display: flex; gap: 8px; margin-bottom: 22px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-3); }
.steps i.on { background: var(--text); }

.splash { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--text); animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); z-index: 50;
  transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity 0.2s;
  background: var(--text); color: var(--bg); font-weight: 550;
  padding: 12px 18px; border-radius: 999px; font-size: 0.95rem; max-width: calc(100vw - 40px);
}
#toast.show { opacity: 1; }

.override-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 16px; margin-top: 14px; }
.override-box input:not([type]), .override-box input[type="text"] { background: var(--surface-3); }
.override-box .segmented { background: var(--surface-3); }
.override-box .btn:not(.primary):not(.danger) { background: var(--surface-3); }

.row .status-line { margin-top: 8px; }
.row .end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.row .end .btn.small { min-height: 34px; padding: 0 10px; }
.btn-row.spaced { margin-top: 16px; }
.segmented button { white-space: nowrap; font-size: 0.95rem; }
.card > .btn.block:not(:first-child), .card > form + .btn.block { margin-top: 10px; }

/* Transaction selection (admin): checkboxes appear only in selection mode. */
.tx-check { display: none; width: 22px; height: 22px; flex: none; accent-color: var(--positive); pointer-events: none; }
.selecting .tx-check { display: block; }
.selecting .tx-row { cursor: pointer; }
.tx-row.on { background: var(--surface-2); }
.shared-line { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.85rem; color: var(--positive); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.shared-line svg { width: 15px; height: 15px; flex: none; }
.action-bar {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
  width: calc(100% - 32px); max-width: 600px; max-height: 70vh; overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--surface-3); border-radius: var(--radius); padding: 16px;
}
.action-bar .choice-list .check { background: var(--surface-3); }
.action-bar .btn:not(.primary):not(.approve):not(.deny) { background: var(--surface-3); }
.content:has(.action-bar:not(.hidden)) { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 140px); }

/* View-as: a persistent, unmistakable bar while an admin looks at the app as someone else. */
.view-as-bar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 20px 10px; background: var(--warning); color: #1b1203; font-weight: 600; font-size: 0.95rem;
}
.view-as-bar svg { width: 20px; height: 20px; flex: none; }
.view-as-bar .grow { flex: 1; min-width: 0; }
.view-as-bar .btn.small { background: #1b1203; color: var(--warning); min-height: 36px; }
.view-as-bar + .topbar { top: calc(env(safe-area-inset-top) + 56px); padding-top: 14px; }

/* Payment cards on the user's overview: flat, light, credit-card proportions. */
.cards-row { display: flex; gap: 14px; overflow-x: auto; margin: 0 -20px 22px; padding: 0 20px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.bank-card {
  flex: none; width: min(320px, 82vw); aspect-ratio: 1.586; scroll-snap-align: start;
  display: flex; flex-direction: column; justify-content: space-between; padding: 20px 22px;
  background: #ececee; color: #0b0b0c; border-radius: 20px; text-decoration: none;
}
.bank-card .card-top { display: flex; justify-content: space-between; align-items: center; font-weight: 650; font-size: 1.02rem; }
.bank-card .card-top svg { width: 26px; height: 26px; }
.bank-card .card-balance { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.bank-card .card-number { font-size: 1rem; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; color: #4a4a50; }
.segmented button { min-width: 0; padding: 8px 6px; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; }
.shared-line.hidden-from { color: var(--muted); }
.load-more { display: flex; justify-content: center; padding: 8px 0 16px; min-height: 40px; }
.action-bar > .title { font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Hoofdkaart: the admin's main card, in the brand yellow. */
.bank-card.main-card { background: #f5c518; color: #1a1400; }
.bank-card.main-card .card-number { color: #5c4a00; }
.bank-card.main-card.blocked { background: var(--surface-3); color: var(--muted); }
.bank-card.main-card.blocked .card-number { color: var(--muted); }
.card-status { font-size: 0.8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgb(240 100 90 / 18%); color: var(--negative); }
.card-block-btn { margin: -8px 0 22px; }
.alert-card { outline: 2px solid var(--negative); outline-offset: -2px; }

/* Cards side by side (two in view, scroll for more). */
.cards-row .bank-card { width: calc((min(100vw, 640px) - 54px) / 2); padding: 14px 16px; border-radius: 16px; border: 0; text-align: left; cursor: pointer; font: inherit; }
.cards-row .bank-card .card-top { font-size: 0.9rem; gap: 6px; }
.cards-row .bank-card .card-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cards-row .bank-card .card-top svg { width: 20px; height: 20px; flex: none; }
.cards-row .bank-card .card-balance { font-size: 1.3rem; }
.cards-row .bank-card .card-number { font-size: 0.85rem; letter-spacing: 0.08em; }
.cards-row .card-status { font-size: 0.7rem; padding: 3px 8px; }

/* Bottom sheet: slides up over a flat dimmed backdrop. */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgb(0 0 0 / 0%); transition: background 0.2s; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop.open { background: rgb(0 0 0 / 60%); }
.sheet {
  width: 100%; max-width: 640px; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(env(safe-area-inset-bottom) + 20px);
  transform: translateY(100%); transition: transform 0.22s ease-out; max-height: 85vh; overflow-y: auto;
}
.sheet-backdrop.open .sheet { transform: translateY(0); }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 0 auto 16px; }
.sheet textarea { background: var(--surface-2); }
.sheet .btn:not(.primary):not(.deny):not(.approve) { background: var(--surface-2); }
.segmented.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }

/* Profile pictures */
.avatar.photo { background: var(--surface-3); }
.avatar.photo img { object-fit: cover; background: none; }
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 0.8rem; }
.avatar-editor { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.avatar-lg .avatar { width: 72px; height: 72px; border-radius: 22px; font-size: 1.6rem; }
.people .person .avatar.sm { flex: none; }
.card-filter { margin: -6px 0 6px; }
.action-bar .inline .btn.small { padding: 0 12px; }

/* Payment status choices (admin): one tap sets the status. */
.status-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.status-choice { border: 0; border-radius: 999px; padding: 10px 14px; font-weight: 600; font-size: 0.92rem; cursor: pointer; background: var(--surface-3); color: var(--text); }
.status-choice.on.ok { background: var(--positive); color: #06180d; }
.status-choice.on.warn { background: var(--warning); color: #1b1203; }
.status-choice.on.bad { background: var(--negative); color: #fff; }
.status-choice.on { outline: none; }
.card input[type="date"], .card input[type="time"] { background: var(--surface-3); }
.payee-chips.wrap { flex-wrap: wrap; overflow: visible; }
.field.card-filter { margin: -6px 0 6px; }

/* Dropdowns keep a visible arrow despite the flat styling. */
select {
  padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 20px;
}

/* App layout: the page itself never scrolls, only the content area between header and tab bar.
   The tab bar is an ordinary flex item at the bottom, so it can't drift while scrolling or when
   the browser's own toolbars grow and shrink. */
html, body { height: 100%; overflow: hidden; }
.shell { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
.topbar, .view-as-bar { position: static; flex: none; }
.content {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  padding-bottom: 28px;
}
.content.no-tabs { padding-bottom: calc(env(safe-area-inset-bottom) + 28px); }
.tabbar { position: static; flex: none; }
.content:has(.action-bar:not(.hidden)) { padding-bottom: 170px; }
/* Pages outside the app shell (login, invite, bank callback) scroll on their own. */
.center-page { height: 100vh; height: 100dvh; min-height: 0; overflow-y: auto; align-items: flex-start; }
.center-page > .narrow { margin: auto; }
.splash { height: 100vh; height: 100dvh; min-height: 0; }
.version-line { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 24px 0 0; }

/* The lock: an unmistakable red bar on the admin's screens; a card with a switch for users. */
.lock-slot { flex: none; }
.lock-bar {
  display: flex; align-items: center; gap: 12px; width: 100%; border: 0; text-align: left; cursor: pointer;
  padding: calc(env(safe-area-inset-top) + 12px) 20px 12px; background: var(--negative); color: #fff; font: inherit;
}
.view-as-bar + .lock-slot .lock-bar { padding-top: 12px; }
.lock-bar svg { width: 22px; height: 22px; flex: none; }
.lock-bar .grow { flex: 1; min-width: 0; }
.lock-bar .lock-title { font-weight: 700; }
.lock-bar .lock-sub { font-size: 0.85rem; opacity: 0.9; }
.lock-slot:not(:empty) + .topbar { padding-top: 14px; }
.lock-card .inline { cursor: pointer; }
.lock-card .avatar svg { color: var(--text); }
.lock-card.on { outline: 2px solid var(--negative); outline-offset: -2px; }
.lock-card.on .avatar { background: rgb(240 100 90 / 18%); }
.lock-card.on .avatar svg { color: var(--negative); }
.lock-card .message { margin-top: 14px; }
.lock-note { margin: 12px 0 0; }
.lock-card.on .switch input:checked + span { background: var(--negative); }
.or { text-align: center; color: var(--muted); font-size: 0.88rem; margin: 16px 0; }
.passkey-hint .decide { margin-top: 14px; }

/* Savings progress */
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.card .progress, .sheet .progress { background: var(--surface-2); }
.progress-fill { height: 100%; width: 0; background: var(--positive); border-radius: 999px; transition: width 0.3s; }
.row .progress { max-width: 220px; }
.sheet .amount-big { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.03em; margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.passkey-explain { display: flex; gap: 14px; align-items: flex-start; background: var(--surface-3); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.passkey-explain svg { width: 28px; height: 28px; flex: none; color: var(--positive); }
.passkey-explain p { margin: 0; }
.seen { font-size: 0.82rem; color: var(--muted); } .seen.yes { color: var(--positive); }

/* Oversight: attention bars for the admin, a full-screen emergency stop. */
.attention-bar {
  display: flex; align-items: center; gap: 12px; width: 100%; border: 0; text-align: left; cursor: pointer; font: inherit;
  padding: 12px 20px; background: var(--negative); color: #fff;
}
.attention-bar.warn { background: var(--warning); color: #1b1203; }
.lock-slot > .attention-bar:first-child { padding-top: calc(env(safe-area-inset-top) + 12px); }
.attention-bar svg { width: 22px; height: 22px; flex: none; }
.attention-bar .grow { flex: 1; min-width: 0; }
.explain-item { background: var(--surface-2); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.explain-item textarea { margin: 10px 0; background: var(--surface-3); }
.explain-review { padding: 10px 0; border-top: 1px solid var(--divider); }
.emergency { position: fixed; inset: 0; z-index: 100; background: var(--negative); color: #fff; display: flex; align-items: center; justify-content: center; padding: 24px; }
.emergency-inner { width: 100%; max-width: 480px; }
.emergency-title { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 20px; }
.emergency-msg { background: rgb(0 0 0 / 18%); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.emergency-text { font-size: 1.3rem; font-weight: 600; }
.emergency-from { opacity: 0.85; margin-top: 6px; font-size: 0.9rem; }
.btn.emergency-ack { background: #fff; color: var(--negative); margin-top: 12px; }
.oversight-card .decide { margin-top: 14px; }
.limit-row { margin-bottom: 12px; }
.limit-row.over .progress-fill { background: var(--negative); }
.view-as-bar.test { background: #5b8def; color: #fff; } .view-as-bar.test .btn.small { background: #fff; color: #234; }

/* --- Meer: QR payments, share links, card details --- */
.tabbar a { min-width: 0; font-size: 0.72rem; }
.amount-big { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.05rem; padding: 4px 12px; border-radius: 999px; background: rgb(227 173 69 / 14%); color: var(--warning); white-space: nowrap; }
.countdown.urgent { background: rgb(240 100 90 / 16%); color: var(--negative); }
.countdown.over { background: var(--surface-3); color: var(--muted); }
.countdown-box { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.countdown-box .countdown { font-size: 1.6rem; padding: 8px 18px; }
.qr-cta { margin-bottom: 16px; }
.qr-preview img { display: block; width: 100%; max-height: 260px; object-fit: contain; border-radius: var(--radius-sm); background: #000; margin-top: 12px; }
.qr-read { font-size: 0.85rem; color: var(--muted); margin: 8px 0 4px; }
.qr-read.ok { color: var(--positive); }
.qr-photo { display: block; width: 100%; max-height: 360px; object-fit: contain; border-radius: var(--radius-sm); background: #fff; margin: 12px 0; cursor: zoom-in; }
.qr-photo.zoom { position: fixed; inset: 0; z-index: 300; max-height: none; height: 100dvh; border-radius: 0; margin: 0; cursor: zoom-out; }
.ideal-card .head { display: flex; align-items: flex-start; gap: 12px; }
.card-details { display: grid; gap: 8px; margin: 8px 0 12px; }
.copy-row { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.sheet .copy-row, .card .copy-row { background: var(--surface-3); }
.copy-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.05rem; letter-spacing: 0.02em; word-break: break-all; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.copy-row .grow { flex: 1; min-width: 0; }
.req-card .shared-line, .ideal-card .shared-line { white-space: normal; overflow-wrap: anywhere; }
.switch-row.stack { flex-direction: column; align-items: stretch; gap: 10px; }
.available { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 16px; margin: 8px 0 16px; }
.card .available { background: var(--surface-3); }
.available strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.link-row { align-items: flex-start; } .link-row .status-line.inline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.link-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; word-break: break-all; background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; margin: 8px 0 14px; user-select: all; }

/* Sign-up, introduction and user management */
.language-picker { margin: 16px 0; }
.card .language-picker:first-child { margin-top: 0; }
.intro-icon { width: 56px; height: 56px; border-radius: 18px; background: var(--surface-3); display: grid; place-items: center; margin-bottom: 16px; }
.intro-icon svg { width: 26px; height: 26px; }
.intro p.muted { margin-bottom: 20px; }
.intro-list { margin: 0 0 20px; padding-left: 20px; color: var(--muted); display: flex; flex-direction: column; gap: 10px; }
.intro .btn + .btn { margin-top: 10px; margin-left: 0; }
.user-search { margin-bottom: 12px; }
.link-people { margin: 12px 0 0; }
.link-people a { flex: none; border-radius: 999px; padding: 8px 12px; background: var(--surface-3); font-size: 0.9rem; color: inherit; text-decoration: none; }
.row-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.user-tabs button { font-size: 0.8rem; padding: 8px 2px; }
.levy-row { background: var(--surface-2); margin-bottom: 12px; }
.levy-row h3 { margin-bottom: 4px; }
.levy-row .copy-box input { font-size: 0.75rem; padding-left: 10px; padding-right: 6px; }
.goal-card .progress { margin-top: 8px; }
.levy-row:first-of-type { margin-top: 0; }
.switch-row .grow .muted.small { white-space: normal; overflow: visible; text-overflow: clip; }
.my-budget { margin: -8px 0 18px; }
.my-budget .limit-row { margin: 0; }
.segmented.grid-2 button { white-space: normal; text-overflow: clip; line-height: 1.2; }

.card-row { flex-wrap: wrap; }
.card-row > .grow { flex: 1 1 60%; min-width: 0; }
.card-row > .btn-row { flex: 1 1 100%; flex-wrap: wrap; }

.pin-input { font-size: 1.5rem; letter-spacing: 0.5em; text-align: center; }

.owned-totals { display: flex; gap: 12px; }
.owned-card .limit-row { margin-top: 12px; }

.card-link { margin-bottom: 12px; border-radius: 16px; background: var(--surface-1, var(--surface-2)); }
.section-title.inline { display: flex; align-items: center; gap: 10px; }

.report-item { flex-wrap: wrap; gap: 10px; }
.report-item > .grow { flex: 1 1 45%; min-width: 0; }
.report-item.off .title, .report-item.off .amount { opacity: 0.45; text-decoration: line-through; }
.report-item > input[type=checkbox] { width: 20px; height: 20px; flex: none; }

.report-item .sub { white-space: normal; }
.report-kinds > div { display: flex; justify-content: space-between; gap: 12px; }

.log-row { align-items: flex-start; }
.log-row .sub { white-space: normal; }
.log-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }

.message.written { white-space: pre-wrap; overflow-wrap: anywhere; }

/* --- PPAB controls -------------------------------------------------------- */
.control { margin-bottom: 12px; }
.control-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.control-head .name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.control-value { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.control-who { color: var(--muted); font-size: 0.85rem; margin: 10px 0 0; }
.press-btn { display: block; width: 100%; min-height: 120px; padding: 20px; border: 0; border-radius: var(--radius); background: var(--primary); color: var(--primary-text); font-size: 1.35rem; font-weight: 700; cursor: pointer; overflow-wrap: anywhere; transition: transform 0.08s ease; }
.press-btn:active { transform: scale(0.97); }
.press-btn:disabled { opacity: 0.6; }
.control input[type="range"] { width: 100%; height: 40px; margin: 0; accent-color: var(--primary); touch-action: pan-y; }
.range-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.85rem; }
.counter-row { display: flex; align-items: center; gap: 12px; }
.counter-row .control-value { flex: 1; text-align: center; font-size: 2rem; }
.counter-row .btn { min-width: 64px; font-size: 1.4rem; }
.timer-left { font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 12px; }
.timer-left.running { color: var(--positive); }
.manage-row { flex-wrap: wrap; }
.manage-row > .grow { flex: 1 1 55%; }
.manage-row > .btn-row { flex: 1 1 100%; }
.log-row { align-items: flex-start; }
.log-row .sub { white-space: normal; }
.log-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.field-pair { display: flex; gap: 12px; }
.field-pair > .field { flex: 1; min-width: 0; }

.or-line { text-align: center; margin: 18px 0; }

.person-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.person-actions { flex-wrap: wrap; margin-bottom: 16px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.written { white-space: pre-wrap; overflow-wrap: anywhere; }
a.row { color: inherit; text-decoration: none; }

.file-btn { position: relative; cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
.file-btn.working { opacity: 0.5; pointer-events: none; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.field-hint { margin: -8px 0 16px; }

.form-block { margin-bottom: 8px; }
.form-card h2 { margin-bottom: 4px; }
.form-card .list { margin-bottom: 0; background: var(--surface-2); }
.entries { margin-top: 16px; border-top: 1px solid var(--surface-3); }
.entry { padding: 10px 0; border-bottom: 1px solid var(--surface-3); }
.entry:last-child { border-bottom: 0; padding-bottom: 0; }

.press-btn.latch { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 2px var(--surface-3); }
.press-btn.latch.on { background: var(--primary); color: var(--primary-contrast, #111); box-shadow: none; }
.latch-state { font-size: 0.85rem; font-weight: 600; opacity: 0.75; }
.press-btn.sent { animation: press-sent 0.6s ease-out; }
@keyframes press-sent { 0% { box-shadow: 0 0 0 0 var(--positive); } 100% { box-shadow: 0 0 0 14px transparent; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 0.85rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; }

.press-btn .timer-left { font-size: 1.3rem; color: inherit; margin: 0; }
.schedules { margin-bottom: 12px; }

.plan-btn { margin-bottom: 16px; }

.time-link { display: block; margin: 8px auto 0; }
.duration-chips { margin-bottom: 14px; }
.chip.on { background: var(--primary); color: var(--primary-contrast, #111); }
.duration .field-pair { grid-template-columns: repeat(3, minmax(0, 1fr)); }
