/* ==========================================================================
   Khata — "Midnight Banking" design system (see DESIGN.md)
   Dark-first. Separation comes from surface steps, not borders:
     page #040D3F → surface #141C4E → card #1D2552 → hover #243066
   Mint = money in, coral = money out (applied to amount text + icon tint).
   Gradients only on primary entities (account cards, the brand stamp).
   ========================================================================== */

/* Self-hosted fonts (SIL Open Font License, see /static/fonts/OFL-*.txt): no third-party requests. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-latin-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/jetbrains-mono-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Mukta's Devanagari files hold only the glyphs of the brand mark (ख, खाता): about 3 KB each instead
   of 100 KB. Other Devanagari falls back per character to the system font. Re-subset if .deva is used
   for more text (pyftsubset --text=…). */
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/mukta-devanagari-600.woff2") format("woff2"); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/mukta-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/mukta-devanagari-700.woff2") format("woff2"); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF; }
/* Nepali in running text (Khatu answers in Nepali, people talk to him in it): the full Devanagari
   set, so it matches Inter instead of whatever the system has. Only fetched when a page has some. */
@font-face { font-family: "Mukta Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/mukta-text-devanagari-400.woff2") format("woff2"); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: "Mukta Text"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/mukta-text-devanagari-600.woff2") format("woff2"); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF; }
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/mukta-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: dark;

  /* surfaces */
  --page: #040d3f;
  --surface: #141c4e;
  --card: #1d2552;
  --card-hover: #243066;
  --sunken: #0b1338;

  /* text */
  --text: #ffffff;
  /* DESIGN.md's #B9BBC7 / #6A7178 tinted toward the navy: flat grey on blue reads as washed out */
  --text-2: #b7bfe0;
  /* raised from DESIGN.md's #6A7178 (2.95:1 on cards) to pass WCAG AA on every surface */
  --text-3: #9aa3c9;
  --text-disabled: #6a7178;
  --neutral-4: #dee2e6;
  --neutral-6: #adb5bd;

  /* status / signed amounts */
  --pos: #7fe089;
  --neg: #f97d7d;
  --info: #0d8091;
  --info-2: #1ab8c7;
  --warn: #f2c94c;
  --android: #3ddc84;

  /* gradients */
  /* every stop keeps white text at WCAG AA (4.5:1), also under the card highlight circle */
  --grad-turquoise: linear-gradient(135deg, #0b6b78 0%, #0c7489 100%);
  --grad-pink: linear-gradient(135deg, #a3336f 0%, #b73e7a 100%);
  --grad-purple: linear-gradient(135deg, #5a2d8a 0%, #7d44b0 100%);
  --grad-yellow: linear-gradient(135deg, #d4a017 0%, #f2c94c 100%);
  --grad-pink-soft: linear-gradient(135deg, #e64980 0%, #ff6b9d 100%);
  --grad-cyan-soft: linear-gradient(135deg, #1d4f9a 0%, #2f69c4 100%);

  /* radius / elevation */
  --r-xs: 6px;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-full: 9999px;
  --shadow-tile: 0 2px 4px 0 rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 60px 0 rgb(0 4 26 / 0.6);
  --shadow-modal: 0 8px 32px 0 rgb(0 0 0 / 0.3);

  --font: "Inter", "Mukta Text", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --deva: "Mukta", "Kohinoor Devanagari", "Noto Sans Devanagari", sans-serif;

  /* aliases still referenced by templates / inline styles */
  --paper: var(--page);
  --ink: var(--text);
  --ink-2: var(--text-2);
  --muted: var(--text-2);
  --faint: var(--text-3);
  --surface-2: var(--card);
  --line: rgb(255 255 255 / 0.06);
  --line-strong: rgb(255 255 255 / 0.12);
  --in: var(--pos);
  --out: var(--neg);
  --ok: var(--pos);
  --ok-soft: rgb(127 224 137 / 0.15);
  --danger: var(--neg);
  --danger-soft: rgb(249 125 125 / 0.15);
  --marigold: var(--warn);
  --marigold-soft: rgb(242 201 76 / 0.15);
  --radius: var(--r-lg);
  --shadow: var(--shadow-tile);

  /* theme-dependent details */
  --scheme: dark;
  --grid: rgb(255 255 255 / 0.07);
  --hover-tint: rgb(255 255 255 / 0.05);
  --warn-bg: var(--warn);
  --on-warn: #2b2003;
  --on-neg: #2b0606;
  /* strength of a status tint behind text (badges, tags): lighter in the light theme so the
     darker signal colours keep AA on their own tint */
  --tint: 15%;
  --input-bg: var(--card);
  /* field edges at 3:1 on every surface (WCAG 1.4.11) */
  --input-ring: #737ba3;
  --btn-line: #646da3;  /* was var(--card): invisible on cards, so buttons read as text */
  /* behind the iPhone status bar, which an installed app draws in white (black-translucent) */
  --statusbar: var(--surface);
  --appbar-h: 88px;
}

/* Light theme (roadmap 4.7): same layout, light surfaces, darker ink and signal colours so
   every text token keeps WCAG AA contrast (checked in tests/services/test_design_tokens.py).
   Applied when the device prefers light (unless "Dark" is chosen) or when "Light" is chosen. */
:root[data-theme="light"] {
  color-scheme: light;
  --scheme: light;
  --page: #eef1f7;
  --surface: #ffffff;
  --card: #f2f4f9;
  --card-hover: #e6eaf3;
  --sunken: #e9ecf4;
  --text: #0b1236;
  --text-2: #464c6a;
  --text-3: #575e7a;
  --text-disabled: #9aa0b4;
  --neutral-4: #33394f;
  --neutral-6: #5b6276;
  --pos: #19733a;
  --neg: #b8312e;
  --info: #0a6a77;
  --info-2: #086f7b;
  --warn: #855a00;
  --android: #12823f;
  --line: rgb(11 18 54 / 0.08);
  --line-strong: rgb(11 18 54 / 0.14);
  --shadow-tile: 0 1px 2px 0 rgb(11 18 54 / 0.08), 0 0 0 1px rgb(11 18 54 / 0.04);
  --shadow-glow: 0 12px 40px 0 rgb(11 18 54 / 0.14);
  --shadow-modal: 0 8px 32px 0 rgb(11 18 54 / 0.18);
  --ok-soft: rgb(25 115 58 / 0.12);
  --danger-soft: rgb(184 49 46 / 0.10);
  --marigold-soft: rgb(133 90 0 / 0.12);
  --grid: rgb(11 18 54 / 0.08);
  --hover-tint: rgb(11 18 54 / 0.04);
  --warn-bg: #f2c94c;
  --on-warn: #2b2003;
  --on-neg: #ffffff;
  --tint: 8%;
  --input-bg: #ffffff;
  --input-ring: #808496;
  --btn-line: #a9adbd;
  --statusbar: #040d3f;  /* white clock on a white header would vanish */
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --scheme: light;
    --page: #eef1f7;
    --surface: #ffffff;
    --card: #f2f4f9;
    --card-hover: #e6eaf3;
    --sunken: #e9ecf4;
    --text: #0b1236;
    --text-2: #464c6a;
    --text-3: #575e7a;
    --text-disabled: #9aa0b4;
    --neutral-4: #33394f;
    --neutral-6: #5b6276;
    --pos: #19733a;
    --neg: #b8312e;
    --info: #0a6a77;
    --info-2: #086f7b;
    --warn: #855a00;
    --android: #12823f;
    --line: rgb(11 18 54 / 0.08);
    --line-strong: rgb(11 18 54 / 0.14);
    --shadow-tile: 0 1px 2px 0 rgb(11 18 54 / 0.08), 0 0 0 1px rgb(11 18 54 / 0.04);
    --shadow-glow: 0 12px 40px 0 rgb(11 18 54 / 0.14);
    --shadow-modal: 0 8px 32px 0 rgb(11 18 54 / 0.18);
    --ok-soft: rgb(25 115 58 / 0.12);
    --danger-soft: rgb(184 49 46 / 0.10);
    --marigold-soft: rgb(133 90 0 / 0.12);
    --grid: rgb(11 18 54 / 0.08);
    --hover-tint: rgb(11 18 54 / 0.04);
    --warn-bg: #f2c94c;
    --on-warn: #2b2003;
    --on-neg: #ffffff;
    --tint: 8%;
    --input-bg: #ffffff;
    --input-ring: #808496;
    --btn-line: #a9adbd;
    --statusbar: #040d3f;
  }
}


/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--text-3); text-underline-offset: 3px; }
/* links inside running text must look like links: colour alone isn't enough (WCAG 1.4.1),
   so plain ones are underlined too. a.text-link does the same for a standalone text link. */
p a, li a, .hint a, .lede a, dd a, a.text-link { color: var(--info-2); }
:where(p, li, .hint, .lede, dd, .empty-inline, .callout) a:not([class]), a.text-link {
  color: var(--info-2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--info-2) 55%, transparent);
}
p a:hover, li a:hover, .hint a:hover, .lede a:hover, dd a:hover, a.text-link:hover { text-decoration-color: var(--info-2); }
h1, h2, h3 { margin: 0; color: var(--text); letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 700; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 600; line-height: 1.3; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
strong, b { font-weight: 600; color: var(--text); }
:focus-visible { outline: 2px solid var(--info-2); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: color-mix(in srgb, var(--info-2) 35%, transparent); }

.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.deva { font-family: var(--deva); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: 12px; font-weight: 500; color: var(--text-2); }
.lede { color: var(--text-2); margin-top: 6px; max-width: 64ch; font-size: 14px; font-weight: 400; }
.hint { font-size: 12px; color: var(--text-2); font-weight: 400; }
.section-sub { color: var(--text-2); font-size: 13px; margin-top: 4px; max-width: 60ch; font-weight: 400; }

.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ brand */

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
/* Khatu, as a logo (favicon.svg). */
.stamp { display: block; flex: none; width: 34px; height: 34px; }
.brand-word { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; color: var(--text); }
.brand-deva { font-family: var(--deva); color: var(--text-3); font-size: 14px; font-weight: 600; }

/* ------------------------------------------------------------------ app shell: header bar */

.appbar { position: sticky; top: 0; z-index: 40; background: var(--surface); box-shadow: 0 1px 0 rgb(0 0 0 / 0.25); }
/* The installed iPhone app draws the page under the status bar (viewport-fit=cover +
   black-translucent): pad the bar down past the clock and the Dynamic Island, and in from
   the sides in landscape. Outside an installed app the insets are 0. */
.appbar { padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
/* A strip behind the status bar, so the white clock and battery stay readable on every page
   and content scrolls under it instead of under the clock. */
body::before { content: ""; position: fixed; inset: 0 0 auto 0; z-index: 100; height: env(safe-area-inset-top); background: var(--statusbar); pointer-events: none; }
.appbar-inner { max-width: 1240px; margin: 0 auto; height: var(--appbar-h); padding: 0 24px; display: flex; align-items: center; gap: 24px; }
.appnav { display: flex; align-items: center; gap: 24px; margin: 0 auto; }
.appnav a { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 2px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.appnav a:hover { color: var(--text); text-decoration: none; }
.appnav a[aria-current="page"], .appnav a.is-pending { color: var(--text); }
.appnav a[aria-current="page"]::after, .appnav a.is-pending::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; background: var(--marigold); }
.appnav:has(.is-pending) a[aria-current="page"]:not(.is-pending) { color: var(--text-2); }
.appnav:has(.is-pending) a[aria-current="page"]:not(.is-pending)::after { content: none; }
.appnav .count, .tabbar .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full); background: var(--neg); color: var(--on-neg); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.appbar-right { display: flex; align-items: center; gap: 12px; }
/* Eight sections: tighten the bar before it switches to the phone tab bar at 960px. */
@media (max-width: 1240px) {
  .appbar-inner { gap: 16px; }
  .appnav { gap: 16px; }
  .usermenu .greet { display: none; }
}
@media (max-width: 1080px) {
  .appnav { gap: 12px; }
  .appnav a { font-size: 13px; }
}
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-full); color: var(--text-2); }
.icon-btn:hover, .icon-btn[aria-current="page"] { background: var(--card); color: var(--text); text-decoration: none; }

.usermenu { position: relative; }
/* A button, not a label: a quiet pill with the avatar flush at one end and a caret at the other,
   44px tall. Phones hide the greeting, so the avatar and caret carry it alone. */
.usermenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 3px 10px 3px 3px; border: 1px solid var(--line-strong); border-radius: var(--r-full); background: var(--card); transition: background 0.15s ease, border-color 0.15s ease; }
.usermenu summary:hover { background: var(--card-hover); }
.usermenu[open] summary { border-color: var(--text-3); }
.usermenu-caret { flex: none; color: var(--text-2); transition: transform 0.18s ease-out; }
.usermenu[open] .usermenu-caret { transform: rotate(180deg); }
.usermenu summary:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--info-2); }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .greet { margin: 0 6px 0 12px; text-align: right; line-height: 1.25; }
.usermenu .greet span { display: block; font-size: 12px; color: var(--text-2); font-weight: 400; }
.usermenu .greet strong { font-size: 14px; }
.usermenu-panel {
  position: absolute; right: 0; top: calc(100% + 12px); width: 250px; padding: 8px;
  border-radius: var(--r); background: var(--card); box-shadow: var(--shadow-modal); display: grid; gap: 2px;
}
.usermenu-panel a, .usermenu-panel button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.usermenu-panel a:hover, .usermenu-panel button:hover { background: var(--card-hover); text-decoration: none; }
.usermenu-panel a[aria-current="page"] { background: var(--card-hover); }
.usermenu-panel .menu-sep { height: 1px; margin: 4px 8px; background: var(--line-strong); }
.usermenu-panel form button { color: var(--neg); }
.usermenu-panel .who-line { padding: 8px 12px 10px; margin-bottom: 4px; box-shadow: 0 1px 0 var(--line-strong); }
.usermenu-panel .who-line span { display: block; color: var(--text-2); font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.usermenu-panel form { margin: 0; }
/* Gold like the ख stamp, so it reads as a circle on the navy bar instead of a floating letter. */
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--grad-yellow); color: #2a1f00; font-weight: 700; font-size: 15px; line-height: 1; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.28); }

.main { padding: 24px 24px 64px; }
.page { max-width: 1192px; margin: 0 auto; display: grid; gap: 24px; }
.page > *, .grid > *, .stack > * { min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin-top: 4px; }
/* Let long names and form fields shrink inside their row instead of widening the page. */
.page-head > *, .hello > *, .row > *, .spread > *, .card-head > * { min-width: 0; max-width: 100%; }
.page-head h1, .hello h1 { overflow-wrap: anywhere; }

.tabbar { display: none; }
.usermenu-panel .show-sm { display: none; }
@media (max-width: 960px) {
  .appnav, .appbar-right .icon-btn, .usermenu .greet, .appbar-right .hide-sm { display: none; }
  .usermenu-panel a.show-sm { display: flex; }
  .usermenu-panel .menu-sep.show-sm { display: block; }
  :root { --appbar-h: 64px; }
  .appbar-inner { padding: 0 16px; justify-content: space-between; }
  .appbar-right { margin-left: auto; }
  .main { padding: 16px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; inset: auto 0 0 0; z-index: 30;
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    background: var(--surface); box-shadow: 0 -1px 0 rgb(0 0 0 / 0.3);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: var(--r); font-size: 11px; color: var(--text-2); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a { position: relative; }
  .tabbar .count { position: absolute; top: 0; left: calc(50% + 6px); }
  .count[hidden] { display: none; }
  .tabbar a[aria-current="page"], .tabbar a.is-pending { color: var(--text); }
  .tabbar a[aria-current="page"]:not(.tab-add)::before, .tabbar a.is-pending:not(.tab-add)::before { content: ""; position: absolute; top: -6px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--marigold); }
  .tabbar a[aria-current="page"]:not(.tab-add) .ico, .tabbar a.is-pending:not(.tab-add) .ico { color: var(--marigold); }
  .tabbar:has(.is-pending) a[aria-current="page"]:not(.is-pending) { color: var(--text-2); }
  .tabbar:has(.is-pending) a[aria-current="page"]:not(.is-pending)::before { content: none; }
  .tabbar:has(.is-pending) a[aria-current="page"]:not(.is-pending) .ico { color: inherit; }
  .tabbar .tab-add.is-pending .ico { opacity: 0.7; }
  .tabbar .tab-add .ico { width: 44px; height: 32px; padding: 6px 12px; border-radius: var(--r-full); background: var(--text); color: var(--page); }
}

/* ------------------------------------------------------------------ page loader */

/* An installed app has no address bar and no spinner, so a tap gave no sign of life.
   html.is-navigating (app.js) shows a bar along the header's bottom edge at once and, when
   the next page takes a moment, a pill naming what is loading. The next page replaces this
   one; Back, a download or a 15 s timeout clears it. */
.navload { --navload-top: env(safe-area-inset-top); position: fixed; inset: 0 0 auto 0; z-index: 95; pointer-events: none; }
body:has(> .appbar) .navload { --navload-top: calc(env(safe-area-inset-top) + var(--appbar-h)); }
.navload-bar {
  position: absolute; left: 0; right: 0; top: calc(var(--navload-top) - 1px); height: 3px; overflow: hidden;
  border-radius: 0 3px 3px 0; background: var(--marigold);
  transform-origin: 0 50%; transform: scaleX(0); opacity: 0; transition: opacity 0.2s ease;
}
/* A light sweep along the bar: progress you can see even while the bar creeps. */
.navload-bar::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 35%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.6), transparent);
  transform: translateX(-100%);
}
html.is-navigating .navload-bar { opacity: 1; animation: navload-creep 14s cubic-bezier(0.08, 0.7, 0.2, 1) forwards; }
html.is-navigating .navload-bar::after { animation: navload-sweep 1.2s ease-in-out infinite; }
@keyframes navload-creep { 0% { transform: scaleX(0); } 5% { transform: scaleX(0.28); } 25% { transform: scaleX(0.62); } 100% { transform: scaleX(0.94); } }
@keyframes navload-sweep { to { transform: translateX(400%); } }

/* The page that's leaving dims, and Khatu's card names the one on its way (html.is-navigating-slow,
   added by app.js 220 ms in, so fast pages never show it). Same on every page and both themes. */
.navload-card {
  position: fixed; left: 50%; top: 50%;
  display: grid; justify-items: center; gap: 8px; min-width: 168px; max-width: calc(100vw - 48px);
  padding: 18px 24px 16px; border-radius: var(--r-lg);
  background: var(--surface); color: var(--text-2);
  box-shadow: var(--shadow-modal), 0 0 0 1px var(--line-strong);
  font-size: 13.5px; font-weight: 500; line-height: 1.3; text-align: center;
  opacity: 0; visibility: hidden; transform: translate(-50%, -46%) scale(0.96);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}
.navload-card .khatu { width: 60px; }
html.is-navigating-slow .navload-card {
  opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1);
  transition: opacity 0.22s ease, transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s;
}
html.is-navigating-slow .main { opacity: 0.4; transition: opacity 0.22s ease; }
.navload-text { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navload-text::after { content: "\2026"; }
.navload-text strong { color: var(--text); font-weight: 600; }
/* Reduced motion stops every animation (below): hold the bar part-way instead of at zero. */
@media (prefers-reduced-motion: reduce) { html.is-navigating .navload-bar { transform: scaleX(0.6); } }

/* The installed app's launch screen (pages/launch.html), shown by sw.js while the dashboard loads. */
.launch {
  min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 16px;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
}
.launch .khatu { width: 112px; }
.launch-line { margin: 0; color: var(--text-2); font-size: 14px; font-weight: 500; }
.launch-bar { position: relative; width: 132px; height: 3px; overflow: hidden; border-radius: 3px; background: color-mix(in srgb, var(--marigold) 22%, transparent); }
.launch-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 40%; border-radius: inherit; background: var(--marigold); animation: launch-sweep 1.1s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
@keyframes launch-sweep { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .launch-bar::after { width: 60%; } }

/* ------------------------------------------------------------------ surfaces */

.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-tile); }
.card-pad { padding: 20px; }
/* wrap: on a phone the legend or note drops under the title instead of squeezing it
   ("Money in / and out", "By / category") */
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 20px 20px 0; }
.card-head + .card-body { padding-top: 16px; }
.card-head > a { font-size: 13px; color: var(--text-2); }
/* small text links get a 24px+ tap area without moving (WCAG 2.5.8) */
.card-head a:not(.btn) { padding: 6px 4px; margin: -6px -4px; }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px 18px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.card-foot-start { justify-content: flex-start; gap: 8px; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: 1.35fr 1fr; }
.grid-2-even { grid-template-columns: 1fr 1fr; }
@media (max-width: 980px) { .grid-2, .grid-2-even { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ controls */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 10px 20px; border-radius: var(--r-full);
  border: 1px solid var(--btn-line); background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, transform 0.08s ease;
}
.btn:hover { background: var(--card-hover); color: var(--text); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--info-2); outline-offset: 2px; }
.btn:active { transform: translateY(1px); }
.btn-ink { background: var(--text); border-color: var(--text); color: var(--page); }
.btn-ink:hover { background: var(--neutral-4); border-color: var(--neutral-4); color: var(--page); }
/* Khata marigold: the same yellow and dark ink in both themes (10:1) */
.btn-gold { background: var(--warn-bg); border-color: var(--warn-bg); color: var(--on-warn); }
.btn-gold:hover { background: #e2b93c; border-color: #e2b93c; color: var(--on-warn); }
.btn-ghost { background: transparent; }  /* quieter, but still outlined: always reads as a button */
/* Removes, deletes, switches off or signs out: red, so it never looks like a normal action. */
.btn-danger { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 60%, transparent); background: var(--danger-soft); }
.btn-danger:hover { background: color-mix(in srgb, var(--neg) 24%, transparent); color: var(--neg); border-color: var(--neg); }
.btn:disabled { cursor: not-allowed; opacity: 0.55; }
.btn.is-loading { opacity: 1; cursor: progress; }
.btn.is-loading .ico { display: none; }
.btn.is-loading::before {
  content: ""; width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
/* Links are locked while a form is in flight, but not dimmed: a page of faded buttons reads
   as broken. The clicked submit button's spinner shows the progress. */
body.is-submitting a.btn { pointer-events: none; }
body.is-submitting { cursor: progress; }
.btn-sm { min-height: 32px; padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; min-height: 36px; padding: 0; }

.field { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 6px; align-content: start; }
.field label, .label { font-size: 12px; font-weight: 500; color: var(--text-2); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"],
select, textarea {
  width: 100%; min-width: 0; max-width: 100%; min-height: 44px; padding: 10px 14px; border: 0; border-radius: var(--r);
  background: var(--input-bg); box-shadow: inset 0 0 0 1px var(--input-ring); color: var(--text); font: inherit; font-size: 14px; font-weight: 500;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, select:hover, textarea:hover { background: var(--card-hover); }
input:focus, select:focus, textarea:focus { outline: none; background: var(--card-hover); box-shadow: inset 0 0 0 2px var(--info-2); }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
textarea.sms { font-family: var(--mono); font-size: 13px; font-weight: 400; }
select {
  appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
select option, select optgroup { background: var(--card); color: var(--text); }
input[type="datetime-local"], input[type="date"], input[type="time"] { font-family: var(--mono); font-size: 13px; color-scheme: var(--scheme); }
input[type="color"] { width: 44px; height: 44px; padding: 4px; border: 0; border-radius: var(--r); background: var(--card); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 400; color: var(--text-2); }
.check input { width: 18px; height: 18px; flex: none; margin-top: 2px; accent-color: var(--info-2); }
.check > span { min-width: 0; overflow-wrap: anywhere; }
/* Settings → This device → notifications: the copy beside its buttons; buttons drop below on a phone. */
.push-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.push-copy { display: grid; gap: 2px; flex: 1 1 240px; font-size: 14px; }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--card); cursor: pointer; transition: background 0.15s ease, box-shadow 0.15s ease; }
.choice:hover { background: var(--card-hover); }
.choice input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--info-2); }
.choice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--info-2); }
.choice:has(input:focus-visible) { outline: 2px solid var(--info-2); outline-offset: 2px; }
.choice-body { display: grid; min-width: 0; gap: 4px; overflow-wrap: anywhere; }
.choice-body .mono { color: var(--text-2); }

/* Month switcher: one quiet bar, arrows as round buttons, the month centred with its BS days
   under it. Phones: full width, so it lines up with the cards below. */
.month-switch { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.month-nav {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px;
  min-width: 264px; padding: 4px; border-radius: var(--r-full);
  background: var(--surface); box-shadow: var(--shadow-tile);
}
.month-step { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--card); color: var(--text); transition: background 0.15s ease, transform 0.1s ease; }
a.month-step:hover { background: var(--card-hover); text-decoration: none; }
a.month-step:active { transform: scale(0.92); }
.month-step.is-disabled { background: transparent; color: var(--text-3); opacity: 0.45; }
.month-label { display: grid; justify-items: center; gap: 1px; min-width: 0; padding: 2px 6px; text-align: center; line-height: 1.2; }
.month-label strong { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); white-space: nowrap; }
.month-label small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.month-now { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--btn-line); border-radius: var(--r-full); font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.month-now:hover { background: var(--card-hover); text-decoration: none; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-full); background: var(--surface); justify-self: start; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--r-full); font-weight: 600; font-size: 13px; color: var(--text-2); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a[aria-current="page"] { background: var(--text); color: var(--page); }
.tab-short { display: none; }
@media (max-width: 560px) { .tab-long { display: none; } .tab-short { display: inline; } .tabs a { white-space: nowrap; } }
/* Phones: the tabs share the row equally instead of running off its edge (3 tabs needed 367px). */
@media (max-width: 420px) {
  .tabs { display: flex; justify-self: stretch; }
  .tabs a { flex: 1 1 0; min-width: 0; justify-content: center; gap: 6px; padding: 8px 10px; }
}
@media (max-width: 374px) { .tabs .ico { display: none; } }

/* ------------------------------------------------------------------ badges / chips / notices */

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: var(--r-xs); font-size: 11px; font-weight: 600; line-height: 1.2; white-space: nowrap; background: color-mix(in srgb, var(--neutral-6) 16%, transparent); color: var(--neutral-4); }
.badge-ok { background: color-mix(in srgb, var(--pos) var(--tint), transparent); color: var(--pos); }
.badge-danger { background: color-mix(in srgb, var(--neg) var(--tint), transparent); color: var(--neg); }
.badge-gold { background: color-mix(in srgb, var(--warn) var(--tint), transparent); color: var(--warn); }
.badge-info { background: color-mix(in srgb, var(--info-2) var(--tint), transparent); color: var(--info-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c, var(--text-3)); }
.k-in { --c: var(--pos); }
.k-out { --c: var(--neg); }
.k-move { --c: var(--neutral-6); }
.k-transfer { --c: var(--neutral-6); }
.k-unclassified { --c: var(--text-3); }

.empty { padding: 36px 20px; text-align: center; color: var(--text-2); display: grid; gap: 10px; justify-items: center; }
.empty strong { font-size: 15px; }
.empty-inline { display: flex; align-items: center; gap: 8px; padding: 0 20px 20px; color: var(--text-2); font-size: 13px; }
.empty-inline .ico { color: var(--pos); }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--card); font-size: 13px; color: var(--text-2); }
.callout .ico { color: var(--info-2); margin-top: 1px; flex: none; }
.callout-gold { background: color-mix(in srgb, var(--warn) 10%, transparent); color: var(--text); }
.callout-title { color: var(--text); font-weight: 600; }
.callout-gold .ico { color: var(--warn); }
.form-error { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: 13px; background: var(--danger-soft); color: var(--text); }
.form-error .ico { color: var(--neg); flex: none; margin-top: 1px; }

.demo-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px 10px 16px; border-radius: var(--r); background: var(--card); font-size: 13px; color: var(--text-2); }
.demo-banner > .ico { color: var(--warn); flex: none; }
.demo-banner-text { flex: 1 1 260px; }

/* ------------------------------------------------------------------ toasts */

.toasts { position: fixed; z-index: 60; top: calc(104px + env(safe-area-inset-top)); right: 24px; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  --accent: var(--info-2);
  position: relative; overflow: hidden; pointer-events: auto;
  display: grid; grid-template-columns: 32px minmax(0, 1fr) 28px; gap: 12px; align-items: start;
  padding: 14px 10px 16px 14px; border-radius: var(--r);
  background: var(--card); color: var(--text); box-shadow: var(--shadow-modal);
  font-size: 13.5px; line-height: 1.45;
  animation: toast-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
/* The accent colours the icon, the timer bar, a hairline and a light tint, so the kind
   reads at a glance: green saved, blue for your information, amber warning, red removed or
   failed. */
.toast { background: color-mix(in srgb, var(--accent) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.toast-ok { --accent: var(--pos); }
.toast-info { --accent: var(--info-2); }
.toast-warn { --accent: var(--warn); --toast-time: 8s; }
.toast-error { --accent: var(--neg); --toast-time: 9s; }  /* errors stay longer */
.toast-removed { --accent: var(--neg); }
.toast-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.toast-text { padding-top: 6px; overflow-wrap: anywhere; }
.toast-close { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer; }
.toast-close:hover { background: var(--card-hover); color: var(--text); }
.toast-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); opacity: 0.7; transform-origin: left; animation: toast-timer var(--toast-time, 5s) linear forwards; }
.toast:hover .toast-timer, .toast:focus-within .toast-timer { animation-play-state: paused; }
.toast.is-leaving { animation: toast-out 0.28s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px) scale(0.98); } }
@keyframes toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 960px) {
  .toasts { top: calc(76px + env(safe-area-inset-top)); left: 50%; right: auto; transform: translateX(-50%); }
  @keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
  @keyframes toast-out { to { opacity: 0; transform: translateY(-12px); } }
}

/* ------------------------------------------------------------------ overview: balance, account cards, KPI tiles */

.hello { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hello p { color: var(--text-2); margin-top: 4px; font-weight: 400; }
/* "Last bank text 2m ago · Nabil Bank": the ledger fills itself, so say when it last did */
.hello .hello-pulse { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.hello-pulse .ico { color: var(--marigold); }

.balance { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.balance-total { display: grid; align-content: space-between; gap: 18px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-tile); }
.balance-total .figure { font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.balance-total .figure .cur { font-size: 14px; font-weight: 600; color: var(--text-2); margin-right: 6px; }
.balance-total .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.balance-total .net { font-size: 13px; color: var(--text-2); font-weight: 400; }
.balance-total .net strong { color: var(--pos); }
.balance-total .net strong.neg { color: var(--neg); }
.balance-total .delta { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-top: 2px; }
/* "NPR 3,800 cash not itemized yet": withdrawn cash nobody has itemized */
.cash-line { display: grid; gap: 10px; margin: 0; padding: 12px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line-strong); }
.cash-text { display: flex; gap: 8px; align-items: baseline; margin: 0; font-size: 13px; color: var(--text-2); font-weight: 400; }
.cash-text strong { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cash-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--marigold); transform: translateY(-1px); }
.cash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px 20px; margin: 0; }
.summary dt { font-size: 12px; color: var(--text-2); font-weight: 500; }
.summary dd { margin: 2px 0 0; display: grid; gap: 2px; }
.summary .num { font-family: var(--font); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary .delta { margin: 0; font-size: 12px; font-weight: 500; }
/* Right of the month's total: the account cards (kept card-shaped, not stretched), and under
   them a strip with income, transfers and cash, so both columns end at the same height. */
.balance-side { display: grid; gap: 16px; min-width: 0; align-content: start; }
.balance-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px 24px; align-items: center; padding: 16px 20px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-tile); }
.accounts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 340px); gap: 16px; overflow-x: auto; padding: 8px; margin: -8px; scrollbar-width: none; }
.accounts::-webkit-scrollbar { display: none; }
/* The row scrolls, so it clips anything drawn outside it: a 40px glow became a hard grey band in the
   light theme. Cards in the row get a shadow small enough to fit its 8px padding. */
.accounts .acct { box-shadow: 0 2px 6px 0 rgb(0 4 26 / 0.18); }
.acct {
  position: relative; overflow: hidden; display: grid; align-content: space-between; gap: 28px;
  min-height: 180px; padding: 20px; border-radius: var(--r-lg); color: #fff;
  background: var(--grad-turquoise); box-shadow: var(--shadow-glow);
}
.acct:hover { text-decoration: none; }
.acct::after { content: ""; position: absolute; right: -50px; top: -70px; width: 190px; height: 190px; border-radius: 50%; background: rgb(255 255 255 / 0.08); }
.acct-pink { background: var(--grad-pink); }
.acct-purple { background: var(--grad-purple); }
.acct-top, .acct-bottom { display: flex; justify-content: space-between; gap: 12px; position: relative; z-index: 1; }
.acct-top { align-items: flex-start; }
.acct-bottom { align-items: flex-end; flex-wrap: wrap; }
.acct-name { font-size: 16px; font-weight: 600; }
/* Secondary card text stays solid white: 80% white fell under 4.5:1 on 19 of the 31 bank colours.
   Size, weight and case carry the hierarchy instead. */
.acct-kind { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; }
.acct-num { font-family: var(--mono); font-size: 14px; color: #fff; }
.acct-value { min-width: 0; max-width: 100%; margin-left: auto; text-align: right; }
.acct-value strong { display: block; font-size: 22px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.acct-value > span { display: block; font-size: 12px; color: #fff; font-weight: 400; white-space: nowrap; }
.acct-value strong .cur { display: inline; margin-right: 5px; font-size: 12px; font-weight: 600; opacity: 0.85; }
.acct-stats .cur { margin-right: 5px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.acct-value .acct-hint { margin-top: 2px; font-weight: 600; opacity: 0.85; }
.acct-empty { background: var(--card); box-shadow: none; color: var(--text); }
/* "Cash & other": an empty slot to fill, so a dashed outline on a quiet surface, the same
   size and shape as the bank cards, with its own icon and a real button. */
.acct-ghost { background: color-mix(in srgb, var(--text) 3%, var(--surface)); box-shadow: none; border: 1.5px dashed var(--btn-line); color: var(--text-2); transition: background-color 150ms ease-out, border-color 150ms ease-out; }
.acct-ghost:hover { background: var(--card); border-color: var(--text-3); }
.acct-ghost:focus-visible { outline: 2px solid var(--info-2); outline-offset: 2px; }
.acct-ghost-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--card-hover); color: var(--text); }
.acct-ghost-bottom { display: grid; gap: 12px; justify-items: start; }
.acct-ghost-bottom .small { color: var(--text-2); line-height: 1.45; }
.acct-ghost:hover .acct-ghost-cta { background: var(--card-hover); color: var(--text); }
.acct-ghost::after { display: none; }
.acct-ghost .acct-name { color: var(--text); }
.acct-empty::after { display: none; }
/* These two sit on theme surfaces, not a card colour, so their labels follow the theme. */
.acct-empty .acct-kind, .acct-ghost .acct-kind { color: var(--text-2); }
/* An account card in its bank's own colour (both stops keep white text at 4.5:1). */
.acct-brand, .sc-card.acct-brand { background: linear-gradient(135deg, var(--c2) 0%, var(--c) 100%); }
.acct-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acct-id .acct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct .bank-mark { box-shadow: 0 2px 8px rgb(0 4 26 / 0.25); }

/* ------------------------------------------------------- bank & wallet logos */
/* A bank's logo on the colour its own logo / app icon sits on. The colour comes from
   app/web/brands.py through css(c=…), which sets --c. */
.bank-mark {
  --c: var(--card);
  display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px;
  border-radius: var(--r-sm); background: var(--c); overflow: hidden;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06);
}
.bank-mark img { display: block; width: 74%; height: 74%; object-fit: contain; }
.bank-mark-sm { width: 18px; height: 18px; border-radius: 5px; }
.bank-mark-lg { width: 36px; height: 36px; border-radius: 10px; }
.bank-mark-blank { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.bank-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.bank-name > span { min-width: 0; overflow-wrap: anywhere; }

/* <select data-bank-picker>: the select stays in the form, visually hidden */
.picker { position: relative; }
.picker-native { position: absolute; left: 12px; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.picker-btn {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px;
  border: 0; border-radius: var(--r); background: var(--input-bg); box-shadow: inset 0 0 0 1px var(--input-ring);
  color: var(--text); font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}
.picker-btn:hover { background: var(--card-hover); }
.picker-btn:focus-visible, .picker-btn[aria-expanded="true"] { outline: none; background: var(--card-hover); box-shadow: inset 0 0 0 2px var(--info-2); }
.picker-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-chev { color: var(--text-2); transition: transform 0.15s ease; }
.picker-btn[aria-expanded="true"] .picker-chev { transform: rotate(180deg); }
.picker-panel {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); min-width: 0;
  padding: 6px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-modal), inset 0 0 0 1px var(--line-strong);
}
.picker.is-up .picker-panel { top: auto; bottom: calc(100% + 6px); }
.picker-panel input.picker-search { min-height: 38px; margin-bottom: 6px; padding: 8px 12px; font-size: 13px; }
.picker-list { list-style: none; margin: 0; padding: 0; max-height: min(300px, 40dvh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.picker-list:focus { outline: none; }
.picker-list li { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: var(--r-sm); font-size: 14px; color: var(--text); cursor: pointer; }
.picker-list li.is-active { background: var(--card-hover); box-shadow: inset 0 0 0 2px var(--info-2); }
.picker-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-check { color: var(--info-2); visibility: hidden; }
.picker-list li[aria-selected="true"] { font-weight: 600; }
.picker-list li[aria-selected="true"] .picker-check { visibility: visible; }
.picker-empty { margin: 0; padding: 10px; font-size: 13px; color: var(--text-2); }
@media (max-width: 860px) { .balance { grid-template-columns: minmax(0, 1fr); } }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kpi { display: grid; gap: 4px; padding: 16px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow-tile); }
.kpi > .ico { color: var(--text-2); margin-bottom: 6px; }
.kpi-label { font-size: 12px; color: var(--text-2); }
.kpi-value { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi-delta { font-size: 12px; font-weight: 600; color: var(--text-2); }
.kpi-delta.good { color: var(--pos); }
.kpi-delta.bad { color: var(--neg); }
a.kpi:hover { background: var(--card-hover); text-decoration: none; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 8px; margin-top: 16px; }
.mini-stats > div { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r); background: var(--card); }
.mini-stats strong { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* used on reports */
.hero { padding: 20px; display: grid; gap: 16px; }
.hero-figure { font-size: 32px; font-weight: 700; line-height: 1.2; margin-top: 6px; font-variant-numeric: tabular-nums; }
.hero-figure .cur { font-size: 14px; color: var(--text-2); margin-right: 6px; }
.hero-sub { color: var(--text-2); margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 8px; padding: 0 20px 20px; }
.stat { display: grid; gap: 4px; padding: 16px; border-radius: var(--r); background: var(--card); }
.stat-key { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.stat-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats.stats-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .stats.stats-3 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ budgets */

.text-neg, .stat-value.neg { color: var(--neg); }
.budget-track { position: relative; height: 4px; border-radius: var(--r-full); background: var(--card-hover); margin: 10px 0 8px; }
.budget-fill { position: absolute; inset: 0 auto 0 0; border-radius: var(--r-full); background: var(--pos); max-width: 100%; }
.budget-fill.budget-warn { background: var(--warn); }
.budget-fill.budget-over { background: var(--neg); }
.budget-pace { position: absolute; top: -4px; width: 2px; height: 12px; margin-left: -1px; border-radius: 1px; background: var(--text-2); }
.budget-pace-key { display: inline-block; width: 2px; height: 10px; margin-right: 6px; vertical-align: -1px; border-radius: 1px; background: var(--text-2); }
.budget-list { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 8px; }
.budget-row { padding: 14px 16px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow-tile); }
.budget-head, .budget-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.budget-head .chip { font-size: 14px; color: var(--text); font-weight: 600; }
.budget-foot { font-size: 13px; }
.budget-foot .neg { color: var(--neg); }
.budget-edit summary { margin-top: 8px; font-size: 12px; color: var(--text-2); cursor: pointer; width: max-content; }
.budget-edit summary:hover { color: var(--text); }
.budget-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 12px 12px; }
.budget-tile { display: block; padding: 14px 16px; border-radius: var(--r); background: var(--card); color: inherit; box-shadow: var(--shadow-tile); }
.budget-tile:hover { background: var(--card-hover); text-decoration: none; }
.budget-tile .budget-track { background: var(--surface); }
@media (max-width: 720px) { .budget-tiles { grid-template-columns: 1fr; } }
.suggest-list { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 8px; }
.suggest-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 12px 10px 16px; border-radius: var(--r); background: var(--card); }

.alert-channel { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r); background: var(--card); }
.alert-channel .hint { margin: 4px 0 0; }

/* New-account fields only matter for a new account (stay visible where :has is unsupported). */
.import-form:has(#import-account option[value^="acct:"]:checked) .new-acct { display: none; }
.map-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
@media (max-width: 900px) { .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.table td.pos { color: var(--pos); }
.table td.neg { color: var(--neg); }
.table tr.muted td { color: var(--text-2); }
input[type="file"] { width: 100%; padding: 10px 12px; border-radius: var(--r); background: var(--card); color: var(--text-2); font: inherit; font-size: 13px; }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 6px 14px; border: 0; border-radius: var(--r-full); background: var(--text); color: var(--page); font: inherit; font-weight: 600; cursor: pointer; }

.alias-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r); background: var(--card); }
.alias-row > span, .share-row > span { min-width: 0; overflow-wrap: anywhere; }
.alias-variants { display: flex; flex-wrap: wrap; gap: 6px 12px; min-width: 0; }
@media (max-width: 720px) {
  .alias-row { grid-template-columns: minmax(0, 1fr) auto; }
  .suggest-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .suggest-list li > .muted { grid-column: 1; }
}

.offline-bar { position: sticky; top: env(safe-area-inset-top); z-index: 50; padding: 10px 16px; text-align: center; font-size: 13px; font-weight: 600; background: var(--warn-bg); color: var(--on-warn); }
.offline-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.offline-list a { display: block; padding: 12px 14px; border-radius: var(--r); background: var(--card); color: var(--text); font-weight: 600; }
.offline-list a:hover { background: var(--card-hover); text-decoration: none; }
[hidden] { display: none !important; }

.label-link { float: right; font-weight: 500; color: var(--info-2); }
.code-input { font-family: var(--mono); font-size: 20px !important; letter-spacing: 0.18em; }
.two-factor-setup { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: start; }
.two-factor-setup .qr svg { display: block; width: 220px; height: auto; border-radius: var(--r); }
.secret-key { display: inline-block; margin-top: 6px; padding: 8px 10px; border-radius: var(--r-xs); background: var(--card); color: var(--text); letter-spacing: 0.06em; word-break: break-all; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 10px 56px; margin: 0; padding: 0; list-style-position: inside; font-size: 16px; color: var(--text); }
.recovery-codes li::marker { color: var(--text-3); }
@media (max-width: 420px) { .recovery-codes { grid-template-columns: max-content; } }
@media (max-width: 640px) { .two-factor-setup { grid-template-columns: 1fr; } .two-factor-setup .qr svg { width: 200px; } }

.tag { display: inline-flex; padding: 2px 8px; border-radius: var(--r-full); background: color-mix(in srgb, var(--info-2) var(--tint), transparent); color: var(--info-2); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
a.tag:hover { text-decoration: none; background: color-mix(in srgb, var(--info-2) calc(var(--tint) + 4%), transparent); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.split-row { display: grid; grid-template-columns: minmax(0, 1.2fr) 140px minmax(0, 1.4fr); gap: 8px; }
@media (max-width: 640px) { .split-row { grid-template-columns: minmax(0, 1fr) 110px; } .split-row input[name="part_note"] { grid-column: 1 / -1; } }
[data-split-left].bad { color: var(--neg); }
[data-split-left].good { color: var(--pos); }

.consent-box { padding: 14px 16px; border-radius: var(--r); background: var(--card); font-size: 13.5px; }
.consent-box ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); display: grid; gap: 4px; }
.suggest-rows { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 8px; }
.suggest-rows li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 200px; gap: 14px; align-items: center; padding: 12px 16px; border-radius: var(--r); background: var(--card); }
.suggest-main { display: grid; gap: 3px; min-width: 0; }
.suggest-main .neg { color: var(--neg); } .suggest-main .pos { color: var(--pos); }
@media (max-width: 720px) { .suggest-rows li { grid-template-columns: auto minmax(0, 1fr) auto; } .suggest-rows select { grid-column: 2 / -1; } }

.receipt-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.receipt-grid li { display: grid; gap: 6px; justify-items: start; }
.receipt-grid img { display: block; width: 100%; height: 190px; object-fit: cover; border-radius: var(--r); background: var(--card); }

.shared-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 4px; border-radius: var(--r); background: color-mix(in srgb, var(--info-2) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info-2) 35%, transparent); }
.shared-banner .demo-banner-text { flex: 1 1 260px; }
.share-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--r); background: var(--card); }
@media (max-width: 640px) { .share-row { grid-template-columns: minmax(0, 1fr) auto; } }

.form-success { padding: 14px 16px; border-radius: var(--r); background: color-mix(in srgb, var(--pos) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pos) 30%, transparent); }

/* ------------------------------------------------------------------ recurring */

.rec-list { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 8px; }
.rec-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 150px auto; gap: 16px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow-tile); }
.rec-compact .rec-row { grid-template-columns: minmax(0, 1fr) auto 110px; }
.rec-main { display: grid; gap: 4px; min-width: 0; }
.rec-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-when { display: grid; justify-items: end; gap: 4px; text-align: right; }
.rec-amount { display: grid; justify-items: end; gap: 2px; }
.rec-hidden { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.rec-hidden li { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
@media (max-width: 720px) {
  .rec-row, .rec-compact .rec-row { grid-template-columns: minmax(0, 1fr) auto; }
  .rec-when { grid-column: 1; justify-items: start; text-align: left; grid-row: 2; }
  .rec-amount { grid-row: 1; grid-column: 2; }
  .rec-action { grid-row: 2; grid-column: 2; justify-self: end; }
}

/* ------------------------------------------------------------------ transaction rows (tiles) */

.ledger { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 8px; }
.ledger-day { display: flex; gap: 4px 8px; flex-wrap: wrap; align-items: baseline; padding: 10px 6px 0; font-size: 12px; font-weight: 500; color: var(--text-2); }
.ledger-alt { color: var(--text-3); font-weight: 400; }
.ledger-alt::before { content: "·"; margin-right: 8px; }
.ledger-row {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: var(--r); background: var(--card); color: inherit;
  box-shadow: var(--shadow-tile); transition: background 0.15s ease;
}
a.ledger-row:hover { background: var(--card-hover); text-decoration: none; }
.dir { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.dir-out { background: color-mix(in srgb, var(--neg) 13%, transparent); color: var(--neg); }
.dir-in { background: color-mix(in srgb, var(--pos) 13%, transparent); color: var(--pos); }
.ledger-main { min-width: 0; display: grid; gap: 2px; }
.ledger-title { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-2); font-weight: 400; }
.ledger-meta .chip, .ledger-meta .tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.ledger-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.amount { font-weight: 600; font-size: 14px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount small { display: block; font-weight: 400; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.amount .sign { margin-right: 1px; }
.ledger-row:has(.dir-out) .amount, .amount.is-out { color: var(--neg); }
.ledger-row:has(.dir-in) .amount, .amount.is-in { color: var(--pos); }
.ledger-row .amount small { color: var(--text-2); }
@media (max-width: 520px) { .ledger { padding: 0 8px 8px; } .ledger-row { gap: 10px; padding: 12px; } }
.pager { justify-content: space-between; }

/* ------------------------------------------------------------------ charts */

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-family: var(--mono); font-size: 10px; }
.chart .cap { fill: var(--text-2); font-family: var(--mono); font-size: 10px; font-weight: 500; }
.chart .m-out { fill: var(--neg); }
.chart .m-in { fill: var(--pos); }
.chart .m-move { fill: var(--neutral-6); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover { fill: var(--hover-tint); }
.chart-scroll { overflow-x: auto; }
.chart-table summary { cursor: pointer; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.chart-table ul { list-style: none; margin: 8px 0 0; padding: 0; columns: 2; gap: 16px; font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sharebar { display: flex; gap: 2px; height: 10px; border-radius: var(--r-full); overflow: hidden; background: var(--card); }
.sharebar span { display: block; background: var(--c); min-width: 3px; }
.bars { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.bar-row .label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); min-width: 0; }
.bar-row .label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .value { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.bar-row .value small { color: var(--text-2); font-weight: 400; margin-left: 6px; }
.bar-track { grid-column: 1 / -1; height: 4px; border-radius: var(--r-full); background: var(--card-hover); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--r-full); background: var(--c, var(--neg)); }
.tip { position: fixed; z-index: 70; pointer-events: none; padding: 6px 10px; border-radius: var(--r-sm); background: var(--text); color: var(--page); font-size: 12px; font-weight: 600; transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; opacity: 0; transition: opacity 0.1s; }
.tip.on { opacity: 1; }

/* ------------------------------------------------------------------ tables / key-value */

.table { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 13px; padding: 0 12px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-2); padding: 0 16px; }
.table td { padding: 12px 16px; background: var(--card); }
.table td:first-child { border-radius: var(--r) 0 0 var(--r); }
.table td:last-child { border-radius: 0 var(--r) var(--r) 0; }
.table td:only-child { border-radius: var(--r); }
.table .r { text-align: right; }
/* position: relative so absolute children (the sr-only "Actions" header) scroll with the table
   instead of escaping it and widening the whole page to 675px on phones. */
.table-wrap { position: relative; overflow-x: auto; padding-bottom: 8px; }
.is-off td:not(:last-child) { opacity: 0.45; }

.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); margin: 0; padding: 0 12px; row-gap: 6px; }
.kv dt, .kv dd { margin: 0; padding: 12px 14px; font-size: 13px; background: var(--card); }
.kv dt { color: var(--text-2); border-radius: var(--r) 0 0 var(--r); font-weight: 400; }
.kv dd { border-radius: 0 var(--r) var(--r) 0; overflow-wrap: anywhere; }
.kv dd.mono { font-weight: 400; }
.kv-compact { padding: 0; margin-top: 8px; }
@media (max-width: 520px) { .kv { grid-template-columns: 110px minmax(0, 1fr); } }

.sms-bubble { font-family: var(--mono); font-size: 13px; line-height: 1.6; font-weight: 400; padding: 14px 16px; border-radius: 16px 16px 16px 4px; background: var(--card); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.secret { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 14px; border-radius: var(--r); background: var(--card); }
.secret code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; color: var(--text); }
.secret-plain { max-width: 360px; }

/* ------------------------------------------------------------------ accounts page */

.acct-panel { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; padding: 20px; align-items: start; scroll-margin-top: 110px; }
.acct-panel-card { min-height: 180px; }
.acct-panel-body { display: grid; gap: 14px; min-width: 0; }
.acct-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.acct-stats > div { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r); background: var(--card); }
.acct-stats strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.acct-stats strong.pos { color: var(--pos); }
.acct-stats strong.neg { color: var(--neg); }
.chart .bal-line { fill: none; stroke: var(--info-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .bal-area { fill: var(--info-2); opacity: 0.1; }
.chart .bal-end { fill: var(--info-2); stroke: var(--surface); stroke-width: 2; }
@media (max-width: 860px) { .acct-panel { grid-template-columns: 1fr; } .acct-stats { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 520px) { .acct-stats { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ review page */

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
/* Review › month close: a ruled ledger page with a marigold "Filed" stamp. */
.month-close { position: relative; background: repeating-linear-gradient(var(--surface) 0 31px, var(--line) 31px 32px); }
.close-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; padding: 22px 128px 6px 20px; }
@media (max-width: 560px) { .close-head { grid-template-columns: 1fr; padding-right: 20px; } }
.close-head h2 { font-size: 20px; }
/* The word sits well inside the inner ring: 84px stamp, 70px inner ring, content 34px tall
   and centred, so the narrowest chord it crosses (~60px) is wider than "FILED" (~40px). */
.close-stamp {
  position: absolute; top: 18px; right: 22px;
  display: grid; place-content: center; justify-items: center; gap: 3px; width: 84px; height: 84px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--marigold), inset 0 0 0 6px var(--surface), inset 0 0 0 7px var(--marigold);
  color: var(--marigold); font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; line-height: 1; text-transform: uppercase;
  transform: rotate(-8deg); animation: stamp-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.close-stamp .ico { width: 18px; height: 18px; }
@media (max-width: 560px) { .close-stamp { width: 68px; height: 68px; font-size: 9.5px; top: 14px; right: 14px; } .close-stamp .ico { width: 15px; height: 15px; } }
@keyframes stamp-in { from { opacity: 0; transform: rotate(-8deg) scale(1.35); } to { opacity: 1; transform: rotate(-8deg) scale(1); } }
.close-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 24px; margin: 0; padding: 8px 20px 18px; }
.close-lines > div { display: grid; gap: 2px; padding: 10px 0; }
.close-lines dt { font-size: 12px; color: var(--text-2); }
.close-lines dd { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.close-note { font-size: 12px; font-weight: 500; color: var(--text-2); }
.tile { display: grid; gap: 4px; padding: 16px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow-tile); transition: background 0.15s ease; }
.tile:hover { background: var(--card-hover); text-decoration: none; }
.tile-count { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-label { font-weight: 600; }
.tile-hint { font-size: 12px; color: var(--text-2); font-weight: 400; }
.tile-alert .tile-count { color: var(--neg); }
.tile-warn .tile-count { color: var(--warn); }
.tile-ok .tile-count { color: var(--text-3); }
@media (max-width: 720px) { .tiles { grid-template-columns: 1fr; } }
.review-section { scroll-margin-top: 110px; }
.review-section > .card-head { padding-bottom: 16px; }
.review-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0 12px 12px; }
.review-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; border-radius: var(--r); background: var(--card); }
.review-item:target { box-shadow: inset 0 0 0 2px var(--warn); }
.review-meta { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; }
.review-problem { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); background: var(--danger-soft); font-size: 13px; color: var(--text); }
.review-problem .ico { color: var(--neg); margin-top: 2px; flex: none; }
.review-item textarea, .review-item input { background: var(--sunken); }
.review-sms { min-height: 64px; }
.review-actions { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
/* min-width 0: a datetime-local input's own width (272px) pushed the card past a 320px screen */
.review-actions .field { flex: 0 1 260px; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.review-buttons { margin-left: auto; }
.check-list { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 8px; }
.check-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: var(--card); }
.check-row:has(.dir-out) .amount { color: var(--neg); }
.check-row:has(.dir-in) .amount { color: var(--pos); }
.check-main { display: grid; gap: 2px; min-width: 0; }
/* Review › Needs a category: pick and file in place, one row per shop or person */
.sort-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
.sort-form { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sort-form select { flex: 1 1 200px; max-width: 320px; background-color: var(--sunken); }
.sort-remember { align-items: center; font-size: 13px; }
.warn-text { color: var(--warn); }
.activity summary { cursor: pointer; padding: 0 20px 18px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.activity-list { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 6px; }
.activity-list li { display: grid; grid-template-columns: 120px 80px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: var(--r-sm); background: var(--card); font-size: 13px; }
@media (max-width: 640px) {
  .check-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .check-action { grid-column: 2 / -1; }
  .review-buttons { margin-left: 0; }
  .activity-list li { grid-template-columns: 1fr auto; }
  .activity-list li > :nth-child(2), .activity-list li > :nth-child(3) { display: none; }
}

/* ------------------------------------------------------------------ add page */

.manual-form { display: grid; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.direction { display: flex; gap: 12px; flex-wrap: wrap; margin: 0; padding: 0; border: 0; }
.direction legend { margin-bottom: 8px; }
.dir-choice { position: relative; }
.dir-choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.dir-choice > span { display: inline-flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border-radius: var(--r-full); background: var(--card); font-weight: 600; font-size: 13px; color: var(--text-2); }
.dir-choice input:checked + span { background: var(--text); color: var(--page); }
.dir-choice input:focus-visible + span { outline: 2px solid var(--info-2); outline-offset: 2px; }
.amount-input { font-family: var(--mono) !important; font-size: 20px !important; font-weight: 600 !important; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--text-2); font-weight: 400; }
.checklist li { display: flex; gap: 8px; align-items: flex-start; }
.checklist .ico { color: var(--pos); margin-top: 2px; flex: none; }

/* ------------------------------------------------------------------ Connect a phone (setup guide) */

.setup-step { scroll-margin-top: 110px; }
.step-head { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding: 20px 20px 0; align-items: start; }
.step-num { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--text); color: var(--page); font-weight: 700; }
.step-body { padding: 16px 20px 20px 70px; display: grid; gap: 12px; }
@media (max-width: 640px) { .step-body { padding-left: 20px; } }
.status-ok, .status-warn { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: 13px; }
.status-ok { background: color-mix(in srgb, var(--pos) 12%, transparent); }
.status-ok .ico { color: var(--pos); flex: none; }
.status-warn { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.status-warn .ico { color: var(--warn); flex: none; }
.status-ok .mono, .status-warn .mono { overflow-wrap: anywhere; }
.fix { display: grid; gap: 8px; }
.newlink { display: grid; gap: 10px; padding: 16px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pos) 35%, transparent); }
.newlink .secret { background: var(--sunken); }
.links { list-style: none; margin: 16px 0 0; padding: 0 12px; display: grid; gap: 8px; }
.link-row, .session-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--card); }
.link-row.is-off { opacity: 0.5; }
.link-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--card-hover); color: var(--text-2); }
.link-main { display: grid; gap: 2px; min-width: 0; }
.link-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.link-actions form, .session-row form { margin: 0; }
.newlink-form { justify-content: flex-start; }
.newlink-form input { max-width: 240px; }
.session-list { list-style: none; margin: 0; padding: 16px 12px 0; display: grid; gap: 8px; }
@media (max-width: 560px) { .link-row, .session-row { grid-template-columns: 32px minmax(0, 1fr); } .link-actions, .session-row form { grid-column: 2; justify-content: flex-start; } }

/* Connect › step 3: iPhone or Android. Radio buttons + :has(), so it works without JavaScript. */
.platform-switch { display: inline-flex; gap: 4px; margin: 0; padding: 4px; border: 0; border-radius: var(--r-full); background: var(--sunken); justify-self: start; }
.platform-switch label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: var(--r-full); font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.platform-switch label:has(input:checked) { background: var(--text); color: var(--page); }
.platform-switch label:has(input:focus-visible) { outline: 2px solid var(--info-2); outline-offset: 2px; }
.step-link { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.platform-intro { margin: 0; padding: 0 20px 0 70px; color: var(--text-2); font-size: 13px; font-weight: 400; }
.platform-android { display: none; }
.setup-step:has(input[name="platform"][value="android"]:checked) .platform-android { display: block; }
.setup-step:has(input[name="platform"][value="android"]:checked) .platform-ios { display: none; }
.platform-more { padding: 0 20px 20px 70px; font-size: 13px; color: var(--text-2); }
.platform-more summary { cursor: pointer; font-weight: 600; }
.platform-more p { margin: 8px 0 0; max-width: 70ch; }
.fix summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); }
.action { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: var(--r-xs); background: var(--card-hover); font-weight: 600; font-size: 12.5px; color: var(--text); white-space: nowrap; }
.kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: var(--r-xs); background: var(--card-hover); }


/* Connect › three steps, then phone mock-ups whose numbered pins match the instructions. */
.guide-rail { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.guide-rail a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--card); color: var(--text); text-decoration: none; transition: background-color 150ms ease-out, transform 120ms ease-out; }
.guide-rail a:active { transform: translateY(1px); }
.guide-rail a:focus-visible { outline: 2px solid var(--info-2); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .guide-rail a:hover { background: var(--card-hover); } }
.guide-rail strong { display: block; font-size: 14px; }
.guide-rail small { display: block; font-size: 12px; color: var(--text-2); }
.guide-dot { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--text); color: var(--page); font-weight: 700; font-size: 13px; }
.guide-trust { display: flex; align-items: center; gap: 8px; margin: 0 0 20px; font-size: 13px; color: var(--text-2); }
.guide-trust .ico { color: var(--pos); flex: none; }
.guide-warn { padding: 16px 20px; display: grid; gap: 12px; }
.guide-sub { margin: 18px 20px 0 70px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.newlink-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.guide { list-style: none; margin: 0; padding: 4px 20px 12px 70px; display: grid; gap: 12px; }
.guide-step { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: center; padding: 20px; border-radius: var(--r-lg); background: var(--card); }
.guide-text { display: grid; gap: 8px; max-width: 62ch; }
.guide-kicker { margin: 0; font-size: 12px; font-weight: 600; color: var(--info-2); }
.guide-text h3 { margin: 0; font-size: 17px; line-height: 1.3; text-wrap: balance; }
.guide-do { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14px; line-height: 1.65; color: var(--text-2); font-weight: 400; text-wrap: pretty; }
.guide-do li { position: relative; padding-left: 30px; }
.guide-do > li > .pin { position: absolute; left: 0; top: 2px; }
.guide-do li:not(:has(> .pin))::before { content: ""; position: absolute; left: 7px; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.guide-do .btn { margin-left: 4px; vertical-align: middle; }
.guide-note { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0 0; padding: 10px 12px; border-radius: var(--r); background: var(--sunken); font-size: 13px; line-height: 1.55; color: var(--text-2); }
.guide-note .ico { color: var(--info-2); flex: none; margin-top: 3px; }
.pin { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--info-2); color: var(--page); font-size: 11px; font-weight: 700; font-style: normal; line-height: 1; flex: none; }
.guide-extras { padding: 0 20px 20px 70px; display: grid; gap: 8px; }
.guide-extras details { border-radius: var(--r); background: var(--card); padding: 0 16px; }
.guide-extras summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 14px; }
.guide-extra-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; padding: 0 0 16px; font-size: 13px; line-height: 1.6; color: var(--text-2); }
.guide-extra-body:not(:has(> figure)) { grid-template-columns: 1fr; }
.guide-extra-body p { margin: 0 0 8px; max-width: 70ch; }

.mock { margin: 0; width: 100%; max-width: 260px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; padding: 12px; border-radius: 28px; background: var(--sunken); box-shadow: var(--shadow-modal), inset 0 0 0 1px var(--line-strong); font-size: 12px; line-height: 1.35; color: var(--text); }
.mock-ios::before { content: ""; justify-self: center; width: 56px; height: 5px; border-radius: 3px; background: var(--line-strong); }
.mock-android { border-radius: 20px; }
.mock-sm { max-width: 240px; }
.mock .is-target { box-shadow: inset 0 0 0 2px var(--info-2); color: var(--text); }
.mock .is-dim { opacity: 0.55; }
.mock .pin { margin-left: 6px; }
.mock-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 2px 4px; font-size: 11.5px; color: var(--info-2); }
.mock-bar b { color: var(--text); font-size: 12.5px; }
.mock-bar > span:last-child { justify-self: end; display: inline-flex; align-items: center; }
.mock-bar-android { grid-template-columns: 1fr; font-size: 13px; }
.mock-group { display: grid; gap: 1px; border-radius: 12px; overflow: hidden; background: var(--line-strong); }
.mock-row { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 10px; border-radius: 0; background: var(--card); color: var(--text-2); }
.mock > .mock-row, .mock-action > .mock-row { border-radius: 10px; }
.mock-row b { margin-left: auto; color: var(--text); font-weight: 600; text-align: right; }
.mock-row em { margin-left: auto; font-style: normal; color: var(--text-3); }
.mock-row b + .pin, .mock-row em + .pin { margin-left: 6px; }
.mock-row .pin:only-of-type { margin-left: auto; }
.mock-radio { flex: none; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.mock-radio.is-on { box-shadow: inset 0 0 0 4px var(--info-2); }
.mock-toggle { margin-left: auto; flex: none; width: 30px; height: 18px; border-radius: 9px; background: var(--card-hover); box-shadow: inset 0 0 0 1px var(--line-strong); }
.mock-action { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px; border-radius: 16px; background: var(--card); }
.mock-action > .mock-row { background: var(--sunken); }
.mock-action-head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.mock-app { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--grad-turquoise); color: #fff; }
.mock-url, .mock-field { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: var(--sunken); }
.mock-url { color: var(--info-2); overflow-wrap: anywhere; }
.mock-field { flex-wrap: wrap; }  /* the "Shortcut Input › Content" chip drops a line on a narrow phone */
.mock-url .mono, .mock-field .mono { font-size: 11px; }
.mock-url .pin { margin-left: auto; }
.mock-token { margin-left: auto; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--info-2) 18%, transparent); color: var(--info-2); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.mock-search { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--r-full); background: var(--card); color: var(--text-2); }
.mock-pop { justify-self: end; width: 72%; margin-top: -2px; display: grid; gap: 2px; padding: 6px; border-radius: 12px; background: var(--card-hover); box-shadow: var(--shadow-modal); }
.mock-pop-title { padding: 2px 6px 4px; font-size: 10.5px; color: var(--text-3); }
.mock-pop-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px; border-radius: 8px; color: var(--text-2); }
.mock-pop-row .ico { color: var(--info-2); }
.mock-dialog { display: grid; gap: 8px; justify-items: center; padding: 18px 14px 12px; border-radius: 22px; background: var(--card); text-align: center; }
.mock-dialog-icon { color: var(--info-2); }
.mock-dialog p { margin: 0 0 4px; color: var(--text-2); line-height: 1.5; }
.mock-dialog p b { color: var(--text); }
.mock-dialog-btn { width: 100%; display: flex; align-items: center; justify-content: center; padding: 8px; border-radius: var(--r-full); background: var(--sunken); font-weight: 600; }
.mock-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 6px 10px 8px; border-radius: 8px 8px 0 0; background: var(--card); box-shadow: inset 0 -1.5px 0 var(--text-3); }
.mock-input.is-target { box-shadow: inset 0 0 0 2px var(--info-2); border-radius: 8px; }
.mock-input small { font-size: 10px; color: var(--info-2); }
.mock-input .mono { grid-column: 1; font-size: 11px; overflow-wrap: anywhere; }
.mock-input .pin { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.mock-buttons { display: flex; justify-content: flex-end; gap: 8px; padding: 2px 0 0; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--info-2); }
.mock-buttons span { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 6px; }
.mock-toggle.is-on { background: var(--info-2); box-shadow: none; }
.mock-store { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }
.mock-store-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--grad-turquoise); color: #fff; }
.mock-store b { display: block; font-size: 12.5px; }
.mock-store small { display: block; font-size: 10.5px; color: var(--text-3); }
.mock-store-btn { background: var(--card); }
.mock-menu { display: grid; gap: 4px; padding: 8px; border-radius: 12px; background: var(--card-hover); box-shadow: var(--shadow-modal); }
.mock-menu-title { display: flex; justify-content: space-between; padding: 2px 6px; font-size: 11px; font-weight: 600; color: var(--text-2); }
.mock .mock-pop-row .pin { margin-left: 6px; }
.mock-notif { gap: 6px; padding: 12px; border-radius: 18px; background: var(--card-hover); }
.mock-notif-app { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--text-2); }
.mock-notif-app .ico { width: 12px; height: 12px; color: var(--warn); }
@media (max-width: 760px) {
  .guide-step { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .guide-step .guide-text { order: -1; }
  .guide-extra-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .guide-rail { grid-template-columns: 1fr; }
  .platform-intro, .platform-more { padding-left: 20px; }
  .guide-sub { margin-left: 20px; }
  .guide, .guide-extras { padding-left: 12px; padding-right: 12px; }
  .guide-step { padding: 16px; }
}

.senders { display: grid; gap: 8px; }
.sender-list { list-style: none; margin: 0 20px 0 70px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sender-list li { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 12px; border-radius: var(--r-full); background: var(--card); font-size: 13px; }
.sender-list form { margin: 0; }
.senders-hint { margin: 0 20px 0 70px; }
@media (max-width: 640px) { .sender-list, .senders-hint { margin-left: 20px; } }

/* Reports › By category: transfers listed under spending, kept apart from it. */
.transfer-group { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line-strong); }
.transfer-head { margin: 0; font-size: 14px; font-weight: 600; }
.table-sub { display: block; font-size: 11.5px; font-weight: 400; color: var(--text-2); font-family: var(--font); }

/* Accounts › set the balance once when the bank's texts never say it. */
.set-balance { margin-top: 14px; border-radius: var(--r); background: var(--card); padding: 0 16px; }
.set-balance summary { cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 14px; }
.set-balance-form { display: grid; gap: 8px; padding: 0 0 14px; }
.set-balance-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.set-balance-row .field { margin: 0; }
.set-balance-row input { max-width: 220px; }
.set-balance-form .hint { margin: 0; }
.kpi-sub { display: block; font-size: 12px; color: var(--text-2); }

/* Where an entry came from: Apple / Android logo (+ name). */
.device { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--text-2); }
.device-logo { flex: none; width: 14px; height: 14px; }
svg.device-logo:not(.ico) { fill: currentColor; stroke: none; }
.device-ios .device-logo { color: var(--text); }
.device-android .device-logo, .link-icon-android { color: var(--android); }
.link-icon-ios { color: var(--text); }
.link-icon .device-logo { width: 16px; height: 16px; }

.try-form textarea { min-height: 96px; }
.try-form select { max-width: 360px; }
.try-result { display: grid; grid-template-columns: auto 280px minmax(0, 1fr); gap: 24px; padding: 4px 20px 24px 70px; align-items: start; }
.try-notif { font-size: 14px; }
@media (max-width: 760px) { .try-result { grid-template-columns: 1fr; padding-left: 20px; } }
.faq { padding: 12px 12px 12px 70px; display: grid; gap: 8px; }
.faq details { border-radius: var(--r); background: var(--card); padding: 0 16px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.faq details p { padding: 0 0 14px; color: var(--text-2); font-size: 13px; max-width: 72ch; font-weight: 400; }
@media (max-width: 640px) { .faq { padding-left: 12px; } }
.dev-details > summary { cursor: pointer; padding: 18px 20px; font-weight: 600; color: var(--text-2); }
.dev-details .step-body { padding-left: 20px; }

/* ------------------------------------------------------------------ pipeline animation (landing + iPhone setup) */

.pipeline { margin: 0; padding: 20px; display: grid; gap: 18px; background: var(--surface); }
.pl-step { display: grid; gap: 8px; position: relative; }
.pl-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.pl-label span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--card-hover); color: var(--text); font-size: 11px; font-weight: 700; }
.pl-sms { padding: 12px 14px; border-radius: 16px 16px 16px 4px; background: var(--card); opacity: 0; transform: translateY(-10px) scale(0.98); transform-origin: top left; transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
.pl-sms.in { opacity: 1; transform: none; }
.pl-sms-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.pl-avatar { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--grad-cyan-soft); color: #fff; }
.pl-avatar .ico { width: 13px; height: 13px; }
.pl-sender { font-weight: 600; }
.pl-when { margin-left: auto; color: var(--text-3); font-size: 11px; }
.pl-sms-body { font-family: var(--mono); font-size: 12px; line-height: 1.75; color: var(--text-2); font-weight: 400; min-height: 4.6em; }
.pl-sms mark { color: inherit; padding: 1px 3px; margin: 0 -2px; border-radius: 4px; background: linear-gradient(color-mix(in srgb, var(--info-2) 28%, transparent), color-mix(in srgb, var(--info-2) 28%, transparent)) no-repeat 0 0 / 0% 100%; transition: background-size 0.3s ease, color 0.3s ease; }
.pl-sms mark.hl { background-size: 100% 100%; color: var(--text); }
.pl-sms.is-replay .pl-when::after { content: " · again"; color: var(--warn); }
.pl-fields { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.pl-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: var(--r-full); background: var(--card); font-family: var(--mono); font-size: 11px; color: var(--text); opacity: 0; transform: translateY(6px); transition: opacity 0.25s ease, transform 0.3s ease; }
.pl-chip i { font-style: normal; color: var(--text-3); font-size: 11px; }
.pl-chip.in { opacity: 1; transform: none; }
.pl-post { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r); background: var(--card); font-size: 12px; }
.pl-endpoint { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); white-space: nowrap; }
.pl-endpoint .ico { color: var(--info-2); }
.pl-track { position: relative; flex: 1; min-width: 40px; height: 2px; border-radius: 2px; background: var(--card-hover); }
.pl-track::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--info-2); transform: scaleX(0); transform-origin: left; }
.pl-track.go::after { animation: pl-fill 0.8s ease-in-out forwards; }
.pl-track.done::after { transform: scaleX(1); }
.pl-packet { position: absolute; inset: 0; opacity: 0; pointer-events: none; }  /* a lane as wide as the track */
.pl-packet::before { content: ""; position: absolute; top: 50%; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--info-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--info-2) 25%, transparent); transform: translate(-50%, -50%); }
.pl-track.go .pl-packet { animation: pl-packet 0.8s ease-in-out forwards; }
@keyframes pl-fill { to { transform: scaleX(1); } }
/* transform, not left: the lane slides its own width, so the dot crosses the track without layout work */
@keyframes pl-packet { 0% { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateX(100%); opacity: 0; } }
.pl-status { padding: 4px 8px; border-radius: var(--r-xs); font-size: 11px; font-weight: 600; white-space: nowrap; background: color-mix(in srgb, var(--neutral-6) 16%, transparent); color: var(--text-2); }
.pl-status[data-state="sending"] { color: var(--text); }
.pl-status[data-state="sending"]::before { content: "● "; color: var(--info-2); animation: pl-blink 0.8s steps(2) infinite; }
.pl-status[data-state="ok"] { background: color-mix(in srgb, var(--pos) var(--tint), transparent); color: var(--pos); }
.pl-status[data-state="dup"] { background: color-mix(in srgb, var(--warn) var(--tint), transparent); color: var(--warn); }
@keyframes pl-blink { 50% { opacity: 0; } }
.pl-ledger { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pl-row { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows 0.45s ease, opacity 0.4s ease; }
.pl-row.collapsed { grid-template-rows: 0fr; opacity: 0; }
.pl-row-in { overflow: hidden; min-height: 0; }
.pl-ledger .ledger-row { padding: 10px 12px; gap: 12px; box-shadow: none; }
.pl-ledger .ledger-meta { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.pl-row.pulse .ledger-row { animation: pl-pulse 1.4s ease 2; }
@keyframes pl-pulse { 0%, 100% { box-shadow: inset 0 0 0 0 transparent; } 40% { box-shadow: inset 0 0 0 2px var(--warn); } }
.chip.pending { color: var(--text-3); }
.chip.pending .dot { animation: pl-blink 0.9s steps(2) infinite; }
@media (max-width: 520px) { .pipeline { padding: 14px; } .pl-endpoint .mono { display: none; } }

/* ------------------------------------------------------------------ auth & landing */

.auth {
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
}
.auth-aside {
  position: relative;
  background:
    radial-gradient(circle at 10% 15%, color-mix(in srgb, var(--marigold) 8%, transparent), transparent 50%),
    radial-gradient(circle at 90% 85%, color-mix(in srgb, var(--info-2) 10%, transparent), transparent 55%),
    var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.auth-aside-inner {
  padding: clamp(32px, 5vw, 64px);
  max-width: 580px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.auth-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.auth-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--card) 85%, transparent);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.auth-aside-body {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.auth-hero-copy {
  display: grid;
  gap: 12px;
}
.auth-tagline {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.03em;
}
.auth-tagline-highlight {
  color: var(--marigold);
  display: inline-block;
}
.auth-lede {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.55;
  max-width: 48ch;
}
.auth-preview-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--card) 75%, transparent);
  border: 1px solid var(--line-strong);
  box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.35);
  backdrop-filter: blur(12px);
}
.auth-preview-sms {
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  display: grid;
  gap: 6px;
}
.auth-preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.auth-sms-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pos);
  box-shadow: 0 0 6px var(--pos);
  flex-shrink: 0;
}
.auth-preview-label {
  color: var(--text-2);
}
.auth-preview-time {
  margin-left: auto;
  color: var(--text-3);
  font-size: 10.5px;
}
.auth-sms-body {
  margin: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}
.auth-preview-connector {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 0;
}
.auth-preview-connector-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-connector-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--marigold) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--marigold) 35%, transparent);
  color: var(--marigold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.auth-connector-badge .ico {
  color: var(--marigold);
}
.auth-preview-ledger {
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line-strong);
}
.auth-ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.auth-ledger-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-ledger-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--warn) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.auth-ledger-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.25;
}
.auth-ledger-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
}
.auth-ledger-right {
  display: grid;
  justify-items: end;
  gap: 4px;
}
.auth-ledger-amount {
  font-weight: 700;
  font-size: 14px;
  color: var(--neg);
  font-variant-numeric: tabular-nums;
}
.auth-ledger-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--warn) 18%, transparent);
  color: var(--warn);
  font-size: 10.5px;
  font-weight: 600;
}
.auth-features-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 12.5px;
  color: var(--text-2);
}
.auth-feature-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.auth-feature-icon {
  color: var(--pos);
  display: grid;
  place-items: center;
}

.auth-main { display: grid; min-width: 0; place-items: center; padding: 40px max(20px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.auth-card { width: 100%; max-width: 380px; display: grid; gap: 20px; }
.auth-card form { display: grid; gap: 14px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.demo-card { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); }
.inline-form { display: inline-flex; margin: 0; }

/* Password show/hide toggle */
.field-password { position: relative; display: flex; align-items: center; width: 100%; }
.field-password input { width: 100%; box-sizing: border-box; padding-right: 44px; }
.btn-toggle-pw {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; min-width: 32px; padding: 0;
  border: 0; background: transparent; color: var(--text-3); border-radius: var(--r-sm);
  cursor: pointer; z-index: 5;
  transition: color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  user-select: none;
}
.btn-toggle-pw:hover { color: var(--text); background: color-mix(in srgb, var(--text) 10%, transparent); }
.btn-toggle-pw:focus-visible { outline: 2px solid var(--marigold); outline-offset: 1px; color: var(--text); }
.btn-toggle-pw:active { transform: translateY(-50%) scale(0.94); }
.btn-toggle-pw .ico-pw-hide { display: none; }
.field-password.is-showing .btn-toggle-pw .ico-pw-show { display: none; }
.field-password.is-showing .btn-toggle-pw .ico-pw-hide { display: inline-block; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { padding: 28px max(20px, env(safe-area-inset-right)) 28px max(20px, env(safe-area-inset-left)); border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-aside-inner { padding: 0; gap: 24px; }
  .auth-preview-card { display: none; }
}

.landing { max-width: 1192px; margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); display: grid; gap: 88px; }
.landing-main { display: grid; gap: inherit; min-width: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r-full); background: var(--text); color: var(--page); font-weight: 600; }
.skip-link:focus { top: calc(12px + env(safe-area-inset-top)); text-decoration: none; }
.landing-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.btn-lg { min-height: 48px; padding: 12px 24px; font-size: 14px; }
.pill-note { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: var(--r-full); background: var(--surface); color: var(--text-2); font-size: 12.5px; }
.pill-note .ico { color: var(--warn); }

/* hero */
.landing-hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; padding-top: 24px; }
.hero-copy { display: grid; gap: 22px; justify-items: start; }
.landing-hero h1 { font-size: clamp(38px, 5.4vw, 62px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 700; }
.landing-hero h1 em { font-style: normal; color: var(--marigold); }
.landing-hero .lede { font-size: 17px; margin: 0; max-width: 46ch; line-height: 1.55; }
.hero-proof { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; font-weight: 400; }
.hero-proof li { display: inline-flex; align-items: center; gap: 6px; }
.hero-proof .ico { color: var(--pos); }

/* product shot */
.showcase { position: relative; min-height: 470px; display: grid; place-items: center; isolation: isolate; }
.showcase::before { content: ""; position: absolute; inset: 8% 6%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--info-2) 22%, transparent), transparent); filter: blur(10px); }
.sc-card { position: absolute; width: 250px; min-height: 148px; display: grid; align-content: space-between; gap: 24px; padding: 18px; border-radius: var(--r-lg); color: #fff; box-shadow: var(--shadow-glow); overflow: hidden; }
.sc-card::after { content: ""; position: absolute; right: -40px; top: -60px; width: 150px; height: 150px; border-radius: 50%; background: rgb(255 255 255 / 0.09); }
.sc-card .acct-value strong { font-size: 18px; }
.sc-acct { top: 0; left: 0; background: var(--grad-turquoise); transform: rotate(-6deg); animation: sc-float 7s ease-in-out infinite; }
.sc-wallet { right: 0; bottom: 34px; width: 210px; min-height: 128px; background: var(--grad-purple); transform: rotate(5deg); animation: sc-float 8s ease-in-out -2s infinite; z-index: 0; }
.sc-dash { position: relative; z-index: 1; width: min(400px, 100%); margin-top: 70px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-modal), 0 0 0 1px var(--line); display: grid; gap: 14px; }
.sc-dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sc-total { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sc-total span { font-size: 12px; color: var(--text-2); font-weight: 600; margin-right: 6px; }
.sc-bars { display: flex; align-items: flex-end; gap: 6px; height: 64px; padding: 0 2px; }
.sc-bars span { flex: 1; height: var(--h); border-radius: 4px 4px 0 0; background: linear-gradient(var(--neg), color-mix(in srgb, var(--neg) 45%, transparent)); transform-origin: bottom; animation: sc-grow 1.2s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.sc-bars span:nth-child(odd) { animation-delay: 0.08s; }
.sc-bars span:nth-child(3n) { animation-delay: 0.16s; }
.sc-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sc-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r); background: var(--card); }
.sc-row .amount { font-size: 13px; }
.sc-row-new { animation: sc-row-in 9s ease-in-out infinite; }
.sc-notif {
  position: absolute; z-index: 2; right: -2%; top: 31%;
  display: flex; gap: 12px; align-items: center; width: 270px; padding: 12px 14px; border-radius: 18px;
  background: color-mix(in srgb, var(--card-hover) 94%, transparent); backdrop-filter: blur(12px); box-shadow: var(--shadow-modal), 0 0 0 1px var(--line-strong);
  animation: sc-notif 9s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
.sc-notif-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--grad-yellow); color: #2a1f00; }
.sc-notif-app { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--text-2); }
.sc-notif-text { font-size: 13.5px; font-weight: 600; }
.sc-notif-text b { color: var(--warn); }
@keyframes sc-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes sc-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
/* notification arrives at ~10%, row is "filed" at ~20%, both settle, then loop */
@keyframes sc-notif {
  0%, 4% { opacity: 0; transform: translateY(-14px) scale(0.96); }
  10%, 70% { opacity: 1; transform: none; }
  80%, 100% { opacity: 0; transform: translateY(-8px) scale(0.98); }
}
@keyframes sc-row-in {
  0%, 14% { box-shadow: inset 0 0 0 0 transparent; background: var(--card); }
  20% { box-shadow: inset 0 0 0 2px var(--warn); background: var(--card-hover); }
  40%, 100% { box-shadow: inset 0 0 0 0 transparent; background: var(--card); }
}

/* works-with marquee */
.works-with { display: grid; gap: 14px; justify-items: center; }
.marquee { width: 100%; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; width: max-content; animation: marquee 48s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* Loops pause while scrolled out of view (.is-offscreen, set by app.js). */
.showcase-col { display: grid; gap: 8px; min-width: 0; }
.pipeline.is-offscreen *,
.marquee.is-offscreen .marquee-track,
.showcase.is-offscreen * { animation-play-state: paused; }
.marquee-track li { display: grid; place-items: center; height: 48px; padding: 0 20px; border-radius: var(--r-full); background: var(--c, var(--surface)); }
.marquee-track img { display: block; height: 26px; width: auto; max-width: 132px; object-fit: contain; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* how it works */
.section-title { display: grid; gap: 8px; justify-items: center; text-align: center; margin-bottom: 28px; }
.section-title h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: -0.02em; max-width: 24ch; }
.how-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how-cards li { position: relative; display: grid; gap: 10px; align-content: start; padding: 24px; border-radius: var(--r-lg); background: var(--surface); }
.how-cards p { color: var(--text-2); font-weight: 400; }
.how-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--marigold-soft); color: var(--marigold); margin-bottom: 6px; }
.how-n { position: absolute; top: 22px; right: 24px; font-family: var(--mono); font-size: 13px; color: var(--text-3); }

/* features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { display: grid; gap: 8px; align-content: start; padding: 22px; border-radius: var(--r-lg); background: var(--surface); transition: background 0.15s ease; }
.feature:hover { background: var(--card); }
.feature h3 { font-size: 16px; }
.feature p { color: var(--text-2); font-weight: 400; }
.feature .eyebrow { color: var(--marigold); font-weight: 600; }

/* call to action — a "product card" gradient per DESIGN.md. The band is blue in both themes,
   so its text and button colours are fixed rather than theme tokens. */
.cta-card { color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 36px; border-radius: var(--r-lg); background: var(--grad-cyan-soft); box-shadow: var(--shadow-glow); }
.cta-card h2 { color: #fff; font-size: clamp(20px, 2.6vw, 28px); font-weight: 700; letter-spacing: -0.02em; max-width: 26ch; }
.cta-card .cta-text { flex: 1 1 320px; min-width: 0; }
.cta-card p { color: #fff; margin-top: 6px; font-weight: 400; }
.cta-btn { background: #fff; border-color: #fff; color: #040d3f; }
.cta-btn:hover { background: #dee2e6; border-color: #dee2e6; color: #040d3f; }
.cta-ghost { color: #fff; border-color: rgb(255 255 255 / 0.5); }
.cta-ghost:hover { background: rgb(255 255 255 / 0.12); color: #fff; }
.landing-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 8px; }

@media (max-width: 960px) {
  .landing { gap: 64px; }
  .landing-hero { grid-template-columns: 1fr; gap: 40px; }
  .showcase { min-height: 440px; }
  .how-cards, .features { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .landing { padding: calc(16px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  /* One row: brand left, compact buttons right (they stacked into two rows beside the logo). */
  .landing-nav .row { flex-wrap: nowrap; gap: 8px; }
  .landing-nav .btn { min-height: 44px; padding: 8px 14px; }
  .hide-xs { display: none; }
  .sc-card { width: 200px; min-height: 120px; padding: 14px; }
  .sc-wallet { width: 170px; }
  .sc-notif { width: 200px; right: 0; top: 4%; padding: 10px 12px; }
  .sc-notif-text { font-size: 12.5px; }
  .cta-card { padding: 24px; }
}
/* The hero's "Open a free khata" is the same link, one thumb below: keep just Sign in up top. */
@media (max-width: 400px) { .landing-nav .nav-cta { display: none; } }

.error-page { min-height: 70dvh; display: grid; place-items: center; text-align: center; }
.error-code { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---- Khatu (खातु), the mascot ------------------------------------------------------
   Brand colours, the same in both themes. Loops end within 5 s (WCAG 2.2.2); reduced motion
   gets the still pose (the global rule below). */
.khatu { display: block; flex: none; height: auto; overflow: visible; }
.khatu-sm { width: 56px; }
.khatu-md { width: 88px; }
.khatu-lg { width: 128px; }
.khatu .k-shadow { fill: rgb(4 13 63 / 0.18); }
.khatu .k-spine { fill: #0b1338; }
.khatu .k-pages { fill: #fbf3dc; }
.khatu .k-pages-lines { fill: none; stroke: #e2d6b4; stroke-width: 1.5; stroke-linecap: round; }
.khatu .k-cover { fill: #f2c94c; stroke: rgb(4 13 63 / 0.22); stroke-width: 1.5; }
.khatu .k-shine { fill: none; stroke: #fbe7a1; stroke-width: 4; stroke-linecap: round; }
.khatu .k-ribbon { fill: #d9534f; }
.khatu .k-cheek { fill: #f08f6f; opacity: 0.45; }
.khatu .k-open { fill: #040d3f; }
.khatu .k-glint { fill: #fff; }
.khatu .k-happy, .khatu .k-shut { fill: none; stroke: #040d3f; stroke-width: 4; stroke-linecap: round; opacity: 0; }
.khatu .k-z { fill: var(--text-2); font: 700 13px var(--font); opacity: 0; }
.khatu .k-z2 { font-size: 10px; }
.khatu .k-spark { fill: #f2c94c; opacity: 0; }
.khatu .k-lid { fill: #f2c94c; opacity: 0; transform: translateY(-5px); }
.khatu .k-body, .khatu .k-eye, .khatu .k-eyes, .khatu .k-z, .khatu .k-spark { transform-box: fill-box; }
.khatu .k-body { transform-origin: 50% 100%; }
.khatu .k-eye, .khatu .k-spark, .khatu .k-z { transform-origin: 50% 50%; }
/* Moving between moods eases instead of snapping (app.js switches them on the live pages). */
.khatu .k-body, .khatu .k-eye, .khatu .k-eyes, .khatu .k-lid, .khatu .k-open, .khatu .k-glint,
.khatu .k-happy, .khatu .k-shut, .khatu .k-cheek {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}
.khatu[data-khatu-react] { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* idle: breathes and blinks twice, then rests */
.khatu-idle .k-body { animation: k-breathe 2.4s ease-in-out 2; }
.khatu-idle .k-eye { animation: k-blink 2.4s ease-in-out 2; }
/* thinking: eyes up in the corner while the answer comes */
.khatu-thinking .k-eyes { transform-box: fill-box; transform: translate(3px, -3px); animation: k-ponder 1.6s ease-in-out 3; }
.khatu-thinking .k-body { animation: k-breathe 1.6s ease-in-out 3; }
/* happy: smiling eyes and one hop */
.khatu-happy .k-open, .khatu-happy .k-glint, .khatu-celebrate .k-open, .khatu-celebrate .k-glint { opacity: 0; }
.khatu-happy .k-happy, .khatu-celebrate .k-happy { opacity: 1; }
.khatu-happy .k-body { animation: k-hop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 1; }
/* celebrate: two hops, a wiggle and three sparkles (they stay lit) */
.khatu-celebrate .k-body { animation: k-cheer 1.4s cubic-bezier(0.16, 1, 0.3, 1) 1; }
.khatu-celebrate .k-spark { opacity: 1; }
.khatu-celebrate .k-spark { animation: k-twinkle 1.4s cubic-bezier(0.16, 1, 0.3, 1) 1 backwards; }
.khatu-celebrate .k-spark2 { animation-delay: 0.15s; }
.khatu-celebrate .k-spark3 { animation-delay: 0.3s; }
/* sleeping: eyes closed, slow breaths, two z's */
.khatu-sleeping .k-open, .khatu-sleeping .k-glint { opacity: 0; }
.khatu-sleeping .k-shut { opacity: 1; }
.khatu-sleeping .k-body { animation: k-breathe 2.4s ease-in-out 2; }
.khatu-sleeping .k-z { animation: k-float 2.4s ease-out 2; }
.khatu-sleeping .k-z2 { animation-delay: 0.6s; }
/* confused: a tilt, one eye squinted */
.khatu-confused .k-body { transform: rotate(-7deg); }
.khatu-confused .k-eye-r { transform: scale(0.72) translateY(2px); }
.khatu-confused .k-eyes { animation: k-ponder 1.6s ease-in-out 1; }

/* The fuller set (docs/make-your-own-mascot.md: personality from the eyes alone). Each mood is
   a still pose first, so reduced motion still shows the feeling; the
   motion on top plays once or twice and stops. */
/* waking: eyes closed, a stretch, eyes open */
.khatu-waking .k-body { animation: k-stretch 1.2s cubic-bezier(0.16, 1, 0.3, 1) 1; }
.khatu-waking .k-open, .khatu-waking .k-glint { animation: k-eyes-open 1.2s ease 1 backwards; }
.khatu-waking .k-shut { animation: k-eyes-shut 1.2s ease 1; }
/* drowsy: heavy lids, a slow nod */
.khatu-drowsy .k-lid-heavy { opacity: 1; transform: none; }
.khatu-drowsy .k-body { animation: k-nod 2.4s ease-in-out 2; }
/* curious: head tilted, one eye wider, looking over */
.khatu-curious .k-body { transform: rotate(6deg); }
.khatu-curious .k-eyes { transform: translate(3px, -1px); }
.khatu-curious .k-eye-l { transform: scale(1.14); }
/* excited: wide eyes, two quick hops */
.khatu-excited .k-eye { transform: scale(1.16); }
.khatu-excited .k-glint { transform: scale(1.7); transform-box: fill-box; transform-origin: 50% 50%; }
.khatu-excited .k-cheek { opacity: 0.8; }
.khatu-excited .k-body { animation: k-bounce 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1; }
/* proud: smiling eyes, chest out, one twinkle */
.khatu-proud .k-open, .khatu-proud .k-glint { opacity: 0; }
.khatu-proud .k-happy { opacity: 1; }
.khatu-proud .k-body { transform: translateY(-3px) scale(1.03); animation: k-puff 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1; }
.khatu-proud .k-spark3 { opacity: 1; animation: k-twinkle 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s 1 backwards; }
/* surprised: eyes round and wide, a small jolt */
.khatu-surprised .k-eye { transform: scale(1.4, 1.12); }
.khatu-surprised .k-glint { transform: scale(1.3) translate(-1px, 1px); transform-box: fill-box; transform-origin: 50% 50%; }
.khatu-surprised .k-body { animation: k-jolt 0.5s cubic-bezier(0.16, 1, 0.3, 1) 1; }
/* worried: lids slanting down at the outer corners, eyes lowered, a small shrink */
.khatu-worried .k-lid-worry { opacity: 1; transform: none; }
.khatu-worried .k-eyes { transform: translateY(2px); }
.khatu-worried .k-body { transform: scale(0.98); animation: k-fret 1.8s ease-in-out 1; }
/* shy: eyes shut, cheeks warm, tucked away (amounts are hidden) */
.khatu-shy .k-open, .khatu-shy .k-glint { opacity: 0; }
.khatu-shy .k-shut { opacity: 1; }
.khatu-shy .k-cheek { opacity: 0.9; }
.khatu-shy .k-body { transform: rotate(-5deg) translateY(2px); }
/* laughing: smiling eyes, a giggle */
.khatu-laughing .k-open, .khatu-laughing .k-glint { opacity: 0; }
.khatu-laughing .k-happy { opacity: 1; }
.khatu-laughing .k-body { transform: rotate(-3deg); animation: k-giggle 1s ease-in-out 1; }
.khatu-laughing .k-cheek { opacity: 0.85; }
.khatu-laughing .k-eyes { transform: translateY(-1px); }

@keyframes k-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.015, 0.985); } }
@keyframes k-blink { 0%, 44%, 52%, 100% { transform: scaleY(1); } 48% { transform: scaleY(0.1); } }
@keyframes k-ponder { 0%, 100% { transform: translate(0, 0); } 40%, 70% { transform: translate(4px, -4px); } }
@keyframes k-hop { 0% { transform: translateY(0); } 35% { transform: translateY(-9px) scale(1.02, 0.98); } 70% { transform: translateY(0) scale(1.03, 0.97); } 100% { transform: none; } }
@keyframes k-cheer { 0%, 100% { transform: none; } 18% { transform: translateY(-10px) rotate(-4deg); } 36% { transform: translateY(0) rotate(0); } 54% { transform: translateY(-8px) rotate(4deg); } 72% { transform: translateY(0) rotate(0); } }
@keyframes k-float { 0% { opacity: 0; transform: translate(0, 4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -10px); } }
@keyframes k-twinkle { 0% { opacity: 0; transform: scale(0.2) rotate(-30deg); } 45% { opacity: 1; transform: scale(1.2) rotate(8deg); } 100% { opacity: 1; transform: none; } }
@keyframes k-stretch { 0% { transform: scale(1.02, 0.94); } 45% { transform: scale(0.97, 1.06); } 100% { transform: none; } }
@keyframes k-eyes-open { 0%, 45% { opacity: 0; } 70%, 100% { opacity: 1; } }
@keyframes k-eyes-shut { 0%, 45% { opacity: 1; } 70%, 100% { opacity: 0; } }
@keyframes k-nod { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(4deg) translateY(1px); } }
@keyframes k-bounce { 0%, 100% { transform: none; } 25% { transform: translateY(-9px); } 50% { transform: none; } 70% { transform: translateY(-5px); } }
@keyframes k-puff { 0% { transform: none; } 50% { transform: translateY(-5px) scale(1.06); } 100% { transform: translateY(-3px) scale(1.03); } }
@keyframes k-jolt { 0% { transform: none; } 30% { transform: translateY(-7px) scale(0.98, 1.03); } 100% { transform: none; } }
@keyframes k-fret { 0%, 100% { transform: scale(0.98); } 30% { transform: scale(0.98) rotate(-2deg); } 60% { transform: scale(0.98) rotate(2deg); } }
@keyframes k-giggle { 0%, 100% { transform: rotate(-3deg); } 15%, 45%, 75% { transform: rotate(-7deg) translateY(-2px); } 30%, 60%, 90% { transform: rotate(1deg); } }

/* Khatu's note on the dashboard: his mood for the month and the one true thing behind it.
   The bubble's tail points at him; it opens once, after the page settles. */
.khatu-note { display: flex; align-items: center; gap: 4px 14px; max-width: 720px; }
.khatu-note .khatu { width: 64px; margin-bottom: -4px; }
.khatu-says {
  flex: 0 1 auto; min-width: 0; margin: 0; padding: 12px 16px; border-radius: 18px 18px 18px 5px;
  background: var(--surface); box-shadow: var(--shadow-tile); color: var(--text-2);
  font-size: 14px; font-weight: 400; line-height: 1.45; transform-origin: 0 100%;
  animation: khatu-says 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.25s backwards;
}
.khatu-says strong { color: var(--text); font-weight: 600; white-space: nowrap; }
.khatu-says a { font-weight: 600; white-space: nowrap; }
.khatu-dismiss { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--text-3); cursor: pointer; }
.khatu-dismiss:hover { background: var(--card-hover); color: var(--text); }
@keyframes khatu-says { from { opacity: 0; transform: translateX(-6px) scale(0.94); } }
@media (max-width: 560px) {
  .khatu-note { gap: 10px; }
  .khatu-note .khatu { width: 52px; }
  .khatu-says { padding: 10px 14px; font-size: 13.5px; }
  .khatu-dismiss { width: 40px; height: 40px; margin-right: -8px; }
}

/* Khatu on the landing page's product shot, sitting on the dashboard card's top edge. */
.sc-khatu { position: absolute; z-index: 3; top: 4px; left: calc(50% + 64px); width: 88px; }
.sc-khatu .khatu { width: 100%; }
/* Phones: the top is taken by the bank card and the SMS, so he hangs off the bottom edge. */
@media (max-width: 560px) {
  .sc-khatu { width: 64px; top: auto; bottom: -46px; left: 6px; }
  .showcase { margin-bottom: 30px; }
}

/* The product tour (Driver.js, static/vendor/driver): its popover in Khata's own surface, type
   and buttons, with Khatu beside each title. These override driver.css by specificity. */
.driver-popover.khata-tour {
  min-width: min(300px, calc(100vw - 32px)); max-width: min(360px, calc(100vw - 32px));
  padding: 18px 18px 16px; border-radius: var(--r-lg);
  background: var(--surface); color: var(--text); font-family: var(--font);
  box-shadow: var(--shadow-modal), 0 0 0 1px var(--line-strong);
}
.khata-tour-head { display: flex; align-items: center; gap: 12px; margin: 0 28px 8px 0; }
.khata-tour-head .khatu { width: 52px; flex: none; }
.khata-tour .driver-popover-title { font-family: var(--font); font-size: 17px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--text); }
.khata-tour .driver-popover-description { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text-2); }
.khata-tour .driver-popover-footer { margin-top: 16px; gap: 10px; }
.khata-tour .driver-popover-progress-text { font-family: var(--font); font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.khata-tour .driver-popover-navigation-btns { gap: 8px; }
.khata-tour .driver-popover-navigation-btns button + button { margin-left: 0; }
.khata-tour .driver-popover-footer-btn {
  display: inline-flex; align-items: center; min-height: 38px; padding: 8px 16px; border-radius: var(--r-full);
  border: 1px solid var(--btn-line); background: transparent; color: var(--text);
  font: 600 13px var(--font); text-shadow: none; cursor: pointer;
}
.khata-tour .driver-popover-footer-btn:hover, .khata-tour .driver-popover-footer-btn:focus-visible { background: var(--card-hover); }
.khata-tour .driver-popover-footer-btn:focus-visible { outline: 2px solid var(--info-2); outline-offset: 2px; }
.khata-tour .driver-popover-next-btn { background: var(--text); border-color: var(--text); color: var(--page); }
.khata-tour .driver-popover-next-btn:hover, .khata-tour .driver-popover-next-btn:focus-visible { background: var(--neutral-4); border-color: var(--neutral-4); color: var(--page); }
.khata-tour .driver-popover-close-btn { top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; color: var(--text-3); font-size: 20px; line-height: 32px; }
.khata-tour .driver-popover-close-btn:hover, .khata-tour .driver-popover-close-btn:focus-visible { color: var(--text); background: var(--card-hover); }
.khata-tour .driver-popover-arrow-side-left { border-left-color: var(--surface); }
.khata-tour .driver-popover-arrow-side-right { border-right-color: var(--surface); }
.khata-tour .driver-popover-arrow-side-top { border-top-color: var(--surface); }
.khata-tour .driver-popover-arrow-side-bottom { border-bottom-color: var(--surface); }
@media (max-width: 560px) {
  .driver-popover.khata-tour { padding: 16px 16px 14px; }
  .khata-tour-head .khatu { width: 46px; }
  .khata-tour .driver-popover-footer-btn { min-height: 44px; padding: 10px 16px; }
  .khata-tour .driver-popover-close-btn { width: 40px; height: 40px; line-height: 40px; top: 6px; right: 6px; }
}

/* ---- Ask Khatu --------------------------------------------------------------------- */
.ask { display: grid; gap: 18px; padding: 20px; }
/* Khatu's face sits in a fixed column, so every reply lines up under the first one (voice.js gives
   each spoken reply its own face). */
.ask-log { display: grid; gap: 14px; --ask-face: 64px; }
.ask-row { display: grid; grid-template-columns: var(--ask-face) minmax(0, 1fr); gap: 14px; align-items: end; }
.ask-row .khatu { width: var(--ask-face); }
.ask-from-khatu > .ask-bubble { grid-column: 2; justify-self: start; }
.ask-from-you { grid-template-columns: minmax(0, 1fr); justify-items: end; padding-left: calc(var(--ask-face) + 14px); }
.ask-bubble { min-width: 0; max-width: 62ch; padding: 14px 16px; border-radius: 18px 18px 18px 6px; background: var(--card); line-height: 1.55; font-weight: 400; overflow-wrap: anywhere; }
.ask-bubble p + p, .ask-bubble p + ul, .ask-bubble ul + p { margin-top: 8px; }
.ask-bubble ul { margin: 6px 0 0; padding-left: 18px; }
.ask-bubble li + li { margin-top: 4px; }
.ask-from-you .ask-bubble { border-radius: 18px 18px 6px 18px; background: var(--text); color: var(--page); font-weight: 500; }
.ask-asked { color: var(--text-2); font-size: 12.5px; }
.ask-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.ask-form textarea { min-height: 52px; resize: vertical; }
.ask-suggestions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ask-suggestions .label { width: 100%; margin: 0; }
.ask-chip { min-height: 36px; padding: 6px 14px; border: 1px solid var(--btn-line); border-radius: var(--r-full); background: transparent; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.ask-chip:hover { background: var(--card); color: var(--text); }
.ask-privacy { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.ask-privacy .ico { flex: none; margin-top: 2px; }
@media (max-width: 560px) { .ask-form { grid-template-columns: 1fr; } .ask-log { --ask-face: 44px; } .ask-row { gap: 10px; } }
/* Talk to Khatu: the mic button grows a marigold ring with your voice (--voice-level, set by
   voice.js) and the line beside it says who's talking. Transform and opacity only. */
.voice { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 14px; border-radius: var(--r-lg); background: var(--card); }
.voice-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px 0 16px; border: 0; border-radius: var(--r-full); background: var(--text); color: var(--page); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; isolation: isolate; }
.voice-btn:focus-visible { outline: 2px solid var(--info-2); outline-offset: 3px; }
.voice-btn .ico { width: 20px; height: 20px; }
.voice-ring { position: absolute; inset: -4px; z-index: -1; border-radius: inherit; background: var(--marigold); opacity: 0; transform: scale(calc(1 + var(--voice-level, 0) * 0.18)); transition: transform 0.08s linear, opacity 0.2s ease; }
.voice:not([data-state="idle"]) .voice-ring { opacity: 0.55; }
.voice[data-state="speaking"] .voice-ring { animation: voice-breathe 1.4s ease-in-out infinite; }
.voice[data-state="connecting"] .voice-ring, .voice[data-state="thinking"] .voice-ring { opacity: 0.3; }
.voice:not([data-state="idle"]) .voice-btn { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
@keyframes voice-breathe { 50% { transform: scale(1.08); opacity: 0.35; } }
.voice-status { flex: 1 1 220px; margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.voice[data-state="you"] .voice-status, .voice[data-state="speaking"] .voice-status { color: var(--text); font-weight: 500; }
/* What happened to an entry said out loud (sent by Khata, not the model). */
.ask-entry { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; justify-self: center; max-width: 62ch; padding: 10px 14px; border-radius: var(--r); border: 1px dashed var(--btn-line); color: var(--text-2); font-size: 13.5px; }
.ask-entry-saved { border-style: solid; border-color: color-mix(in srgb, var(--pos) 55%, transparent); background: var(--ok-soft); color: var(--text); }
.ask-entry a { font-weight: 600; }

/* Phones and tablets. Fields at 16px: anything smaller makes iOS Safari zoom the page on focus.
   Coarse pointers include landscape tablets wider than the phone navigation breakpoint.
   Tap targets at 44px; the toast's × keeps its look and gets a larger invisible hit area. */
@media (max-width: 960px), (any-pointer: coarse) {
  input:not([type="checkbox"], [type="radio"], [type="color"], [type="file"]), select, textarea,
  textarea.sms, .picker-panel input.picker-search, input[type="file"] { font-size: 16px; }
  .btn, .btn-sm { min-width: 44px; max-width: 100%; min-height: 44px; white-space: normal; text-align: center; }
  .btn-icon { width: 44px; min-height: 44px; }
  .tabs a, .platform-switch label, .picker-list li, .picker-panel input.picker-search,
  .usermenu-panel a, .usermenu-panel button, .ask-chip, .check { min-height: 44px; }
  .card-head a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }
  .field-password input { padding-right: 52px; }
  .btn-toggle-pw { right: 2px; width: 44px; height: 44px; min-width: 44px; }
  .khatu-dismiss { width: 44px; height: 44px; }
  .month-step { width: 44px; height: 44px; }
  .toast-close { position: relative; }
  .toast-close::after { content: ""; position: absolute; inset: -8px; }
}
@media (max-width: 960px) {
  .month-switch { display: flex; flex-wrap: wrap; width: 100%; }
  /* Keep both arrows and the month readable; "This month" moves below when space runs out. */
  .month-nav { flex: 1 1 264px; min-width: min(264px, 100%); }
  .month-now { flex: none; }
  /* Ledger and Reports put the switcher in a row with buttons: that row spans the screen too. */
  .page-head > .row:has(.month-switch) { width: 100%; }
  .acct-value > span { white-space: normal; }
  .usermenu-panel {
    max-width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-height: calc(100dvh - var(--appbar-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px);
    overflow-y: auto; overscroll-behavior: contain;
  }
}
@media (max-width: 560px) {
  .map-grid { grid-template-columns: minmax(0, 1fr); }
  .alias-row, .share-row { grid-template-columns: minmax(0, 1fr); }
  .khatu-says a { white-space: normal; }
  .ask-from-you { padding-left: calc(var(--ask-face) + 10px); }
}
@media (max-width: 420px) {
  /* Amounts get their own line so names, banks and categories do not collapse beside them. */
  .ledger-row, .check-row { grid-template-columns: 32px minmax(0, 1fr); }
  .ledger-row > .amount, .check-row > .amount { grid-column: 2; justify-self: start; text-align: left; white-space: normal; }
  .ledger-row > .dir, .check-row > .dir { grid-row: 1 / span 2; }
  .split-row { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- Utilities ------------------------------------------------------------------
   One-off layout tweaks that used to be style="…" attributes. The CSP allows no inline
   styles, so they live here; !important keeps the precedence an inline style had.
   Values computed at render time use css(…) in templates instead (app/web/page_css.py). */
.u-bt-line { border-top: 1px solid var(--line) !important; }
.u-c-ink-2 { color: var(--ink-2) !important; }
.u-c-text { color: var(--text) !important; }
.u-col-full { grid-column: 1 / -1 !important; }
.u-d-block { display: block !important; }
.u-d-grid { display: grid !important; }
.u-d-inline { display: inline !important; }
.u-dot-1ab8c7 { --c: #1ab8c7 !important; }
.u-dot-2d7dd2 { --c: #2d7dd2 !important; }
.u-dot-7fe089 { --c: #7fe089 !important; }
.u-dot-f2c94c { --c: #f2c94c !important; }
.u-flex-0-1-100 { flex: 0 1 100px !important; }
.u-flex-0-1-260 { flex: 0 1 260px !important; }
.u-flex-0-1-300 { flex: 0 1 300px !important; }
.u-flex-1 { flex: 1 !important; }
.u-flex-1-1-150 { flex: 1 1 150px !important; }
.u-flex-1-1-160 { flex: 1 1 160px !important; }
.u-flex-1-1-170 { flex: 1 1 170px !important; }
.u-flex-1-1-260 { flex: 1 1 260px !important; }
.u-flex-2-1-200 { flex: 2 1 200px !important; }
.u-flex-2-1-220 { flex: 2 1 220px !important; }
.u-flex-2-1-240 { flex: 2 1 240px !important; }
.u-fs-30 { font-size: 30px !important; }
.u-gap-10 { gap: 10px !important; }
.u-gap-12 { gap: 12px !important; }
.u-gap-14 { gap: 14px !important; }
.u-gap-16 { gap: 16px !important; }
.u-gap-18 { gap: 18px !important; }
.u-gap-22 { gap: 22px !important; }
.u-gap-28 { gap: 28px !important; }
.u-gap-6 { gap: 6px !important; }
.u-gap-8 { gap: 8px !important; }
.u-gap-8-16 { gap: 8px 16px !important; }
.u-items-center { align-items: center !important; }
.u-items-end { align-items: flex-end !important; }
.u-jitems-center { justify-items: center !important; }
.u-jself-start { justify-self: start !important; }
.u-justify-between { justify-content: space-between !important; }
.u-justify-center { justify-content: center !important; }
.u-justify-end { justify-content: flex-end !important; }
.u-m-0 { margin: 0 !important; }
.u-m-0-n20 { margin: 0 -20px !important; }
.u-m-6-0-0 { margin: 6px 0 0 !important; }
.u-maxw-220 { max-width: 220px !important; }
.u-maxw-260 { max-width: 260px !important; }
.u-maxw-360 { max-width: 360px !important; }
.u-maxw-620 { max-width: 620px !important; }
.u-mb-4 { margin-bottom: 4px !important; }
.u-mb-8 { margin-bottom: 8px !important; }
.u-minh-80 { min-height: 80px !important; }
.u-mt-10 { margin-top: 10px !important; }
.u-mt-12 { margin-top: 12px !important; }
.u-mt-14 { margin-top: 14px !important; }
.u-mt-4 { margin-top: 4px !important; }
.u-mt-6 { margin-top: 6px !important; }
.u-mt-8 { margin-top: 8px !important; }
.u-p-0 { padding: 0 !important; }
.u-p-0-20-12 { padding: 0 20px 12px !important; }
.u-p-8-0-0 { padding: 8px 0 0 !important; }
.u-pb-0 { padding-bottom: 0 !important; }
.u-pl-18 { padding-left: 18px !important; }
.u-pl-36 { padding-left: 36px !important; }
.u-pos-relative { position: relative !important; }
.u-pt-12 { padding-top: 12px !important; }
.u-pt-16 { padding-top: 16px !important; }
.u-w-160 { width: 160px !important; }
.u-w-200 { width: 200px !important; }

/* Amount privacy: the amt() macro renders the digits and a mask side by side; html.privacy-masked
   shows the mask instead. Both inherit the figure's font, so "NPR" and the dots keep the same size,
   weight and baseline as the real amount. */
.privacy-amount { white-space: nowrap; }
.privacy-amount .amt-mask { display: none; }
html.privacy-masked .privacy-amount .amt-real { display: none; }
html.privacy-masked .privacy-amount .amt-mask { display: inline; letter-spacing: 0.06em; user-select: none; }
/* One account on the Accounts page (.privacy-scope) can differ from the rest: .is-masked hides
   just that one, .is-shown keeps it visible while everything else is hidden. Until app.js has
   read which cards someone hid (privacy-cards-pending, set by theme.js), every card stays masked. */
html.privacy-cards-pending .privacy-scope .amt-real,
.privacy-scope.is-masked .amt-real { display: none; }
html.privacy-cards-pending .privacy-scope .amt-mask,
.privacy-scope.is-masked .amt-mask { display: inline; letter-spacing: 0.06em; user-select: none; }
html.privacy-masked .privacy-scope.is-shown .amt-real { display: inline; }
html.privacy-masked .privacy-scope.is-shown .amt-mask { display: none; }

/* Subtle chart blur on Accounts page when privacy is masked */
html.privacy-masked .acct-panel .chart-scroll,
.acct-panel.is-masked .chart-scroll {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
  opacity: 0.55;
  transition: filter 0.2s ease, opacity 0.2s ease;
}
html.privacy-masked .acct-panel.is-shown .chart-scroll { filter: none; user-select: auto; pointer-events: auto; opacity: 1; }

/* Privacy toggle buttons */
.btn-privacy-toggle:not(.btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  border-radius: var(--r-full);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
  user-select: none;
}
.btn-privacy-toggle:not(.btn):hover {
  background: var(--card);
  color: var(--text);
}
.btn-privacy-toggle:focus-visible {
  outline: 2px solid var(--marigold);
  outline-offset: 1px;
}
.btn-privacy-toggle:not(.btn):active {
  transform: scale(0.95);
}

.btn-privacy-toggle .ico-privacy-hide { display: none; }
.btn-privacy-toggle .ico-privacy-show { display: inline-block; }

html.privacy-masked .btn-privacy-toggle .ico-privacy-show { display: none; }
html.privacy-masked .btn-privacy-toggle .ico-privacy-hide { display: inline-block; }
.privacy-scope.is-masked .ico-privacy-show { display: none; }
.privacy-scope.is-masked .ico-privacy-hide { display: inline-block; }
html.privacy-masked .privacy-scope.is-shown .ico-privacy-show { display: inline-block; }
html.privacy-masked .privacy-scope.is-shown .ico-privacy-hide { display: none; }

.privacy-label-show { display: inline; }
.privacy-label-hide { display: none; }
html.privacy-masked .privacy-label-show { display: none; }
html.privacy-masked .privacy-label-hide { display: inline; }

/* Dashboard balance card eyebrow row */
.balance-eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.balance-eyebrow-row .eyebrow {
  margin: 0;
}
.balance-privacy-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: var(--r-full);
  color: var(--text-2);
  opacity: 0.75;
}
.balance-privacy-btn:hover {
  opacity: 1;
  color: var(--text);
  background: var(--surface);
}

/* Account card header right side & privacy button */
.acct-top-aside {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.acct-card-privacy-btn {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-full);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.15);
  color: rgba(255, 255, 255, 0.85);
  padding: 0;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.acct-card-privacy-btn:hover {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}
.acct-card-privacy-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

/* Page head actions container */
.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Touch screens: the 24px eye buttons and the 17px "Change" / "Show as a list" toggles get a
   finger-sized tap area without moving anything (padding paid back with negative margin). */
@media (any-pointer: coarse) {
  .balance-privacy-btn, .acct-card-privacy-btn { position: relative; flex: none; }
  .balance-privacy-btn::after, .acct-card-privacy-btn::after { content: ""; position: absolute; inset: -10px; border-radius: inherit; }
  .budget-edit summary { margin: -2px 0 -10px; padding: 10px 0; }
  .chart-table summary { margin: 0 0 -10px; padding: 10px 0; }
  .fix summary { margin: -10px 0; padding: 10px 0; }
}
