:root {
  --bg: #f1f8ff;
  --surface: #ffffff;
  --fg: #14324f;
  --muted: #5f7b95;
  --line: #d9e8f6;
  --accent: #2b8be6;
  --accent-dark: #1a67b8;
  --accent-fg: #ffffff;
  --soft: #e4f1fd; --bar: #bcdcfa;
  --sun: #ffc94d;
  --ok: #17794f; --ok-bg: #dcf2e7;
  --warn: #8a5a00; --warn-bg: #fdefcb;
  --bad: #a3261f; --bad-bg: #fbdedb;
  --ring-a: 17%; --glow-a: 11%;
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1b2a; --surface: #15283b; --fg: #e6f1fb; --muted: #8fa9c2; --line: #243b52;
    --accent: #4aa3f5; --accent-dark: #7bbcf8; --accent-fg: #06213a; --soft: #17314a; --bar: #2c5a85; --sun: #f2c04a;
    --ok: #5fd6a0; --ok-bg: #123a2a; --warn: #f0c261; --warn-bg: #3a2d0e; --bad: #f08a82; --bad-bg: #3d1916;
    --ring-a: 24%; --glow-a: 15%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0e1b2a; --surface: #15283b; --fg: #e6f1fb; --muted: #8fa9c2; --line: #243b52;
    --accent: #4aa3f5; --accent-dark: #7bbcf8; --accent-fg: #06213a; --soft: #17314a; --bar: #2c5a85; --sun: #f2c04a;
    --ok: #5fd6a0; --ok-bg: #123a2a; --warn: #f0c261; --warn-bg: #3a2d0e; --bad: #f08a82; --bad-bg: #3d1916;
    --ring-a: 24%; --glow-a: 15%;
    color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
:root[data-fs="small"] { --fs: 0.9; }
:root[data-fs="large"] { --fs: 1.14; }
:root[data-fs="xl"] { --fs: 1.3; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: calc(16px * var(--fs, 1)); line-height: 1.5;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 110px max(16px, env(safe-area-inset-left));
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, p { margin: 0; }
h1 { font-size: calc(26px * var(--fs, 1)); font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: calc(18px * var(--fs, 1)); font-weight: 800; }
.wrap { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.wrap.wide { max-width: 1000px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hello { display: flex; flex-direction: column; min-width: 0; }
.hello span { color: var(--muted); font-size: calc(14px * var(--fs, 1)); font-weight: 600; }
.ghost { background: transparent; border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: calc(14px * var(--fs, 1)); color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

.balance { position: relative; overflow: hidden; background: var(--accent); color: var(--accent-fg); border-radius: 24px; padding: 22px 20px; display: flex; flex-direction: column; gap: 6px; }
.balance::after { content: ""; position: absolute; right: -40px; top: -50px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255,255,255,0.16); pointer-events: none; }
.balance .label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: calc(14px * var(--fs, 1)); opacity: 0.92; position: relative; z-index: 1; }
.balance .amount { font-size: calc(38px * var(--fs, 1)); font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; position: relative; z-index: 1; }
.balance .sub { font-size: calc(14px * var(--fs, 1)); opacity: 0.92; position: relative; z-index: 1; }
.eye { background: rgba(255,255,255,0.2); border: 0; color: inherit; border-radius: 999px; padding: 4px 12px; font-size: calc(13px * var(--fs, 1)); font-weight: 700; }

.btn { background: var(--accent-dark); color: #fff; border: 0; border-radius: 16px; padding: 15px 18px; font-weight: 800; width: 100%; font-size: calc(17px * var(--fs, 1)); }
@media (prefers-color-scheme: dark) { .btn { background: var(--accent); color: var(--accent-fg); } }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.small { width: auto; padding: 9px 16px; font-size: calc(14px * var(--fs, 1)); border-radius: 12px; }
.btn.line { background: transparent; color: var(--accent-dark); border: 2px solid var(--accent); }
.btn.bad { background: transparent; color: var(--bad); border: 2px solid var(--bad); }
.btn.armed { background: var(--bad); color: #fff; border-color: var(--bad); }

.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.link { background: none; border: 0; color: var(--accent-dark); font-weight: 800; font-size: calc(14px * var(--fs, 1)); padding: 4px 0; }
.note { color: var(--muted); font-size: calc(14px * var(--fs, 1)); }
.empty { color: var(--muted); text-align: center; padding: 18px 8px; }


label { font-size: calc(14px * var(--fs, 1)); font-weight: 700; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], select {
  width: 100%; border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 13px 14px; font-size: calc(17px * var(--fs, 1)); outline: 0;
}
input:focus, select:focus { border-color: var(--accent); }
.amt { display: flex; align-items: center; gap: 8px; border: 2px solid var(--line); border-radius: 16px; padding: 0 16px; background: var(--surface); }
.amt:focus-within { border-color: var(--accent); }
.amt span { font-size: calc(24px * var(--fs, 1)); font-weight: 800; color: var(--muted); }
.amt input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: calc(28px * var(--fs, 1)); font-weight: 800; padding: 14px 0; outline: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: calc(14px * var(--fs, 1)); }
.bank { background: var(--soft); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kv span { color: var(--muted); font-size: calc(14px * var(--fs, 1)); font-weight: 600; }
.kv b { font-weight: 800; text-align: right; overflow-wrap: anywhere; }
.copy { border: 1.5px solid var(--line); background: var(--surface); border-radius: 8px; padding: 2px 10px; font-size: calc(13px * var(--fs, 1)); font-weight: 700; margin-left: 8px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: calc(14px * var(--fs, 1)); }

.item { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-top: 1.5px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 0; }
.item:last-child { padding-bottom: 0; }
.item .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.item .row > div { min-width: 0; }
.item b { font-weight: 800; }
.item small { color: var(--muted); font-size: calc(13px * var(--fs, 1)); display: block; overflow-wrap: anywhere; }
.pill { font-size: calc(12px * var(--fs, 1)); font-weight: 800; padding: 3px 11px; border-radius: 999px; display: inline-block; }
.pill.pending { background: var(--warn-bg); color: var(--warn); }
.pill.confirmed { background: var(--ok-bg); color: var(--ok); }
.pill.rejected { background: var(--bad-bg); color: var(--bad); }
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.track li { font-size: calc(12px * var(--fs, 1)); font-weight: 700; color: var(--muted); border-top: 5px solid var(--line); padding-top: 5px; border-radius: 3px; }
.track li.done { border-color: var(--accent); color: var(--fg); }
.track li.now { border-color: var(--sun); color: var(--fg); }
.rej { color: var(--bad); font-size: calc(14px * var(--fs, 1)); font-weight: 600; }

nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1.5px solid var(--line); z-index: 5;
  padding: 8px max(16px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
nav.tabs div { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
nav.tabs button { background: transparent; border: 0; border-radius: 14px; padding: 11px 2px; font-size: calc(14px * var(--fs, 1)); font-weight: 700; color: var(--muted); }
nav.tabs button[aria-current="page"] { background: var(--soft); color: var(--accent-dark); font-weight: 800; }

/* ---------- photos ---------- */
.authwrap { display: flex; flex-direction: column; gap: 18px; }
.authpic { position: relative; overflow: hidden; height: 170px; border-radius: 22px; margin-top: 4px;
  background: linear-gradient(180deg, rgba(14,45,80,0) 35%, rgba(14,45,80,0.6)), var(--pic-signin, none) center / cover no-repeat, linear-gradient(135deg, var(--accent), var(--accent-dark)); }
.authcap { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; flex-direction: column; gap: 2px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.35); }
.authcap b { font-size: calc(18px * var(--fs, 1)); }
.authcap span { font-size: calc(14px * var(--fs, 1)); font-weight: 600; opacity: 0.95; }
.authwrap .auth { margin-top: 0; }
.top.hero { position: relative; overflow: hidden; min-height: 150px; align-items: flex-end; padding: 22px 20px; border-radius: 26px; color: #fff;
  background: linear-gradient(90deg, rgba(14,45,80,0.8), rgba(14,45,80,0.3)), var(--pic-home, none) var(--pos-home, center) / cover no-repeat, linear-gradient(135deg, var(--accent-dark), var(--accent)); }
.top.hero .hello span { color: rgba(255,255,255,0.92); }
.top.hero h1 { color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,0.3); }

.auth { max-width: 420px; margin: 6vh auto 0; display: flex; flex-direction: column; gap: 18px; }
.brand { font-weight: 800; font-size: calc(20px * var(--fs, 1)); color: var(--accent-dark); }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.err { color: var(--bad); font-weight: 700; font-size: calc(14px * var(--fs, 1)); min-height: 1.2em; }
.okmsg { color: var(--ok); font-weight: 700; font-size: calc(14px * var(--fs, 1)); }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom)); background: var(--fg); color: var(--bg);
  padding: 12px 18px; border-radius: 16px; font-weight: 700; font-size: calc(15px * var(--fs, 1)); z-index: 9; max-width: calc(100% - 32px); text-align: center; }
#toast[hidden] { display: none; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.tile span { color: var(--muted); font-size: calc(13px * var(--fs, 1)); font-weight: 700; }
.tile b { font-size: calc(24px * var(--fs, 1)); font-weight: 800; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: calc(15px * var(--fs, 1)); }
th { text-align: left; color: var(--muted); font-size: calc(13px * var(--fs, 1)); font-weight: 700; padding: 8px 10px; white-space: nowrap; }
td { padding: 10px; border-top: 1.5px solid var(--line); vertical-align: middle; }
td.r, th.r { text-align: right; }
td small { display: block; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filters input, .filters select { width: auto; flex: 1 1 180px; font-size: calc(15px * var(--fs, 1)); padding: 10px 12px; }
.chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; }
.col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.col .val { font-size: calc(12px * var(--fs, 1)); font-weight: 700; color: var(--muted); min-height: 1.2em; white-space: nowrap; }
.col .bar { width: 100%; height: 110px; display: flex; align-items: flex-end; }
.col .bar i { display: block; width: 100%; background: var(--bar); border-radius: 8px 8px 3px 3px; }
.col .bar i.now { background: var(--accent); }
.col .bar i.zero { height: 3px; background: var(--line); border-radius: 2px; }
.col .mo { font-size: calc(12px * var(--fs, 1)); font-weight: 700; color: var(--muted); }
.col .mo.now { color: var(--fg); }
.rep th, .rep td { padding: 7px 8px; white-space: nowrap; }
.rep td:first-child, .rep th:first-child { white-space: normal; min-width: 130px; }
.rep tfoot td { font-weight: 800; border-top: 2px solid var(--fg); }
.amount-big { font-size: calc(32px * var(--fs, 1)); font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice button { border: 2px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px 10px; font-weight: 800; font-size: calc(16px * var(--fs, 1)); }
.choice button[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); color: var(--accent-dark); }
.pending-note { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 8px 12px; font-size: calc(14px * var(--fs, 1)); font-weight: 700; margin: 0; }
.switches { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; }
.switch { display: flex; align-items: center; gap: 10px; font-size: calc(15px * var(--fs, 1)); font-weight: 700; color: var(--fg); cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; cursor: pointer; transition: background 0.15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
input.cell { width: 130px; padding: 8px 10px; font-size: calc(15px * var(--fs, 1)); border-radius: 10px; text-align: right; }
@media (prefers-reduced-motion: reduce) { .switch input, .switch input::after { transition: none; } }
/* ---------- admin pages and dividend steps ---------- */
.adm-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.atabs { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 3px; gap: 2px; }
.atabs button { background: transparent; border: 0; border-radius: 999px; padding: 7px 16px; font-weight: 800; font-size: calc(14px * var(--fs, 1)); color: var(--muted); }
.atabs button[aria-current="page"] { background: var(--surface); color: var(--accent-dark); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.wrap.t-div { max-width: 1100px; }
.step { gap: 14px; }
.step.wait { opacity: 0.72; }
.stephead { display: flex; align-items: center; gap: 12px; }
.stephead h2 { flex: 1; min-width: 0; }
.stepnum { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--soft); color: var(--accent-dark); display: grid; place-items: center; font-weight: 800; }
.step.done .stepnum { background: var(--ok-bg); color: var(--ok); }
.step.now { border-color: var(--accent); }
.banner { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: calc(14px * var(--fs, 1)); }
.rowbtns { display: flex; gap: 8px; flex-wrap: wrap; }
tr.changed td { background: var(--warn-bg); }
.tile small { color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
td.paybox { width: 70px; }

/* ---------- show / hide password ---------- */
.pwwrap { position: relative; display: flex; }
.pwwrap input { padding-right: 76px; }
.pwbtn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: var(--soft); color: var(--accent-dark); border: 0; border-radius: 999px; padding: 6px 12px; font-size: calc(13px * var(--fs, 1)); font-weight: 800; }
.form2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .form2 { grid-template-columns: 1fr 1fr; } .form2 .full { grid-column: 1 / -1; } }

/* ---------- home columns (stacked on phones) ---------- */
.cols { display: flex; flex-direction: column; gap: 18px; }
.colA, .colB { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.navbrand, .navout { display: none; }
.adm-cols { display: flex; flex-direction: column; gap: 18px; }
.adm-main, .adm-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ---------- tablets ---------- */
@media (min-width: 700px) {
  .wrap { max-width: 640px; }
  .wrap.wide { max-width: 1000px; }
}

/* ---------- laptops: sidebar and wide dashboard ---------- */
@media (min-width: 900px) {
  body:has(.authwrap) { padding: 0 !important; }
  .authwrap { flex-direction: row; min-height: 100vh; gap: 0; }
  .authpic { flex: 1.15; height: auto; min-height: 100vh; margin: 0; border-radius: 0 44px 44px 0;
    background: linear-gradient(180deg, rgba(14,45,80,0) 45%, rgba(14,45,80,0.65)), var(--pic-signin, none) center / cover no-repeat, linear-gradient(135deg, var(--accent), var(--accent-dark)); }
  .authcap { left: 48px; right: 48px; bottom: 48px; }
  .authcap b { font-size: calc(30px * var(--fs, 1)); }
  .authcap span { font-size: calc(17px * var(--fs, 1)); }
  .authwrap .auth { flex: 1; align-self: center; margin: 0 auto; padding: 40px 36px; width: 100%; }
  .top.hero { min-height: 190px; padding: 30px 32px; }
}

@media (min-width: 960px) {
  body:has(nav.tabs) { padding: 36px 40px 48px calc(250px + 40px); }
  nav.tabs { top: 0; right: auto; bottom: 0; width: 250px; border-top: 0; border-right: 1.5px solid var(--line); padding: 28px 16px 24px; }
  nav.tabs div { max-width: none; height: 100%; display: flex; flex-direction: column; gap: 6px; }
  .navbrand { display: block; font-size: calc(24px * var(--fs, 1)); font-weight: 800; color: var(--accent-dark); padding: 0 14px 22px; letter-spacing: -0.01em; }
  nav.tabs button { text-align: left; padding: 13px 16px; font-size: calc(16px * var(--fs, 1)); }
  nav.tabs button:hover { background: var(--soft); }
  .navout { display: block; margin-top: auto; background: transparent; border: 1.5px solid var(--line); color: var(--muted); }
  #toast { bottom: 28px; left: calc(50% + 125px); }

  .wrap { max-width: 1060px; margin: 0; }
  .wrap h1 { font-size: calc(30px * var(--fs, 1)); }
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .colA, .colB { gap: 24px; }
  .balance { padding: 30px 28px; border-radius: 28px; }
  .balance .amount { font-size: calc(48px * var(--fs, 1)); }
  .wrap.t-deposit, .wrap.t-profile, .wrap.t-settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .wrap.t-deposit > .top, .wrap.t-profile > .top, .wrap.t-settings > .top { grid-column: 1 / -1; }
  .wrap.t-activity { max-width: 820px; }
  .col .bar { height: 150px; }
  .card { padding: 22px; border-radius: 22px; }
  .wrap.t-profile > .ghost[data-act="signout"] { display: none !important; }
}

/* ---------- admin on a wide screen ---------- */
@media (min-width: 1100px) {
  .wrap.wide { max-width: 1400px; margin: 0 auto; }
  body:not(:has(nav.tabs)) { padding-left: 40px; padding-right: 40px; }
  .adm-cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .adm-main, .adm-side { gap: 24px; }
  .tiles { grid-template-columns: repeat(6, 1fr); }
  .tile { padding: 18px 20px; }
  .tile b { font-size: calc(26px * var(--fs, 1)); }
}

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  :root { --bg: #fff; --surface: #fff; --fg: #000; --muted: #333; --line: #999; color-scheme: light; }
  body { background: #fff; color: #000; padding: 0; }
  .wrap.wide > *:not(#reportCard):not(.adm-cols) { display: none !important; }
  .adm-cols, .adm-side { display: block !important; }
  .adm-main, .adm-side > *:not(#reportCard) { display: none !important; }
  body.print-wd .wrap.wide > #listWd, body.print-re .wrap.wide > #listRe { display: flex !important; border: 0; padding: 0; background: #fff; box-shadow: none; }
  .listcard td.paybox { border: 1px solid #999; height: 26px; min-width: 60px; }
  .listcard .printonly { display: flex !important; }
  .listcard .lhead { justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 8px; }
  .listcard .sign { flex-direction: column; gap: 22px; margin-top: 36px; }
  .listcard tfoot td { border-top: 2px solid #000; }
  .noprint, #toast { display: none !important; }
  #reportCard { border: 0; padding: 0; background: #fff; }
  .rep { font-size: calc(11px * var(--fs, 1)); }
  .rep th, .rep td { border: 1px solid #999; padding: 4px 6px; color: #000; }
  .scroll { overflow: visible; }
}

/* ---------- sign-in photo as a full-page background on phones ---------- */
@media (max-width: 899px) {
  body:has(.authwrap) { background: #0f2a47; padding: 0 !important; }
  .authwrap { position: relative; display: block; min-height: 100vh; margin: 0; isolation: isolate; }
  .authpic { position: absolute; left: 0; right: 0; top: 0; height: 78vh; min-height: 480px; z-index: -1; margin: 0; border-radius: 0;
    background: linear-gradient(180deg, rgba(15,42,71,0.4) 0%, rgba(15,42,71,0.62) 40%, rgba(15,42,71,0.9) 72%, #0f2a47 100%), var(--pic-signin, none) 50% 12% / cover no-repeat, linear-gradient(135deg, var(--accent), var(--accent-dark)); }
  .authcap { left: 22px; right: 22px; top: 19vh; bottom: auto; }
  .authcap b { font-size: calc(20px * var(--fs, 1)); }
  .authcap span { display: none; }
  .authwrap .auth { padding: 31vh 22px 32px; max-width: 460px; margin: 0 auto; color: #fff; }
  .authwrap .brand, .authwrap h1 { color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,0.35); }
  .authwrap .note, .authwrap label { color: rgba(255,255,255,0.88); }
  .authwrap input { color: var(--fg); }
  .authwrap input::placeholder { color: var(--muted); }
  .authwrap .err { color: #ffb4b4; }
  .authwrap .pending-note { color: #ffe3a3; }
  .authwrap .auth .brand { position: absolute; top: 24px; left: 24px; font-size: calc(22px * var(--fs, 1)); }
}

/* ---------- soft abstract rings and circles behind the pages ---------- */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before {
  --ring: color-mix(in srgb, var(--accent) var(--ring-a), transparent);
  --glow: color-mix(in srgb, var(--accent) var(--glow-a), transparent);
  background:
    radial-gradient(circle 360px at 94% 4%, var(--glow), transparent 70%),
    radial-gradient(circle at 94% 4%, transparent 0 150px, var(--ring) 150px 151.5px, transparent 151.5px 215px, var(--ring) 215px 216.5px, transparent 216.5px),
    repeating-radial-gradient(circle at 94% 4%, transparent 0 26px, var(--ring) 26px 27px),
    radial-gradient(circle at 70% 18%, transparent 0 54px, var(--ring) 54px 55.5px, transparent 55.5px);
  -webkit-mask-image: radial-gradient(circle 560px at 94% 4%, #000 0%, transparent 100%);
  mask-image: radial-gradient(circle 560px at 94% 4%, #000 0%, transparent 100%);
}
body::after {
  --ring: color-mix(in srgb, var(--accent) var(--ring-a), transparent);
  --glow: color-mix(in srgb, var(--accent) var(--glow-a), transparent);
  background:
    radial-gradient(circle 380px at 4% 96%, var(--glow), transparent 70%),
    radial-gradient(circle at 4% 96%, transparent 0 110px, var(--ring) 110px 111.5px, transparent 111.5px 190px, var(--ring) 190px 191.5px, transparent 191.5px 270px, var(--ring) 270px 271.5px, transparent 271.5px),
    radial-gradient(circle at 26% 90%, transparent 0 38px, var(--ring) 38px 39.5px, transparent 39.5px),
    radial-gradient(circle at 9% 62%, var(--glow) 0 7px, transparent 8px);
  -webkit-mask-image: radial-gradient(circle 600px at 4% 96%, #000 0%, transparent 100%);
  mask-image: radial-gradient(circle 600px at 4% 96%, #000 0%, transparent 100%);
}
body:has(.authwrap)::before, body:has(.authwrap)::after { display: none; }
@media (min-width: 960px) { body:has(nav.tabs)::after { left: 250px; } }
@media print { body::before, body::after { display: none !important; } }

/* ---------- settings page ---------- */
.choice3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .choice4 { grid-template-columns: repeat(4, 1fr); } }
.choice3 button, .choice4 button { border: 2px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px 8px; font-weight: 800; }
.choice3 button[aria-pressed="true"], .choice4 button[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); color: var(--accent-dark); }
.sample { background: var(--soft); border-radius: 16px; padding: 14px 16px; }
.sample b { display: block; font-size: calc(20px * var(--fs, 1)); }
@media (max-width: 420px) { nav.tabs button { font-size: calc(13px * var(--fs, 1)); padding: 11px 0; } }

/* ---------- logo ---------- */
.logo { display: inline-block; line-height: 0; }
.logo img { display: block; height: 64px; width: auto; max-width: 100%; }
.logo .lg-dk { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo .lg-lt { display: none; } :root:not([data-theme="light"]) .logo .lg-dk { display: block; } }
:root[data-theme="dark"] .logo .lg-lt { display: none; }
:root[data-theme="dark"] .logo .lg-dk { display: block; }
.brand .adm-tag { display: block; margin-top: 4px; font-size: calc(13px * var(--fs, 1)); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.navbrand .logo img { height: auto; width: 170px; }
.navbrand { padding-bottom: 18px !important; }
.lead { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo.sm img { height: 52px; }
@media (max-width: 560px) { .logo.sm { display: none; } }
@media (max-width: 899px) {
  .authwrap .logo .lg-lt { display: none !important; }
  .authwrap .logo .lg-dk { display: block !important; }
  .authwrap .auth .brand { top: 18px; left: 20px; }
  .authwrap .logo img { height: 72px; filter: drop-shadow(0 1px 6px rgba(0,0,0,0.35)); }
  .authwrap .brand .adm-tag { color: rgba(255,255,255,0.85); }
}
@media print { .logo .lg-lt { display: block !important; } .logo .lg-dk { display: none !important; } }

/* ---------- proof of payment ---------- */
.proofadd { align-self: flex-start; }
.proofrow { display: flex; align-items: center; gap: 12px; }
.proofrow img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; border: 1.5px solid var(--line); flex: none; }
.proofrow div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.field label small { font-weight: 600; color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: calc(13px * var(--fs, 1)); font-weight: 700; color: var(--accent-dark); text-decoration: underline; }
.btn.small.ghostb { background: transparent; color: var(--accent-dark); border: 1.5px solid var(--line); }
#proofModal { position: fixed; inset: 0; background: rgba(8, 20, 36, 0.78); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
#proofModal[hidden] { display: none; }
#proofModal .pm-box { background: var(--surface); border-radius: 18px; padding: 14px; max-width: min(92vw, 720px); max-height: 92vh; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
#proofModal img { max-width: 100%; max-height: calc(92vh - 80px); border-radius: 10px; object-fit: contain; align-self: center; }
@media print { #proofModal { display: none !important; } }

/* ---------- install card ---------- */
.installcard { display: flex; flex-direction: column; gap: 10px; }
.installcard .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.installcard small { display: block; color: var(--muted); }

/* ---------- developer dashboard meters ---------- */
.meter { height: 14px; border-radius: 999px; background: var(--soft); overflow: hidden; margin: 10px 0 8px; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.meter.warn i { background: var(--warn); }
.meter.bad i { background: var(--bad); }
.meterhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.delcard { border-color: var(--bad); display: flex; flex-direction: column; gap: 10px; }

.qrbox { background: #fff; padding: 10px; border-radius: 12px; display: inline-block; margin: 4px 0 8px; }

.credbox { display: grid; gap: 10px; padding: 12px 14px; border: 1px dashed var(--line, #9bb); border-radius: 12px; margin: 8px 0; }
.credbox small { display: block; opacity: .7; }
.credbox b { word-break: break-all; font-size: 1.05em; }

/* loading feedback (busy.js) */
#ewbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity .15s; overflow: hidden; }
#ewbar.on { opacity: 1; }
#ewbar::before { content: ""; position: absolute; inset: 0; width: 40%; background: var(--accent, var(--brand, #2b8be6)); border-radius: 3px; animation: ewbar 1.1s ease-in-out infinite; }
@keyframes ewbar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
button.is-busy { cursor: progress; opacity: .8; }
button.is-busy::after { content: ""; display: inline-block; width: .9em; height: .9em; margin-left: .55em; vertical-align: -.12em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ewspin .7s linear infinite; }
@keyframes ewspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #ewbar::before { animation-duration: 2.4s; } button.is-busy::after { animation-duration: 1.6s; } }

/* password strength bar and checklist */
.pwm { display: flex; flex-direction: column; gap: 8px; margin: -4px 0 4px; }
.pwbar { height: 8px; border-radius: 999px; background: var(--line, rgba(127,127,127,.25)); overflow: hidden; }
.pwbar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--bad); transition: width .25s, background .25s; }
.pwm[data-level="1"] .pwbar i { width: 25%; background: var(--bad); }
.pwm[data-level="2"] .pwbar i { width: 50%; background: var(--warn); }
.pwm[data-level="3"] .pwbar i { width: 75%; background: var(--ok); }
.pwm[data-level="4"] .pwbar i { width: 100%; background: var(--ok); }
.pwlabel { font-size: calc(13px * var(--fs, 1)); font-weight: 700; color: var(--muted); }
.pwlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: calc(14px * var(--fs, 1)); color: var(--muted); }
.pwlist li { display: flex; align-items: center; gap: 8px; }
.pwtick { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; opacity: .55; position: relative; }
.pwlist li.yes { color: var(--ok); font-weight: 700; }
.pwlist li.yes .pwtick { opacity: 1; background: var(--ok); border-color: var(--ok); }
.pwlist li.yes .pwtick::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* outline icons */
.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:has(.ic), .ghost:has(.ic), .atabs button:has(.ic), a.btn:has(.ic) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:has(.ic):not(.small) { display: flex; }
nav.tabs button:not(.navout):has(.ic) { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: calc(12px * var(--fs, 1)); }
nav.tabs button:not(.navout):has(.ic) .ic { width: 22px; height: 22px; }
@media (min-width: 960px) {
  nav.tabs button:not(.navout):has(.ic) { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: calc(16px * var(--fs, 1)); }
  nav.tabs .navout:has(.ic) { display: flex; align-items: center; gap: 10px; }
  nav.tabs .navout:has(.ic) { justify-content: center; }
}

/* layout fixes: amounts, admin header on phones, admin columns */
.item .amtcol { flex: none; max-width: 62%; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.item .amtcol b.num { white-space: nowrap; }
@media (max-width: 899px) {
  .wrap.wide > .top { flex-direction: column; align-items: stretch; gap: 14px; }
  .wrap.wide > .top .adm-actions { justify-content: flex-start; }
  .wrap.wide > .top .atabs { display: flex; width: 100%; }
  .wrap.wide > .top .atabs button { flex: 1 1 0; min-width: 0; padding: 8px 6px; gap: 6px; font-size: calc(13px * var(--fs, 1)); white-space: nowrap; }
  .wrap.wide > .top .atabs .ic { width: 1.1em; height: 1.1em; }
}
@media (max-width: 420px) { .wrap.wide > .top .atabs button .ic { display: none; } }
@media (min-width: 960px) and (max-width: 1499px) {
  .adm-cols { display: flex; flex-direction: column; gap: 24px; align-items: stretch; }
  .adm-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
}

.nw { white-space: nowrap; }

@media (min-width: 960px) { .adm-side > .wide2 { grid-column: 1 / -1; } }
/* tables become tidy stacked rows on phones, so nothing hides off to the side */
@media (max-width: 640px) {
  table.stack, table.stack tbody { display: block; }
  table.stack thead { display: none; }
  table.stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-top: 1.5px solid var(--line); align-items: center; }
  table.stack tr:first-child { border-top: 0; padding-top: 0; }
  table.stack td { border: 0; padding: 0; min-width: 0; white-space: normal; }
  table.stack td.nw { white-space: normal; }
  table.stack td.r { text-align: right; }
  table.stack td .actions { justify-content: flex-start; margin-top: 6px; }
  /* deposits waiting: member | amount, reference | date, buttons */
  table.stack tr > td:nth-child(1) { grid-column: 1; }
  table.stack tr > td:nth-child(2) { grid-column: 1; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
  table.stack tr > td:nth-child(3) { grid-column: 2; grid-row: 2; text-align: right; color: var(--muted); font-size: calc(13px * var(--fs, 1)); }
  table.stack tr > td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  table.stack tr > td:nth-child(5) { grid-column: 1 / -1; }
  table.stack tr > td:nth-child(6) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  table.stack.req tr { grid-template-columns: 1fr; }
  table.stack.req tr > td { grid-column: 1 !important; grid-row: auto !important; text-align: left !important; font-size: calc(14px * var(--fs, 1)); color: var(--fg); }
  table.stack.req tr > td:nth-child(2) { color: var(--muted); }
  table.stack.req tr > td:nth-child(3)::before { content: "Now: "; color: var(--muted); }
  table.stack.req tr > td:nth-child(4)::before { content: "Wants: "; color: var(--muted); font-weight: 400; }
  table.stack.req tr > td:nth-child(5) { color: var(--muted); }
}
@media (max-width: 640px) { table.stack.req tr > td:nth-child(3) small { display: inline; } }

/* press feedback: reacts the instant a finger lands, springs back on release */
button, a.btn, .chip, [role="button"] { transition: transform .22s cubic-bezier(.2, .9, .3, 1), background-color .15s ease, opacity .15s ease, box-shadow .15s ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:not(:disabled):active, a.btn:active, .chip:active { transform: scale(.96); transition-duration: .08s; }
nav.tabs button:not(:disabled):active { transform: scale(.92); }
.switch input:active { transform: none; }
button:disabled { cursor: not-allowed; }

/* arriving on a new screen */
@keyframes ewenter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ewfade { from { opacity: 0; } to { opacity: 1; } }
#app.enter .wrap > *:not(.cols), #app.enter .cols > div > * { animation: ewenter .38s cubic-bezier(.2, .8, .2, 1) both; }
#app.enter .wrap > :nth-child(2), #app.enter .cols > div > :nth-child(1) { animation-delay: .04s; }
#app.enter .wrap > :nth-child(3), #app.enter .cols > div > :nth-child(2) { animation-delay: .08s; }
#app.enter .wrap > :nth-child(4), #app.enter .cols > div > :nth-child(3) { animation-delay: .12s; }
#app.enter .wrap > :nth-child(5), #app.enter .cols > div > :nth-child(4) { animation-delay: .16s; }
#app.enter .wrap > :nth-child(n+6), #app.enter .cols > div > :nth-child(n+5) { animation-delay: .2s; }

/* the tab bar as a soft glass layer: content scrolls underneath */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  nav.tabs { background: color-mix(in srgb, var(--surface) 74%, transparent); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); border-color: color-mix(in srgb, var(--line) 70%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  button, a.btn, .chip { transition: background-color .15s ease, opacity .15s ease; }
  button:not(:disabled):active, a.btn:active, .chip:active, nav.tabs button:not(:disabled):active { transform: none; opacity: .75; }
  #app.enter .wrap > *, #app.enter .cols > div > * { animation: ewfade .18s ease both !important; animation-delay: 0s !important; }
}
@media (prefers-reduced-transparency: reduce) {
  nav.tabs { background: var(--surface) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
@media (prefers-contrast: more) {
  nav.tabs { background: var(--surface) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; border-color: var(--fg); }
  .card, .tile { border-color: var(--muted); }
}

/* 9. calmer home banner */
.top.hero { min-height: 112px; padding: 16px 18px; }
@media (min-width: 960px) { .top.hero { min-height: 150px; padding: 24px 28px; } }
/* 10. amount chips in an even grid */
.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 460px) { .chips { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.chip { text-align: center; padding: 9px 6px; white-space: nowrap; }
/* 11. account name: easy to read and compare with the bank app */
.kv.stackkv { flex-direction: column; align-items: flex-start; gap: 4px; }
.kv.stackkv .acctname { text-align: left; font-weight: 700; font-size: calc(15px * var(--fs, 1)); line-height: 1.4; letter-spacing: .02em; }

/* sliding highlight under the active tab */
nav.tabs > div { position: relative; }
.tabpill { position: absolute; left: 0; top: 0; width: 0; height: 0; border-radius: 14px; background: var(--soft); pointer-events: none; z-index: 0; }
.tabpill.ready { transition: transform .38s cubic-bezier(.2, .9, .3, 1), width .38s cubic-bezier(.2, .9, .3, 1), height .38s cubic-bezier(.2, .9, .3, 1); }
nav.tabs > div:has(.tabpill) button[aria-current="page"] { background: transparent; }
nav.tabs > div > button, nav.tabs > div > .navbrand { position: relative; z-index: 1; }
nav.tabs button { transition: color .2s ease, transform .22s cubic-bezier(.2, .9, .3, 1); }

/* status changes and new rows */
.pill { transition: background-color .3s ease, color .3s ease; }
.pill.pop { animation: ewpop .4s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes ewpop { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
.item.row-in { animation: ewrow .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes ewrow { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.track li { transition: border-color .4s ease, color .4s ease, background-color .4s ease; }

/* balance reveal and the check mark on success */
.balance .amount.reveal { animation: ewreveal .4s ease; }
@keyframes ewreveal { from { opacity: .2; filter: blur(10px); } to { opacity: 1; filter: blur(0); } }
#toast { display: flex; align-items: center; gap: 10px; }
#toast[hidden] { display: none; }
#toast .tick { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#toast .tick path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ewdraw .45s .1s ease-out forwards; }
@keyframes ewdraw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .tabpill.ready { transition: none; }
  .pill.pop, .item.row-in, .balance .amount.reveal { animation: none; }
  #toast .tick path { animation: none; stroke-dashoffset: 0; }
  .track li, .pill { transition: none; }
}

/* ---- first-sign-in tour ---- */
.tt { position: fixed; inset: 0; z-index: 1000; opacity: 0; transition: opacity .25s ease; }
.tt.in { opacity: 1; }
.tt-ring { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(8, 24, 42, .62), 0 0 0 2px var(--accent); transition: left .35s cubic-bezier(.3,.8,.3,1), top .35s cubic-bezier(.3,.8,.3,1), width .35s cubic-bezier(.3,.8,.3,1), height .35s cubic-bezier(.3,.8,.3,1); pointer-events: none; }
.tt-pop { position: fixed; background: var(--surface); color: var(--fg); border-radius: 18px; padding: 16px 18px 14px; box-shadow: 0 12px 40px rgba(8, 24, 42, .35); border: 1px solid var(--line); transition: left .35s cubic-bezier(.3,.8,.3,1), top .35s cubic-bezier(.3,.8,.3,1); box-sizing: border-box; }
.tt-pop h2 { margin: 6px 0 4px; font-size: 1.1rem; letter-spacing: -.01em; line-height: 1.25; }
.tt-pop p { margin: 0 0 14px; color: var(--muted); font-size: .95rem; line-height: 1.45; }
.tt-pop.mid { text-align: center; }
.tt-dots { display: flex; gap: 5px; }
.tt-pop.mid .tt-dots { justify-content: center; }
.tt-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line); transition: width .25s ease, background .25s ease; }
.tt-dots i.on { width: 18px; background: var(--accent); }
.tt-row { display: flex; align-items: center; gap: 8px; }
.tt-sp { flex: 1; }
.tt-row button { font: inherit; font-weight: 700; border-radius: 12px; padding: 10px 16px; min-height: 44px; border: 0; cursor: pointer; transition: transform .1s ease-out; }
.tt-row button:active { transform: scale(.96); }
.tt-next { background: var(--accent); color: var(--accent-fg); }
.tt-back { background: var(--soft); color: var(--accent-dark); }
.tt-skip { background: transparent; color: var(--muted); padding-left: 4px !important; padding-right: 4px !important; }
.tt-row button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tt-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tt.calm, .tt.calm * { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .tt, .tt-ring, .tt-pop, .tt-dots i { transition: none !important; } }
@media (prefers-reduced-transparency: reduce) { .tt-ring { box-shadow: 0 0 0 9999px rgba(8, 24, 42, .85), 0 0 0 2px var(--accent); } }

/* ---- dividend confirmed ---- */
.divdone .donebox { display: flex; gap: 14px; align-items: flex-start; background: var(--ok-bg); color: var(--ok); border-radius: 16px; padding: 14px 16px; }
.divdone .donebox b { display: block; font-size: 1.05rem; margin-bottom: 2px; }
.divdone .donebox p { margin: 0; line-height: 1.45; }
.divdone .donetick { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; }
.divdone .donetick .ic { width: 20px; height: 20px; }
.choice button.go { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.choice button:disabled { opacity: .6; }
.divdone.pop { animation: ewpop .45s cubic-bezier(.2, .9, .3, 1.3); }
@media (prefers-reduced-motion: reduce) { .divdone.pop { animation: none; } }

/* ---- dividend lists ---- */
.printonly { display: none; }
.listcard tfoot td { border-top: 2px solid var(--line); padding-top: 8px; }
.listcard td small { display: block; color: var(--muted); }
.listcard td.paybox { width: 64px; }
@media screen and (max-width: 560px) {
  .listcard table, .listcard tbody, .listcard tfoot { display: block; }
  .listcard thead { display: none; }
  .listcard tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 12px 0; border-top: 1.5px solid var(--line); align-items: baseline; }
  .listcard tbody tr:first-child { border-top: 0; padding-top: 0; }
  .listcard td { border: 0; padding: 0; min-width: 0; white-space: normal; }
  .listcard tbody td:nth-child(1), .listcard td.paybox { display: none; }
  .listcard tbody td:nth-child(2) { grid-column: 1; grid-row: 1; }
  .listcard tbody td.pay { grid-column: 2; grid-row: 1; text-align: right; font-weight: 800; }
  .listcard tbody td.sub { grid-column: 1 / -1; text-align: left; color: var(--muted); font-size: .9em; }
  .listcard tbody td.sub::before { content: attr(data-l) ": "; }
  .listcard tbody td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; color: var(--muted); }
  .listcard tbody td:nth-child(4) { grid-column: 1; grid-row: 3; }
  .listcard tbody td:nth-child(5) { grid-column: 2; grid-row: 3; text-align: right; color: var(--muted); }
  .listcard tfoot td.pay { grid-column: 2; grid-row: 1; text-align: right; }
  .listcard tfoot td.sub { grid-column: 1 / -1; text-align: left; color: var(--muted); font-size: .9em; }
  .listcard tfoot td.sub::before { content: attr(data-l) ": "; }
  .listcard tfoot td:last-child { text-align: right; }
}
@media (max-width: 560px) { .t-div .tile b { font-size: clamp(1.05rem, 5.4vw, 1.5rem); } }

/* ---- member deposit history ---- */
.namebtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-dark); text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .15s; }
.namebtn:hover, .namebtn:focus-visible { text-decoration-color: currentColor; }
#histModal { position: fixed; inset: 0; background: rgba(8, 20, 36, 0.7); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; }
#histModal[hidden] { display: none; }
.hm-box { background: var(--surface); color: var(--fg); border-radius: 18px; padding: 18px; width: min(100%, 760px); display: flex; flex-direction: column; gap: 12px; margin: auto 0; }
.hm-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.hm-head h2 { margin: 0; }
.hm-head small { color: var(--muted); }
.hm-btns { display: flex; gap: 8px; }
.hm-year { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 1.2rem; }
.hm-year button { min-width: 44px; font-size: 1.3rem; padding: 4px 12px; }
.hm-sum { display: flex; gap: 10px; flex-wrap: wrap; }
.hm-sum > div { flex: 1 1 140px; background: var(--soft); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; }
.hm-sum span { color: var(--muted); font-size: .85rem; }
.hm-sum b { font-size: 1.15rem; }
.hm-mo { border-top: 1.5px solid var(--line); }
.hm-mo summary, .hm-mo.none { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 14px; align-items: baseline; padding: 11px 2px; cursor: pointer; list-style: none; }
.hm-mo.none { grid-template-columns: 1fr auto; cursor: default; }
.hm-mo summary::-webkit-details-marker { display: none; }
.hm-mo summary > span:first-child { font-weight: 700; }
.hm-mo .muted, .hm-n { color: var(--muted); font-size: .85rem; }
.hm-mo summary::after { content: ""; }
.hm-mo[open] summary { border-bottom: 1px dashed var(--line); }
.hm-mo ul { list-style: none; margin: 0; padding: 4px 0 10px; display: flex; flex-direction: column; gap: 8px; }
.hm-mo li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.hm-mo li .hk small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.hm-mo li .neg { color: var(--bad); }
@media (max-width: 560px) { .hm-mo summary { grid-template-columns: 1fr auto; } .hm-mo summary .hm-n { grid-column: 1; grid-row: 2; } .hm-mo summary b { grid-column: 2; grid-row: 1 / span 2; } .hm-mo li { grid-template-columns: 48px minmax(0, 1fr) auto; } .hm-mo li .pill { display: none; } }
@media print {
  body.print-hist #app, body.print-hist #toast { display: none !important; }
  body.print-hist #histModal { position: static; background: #fff; display: block; padding: 0; overflow: visible; }
  body.print-hist .hm-box { box-shadow: none; padding: 0; width: 100%; margin: 0; animation: none; transform: none; }
  body.print-hist .hm-mo li .pill { display: inline-block; }
  .hm-foot { display: block !important; margin-top: 16px; color: #333; font-size: 12px; }
  #histModal { display: none; }
  body.print-hist #histModal { display: block; }
}
@media (prefers-reduced-motion: no-preference) { .hm-box { animation: ewpop .25s ease-out; } }

.dep-more { margin-top: 12px; display: flex; justify-content: center; }
