/* ─────────────────────────────────────────────────────────────────────────────
   Money — stylesheet.

   The look, fifth pass: black ground, white type, a serif display face for
   headings, uppercase eyebrows with wide tracking, hairline borders, and one
   champagne accent. Accounts are card-shaped tiles finished by type. Motion is
   small and everywhere: cards fade up as they arrive, figures count up once,
   tiles lean towards the pointer -- and all of it is off under
   prefers-reduced-motion.

   Colour still carries meaning: mint for money in, coral for money out, sky
   for transfers (neither), amber for warnings, and eight avatar hues so
   accounts and people are told apart at a glance. Charts use their own
   validated pair (see View\Chart).

   Light is a paper version of the same language: warm off-white ground; the
   sidebar, the hero card and the account cards stay black -- like a black card
   on a desk.

   Themes: the dark tokens appear twice on purpose -- under the media query
   (the system setting, and the no-JavaScript path) guarded by
   :root:not([data-theme=light]), and under :root[data-theme=dark] (the viewer's
   own choice from public/js/theme.js). Edit both.

   Templates carry no inline styles and no <style> blocks; every rule lives here.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── light (paper) ────────────────────────────────────────────────────────── */
:root {
  --bg:        #f3f1ec;
  --surface:   #fbfaf7;
  --surface-2: #f3f1ec;
  --surface-3: #e9e6df;
  --text:      #131313;
  --muted:     #6b6a66;
  --faint:     #a3a19b;
  --border:    rgba(0, 0, 0, .08);
  --border-2:  rgba(0, 0, 0, .16);

  --accent:    #8a6d2f;
  --accent-3:  #6e561f;
  --accent-2:  rgba(138, 109, 47, .12);
  --on-accent: #ffffff;
  --btn:       #131313;
  --on-btn:    #ffffff;

  --pos:       #1f8a5f;  --pos-2:  rgba(31, 138, 95, .12);
  --neg:       #c8503d;  --neg-2:  rgba(200, 80, 61, .12);
  --warn:      #9a7420;  --warn-2: rgba(154, 116, 32, .12);
  --move:      #2f6fb0;  --move-2: rgba(47, 111, 176, .12);

  --side-bg:   #000000;
  --side-text: rgba(255, 255, 255, .62);
  --side-on:   #ffffff;
  --side-dim:  rgba(255, 255, 255, .34);
  --side-line: rgba(255, 255, 255, .09);
  --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(255, 255, 255, .08);

  /* Black metal: the hero card and the account cards stay dark in both themes. */
  --metal:     linear-gradient(150deg, #262629 0%, #0c0c0e 55%, #1a1a1d 100%);
  --grad-soft: linear-gradient(135deg, rgba(138, 109, 47, .10), rgba(138, 109, 47, .03));

  /* Chart series, validated for colour-vision deficiency (see View\Chart). */
  --c-in:      #1baf7a;
  --c-out:     #eb6834;
  --c-now:     #8a6d2f;
  --c-prev:    #c9c5bb;

  --shadow:    0 1px 2px rgba(20, 18, 10, .04), 0 10px 30px -18px rgba(20, 18, 10, .18);
  --shadow-2:  0 2px 4px rgba(20, 18, 10, .06), 0 24px 50px -24px rgba(20, 18, 10, .3);
  --radius:    16px;
  --radius-s:  10px;
  --serif:     'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, 'Times New Roman', serif;
  --mono:      'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  --ease:      cubic-bezier(.22, .61, .36, 1);
  color-scheme: light dark;
}

/* ── dark (black) ─────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg:        #050506;
    --surface:   #101012;
    --surface-2: #17171a;
    --surface-3: #202024;
    --text:      #f4f3ef;
    --muted:     #9a9aa2;
    --faint:     #5e5e66;
    --border:    rgba(255, 255, 255, .08);
    --border-2:  rgba(255, 255, 255, .16);

    --accent:    #e2c48c;
    --accent-3:  #f0d7a8;
    --accent-2:  rgba(226, 196, 140, .12);
    --on-accent: #111111;
    --btn:       #f4f3ef;
    --on-btn:    #0b0b0c;

    --pos:       #4cc69a;  --pos-2:  rgba(76, 198, 154, .14);
    --neg:       #f2735f;  --neg-2:  rgba(242, 115, 95, .14);
    --warn:      #e0b35a;  --warn-2: rgba(224, 179, 90, .14);
    --move:      #6db6ff;  --move-2: rgba(109, 182, 255, .14);

    --side-bg:   #000000;
    --metal:     linear-gradient(150deg, #232326 0%, #0a0a0b 55%, #17171a 100%);
    --grad-soft: linear-gradient(135deg, rgba(226, 196, 140, .10), rgba(226, 196, 140, .03));

    --c-in:      #199e70;
    --c-out:     #d95926;
    --c-now:     #e2c48c;
    --c-prev:    #3a3a40;

    --shadow:    0 1px 2px rgba(0, 0, 0, .5), 0 12px 30px -18px rgba(0, 0, 0, .9);
    --shadow-2:  0 2px 4px rgba(0, 0, 0, .5), 0 30px 60px -28px rgba(0, 0, 0, 1);
  }
}
:root[data-theme=dark] {
  --bg:        #050506;
  --surface:   #101012;
  --surface-2: #17171a;
  --surface-3: #202024;
  --text:      #f4f3ef;
  --muted:     #9a9aa2;
  --faint:     #5e5e66;
  --border:    rgba(255, 255, 255, .08);
  --border-2:  rgba(255, 255, 255, .16);

  --accent:    #e2c48c;
  --accent-3:  #f0d7a8;
  --accent-2:  rgba(226, 196, 140, .12);
  --on-accent: #111111;
  --btn:       #f4f3ef;
  --on-btn:    #0b0b0c;

  --pos:       #4cc69a;  --pos-2:  rgba(76, 198, 154, .14);
  --neg:       #f2735f;  --neg-2:  rgba(242, 115, 95, .14);
  --warn:      #e0b35a;  --warn-2: rgba(224, 179, 90, .14);
  --move:      #6db6ff;  --move-2: rgba(109, 182, 255, .14);

  --side-bg:   #000000;
  --metal:     linear-gradient(150deg, #232326 0%, #0a0a0b 55%, #17171a 100%);
  --grad-soft: linear-gradient(135deg, rgba(226, 196, 140, .10), rgba(226, 196, 140, .03));

  --c-in:      #199e70;
  --c-out:     #d95926;
  --c-now:     #e2c48c;
  --c-prev:    #3a3a40;

  --shadow:    0 1px 2px rgba(0, 0, 0, .5), 0 12px 30px -18px rgba(0, 0, 0, .9);
  --shadow-2:  0 2px 4px rgba(0, 0, 0, .5), 0 30px 60px -28px rgba(0, 0, 0, 1);
}
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark]  { color-scheme: dark; }

/* ── base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg);
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: color .15s var(--ease); }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-3); padding: .05rem .35rem; border-radius: 5px; }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-family: var(--serif); font-weight: 500; font-size: 1.9rem; letter-spacing: -.01em; margin: .25rem 0 1rem; }
h2 { font-size: 1.02rem; font-weight: 600; letter-spacing: -.005em; margin-top: 2.25rem; margin-bottom: .7rem; display: flow-root; }
h3 { font-size: .95rem; font-weight: 600; margin-top: 1.25rem; }
h1 .note, h2 .note { font-weight: 400; }
h2 .more { float: right; font-weight: 500; font-size: .82rem; margin-top: .15rem; }
h2.eyebrow-h { font-size: .7rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); font-weight: 600; margin-top: 2rem; }
h2.eyebrow-h .more { text-transform: none; letter-spacing: 0; font-size: .82rem; margin-top: -.1rem; }
p  { margin: .5rem 0 .75rem; max-width: 46rem; }
p.lede { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }

/* Eyebrows: the small uppercase labels the whole interface uses. */
.eyebrow, .stat .label, .hero-card .label, .acard .type, thead th, nav.sidebar .group-label, form.filters label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 600;
}

/* ── app shell ────────────────────────────────────────────────────────────── */
:root { --sidebar: 15.5rem; --topbar: 3.25rem; }

body.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); grid-template-rows: 1fr; min-height: 100vh; }
body.app .topbar { display: none; }
body.app main { grid-column: 2; max-width: 76rem; width: 100%; padding: 2rem 2.75rem 2.5rem; margin: 0; }
body.app footer { max-width: none; padding: 1.25rem 0 0; margin-top: 3rem; }

nav.sidebar {
  grid-column: 1; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side-bg); border-right: 1px solid var(--side-line);
  color: var(--side-text);
  display: flex; flex-direction: column; padding: 1.25rem 1rem 1.1rem; gap: .25rem; font-size: .92rem;
}
.brand {
  display: flex; align-items: center; gap: .65rem; color: var(--text); font-weight: 700; font-size: 1rem;
  letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 8px;
  background: var(--metal); color: #e2c48c; flex: none; border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 6px 14px -8px rgba(0, 0, 0, .8);
}
.brand .mark .i { width: 1.05rem; height: 1.05rem; stroke-width: 2; }
nav.sidebar .brand { color: var(--side-on); padding: .25rem .5rem 1.25rem; }
nav.sidebar .group { display: flex; flex-direction: column; gap: 2px; padding-bottom: 1rem; }
nav.sidebar .group.bottom { margin-top: auto; padding-top: .9rem; border-top: 1px solid var(--side-line); padding-bottom: 0; }
nav.sidebar .group-label { color: var(--side-dim); padding: .55rem .65rem .4rem; }
nav.sidebar a {
  display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border-radius: 10px;
  color: var(--side-text); text-decoration: none; line-height: 1.2; position: relative; font-weight: 500;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
nav.sidebar a:hover { background: var(--side-hover); color: var(--side-on); transform: translateX(2px); }
nav.sidebar a.on { background: var(--side-active); color: var(--side-on); }
nav.sidebar a.on::before {
  content: ''; position: absolute; left: -1rem; top: .6rem; bottom: .6rem; width: 2px; border-radius: 0 2px 2px 0;
  background: #e2c48c;
}
nav.sidebar a .i { width: 1.1rem; height: 1.1rem; flex: none; opacity: .7; transition: opacity .18s; }
nav.sidebar a:hover .i, nav.sidebar a.on .i { opacity: 1; }
nav.sidebar a.on .i { color: #e2c48c; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 19; backdrop-filter: blur(3px); }

/* The UA sheet's [hidden] rule matches HTML elements only, so the inline icon
   sheet (an <svg hidden>) would otherwise render as a 300x150 blank box. */
svg[hidden] { display: none; }
svg.i { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; }

/* Narrow: top bar + drawer. */
@media (max-width: 56rem) {
  body.app { display: block; }
  body.app .topbar {
    display: flex; align-items: center; gap: .5rem; height: var(--topbar); padding: 0 .75rem;
    background: var(--side-bg); color: #fff; border-bottom: 1px solid var(--side-line); position: sticky; top: 0; z-index: 10;
  }
  .topbar .brand { padding: 0 .25rem; color: #fff; }
  .nav-toggle { margin: 0; padding: .45rem; background: none; border: 0; color: #fff; border-radius: 7px; line-height: 0; box-shadow: none; }
  .nav-toggle .i { width: 1.35rem; height: 1.35rem; }
  .nav-toggle:hover { background: var(--side-hover); transform: none; box-shadow: none; }
  nav.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(18rem, 84vw); z-index: 20; height: auto;
    transform: translateX(-102%); transition: transform .25s var(--ease); box-shadow: 0 0 60px rgba(0,0,0,.6);
  }
  body.nav-open nav.sidebar { transform: none; }
  body.app main { padding: 1.1rem 1rem 2rem; }
  /* No JavaScript: the toggle stays hidden; the drawer opens when targeted. */
  nav.sidebar:target { transform: none; }
  .nojs-menu { margin-left: auto; color: #e2c48c; }
}

/* ── public shell ─────────────────────────────────────────────────────────── */
body.public { display: flex; flex-direction: column; min-height: 100vh; }
nav.top {
  display: flex; align-items: center; gap: 1.25rem; width: 100%; margin: 0; padding: 1rem 2rem;
  font-size: .92rem; position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: padding .25s var(--ease), border-color .25s var(--ease);
}
body.scrolled nav.top { padding: .6rem 2rem; border-bottom-color: var(--border); }
nav.top a { color: var(--muted); text-decoration: none; font-weight: 500; }
nav.top a:hover, nav.top a.on { color: var(--text); }
nav.top a.button { color: var(--on-btn); }
nav.top .sp { flex: 1; }
body.public main { max-width: 68rem; width: 100%; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; flex: 1; }
body.public footer { padding-top: 1.25rem; margin-top: 2.5rem; }
footer { color: var(--faint); font-size: .82rem; border-top: 1px solid var(--border); max-width: 46rem; }

/* Narrow pages: sign-in, registration, recovery, the recovery code, PIN change. */
main.page-login, main.page-register, main.page-recover, main.page-recovery_code,
main.page-account_pin, main.page-accept_policy { max-width: 30rem !important; padding-top: 2rem !important; }
main.page-policy, main.page-landing { max-width: 56rem !important; }
main.page-login h1, main.page-register h1, main.page-recover h1, main.page-recovery_code h1 { text-align: center; font-size: 1.75rem; margin-bottom: .35rem; }
main.page-login > .auth-head, main.page-register > .auth-head, main.page-recover > .auth-head { text-align: center; margin-bottom: 1.5rem; }
.auth-head .mark {
  display: inline-flex; align-items: center; justify-content: center; width: 3.2rem; height: 3.2rem; border-radius: 12px;
  background: var(--metal); color: #e2c48c; margin-bottom: 1rem; border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 14px 30px -14px rgba(0, 0, 0, .9);
}
.auth-head .mark .i { width: 1.6rem; height: 1.6rem; stroke-width: 1.9; }
.auth-head p { margin: 0 auto; color: var(--muted); font-size: .93rem; }
main.page-login form.stack, main.page-register form.stack, main.page-recover form.stack { max-width: none; padding: 1.5rem 1.5rem 1.6rem; box-shadow: var(--shadow-2); }
main.page-login > p.note, main.page-register > p.note { text-align: center; max-width: none; }

/* ── page header ──────────────────────────────────────────────────────────── */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.75rem; }
.pagehead h1 { margin: 0; font-size: 2.1rem; }
.pagehead .sub { margin: .3rem 0 0; color: var(--muted); font-size: .93rem; }
.pagehead .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

a.button, button.button {
  display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1.15rem; border-radius: 999px; font-weight: 600; font-size: .9rem;
  background: var(--btn); color: var(--on-btn); border: 1px solid transparent; text-decoration: none; cursor: pointer; margin: 0;
  box-shadow: var(--shadow);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
a.button, button.button { white-space: nowrap; }
a.button.quiet, button.quiet { background: transparent; color: var(--text); border-color: var(--border-2); box-shadow: none; }
a.button.small { padding: .4rem .85rem; font-size: .85rem; }
a.button:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-2); }
a.button.quiet:hover { background: var(--surface-2); }
a.button:active { transform: translateY(0); }

/* ── panels (collapsible add forms) ───────────────────────────────────────── */
details.panel { margin: 1.5rem 0; }
details.panel > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .55rem;
  color: var(--accent); font-weight: 600; font-size: .9rem; padding: .35rem 0;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before {
  content: '+'; font-weight: 600; width: 1.4rem; height: 1.4rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-2); font-size: .95rem; line-height: 1; transition: transform .25s var(--ease), background .2s;
}
details.panel[open] > summary::before { transform: rotate(45deg); background: var(--surface-3); }
details.panel[open] > summary { color: var(--muted); }
details.panel > form, details.panel > .panel-body { margin-top: .5rem; }

/* ── hero card (dashboard) ───────────────────────────────────────────────── */
.hero-card {
  position: relative; overflow: hidden; border-radius: 20px; padding: 1.75rem 2rem 1.6rem; margin: 0 0 1.5rem;
  background: var(--metal); color: #f4f3ef; border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 40px 80px -40px rgba(0, 0, 0, .9);
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.25rem 2rem; align-items: end;
}
.hero-card::before, .hero-card::after { content: ''; position: absolute; pointer-events: none; }
/* A soft sheen crossing the card, like light on a metal surface. */
.hero-card::before { inset: -40% -20%; background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.07) 50%, transparent 62%); }
.hero-card::after  { width: 22rem; height: 22rem; border-radius: 50%; right: -8rem; top: -12rem; background: radial-gradient(closest-side, rgba(226, 196, 140, .16), rgba(226,196,140,0)); }
.hero-card > * { position: relative; }
.hero-card .label { display: block; color: #e2c48c; }
.hero-card .big { display: block; font-size: 2.7rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.05; margin: .45rem 0 .4rem; }
.hero-card .big.neg { color: #ffb0a4; }
.hero-card .meta { font-size: .88rem; color: rgba(255,255,255,.62); margin: 0; }
.hero-card .meta a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.35); }
.hero-card .flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.hero-card .flow > div {
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: .7rem .85rem;
  min-width: 0; transition: background .2s var(--ease), transform .2s var(--ease);
}
.hero-card .flow > div:hover { background: rgba(255, 255, 255, .09); transform: translateY(-2px); }
.hero-card .flow .label { font-size: .62rem; display: flex; align-items: center; gap: .35rem; color: rgba(255,255,255,.6); }
.hero-card .flow .label .i { width: .85rem; height: .85rem; }
.hero-card .flow .v { display: block; font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; margin-top: .25rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-card .flow .in .label .i { color: #7fe0b8; }
.hero-card .flow .out .label .i { color: #ffb0a4; }
.hero-card .flow .net .label .i { color: #e2c48c; }
@media (max-width: 48rem) {
  .hero-card { grid-template-columns: 1fr; padding: 1.35rem 1.35rem 1.2rem; }
  .hero-card .big { font-size: 2.2rem; }
  /* One tile per line, label left and figure right, so nothing truncates. */
  .hero-card .flow { grid-template-columns: 1fr; gap: .4rem; }
  .hero-card .flow > div { display: flex; align-items: center; justify-content: space-between; padding: .55rem .85rem; }
  .hero-card .flow .v { margin-top: 0; font-size: 1rem; }
}

/* Masked figures (public/js/peek.js). Hidden, a figure is a frosted placeholder:
   the same shape for everyone, blurred, the way Revolut hides a balance. The
   eye beside it is a small ghost glyph. Revealing lifts the blur while the
   digits settle -- a decrypt, which is what it is. */
[data-figure] { display: inline-block; transition: filter .55s var(--ease), opacity .55s var(--ease), letter-spacing .55s var(--ease); }
.masked { filter: blur(6px); opacity: .55; user-select: none; pointer-events: none; letter-spacing: .02em; }
.decrypting { font-variant-numeric: tabular-nums; }
.fig { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; max-width: 100%; }
.fig > [data-figure] { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.peek {
  flex: none; display: inline-flex; align-items: center; justify-content: center; padding: .2rem; margin: 0 -.2rem; border-radius: 6px;
  color: rgba(255,255,255,.42); background: none; border: 0;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.peek:hover, .peek:focus-visible { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.peek.busy { opacity: .5; pointer-events: none; }
.peek .i { width: .85rem; height: .85rem; stroke-width: 1.9; }
.peek svg[hidden] { display: none; }
.hero-card .big { display: flex; align-items: center; gap: .6rem; }
.hero-card .big .peek { align-self: center; margin-top: .15rem; }
.hero-card .big .peek .i { width: 1rem; height: 1rem; }
.hero-card .flow .v { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.hero-card .flow .v .peek .i { width: .72rem; height: .72rem; }
.acard .fig .peek .i { width: .8rem; height: .8rem; }
@media (prefers-reduced-motion: reduce) {
  [data-figure] { transition: none; }
}

/* ── account cards ──────────────────────────────────────────────────────── */
.acards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1rem; margin: .5rem 0 1.75rem; perspective: 1200px; }
.acard {
  --tx: 0; --ty: 0;
  position: relative; display: flex; flex-direction: column; aspect-ratio: 1.586; min-height: 9.5rem; padding: 1.1rem 1.2rem 1.05rem;
  border-radius: 14px; color: #f4f3ef; text-decoration: none; overflow: hidden; isolation: isolate;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 30px 60px -34px rgba(0, 0, 0, .9);
  transform: rotateX(calc(var(--ty) * -6deg)) rotateY(calc(var(--tx) * 8deg));
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  will-change: transform;
}
.acard:hover { text-decoration: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 40px 70px -34px rgba(0, 0, 0, 1); }
.acard { cursor: pointer; }
/* The sheen follows the pointer through the same two custom properties. */
.acard::before {
  content: ''; position: absolute; inset: -60%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side at calc(50% + var(--tx) * 40%) calc(50% + var(--ty) * 40%), rgba(255,255,255,.14), rgba(255,255,255,0) 70%);
  transition: opacity .3s; opacity: .7;
}
.acard:hover::before { opacity: 1; }
.acard.bank    { background: linear-gradient(150deg, #223052 0%, #0b1020 58%, #17203a 100%); }
.acard.card    { background: linear-gradient(150deg, #2c2c30 0%, #080809 58%, #1b1b1e 100%); }
.acard.cash    { background: linear-gradient(150deg, #1f4a3a 0%, #08160f 58%, #143526 100%); }
.acard.wallet  { background: linear-gradient(150deg, #3d2b57 0%, #120b1c 58%, #2b1e3e 100%); }
.acard.loan    { background: linear-gradient(150deg, #5a3d22 0%, #1a100a 58%, #3e2a16 100%); }
.acard.friends { background: linear-gradient(150deg, #5a2236 0%, #1a0a12 58%, #3e1828 100%); }
.acard.other   { background: var(--metal); }
.acard .top { display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,.62); }
.acard .top .i { width: 1.1rem; height: 1.1rem; color: rgba(255,255,255,.7); }
.acard .type { color: rgba(255,255,255,.62); }
.acard .chip { display: none; }
.acard.card .chip {
  display: block; width: 2rem; height: 1.45rem; border-radius: 5px; margin-top: .7rem;
  background: linear-gradient(135deg, #e9d7a8, #b8955a 55%, #e2c48c); opacity: .9;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25), inset 0 -6px 0 -4px rgba(0,0,0,.2);
}
.acard .name { margin-top: auto; font-weight: 600; font-size: 1rem; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The name's link is stretched over the whole card; the eye sits above it. */
.acard .name a { color: inherit; text-decoration: none; }
.acard .name a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.acard .fig { position: relative; z-index: 2; display: flex; margin-top: .15rem; }
.acard .fig .peek { pointer-events: auto; }
.acard .fig > [data-figure] { pointer-events: none; }
.acard .bal { display: block; font-size: 1.45rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acard .bal.neg { color: #ffb0a4; }
.acard .sub { font-size: .74rem; color: rgba(255,255,255,.55); }
@media (max-width: 40rem) {
  /* A wallet: one row of cards to swipe through, each snapping into place. */
  .acards {
    display: flex; gap: .75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: .25rem .25rem 1rem;
    margin: .25rem -.25rem 1rem; scrollbar-width: none; perspective: none;
  }
  .acards::-webkit-scrollbar { display: none; }
  .acard { flex: 0 0 78vw; max-width: 20rem; scroll-snap-align: start; aspect-ratio: 1.7; transform: none; }
}

/* ── cards and grids ──────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.25rem; align-items: start; }
section.card {
  min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem 1.25rem 1.15rem;
  transition: border-color .2s var(--ease), box-shadow .3s var(--ease);
}
section.card:hover { border-color: var(--border-2); }
section.card > h2 { margin: 0 0 .6rem; padding: 0 0 .7rem; border-bottom: 1px solid var(--border); font-size: .98rem; }
section.card > h2 .more { float: right; font-weight: 500; font-size: .82rem; }
section.card table { border: 0; box-shadow: none; margin: 0; background: transparent; }
section.card table thead th { background: transparent; border-bottom-color: var(--border); }
section.card tfoot th, section.card tfoot td { background: var(--surface-2); }
section.card .empty { margin: .25rem 0 0; }
.empty {
  background: var(--grad-soft); border: 1px solid var(--accent-2); border-radius: var(--radius); padding: 1.4rem 1.25rem;
  color: var(--muted); font-size: .93rem; text-align: center;
}
.empty a { font-weight: 600; }

/* ── notices ──────────────────────────────────────────────────────────────── */
p.error, p.ok, p.notice {
  border-radius: var(--radius-s); padding: .65rem .9rem .65rem 1.1rem; margin: 0 0 1rem;
  border: 1px solid; max-width: none; font-size: .93rem; position: relative;
}
p.error::before, p.ok::before, p.notice::before { content: ''; position: absolute; left: 0; top: .55rem; bottom: .55rem; width: 3px; border-radius: 3px; background: currentColor; }
p.error  { color: var(--neg);  background: var(--neg-2);  border-color: color-mix(in srgb, var(--neg) 22%, transparent); }
p.ok     { color: var(--pos);  background: var(--pos-2);  border-color: color-mix(in srgb, var(--pos) 22%, transparent); }
p.notice { color: var(--warn); background: var(--warn-2); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
p.error a, p.ok a { color: inherit; text-decoration: underline; }
p.note, span.note, .note { color: var(--muted); font-size: .88rem; }
p.note { margin: .35rem 0 1rem; max-width: 44rem; }
.neg, td.neg, .num.neg { color: var(--neg); }
.move, td.move { color: var(--move); }
.pos, .ok-text { color: var(--pos); }
p.jump { margin: -.5rem 0 1rem; font-size: .88rem; color: var(--muted); }

/* ── stat tiles ──────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; margin: 0 0 1.5rem; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.15rem 1.05rem; box-shadow: var(--shadow); position: relative; min-width: 0;
  display: grid; grid-template-columns: 1fr auto; column-gap: .75rem;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.stat:hover { border-color: var(--border-2); transform: translateY(-2px); }
.stat .label { display: block; color: var(--muted); grid-column: 1; }
.stat .value { display: block; font-size: 1.55rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: .3rem; letter-spacing: -.02em; grid-column: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value.neg { color: var(--neg); }
.stat .value.pos { color: var(--pos); }
.stat .sub { display: block; color: var(--muted); font-size: .8rem; margin-top: .15rem; grid-column: 1; }
.stat .ico {
  grid-column: 2; grid-row: 1 / span 3; align-self: start;
  width: 2.35rem; height: 2.35rem; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-2); color: var(--accent);
}
.stat .ico .i { width: 1.2rem; height: 1.2rem; stroke-width: 1.9; }
.stat.in .ico  { background: var(--pos-2);  color: var(--pos); }
.stat.out .ico { background: var(--neg-2);  color: var(--neg); }
.stat.move .ico { background: var(--move-2); color: var(--move); }
.stat.warn .ico { background: var(--warn-2); color: var(--warn); }

/* ── avatars ─────────────────────────────────────────────────────────────── */
.av {
  display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  font-size: .78rem; font-weight: 700; flex: none; vertical-align: middle; margin-right: .6rem;
  background: var(--av-bg); color: var(--av-fg); transition: transform .2s var(--ease);
}
tr:hover .av, .feature:hover .av { transform: scale(1.08); }
.av .i { width: .95rem; height: .95rem; stroke-width: 2; }
.av.sq { border-radius: 8px; }
.av.lg { width: 2.6rem; height: 2.6rem; font-size: 1.05rem; }
.av.lg .i { width: 1.25rem; height: 1.25rem; }
.av.h0 { --av-bg: #e7e3f6; --av-fg: #4b3f9e; }   /* indigo  */
.av.h1 { --av-bg: #ddf0e6; --av-fg: #1d6b4c; }   /* emerald */
.av.h2 { --av-bg: #f6ecd2; --av-fg: #8a6412; }   /* amber   */
.av.h3 { --av-bg: #f8e2e2; --av-fg: #a83a3a; }   /* rose    */
.av.h4 { --av-bg: #dcecf5; --av-fg: #1f5f80; }   /* sky     */
.av.h5 { --av-bg: #ede2f5; --av-fg: #6a3fa8; }   /* violet  */
.av.h6 { --av-bg: #d9f0ee; --av-fg: #176c65; }   /* teal    */
.av.h7 { --av-bg: #f8e6d9; --av-fg: #9c4e1e; }   /* orange  */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .av.h0 { --av-bg: #24224a; --av-fg: #b2acff; }
  :root:not([data-theme=light]) .av.h1 { --av-bg: #113023; --av-fg: #6fe0af; }
  :root:not([data-theme=light]) .av.h2 { --av-bg: #362c14; --av-fg: #f0c66a; }
  :root:not([data-theme=light]) .av.h3 { --av-bg: #3a1d1f; --av-fg: #ff9a9a; }
  :root:not([data-theme=light]) .av.h4 { --av-bg: #10293a; --av-fg: #7fcdf0; }
  :root:not([data-theme=light]) .av.h5 { --av-bg: #2b1f46; --av-fg: #c8a8ff; }
  :root:not([data-theme=light]) .av.h6 { --av-bg: #0f302e; --av-fg: #6cd8cc; }
  :root:not([data-theme=light]) .av.h7 { --av-bg: #3a2416; --av-fg: #ffa878; }
}
:root[data-theme=dark] .av.h0 { --av-bg: #24224a; --av-fg: #b2acff; }
:root[data-theme=dark] .av.h1 { --av-bg: #113023; --av-fg: #6fe0af; }
:root[data-theme=dark] .av.h2 { --av-bg: #362c14; --av-fg: #f0c66a; }
:root[data-theme=dark] .av.h3 { --av-bg: #3a1d1f; --av-fg: #ff9a9a; }
:root[data-theme=dark] .av.h4 { --av-bg: #10293a; --av-fg: #7fcdf0; }
:root[data-theme=dark] .av.h5 { --av-bg: #2b1f46; --av-fg: #c8a8ff; }
:root[data-theme=dark] .av.h6 { --av-bg: #0f302e; --av-fg: #6cd8cc; }
:root[data-theme=dark] .av.h7 { --av-bg: #3a2416; --av-fg: #ffa878; }
td .av + a, td .av + span { vertical-align: middle; }
.who { display: flex; align-items: center; gap: 0; min-width: 0; }
.who .av { margin-right: .65rem; }
.who .t { min-width: 0; }
.who .t a { font-weight: 600; color: var(--text); }
.who .t a:hover { color: var(--accent); }
.who .t .note { display: block; font-size: .8rem; margin-top: -.05rem; }

/* ── tables ───────────────────────────────────────────────────────────────── */
table {
  width: 100%; margin: .5rem 0 .5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); font-size: .93rem;
  border-collapse: separate; border-spacing: 0; overflow: hidden;
}
th, td { text-align: left; padding: .7rem .95rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td, tfoot tr:last-child th, tfoot tr:last-child td { border-bottom: 0; }
thead th { color: var(--muted); background: transparent; border-bottom: 1px solid var(--border-2); padding-top: .6rem; padding-bottom: .6rem; }
tfoot th, tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--border-2); }
tbody tr { transition: background .12s var(--ease); }
tbody tr:hover td { background: var(--surface-2); }
td.date, th.date { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
td.num .note { display: block; font-size: .78rem; font-weight: 400; }
tr.child td { color: var(--muted); font-size: .9rem; }
tr.current td { font-weight: 600; background: var(--accent-2); }
table a { text-decoration: none; }
table a:hover { text-decoration: underline; }
td:only-child { border-bottom: 1px solid var(--border); }

/* Share bars in the report breakdowns: a <progress> so no inline widths. */
progress.share { -webkit-appearance: none; appearance: none; width: 6.5rem; height: .4rem; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-3); vertical-align: middle; margin-right: .5rem; }
progress.share::-webkit-progress-bar { background: var(--surface-3); border-radius: 999px; }
progress.share::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.share::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
/* One vendor pseudo-element per rule: an unknown one invalidates the whole selector list. */
progress.share.in::-webkit-progress-value  { background: var(--pos); }
progress.share.in::-moz-progress-bar       { background: var(--pos); }
progress.share.out::-webkit-progress-value { background: var(--neg); }
progress.share.out::-moz-progress-bar      { background: var(--neg); }
td.share { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* Narrow screens: tables scroll sideways rather than squashing. */
/* public/js/tables.js wraps each data table in .table-wrap so wide tables
   scroll sideways inside a full-width frame. The inline-block rule below is the
   no-JavaScript fallback: same frame, rows that do not stretch. */
.table-wrap { overflow-x: auto; margin: .5rem 0; border-radius: var(--radius); }
.table-wrap > table { margin: 0; min-width: 100%; width: max-content; display: table; }
section.card .table-wrap { margin: 0; border-radius: 0; }
section.card .table-wrap > table { width: 100%; }
section.card .who .t a { overflow-wrap: anywhere; }
section.card.wide table { white-space: nowrap; }
@media (max-width: 40rem) {
  table { display: inline-block; min-width: 100%; max-width: 100%; overflow-x: auto; white-space: nowrap; vertical-align: top; }
  .table-wrap > table { display: table; }
  th, td { padding: .5rem .65rem; }
  td.date .yr { display: none; }
  /* A card's table fits the card: names wrap, figures stay on one line.
     A .wide card keeps its rows on one line and scrolls sideways instead. */
  section.card:not(.wide) table { display: table; white-space: normal; width: 100%; }
}

/* ── forms ────────────────────────────────────────────────────────────────── */
form.stack, form.txform, form.splitform {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.2rem 1.35rem 1.35rem; margin: .75rem 0 1rem;
}
form.stack { max-width: 30rem; }
form.txform, form.splitform { max-width: 48rem; }
label { display: block; font-size: .84rem; font-weight: 600; color: var(--text); margin: .85rem 0 .3rem; }
label .note { font-weight: 400; }
label:first-of-type { margin-top: 0; }
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=tel], input[type=password], input[type=date], input[type=month],
input[type=number], select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--border-2); border-radius: var(--radius-s);
  background: var(--surface-2); color: var(--text); min-height: 2.6rem;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-2);
}
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=checkbox] { width: auto; margin-right: .45rem; vertical-align: -.1em; accent-color: var(--accent); }
label.check { font-weight: 400; display: flex; gap: .6rem; align-items: flex-start; margin: 1.1rem 0; font-size: .9rem; line-height: 1.5; }
label.check input { margin: .25rem 0 0; flex: none; width: 1rem; height: 1rem; }
/* The text sits in one span, so a link or emphasis inside it stays in the sentence. */
label.check .txt { flex: 1; min-width: 0; }
/* Selects share the input box; the native control ignored padding and height. */
select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 2.4rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a90' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right .8rem center; background-size: .9rem;
}
select:disabled { cursor: default; opacity: .6; }
select option { background: var(--surface); color: var(--text); }
::placeholder { color: var(--faint); }

button {
  margin-top: 1rem; padding: .65rem 1.25rem; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; background: var(--btn); color: var(--on-btn); font-weight: 600;
  box-shadow: var(--shadow); transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
button:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
button:active { transform: translateY(0); }
button.link {
  background: none; color: var(--accent); border: none; padding: 0; margin: 0; font-weight: 500;
  text-decoration: none; box-shadow: none;
}
button.link:hover { text-decoration: underline; background: none; transform: none; box-shadow: none; }
form.inline { display: inline; margin: 0; }
form.inline button { margin: 0; }
form.inline.stack { display: block; padding: .6rem .75rem; margin: .4rem 0 0; max-width: 20rem; box-shadow: none; }
form.inline.stack label { margin: .3rem 0 .15rem; }
form.inline.stack button { margin-top: .6rem; padding: .35rem .8rem; font-size: .88rem; }
form.danger { margin-top: 1.5rem; font-size: .9rem; }
form.danger button.link { color: var(--neg); }
form.danger .note { margin-left: .5rem; }

/* Rows of fields side by side; stack on narrow screens. */
.row { display: flex; gap: .9rem; flex-wrap: wrap; margin: 0; }
.row > span { flex: 1 1 11rem; min-width: 0; }
.row + .row { margin-top: .25rem; }
form.txform .row label, form.splitform .row label { margin-top: .6rem; }

/* Filters: a quiet strip above a list. */
form.filters {
  display: flex; gap: .5rem 1rem; align-items: flex-end; flex-wrap: wrap; margin: 1rem 0 .75rem;
  padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
form.filters span { display: flex; flex-direction: column; gap: .2rem; }
form.filters label { margin: 0; color: var(--muted); }
form.filters input, form.filters select { width: auto; min-width: 8rem; min-height: 2.5rem; padding: .35rem .6rem; }
form.filters select { padding-right: 2.2rem; }
form.filters button { margin: 0; padding: .5rem 1rem; }

/* Split lines inside the transaction and shared-expense forms. */
table.splits { box-shadow: none; margin: .75rem 0; font-size: .9rem; }
table.splits thead th { font-size: .64rem; }
table.splits td { padding: .35rem .5rem; }
table.splits input, table.splits select { min-height: 2.2rem; padding: .35rem .5rem; }
table.splits select { padding-right: 2rem; background-position: right .55rem center; }
table.splits td.split-input input { max-width: 9rem; margin-left: auto; text-align: right; }
table.splits label { margin: 0; font-weight: 400; display: inline; }
table.splits td:only-child { border-bottom: 1px solid var(--border); }

/* Credential field + its reveal toggle. */
span.secret { display: block; position: relative; }
span.secret input { padding-right: 2.6rem; }
button.reveal {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  margin: 0; padding: .5rem; line-height: 0; background: none; border: none; color: var(--muted); cursor: pointer; box-shadow: none;
}
button.reveal svg[hidden] { display: none; }
button.reveal:hover { color: var(--text); background: none; transform: translateY(-50%); box-shadow: none; }

.code {
  font-family: var(--mono); font-size: 1.15rem; letter-spacing: .08em; text-align: center;
  background: var(--surface); padding: 1rem; border: 1px dashed var(--border-2); border-radius: var(--radius);
  user-select: all;
}

/* ── details / summary (inline record-in-ledger panels) ───────────────────── */
details summary { cursor: pointer; color: var(--accent); list-style: none; font-size: .9rem; font-weight: 500; }
details summary::-webkit-details-marker { display: none; }
details summary:hover { text-decoration: underline; }
details[open] summary { color: var(--muted); }

/* ── pager ────────────────────────────────────────────────────────────────── */
p.pager { display: flex; gap: 1rem; align-items: baseline; margin: .75rem 0 1.5rem; font-size: .9rem; }

/* ── landing ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 4rem 2rem 3.5rem; text-align: center;
  background: var(--metal); color: #f4f3ef; margin: .25rem 0 2.5rem; border: 1px solid rgba(255,255,255,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 50px 100px -50px rgba(0,0,0,.9);
}
.hero::before, .hero::after { content: ''; position: absolute; pointer-events: none; }
.hero::before { inset: -40% -20%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.06) 50%, transparent 60%); }
.hero::after  { width: 36rem; height: 36rem; border-radius: 50%; left: 50%; top: -22rem; margin-left: -18rem; background: radial-gradient(closest-side, rgba(226,196,140,.18), rgba(226,196,140,0)); }
.hero > * { position: relative; }
.hero h1 { font-size: 3.4rem; margin: 1rem auto .9rem; letter-spacing: -.02em; max-width: 36rem; line-height: 1.08; font-weight: 500; }
.hero .lede { margin: 0 auto; color: rgba(255,255,255,.7); font-size: 1.1rem; }
.hero .badge { background: rgba(255,255,255,.06); color: #e2c48c; border: 1px solid rgba(226,196,140,.35); padding: .3rem .85rem; font-weight: 600; display: inline-flex; align-items: center; gap: .4rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; }
.hero .actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; margin: 1.75rem 0 0; max-width: none; }
.hero a.button { background: #f4f3ef; color: #0b0b0c; box-shadow: 0 14px 30px -14px rgba(0,0,0,.8); }
.hero a.button.quiet { background: transparent; color: #f4f3ef; border-color: rgba(255,255,255,.3); box-shadow: none; }
.hero a.button.quiet:hover { background: rgba(255,255,255,.08); }
main.page-landing h2 { text-align: center; font-family: var(--serif); font-weight: 500; font-size: 1.7rem; margin-top: 3rem; letter-spacing: -.01em; }
main.page-landing > p { margin-left: auto; margin-right: auto; text-align: center; }
main.page-landing > p.actions { display: flex; justify-content: center; gap: .75rem; margin-top: 1.5rem; max-width: none; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 1.5rem 0 1rem; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem 1.25rem 1.25rem; box-shadow: var(--shadow);
  transition: transform .25s var(--ease), border-color .2s var(--ease), box-shadow .25s var(--ease);
}
.feature:hover { transform: translateY(-3px); border-color: var(--border-2); box-shadow: var(--shadow-2); }
.feature .av { margin: 0 0 .85rem; }
.feature strong { display: block; margin-bottom: .25rem; font-size: .98rem; }
.feature p { margin: 0; color: var(--muted); font-size: .9rem; }
.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.trust .stat .value { font-size: 1.35rem; }

/* ── type badges ──────────────────────────────────────────────────────────── */
.badge.type { text-transform: uppercase; font-size: .62rem; letter-spacing: .1em; font-weight: 600; }
.badge.type.expense  { color: var(--neg);  background: var(--neg-2);  border-color: transparent; }
.badge.type.income   { color: var(--pos);  background: var(--pos-2);  border-color: transparent; }
.badge.type.transfer { color: var(--move); background: var(--move-2); border-color: transparent; }
.badge.type.opening  { color: var(--muted); }
td.credit { color: var(--pos); }
a.icon { color: var(--faint); display: inline-flex; padding: .3rem; border-radius: 7px; transition: color .15s, background .15s; }
a.icon:hover { color: var(--accent); background: var(--accent-2); text-decoration: none; }
tr:hover a.icon { color: var(--accent); }

/* ── categories ──────────────────────────────────────────────────────────── */
.cats { list-style: none; margin: 0; padding: 0; }
.cat { padding: .85rem 0 .9rem; border-bottom: 1px solid var(--border); }
.cat:last-child { border-bottom: 0; padding-bottom: .25rem; }
.cat-row { display: flex; align-items: center; gap: .2rem; min-width: 0; }
.cat-row .av { width: 2.2rem; height: 2.2rem; font-size: .85rem; margin-right: .6rem; }
.cat-main { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.cat-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-main .note { font-size: .78rem; }
.cat-fig { display: flex; flex-direction: column; align-items: flex-end; flex: none; gap: .2rem; }
.cat-fig .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.cat-fig .share-row { display: inline-flex; align-items: center; gap: .4rem; }
.cat-fig progress.share { width: 5rem; margin: 0; }
.cat-fig .note.quiet { color: var(--faint); font-size: .8rem; }
.chips { list-style: none; margin: .6rem 0 0 2.8rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .65rem .2rem .5rem; border-radius: 999px;
  background: var(--surface-3); color: var(--text); font-size: .82rem; font-weight: 500; border: 1px solid transparent;
  transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.chip:hover { border-color: var(--border-2); transform: translateY(-1px); }
.chip .dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--av-fg); flex: none; }
.chip .dot.h0 { --av-fg: #4b3f9e; } .chip .dot.h1 { --av-fg: #1d6b4c; } .chip .dot.h2 { --av-fg: #8a6412; } .chip .dot.h3 { --av-fg: #a83a3a; }
.chip .dot.h4 { --av-fg: #1f5f80; } .chip .dot.h5 { --av-fg: #6a3fa8; } .chip .dot.h6 { --av-fg: #176c65; } .chip .dot.h7 { --av-fg: #9c4e1e; }
.chip-amt { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .chip .dot.h0 { --av-fg: #b2acff; } :root:not([data-theme=light]) .chip .dot.h1 { --av-fg: #6fe0af; }
  :root:not([data-theme=light]) .chip .dot.h2 { --av-fg: #f0c66a; } :root:not([data-theme=light]) .chip .dot.h3 { --av-fg: #ff9a9a; }
  :root:not([data-theme=light]) .chip .dot.h4 { --av-fg: #7fcdf0; } :root:not([data-theme=light]) .chip .dot.h5 { --av-fg: #c8a8ff; }
  :root:not([data-theme=light]) .chip .dot.h6 { --av-fg: #6cd8cc; } :root:not([data-theme=light]) .chip .dot.h7 { --av-fg: #ffa878; }
}
:root[data-theme=dark] .chip .dot.h0 { --av-fg: #b2acff; } :root[data-theme=dark] .chip .dot.h1 { --av-fg: #6fe0af; }
:root[data-theme=dark] .chip .dot.h2 { --av-fg: #f0c66a; } :root[data-theme=dark] .chip .dot.h3 { --av-fg: #ff9a9a; }
:root[data-theme=dark] .chip .dot.h4 { --av-fg: #7fcdf0; } :root[data-theme=dark] .chip .dot.h5 { --av-fg: #c8a8ff; }
:root[data-theme=dark] .chip .dot.h6 { --av-fg: #6cd8cc; } :root[data-theme=dark] .chip .dot.h7 { --av-fg: #ffa878; }
@media (max-width: 40rem) {
  .cat-fig progress.share { width: 3.5rem; }
  .chips { margin-left: 0; }
}

/* Small ghost icon buttons (delete on a category row or chip). */
button.icon-btn {
  margin: 0; padding: .3rem; border: 0; border-radius: 6px; background: none; box-shadow: none; line-height: 0;
  color: var(--faint); cursor: pointer; transition: color .15s var(--ease), background .15s var(--ease);
}
button.icon-btn:hover, button.icon-btn:focus-visible { color: var(--neg); background: var(--neg-2); transform: none; box-shadow: none; }
button.icon-btn .i { width: .9rem; height: .9rem; }
.cat-row form.del { margin-left: .5rem; opacity: 0; transition: opacity .15s var(--ease); }
.cat:hover .cat-row form.del, .cat:focus-within .cat-row form.del { opacity: 1; }
.chip form.del { margin-left: .15rem; }
.chip form.del button.icon-btn { padding: .1rem; border-radius: 50%; }
.chip form.del .i { width: .7rem; height: .7rem; }
@media (hover: none) { .cat-row form.del { opacity: 1; } }

/* ── feedback ────────────────────────────────────────────────────────────── */
.fb-grid { align-items: start; }
form.fb { max-width: none; box-shadow: none; border: 0; padding: 0; margin: 0; background: transparent; }
.label-text { display: block; font-size: .84rem; font-weight: 600; margin: .85rem 0 .35rem; }
form.fb .label-text:first-of-type { margin-top: 0; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-3); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label {
  margin: 0; padding: .4rem .95rem; border-radius: 999px; font-size: .86rem; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.seg label:hover { color: var(--text); }
.seg input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Stars: laid out right-to-left so :checked ~ label lights the ones before it. */
.stars { display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.stars label { margin: 0; padding: .15rem; cursor: pointer; color: var(--border-2); line-height: 0; transition: color .12s var(--ease), transform .12s var(--ease); }
.stars label .i { width: 1.6rem; height: 1.6rem; stroke-width: 1.6; }
.stars label:hover, .stars label:hover ~ label { color: var(--accent); }
.stars input:checked ~ label { color: var(--accent); }
.stars input:checked ~ label .i, .stars label:hover .i, .stars label:hover ~ label .i { fill: var(--accent); }
.stars label:hover { transform: scale(1.1); }
.stars input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.fb-privacy { display: flex; gap: .5rem; align-items: flex-start; padding: .75rem .9rem; margin: 1rem 0 .25rem; border-radius: var(--radius-s); background: var(--grad-soft); border: 1px solid var(--accent-2); max-width: none; }
.fb-privacy .i { flex: none; margin-top: .2rem; color: var(--accent); }
.fb-items { list-style: none; margin: 0; padding: 0; }
.fb-item { padding: .9rem 0 1rem; border-bottom: 1px solid var(--border); }
.fb-item:last-child { border-bottom: 0; }
.fb-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
.fb-head .fb-date { margin-left: auto; }
.fb-subject { display: block; font-size: .98rem; margin-bottom: .2rem; }
.fb-body { margin: 0; color: var(--muted); font-size: .92rem; white-space: pre-line; }
.fb-stars .i { width: .85rem; height: .85rem; color: var(--border-2); }
.fb-stars .i.on { color: var(--accent); fill: var(--accent); }
.fb-reply { margin-top: .75rem; padding: .7rem .9rem; border-radius: var(--radius-s); background: var(--surface-2); border-left: 2px solid var(--accent); }
.fb-reply .eyebrow { color: var(--accent); display: block; margin-bottom: .2rem; }
.fb-reply p { margin: 0; font-size: .92rem; white-space: pre-line; }
.badge.kind-review    { color: var(--accent); background: var(--accent-2); }
.badge.kind-complaint { color: var(--neg); background: var(--neg-2); }
.badge.kind-feature   { color: var(--move); background: var(--move-2); }
.badge.status-new         { color: var(--text); background: var(--surface-3); }
.badge.status-seen        { color: var(--muted); background: var(--surface-3); }
.badge.status-in_progress { color: var(--warn); background: var(--warn-2); }
.badge.status-done        { color: var(--pos); background: var(--pos-2); }
.badge.status-wont_fix    { color: var(--muted); background: var(--surface-3); text-decoration: line-through; }

/* ── misc ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; font-size: .75rem; padding: .1rem .6rem; border-radius: 999px;
  background: var(--surface-3); color: var(--muted); border: 1px solid transparent; vertical-align: .08em; font-weight: 500;
}
.badge.pos { color: var(--pos); background: var(--pos-2); }
.badge.neg { color: var(--neg); background: var(--neg-2); }
.badge.accent { color: var(--accent); background: var(--accent-2); }
.muted { color: var(--muted); }

/* ── appearance switch ───────────────────────────────────────────────────── */
.theme { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--surface-3); }
.theme button {
  margin: 0; padding: .32rem .6rem; border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  box-shadow: none; line-height: 0; cursor: pointer; transition: background .18s, color .18s;
}
.theme button:hover { background: var(--surface); color: var(--text); transform: none; box-shadow: none; }
.theme button[aria-pressed=true] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.theme .i { width: 1rem; height: 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
nav.sidebar .appearance { display: flex; align-items: center; justify-content: space-between; padding: .7rem .1rem 0 0; }
nav.sidebar .appearance .group-label { padding-left: .7rem; }
nav.sidebar .theme { background: rgba(255, 255, 255, .06); }
nav.sidebar .theme button { color: var(--side-dim); }
nav.sidebar .theme button:hover { background: var(--side-hover); color: var(--side-on); }
nav.sidebar .theme button[aria-pressed=true] { background: rgba(255,255,255,.12); color: #e2c48c; box-shadow: none; }
nav.top .theme { margin-left: .25rem; }

/* ── charts ──────────────────────────────────────────────────────────────── */
section.card.chart > h2 .note { float: right; font-weight: 400; }
.legend { display: flex; gap: 1.1rem; flex-wrap: wrap; list-style: none; margin: 0 0 .6rem; padding: 0; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .4rem; vertical-align: -.08em; }
.legend i.line { width: 1rem; height: 3px; border-radius: 2px; vertical-align: .18em; }
.legend .in   { background: var(--c-in); }
.legend .out  { background: var(--c-out); }
.legend .now  { background: var(--c-now); }
.legend .prev { background: var(--c-prev); }

.chart-wrap { overflow-x: auto; }
svg.chart-svg { display: block; width: 100%; height: auto; min-width: 30rem; font-family: inherit; overflow: visible; }
.chart-svg text { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-svg text.lab { fill: var(--text); font-weight: 600; font-size: 12px; }
.chart-svg text.now-lab { fill: var(--text); font-weight: 600; }
.chart-svg .grid { stroke: var(--border); stroke-width: 1; }
.chart-svg .base { stroke: var(--border-2); stroke-width: 1; }
.chart-svg .col { transition: filter .15s; }
.chart-svg .col.in   { fill: var(--c-in); }
.chart-svg .col.out  { fill: var(--c-out); }
.chart-svg .col.now  { fill: var(--c-now); }
.chart-svg .col.prev { fill: var(--c-prev); }
.chart-svg .dot.now  { fill: var(--c-now); }
.chart-svg .ring     { fill: var(--surface); }
.chart-svg .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .ln.now  { stroke: var(--c-now); }
.chart-svg .ln.prev { stroke: var(--c-prev); }
.chart-svg .hit { fill: transparent; }
.chart-svg .slot { outline: none; cursor: default; }
.chart-svg .slot:hover .hit, .chart-svg .slot:focus .hit { fill: color-mix(in srgb, var(--accent) 8%, transparent); }
.chart-svg .slot:hover .col, .chart-svg .slot:focus .col { filter: brightness(1.12); }
.chart-svg .xhair { stroke: var(--border-2); stroke-width: 1; opacity: 0; pointer-events: none; }
.chart-svg .xhair.on { opacity: 1; }
.chart-tip {
  position: fixed; z-index: 50; pointer-events: none; white-space: nowrap;
  background: var(--text); color: var(--bg); padding: .45rem .7rem; border-radius: 8px; font-size: .8rem; line-height: 1.45;
  box-shadow: var(--shadow-2);
}
.chart-tip div:first-child { font-weight: 600; opacity: .85; margin-bottom: .1rem; }

/* Horizontal bars and diverging bars: <progress> is the mark, its value the length. */
.hbars, .dbars {
  display: grid; grid-template-columns: minmax(5.5rem, 10rem) minmax(0, 1fr) auto; gap: .55rem .8rem; align-items: center;
  font-size: .9rem; margin: .35rem 0 .25rem;
}
.hbars .lbl, .dbars .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .val, .dbars .val { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; font-weight: 500; }
progress.hb, .dbars progress {
  -webkit-appearance: none; appearance: none; width: 100%; height: .8rem; border: 0; display: block;
  background: var(--surface-3); border-radius: 4px; overflow: hidden;
}
progress.hb::-webkit-progress-bar, .dbars progress::-webkit-progress-bar { background: var(--surface-3); }
progress.hb.out::-webkit-progress-value { background: var(--c-out); border-radius: 0 4px 4px 0; }
progress.hb.out::-moz-progress-bar      { background: var(--c-out); border-radius: 0 4px 4px 0; }
progress.hb.in::-webkit-progress-value  { background: var(--c-in);  border-radius: 0 4px 4px 0; }
progress.hb.in::-moz-progress-bar       { background: var(--c-in);  border-radius: 0 4px 4px 0; }
.dbars .track { display: flex; position: relative; min-width: 0; }
.dbars .track::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--border-2); border-radius: 1px; }
.dbars progress { width: 50%; border-radius: 0; }
.dbars progress.less { transform: scaleX(-1); border-radius: 0 4px 4px 0; }
.dbars progress.more { border-radius: 0 4px 4px 0; }
.dbars progress.less::-webkit-progress-value { background: var(--c-in); border-radius: 0 4px 4px 0; }
.dbars progress.less::-moz-progress-bar      { background: var(--c-in); border-radius: 0 4px 4px 0; }
.dbars progress.more::-webkit-progress-value { background: var(--c-out); border-radius: 0 4px 4px 0; }
.dbars progress.more::-moz-progress-bar      { background: var(--c-out); border-radius: 0 4px 4px 0; }
@media (max-width: 40rem) {
  .hbars, .dbars { grid-template-columns: minmax(4.5rem, 7rem) minmax(0, 1fr) auto; font-size: .85rem; }
}

/* ── motion ──────────────────────────────────────────────────────────────── */
/* public/js/motion.js marks targets .rise and adds .in as they enter the
   viewport. Only hidden when <html class="js"> says the script will run.
   (Not "reveal": the credential show/hide button already owns that class.) */
html.js .rise { opacity: 0; transform: translateY(14px); }
html.js .rise.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }
html.js .acard.rise.in { transition: opacity .6s var(--ease), transform .25s var(--ease); }
html.js .stats > .stat.rise.in:nth-child(2), html.js .acards > .acard.rise.in:nth-child(2), html.js .features > .feature.rise.in:nth-child(2) { transition-delay: .07s; }
html.js .stats > .stat.rise.in:nth-child(3), html.js .acards > .acard.rise.in:nth-child(3), html.js .features > .feature.rise.in:nth-child(3) { transition-delay: .14s; }
html.js .stats > .stat.rise.in:nth-child(4), html.js .acards > .acard.rise.in:nth-child(4), html.js .features > .feature.rise.in:nth-child(4) { transition-delay: .21s; }
html.js .acards > .acard.rise.in:nth-child(5), html.js .features > .feature.rise.in:nth-child(5) { transition-delay: .28s; }
html.js .acards > .acard.rise.in:nth-child(6), html.js .features > .feature.rise.in:nth-child(6) { transition-delay: .35s; }

@media print {
  html.js .rise { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html.js .rise { opacity: 1; transform: none; }
  .acard { transform: none !important; }
}

/* ── landing page ────────────────────────────────────────────────────────── */
/* Full-bleed sections, each with its own centred .lp-wrap. */
body.public main.page-landing { max-width: none !important; padding: 0 !important; overflow-x: clip; }
body.public main.page-landing footer { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1.5rem 2rem; }
.lp-wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.lp-section { padding: 5.5rem 0 3rem; }
.lp-kicker { color: var(--accent); margin: 0 0 .75rem; }
.lp-h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.015em; line-height: 1.15; margin: 0 0 1rem; max-width: 34rem; }
.lp-section > .lp-wrap > .lp-kicker, .lp-section > .lp-wrap > .lp-h2 { text-align: center; margin-left: auto; margin-right: auto; }

/* Hero: full height, copy left, a floating stage right. */
.lp-hero {
  position: relative; min-height: calc(100vh - 4rem); display: flex; align-items: center;
  /* clip, not hidden: hidden makes the hero a scroll container, and anything
     that scrolls a child into view then scrolls the hero's own contents. */
  overflow: clip;
  padding: 3rem 0 4rem; isolation: isolate;
}
.lp-hero::before, .lp-hero::after {
  content: ''; position: absolute; z-index: -1; border-radius: 50%; filter: blur(40px); pointer-events: none;
  animation: lp-drift 22s ease-in-out infinite alternate;
}
.lp-hero::before { width: 44rem; height: 44rem; right: -14rem; top: -18rem; background: radial-gradient(closest-side, rgba(226,196,140,.20), rgba(226,196,140,0)); }
.lp-hero::after  { width: 36rem; height: 36rem; left: -12rem; bottom: -20rem; background: radial-gradient(closest-side, rgba(109,182,255,.14), rgba(109,182,255,0)); animation-delay: -9s; animation-duration: 28s; }
@keyframes lp-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-6rem, 4rem) scale(1.12); } }
.lp-hero .lp-wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3rem; align-items: center; width: 100%; }
.lp-hero-copy .lp-eyebrow {
  display: inline-flex; align-items: center; gap: .45rem; background: var(--accent-2); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding: .32rem .9rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 600;
  animation: lp-rise .7s var(--ease) both;
}
.lp-title { font-size: clamp(2.6rem, 5.4vw, 4.6rem); line-height: 1.02; letter-spacing: -.025em; margin: 1.1rem 0 1.1rem; max-width: 13ch; }
.lp-title .w { display: inline-block; animation: lp-rise .8s var(--ease) both; }
.lp-title .w:nth-child(1) { animation-delay: .05s; }
.lp-title .w:nth-child(2) { animation-delay: .12s; }
.lp-title .w:nth-child(3) { animation-delay: .19s; }
.lp-title .w:nth-child(4) { animation-delay: .26s; }
.lp-title .w:nth-child(5) { animation-delay: .33s; }
.lp-title .w:nth-child(6) { animation-delay: .40s; color: var(--accent); }
.lp-hero-copy .lede { max-width: 30rem; animation: lp-rise .8s var(--ease) .45s both; }
.lp-hero-copy .actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.5rem 0 .75rem; max-width: none; animation: lp-rise .8s var(--ease) .55s both; }
.lp-fine { color: var(--faint); font-size: .85rem; margin: 0; animation: lp-rise .8s var(--ease) .65s both; }
@keyframes lp-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

.lp-stage { position: relative; height: 30rem; perspective: 1400px; animation: lp-rise 1s var(--ease) .3s both; }
.lp-worth {
  position: absolute; left: 4%; top: 4%; width: 64%; padding: 1.35rem 1.5rem 1.25rem; border-radius: 18px;
  background: var(--metal); color: #f4f3ef; border: 1px solid rgba(255,255,255,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 40px 80px -36px rgba(0,0,0,.9);
  animation: lp-float 7s ease-in-out infinite alternate;
}
.lp-worth .label { display: block; color: #e2c48c; font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }
.lp-worth .big { display: block; font-size: 2.1rem; font-weight: 600; letter-spacing: -.03em; margin: .35rem 0 .1rem; font-variant-numeric: tabular-nums; }
.lp-worth .meta { display: block; font-size: .8rem; color: rgba(255,255,255,.55); margin-bottom: .9rem; }
.lp-worth .flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.lp-worth .flow > div { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: .5rem .6rem; min-width: 0; }
.lp-worth .flow .label { display: flex; align-items: center; gap: .3rem; color: rgba(255,255,255,.6); font-size: .58rem; }
.lp-worth .flow .label .i { width: .75rem; height: .75rem; }
.lp-worth .flow .in .i { color: #7fe0b8; } .lp-worth .flow .out .i { color: #ffb0a4; } .lp-worth .flow .net .i { color: #e2c48c; }
.lp-worth .flow .v { display: block; font-weight: 600; font-size: .92rem; margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-stage .acard { position: absolute; width: 15.5rem; aspect-ratio: 1.586; cursor: default; }
.lp-stage .acard .bal { margin-top: .15rem; }
.lp-stage .acard.f1 { right: 0; top: 44%; animation: lp-float 6s ease-in-out infinite alternate; }
.lp-stage .acard.f2 { left: 0; bottom: 2%; animation: lp-float 8s ease-in-out infinite alternate-reverse; }
.lp-stage .acard.f3 { right: 10%; bottom: -4%; width: 12.5rem; animation: lp-float 9s ease-in-out infinite alternate; animation-delay: -3s; }
@keyframes lp-float { from { translate: 0 0; } to { translate: 0 -14px; } }
.lp-scroll {
  position: absolute; left: 50%; bottom: 1.25rem; transform: translateX(-50%); color: var(--faint); width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 1px solid var(--border-2); display: inline-flex; align-items: center; justify-content: center; animation: lp-bob 2.4s ease-in-out infinite;
}
.lp-scroll:hover { color: var(--text); text-decoration: none; }
@keyframes lp-bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

/* Ticker strip. */
.lp-marquee { overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .9rem 0; background: var(--surface); }
.lp-marquee .track { display: flex; gap: 3rem; width: max-content; animation: lp-marquee 40s linear infinite; }
.lp-marquee span { font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); white-space: nowrap; font-weight: 600; display: inline-flex; align-items: center; gap: 3rem; }
.lp-marquee span::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: .7; }
@keyframes lp-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Features. */
.lp-features { margin-top: 2rem; }
@media (min-width: 56rem) { .lp-features { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lp-features .feature { padding: 1.5rem 1.5rem 1.6rem; }
.lp-features .feature strong { font-size: 1.05rem; }

/* Story rows: copy beside a framed mock-up, alternating sides. */
.lp-story { padding-top: 2rem; }
.lp-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 3.5rem; align-items: center; padding: 3.5rem 0; }
.lp-row.flip .lp-copy { order: 2; }
.lp-row .lp-h2 { margin-top: .4rem; }
.lp-copy p { color: var(--muted); font-size: 1.02rem; }
.lp-more { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; margin-top: .5rem; }
.lp-more .i { transition: transform .2s var(--ease); }
.lp-more:hover .i { transform: translateX(3px); }
.lp-frame {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-2); overflow: hidden;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.lp-frame:hover { transform: translateY(-4px); }
.lp-frame .bar { display: flex; align-items: center; gap: .4rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.lp-frame .bar i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--border-2); }
.lp-frame .bar span { margin-left: .6rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.lp-frame.chart { padding-bottom: .75rem; }
.lp-frame.chart .chart-svg { min-width: 0; padding: 1rem 1rem 0; }
.lp-table { border: 0; box-shadow: none; margin: 0; background: transparent; border-radius: 0; }
.lp-table td { padding: .8rem 1rem; }
.lp-table tr:hover td { background: var(--surface-2); }
.lp-split { list-style: none; margin: 0; padding: .4rem 0; }
.lp-split li { display: flex; align-items: center; gap: .6rem; padding: .75rem 1.1rem; border-bottom: 1px solid var(--border); font-size: .95rem; }
.lp-split li:last-child { border-bottom: 0; }
.lp-split .who, .lp-split .whom { font-weight: 600; }
.lp-split .amt { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.lp-plan { margin: 0; padding: .8rem 1.1rem 1rem; color: var(--pos); font-size: .88rem; display: flex; align-items: center; gap: .45rem; border-top: 1px solid var(--border); }

/* Privacy band: black in both themes. */
.lp-band { background: #000; color: #f4f3ef; padding: 6rem 0; margin: 3rem 0 0; position: relative; overflow: hidden; }
.lp-band::before { content: ''; position: absolute; inset: -30% -10%; background: radial-gradient(closest-side at 70% 30%, rgba(226,196,140,.12), rgba(226,196,140,0) 70%); pointer-events: none; }
.lp-band .lp-wrap { position: relative; }
.lp-band .lp-kicker { color: #e2c48c; }
.lp-quote { font-family: var(--serif); font-weight: 500; font-size: clamp(1.7rem, 3.4vw, 2.8rem); line-height: 1.15; letter-spacing: -.015em; max-width: 40rem; margin: 0 0 3rem; }
.lp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2.5rem 2rem; }
.lp-cols .av { margin-bottom: 1rem; }
.lp-cols strong { display: block; font-size: 1.02rem; margin-bottom: .35rem; }
.lp-cols p { margin: 0; color: rgba(255,255,255,.62); font-size: .93rem; }
.lp-cols p strong { display: inline; font-size: inherit; color: #f4f3ef; }
.lp-cols a { color: #e2c48c; }

/* Closing call. */
.lp-cta { text-align: center; padding: 4rem 0 5rem; }
.lp-cta .lp-h2 { margin: 0 auto .5rem; font-size: clamp(2rem, 4vw, 3rem); }
.lp-cta .lede { margin: 0 auto; }
.lp-cta .actions { display: flex; gap: .75rem; justify-content: center; margin: 1.75rem auto 0; max-width: none; }

/* Directional reveals for the story rows. */
html.js [data-reveal="left"].rise  { transform: translateX(-28px); }
html.js [data-reveal="right"].rise { transform: translateX(28px); }
html.js [data-reveal].rise.in { transform: none; }
html.js .lp-cols > [data-reveal].rise.in:nth-child(2) { transition-delay: .1s; }
html.js .lp-cols > [data-reveal].rise.in:nth-child(3) { transition-delay: .2s; }

@media (max-width: 56rem) {
  /* Block flow, not flex centring: a wrapper taller than the box would otherwise overflow upward. */
  .lp-hero { min-height: 0; padding: 2.5rem 0 3rem; display: block; }
  .lp-hero .lp-wrap { grid-template-columns: 1fr; gap: 2rem; }
  .lp-title { max-width: none; }
  .lp-stage { height: 22rem; max-width: 30rem; }
  .lp-worth { width: 78%; left: 0; top: 0; }
  .lp-stage .acard { width: 10.5rem; }
  .lp-stage .acard.f1 { top: auto; bottom: 0; right: 0; }
  .lp-stage .acard.f2 { left: 0; bottom: 0; }
  .lp-stage .acard.f3 { display: none; }
  .lp-worth .flow { grid-template-columns: 1fr; gap: .3rem; }
  .lp-worth .flow > div { display: flex; align-items: center; justify-content: space-between; padding: .4rem .6rem; }
  .lp-worth .flow .v { margin-top: 0; }
  .lp-scroll { display: none; }
  /* minmax(0, 1fr), not 1fr: a no-wrap mock table must not widen the column. */
  .lp-row, .lp-row.flip { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding: 2.5rem 0; }
  .lp-visual, .lp-frame { min-width: 0; }
  .lp-frame .lp-table { display: table; white-space: nowrap; width: 100%; }
  .lp-frame .lp-table td:nth-child(2) { white-space: normal; }
  .lp-row.flip .lp-copy { order: 0; }
  .lp-section { padding: 3.5rem 0 2rem; }
  .lp-band { padding: 4rem 0; }
  nav.top { padding: .85rem 1rem; }
  body.scrolled nav.top { padding: .6rem 1rem; }
}
@media (max-width: 40rem) {
  /* The public bar keeps brand, one pill and the switch; the hero carries sign-in. */
  nav.top { gap: .6rem; }
  nav.top a:not(.brand):not(.button) { display: none; }
  nav.top a.button.small { padding: .35rem .7rem; font-size: .8rem; }
  .lp-title { font-size: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .lp-marquee .track { animation: none; }
}
