/* MHWIC design system.
   1 tokens · 2 base · 3 shell (desktop) · 4 components · 5 dashboards · 6 public pages
   7 phone and tablet layout (<= 860px) · 8 print */

/* ------------------------------------------------------------------ 1 tokens */
:root {
  --bg: #f6f8fb; --surface: #fff; --sunken: #f9fafc;
  --ink: #0a2540; --ink-2: #3c4f64; --muted: #5f6f85; --faint: #8a97a8;
  --line: #e6ebf1; --line-2: #d3dae3;
  --brand: #0a7f5f; --brand-2: #086b50; --brand-ink: #075e47; --brand-soft: #e7f6f0; --brand-ring: rgba(10, 127, 95, .22);
  --link: #087a5b;
  --ok: #0b6b47; --ok-bg: #dff5ea; --warn: #8a5300; --warn-bg: #fdf0d3;
  --bad: #b3261e; --bad-bg: #fde8e6; --info: #1f5fbf; --info-bg: #e7f0fd;
  --r-s: 6px; --r: 8px; --r-l: 12px; --r-xl: 16px;
  --sh-1: 0 0 0 1px rgba(10, 37, 64, .06), 0 1px 2px rgba(10, 37, 64, .06);
  --sh-2: 0 0 0 1px rgba(10, 37, 64, .05), 0 2px 5px rgba(50, 50, 93, .09), 0 1px 2px rgba(0, 0, 0, .05);
  --sh-pop: 0 0 0 1px rgba(10, 37, 64, .06), 0 18px 40px rgba(50, 50, 93, .2), 0 6px 14px rgba(0, 0, 0, .1);
  --mesh: radial-gradient(900px 520px at 0% 0%, #11b585 0%, transparent 58%),
          radial-gradient(760px 480px at 105% 8%, #1c6bd6 0%, transparent 55%),
          radial-gradient(620px 460px at 62% 118%, #f0b03a 0%, transparent 48%), #0a2540;
  --hover: #fafcfe; --track: #e9eef3; --line-3: #bcc6d2; --field: #fff; --select: #c9efe1; --info-ink: #17437f;
  --glass: rgba(246, 248, 251, .82); --glass-2: rgba(255, 255, 255, .9); --inverse: #0a2540;
  color-scheme: light;
  --side-w: 244px; --bar-h: 56px;
  --font: "Inter var", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}

/* dark theme: app.js sets data-theme on <html> from the saved choice, or the device setting */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a111e; --surface: #121b2d; --sunken: #0e1626; --field: #0d1524;
  --ink: #e9eff8; --ink-2: #c3cede; --muted: #94a3b8; --faint: #6c7c93;
  --line: #212d43; --line-2: #2d3b55; --line-3: #40516f; --hover: #17223a; --track: #25324b;
  --brand: #0f9d75; --brand-2: #12b085; --brand-ink: #7fe6c4; --brand-soft: rgba(17, 181, 133, .16); --brand-ring: rgba(21, 189, 140, .35);
  --link: #56d6ab;
  --ok: #62e0aa; --ok-bg: rgba(46, 204, 143, .14); --warn: #f6c76f; --warn-bg: rgba(240, 176, 58, .15);
  --bad: #ff948b; --bad-bg: rgba(255, 99, 88, .15); --info: #8fbcff; --info-bg: rgba(74, 144, 255, .16); --info-ink: #b3d1ff;
  --select: rgba(17, 181, 133, .4); --inverse: #2a3855;
  --glass: rgba(10, 17, 30, .78); --glass-2: rgba(18, 27, 45, .9);
  --sh-1: 0 0 0 1px rgba(255, 255, 255, .07), 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 0 0 1px rgba(255, 255, 255, .1), 0 4px 12px rgba(0, 0, 0, .45);
  --sh-pop: 0 0 0 1px rgba(255, 255, 255, .1), 0 24px 60px rgba(0, 0, 0, .65);
}
[data-theme="dark"] .btn.secondary, [data-theme="dark"] .btn.danger, [data-theme="dark"] td .btn.small:not(.danger):not(.secondary), [data-theme="dark"] .chip, [data-theme="dark"] kbd { background: #1a2640; }
[data-theme="dark"] .btn.secondary:hover { background: #20304f; }
[data-theme="dark"] .tabs a.on { background: #33415c; box-shadow: none; }
[data-theme="dark"] .badge-closed, [data-theme="dark"] .badge-withdrawn, [data-theme="dark"] .badge-dormant, [data-theme="dark"] .badge-deceased, [data-theme="dark"] .badge-exempted { background: var(--track); }
[data-theme="dark"] .modal-backdrop, [data-theme="dark"] .palette, [data-theme="dark"] .scrim { background: rgba(2, 6, 14, .66); }
[data-theme="dark"] .wallet { box-shadow: 0 12px 30px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .14); }
[data-theme="dark"] .quick a.primary { color: #fff; }
[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.8); }
[data-theme="dark"] body.public { background: var(--surface); }
.theme-btn .moon, [data-theme="dark"] .theme-btn .sun { display: none; }
[data-theme="dark"] .theme-btn .moon { display: block; }
.public-theme { position: fixed; top: 14px; right: 14px; z-index: 5; }

/* -------------------------------------------------------------------- 2 base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--link); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -.022em; margin: 0 0 6px; }
h1 + p.muted { margin: 0 0 22px; max-width: 76ch; font-size: 14.5px; }
h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; margin: 34px 0 12px; }
h2 + p.muted { margin: -6px 0 12px; }
p { margin: 0 0 12px; }
strong { font-weight: 650; }
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--select); }
.cur { font-size: .52em; font-weight: 600; letter-spacing: .04em; color: var(--muted); margin-right: .35em; vertical-align: .32em; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }

/* thin progress bar while HTMX talks to the server */
#progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: linear-gradient(90deg, #11b585, #1c6bd6); z-index: 100; opacity: 0; pointer-events: none; }
.loading #progress { opacity: 1; width: 85%; transition: width 8s cubic-bezier(.1, .7, .1, 1), opacity .1s; }

/* ------------------------------------------------------- 3 shell (desktop) */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); view-transition-name: side; z-index: 40; }
.side-head { padding: 16px 16px 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 32px; height: 32px; flex: none; border-radius: 9px; box-shadow: 0 1px 2px rgba(10, 37, 64, .25), inset 0 1px 0 rgba(255, 255, 255, .25); }
.brand .name { display: flex; flex-direction: column; line-height: 1.15; font-size: 15px; }
.brand .name small { font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.jump { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 14px; padding: 7px 10px; font: inherit; font-size: 13px; color: var(--muted); background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; transition: border-color .15s, background .15s; }
.jump:hover { border-color: var(--line-2); background: var(--surface); }
.jump span { flex: 1; text-align: left; }
kbd { font: 600 10.5px var(--font); color: var(--muted); background: var(--surface); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; }

.nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.nav-group { margin: 18px 10px 6px; font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin: 1px 0; border-radius: var(--r); color: var(--ink-2); font-weight: 500; transition: background .12s, color .12s; }
.nav a svg { color: var(--faint); transition: color .12s; }
.nav a:hover { background: var(--sunken); color: var(--ink); text-decoration: none; }
.nav a:hover svg { color: var(--ink-2); }
.nav a.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
.nav a.on svg { color: var(--brand); }

.side-foot { border-top: 1px solid var(--line); padding: 10px; }
.side-foot .switch { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r); color: var(--ink-2); font-size: 13px; }
.side-foot button.switch { width: 100%; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; }
.side-foot .switch:hover { background: var(--sunken); text-decoration: none; }
.side-foot .switch svg { color: var(--faint); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px 4px; }
.me .who { min-width: 0; flex: 1; line-height: 1.25; }
.me .who b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who small { color: var(--muted); font-size: 12px; }
.me form { margin: 0; }
.avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; font-weight: 700; font-size: 13px; color: #fff; background: linear-gradient(135deg, #11b585, #1c6bd6); }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--r); background: none; color: var(--muted); cursor: pointer; transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.appbar { position: sticky; top: 0; z-index: 30; height: var(--bar-h); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--glass); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; view-transition-name: appbar; }
.scrolled .appbar { border-bottom-color: var(--line); }
.appbar .brand { display: none; }
.crumb { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumb b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb .sep { color: var(--line-2); }
.appbar .spacer { flex: 1; }
.appbar .only-phone { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--surface); box-shadow: var(--sh-1); }
.chip:hover { text-decoration: none; color: var(--ink); box-shadow: var(--sh-2); }
.chip svg { width: 15px; height: 15px; color: var(--faint); }

main { width: 100%; max-width: 1320px; margin: 0 auto; padding: 18px 28px 72px; }
.tabbar, .scrim { display: none; }

/* command palette */
.palette { position: fixed; inset: 0; z-index: 90; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; background: rgba(10, 37, 64, .38); backdrop-filter: blur(3px); animation: fade .12s ease-out; }
.palette[hidden] { display: none; }
.palette-box { width: 100%; max-width: 560px; background: var(--surface); border-radius: 14px; box-shadow: var(--sh-pop); overflow: hidden; animation: pop .16s cubic-bezier(.2, .9, .3, 1.2); }
.palette-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-in input { flex: 1; border: 0; outline: 0; box-shadow: none; padding: 0; font-size: 16px; background: none; min-height: 0; }
.palette-in input:focus { box-shadow: none; border: 0; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
.palette li a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r); color: var(--ink); font-weight: 500; }
.palette li a small { margin-left: auto; color: var(--faint); font-weight: 500; }
.palette li a svg { color: var(--faint); }
.palette li.sel a { background: var(--brand-soft); color: var(--brand-ink); text-decoration: none; }
.palette li.sel a svg { color: var(--brand); }
.palette .none { padding: 22px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------ 4 components */
.card { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-1); padding: 18px 20px; }
.card h2:first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.kpi { display: flex; flex-direction: column; gap: 2px; transition: box-shadow .18s, transform .18s; }
.kpi:hover { box-shadow: var(--sh-2); }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.kpi .value { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #11b585, var(--brand)); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.toolbar label { color: var(--muted); font-size: 13px; font-weight: 550; display: inline-flex; align-items: center; gap: 8px; }
.toolbar + p.muted { margin-top: -6px; margin-bottom: 20px; }

input, select, textarea { font: inherit; color: var(--ink); min-height: 36px; padding: 6px 11px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--field); box-shadow: 0 1px 1px rgba(10, 37, 64, .04); transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
textarea { min-height: 84px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235f6f85' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 9px center; }
input[type=checkbox], input[type=radio] { min-height: 0; width: 17px; height: 17px; padding: 0; accent-color: var(--brand); box-shadow: none; vertical-align: -3px; cursor: pointer; }
input[type=search] { min-width: 280px; padding-left: 34px; background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a97a8' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='m13.5 13.5-3-3'/%3E%3C/svg%3E") no-repeat 11px center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 14px; font: inherit; font-weight: 600; font-size: 13.5px; line-height: 1.2; white-space: nowrap; color: #fff; background: var(--brand); border: 0; border-radius: var(--r); cursor: pointer; box-shadow: 0 1px 2px rgba(10, 37, 64, .2), inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 0 0 1px rgba(0, 0, 0, .08); transition: background .15s, box-shadow .15s, transform .08s; }
.btn:hover { background: var(--brand-2); text-decoration: none; box-shadow: 0 3px 8px rgba(10, 127, 95, .28), inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 0 0 1px rgba(0, 0, 0, .08); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--brand-ring), 0 0 0 1px var(--brand); }
.btn.secondary, .btn.danger { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.btn.secondary:hover, .btn.danger:hover { background: var(--surface); box-shadow: var(--sh-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.small { min-height: 28px; padding: 3px 10px; font-size: 12.5px; border-radius: var(--r-s); }
.btn[disabled] { opacity: .55; cursor: wait; }
button.link { background: none; border: 0; color: var(--link); cursor: pointer; font: inherit; font-weight: 500; padding: 0; }
button.link:hover { text-decoration: underline; }
.htmx-indicator { opacity: 0; transition: opacity .2s; color: var(--muted); font-size: 13px; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-1); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
table { border-collapse: collapse; width: 100%; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
/* the actions column stays in view when a wide table scrolls sideways (app.js adds .has-actions) */
.has-actions thead th:last-child, .has-actions tbody td:last-child { position: sticky; right: 0; text-align: right; }
.has-actions tbody td:last-child { background: var(--surface); }
.has-actions tbody tr:hover td:last-child { background: var(--hover); }
.has-actions.is-scrolling tbody td:last-child, .has-actions.is-scrolling thead th:last-child { box-shadow: -10px 0 12px -10px rgba(10, 37, 64, .16); }
/* row actions are quiet: a column of solid buttons would shout */
td .btn.small:not(.danger):not(.secondary) { background: var(--surface); color: var(--brand-ink); box-shadow: var(--sh-1); }
td .btn.small:not(.danger):not(.secondary):hover { background: var(--brand-soft); box-shadow: var(--sh-2); }
th, td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--sunken); padding-top: 9px; padding-bottom: 9px; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--hover); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 240px; }
td.pre { white-space: pre; }
td .muted { font-size: 12.5px; }
tfoot td { font-weight: 650; background: var(--sunken); border-top: 1px solid var(--line); border-bottom: 0; }
td form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
td select { min-height: 28px; padding-top: 2px; padding-bottom: 2px; font-size: 12.5px; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); margin: 0; }
.empty::before { content: ""; display: block; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 50%; background: var(--sunken) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%238a97a8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 11h4l1.2 2.5h4.6L13.5 11h4'/%3E%3Cpath d='M4.6 4h10.8l2.1 7v4.2a.8.8 0 0 1-.8.8H3.3a.8.8 0 0 1-.8-.8V11z'/%3E%3C/svg%3E") no-repeat center; box-shadow: inset 0 0 0 1px var(--line); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--info-bg); color: var(--info); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-paid, .badge-successful, .badge-confirmed, .badge-active, .badge-approved, .badge-passed, .badge-disbursed, .badge-admitted { background: var(--ok-bg); color: var(--ok); }
.badge-partial, .badge-awaiting_approval, .badge-submitted, .badge-pending, .badge-pending_payment, .badge-verified, .badge-applied, .badge-proposed, .badge-requested, .badge-voting, .badge-open, .badge-exiting { background: var(--warn-bg); color: var(--warn); }
.badge-overdue, .badge-rejected, .badge-failed, .badge-unpaid, .badge-no_quorum, .badge-suspended { background: var(--bad-bg); color: var(--bad); }
.badge-closed, .badge-withdrawn, .badge-dormant, .badge-deceased, .badge-exempted { background: var(--track); color: var(--ink-2); }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; padding: 3px; width: fit-content; max-width: 100%; overflow-x: auto; background: var(--track); border-radius: 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 5px 12px; border-radius: 7px; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ink-2); transition: background .15s, color .15s; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(10, 37, 64, .14), 0 0 0 1px rgba(10, 37, 64, .04); }

.form p { margin: 0 0 16px; }
.form label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.form input, .form select, .form textarea { width: 100%; }
.form input[type=checkbox], .form input[type=radio] { width: 17px; }
.form p:has(> input[type=checkbox]) { display: grid; grid-template-columns: 17px 1fr; column-gap: 10px; align-items: start; }
.form p:has(> input[type=checkbox]) > input { grid-column: 1; grid-row: 1; margin-top: 2px; }
.form p:has(> input[type=checkbox]) > label { grid-column: 2; grid-row: 1; margin: 0; font-weight: 500; }
.form p:has(> input[type=checkbox]) > .helptext { grid-column: 2; }
.form .helptext { display: block; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.form .helptext ul { margin: 4px 0 0; padding-left: 18px; }
.form > .btn + .btn { margin-left: 6px; }
.errorlist { list-style: none; margin: 0 0 6px; padding: 0; color: var(--bad); font-size: 13px; font-weight: 550; }
.errorlist + p input, .errorlist + p select, .errorlist + p textarea { border-color: var(--bad); }
.card:has(> form.form) { max-width: 620px; }

.flash, .notice { position: relative; padding: 11px 14px 11px 40px; border-radius: var(--r); margin: 0 0 16px; background: var(--info-bg); color: var(--info-ink); font-weight: 500; box-shadow: inset 0 0 0 1px rgba(31, 95, 191, .14); }
.flash::before, .notice::before { content: ""; position: absolute; left: 13px; top: 12px; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm-.75-9.25h1.5v5h-1.5v-5ZM10 5.5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z'/%3E%3C/svg%3E"); }
.flash-success, .notice.ok { background: var(--ok-bg); color: var(--ok); box-shadow: inset 0 0 0 1px rgba(11, 107, 71, .16); }
.flash-success::before, .notice.ok::before { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.7-9.8-4.2 4.6-2.2-2.1 1-1.1 1.1 1 3.2-3.4 1.1 1Z'/%3E%3C/svg%3E"); }
.notice.warn, .flash-warning { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px rgba(138, 83, 0, .16); }
.flash-error, .notice.bad { background: var(--bad-bg); color: var(--bad); box-shadow: inset 0 0 0 1px rgba(179, 38, 30, .16); }
.notice a, .flash a { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 650; }

.modal-backdrop { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-start; justify-content: center; padding: 9vh 16px 24px; overflow-y: auto; background: rgba(10, 37, 64, .42); backdrop-filter: blur(3px); animation: fade .14s ease-out; }
.modal { position: relative; width: 100%; max-width: 500px; background: var(--surface); border-radius: 14px; padding: 22px 24px 20px; box-shadow: var(--sh-pop); animation: pop .2s cubic-bezier(.2, .9, .3, 1.15); }
.modal h2 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.015em; }
.modal h2 + p.muted { margin: 0 0 16px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes rise { from { transform: translateY(100%); } }

#toast { position: fixed; bottom: 24px; left: 50%; z-index: 95; display: flex; align-items: center; gap: 10px; max-width: min(92vw, 520px); padding: 11px 16px 11px 14px; border-radius: 12px; background: var(--inverse); color: #fff; font-weight: 550; box-shadow: var(--sh-pop); transform: translate(-50%, 24px) scale(.96); opacity: 0; pointer-events: none; transition: transform .28s cubic-bezier(.2, .9, .3, 1.2), opacity .2s; }
#toast::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; background: #2bd4a0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%230a2540' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 9.3 2.4 2.3 4.6-5'/%3E%3C/svg%3E") center no-repeat; }
#toast.show { transform: translate(-50%, 0) scale(1); opacity: 1; }

dl.kv { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: 9px 22px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
dl.kv dd:last-of-type { font-weight: 700; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.vote-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.report-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.report-list a.card { position: relative; display: block; padding-right: 40px; color: var(--muted); font-weight: 400; transition: box-shadow .18s, transform .18s; }
.report-list a.card:hover { text-decoration: none; box-shadow: var(--sh-2); transform: translateY(-1px); }
.report-list a.card strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 14.5px; }
.report-list a.card::after { content: "→"; position: absolute; right: 18px; top: 16px; color: var(--faint); transition: transform .18s, color .18s; }
.report-list a.card:hover::after { transform: translateX(3px); color: var(--brand); }

/* ------------------------------------------------------------ 5 dashboards */
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 14px; align-items: stretch; }
.hero-card { padding: 22px 24px; display: flex; flex-direction: column; }
.hero-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.hero-value { font-size: 38px; line-height: 1.15; font-weight: 680; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.ring { --p: 0; position: relative; flex: none; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--track) 0); }
.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.ring small { position: relative; display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); text-align: center; margin-top: -3px; }
.ring div { position: relative; text-align: center; line-height: 1.2; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.stat-row > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stat-row span { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.stat-row strong { font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-row a { font-size: 12.5px; }
.chart { display: flex; align-items: flex-end; gap: 14px; height: 132px; margin-top: 22px; padding-top: 6px; }
.chart .c { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.chart .c:hover { text-decoration: none; color: var(--ink); }
.chart .track { position: relative; width: 100%; max-width: 46px; min-height: 4px; border-radius: 6px 6px 3px 3px; background: var(--track); overflow: hidden; transition: filter .15s; }
.chart .fill { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, #15bd8c, var(--brand)); border-radius: 6px 6px 0 0; }
.chart .c.on .track { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand-ring); }
.chart .c:hover .track { filter: brightness(.96); }
.legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--brand); }
.legend i.x { background: var(--track); }

.tasks { padding: 18px 10px 10px; }
.tasks h2 { margin: 0 10px 8px; }
.task { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r); color: var(--ink); font-weight: 550; transition: background .12s; }
.task:hover { background: var(--sunken); text-decoration: none; }
.task .n { flex: none; min-width: 34px; height: 34px; padding: 0 8px; display: grid; place-items: center; border-radius: 10px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--track); color: var(--muted); }
.task.hot .n { background: var(--warn-bg); color: var(--warn); }
.task .t { flex: 1; min-width: 0; line-height: 1.3; }
.task .t small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.task svg { color: var(--faint); width: 16px; height: 16px; transition: transform .15s; }
.task:hover svg { transform: translateX(2px); color: var(--ink-2); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.page-head .spacer { flex: 1; }

/* member wallet */
.wallet { position: relative; overflow: hidden; color: #fff; background: var(--mesh); border-radius: var(--r-xl); padding: 24px 26px; box-shadow: 0 12px 30px rgba(10, 37, 64, .22), inset 0 1px 0 rgba(255, 255, 255, .18); }
.wallet::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 37, 64, 0) 30%, rgba(10, 37, 64, .35)); pointer-events: none; }
.wallet > * { position: relative; z-index: 1; }
.wallet .eyebrow { color: rgba(255, 255, 255, .8); }
.wallet .cur { color: rgba(255, 255, 255, .78); }
.wallet-value { font-size: 44px; line-height: 1.1; font-weight: 680; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin: 8px 0 4px; }
.wallet-sub { color: rgba(255, 255, 255, .82); font-size: 13px; }
.wallet-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px 20px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .2); }
.wallet-stats span { display: block; font-size: 12px; color: rgba(255, 255, 255, .78); font-weight: 550; }
.wallet-stats strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.wallet-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 14px; align-items: stretch; margin-bottom: 18px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick a { display: flex; flex-direction: column; justify-content: flex-start; gap: 14px; padding: 14px; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-1); color: var(--ink); font-weight: 600; transition: box-shadow .18s, transform .18s; }
.quick a:hover { text-decoration: none; box-shadow: var(--sh-2); transform: translateY(-1px); }
.quick a small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.quick .ic { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.quick a.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(10, 127, 95, .3), inset 0 1px 0 rgba(255, 255, 255, .18); }
.quick a.primary small { color: rgba(255, 255, 255, .85); }
.quick a.primary .ic { background: rgba(255, 255, 255, .18); color: #fff; }
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(s); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-weight: 700; font-size: 12.5px; background: var(--brand-soft); color: var(--brand-ink); }

/* receipt */
.receipt { max-width: 520px; margin: 8px auto; padding: 0; overflow: hidden; box-shadow: var(--sh-2); }
.receipt-top { padding: 26px 28px 22px; text-align: center; background: var(--sunken); border-bottom: 1px dashed var(--line-2); }
.receipt-top .mark { width: 40px; height: 40px; border-radius: 11px; margin-bottom: 10px; }
.receipt-top h1 { font-size: 15px; letter-spacing: 0; margin: 0; }
.receipt-amount { font-size: 34px; font-weight: 680; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin: 14px 0 6px; }
.receipt-body { padding: 22px 28px 24px; }
.receipt dl.kv dd { text-align: right; }
.receipt dl.kv dd:last-of-type { font-weight: 550; }
.receipt .code { font-family: var(--mono); letter-spacing: .08em; }
.receipt-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; }

/* ---------------------------------------------------------- 6 public pages */
body.public { background: var(--surface); }
.public-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 46%) 1fr; }
.public-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 44px 52px; color: #fff; background: var(--mesh); }
.public-brand::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 50% 120%, rgba(10, 37, 64, .55), transparent 60%); pointer-events: none; }
.public-brand > * { position: relative; z-index: 1; }
.public-brand .brand { color: #fff; }
.public-brand .brand .name small { color: rgba(255, 255, 255, .8); }
.public-brand h2 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; letter-spacing: -.035em; font-weight: 700; margin: 0 0 18px; max-width: 12ch; }
.public-brand ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 40ch; font-size: 15px; color: rgba(255, 255, 255, .92); }
.public-brand li { display: flex; gap: 12px; align-items: flex-start; }
.public-brand li svg { margin-top: 2px; color: #7df0c8; }
.public-brand footer { font-size: 12.5px; color: rgba(255, 255, 255, .7); }
.public-main { display: grid; place-items: center; padding: 40px 24px; }
.public-main > .inner { width: 100%; max-width: 400px; }
.public-main > .inner:has(.wide) { max-width: 500px; }
.public .card.login { max-width: none !important; margin: 0; padding: 0; box-shadow: none; background: none; }
.public .login h1 { font-size: 26px; margin-bottom: 6px; }
.public .login h1 + p.muted { margin-bottom: 26px; }
.public .login .form > .btn { width: 100%; min-height: 42px; font-size: 14.5px; margin: 6px 0 0; }
.public .login .form > .btn.secondary { margin-top: 10px; margin-left: 0; }
.public .login > p:last-child, .public .login .alt { margin-top: 22px; color: var(--muted); text-align: center; }
.public .flash { margin-bottom: 20px; }
.login { max-width: 420px; margin: 6vh auto; }

/* ------------------------------------------- 7 phone and tablet (<= 860px) */
@media (max-width: 860px) {
  :root { --bar-h: 52px; }
  body { font-size: 15px; }
  .shell { display: block; }
  input, select, textarea { font-size: 16px; min-height: 44px; }   /* 16px stops iOS zooming on focus */
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; }
  .btn { min-height: 44px; padding: 10px 16px; font-size: 15px; }
  .btn.small { min-height: 36px; padding: 6px 12px; font-size: 13.5px; border-radius: var(--r); }
  td select { min-height: 36px; font-size: 15px; }

  .appbar { padding: 0 6px 0 14px; padding-top: env(safe-area-inset-top); height: calc(var(--bar-h) + env(safe-area-inset-top)); background: var(--glass-2); border-bottom-color: var(--line); gap: 4px; }
  .appbar .brand { display: flex; }
  .appbar .brand .mark { width: 28px; height: 28px; border-radius: 8px; }
  .appbar .brand .name { font-size: 15px; }
  .appbar .crumb, .appbar .chip { display: none; }
  .appbar .only-phone { display: grid; }
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn svg.i { width: 21px; height: 21px; }
  .appbar .avatar { width: 30px; height: 30px; font-size: 12.5px; }

  main { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 22px; }
  h1 + p.muted { font-size: 14.5px; margin-bottom: 16px; }
  h2 { margin-top: 28px; }

  /* bottom tab bar */
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: var(--glass-2); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-top: 1px solid var(--line); view-transition-name: tabbar; }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px; border: 0; background: none; font: inherit; font-size: 10.5px; font-weight: 600; color: var(--muted); border-radius: 10px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar svg.i { width: 23px; height: 23px; stroke-width: 1.6; }
  .tabbar a.on { color: var(--brand); }
  .tabbar a:active, .tabbar button:active { background: var(--sunken); }
  .tabbar .fab { color: #fff; }
  .tabbar .fab span.ic { width: 46px; height: 30px; display: grid; place-items: center; border-radius: 12px; background: var(--brand); box-shadow: 0 4px 10px rgba(10, 127, 95, .35); }
  .tabbar .fab b { color: var(--brand-ink); font-weight: 600; }

  /* the sidebar becomes a sheet opened from "More" */
  .side { position: fixed; inset: auto 0 0 0; height: auto; max-height: 88dvh; border-right: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(10, 37, 64, .25); transform: translateY(105%); transition: transform .32s cubic-bezier(.2, .85, .25, 1); z-index: 60; padding-bottom: env(safe-area-inset-bottom); view-transition-name: none; }
  .side::before { content: ""; width: 38px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: var(--line-2); flex: none; }
  .side.open { transform: none; }
  .side-head { padding: 8px 16px 6px; }
  .side-head .jump { display: none; }
  .nav { padding: 0 8px 8px; }
  .nav a { padding: 11px 12px; font-size: 15.5px; gap: 14px; }
  .nav a svg { width: 21px; height: 21px; }
  .side-foot .switch, .side-foot button.switch { padding: 11px 12px; font-size: 15px; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10, 37, 64, .45); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .scrim.open { opacity: 1; pointer-events: auto; }

  .palette { padding: 0; align-items: stretch; background: var(--surface); backdrop-filter: none; }
  .palette-box { max-width: none; border-radius: 0; box-shadow: none; animation: none; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
  .palette ul { max-height: none; flex: 1; }
  .palette li a { padding: 13px 12px; font-size: 16px; }

  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 14px; }
  .kpi .value { font-size: 17px; }
  .kpi .label { font-size: 12px; }
  .dash-grid, .wallet-grid { grid-template-columns: 1fr; }
  .hero-card { padding: 18px 16px; }
  .hero-value { font-size: 30px; }
  .ring { width: 76px; height: 76px; }
  .ring::before { inset: 8px; }
  .ring span { font-size: 16px; }
  .stat-row { gap: 10px; grid-template-columns: 1.5fr 1fr 1fr; }
  .stat-row strong { font-size: 14.5px; }
  .chart { height: 110px; gap: 8px; }
  .task { padding: 12px 10px; }
  .wallet { padding: 20px 18px; border-radius: 18px; }
  .wallet-value { font-size: 36px; }
  .wallet-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .wallet-stats strong { font-size: 14px; }
  .quick a { padding: 12px; gap: 10px; }
  .split { grid-template-columns: 1fr; }
  dl.kv { grid-template-columns: minmax(96px, max-content) 1fr; gap: 8px 14px; }
  .report-list { grid-template-columns: 1fr; gap: 10px; }

  .toolbar { gap: 8px; }
  .toolbar > input[type=search], .toolbar > select { flex: 1 1 100%; min-width: 0; }
  .toolbar > .btn { flex: 1 1 auto; }
  .toolbar .spacer { display: none; }
  .toolbar > h1 { flex: 1 1 100%; }
  .page-head .spacer, .page-head label { display: none; }
  .page-head > div { flex: 1 1 100%; }
  .page-head select { flex: 1 1 100%; }
  .actions-row .btn, .vote-bar .btn { flex: 1 1 auto; }
  .card:has(> form.form) { max-width: none; }
  .form > .btn { width: 100%; margin: 0 0 8px !important; }

  /* tables turn into a list of cards; app.js copies each column heading onto its cells and picks a title cell */
  .table-wrap { overflow: visible; background: none; box-shadow: none; border-radius: 0; }
  table, tbody, tfoot { display: block; width: auto; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .has-actions thead th:last-child, .has-actions tbody td:last-child { position: static; box-shadow: none !important; }
  tbody tr, tfoot tr { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-1); padding: 14px; margin-bottom: 10px; }
  tbody tr:hover { background: var(--surface); }
  td, th:first-child, td:first-child, th:last-child, td:last-child, tbody tr:last-child td { display: block; padding: 0; border: 0; white-space: normal; text-align: left; min-width: 0; overflow-wrap: anywhere; background: none !important; }
  td::before { content: attr(data-label); display: block; margin-bottom: 1px; color: var(--muted); font-size: 12px; font-weight: 550; }
  td[data-label=""]::before, td:not([data-label])::before, td.is-title::before { content: none; }
  td.is-empty { display: none; }
  td.pre { white-space: normal; }
  td.num, th.num { font-weight: 600; text-align: left; }
  td.is-title { order: -1; grid-column: 1 / -1; font-size: 16px; font-weight: 650; padding-bottom: 12px !important; border-bottom: 1px solid var(--line) !important; }
  td.is-title a { color: var(--ink); font-weight: 650; }
  td.wrap, td[data-label=""], td:has(form), td:not([data-label]) { grid-column: 1 / -1; }
  td[data-label=""] { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px !important; border-top: 1px solid var(--line) !important; }
  td[data-label=""] > .btn, td[data-label=""] > form { flex: 1 1 auto; }
  td[data-label=""] > .muted { font-size: 13.5px; }
  td.is-check { position: absolute; top: 12px; right: 14px; z-index: 1; }
  td.is-check::before { content: none; }
  tr:has(td.is-check) td.is-title { padding-right: 36px !important; }
  td form { flex-wrap: wrap; width: 100%; }
  td form select { flex: 1 1 140px; }
  td form .btn { flex: 1 1 auto; }
  tfoot tr { background: var(--inverse); color: #fff; }
  tfoot td::before { color: rgba(255, 255, 255, .7); }
  .empty { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--sh-1); }

  /* dialogs become bottom sheets */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none; max-height: 92dvh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 26px 16px calc(16px + env(safe-area-inset-bottom)); animation: rise .3s cubic-bezier(.2, .85, .25, 1); }
  .modal::before { content: ""; position: absolute; top: 8px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--line-2); }
  .modal .actions { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); margin: 20px -16px calc(-16px - env(safe-area-inset-bottom)); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); }
  .modal .actions .btn { flex: 1; }
  #toast { bottom: calc(78px + env(safe-area-inset-bottom)); }

  .public-wrap { display: block; }
  .public-brand { padding: 26px 22px 30px; gap: 22px; }
  .public-brand h2 { font-size: 28px; max-width: none; margin-bottom: 0; }
  .public-brand ul, .public-brand footer { display: none; }
  .public-main { display: block; padding: 0; margin-top: -16px; position: relative; z-index: 2; }
  .public-main > .inner { max-width: none !important; background: var(--surface); border-radius: 18px 18px 0 0; padding: 26px 20px 40px; }
  .public .login .form > .btn { min-height: 48px; font-size: 16px; }
  .receipt-top, .receipt-body { padding-left: 18px; padding-right: 18px; }
  .receipt dl.kv dd { text-align: right; }
}
@media (max-width: 350px) {
  .wallet-stats { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  @view-transition { navigation: none; }
}

/* ------------------------------------------------------------------ 8 print */
@media print {
  .side, .appbar, .tabbar, .scrim, .no-print, #toast, #modal, #progress, .palette { display: none !important; }
  .shell { display: block; }
  body { background: var(--surface); font-size: 12px; }
  main { margin: 0; padding: 0; max-width: none; }
  .card, .table-wrap { box-shadow: none; border: 1px solid #999; }
  th { background: none; }
}
