/* Family Invoices — "Lavender" theme. Phone first; desktop from 900px. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/vendor/plus-jakarta-sans-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #F4F2FB;
  --surface: #FFFFFF;
  --ink: #17151F;
  --muted: #625E70;
  --faint: #8E8A9C;
  --line: #ECE9F5;
  --field-line: #E1DCEF;
  --accent: #5B3DE8;
  --accent-ink: #4B2FD6;
  --accent-soft: #ECE8FF;
  --accent-shadow: rgba(78, 49, 221, 0.3);
  --hero-from: #4E31DD;
  --hero-mid: #6A4CF0;
  --hero-to: #7F64F6;
  --ok-bg: #E6F6EE; --ok-ink: #17663E;
  --hold-bg: #FFF3D6; --hold-ink: #7A5200;
  --warn-bg: #FFEDE3; --warn-ink: #8A3208; --warn-strong: #C2410C;
  --err-bg: #FDECEC; --err-ink: #A12A2A;
  --info-bg: #ECE8FF; --info-ink: #4B33C9;
  --pdf-bg: #FFF8E6; --pdf-line: #F0C36D; --pdf-ink: #6B4700;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 14px;
  --tabbar-h: 76px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); }
h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; margin: 0; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.4px; }
.pre { white-space: pre-wrap; }
.center { text-align: center; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */

/* viewport-fit=cover lets the page run under the status bar; keep the header below it. */
.top { padding: calc(12px + env(safe-area-inset-top)) 16px 0; }
.topbar { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 52px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 16px; }
.logo { width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: #FFF; display: grid; place-items: center; }
.desk-nav { display: none; }
.signout { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-size: 13px; font-weight: 800; }

.hero-band {
  background: linear-gradient(160deg, var(--hero-from) 0%, var(--hero-mid) 55%, var(--hero-to) 100%);
  color: #FFF;
  border-radius: 0 0 28px 28px;
  padding-bottom: 72px;
}
.hero-band .brand { color: #FFF; }
.hero-band .logo { background: rgba(255, 255, 255, 0.18); }
.hero-band .avatar { background: #FFF; color: var(--hero-from); }
.hero-band .ghost { color: #FFF; border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.12); }
.hero { max-width: 1200px; margin: 0 auto; text-align: center; padding-top: 18px; }
.hero-label { font-size: 14px; font-weight: 600; }
.hero-amount { font-size: 46px; font-weight: 800; letter-spacing: -1.5px; line-height: 1.15; margin-top: 2px; font-variant-numeric: tabular-nums; }
.hero-amount .pence { color: rgba(255, 255, 255, 0.78); }
.hero-pill { display: inline-block; margin-top: 10px; padding: 6px 12px; border-radius: 999px; background: rgba(20, 10, 70, 0.28); font-size: 12px; font-weight: 600; }

main { max-width: 760px; margin: 0 auto; padding: 16px 16px 40px; }
main.wide { max-width: 1200px; }
.with-hero main { margin-top: -56px; position: relative; }
.with-tabs main { padding-bottom: calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }

/* Bottom tab bar (phones) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
}
.tabbar.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; min-height: 48px; justify-content: center; }
.tab.active { color: var(--ink); font-weight: 800; }
.fab {
  justify-self: center; width: 58px; height: 58px; margin-top: -30px; border-radius: 50%;
  background: var(--accent); color: #FFF; display: grid; place-items: center;
  box-shadow: 0 8px 20px var(--accent-shadow);
}

@media (min-width: 900px) {
  .tabbar { display: none; }
  .with-tabs main { padding-bottom: 48px; }
  .desk-nav { display: flex; align-items: center; gap: 4px; margin-left: 24px; flex: 1; }
  .desk-nav a:not(.button) { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; }
  .desk-nav a:not(.button):hover { color: var(--ink); background: rgba(91, 61, 232, 0.06); }
  .desk-nav a.active { color: var(--ink); background: var(--surface); }
  .desk-nav .button { margin-left: auto; }
  .signout { margin-left: 12px; }
  .hero-band .desk-nav a:not(.button) { color: rgba(255, 255, 255, 0.85); }
  .hero-band .desk-nav a.active, .hero-band .desk-nav a:not(.button):hover { color: #FFF; background: rgba(255, 255, 255, 0.14); }
  .hero-band .desk-nav .button.primary { background: #FFF; color: var(--hero-from); box-shadow: none; }
  .top { padding: 16px 24px 0; }
  main { padding: 24px 24px 48px; }
}

/* ---------- Controls ---------- */

input, select, textarea, button, .button { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--field-line); border-radius: var(--r-sm);
  font-size: 16px; font-weight: 600; color: var(--ink);
}
textarea { min-height: 72px; resize: vertical; font-weight: 500; }
input::placeholder, textarea::placeholder { color: var(--faint); font-weight: 500; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
input[type="file"] { padding: 10px; font-size: 14px; font-weight: 500; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: 6px; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--field-line); background: var(--surface); color: var(--ink);
  font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
button:hover, .button:hover { border-color: #C9C2E0; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #FFF; box-shadow: 0 8px 20px var(--accent-shadow); }
button.primary:hover, .button.primary:hover { background: var(--accent-ink); }
button.danger { color: var(--err-ink); border-color: #F1C3C3; }
button.ghost { background: transparent; }
button.small, .button.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
button.big, .button.big { min-height: 56px; font-size: 16px; width: 100%; }
button.link { min-height: 0; padding: 0; border: none; background: none; color: var(--accent-ink); text-decoration: underline; font-weight: 700; }
.back { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--surface); color: var(--ink); display: grid; place-items: center; }

.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
form.inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
form.inline input, form.inline select { width: auto; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }

/* ---------- Cards, alerts, badges ---------- */

.card { background: var(--surface); border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px; }
.card.flat { border: 1px solid var(--line); }
.page-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.page-head h1 { flex: 1; min-width: 0; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); margin: 0 0 14px; font-size: 14px; font-weight: 600; line-height: 1.45; }
.alert > svg { flex: none; margin-top: 1px; }
.alert-error { background: var(--err-bg); color: var(--err-ink); }
.alert-warning { background: var(--warn-bg); color: var(--warn-ink); }
.alert-success { background: var(--ok-bg); color: var(--ok-ink); }
.alert-info { background: var(--info-bg); color: var(--info-ink); }

.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-submitted { background: var(--info-bg); color: var(--info-ink); }
.badge-on-hold { background: var(--hold-bg); color: var(--hold-ink); }
.badge-rejected { background: var(--err-bg); color: var(--err-ink); }
.badge-paid { background: var(--ok-bg); color: var(--ok-ink); }
.status-submitted { color: var(--info-ink); }
.status-on-hold { color: var(--hold-ink); }
.status-rejected { color: var(--err-ink); }
.status-paid { color: var(--ok-ink); }

.chip { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; font-size: 14px; font-weight: 800; }
.tint-0 { background: #ECE8FF; color: #4B2FD6; }
.tint-1 { background: #FFEDE3; color: #A93C0C; }
.tint-2 { background: #E3F0FF; color: #1D5BB8; }
.tint-3 { background: #E6F6EE; color: #17663E; }
.tint-4 { background: #FDE7F3; color: #9D2265; }

/* ---------- Home ---------- */

.month-card { background: var(--surface); border-radius: var(--r-lg); padding: 16px; box-shadow: 0 8px 24px rgba(40, 20, 120, 0.08); margin-bottom: 14px; }
.month-card .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.month-card .head h2 { margin: 0; font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.stat .icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.stat .label { font-size: 12px; color: var(--muted); margin-top: 10px; }
.stat .value { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }

.banner { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 999px; background: var(--ink); color: #FFF; text-decoration: none; font-size: 14px; font-weight: 600; margin-bottom: 18px; }
.banner .go { margin-left: auto; display: flex; align-items: center; gap: 4px; color: #D9D2FF; }
.banner svg:first-child { color: #FFB38A; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 10px; }
.section-head h2 { margin: 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 12px; scrollbar-width: none; }
.chips a { flex: none; min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.chips a.on { background: var(--ink); color: #FFF; }

details.filters-panel { margin-bottom: 12px; }
details.filters-panel > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--accent-ink); min-height: 36px; }
details.filters-panel > summary::-webkit-details-marker { display: none; }
.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; background: var(--surface); border-radius: var(--r-md); padding: 14px; margin-top: 8px; }
.filters .full { grid-column: 1 / -1; }
.filters input, .filters select { min-height: 44px; font-size: 15px; }
@media (min-width: 700px) { .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); } .filters .grow { grid-column: span 2; } }

.day { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 14px 4px 8px; }
.day strong { color: var(--ink); }
.cards { display: flex; flex-direction: column; gap: 8px; }
.inv { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface); border-radius: var(--r-md); text-decoration: none; color: inherit; }
.inv:hover { box-shadow: 0 4px 16px rgba(40, 20, 120, 0.08); }
.inv .body { flex: 1; min-width: 0; }
.inv .name { display: block; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv .meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 2px; flex-wrap: wrap; }
.tag { padding: 1px 8px; border-radius: 999px; background: #F1EFF7; font-weight: 600; }
.flag { color: var(--warn-strong); display: inline-flex; }
.inv .right { text-align: right; flex: none; }
.inv .amount { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.inv .status { font-size: 11px; font-weight: 700; margin-top: 2px; }
.list-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 16px 4px 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; background: var(--surface); border-radius: var(--r-lg); }

/* ---------- Invoice form ---------- */

.invoice-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.invoice-form .full { grid-column: 1 / -1; }
.invoice-form .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.invoice-form .field > label { margin: 0; }
.upload { background: var(--surface); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.upload-head { display: flex; align-items: center; gap: 12px; }
.upload-head .chip { background: var(--accent-soft); color: var(--accent-ink); }
.upload-head strong { display: block; font-size: 15px; }
.upload input[type="file"] { border-style: dashed; background: #FBFAFE; }
.hint { color: var(--muted); font-size: 13px; margin: 0; min-height: 1.2em; font-weight: 600; }
.hint:empty { display: none; }
.hint.error { color: var(--err-ink); }
.field-error { color: var(--err-ink); font-size: 13px; font-weight: 600; }
.from-pdf { background: var(--pdf-bg); border-color: var(--pdf-line); }
.pdf-note { color: var(--pdf-ink); font-size: 12px; font-weight: 700; line-height: 1.3; }
.saved-bank { background: var(--surface); border-radius: var(--r-sm); padding: 12px 14px; font-size: 14px; font-weight: 600; }
.saved-bank .mono { font-weight: 800; }
.segmented { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); min-height: 48px; padding: 4px; border-radius: var(--r-sm); background: #E9E5F6; gap: 4px; }
.segmented label { position: relative; display: grid; place-items: center; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 700; cursor: pointer; min-height: 40px; padding: 0 6px; text-align: center; }
.segmented input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segmented label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(40, 20, 120, 0.14); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); }
fieldset { border: none; margin: 0; padding: 0; min-width: 0; }
legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 6px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--surface); padding: 12px 14px; border-radius: var(--r-sm); }
.check.attention { outline: 2px solid var(--err-ink); }
.form-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin-top: 6px; }
.form-actions a { text-align: center; font-weight: 700; padding: 8px; }
.amount-input { font-size: 18px; font-weight: 800; }

/* ---------- Invoice detail ---------- */

.summary-card .who { display: flex; align-items: center; gap: 12px; }
.summary-card .who strong { display: block; font-size: 16px; }
.big-amount { font-size: 40px; font-weight: 800; letter-spacing: -1px; margin-top: 14px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.big-amount .pence { color: var(--faint); }
.progress { margin-top: 16px; }
.progress .track { position: relative; height: 10px; border-radius: 999px; background: #EFEDF6; }
.progress .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); }
.progress .dot { position: absolute; top: -4px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #FFF; border: 3px solid var(--accent); }
.progress.hold .fill { background: #E0A100; } .progress.hold .dot { border-color: #E0A100; }
.progress.rejected .fill { background: var(--err-ink); } .progress.rejected .dot { border-color: var(--err-ink); }
.progress.paid .fill { background: #1F9D5B; } .progress.paid .dot { border-color: #1F9D5B; }
.progress .steps { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 6px; }

.check-banner { background: var(--warn-strong); color: #FFF; border-radius: var(--r-md); padding: 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; font-weight: 600; line-height: 1.45; }
.check-banner .text { display: flex; gap: 10px; }
.check-banner button { align-self: flex-start; background: #FFF; border-color: #FFF; color: #8A3208; }
.check-note { background: var(--warn-bg); color: var(--warn-ink); }

.bank { padding: 4px 16px; }
.bank-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F0EEF6; }
.bank-row:last-child { border-bottom: none; }
.bank-row .k { font-size: 12px; color: var(--muted); }
.bank-row .v { font-size: 17px; font-weight: 800; }
.bank-row > div { flex: 1; min-width: 0; }
.copy { width: 44px; height: 44px; min-height: 44px; padding: 0; border: none; border-radius: 12px; background: var(--bg); color: var(--accent-ink); flex: none; }
.copy.done { background: var(--ok-bg); color: var(--ok-ink); }
.copy-label { font-size: 12px; font-weight: 700; }

.file-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.file-link .chip { background: var(--err-bg); color: var(--err-ink); font-size: 10px; }
.file-link .fname { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-link > div { flex: 1; min-width: 0; }
.preview { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 12px; background: #FFF; margin-top: 12px; }
img.preview { height: auto; max-height: 720px; object-fit: contain; }
details.more > summary { cursor: pointer; font-weight: 700; color: var(--accent-ink); list-style: none; min-height: 36px; display: flex; align-items: center; }
details.more > summary::-webkit-details-marker { display: none; }
.actions-card { display: grid; gap: 10px; }
.actions-card .pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.actions-card form { display: contents; }
.paid-row { display: flex; gap: 10px; align-items: center; }
.paid-row label { flex: none; margin: 0; }
.paid-row input { width: auto; flex: 1; }
ul.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
ul.history .muted { font-size: 12px; display: block; }
@media (min-width: 900px) {
  .detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
}

/* ---------- Pay list (desktop, Admin) ---------- */

.pay-group { margin-bottom: 22px; }
.pay-group .group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 4px 10px; flex-wrap: wrap; }
.pay-group .group-head h2 { margin: 0; font-size: 18px; }
.pay-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: var(--r-md); overflow: hidden; font-size: 14px; }
.pay-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 12px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pay-table td { padding: 12px; border-bottom: 1px solid #F3F1F8; vertical-align: middle; }
.pay-table tr:last-child td { border-bottom: none; }
.pay-table tr.needs-check td { background: #FFF9F5; }
.pay-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.copyable { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.copyable .val { font-weight: 800; font-variant-numeric: tabular-nums; }
.copyable .copy { width: 34px; height: 34px; min-height: 34px; border-radius: 10px; }
.pay-table .payee { font-weight: 700; }
.pay-table .sub { font-size: 12px; color: var(--muted); }
.pay-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.check-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); font-size: 11px; font-weight: 800; margin-top: 4px; }
@media (max-width: 899px) {
  .pay-table, .pay-table tbody, .pay-table tr, .pay-table td { display: block; width: 100%; }
  .pay-table thead { display: none; }
  .pay-table tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .pay-table td { border: none; padding: 6px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .pay-table td[data-label]::before { content: attr(data-label); font-size: 12px; color: var(--muted); font-weight: 600; }
  .pay-table .num { text-align: left; }
}

/* ---------- Generic admin tables ---------- */

.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--r-md); margin-bottom: 18px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { padding: 12px; border-bottom: 1px solid #F3F1F8; text-align: left; vertical-align: middle; }
table.list th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); white-space: nowrap; }
table.list tr:last-child td { border-bottom: none; }
table.list .num { text-align: right; font-variant-numeric: tabular-nums; }
tr.inactive td { color: var(--faint); }
ul.plain { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
details.reset summary { cursor: pointer; color: var(--accent-ink); font-weight: 700; }
details.reset form { margin-top: 8px; min-width: 240px; }
.link-list { display: grid; gap: 8px; }
.link-list a { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border-radius: var(--r-md); text-decoration: none; color: var(--ink); font-weight: 700; }
.link-list a .go { margin-left: auto; color: var(--muted); }

/* ---------- Sign-in ---------- */

.auth { max-width: 420px; margin: 24px auto 0; }
.auth.card { padding: 24px; }
.auth h1 { margin-bottom: 6px; }

/* ---------- Utilities (no inline styles: the CSP blocks them) ---------- */

.strong-link { font-weight: 700; text-decoration: none; }
.plain-link { color: inherit; text-decoration: none; }
.plain-link:hover { text-decoration: underline; }
.grow-text { min-width: 0; }
.meta-line { margin-top: 4px; }
.edit-line { margin: 14px 0 0; }
.ink { color: var(--ink); }
th.right { text-align: right; }
.link-list.spaced { margin-bottom: 14px; }
.icon-ok { background: var(--ok-bg); color: var(--ok-ink); }
.icon-hold { background: var(--hold-bg); color: var(--hold-ink); }
.inv .status { display: block; }
.progress .p-8 { --p: 8%; }
.progress .p-50 { --p: 50%; }
.progress .p-100 { --p: 100%; }
.progress .fill { width: var(--p, 0%); }
.progress .dot { left: var(--p, 0%); }

/* Same column widths in every account group on desktop. */
@media (min-width: 900px) {
  .pay-table { table-layout: fixed; }
  .pay-table th:nth-child(1) { width: 24%; }
  .pay-table th:nth-child(2) { width: 13%; }
  .pay-table th:nth-child(3) { width: 14%; }
  .pay-table th:nth-child(4) { width: 15%; }
  .pay-table th:nth-child(5) { width: 12%; }
  .pay-table th:nth-child(6) { width: 8%; }
  .pay-table th:nth-child(7) { width: 14%; }
  .pay-table .num .copyable { justify-content: flex-end; }
}

/* iOS Safari draws date inputs wider than their column; keep them inside it. */
input[type="date"] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; display: block; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.optional { font-weight: 500; color: var(--faint); }
@media (max-width: 560px) {
  .invoice-form .stack-sm { grid-column: 1 / -1; }
}

/* Long names never run into the amount. */
.inv .meta { overflow: hidden; }
.inv .right { max-width: 45%; }

/* Admin tables become stacked rows on phones. */
@media (max-width: 700px) {
  table.list.stack thead { display: none; }
  table.list.stack, table.list.stack tbody, table.list.stack tr, table.list.stack td { display: block; width: 100%; }
  table.list.stack tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.list.stack td { border: none; padding: 4px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  table.list.stack td::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; }
}
