/* BillGem
   Idea: a warm home at night. Deep plum and violet, an ember-orange glow, glassy cards that float and lean
   toward the pointer, and real 3D where it means something (the spending city, coin stacks, extruded charts).
   Light theme: lavender morning with the same ember. Category colours are the same everywhere. */

@font-face {
  font-family: "Public Sans";
  src: url("/fonts/public-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-024F, U+2000-206F, U+20A0-20CF;
}

/* ---------- tokens ---------- */

:root {
  color-scheme: light;
  --bg: #f5f2ff;
  --bg-2: #fff7f1;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-2: #f4f1fd;
  --line: rgba(76, 29, 149, 0.1);
  --line-strong: rgba(76, 29, 149, 0.2);
  --text: #1c1533;
  --text-2: #5b5378;
  --text-3: #8a83a6;
  --accent: #7c3aed;
  --accent-2: #a855f7;
  --accent-ink: #5b21b6;
  --accent-tint: #ede9fe;
  --ember: #ff6a3d;
  --ember-2: #ffb347;
  --on-accent: #fff;
  --good: #16a34a;
  --good-bg: #dcfce7;
  --warn: #d97706;
  --warn-bg: #fef3c7;
  --bad: #e11d48;
  --bad-bg: #ffe4e6;
  --bar: #c4b5fd;
  --empty-ring: #e9e5f7;
  --shadow-1: 0 1px 2px rgba(45, 20, 110, 0.06), 0 4px 12px rgba(45, 20, 110, 0.06);
  --shadow-2: 0 2px 4px rgba(45, 20, 110, 0.05), 0 12px 32px -6px rgba(45, 20, 110, 0.18), 0 32px 64px -24px rgba(45, 20, 110, 0.22);
  --glow: 0 0 0 1px rgba(124, 58, 237, 0.08), 0 20px 60px -20px rgba(255, 106, 61, 0.45);
  --side-bg: linear-gradient(180deg, #2a1b5e 0%, #1b1436 100%);
  --radius: 22px;
  --radius-sm: 14px;
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans Telugu", "Telugu Sangam MN", "Noto Sans Devanagari", "PingFang SC", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #110b22;
    --bg-2: #1a0f1f;
    --surface: rgba(32, 24, 62, 0.78);
    --surface-solid: #1e1739;
    --surface-2: #261d48;
    --line: rgba(196, 181, 253, 0.12);
    --line-strong: rgba(196, 181, 253, 0.24);
    --text: #f3efff;
    --text-2: #c2b9e3;
    --text-3: #8f86b3;
    --accent: #a78bfa;
    --accent-2: #c084fc;
    --accent-ink: #ddd6fe;
    --accent-tint: rgba(167, 139, 250, 0.16);
    --on-accent: #160f2e;
    --good: #4ade80;
    --good-bg: rgba(74, 222, 128, 0.14);
    --warn: #fbbf24;
    --warn-bg: rgba(251, 191, 36, 0.14);
    --bad: #fb7185;
    --bad-bg: rgba(251, 113, 133, 0.15);
    --bar: #4c3a8f;
    --empty-ring: #2c2352;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.3), 0 16px 40px -8px rgba(0, 0, 0, 0.55), 0 40px 80px -30px rgba(76, 29, 149, 0.6);
    --glow: 0 0 0 1px rgba(167, 139, 250, 0.16), 0 24px 70px -18px rgba(255, 106, 61, 0.4);
    --side-bg: linear-gradient(180deg, #1d1342 0%, #0d081b 100%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #110b22;
  --bg-2: #1a0f1f;
  --surface: rgba(32, 24, 62, 0.78);
  --surface-solid: #1e1739;
  --surface-2: #261d48;
  --line: rgba(196, 181, 253, 0.12);
  --line-strong: rgba(196, 181, 253, 0.24);
  --text: #f3efff;
  --text-2: #c2b9e3;
  --text-3: #8f86b3;
  --accent: #a78bfa;
  --accent-2: #c084fc;
  --accent-ink: #ddd6fe;
  --accent-tint: rgba(167, 139, 250, 0.16);
  --on-accent: #160f2e;
  --good: #4ade80;
  --good-bg: rgba(74, 222, 128, 0.14);
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.14);
  --bad: #fb7185;
  --bad-bg: rgba(251, 113, 133, 0.15);
  --bar: #4c3a8f;
  --empty-ring: #2c2352;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.3), 0 16px 40px -8px rgba(0, 0, 0, 0.55), 0 40px 80px -30px rgba(76, 29, 149, 0.6);
  --glow: 0 0 0 1px rgba(167, 139, 250, 0.16), 0 24px 70px -18px rgba(255, 106, 61, 0.4);
  --side-bg: linear-gradient(180deg, #1d1342 0%, #0d081b 100%);
}

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

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(255, 106, 61, 0.16), transparent 60%),
    radial-gradient(800px 700px at -10% 20%, rgba(124, 58, 237, 0.16), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  min-height: 100vh;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 750; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 0.6em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--text-2); }
.small { font-size: 0.85rem; }
.grow { flex: 1; }
.center { justify-content: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface-solid); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.noscript { padding: 24px; text-align: center; }
[hidden] { display: none !important; }

/* boot */
.boot { display: grid; place-items: center; min-height: 100vh; }
.boot-flame { width: 46px; height: 60px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; background: linear-gradient(0deg, var(--ember), var(--ember-2), #ffe29a); animation: flicker 1.2s ease-in-out infinite alternate; filter: drop-shadow(0 0 24px rgba(255, 106, 61, 0.6)); }
@keyframes flicker { from { transform: scale(1) rotate(-3deg); } to { transform: scale(1.08, 0.94) rotate(3deg); } }

/* ---------- layout ---------- */

.layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side-bg); color: #ece7ff; padding: 22px 14px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 850; font-size: 1.35rem; padding: 4px 10px 2px; text-decoration: none !important; }
.brand img { filter: drop-shadow(0 6px 16px rgba(255, 106, 61, 0.45)); }
.side-household { margin: 0 10px 14px; font-size: 0.85rem; color: #b9addf; }
.side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #d8d0f7; font-weight: 600; text-decoration: none !important; transition: background 0.15s, transform 0.15s; }
.nav-link:hover { background: rgba(255, 255, 255, 0.07); transform: translateX(2px); }
.nav-link.active { background: linear-gradient(90deg, rgba(167, 139, 250, 0.3), rgba(167, 139, 250, 0.08)); color: #fff; box-shadow: inset 3px 0 0 #ffb347; }
.nav-link.primary { background: linear-gradient(135deg, var(--ember), #ff8a4c); color: #fff; margin: 4px 0; box-shadow: 0 10px 24px -10px rgba(255, 106, 61, 0.8); }
.nav-link.primary:hover { transform: translateY(-1px); }
.nav-link.voice { background: linear-gradient(135deg, #8b5cf6, #5b21b6); color: #fff; margin: 4px 0; box-shadow: 0 10px 24px -10px rgba(91, 33, 182, 0.8); }
.nav-link.voice:hover { transform: translateY(-1px); }
.nav-ic { width: 24px; text-align: center; font-size: 1.1rem; }
.side-foot { margin-top: auto; padding: 12px 4px 4px; display: grid; gap: 6px; font-size: 0.85rem; color: #b9addf; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.side-who { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 12px; background: transparent; color: #fff; text-align: left; cursor: pointer; font: inherit; }
.side-who:hover { background: rgba(255, 255, 255, 0.08); }
.side-who .grow { display: grid; min-width: 0; }
.side-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-who small { color: #b9addf; }
.side-signout { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 12px; background: rgba(255, 255, 255, 0.06); color: #fecaca; font: inherit; font-weight: 700; cursor: pointer; }
.side-signout:hover { background: rgba(239, 68, 68, 0.22); color: #fff; }
/* Account: initial in a circle, top right on every screen. */
.acct-btn .avatar, .side-who .avatar { width: 34px; height: 34px; font-size: 0.95rem; }
.avatar.avatar-lg { width: 56px; height: 56px; font-size: 1.5rem; }
.acct-btn { padding: 2px; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; transition: border-color 0.15s; }
.acct-btn:hover, .acct-btn:focus-visible { border-color: var(--accent); }
.acct-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.acct-head h2 { margin: 0; text-align: left; }
.acct-head p { margin: 2px 0 0; }
.acct-actions { display: grid; gap: 10px; min-width: min(320px, 80vw); }
.btn.btn-signout { background: color-mix(in srgb, var(--bad) 12%, var(--surface-solid)); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.more-signout { margin-top: 12px; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 12px 28px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 70%, transparent); border-bottom: 1px solid var(--line); }
.brand-mini { display: none; align-items: center; gap: 8px; font-weight: 850; color: var(--text); }
.top-spacer { flex: 1; }
.offline-pill { background: var(--warn-bg); color: var(--warn); padding: 4px 10px; border-radius: 99px; font-size: 0.8rem; font-weight: 700; }
select.lang-select { width: auto; min-height: 38px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 99px; padding: 6px 12px; }
.icon-btn { display: inline-grid; place-items: center; min-width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; position: relative; color: var(--text); text-decoration: none !important; font-size: 1.05rem; transition: transform 0.15s, box-shadow 0.15s; }
.icon-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.icon-btn.ghost { visibility: hidden; }
.icon-btn.danger { color: var(--bad); }
.badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--ember); color: #fff; font-size: 0.7rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }

main { padding: 26px 28px 60px; outline: none; }
main.enter > * { animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.99); } to { opacity: 1; transform: none; } }
.page { max-width: 1180px; margin: 0 auto; display: grid; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head p { margin: 0; }

.tabbar { display: none; }

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: grid;
  gap: 12px;
  align-content: start;
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}
.card-lite { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-1); }
.glass { background: linear-gradient(145deg, color-mix(in srgb, var(--surface-solid) 82%, transparent), color-mix(in srgb, var(--surface-solid) 60%, transparent)); }
.glow { box-shadow: var(--shadow-2), var(--glow); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); display: grid; gap: 12px; justify-items: center; }
.stack { display: grid; gap: 20px; align-content: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1fr; gap: 14px; }
.row-gap { display: flex; gap: 10px; align-items: center; }
.row-gap.wrap { flex-wrap: wrap; }

/* lean toward the pointer */
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.25s ease-out, box-shadow 0.25s; transform-style: preserve-3d; position: relative; }
.tilt::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.16), transparent 45%); opacity: 0; transition: opacity 0.3s; }
.tilt:hover::after { opacity: 1; }

.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.74rem; font-weight: 750; color: var(--text-3); margin-bottom: 6px; }
.lead { font-size: 1.05rem; color: var(--text-2); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 99px; font-size: 0.82rem; font-weight: 650; background: var(--accent-tint); color: var(--accent-ink); border: 1px solid transparent; white-space: nowrap; }
.chip-up { background: var(--bad-bg); color: var(--bad); }
.chip-down { background: var(--good-bg); color: var(--good); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-btn { cursor: pointer; border-color: var(--line-strong); background: var(--surface); color: var(--text); }
.chip-btn:hover { border-color: var(--accent); }
.tag-want { margin-left: 6px; font-size: 0.68rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ember); background: rgba(255, 106, 61, 0.12); padding: 2px 6px; border-radius: 6px; }
.banner { padding: 12px 16px; border-radius: var(--radius-sm); }
.banner-warn { background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 650; }
.ok-text { color: var(--good); font-weight: 650; }

/* ---------- buttons & forms ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface-solid); color: var(--text); font-weight: 680; cursor: pointer; text-decoration: none !important; transition: transform 0.12s, box-shadow 0.15s, background 0.15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #6d28d9 60%, #4c1d95); color: #fff; border-color: transparent; box-shadow: 0 10px 24px -10px rgba(124, 58, 237, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
:root[data-theme="dark"] .btn-primary { color: #fff; }
.btn-primary:hover { box-shadow: 0 14px 30px -10px rgba(124, 58, 237, 1), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-ghost { background: transparent; border-style: dashed; }
.btn-danger { background: var(--bad); color: #fff; border-color: transparent; }
.btn-danger-ghost { background: transparent; color: var(--bad); border-color: transparent; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; border-radius: 10px; }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; border-radius: 16px; }
.btn-block { width: 100%; }
.only-touch { display: none; }
@media (pointer: coarse) { .only-touch { display: inline-flex; } }

.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field label, .field .label { font-weight: 650; font-size: 0.88rem; color: var(--text-2); }
.hint { margin: 0; font-size: 0.8rem; color: var(--text-3); }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-solid); min-height: 44px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
input:disabled, select:disabled { opacity: 0.75; }
.form-error { color: var(--bad); background: var(--bad-bg); padding: 10px 12px; border-radius: 10px; margin: 0; font-weight: 600; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 6px; }

input[type="range"] { width: 100%; accent-color: var(--c, var(--accent)); }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 650; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 48px; height: 28px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background 0.2s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--accent-2); outline-offset: 2px; }

.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg-btn { flex: 1; border: 0; background: transparent; padding: 9px 8px; border-radius: 10px; font-weight: 650; cursor: pointer; color: var(--text-2); }
.seg-btn.on { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- auth ---------- */

.auth-main { padding: 0; }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 24px; padding: 32px clamp(16px, 4vw, 64px); max-width: 1240px; margin: 0 auto; }
.auth-card { max-width: 480px; width: 100%; justify-self: center; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-big { display: flex; align-items: center; gap: 10px; font-size: 1.6rem; font-weight: 850; }
.auth-form { display: grid; gap: 14px; }
.auth-points { list-style: none; padding: 14px 0 0; margin: 0; display: grid; gap: 8px; color: var(--text-2); font-size: 0.9rem; border-top: 1px solid var(--line); }
.auth-hero { position: relative; height: min(70vh, 560px); display: grid; place-items: center; perspective: 1000px; }
.hero-house { position: relative; width: 220px; height: 220px; transform-style: preserve-3d; animation: houseFloat 7s ease-in-out infinite; }
@keyframes houseFloat { 0%, 100% { transform: rotateX(14deg) rotateY(-22deg) translateY(0); } 50% { transform: rotateX(10deg) rotateY(18deg) translateY(-14px); } }
.hh-roof { position: absolute; left: 10px; right: 10px; top: 0; height: 100px; background: linear-gradient(135deg, #a78bfa, #6d28d9); clip-path: polygon(50% 0, 100% 100%, 0 100%); transform: translateZ(30px); filter: drop-shadow(0 18px 24px rgba(76, 29, 149, 0.45)); }
.hh-body { position: absolute; left: 30px; right: 30px; top: 96px; bottom: 0; border-radius: 0 0 24px 24px; background: linear-gradient(160deg, #4c1d95, #2a1660); transform: translateZ(30px); box-shadow: 0 40px 60px -20px rgba(42, 22, 96, 0.7); display: grid; place-items: center; }
.hh-body::before { content: ""; position: absolute; inset: 0; border-radius: inherit; transform: translateZ(-60px); background: #1b1036; }
.hh-flame { width: 64px; height: 60px; clip-path: polygon(22% 0, 78% 0, 100% 34%, 50% 100%, 0 34%); background: linear-gradient(160deg, #ffe29a, var(--ember-2) 45%, var(--ember)); filter: drop-shadow(0 0 22px rgba(255, 138, 76, 0.7)); animation: flicker 1.4s ease-in-out infinite alternate; transform: translateZ(20px); } /* the gem */
.hero-orbit { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.orb { position: absolute; width: 58px; height: 58px; display: grid; place-items: center; font-size: 1.7rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); animation: orbit 18s linear infinite; animation-delay: calc(var(--i) * -3s); }
@keyframes orbit { from { transform: rotate(0deg) translateX(clamp(150px, 17vw, 220px)) rotate(0deg); } to { transform: rotate(360deg) translateX(clamp(150px, 17vw, 220px)) rotate(-360deg); } }

/* ---------- dashboard ---------- */

.hero-card { position: relative; overflow: hidden; background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 45%, #c2410c 120%); color: #fff; border: 0; display: grid; gap: 14px; }
.hero-card::before { content: ""; position: absolute; width: 380px; height: 380px; right: -120px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 179, 71, 0.55), transparent 65%); pointer-events: none; }
.hero-card .eyebrow { color: rgba(255, 255, 255, 0.75); }
.hero-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; position: relative; }
.hero-amount { display: block; font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; text-shadow: 0 8px 30px rgba(0, 0, 0, 0.25); }
.hero-card .month-nav strong { color: #fff; }
.hero-card .icon-btn { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.hero-card .chip { background: rgba(255, 255, 255, 0.16); color: #fff; }
.hero-card .chip-up { background: rgba(255, 228, 230, 0.95); color: #be123c; }
.hero-card .chip-down { background: rgba(220, 252, 231, 0.95); color: #15803d; }
.hero-card .link-cta { color: #ffe29a; font-weight: 700; position: relative; }
.hero-card .target-track { background: rgba(255, 255, 255, 0.2); }
.hero-card .target-text { color: rgba(255, 255, 255, 0.9); }
.spark { width: 100%; height: 56px; display: block; position: relative; }
.spark-fill { fill: rgba(255, 255, 255, 0.14); }
.spark-line { fill: none; stroke: #ffe29a; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.month-nav { display: inline-flex; align-items: center; gap: 10px; }
.month-nav strong { min-width: 9ch; text-align: center; }

.target { display: grid; gap: 6px; position: relative; }
.target-track { height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.target-fill { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, #34d399, #22c55e); transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: 0 0 16px rgba(34, 197, 94, 0.5); }
.target-near .target-fill { background: linear-gradient(90deg, #fbbf24, #f97316); box-shadow: 0 0 16px rgba(249, 115, 22, 0.5); }
.target-over .target-fill { background: linear-gradient(90deg, #f97316, #e11d48); box-shadow: 0 0 16px rgba(225, 29, 72, 0.6); }
.target-text { margin: 0; font-weight: 650; font-size: 0.9rem; }

.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.quick-tile { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); color: var(--text); font-weight: 700; text-decoration: none !important; }
.quick-tile:hover { box-shadow: var(--shadow-2); }
.qt-ic { width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.4rem; border-radius: 14px; background: linear-gradient(145deg, var(--accent-tint), transparent); box-shadow: inset 0 0 0 1px var(--line); transform: translateZ(24px); }

.city-card { padding-bottom: 14px; }
.city-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: center; }
.city { position: relative; height: 380px; border-radius: 18px; background: radial-gradient(ellipse at 50% 70%, rgba(124, 58, 237, 0.16), transparent 65%); overflow: hidden; touch-action: pan-y; }
.city-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; cursor: grab; }
.city-labels { position: absolute; inset: 0; pointer-events: none; }
.city-label { position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; background: color-mix(in srgb, var(--surface-solid) 85%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow-1); font-size: 0.75rem; font-weight: 750; color: var(--text); cursor: pointer; white-space: nowrap; will-change: transform; }
.city-label .ic { font-size: 0.9rem; }
.city-tip { position: absolute; left: 12px; bottom: 12px; padding: 8px 12px; border-radius: 12px; background: var(--surface-solid); box-shadow: var(--shadow-2); font-weight: 700; opacity: 0; transform: translateY(6px); transition: 0.2s; pointer-events: none; }
.city-tip.on { opacity: 1; transform: none; }
.city-side { display: grid; gap: 10px; }

.donut-wrap { position: relative; max-width: 300px; margin: 0 auto; width: 100%; }
.donut3d { width: 100%; height: auto; display: block; overflow: visible; }
.donut3d .slice { cursor: pointer; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.2s; }
.donut3d .slice:hover, .donut3d .slice:focus-visible { transform: translate(var(--dx), var(--dy)); filter: brightness(1.12) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25)); outline: none; }
.donut-center { position: absolute; left: 0; right: 0; top: 50%; text-align: center; transform: translateY(-20%); pointer-events: none; display: grid; }
.donut-center strong { font-size: 1.3rem; font-weight: 850; }
.donut-center span { font-size: 0.75rem; color: var(--text-3); }

.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.legend-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.legend-item:hover { background: var(--surface-2); }
.dot { width: 12px; height: 12px; border-radius: 4px; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); flex: none; }
.legend-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-amt { font-weight: 750; font-variant-numeric: tabular-nums; }

.nw-bar { display: flex; height: 22px; border-radius: 99px; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08); }
.nw-needs, .nw-wants { width: var(--w); transition: width 0.8s; }
.nw-needs { background: linear-gradient(180deg, #a78bfa, #7c3aed); }
.nw-wants { background: linear-gradient(180deg, #ffb347, #ff6a3d); }
.nw-legend { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 0.9rem; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.sw-needs { background: #7c3aed; }
.sw-wants { background: var(--ember); }

.bars3d { width: 100%; height: auto; display: block; }
.bars3d .floor { fill: var(--surface-2); }
.bars3d .bar .side { filter: brightness(0.72); }
.bars3d .bar .top { filter: brightness(1.18); }
.bars3d .bar { transform-box: fill-box; transform-origin: bottom; }
.bars3d.grow .bar { animation: barGrow 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes barGrow { from { transform: scaleY(0.02); } to { transform: none; } }
.bars3d .current .front { filter: drop-shadow(0 0 10px rgba(124, 58, 237, 0.6)); }
.bars3d .axis { fill: var(--text-3); font-size: 11px; }
.bars3d .val { fill: var(--text-2); font-size: 10.5px; font-weight: 700; }
.bars3d .target-line { stroke: var(--ember); stroke-width: 2; stroke-dasharray: 6 5; }

.empty-hero { text-align: center; display: grid; justify-items: center; gap: 8px; padding: 48px 24px; }
.empty-art { font-size: 3.4rem; animation: houseFloat 6s ease-in-out infinite; }

/* ---------- heads-up cards ---------- */

.warn-stack, .warn-grid { display: grid; gap: 14px; }
.warn-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.warn-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 12%, var(--surface-solid)), var(--surface-solid) 70%); border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); box-shadow: var(--shadow-1); }
.warn-card.sev-high { box-shadow: var(--shadow-1), 0 0 0 2px color-mix(in srgb, var(--bad) 30%, transparent); }
.warn-art { flex: none; width: 84px; height: 84px; filter: drop-shadow(0 10px 18px rgba(76, 29, 149, 0.22)); transform: translateZ(30px); animation: bob 5s ease-in-out infinite; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
.warn-body h3 { margin-bottom: 4px; }
.warn-body p { margin: 0 0 4px; color: var(--text-2); }
.warn-sev { font-size: 0.72rem !important; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c) !important; }
.sev-high .warn-sev { color: var(--bad) !important; }
.warn-save { color: var(--good) !important; font-weight: 700; }
.good-news { display: flex; gap: 16px; align-items: center; }

/* ---------- scan ---------- */

.scan-page { max-width: 820px; }
.scan-drop { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 34px 24px; border: 2px dashed var(--line-strong); transition: border-color 0.2s, transform 0.2s; }
.scan-drop.over { border-color: var(--accent); transform: scale(1.01); }
.scan-drop.busy { opacity: 0.6; pointer-events: none; }
.scan-art { position: relative; width: 140px; height: 150px; perspective: 600px; margin-bottom: 6px; }
.paper { position: absolute; inset: 0 18px; border-radius: 10px 10px 4px 4px; background: #fff; box-shadow: 0 24px 40px -18px rgba(76, 29, 149, 0.55); transform: rotateX(18deg) rotateZ(-4deg); display: grid; align-content: start; gap: 10px; padding: 18px 14px; }
.paper::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 10px; background: linear-gradient(-45deg, transparent 33%, #fff 33%, #fff 66%, transparent 66%) 0 0 / 12px 10px; }
.paper i { display: block; height: 7px; border-radius: 4px; background: #e9e5f7; }
.paper i:nth-child(1) { width: 60%; background: #c4b5fd; }
.paper i:nth-child(3) { width: 80%; background: #fecaca; }
.paper i:nth-child(4) { width: 50%; background: #bbf7d0; }
.paper i:nth-child(5) { width: 70%; background: #fde68a; }
.beam { position: absolute; left: 6px; right: 6px; height: 3px; top: 10%; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--ember), transparent); box-shadow: 0 0 18px 4px rgba(255, 106, 61, 0.55); animation: scanBeam 2.2s ease-in-out infinite; }
@keyframes scanBeam { 0%, 100% { top: 8%; } 50% { top: 88%; } }
.scan-preview { position: relative; max-width: 360px; margin: 0 auto; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-2); }
.scan-preview img { display: block; width: 100%; }
.pdf-chip { padding: 40px; text-align: center; background: var(--surface-solid); font-weight: 700; }
.scan-status { text-align: center; font-weight: 700; color: var(--accent); min-height: 1.5em; }
.how-steps { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.how-steps li { display: flex; gap: 12px; align-items: center; }
.step-n { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--ember)); }

/* ---------- bill editor ---------- */

.bill-layout { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: 20px; align-items: start; }
.bill-photo { position: sticky; top: 84px; padding: 10px; max-height: calc(100vh - 110px); overflow: auto; }
.bill-photo img { display: block; width: 100%; border-radius: 12px; cursor: zoom-in; }
.bill-photo iframe { width: 100%; height: 70vh; border: 0; border-radius: 12px; background: #fff; }
.bill-form { display: grid; gap: 16px; }
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.items-table { width: 100%; border-collapse: separate; border-spacing: 6px 6px; min-width: 560px; }
.items-table th { text-align: left; font-size: 0.78rem; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0 4px; }
.items-table td:nth-child(1) { width: 40%; }
.items-table td:nth-child(2) { width: 80px; }
.items-table td:nth-child(3) { width: 120px; }
.items-table td:nth-child(5) { width: 40px; }
.items-table input.num { text-align: right; font-variant-numeric: tabular-nums; }
.cat-select { border-left: 6px solid var(--c) !important; }
/* Phones: each item line becomes a small card (name; qty, amount, remove; category) instead of a wide table. */
@media (max-width: 640px) {
  .table-wrap { overflow: visible; margin: 0; }
  .items-table, .items-table tbody { display: block; min-width: 0; }
  .items-table thead { display: none; }
  .items-table tr { display: grid; grid-template-columns: 84px minmax(0, 1fr) 44px; grid-template-areas: "name name name" "qty amt del" "cat cat cat"; gap: 8px 10px; align-items: end; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
  .items-table td { display: block; width: auto !important; padding: 0; min-width: 0; }
  .items-table td:nth-child(1) { grid-area: name; }
  .items-table td:nth-child(2) { grid-area: qty; }
  .items-table td:nth-child(3) { grid-area: amt; }
  .items-table td:nth-child(4) { grid-area: cat; }
  .items-table td:nth-child(5) { grid-area: del; justify-self: end; }
  .items-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); }
  .items-table td input, .items-table td select { width: 100%; }
  .items-table tr.row-problem { background: var(--warn-bg); }
  .items-table tr.row-problem td { background: transparent; }
  .scan-buttons .btn { flex: 1 1 100%; justify-content: center; }
}
/* Safety net: nothing may push the whole page sideways on a phone. */
body { overflow-x: clip; }
.bill-check { font-size: 0.92rem; }
.split-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 30px; }
.split-chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 99px; background: color-mix(in srgb, var(--c) 14%, var(--surface-solid)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); font-size: 0.86rem; animation: rise 0.3s both; }

/* ---------- bills list ---------- */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 14px; }
.search-form { flex: 1; min-width: 200px; }
.toolbar select { width: auto; min-width: 180px; }
.day-group { display: grid; gap: 8px; }
.day-head { font-size: 0.82rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin: 6px 4px 0; }
.bill-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bill-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; color: var(--text); text-decoration: none !important; border-left: 5px solid var(--c); transition: transform 0.15s, box-shadow 0.15s; }
.bill-row:hover { transform: translateX(3px); box-shadow: var(--shadow-2); }
.bill-ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; font-size: 1.3rem; border-radius: 12px; background: color-mix(in srgb, var(--c) 16%, transparent); }
.bill-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.bill-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.mini-chip { font-size: 0.72rem; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--text); }
.bill-right { display: grid; justify-items: end; gap: 2px; font-variant-numeric: tabular-nums; }

/* ---------- targets ---------- */

.target-hero { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.ring-placeholder { width: 120px; height: 120px; display: grid; place-items: center; font-size: 3rem; border-radius: 50%; background: var(--surface-2); }
.ring { flex: none; }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 7; }
.ring-fg { fill: none; stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray 0.8s; stroke: #22c55e; filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.5)); }
.ring-near .ring-fg { stroke: #f59e0b; filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.6)); }
.ring-over .ring-fg { stroke: #e11d48; filter: drop-shadow(0 0 4px rgba(225, 29, 72, 0.6)); }
.ring-text { font-size: 13px; font-weight: 800; fill: var(--text); }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.target-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; text-align: left; border-left: 5px solid var(--c); transition: transform 0.15s; color: var(--text); }
.target-tile:hover:not(:disabled) { transform: translateY(-2px); }
.target-tile.unset { opacity: 0.85; border-left-style: dashed; }
.tile-ic { width: 56px; height: 56px; display: grid; place-items: center; font-size: 1.6rem; border-radius: 50%; background: color-mix(in srgb, var(--c) 16%, transparent); flex: none; }
.tile-main { display: grid; }
.add-target select { max-width: 320px; }

/* ---------- coach ---------- */

.split-3d { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; margin: 14px 0; perspective: 700px; }
.split-block { position: relative; display: grid; justify-items: center; gap: 2px; padding: 14px 8px; padding-top: var(--h); border-radius: 16px; color: #fff; text-align: center; box-shadow: 0 18px 30px -16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.split-block::before { content: ""; position: absolute; left: 6px; right: 6px; top: -10px; height: 14px; border-radius: 12px 12px 4px 4px; background: inherit; filter: brightness(1.25); transform: skewX(-20deg); z-index: -1; }
.sb-needs { background: linear-gradient(180deg, #8b5cf6, #5b21b6); }
.sb-wants { background: linear-gradient(180deg, #ffb347, #ea580c); }
.sb-savings { background: linear-gradient(180deg, #34d399, #059669); }
.sb-pct { font-size: 1.6rem; font-weight: 900; }
.plan-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.plan-table th { text-align: left; font-size: 0.78rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.plan-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.plan-table td.down { color: var(--good); font-weight: 700; }
.aside-list { margin: 12px 0; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.aside-list p { margin: 0 0 4px; }
.plan-save { margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--good-bg); color: var(--good); font-weight: 700; }
.whatif { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: center; }
.whatif-sliders { display: grid; gap: 12px; }
.whatif-row { display: grid; grid-template-columns: 1fr; gap: 4px; }
.whatif-row output { font-weight: 800; color: var(--accent); justify-self: end; margin-top: -26px; }
.whatif-result { display: grid; gap: 4px; padding: 18px; border-radius: 18px; text-align: center; background: linear-gradient(145deg, var(--good-bg), transparent); border: 1px solid color-mix(in srgb, var(--good) 30%, transparent); }
.whatif-big { font-size: 2rem; font-weight: 900; color: var(--good); font-variant-numeric: tabular-nums; }
.sub-list, .pantry-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sub-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); flex-wrap: wrap; }
.sub-list li > div:first-child { flex: 1; min-width: 140px; }
.sub-list p { margin: 0; }
.sub-right { display: grid; justify-items: end; }
.pantry-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.pantry-list li.due { background: var(--warn-bg); }
.pantry-list li .small { grid-column: 1 / -1; }

/* ---------- prices ---------- */

.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.price-card { padding: 14px 16px; border-top: 4px solid var(--c); display: grid; gap: 6px; }
.price-card p { margin: 0; font-size: 0.88rem; }
.price-head { display: flex; align-items: center; gap: 8px; }
.price-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-line { width: 100%; height: 42px; }
.price-line path { fill: none; stroke: var(--c); stroke-width: 2.5; stroke-linejoin: round; }
.price-line circle { fill: var(--surface-solid); stroke: var(--c); stroke-width: 2; }
.best { color: var(--good); font-weight: 700; }
.store-prices { list-style: none; margin: 4px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: grid; gap: 2px; font-size: 0.85rem; }
.store-prices li { display: flex; justify-content: space-between; gap: 8px; }

/* ---------- goals ---------- */

.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.goal-card { display: flex; gap: 20px; align-items: flex-end; }
.goal-card.done { box-shadow: var(--shadow-2), 0 0 0 2px var(--good); }
.goal-body { flex: 1; display: grid; gap: 8px; }
.goal-body p { margin: 0; }
.goal-amt strong { font-size: 1.3rem; }
.coins { position: relative; width: 74px; height: 150px; flex: none; perspective: 400px; }
.coin { position: absolute; left: 0; bottom: calc(var(--i) * 6px); width: 74px; height: 22px; border-radius: 50%; background: radial-gradient(ellipse at 50% 35%, #fff3b0, #f6c445 45%, #d99a12 80%); box-shadow: 0 4px 0 #b07a0c, 0 6px 8px rgba(0, 0, 0, 0.25); animation: coinDrop 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) both; animation-delay: var(--d); }
.coin:nth-child(odd) { left: 2px; }
@keyframes coinDrop { from { transform: translateY(-60px); opacity: 0; } to { transform: none; opacity: 1; } }
.event-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.event { display: flex; align-items: center; gap: 14px; padding: 12px 14px; flex-wrap: wrap; }
.event.soon { box-shadow: var(--shadow-1), 0 0 0 2px color-mix(in srgb, var(--ember) 50%, transparent); }
.event.past { opacity: 0.6; }
.event p { margin: 0; }
.event .grow { min-width: 160px; display: grid; gap: 4px; }
.cal { width: 54px; flex: none; text-align: center; border-radius: 12px; overflow: hidden; background: var(--surface-solid); box-shadow: var(--shadow-1); display: grid; }
.cal span { font-size: 1.3rem; font-weight: 850; padding: 4px 0 0; }
.cal small { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; color: #fff; background: linear-gradient(90deg, var(--ember), #e11d48); padding: 2px 0; order: -1; }
.event-right { display: grid; justify-items: end; }
.event-actions { display: flex; gap: 6px; align-items: center; }
.suggest { padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- story ---------- */

.story-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 24px; align-items: start; }
.story-frame { perspective: 1200px; display: grid; justify-items: center; }
.story-canvas { width: 100%; max-width: 460px; height: auto; border-radius: 24px; box-shadow: 0 40px 80px -30px rgba(76, 29, 149, 0.7), 0 0 0 1px var(--line); transform: rotateY(-8deg) rotateX(4deg); transition: transform 0.5s; }
.story-frame:hover .story-canvas { transform: none; }
.story-actions { display: grid; gap: 10px; }
.story-actions p { margin: 0; }
.social-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.social { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; background: var(--surface-2); color: var(--text); font-weight: 650; font-size: 0.85rem; text-decoration: none !important; transition: transform 0.15s; }
.social:hover { transform: translateY(-2px); }
.social span { font-size: 1.3rem; }

/* ---------- export ---------- */

.format-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.format-tile { display: grid; justify-items: start; gap: 6px; padding: 18px; text-align: left; cursor: pointer; color: var(--text); transition: transform 0.15s, box-shadow 0.15s; }
.format-tile:hover { transform: translateY(-3px) rotateX(4deg); box-shadow: var(--shadow-2); }
.ft-ic { font-size: 1.8rem; }
.print-report { display: none; }

/* ---------- settings ---------- */

.member-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.member-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.member-list p { margin: 0; }
.member-list select { width: auto; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 850; color: #fff; background: linear-gradient(135deg, var(--accent), var(--ember)); flex: none; }
.invite { padding: 14px; border-radius: 14px; background: linear-gradient(135deg, var(--accent-tint), transparent); border: 1px dashed var(--line-strong); }
.invite-code { font-size: 1.8rem; font-weight: 900; letter-spacing: 0.18em; font-family: ui-monospace, Menlo, monospace; margin: 0 0 10px; }
.card > .btn { justify-self: start; }
.card.goal-card, .card.target-hero, .card.good-news { display: flex; }

/* ---------- toasts, dialogs ---------- */

#toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 440px); }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-2); border-left: 5px solid var(--accent); font-weight: 600; animation: rise 0.3s both; }
.toast-good { border-left-color: var(--good); }
.toast-warn { border-left-color: var(--warn); }
.toast-bad { border-left-color: var(--bad); }
dialog { border: 0; border-radius: 22px; padding: 22px; width: min(92vw, 460px); background: var(--surface-solid); color: var(--text); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.5); }
dialog form { display: grid; gap: 14px; }
dialog::backdrop { background: rgba(17, 11, 34, 0.55); backdrop-filter: blur(4px); }
dialog[open] { animation: rise 0.25s both; }
.dlg-wide { width: min(94vw, 720px); }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 8px; }
.notif-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.notif.unread { box-shadow: inset 4px 0 0 var(--ember); }
.notif-ic { font-size: 1.2rem; }
.more-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.more-item { display: grid; justify-items: center; gap: 6px; padding: 16px 8px; border-radius: 14px; background: var(--surface-2); color: var(--text); font-weight: 650; text-align: center; text-decoration: none !important; }
.more-item .nav-ic { font-size: 1.6rem; width: auto; }

/* ---------- phones & tablets ---------- */

@media (max-width: 1080px) {
  .grid-2, .city-grid, .bill-layout, .story-layout, .whatif { grid-template-columns: minmax(0, 1fr); }
  .bill-photo { position: static; max-height: 360px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { height: auto; min-height: 300px; padding: 40px 0 50px; order: -1; }
}

@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .brand-mini { display: inline-flex; }
  .topbar { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface-solid) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-2); padding: 6px;
  }
  .tab { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px; border: 0; background: transparent; color: var(--text-2); font-size: 0.7rem; font-weight: 650; text-decoration: none !important; cursor: pointer; min-width: 0; }
  .tab .nav-ic { font-size: 1.25rem; width: auto; }
  .tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab.active { color: var(--accent); background: var(--accent-tint); }
  .tab.primary { background: linear-gradient(135deg, var(--ember), #ff8a4c); color: #fff; transform: translateY(-14px); box-shadow: 0 12px 24px -8px rgba(255, 106, 61, 0.8); border-radius: 18px; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .city { height: 300px; }
  .card { padding: 16px; border-radius: 18px; }
  .lang-select { padding: 6px 8px; max-width: 96px; }
  .warn-grid { grid-template-columns: minmax(0, 1fr); }
  .warn-art { width: 64px; height: 64px; }
  .page-head .row-gap { width: 100%; }
  .page-head .row-gap .btn { flex: 1; }
  .toolbar select { width: 100%; }
}

@media (max-width: 420px) {
  .hero-row { flex-direction: column; }
  .split-3d { gap: 6px; }
  .sb-pct { font-size: 1.2rem; }
  .goal-card { flex-direction: column; align-items: stretch; }
  .coins { align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .tilt { transform: none !important; }
}

/* ---------- print (the in-app "Print / Save as PDF" report) ---------- */

@media print {
  body { background: #fff; color: #000; }
  .side, .topbar, .tabbar, #toasts, .page > :not(.print-report) { display: none !important; }
  main { padding: 0; }
  .print-report { display: block; font-size: 11pt; }
  .print-report table { width: 100%; border-collapse: collapse; margin-bottom: 16pt; }
  .print-report th, .print-report td { text-align: left; padding: 4pt 6pt; border-bottom: 1px solid #ddd; }
  .print-report .num { text-align: right; }
  .print-report .total td { font-weight: 700; border-top: 2px solid #000; }
}
.city-label.small { padding: 2px 4px; }
/* SVG fill attributes can't read CSS variables, so chart colours live here. */
.bars3d .bar path, .bars3d .bar rect { fill: var(--bar); }
.bars3d .bar.current path, .bars3d .bar.current rect { fill: var(--accent); }
.donut3d .empty-ring { fill: var(--empty-ring); }

/* ---------- where to buy ---------- */
.wtb-big { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 900; color: #fff; margin: 0; position: relative; }
.wtb-hero p, .wtb-hero h2 { position: relative; }
.swap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.swap-card { padding: 16px; display: grid; gap: 4px; border-top: 4px solid var(--c); }
.swap-card p { margin: 0; }
.swap-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.swap-ic { width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.3rem; border-radius: 12px; background: color-mix(in srgb, var(--c) 16%, transparent); flex: none; }
.swap-best { font-size: 1.02rem; }
.swap-save { color: var(--good); font-weight: 800; margin-top: 6px !important; }
.swap-tip { display: flex !important; align-items: center; gap: 14px; padding: 14px 18px; color: var(--text); text-decoration: none !important; background: linear-gradient(120deg, var(--good-bg), var(--surface) 60%); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.swap-tip .grow { display: grid; }
.swap-tip-ic { font-size: 1.6rem; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--surface-solid); box-shadow: var(--shadow-1); flex: none; }
.chev { font-size: 1.6rem; color: var(--text-3); }
.trip-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 260px; overflow-y: auto; padding: 2px; }
.trip-item { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface-solid); cursor: pointer; font-size: 0.9rem; }
.trip-item:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.trip-item input { accent-color: var(--accent); width: 16px; height: 16px; }
.trip-item.low { border-style: dashed; }
.tag-low { font-size: 0.68rem; font-weight: 800; color: var(--warn); text-transform: uppercase; }
.trip-result:empty { display: none; }
.trip-result { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.stops { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.stop { padding: 12px; animation: rise 0.35s both; animation-delay: calc(var(--i) * 80ms); }
.stop ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 0.88rem; }
.stop li { display: flex; justify-content: space-between; gap: 8px; }
.stop-head { display: flex; align-items: center; gap: 8px; }
.stop-head strong { flex: 1; }
.stop-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--ember)); font-size: 0.85rem; }
.trip-total { font-weight: 800; font-size: 1.05rem; margin: 0; }
.store-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.store-rank li { display: flex; align-items: center; gap: 12px; }
.rank-medal { font-size: 1.4rem; width: 28px; text-align: center; }
.rank-track { height: 8px; border-radius: 99px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.rank-fill { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, #34d399, #f59e0b, #ef4444); background-size: 400px 100%; }
.rank-right { display: grid; justify-items: end; text-align: right; }
.city-invite { display: flex !important; gap: 16px; align-items: flex-start; background: linear-gradient(135deg, var(--accent-tint), var(--surface) 60%); }
.city-art { font-size: 2.6rem; animation: bob 5s ease-in-out infinite; }
.wtb-hero .chip, .hero-card > .chip { justify-self: start; position: relative; }

/* ---------- validation & "needs you" ---------- */
.field-error { margin: 2px 0 0; color: var(--bad); font-size: 0.84rem; font-weight: 650; }
input.invalid, select.invalid { border-color: var(--bad) !important; box-shadow: 0 0 0 4px var(--bad-bg) !important; }
td > .field-error { margin-top: 4px; }
.items-table tr.row-problem td { background: var(--warn-bg); }
.items-table tr.row-problem td:first-child { border-radius: 10px 0 0 10px; }
.items-table tr.row-problem td:last-child { border-radius: 0 10px 10px 0; }
.row-note { margin: 4px 2px 0; font-size: 0.8rem; font-weight: 650; color: var(--warn); }
.issue-banner { padding: 14px 18px; border-radius: var(--radius-sm); background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); color: var(--text); }
.issue-banner strong { color: var(--warn); }
.issue-banner ul, .issue-list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.pop-art { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; font-weight: 900; color: #fff; margin: 0 auto 6px; animation: rise 0.4s both; }
.pop-good { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 12px 30px -8px rgba(5, 150, 105, 0.6); }
.pop-warn { background: linear-gradient(135deg, #fbbf24, #f97316); box-shadow: 0 12px 30px -8px rgba(249, 115, 22, 0.6); }
dialog h2 { text-align: center; }

/* ---------- items & bill details ---------- */
a.chip-link { text-decoration: none !important; cursor: pointer; transition: background 0.15s, transform 0.15s; }
a.chip-link:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.28); }
.printed { display: block; font-size: 0.76rem; color: var(--text-3); margin-top: 2px; font-family: ui-monospace, Menlo, monospace; letter-spacing: 0.02em; }
td > .printed { margin: 4px 2px 0; }
.per { color: var(--good); font-weight: 750; font-variant-numeric: tabular-nums; }
.items-card { padding: 8px; }
.items-list { width: 100%; border-collapse: collapse; }
.items-list th { text-align: left; font-size: 0.76rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.items-list th.num, .items-list td.num { text-align: right; }
.items-list td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.items-list tbody tr { cursor: pointer; transition: background 0.12s; }
.items-list tbody tr:hover, .items-list tbody tr:focus-visible { background: var(--surface-2); outline: none; }
.items-list tr.pending { opacity: 0.75; }
.it-name { display: flex; gap: 12px; align-items: center; min-width: 220px; }
.it-name .mini-chip { margin-top: 4px; display: inline-block; }
.it-name .chip { margin-left: 6px; font-size: 0.7rem; padding: 2px 8px; }
.it-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; font-size: 1.15rem; border-radius: 12px; background: color-mix(in srgb, var(--c) 16%, transparent); }
.seg-inline { justify-self: start; width: auto; min-width: 240px; }
.bill-details { gap: 14px; }
.details-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px dashed var(--line-strong); }
.details-head h2 { font-size: 2rem; font-weight: 900; margin: 0; }
.detail-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.detail-lines li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border-left: 4px solid var(--c); }
.detail-meta { display: block; margin-top: 4px; font-size: 0.82rem; color: var(--text-2); }
.detail-right { display: grid; justify-items: end; gap: 2px; text-align: right; }
.detail-total { display: flex; justify-content: flex-end; gap: 18px; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-size: 1.05rem; }
@media (max-width: 820px) {
  .items-list thead { display: none; }
  .items-list, .items-list tbody, .items-list tr, .items-list td { display: block; width: 100%; }
  .items-list tr { padding: 10px 6px; border-bottom: 1px solid var(--line); }
  .items-list td { border: 0; padding: 2px 6px; }
  .items-list td:not(.it-name) { display: flex; justify-content: space-between; font-size: 0.88rem; }
  .items-list td:not(.it-name)::before { content: attr(data-label); color: var(--text-3); }
  .items-list td.num { text-align: right; }
}

/* ---------- voice ---------- */
.voice-bar { display: grid; gap: 6px; padding: 12px 14px; border-radius: 18px; background: linear-gradient(135deg, var(--accent-tint), transparent 70%); border: 1px solid var(--line); }
.voice-row { display: flex; gap: 10px; align-items: center; }
.voice-text { flex: 1; min-width: 0; }
.mic-btn { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; font-size: 1.4rem; background: linear-gradient(135deg, var(--ember), #e11d48); color: #fff; box-shadow: 0 10px 22px -8px rgba(225, 29, 72, 0.7); transition: transform 0.15s; position: relative; }
.mic-btn:hover { transform: scale(1.06); }
.voice-bar.invite .mic-btn::after, .voice-bar.listening .mic-btn::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid rgba(255, 106, 61, 0.6); animation: micPulse 1.2s ease-out infinite; }
.voice-bar.listening .mic-btn { background: linear-gradient(135deg, #e11d48, #9f1239); }
@keyframes micPulse { from { transform: scale(0.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.voice-bar.busy { opacity: 0.75; }
.voice-hint { margin: 0; font-size: 0.8rem; color: var(--text-3); }
.voice-status { margin: 0; font-size: 0.9rem; font-weight: 650; min-height: 1.2em; }
.voice-status.good { color: var(--good); }
.voice-status.bad { color: var(--bad); }
.speak-btn { font-size: 1.1rem; }
/* Voice has one look everywhere (purple, a microphone and the word "Speak"), so people learn to spot it. */
.mic-btn { background: linear-gradient(135deg, #8b5cf6, #5b21b6); box-shadow: 0 10px 22px -8px rgba(91, 33, 182, 0.7); }
.voice-bar.listening .mic-btn { background: linear-gradient(135deg, #e11d48, #9f1239); }
.mic-pill { width: auto; height: 48px; border-radius: 999px; padding: 0 18px 0 14px; display: inline-flex; gap: 8px; font-size: 1rem; font-weight: 800; }
.mic-pill .mic-ic { font-size: 1.3rem; }
.voice-bar.invite .mic-pill::after, .voice-bar.listening .mic-pill::after { border-radius: 999px; }
.voice-hero { justify-items: center; text-align: center; gap: 14px; padding: 26px 18px 18px; }
.voice-hero-mic { display: grid; justify-items: center; gap: 12px; }
.mic-big { width: 132px; height: 132px; display: grid; align-content: center; gap: 4px; font-size: 3rem; }
.mic-big .mic-label { font-size: 0.95rem; font-weight: 800; line-height: 1.1; padding: 0 10px; }
.mic-big::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 3px solid rgba(139, 92, 246, 0.35); animation: micPulse 2s ease-out infinite; }
.voice-hero-hint { margin: 0; max-width: 34rem; color: var(--text-2); font-weight: 600; }
.voice-examples { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.example-chip { border: 1px dashed color-mix(in srgb, #8b5cf6 55%, transparent); background: color-mix(in srgb, #8b5cf6 8%, transparent); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 0.85rem; cursor: pointer; }
.example-chip:hover { background: color-mix(in srgb, #8b5cf6 16%, transparent); }
.voice-or { margin: 4px 0 0; }
.voice-hero .voice-row { width: 100%; max-width: 40rem; }
/* "Speak" button on every screen. */
.speak-fab { position: fixed; z-index: 40; right: 24px; bottom: 24px; display: inline-flex; align-items: center; gap: 8px; padding: 14px 20px 14px 16px; border-radius: 999px; color: #fff !important; font-weight: 800; font-size: 1.02rem; text-decoration: none !important; background: linear-gradient(135deg, #8b5cf6, #5b21b6); box-shadow: 0 16px 32px -10px rgba(91, 33, 182, 0.75), 0 0 0 4px color-mix(in srgb, #8b5cf6 22%, transparent); transition: transform 0.15s; }
.speak-fab:hover { transform: translateY(-2px) scale(1.03); }
.speak-fab .fab-ic { font-size: 1.4rem; }
.speak-fab[hidden] { display: none; }
@media (max-width: 820px) {
  .speak-fab { right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); padding: 12px 16px 12px 13px; }
  /* Room under the last card so the floating button never covers it. */
  .layout:has(.speak-fab:not([hidden])) main { padding-bottom: calc(164px + env(safe-area-inset-bottom)); }
}
@media (max-width: 520px) {
  .voice-bar:not(.voice-hero) .voice-row { flex-wrap: wrap; }
  .voice-bar:not(.voice-hero) .mic-pill { width: 100%; justify-content: center; }
}
/* Home: the two main ways to add a bill, big and side by side. */
.add-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.add-action { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 22px; color: #fff !important; text-decoration: none !important; box-shadow: var(--shadow-2); transition: transform 0.15s; }
.add-action:hover { transform: translateY(-2px); }
.add-action .aa-ic { font-size: 2rem; }
.add-action strong { display: block; font-size: 1.15rem; }
.add-action small { display: block; opacity: 0.9; font-weight: 600; }
.aa-scan { background: linear-gradient(135deg, var(--ember), #ff8a4c); }
.aa-voice { background: linear-gradient(135deg, #8b5cf6, #5b21b6); }
@media (max-width: 520px) { .add-action { padding: 14px; gap: 10px; } .add-action .aa-ic { font-size: 1.6rem; } .add-action small { display: none; } }

/* ---------- QR code / barcode scanner ---------- */
.code-frame { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; background: #111; }
.code-frame[hidden] { display: none; }
.code-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.code-aim { position: absolute; inset: 18% 14%; border: 3px solid rgba(255, 255, 255, 0.9); border-radius: 16px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); }
.code-line { position: absolute; left: 16%; right: 16%; top: 50%; height: 2px; background: var(--ember); box-shadow: 0 0 12px var(--ember); animation: codeSweep 1.8s ease-in-out infinite alternate; }
@keyframes codeSweep { from { transform: translateY(-60px); } to { transform: translateY(60px); } }
.code-status { margin: 10px 0 0; font-weight: 650; }
.code-result { display: grid; gap: 10px; }
.code-url { word-break: break-all; font-size: 0.85rem; color: var(--text-2); }
.flash { animation: flashIn 1.2s ease-out; }
tr.flash td { animation: flashIn 1.2s ease-out; }
@keyframes flashIn { 0% { background: color-mix(in srgb, var(--good) 35%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 40%, transparent); } 100% { background: transparent; box-shadow: none; } }
.use-sum { margin-left: 8px; }
.detail-mismatch { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin: 0; }
.update-banner { position: fixed; z-index: 150; left: 50%; top: 74px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 16px; background: var(--surface-solid); box-shadow: var(--shadow-2), 0 0 0 1px var(--line); font-weight: 650; animation: rise 0.35s both; max-width: calc(100vw - 32px); }

/* ---------- simple mode ---------- */
html.simple body { font-size: 18px; }
html.simple h1 { font-size: 1.9rem; }
html.simple .btn { padding: 13px 22px; font-size: 1.05rem; border-radius: 16px; }
html.simple .nav-link { padding: 14px 14px; font-size: 1.08rem; }
html.simple .tab { font-size: 0.8rem; }
html.simple .tab .nav-ic { font-size: 1.5rem; }
.nav-more { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.simple-home { max-width: 760px; }
.simple-month { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 1.1rem; padding: 0 4px; }
.simple-month strong { font-size: 1.4rem; }
.big-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.big-action { display: grid; justify-items: center; gap: 8px; padding: 22px 10px; border-radius: 24px; color: #fff; font-weight: 800; font-size: 1.1rem; text-align: center; text-decoration: none !important; box-shadow: var(--shadow-2); transition: transform 0.15s; }
.big-action:active { transform: scale(0.97); }
.ba-ic { font-size: 2.6rem; line-height: 1; }
.ba-scan { background: linear-gradient(135deg, #ff6a3d, #e11d48); }
.ba-voice { background: linear-gradient(135deg, #8b5cf6, #5b21b6); }
.ba-ask { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.big-rows { gap: 8px; }
.big-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 18px; background: var(--surface-2); color: var(--text); text-decoration: none !important; }
.br-ic { width: 52px; height: 52px; flex: none; display: grid; place-items: center; font-size: 1.8rem; border-radius: 16px; background: color-mix(in srgb, var(--c) 18%, transparent); }
.br-main { flex: 1; display: grid; gap: 6px; min-width: 0; }
.br-name { font-weight: 750; }
.br-bar { height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--c) 14%, transparent); overflow: hidden; }
.br-bar i { display: block; height: 100%; width: var(--w); background: var(--c); border-radius: inherit; }
.big-row strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* ---------- today card ---------- */
.today-card { display: flex !important; align-items: center; gap: 18px; padding: 20px 22px; }
.today-face { font-size: 3.6rem; line-height: 1; flex: none; animation: bob 4s ease-in-out infinite; }
.today-words { flex: 1; display: grid; gap: 4px; }
.today-words p { margin: 0; }
.today-big { font-size: clamp(1.3rem, 3.4vw, 1.75rem); font-weight: 900; letter-spacing: -0.01em; }
.today-sub { color: var(--text-2); }
.mood-good { background: linear-gradient(120deg, var(--good-bg), var(--surface) 70%); }
.mood-careful { background: linear-gradient(120deg, var(--warn-bg), var(--surface) 70%); }
.mood-slow, .mood-over { background: linear-gradient(120deg, var(--bad-bg), var(--surface) 70%); }
.streak-chip { background: rgba(255, 179, 71, 0.22) !important; color: inherit !important; }
.banner-good { background: var(--good-bg); color: var(--good); font-weight: 700; margin: 0; }

/* ---------- confetti & guide ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti i { position: absolute; top: -20px; left: var(--x); width: var(--s); height: calc(var(--s) * 1.6); background: var(--c); border-radius: 2px; animation: fall var(--t) cubic-bezier(0.25, 0.6, 0.4, 1) var(--d) forwards; }
@keyframes fall { to { transform: translate3d(calc((var(--s) - 9px) * 8), 110vh, 0) rotate(var(--r)); } }
.guide { display: grid; justify-items: center; gap: 8px; text-align: center; }
.guide-art { font-size: 5rem; line-height: 1.1; animation: bob 4s ease-in-out infinite; }
.guide-count { margin: 0; color: var(--text-3); font-weight: 700; }
.guide h2 { font-size: 1.35rem; line-height: 1.35; }
.guide .dlg-actions { width: 100%; }

/* ---------- ask ---------- */
.ask-page { max-width: 760px; }
.ask-card { justify-items: center; text-align: center; }
.big-mic-wrap { display: grid; justify-items: center; gap: 8px; }
.big-mic { width: 120px; height: 120px; border-radius: 50%; border: 0; cursor: pointer; font-size: 3.2rem; color: #fff; background: radial-gradient(circle at 35% 30%, #ff9a6b, #e11d48 70%); box-shadow: 0 20px 40px -14px rgba(225, 29, 72, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.35); position: relative; transition: transform 0.15s; }
.big-mic:active { transform: scale(0.96); }
.big-mic.listening::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 4px solid rgba(255, 106, 61, 0.6); animation: micPulse 1.2s ease-out infinite; }
.big-mic-label { margin: 0; font-weight: 750; font-size: 1.1rem; }
.ask-form { display: flex; gap: 10px; width: 100%; }
.ask-text { flex: 1; }
.ask-thread { display: grid; gap: 10px; }
.bubble { display: flex; align-items: flex-start; gap: 10px; max-width: 88%; padding: 14px 16px; border-radius: 20px; box-shadow: var(--shadow-1); animation: rise 0.3s both; }
.bubble p { margin: 0; font-size: 1.08rem; line-height: 1.5; }
.bubble.me { justify-self: end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.bubble.bot { justify-self: start; background: var(--surface-solid); border-bottom-left-radius: 6px; }
.bubble.thinking p { color: var(--text-3); animation: flicker 1s ease-in-out infinite alternate; }
.bubble.error { background: var(--bad-bg); }

/* ---------- lite mode (slow phones, data saver) ---------- */
html.lite *, html.lite *::before, html.lite *::after { animation: none !important; transition: none !important; }
html.lite .card, html.lite .topbar, html.lite .tabbar { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html.lite .card { background: var(--surface-solid); }
html.lite body { background: var(--bg); }

@media (max-width: 520px) {
  .big-actions { gap: 10px; }
  .big-action { padding: 18px 6px; font-size: 0.98rem; }
  .ba-ic { font-size: 2.2rem; }
  .today-card { padding: 16px; gap: 12px; }
  .today-face { font-size: 2.8rem; }
}
.sms-area { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-solid); font: inherit; resize: vertical; }

/* ---------- sign-in choices, PIN pad, phone ---------- */
.auth-choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.auth-choices .btn { white-space: normal; text-align: center; }
/* "Joining your family?" sits apart from the two main buttons, so nobody mistakes it for the way to sign up. */
.auth-family-hint { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--accent-tint); color: var(--text-2); font-size: 0.92rem; }
.auth-family-hint > span { font-size: 1.4rem; line-height: 1; }
.auth-family-hint p { margin: 0; }
.auth-switch { margin: 0; text-align: center; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn[hidden] { display: none; }
.google-btn { background: #fff; color: #1f2937; border: 1px solid #d1d5db; }
.g-logo { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 900; color: #fff; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.big-input { font-size: 1.3rem !important; min-height: 54px !important; }
.code-input { text-align: center; letter-spacing: 0.5em; font-variant-numeric: tabular-nums; font-weight: 800; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 8px 0; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent); }
.pin-dots i.on { background: var(--accent); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 300px; margin: 0 auto; width: 100%; }
.pin-key { height: 68px; border-radius: 20px; border: 1px solid var(--line-strong); background: var(--surface-solid); font-size: 1.7rem; font-weight: 800; cursor: pointer; color: var(--text); box-shadow: var(--shadow-1); }
.pin-key:active { transform: scale(0.95); background: var(--accent-tint); }
.pin-input { max-width: 140px; text-align: center; letter-spacing: 0.4em; font-size: 1.2rem; }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }

/* ---------- payments added automatically ---------- */
.chip-good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.auto-page { display: grid; gap: 18px; }
.auto-card { display: grid; gap: 14px; }
.auto-head { display: flex; gap: 14px; align-items: flex-start; }
.auto-head h2 { margin: 0 0 4px; }
.auto-head p { margin: 0; }
.auto-ic { font-size: 2rem; line-height: 1; }
.auto-address { display: grid; gap: 8px; justify-items: start; padding: 14px; border-radius: 16px; background: var(--accent-tint); }
.auto-address .eyebrow { margin: 0; }
.auto-mono { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.02rem; font-weight: 700; word-break: break-all; }
.auto-link { font-size: 0.85rem; }
.auto-confirm { display: grid; gap: 6px; }
.auto-confirm p { margin: 0; }
.auto-steps li { align-items: flex-start; }
.auto-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.auto-ev { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); color: var(--text); text-decoration: none !important; }
.auto-ev strong { display: block; }
.auto-ev-ic { font-size: 1.3rem; }
.src-chip { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; font-size: 0.7rem; font-weight: 700; color: var(--text-2); background: var(--accent-tint); vertical-align: middle; }
@media (max-width: 520px) { .auto-ev { flex-wrap: wrap; } .auto-head { gap: 10px; } }

/* One-tap "Speak" pop-up: big microphone, the words appear as they are heard. */
.ql { border: 0; background: none; padding: 8px 0 0; }
.ql h2 { margin: 4px 0 0; }
.ql-words { margin: 0; min-height: 2.6em; font-size: 1.2rem; font-weight: 700; color: var(--text); }

/* ---------- welcome screen: a glowing "this month" card, the same in light and dark ----------
   Only transforms animate here: fading (opacity) inside the tilted 3D stage draws unreliably. */
.auth-card h1 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); line-height: 1.08; letter-spacing: -0.02em; margin: 4px 0 0; }
.welcome-art { perspective: 1200px; }
/* A soft colour cloud behind the card (outside the 3D stage, so it may blur). */
.wa-glow { position: absolute; inset: 12% 8%; border-radius: 50%; background: radial-gradient(closest-side, rgba(168, 85, 247, 0.55), transparent), radial-gradient(closest-side at 70% 70%, rgba(251, 146, 60, 0.4), transparent); filter: blur(40px); pointer-events: none; }
.wa-stage { position: relative; width: min(460px, 88%); transform: rotateY(-14deg) rotateX(6deg); transform-style: preserve-3d; animation: waFloat 7s ease-in-out infinite; }
/* The "this month" card is a dark jewel in both themes: deep indigo, a lit edge, a light sweep across it. */
.wa-receipt { position: relative; overflow: hidden; display: grid; gap: 12px; padding: 22px 22px 24px; font-size: 1.05rem; border-radius: 24px; color: #f5f3ff;
  background: radial-gradient(120% 80% at 100% 0%, rgba(236, 72, 153, 0.45), transparent 55%), radial-gradient(90% 70% at 0% 100%, rgba(59, 130, 246, 0.35), transparent 60%), linear-gradient(150deg, #312e81, #4c1d95 55%, #1e1b4b);
  box-shadow: 0 50px 90px -30px rgba(76, 29, 149, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.14) inset, 0 1px 0 rgba(255, 255, 255, 0.35) inset; }
.wa-shine { position: absolute; top: -20%; bottom: -20%; left: 0; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent); transform: translateX(-160%) skewX(-18deg); animation: waShine 5.5s ease-in-out 1.2s infinite; pointer-events: none; }
.wa-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wa-total { display: grid; gap: 2px; min-width: 0; }
.wa-eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #c4b5fd; }
.wa-total strong { font-size: clamp(1.8rem, 3.4vw, 2.4rem); line-height: 1.05; letter-spacing: -0.02em; background: linear-gradient(90deg, #fff, #fde68a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wa-saved { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; padding: 2px 10px; border-radius: 99px; font-size: 0.74rem; font-weight: 750; color: #bbf7d0; background: rgba(34, 197, 94, 0.22); border: 1px solid rgba(74, 222, 128, 0.35); }
.wa-ring { flex: none; width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#fbbf24, #f472b6 calc(var(--p) * 1%), rgba(255, 255, 255, 0.14) 0); box-shadow: 0 0 24px rgba(251, 191, 36, 0.35); }
.wa-ring > span { width: 70px; height: 70px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: #2e1065; line-height: 1.1; }
.wa-ring strong { font-size: 1.15rem; }
.wa-ring small { font-size: 0.62rem; color: #c4b5fd; font-weight: 650; }
.wa-split { display: flex; gap: 3px; height: 10px; }
.wa-split i { flex: var(--w) 1 0; border-radius: 99px; background: var(--c); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 60%, transparent); }
.wa-line { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.08); font-size: 1rem; animation: waIn 0.6s both; animation-delay: calc(var(--i) * 0.35s + 0.3s); }
.wa-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; background: color-mix(in srgb, var(--c) 30%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 50%, transparent) inset; }
.wa-name { display: grid; gap: 3px; min-width: 0; font-weight: 700; }
.wa-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-line > strong { font-size: 1.05rem; }
.wa-chip { justify-self: start; padding: 1px 8px; border-radius: 99px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 0.72rem; font-weight: 750; color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); white-space: nowrap; }
.wa-bubble { position: absolute; max-width: 270px; padding: 12px 16px; border-radius: 16px; font-size: 0.95rem; font-weight: 750; line-height: 1.3; color: #fff; box-shadow: 0 20px 40px -14px rgba(15, 23, 42, 0.55); animation: waPop 0.5s both; }
.wa-alert { top: -30px; right: -40px; background: linear-gradient(135deg, #f97316, #e11d48); animation-delay: 1.9s; }
.wa-tip { bottom: -40px; left: -34px; background: linear-gradient(135deg, #10b981, #0d9488); animation-delay: 2.5s; }
@keyframes waIn { from { transform: translateX(-10px); } to { transform: none; } }
@keyframes waPop { from { transform: translateZ(60px) scale(0); } 70% { transform: translateZ(60px) scale(1.06); } to { transform: translateZ(60px) scale(1); } }
@keyframes waFloat { 0%, 100% { transform: rotateY(-14deg) rotateX(6deg) translateY(0); } 50% { transform: rotateY(-10deg) rotateX(4deg) translateY(-10px); } }
@keyframes waShine { 0% { transform: translateX(-160%) skewX(-18deg); } 45%, 100% { transform: translateX(360%) skewX(-18deg); } }

/* Language: the 🌐 button glows until a language is picked; first visit shows big tiles in each script. */
.lang-pill { display: inline-flex; align-items: center; gap: 4px; padding: 0 2px 0 12px; border-radius: 99px; background: linear-gradient(135deg, var(--accent), #ec4899); color: #fff; cursor: pointer; }
.lang-pill select.lang-select { border: 0; background: transparent; color: #fff; font-weight: 750; padding-left: 4px; }
.lang-pill select.lang-select option { color: #111827; }
.lang-pill.glow { animation: langGlow 1.8s ease-in-out infinite; }
@keyframes langGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.55); } 50% { box-shadow: 0 0 0 8px rgba(236, 72, 153, 0); } }
.first-visit { display: grid; gap: 10px; max-width: 520px; }
.first-visit h2 { margin: 0 0 4px; font-size: 1.5rem; }
.first-visit p { margin: 0; }
.first-label { margin-top: 6px !important; font-weight: 800; color: var(--text); }
.country-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.country-tile { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; transition: transform 0.15s; }
.country-tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.country-tile .flag { font-size: 1.8rem; line-height: 1.1; }
.country-tile-name { font-size: 0.8rem; font-weight: 750; text-align: center; line-height: 1.2; }
.country-tile small { font-size: 0.7rem; color: var(--text-2); font-weight: 650; }
.country-tile.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: 0 8px 18px -8px var(--accent); }
.country-tile.on small { color: inherit; }
@media (max-width: 520px) { .country-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lang-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lang-tile { min-height: 48px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: transform 0.15s; }
.lang-tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.lang-tile.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: 0 8px 18px -8px var(--accent); }
.welcome-points { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.welcome-points li { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border-radius: 14px; background: var(--accent-tint); color: var(--text-2); font-size: 0.8rem; font-weight: 650; text-align: center; line-height: 1.25; }
.welcome-points li span { font-size: 1.4rem; }
@media (max-width: 820px) {
  .welcome-art { height: auto; padding: 34px 0 46px; }
  .wa-stage { width: min(340px, 90%); transform: rotateY(-8deg) rotateX(4deg); animation: none; }
  .wa-chip { white-space: normal; font-size: 0.66rem; line-height: 1.3; padding: 1px 7px; }
  .wa-receipt { padding: 14px 14px 16px; gap: 8px; border-radius: 20px; }
  .wa-total strong { font-size: 1.6rem; }
  .wa-ring { width: 64px; height: 64px; }
  .wa-ring > span { width: 50px; height: 50px; }
  .wa-ring strong { font-size: 0.9rem; }
  .wa-ring small { font-size: 0.5rem; }
  .wa-split { height: 7px; }
  .wa-line { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; padding: 5px 8px; font-size: 0.85rem; }
  .wa-ic { width: 30px; height: 30px; border-radius: 9px; font-size: 1rem; }
  .wa-line > strong { font-size: 0.9rem; }
  .wa-bubble { font-size: 0.76rem; padding: 7px 10px; max-width: 200px; }
  .wa-alert { top: -26px; right: -14px; }
  .wa-tip { bottom: -38px; left: -14px; }
}
@media (max-width: 420px) {
  .lang-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-top .brand-big { font-size: 1.3rem; gap: 8px; }
  .auth-top .brand-big img { width: 34px; height: 34px; }
  .lang-pill { padding-left: 9px; min-width: 0; }
  .wa-saved { font-size: 0.66rem; padding: 1px 8px; }
}
@media (prefers-reduced-motion: reduce) { .wa-stage, .wa-line, .wa-bubble, .wa-shine, .lang-pill.glow { animation: none; } }
html.lite .wa-stage, html.lite .wa-line, html.lite .wa-bubble, html.lite .wa-shine, html.lite .lang-pill.glow { animation: none; }

/* ---------- one category, told as a story (#/category/<key>) ---------- */
.cat-page { display: grid; gap: 16px; }
.cat-hero { display: grid; gap: 14px; border: 0; color: #fff; background: linear-gradient(140deg, color-mix(in srgb, var(--c) 70%, #1e1b4b) 0%, var(--c) 100%); box-shadow: 0 24px 50px -24px color-mix(in srgb, var(--c) 80%, #000); }
.cat-hero .icon-btn { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.25); color: #fff; }
.cat-hero .icon-btn.ghost { visibility: hidden; }
.cat-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cat-hero-main { display: flex; align-items: center; gap: 16px; }
.cat-hero-ic { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 22px; font-size: 2.6rem; background: rgba(255, 255, 255, 0.2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.cat-hero h1 { margin: 0; color: #fff; font-size: 1.35rem; }
.cat-hero-amount { margin: 0; font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.cat-hero-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cat-hero .chip { background: rgba(255, 255, 255, 0.2); color: #fff; }
.cat-hero .chip-up { background: rgba(255, 228, 230, 0.95); color: #be123c; }
.cat-hero .chip-down { background: rgba(220, 252, 231, 0.95); color: #15803d; }
.cat-hero .speak-btn { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.25); color: #fff; }
.cat-bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; align-items: end; height: 96px; }
.cat-bar { display: grid; grid-template-rows: 1fr auto; gap: 4px; height: 100%; text-decoration: none !important; color: rgba(255, 255, 255, 0.8); font-size: 0.72rem; font-weight: 650; text-align: center; }
.cat-bar i { align-self: end; height: var(--h); border-radius: 8px 8px 4px 4px; background: rgba(255, 255, 255, 0.35); }
.cat-bar.on i { background: #fff; }
.cat-bar.on { color: #fff; }
.cat-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.cat-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.cat-item-main { display: grid; gap: 2px; min-width: 0; }
.cat-item-main strong { overflow-wrap: anywhere; }
.cat-item-amt { font-variant-numeric: tabular-nums; }
.cat-item-bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--c) 14%, transparent); overflow: hidden; }
.cat-item-bar i { display: block; width: var(--w); height: 100%; border-radius: inherit; background: var(--c); }
.cat-shops { display: grid; gap: 10px; }
.cat-shop { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); }
.cat-shop > div { display: grid; }
.cat-shop-ic { font-size: 1.4rem; }
.cat-every summary { cursor: pointer; font-weight: 750; }
.cat-lines { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.cat-lines a { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none !important; }

/* Welcome back: a short greeting with one fact about the person's own month. */
.welcome-back { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; background: linear-gradient(120deg, color-mix(in srgb, #8b5cf6 16%, var(--surface)), color-mix(in srgb, var(--ember) 14%, var(--surface))); border: 1px solid var(--line); box-shadow: var(--shadow-1); animation: rise 0.45s both; }
.welcome-back p { margin: 2px 0 0; color: var(--text-2); }
.wb-wave { font-size: 1.9rem; display: inline-block; transform-origin: 70% 80%; animation: wave 1.6s ease-in-out 0.3s 2; }
@keyframes wave { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(16deg); } 40% { transform: rotate(-8deg); } 60% { transform: rotate(14deg); } 80% { transform: rotate(-4deg); } }
html.lite .welcome-back, html.lite .wb-wave { animation: none; }

/* ---------- subscriptions & renewals ---------- */
.subs-page { display: grid; gap: 16px; }
.sub-hero { display: grid; gap: 4px; justify-items: start; border: 0; color: #fff; background: linear-gradient(135deg, #4c1d95, #7c3aed 60%, #db2777); }
.sub-hero .eyebrow { color: rgba(255, 255, 255, 0.75); margin: 0; }
.sub-hero p { margin: 0; }
.sub-hero-amount { font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sub-hero-amount span { font-size: 1rem; font-weight: 700; opacity: 0.85; }
.sub-hero .speak-btn { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.25); color: #fff; margin-top: 6px; }
.sub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sub-list > li.sub-row, .sub-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.sub-row.off { opacity: 0.7; }
.sub-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; font-size: 1.5rem; background: color-mix(in srgb, var(--c) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent); }
.sub-main { display: grid; gap: 3px; min-width: 0; }
.sub-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.sub-chips .chip { font-size: 0.74rem; padding: 3px 9px; white-space: normal; }
.sub-actions { display: flex; gap: 6px; align-items: center; }
.sub-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; padding: 2px; }
.sub-preset { display: grid; justify-items: center; gap: 6px; padding: 14px 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 0.85rem; font-weight: 650; cursor: pointer; text-align: center; transition: transform 0.12s, border-color 0.12s; }
.sub-preset:hover { transform: translateY(-2px); border-color: var(--c); }
.sub-preset-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; font-size: 1.5rem; background: color-mix(in srgb, var(--c) 16%, transparent); }
.sub-form-head { display: flex; align-items: center; gap: 12px; }
.sub-form-head h2 { margin: 0; }
.check-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check-row input { margin-top: 4px; width: 20px; height: 20px; flex: none; }
.home-renewal { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none !important; box-shadow: var(--shadow-1); }
.home-renewal .sub-ic { width: 40px; height: 40px; font-size: 1.25rem; }
@media (max-width: 520px) { .sub-list > li.sub-row { grid-template-columns: auto minmax(0, 1fr); } .sub-actions { grid-column: 2; } .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.best-chip { justify-self: start; }
.auto-intro { margin: 0; }

.welcome-trust { margin: 0; text-align: center; font-size: 0.82rem; font-weight: 650; color: var(--text-3); }
@media (max-width: 420px) { .welcome-points { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- utility bills ---------- */
.util-page { display: grid; gap: 16px; }
.util-card { display: grid; gap: 14px; border-top: 4px solid var(--c); }
.util-head { display: flex; gap: 14px; align-items: flex-start; }
.util-head h2 { margin: 0; }
.util-head p { margin: 2px 0 0; }
.util-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; font-size: 1.7rem; background: color-mix(in srgb, var(--c) 16%, transparent); flex: none; }
.util-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.util-facts > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--accent-tint); }
.util-facts strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.util-why { display: grid; gap: 8px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); }
.util-why.up { background: color-mix(in srgb, var(--warn) 8%, transparent); }
.util-why.down { background: color-mix(in srgb, var(--good) 8%, transparent); }
.util-why-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0; font-size: 1.05rem; }
.util-why .eyebrow { margin: 4px 0 0; }
.util-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.util-reasons li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; line-height: 1.4; }
.util-reasons li.up > span:first-child { color: var(--bad); }
.util-reasons li.down > span:first-child { color: var(--good); }
.util-reasons li.fact > span:first-child { color: var(--text-3); }
.util-tip { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--surface); font-weight: 600; }
.util-first { margin: 0; }
.util-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; align-items: end; height: 120px; }
.util-bar { display: grid; grid-template-rows: auto 1fr auto; gap: 4px; height: 100%; text-align: center; font-size: 0.72rem; color: var(--text-2); text-decoration: none !important; }
.util-bar i { align-self: end; height: var(--h); border-radius: 8px 8px 4px 4px; background: color-mix(in srgb, var(--c) 40%, transparent); }
.util-bar.on i { background: var(--c); }
.util-bar-val { font-weight: 700; color: var(--text); }
.util-charges summary { cursor: pointer; font-weight: 700; }
.util-charges ul { list-style: none; margin: 10px 0 6px; padding: 0; display: grid; gap: 6px; }
.util-charges li { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.util-open { justify-self: start; }
.util-due-more { margin: 0; }
.util-panel { display: grid; gap: 12px; margin: 14px 0; padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.util-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0; }
.util-page > * { min-width: 0; }
.util-head { flex-wrap: wrap; }
.util-head > .grow { min-width: 0; flex: 1 1 160px; }
.util-head .chip, .util-panel-head .chip { white-space: normal; }
.util-panel-head { flex-wrap: wrap; }

/* Daily reminders */
.reminders-card { display: grid; gap: 12px; justify-items: start; }
.reminders-card h2, .reminders-card p { margin: 0; }
.rem-rows { display: grid; gap: 10px; width: 100%; }
.rem-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); cursor: pointer; }
.rem-row input[type="checkbox"] { width: 20px; height: 20px; flex: none; }
.rem-row .grow { display: grid; gap: 2px; }
.rem-row input[type="time"] { width: auto; }

/* Country on the welcome screen: detected from the time zone, one tap to change (sets the currency). */
.country-pill { justify-self: start; display: inline-flex; align-items: center; gap: 4px; padding-left: 12px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.country-pill select.lang-select { border: 0; background: transparent; font-weight: 700; max-width: none; }
.geo-tip .btn { flex: none; }

/* ---------- US look ("Ledger"): crisp white and navy, money-green accent, calmer glow ----------
   <html data-region="us"> is set from the household's country (or, before sign-in, the detected/picked one).
   Only colours change; layout, 3D and motion stay the same. */
:root[data-region="us"] {
  --bg: #f5f7fa;
  --bg-2: #eef2f6;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-2: #f1f5f9;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --accent: #059669;
  --accent-2: #10b981;
  --accent-ink: #047857;
  --accent-tint: #d1fae5;
  --ember: #2563eb;
  --ember-2: #60a5fa;
  --bar: #a7f3d0;
  --empty-ring: #e2e8f0;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-2: 0 2px 4px rgba(15, 23, 42, 0.05), 0 12px 32px -8px rgba(15, 23, 42, 0.14), 0 32px 64px -28px rgba(15, 23, 42, 0.18);
  --glow: 0 0 0 1px rgba(15, 23, 42, 0.06), 0 18px 50px -24px rgba(5, 150, 105, 0.35);
  --side-bg: linear-gradient(180deg, #0f2440 0%, #0a172b 100%);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root[data-region="us"]:not([data-theme="light"]) {
    --bg: #0a111e;
    --bg-2: #0c1524;
    --surface: rgba(17, 27, 45, 0.85);
    --surface-solid: #111b2d;
    --surface-2: #16233a;
    --line: rgba(148, 163, 184, 0.14);
    --line-strong: rgba(148, 163, 184, 0.26);
    --text: #f1f5f9;
    --text-2: #b4c0d3;
    --text-3: #7c8aa2;
    --accent: #34d399;
    --accent-2: #6ee7b7;
    --accent-ink: #a7f3d0;
    --accent-tint: rgba(52, 211, 153, 0.15);
    --on-accent: #032b1e;
    --bar: #1f5f4b;
    --empty-ring: #1e2a40;
    --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.3), 0 16px 40px -8px rgba(0, 0, 0, 0.55), 0 40px 80px -30px rgba(2, 44, 34, 0.6);
    --glow: 0 0 0 1px rgba(52, 211, 153, 0.14), 0 24px 70px -22px rgba(52, 211, 153, 0.3);
    --side-bg: linear-gradient(180deg, #0d1d33 0%, #060d18 100%);
  }
}
:root[data-region="us"][data-theme="dark"] {
  --bg: #0a111e;
  --bg-2: #0c1524;
  --surface: rgba(17, 27, 45, 0.85);
  --surface-solid: #111b2d;
  --surface-2: #16233a;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.26);
  --text: #f1f5f9;
  --text-2: #b4c0d3;
  --text-3: #7c8aa2;
  --accent: #34d399;
  --accent-2: #6ee7b7;
  --accent-ink: #a7f3d0;
  --accent-tint: rgba(52, 211, 153, 0.15);
  --on-accent: #032b1e;
  --bar: #1f5f4b;
  --empty-ring: #1e2a40;
  --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.3), 0 16px 40px -8px rgba(0, 0, 0, 0.55), 0 40px 80px -30px rgba(2, 44, 34, 0.6);
  --glow: 0 0 0 1px rgba(52, 211, 153, 0.14), 0 24px 70px -22px rgba(52, 211, 153, 0.3);
  --side-bg: linear-gradient(180deg, #0d1d33 0%, #060d18 100%);
}
[data-region="us"] body {
  background: radial-gradient(900px 600px at 90% -10%, rgba(16, 185, 129, 0.1), transparent 60%), radial-gradient(800px 700px at -10% 20%, rgba(37, 99, 235, 0.08), transparent 60%), linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
}
[data-region="us"] .side-household, [data-region="us"] .side-foot, [data-region="us"] .side-who small { color: #9fb0c8; }
[data-region="us"] .nav-link.active { background: linear-gradient(90deg, rgba(52, 211, 153, 0.22), rgba(52, 211, 153, 0.05)); box-shadow: inset 3px 0 0 #34d399; }
[data-region="us"] .nav-link.primary, [data-region="us"] .aa-scan, [data-region="us"] .ba-scan { background: linear-gradient(135deg, #10b981, #047857); box-shadow: 0 10px 24px -10px rgba(5, 150, 105, 0.7); }
[data-region="us"] .nav-link.voice, [data-region="us"] .aa-voice, [data-region="us"] .ba-voice, [data-region="us"] .mic-btn { background: linear-gradient(135deg, #3b82f6, #1e40af); box-shadow: 0 10px 24px -10px rgba(30, 64, 175, 0.7); }
[data-region="us"] .speak-fab { background: linear-gradient(135deg, #3b82f6, #1e40af); box-shadow: 0 16px 32px -10px rgba(30, 64, 175, 0.6), 0 0 0 4px rgba(59, 130, 246, 0.2); }
[data-region="us"] .example-chip { border-color: rgba(59, 130, 246, 0.45); background: rgba(59, 130, 246, 0.08); }
[data-region="us"] .btn-primary { background: linear-gradient(135deg, #10b981, #059669 55%, #047857); box-shadow: 0 10px 24px -12px rgba(5, 150, 105, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
[data-region="us"] .btn-primary:hover { box-shadow: 0 14px 30px -12px rgba(5, 150, 105, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
[data-region="us"] .hero-card, [data-region="us"] .sub-hero { background: linear-gradient(135deg, #0f2440 0%, #123a5c 55%, #047857 125%); }
[data-region="us"] .hero-card::before { background: radial-gradient(circle, rgba(52, 211, 153, 0.35), transparent 65%); }
[data-region="us"] .hero-card .link-cta { color: #a7f3d0; }
[data-region="us"] .welcome-back { background: linear-gradient(120deg, color-mix(in srgb, #10b981 12%, var(--surface)), color-mix(in srgb, #3b82f6 10%, var(--surface))); }
[data-region="us"] .nw-needs, [data-region="us"] .sb-needs { background: linear-gradient(180deg, #34d399, #047857); }
[data-region="us"] .sw-needs { background: #059669; }
[data-region="us"] .avatar, [data-region="us"] .lang-pill { background: linear-gradient(135deg, #10b981, #2563eb); }
[data-region="us"] .lang-pill.glow { animation-name: langGlowUs; }
@keyframes langGlowUs { 0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); } 50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); } }
/* Welcome card: a navy "statement" with green highlights instead of the purple jewel. */
[data-region="us"] .wa-glow { background: radial-gradient(closest-side, rgba(16, 185, 129, 0.4), transparent), radial-gradient(closest-side at 70% 70%, rgba(59, 130, 246, 0.35), transparent); }
[data-region="us"] .wa-receipt { background: radial-gradient(120% 80% at 100% 0%, rgba(16, 185, 129, 0.32), transparent 55%), radial-gradient(90% 70% at 0% 100%, rgba(59, 130, 246, 0.3), transparent 60%), linear-gradient(150deg, #0f2440, #0b1c33 55%, #071222); box-shadow: 0 50px 90px -30px rgba(15, 36, 64, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 1px 0 rgba(255, 255, 255, 0.3) inset; }
[data-region="us"] .wa-eyebrow, [data-region="us"] .wa-ring small { color: #9fe7c8; }
[data-region="us"] .wa-total strong { background: linear-gradient(90deg, #fff, #a7f3d0); -webkit-background-clip: text; background-clip: text; }
[data-region="us"] .wa-ring { background: conic-gradient(#34d399, #60a5fa calc(var(--p) * 1%), rgba(255, 255, 255, 0.14) 0); box-shadow: 0 0 24px rgba(52, 211, 153, 0.3); }
[data-region="us"] .wa-ring > span { background: #0b1c33; }
[data-region="us"] .wa-alert { background: linear-gradient(135deg, #f59e0b, #ea580c); }

/* Coming up: bills & subscriptions (US home, right under the month's total). */
.recurring-card { display: grid; gap: 12px; }
.recurring-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.recurring-head p { margin: 0; }
.recurring-total { margin-top: 4px !important; color: var(--text-2); }
.recurring-total strong { font-size: 1.5rem; color: var(--text); font-variant-numeric: tabular-nums; }
.recurring-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.recurring-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--text); text-decoration: none; }
.recurring-list a:hover { background: var(--accent-tint); }
.recurring-list .grow { display: grid; min-width: 0; }
.recurring-list .grow strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recurring-list small { color: var(--text-2); }
.recurring-list small.soon { color: var(--warn); font-weight: 700; }
.recurring-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface-solid); font-size: 1.1rem; }

/* Plans & pricing (#/plans, also before sign-in). */
.plans-public { max-width: 1040px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px); }
.plans-page .page-head { align-items: center; }
.plans-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.plan { position: relative; display: grid; gap: 8px; }
.plan h2 { margin: 0; font-size: 1.2rem; }
.plan-price { margin: 0; }
.plan-price strong { font-size: 2.2rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan-price span { color: var(--text-2); }
.plan-year { margin: 0; color: var(--text-2); font-size: 0.9rem; }
.plan-features { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.plan-features li { display: flex; gap: 8px; }
.plan-features li span { color: var(--good); font-weight: 900; }
.plan-star { border: 2px solid var(--accent); box-shadow: var(--glow); }
.plan-badge { justify-self: start; padding: 3px 10px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 0.78rem; font-weight: 800; }
.plans-note { text-align: center; }
.plans-cta { justify-self: center; }
.plans-page { display: grid; gap: 16px; }
@media (max-width: 820px) { .plans-grid { grid-template-columns: minmax(0, 1fr); } }

/* Connect your bank (Automatic payments page). */
.bank-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bank-links li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.bank-links .grow { display: grid; min-width: 0; flex: 1 1 180px; }
.bank-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--text-2); font-size: 0.92rem; }
.bank-picks { display: grid; gap: 8px; }

/* Privacy policy (/privacy.html): a plain readable page. */
.legal { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; line-height: 1.65; }
.legal h1 { font-size: 2rem; margin: 8px 0 4px; }
.legal h2 { font-size: 1.2rem; margin: 28px 0 8px; }
.legal li { margin: 6px 0; }

.consent-line { margin: 4px 0 0; text-align: center; }
.danger-card { border: 1px solid color-mix(in srgb, var(--bad) 30%, var(--line)); }
.danger-card h2 { margin-top: 0; }
.del-list { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }

/* Reminders: the "turn on" pop-up and the in-app morning / evening card. */
.rem-ask-art { font-size: 3rem; text-align: center; line-height: 1; margin-bottom: 4px; }
.rem-ask-list { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 8px; }
.rem-ask-list li { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.ios-steps { margin: 4px 0 12px; }
.nudge-card { display: grid; gap: 10px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface)); }
.nudge-evening { background: linear-gradient(120deg, color-mix(in srgb, #6366f1 14%, var(--surface)), var(--surface)); }
.nudge-head { display: flex; gap: 12px; align-items: flex-start; }
.nudge-head p { margin: 2px 0 0; color: var(--text-2); }
.forgot-link { margin-top: -6px; }
.pin-other { display: block; margin: 6px auto 0; }
.pin-offer-input { width: 100%; font-size: 1.6rem; text-align: center; letter-spacing: 0.4em; }

/* Talk to BillGem: the expense it just added, with Undo / Edit. */
.speak-added { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--line); display: grid; gap: 6px; }
.speak-added-row { display: flex; align-items: center; gap: 10px; }
.speak-added-row strong { font-size: 1.3rem; }
.speak-added p { margin: 0; }
.bubble .grow { min-width: 0; }

/* Automatic payments: one recommended way up top, the rest folded; instructions folded until asked for. */
.auto-hero { border: 2px solid color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--glow); }
.auto-status { margin: 0; }
.other-ways > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.other-ways > summary::before { content: "▸"; color: var(--text-2); transition: transform 0.15s; }
.other-ways[open] > summary::before { transform: rotate(90deg); }
.other-ways[open] > summary { margin-bottom: 12px; }
.other-ways .auto-card { box-shadow: none; border: 1px solid var(--line); }
.auto-how > summary { cursor: pointer; font-weight: 700; color: var(--accent-ink); padding: 6px 0; }
.shortcut-btn { justify-self: start; }

/* Upload a statement (#/import). */
.stmt-pick, .stmt-done, .stmt-reading { display: grid; gap: 10px; justify-items: start; }
.stmt-art { font-size: 2.6rem; line-height: 1; }
.stmt-art.spin { animation: stmtSpin 1.6s linear infinite; }
@keyframes stmtSpin { to { transform: rotate(360deg); } }
.stmt-where { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); font-size: 0.92rem; }
.stmt-review { display: grid; gap: 12px; }
.stmt-group > summary { cursor: pointer; padding: 6px 0; }
.stmt-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.stmt-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.stmt-row .grow { display: grid; min-width: 0; }
.stmt-row .grow strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stmt-row .stmt-cat { grid-column: 2 / 4; justify-self: start; max-width: 100%; min-height: 34px; padding: 4px 8px; font-size: 0.85rem; }
.stmt-check input { width: 20px; height: 20px; }
.stmt-muted { opacity: 0.85; }
.stmt-amt { font-variant-numeric: tabular-nums; }
.stmt-actions { position: sticky; bottom: 12px; display: grid; gap: 6px; background: var(--surface-solid); padding: 10px; border-radius: 16px; box-shadow: var(--shadow-2); }
@media (min-width: 821px) { .stmt-row { grid-template-columns: auto minmax(0, 1fr) auto 220px; } .stmt-row .stmt-cat { grid-column: auto; justify-self: end; } }
/* Above the phone bottom menu (whose raised Scan button sticks up about 14px). */
@media (max-width: 820px) { .stmt-actions { bottom: calc(110px + env(safe-area-inset-bottom)); } }

/* Add a trip: From ⇅ To, date + fare, then how you travelled. */
.trip-form { gap: 12px; }
.trip-route { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 8px; }
.trip-swap { margin-bottom: 4px; font-size: 1.2rem; }
.trip-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.trip-modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.trip-mode { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 0.78rem; font-weight: 650; cursor: pointer; }
.trip-mode span { font-size: 1.3rem; }
.trip-mode.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* "Worth the drive?" */
.drive-card .drive-edit { margin: 10px 0 14px; }
.drive-card .drive-edit > summary { cursor: pointer; font-weight: 650; padding: 8px 0; }
.drive-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 10px; }
.drive-shops { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.drive-shop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; background: var(--surface-2, var(--accent-tint)); }
.drive-shop .grow { flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; }
.drive-shop input.drive-km { width: 6.5em; flex: 0 0 auto; }
.drive { margin-top: 6px; border-top: 1px dashed var(--line-strong); padding-top: 6px; }
.drive p { margin: 2px 0; }
.drive-yes { color: var(--good); font-weight: 650; }
.drive-maybe { color: var(--accent-ink); font-weight: 650; }
.drive-no { color: var(--bad); font-weight: 650; }
.drive-ask { display: inline-block; margin-top: 6px; font-weight: 650; }

/* Life admin: warranties, renewals & dates, home help, shopping list */
.life-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chip-btn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.life-months { max-width: 10em; margin-bottom: 10px; }
.life-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.life-rows > li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.life-rows .grow { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.life-ic { font-size: 1.5rem; width: 2.2rem; text-align: center; flex: 0 0 auto; }
.life-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.life-group { margin: 14px 0 8px; font-size: 0.95rem; color: var(--muted); }
.life-group:first-child { margin-top: 0; }
.life-date.soon .life-when { color: var(--warn); font-weight: 700; }
.life-date.late { background: var(--bad-bg); }
.life-date.late .life-when { color: var(--bad); font-weight: 700; }
.life-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.life-kind { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 0.82rem; font-weight: 650; cursor: pointer; text-align: center; }
.life-kind span { font-size: 1.4rem; }
.life-kind.used { opacity: 0.6; }
.life-kind.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.war-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.war-card { display: grid; gap: 6px; }
.war-card p { margin: 0; }
.war-head { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.war-head .grow { flex: 1 1 140px; overflow-wrap: anywhere; }
.war-chip-ok { background: var(--good-bg); color: var(--good); }
.war-chip-soon { background: var(--warn-bg); color: var(--warn); }
.war-chip-over { background: var(--surface-2); color: var(--muted); }
.war-soon .target-fill { background: var(--warn); }
.war-over { opacity: 0.75; }

.help-card { display: grid; gap: 10px; }
.help-head { display: flex; align-items: center; gap: 10px; }
.help-head h2 { margin: 0; }
.help-head p { margin: 0; }
.help-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; max-width: 420px; }
.help-wd { text-align: center; font-size: 0.75rem; color: var(--muted); font-weight: 700; }
.help-cell { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 0.85rem; font-weight: 650; cursor: pointer; padding: 0; }
.help-cell.blank { border: 0; background: none; cursor: default; }
.help-cell.here { background: var(--good-bg); border-color: transparent; }
.help-cell.off { color: var(--muted); opacity: 0.55; }
.help-cell.absent { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); text-decoration: line-through; }
.help-cell.extra { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.help-cell.today { box-shadow: 0 0 0 2px var(--text) inset; }
.help-cell:disabled { cursor: default; }
.help-legend { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 0; }
.help-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot.here { background: var(--good-bg); border: 1px solid var(--good); }
.dot.absent { background: var(--bad-bg); border: 1px solid var(--bad); }
.dot.extra { background: var(--accent); }
.help-sum p { margin: 2px 0; }
.help-owe { font-size: 1.25rem; font-weight: 800; }
.help-days { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.help-total { font-weight: 700; color: var(--accent-ink); }
.page > .month-nav { display: flex; flex-wrap: wrap; }

.list-add { display: flex; gap: 8px; }
.list-add input { flex: 1 1 auto; min-width: 0; }
.list-items { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; }
.list-item { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.list-item label { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.list-item input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); flex: 0 0 auto; }
.list-item.done .list-name { text-decoration: line-through; color: var(--muted); }
.list-low h2 { margin-top: 0; }

/* Picture menu: five big groups (home screen, #/menu) and big picture buttons inside each */
.hub-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.hub-tile { display: grid; justify-items: center; align-content: center; gap: 6px; padding: 16px 6px; min-height: 108px; border-radius: 20px; text-decoration: none !important; color: var(--text); background: color-mix(in srgb, var(--c) 14%, var(--surface)); border: 2px solid color-mix(in srgb, var(--c) 35%, transparent); box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.06)); }
.hub-ic { font-size: 2.4rem; line-height: 1; }
.hub-name { font-weight: 800; font-size: 1rem; text-align: center; }
.hub-tile:active { transform: scale(0.97); }
@media (max-width: 640px) {
  .hub-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hub-tile { min-height: 96px; }
}
@media (max-width: 380px) { .hub-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hub-page .page-head h1 { font-size: 1.8rem; }
.hub-back { display: inline-block; margin-bottom: 6px; font-weight: 700; text-decoration: none; }
.hub-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.hub-btn { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 130px; padding: 16px 8px; border-radius: 20px; text-decoration: none !important; color: var(--text); background: var(--surface); border: 2px solid color-mix(in srgb, var(--c) 40%, transparent); box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.06)); text-align: center; }
.hub-btn-ic { font-size: 2.8rem; line-height: 1; width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
.hub-btn-name { font-weight: 800; font-size: 1.05rem; }
.hub-btn:active { transform: scale(0.97); }
@media (max-width: 420px) { .hub-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hub-signout { margin-top: 18px; }
.nav-group { margin: 14px 0 4px; padding: 0 12px; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.nav-group a { color: inherit; opacity: 0.75; text-decoration: none; }
.nav-sub { padding-left: 18px; }

/* "Tell me": reads the screen aloud */
.tell-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 99px; border: 2px solid var(--accent); background: var(--accent-tint); color: var(--accent-ink); font: inherit; font-weight: 800; cursor: pointer; white-space: nowrap; }
.tell-btn span[aria-hidden] { font-size: 1.1rem; }
@media (max-width: 520px) { .tell-label { display: none; } .tell-btn { padding: 0 10px; } }
.tell-card { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: 70px; width: min(560px, calc(100vw - 32px)); display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 2px solid var(--accent); box-shadow: 0 12px 40px rgba(0,0,0,0.18); font-size: 1.05rem; animation: tell-in 0.2s ease-out; }
.tell-card p { margin: 0 0 4px; }
.tell-ic { font-size: 1.6rem; }
@keyframes tell-in { from { opacity: 0; transform: translate(-50%, -8px); } }
@media (prefers-reduced-motion: reduce) { .tell-card { animation: none; } }
@media (max-width: 380px) { .hub-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .hub-ic { font-size: 2rem; } .hub-name { font-size: 0.9rem; } }
@media (max-width: 330px) { .hub-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Phones: room for "Tell me" in the top bar (logo only, a narrower language box, no theme switch; it's in Settings) */
@media (max-width: 480px) {
  .topbar { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .brand-mini { font-size: 0; gap: 0; }
  .topbar .lang-select { max-width: 92px; }
  .topbar .theme-toggle { display: none; }
}
.acct-theme { display: none; }
@media (max-width: 480px) { .acct-theme { display: flex; } }

/* Money in & out (Cash Book style), udhaar, family inflation */
.money-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.money-totals.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.money-tot { display: grid; gap: 4px; padding: 14px 12px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); text-align: center; }
.money-tot span { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.money-tot strong { font-size: 1.35rem; font-weight: 850; overflow-wrap: anywhere; }
.money-tot.in { border-color: color-mix(in srgb, var(--good) 45%, transparent); background: var(--good-bg); }
.money-tot.in strong { color: var(--good); }
.money-tot.out { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-bg); }
.money-tot.out strong { color: var(--bad); }
.money-tot.left strong { color: var(--accent-ink); }
.money-tot.left.neg strong { color: var(--bad); }
.money-big-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.money-big { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 72px; border-radius: 20px; border: 0; font: inherit; font-size: 1.2rem; font-weight: 850; color: #fff; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,0.12); }
.money-big span { font-size: 1.6rem; }
.money-big.in { background: #16a34a; }
.money-big.out { background: #dc2626; }
.money-big:active { transform: scale(0.98); }
.money-in-btn { background: #16a34a; color: #fff; border-color: #16a34a; }
.money-out-btn { background: #dc2626; color: #fff; border-color: #dc2626; }
.money-in-title { color: #16a34a; }
.money-out-title { color: #dc2626; }
.money-amount { font-size: 1.8rem !important; font-weight: 800; text-align: center; }
.money-now { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.05rem; margin: 0; }
.money-opening-ask { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.money-opening-ask small { display: block; }
.book-days { display: grid; gap: 10px; }
.book-day { padding: 12px 14px; }
.book-day-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.book-bal { font-size: 0.9rem; color: var(--muted); }
.book-bal strong { color: var(--text); }
.book-bal.neg strong { color: var(--bad); }
.book-entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.book-entry { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line); }
.book-entry:first-child { border-top: 0; }
.book-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none !important; }
.book-entry .grow { min-width: 0; overflow-wrap: anywhere; }
.book-ic { font-size: 1.4rem; width: 2rem; text-align: center; flex: 0 0 auto; }
.book-amt { white-space: nowrap; font-size: 1.05rem; }
.book-amt.in { color: var(--good); }
.book-amt.out { color: var(--bad); }
.book-del { min-width: 30px; height: 30px; font-size: 0.85rem; }
.money-home { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; text-decoration: none !important; color: var(--text); padding: 12px; }
.money-home-tot { display: grid; text-align: center; gap: 2px; }
.money-home-tot small { color: var(--muted); font-weight: 700; }
.money-home-tot strong { font-size: 1.15rem; }
.money-home-tot.in strong { color: var(--good); }
.money-home-tot.out strong { color: var(--bad); }
.money-home-tot.left strong { color: var(--accent-ink); }
.money-home-tot.left.neg strong { color: var(--bad); }
@media (max-width: 420px) { .money-tot strong { font-size: 1.1rem; } .money-big { font-size: 1.05rem; min-height: 64px; } }

.udh-people { list-style: none; padding: 6px 10px; display: grid; }
.udh-person { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-top: 1px solid var(--line); color: inherit; text-decoration: none !important; }
.udh-people li:first-child .udh-person { border-top: 0; }
.udh-person .grow { min-width: 0; overflow-wrap: anywhere; }
.udh-amt { display: grid; text-align: right; font-weight: 850; font-size: 1.1rem; }
.udh-amt small { font-size: 0.72rem; font-weight: 700; }
.udh-amt.get { color: var(--good); }
.udh-amt.give { color: var(--bad); }
.udh-balance { font-size: 1.2rem; text-align: center; }
.udh-balance.get { background: var(--good-bg); color: var(--good); }
.udh-balance.give { background: var(--bad-bg); color: var(--bad); }
.udh-entries { padding: 6px 12px; }

.infl-hero { text-align: center; }
.infl-big { font-size: 3rem; font-weight: 900; margin: 4px 0; line-height: 1.1; }
.infl-rows { list-style: none; margin: 0; padding: 0; display: grid; }
.infl-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--line); }
.infl-row:first-child { border-top: 0; }
.infl-row .grow { min-width: 0; overflow-wrap: anywhere; }
.infl-pct { white-space: nowrap; }
.infl-pct.up { color: var(--bad); }
.infl-pct.down { color: var(--good); }

/* ===================================================================================================
   Look refresh: one rich main card, round quick actions, a swipeable "for you" strip, payment-app style
   picture icons, calmer cards with clear section titles. Placed last so it wins over older rules.
   =================================================================================================== */

/* Section titles on the home screen */
.sec-title { margin: 6px 2px -8px; font-size: 1.05rem; font-weight: 850; letter-spacing: -0.01em; }

/* Main card: deeper colour, bigger number, soft shine */
.hero-card { padding: 22px 22px 18px; border-radius: 28px; background: radial-gradient(120% 140% at 0% 0%, #5b21b6 0%, #4c1d95 40%, #2e1065 100%); box-shadow: 0 24px 50px -22px rgba(76, 29, 149, 0.75); }
.hero-card::before { background: radial-gradient(circle, rgba(255, 140, 70, 0.55), transparent 65%); }
.hero-card::after { content: ""; position: absolute; left: -60px; bottom: -120px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(168, 85, 247, 0.45), transparent 70%); pointer-events: none; }
.hero-card > * { position: relative; z-index: 1; }
.hero-amount { font-size: clamp(2.3rem, 9vw, 3.2rem) !important; font-weight: 900; letter-spacing: -0.02em; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25); }
.hero-card .chip { backdrop-filter: blur(6px); }
.hero-money { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-decoration: none !important; }
.hero-money > span { display: grid; gap: 2px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.16); color: #fff; }
.hero-money small { font-size: 0.78rem; font-weight: 700; color: rgba(255, 255, 255, 0.78); }
.hero-money strong { font-size: 1.25rem; font-weight: 850; }
.hero-money .neg strong { color: #fecdd3; }

/* Round quick actions */
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 14px 8px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.qa { display: grid; justify-items: center; gap: 8px; text-decoration: none !important; color: var(--text); font-weight: 750; font-size: 0.86rem; text-align: center; }
.qa-ic { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; font-size: 1.65rem; color: #fff; box-shadow: 0 10px 20px -10px var(--qa-shadow, rgba(0, 0, 0, 0.4)); transition: transform 0.15s; }
.qa:active .qa-ic { transform: scale(0.92); }
.qa-photo .qa-ic { background: linear-gradient(140deg, #ff8a4c, #f43f5e); --qa-shadow: rgba(244, 63, 94, 0.8); }
.qa-voice .qa-ic { background: linear-gradient(140deg, #a855f7, #6d28d9); --qa-shadow: rgba(109, 40, 217, 0.8); }
.qa-in .qa-ic { background: linear-gradient(140deg, #34d399, #059669); --qa-shadow: rgba(5, 150, 105, 0.8); font-weight: 900; }
.qa-out .qa-ic { background: linear-gradient(140deg, #fb7185, #dc2626); --qa-shadow: rgba(220, 38, 38, 0.8); font-weight: 900; }
.qa-label { line-height: 1.2; }

/* "For you": swipe through tips, warnings and greetings */
.tip-strip { display: grid; gap: 8px; min-width: 0; }
.tip-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px 2px 6px; margin: 0 -2px; overscroll-behavior-x: contain; }
.tip-track::-webkit-scrollbar { display: none; }
.tip-slide { flex: 0 0 86%; scroll-snap-align: start; display: grid; min-width: 0; }
@media (min-width: 900px) { .tip-slide { flex-basis: calc(50% - 6px); } }
.tip-slide > * { margin: 0 !important; height: 100%; box-sizing: border-box; animation: none !important; }
.tip-dots { display: flex; justify-content: center; gap: 6px; }
.tip-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line-strong); transition: width 0.2s, background 0.2s; }
.tip-dots i.on { width: 20px; background: var(--accent); }

/* Picture menu as round colour icons (home screen and #/menu) */
.hub-tiles { gap: 6px; padding: 14px 6px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
.hub-tile { min-height: 0 !important; padding: 4px 2px !important; background: transparent !important; border: 0 !important; box-shadow: none !important; gap: 8px; }
.hub-ic { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 20px; font-size: 1.75rem !important; background: color-mix(in srgb, var(--c) 18%, var(--surface-solid)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent); }
.hub-name { font-size: 0.84rem !important; font-weight: 750; line-height: 1.2; }
@media (max-width: 360px) { .hub-ic { width: 50px; height: 50px; font-size: 1.5rem !important; } .hub-name { font-size: 0.76rem !important; } }
.hub-page .hub-tiles { padding: 22px 10px; row-gap: 18px; }
@media (max-width: 520px) { .hub-page .hub-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }

/* Calmer cards: a bit more air, rounder, softer edge */
.card { border-radius: 24px; }
.card h2 { font-weight: 800; }
.page { gap: 18px; }
.recurring-card .recurring-list a { border-radius: 16px; }

/* Phones: a lighter bottom bar with a clear active tab */
@media (max-width: 860px) {
  .tabbar { border-radius: 26px; box-shadow: 0 18px 40px -16px rgba(45, 20, 110, 0.45); }
  .tab.active { font-weight: 800; }
  .tab.active .nav-ic { transform: translateY(-1px) scale(1.08); }
}

/* Screens appear quickly (long fades looked washed out on slow phones) */
main.enter > * { animation-duration: 0.25s; }
.qa-in .qa-ic, .qa-out .qa-ic { font-size: 2.1rem; font-weight: 800; line-height: 1; padding-bottom: 3px; }
.hero-card .spark-area, .hero-card svg.spark { max-height: 70px; }
/* Inside the "for you" strip every card is compact and the same height */
.tip-slide .today-card { padding: 16px; gap: 12px; align-items: center; }
.tip-slide .today-face { font-size: 2.6rem; }
.tip-slide .today-big { font-size: 1.15rem; }
.tip-slide .today-sub { font-size: 0.92rem; }
.tip-slide .card, .tip-slide .welcome-back, .tip-slide .home-renewal, .tip-slide .banner { padding: 14px 16px; }
.tip-track { align-items: stretch; }
.tip-slide { max-height: 220px; }
.tip-slide > * { overflow: hidden; }
.hub-tile { align-content: start !important; }
.hub-name { min-height: 2.4em; display: block; }
.hub-add .hub-ic { background: linear-gradient(140deg, #ff8a4c, #f97316) !important; color: #fff; font-weight: 900; font-size: 2.2rem !important; box-shadow: 0 10px 20px -10px rgba(249, 115, 22, 0.9) !important; }
/* Simple mode: the two big doors fill the width, right under "Today" */
html.simple .big-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.simple .big-action { min-height: 130px; align-content: center; font-size: 1.15rem; }
html.simple .big-action .ba-ic { font-size: 2.6rem; }
/* Menu: every screen, grouped, round icons */
.svc-group h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.svc-head-ic { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 10px; font-size: 1.05rem; color: #fff; background: var(--c); font-weight: 900; }
.svc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; }
@media (min-width: 700px) { .svc-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.svc { display: grid; justify-items: center; align-content: start; gap: 6px; text-decoration: none !important; color: var(--text); text-align: center; }
.svc-ic { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; font-size: 1.6rem; background: color-mix(in srgb, var(--c) 15%, var(--surface-solid)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent); transition: transform 0.15s; }
.svc:active .svc-ic { transform: scale(0.92); }
.svc-name { font-size: 0.78rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }

/* Sign-in on phones: one screen, no scrolling. The sample-phone picture is only for bigger screens; the card
   becomes the page; the six feature tiles shrink to one row of icons. */
@media (max-width: 640px) {
  .auth { min-height: 100dvh; padding: max(14px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom)); gap: 0; align-items: start; }
  .auth .welcome-art, .auth .auth-hero { display: none !important; }
  .auth-card { max-width: none; background: transparent !important; border: 0 !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; padding: 0 !important; gap: 12px; }
  .auth-card h1 { font-size: 1.55rem; margin-top: 6px; }
  .auth-card .lead { font-size: 0.95rem; margin: 0; }
  .auth-top .brand-big img { width: 36px; height: 36px; }
  .auth-choices .btn-lg { min-height: 52px; padding-top: 10px; padding-bottom: 10px; }
  .auth-family-hint { padding: 10px 12px; font-size: 0.86rem; }
  .auth-family-hint > span { font-size: 1.15rem; }
  .welcome-points { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: 0; }
  .welcome-points li { font-size: 0; padding: 8px 0; gap: 0; background: transparent; }
  .welcome-points li span { font-size: 1.35rem; }
  .welcome-trust { font-size: 0.76rem; }
}
@media (max-width: 640px) and (max-height: 700px) {
  .auth-card .lead { display: none; }
  .welcome-points { display: none; }
}
@media (max-width: 640px) { .auth { align-items: center; align-content: center; } }
/* "Tap to answer": the microphone pulses when BillGem asked something back (iPhone) */
.big-mic.tap-me { animation: tap-me 1.2s ease-in-out infinite; box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.6); }
@keyframes tap-me { 0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.55); } 70% { box-shadow: 0 0 0 22px rgba(124, 58, 237, 0); } 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); } }
@media (prefers-reduced-motion: reduce) { .big-mic.tap-me { animation: none; outline: 4px solid var(--accent); } }
.mic-steps { margin: 0 0 8px; padding-left: 22px; display: grid; gap: 10px; font-size: 1.02rem; line-height: 1.45; }
/* iPhone without listening: speak with the keyboard's 🎤 */
.kb-hint { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface)); border: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.kb-hint p { margin: 4px 0 0; color: var(--text-2); line-height: 1.45; }
.kb-hint-ic { font-size: 1.7rem; line-height: 1; white-space: nowrap; }
.kb-hint[hidden] { display: none; }
/* Voice: the microphone breathes with your voice while recording */
.listening .mic-ic, .big-mic.listening span, .mic-btn.listening .mic-ic { display: inline-block; transform: scale(calc(1 + var(--mic-level, 0) * 0.35)); transition: transform 0.1s linear; }
.big-mic.listening { box-shadow: 0 0 0 calc(6px + var(--mic-level, 0) * 26px) color-mix(in srgb, var(--accent) 25%, transparent); transition: box-shadow 0.1s linear; }
.ql.thinking .ql-mic { opacity: 0.6; }
.btn-thank { background: #16a34a; color: #fff !important; border-color: #16a34a; font-weight: 800; }

/* ---------- Features page (#/features): dark ember hero, sticky topic tabs, picture banners, mini screens ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.feat-page { --fe: #ff6a3d; --fe-ink: #c2410c; --scr: #16111f; --scr-2: #221a30; display: grid; gap: 0; max-width: 1120px; margin: 0 auto; color: var(--text); }
.feat-public { padding: 0 0 24px; }
.feat-hero { position: relative; overflow: hidden; text-align: center; padding: clamp(48px, 9vw, 104px) 20px clamp(56px, 9vw, 112px); border-radius: var(--radius); color: #fff;
  background: radial-gradient(120% 90% at 50% 120%, rgba(255, 106, 61, 0.95) 0%, rgba(214, 64, 22, 0.75) 28%, rgba(60, 18, 20, 0.6) 55%, transparent 75%), linear-gradient(180deg, #0d0a12 0%, #1d0f12 100%); }
.feat-public .feat-hero { border-radius: 0 0 var(--radius) var(--radius); }
.feat-hero h1 { font-size: clamp(2.1rem, 6.4vw, 4.2rem); line-height: 1.04; letter-spacing: -0.02em; font-weight: 800; max-width: 15ch; margin: 14px auto 16px; position: relative; }
.feat-hero-sub { font-size: clamp(1.05rem, 2.2vw, 1.3rem); max-width: 34rem; margin: 0 auto 28px; color: rgba(255, 255, 255, 0.86); position: relative; }
.feat-kicker { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; letter-spacing: 0.04em; position: relative; }
.feat-gem { color: var(--fe); display: inline-block; transform: scale(1.2); }
.feat-hero .feat-gem { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; border: 2px solid var(--fe); transform: none; font-size: 1.3rem; margin-right: 4px; }
.feat-hero-gem { position: absolute; right: -6%; top: 18%; font-size: clamp(12rem, 30vw, 24rem); line-height: 1; color: transparent; -webkit-text-stroke: 2px rgba(0, 0, 0, 0.28); pointer-events: none; }
.feat-cta.btn { background: var(--fe); color: #fff; border: 0; font-weight: 700; padding: 13px 26px; border-radius: 8px; box-shadow: 0 10px 30px -10px rgba(255, 106, 61, 0.7); justify-self: center; position: relative; }
.feat-cta.btn:hover { filter: brightness(1.07); }
.feat-tabs { position: sticky; top: 0; z-index: 5; display: flex; justify-content: center; gap: clamp(20px, 7vw, 64px); padding: 16px 12px; margin-top: -1px; background: var(--surface-solid); border-bottom: 1px solid var(--line); box-shadow: 0 8px 20px -16px rgba(0, 0, 0, 0.4); }
.feat-tabs button { background: none; border: 0; color: var(--text); font: inherit; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.92rem; padding: 6px 2px; border-bottom: 2px solid transparent; cursor: pointer; }
.feat-tabs button:hover, .feat-tabs button:focus-visible { border-bottom-color: var(--fe); color: var(--fe); }
.feat-lead { text-align: center; font-size: clamp(1.7rem, 4.4vw, 2.8rem); line-height: 1.12; letter-spacing: -0.01em; font-weight: 700; max-width: 18ch; margin: clamp(48px, 8vw, 88px) auto clamp(36px, 6vw, 64px); }
.feat-sec { display: grid; gap: 28px; padding-bottom: clamp(56px, 8vw, 96px); scroll-margin-top: 64px; }
.feat-banner { position: relative; overflow: hidden; min-height: clamp(260px, 36vw, 400px); display: grid; align-items: end; padding: clamp(22px, 4vw, 44px); border-radius: var(--radius); color: #fff; }
.feat-track .feat-banner { background: radial-gradient(80% 120% at 85% 30%, #ff8a4c 0%, transparent 60%), linear-gradient(120deg, #1b1033 0%, #4c1d95 100%); }
.feat-save .feat-banner { background: radial-gradient(80% 120% at 85% 30%, #34d399 0%, transparent 60%), linear-gradient(120deg, #052e2b 0%, #0f766e 100%); }
.feat-home .feat-banner { background: radial-gradient(80% 120% at 85% 30%, #fbbf24 0%, transparent 60%), linear-gradient(120deg, #0c1a3a 0%, #1d4ed8 100%); }
.feat-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, 0.55) 0%, transparent 60%); pointer-events: none; }
.feat-banner-text { position: relative; z-index: 1; max-width: 32rem; }
.feat-banner h2 { font-size: clamp(1.8rem, 4.6vw, 3rem); line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 10px; }
.feat-banner p { font-size: clamp(1rem, 2vw, 1.2rem); margin: 0; color: rgba(255, 255, 255, 0.9); }
.feat-banner-art { position: absolute; right: clamp(8px, 4vw, 48px); top: 50%; transform: translateY(-58%); display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(8px, 2vw, 18px); }
.feat-banner-art span { width: clamp(64px, 11vw, 120px); aspect-ratio: 1; display: grid; place-items: center; font-size: clamp(2rem, 5.4vw, 3.8rem); border-radius: 28%; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.22); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); }
.feat-banner-art span:nth-child(2) { transform: translateY(22%) rotate(6deg); }
.feat-banner-art span:nth-child(3) { transform: rotate(-6deg); }
.feat-banner-art span:nth-child(4) { transform: translateY(22%); }
.feat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2.4vw, 28px); }
.feat-card { display: grid; justify-items: center; align-content: start; text-align: center; gap: 8px; }
.feat-card h3 { font-size: 1.22rem; margin: 6px 0 0; }
.feat-card p { margin: 0; color: var(--text-2); max-width: 26ch; line-height: 1.45; }
.feat-screen { width: 100%; aspect-ratio: 4 / 3; background: var(--scr); color: #fff; border-radius: 18px; padding: clamp(14px, 2vw, 20px); display: grid; align-content: start; gap: 8px; text-align: left; box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.55); margin-bottom: 8px; overflow: hidden; }
.fm-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.95rem; padding-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.fm-logo { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; border: 1.5px solid var(--fe); color: var(--fe); font-size: 0.7rem; }
.fm-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--scr-2); font-size: 0.88rem; }
.fm-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255, 255, 255, 0.82); }
.fm-row strong { font-variant-numeric: tabular-nums; }
.fm-total { background: none; border-top: 1px dashed rgba(255, 255, 255, 0.18); border-radius: 0; color: var(--fe); }
.fm-good strong, .fm-good > span:first-child { color: #4ade80; }
.fm-bad strong { color: #fb7185; }
.fm-warn strong { color: #fbbf24; }
.fm-note { margin: -2px 0 2px 10px; font-size: 0.78rem; color: rgba(255, 255, 255, 0.6); }
.fm-mic { justify-self: center; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: #7c3aed; box-shadow: 0 0 0 8px rgba(124, 58, 237, 0.25); margin: 4px 0; }
.fm-bars { display: flex; align-items: end; gap: 5px; height: 64px; padding: 0 4px; }
.fm-bars i { flex: 1; height: var(--h); border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, var(--fe), #c2410c); }
.fm-wave { height: 38px; align-items: center; }
.fm-wave i { background: #a78bfa; border-radius: 4px; }
.fm-big { margin: 4px 0; font-size: 2rem; font-weight: 800; }
.fm-big.up { color: var(--fe); }
.fm-ring { --p: 0; justify-self: center; width: 104px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; margin-top: 6px; background: conic-gradient(var(--fe) calc(var(--p) * 1%), rgba(255, 255, 255, 0.1) 0); }
.fm-ring span { width: 76px; aspect-ratio: 1; border-radius: 50%; background: var(--scr); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; }
.fm-ring + .fm-note { text-align: center; margin: 2px 0 0; }
.fm-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 4px; }
.fm-cal i { aspect-ratio: 1; border-radius: 6px; background: var(--scr-2); }
.fm-cal i.on { background: rgba(74, 222, 128, 0.55); }
.fm-cal i.off { background: #fb7185; }
.feat-new { background: var(--fe); color: #fff; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; }
.feat-compare { display: grid; justify-items: center; gap: 16px; padding: clamp(24px, 6vw, 72px) 0; text-align: center; }
.feat-compare h2 { font-size: clamp(1.7rem, 4.4vw, 2.6rem); line-height: 1.12; max-width: 18ch; margin: 0 0 12px; }
.feat-compare table { width: min(100%, 560px); border-collapse: collapse; text-align: left; }
.feat-compare th, .feat-compare td { padding: 12px 8px; border-bottom: 1px solid var(--line); }
.feat-compare thead th { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; text-align: center; width: 92px; }
.feat-compare thead th:first-child { width: auto; }
.feat-compare tbody th { font-weight: 500; }
.feat-compare td { text-align: center; }
.fm-tick { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 0.85rem; font-weight: 800; }
.fm-tick.on { background: var(--fe); color: #fff; }
.feat-compare td:nth-child(2) .fm-tick.on { background: var(--text); color: var(--surface-solid); }
.feat-link { color: var(--fe-ink); font-weight: 700; }
.feat-closing { position: relative; overflow: hidden; display: grid; justify-items: center; gap: 20px; text-align: center; padding: clamp(56px, 10vw, 120px) 20px; border-radius: var(--radius); color: #fff;
  background: radial-gradient(100% 140% at 50% 0%, rgba(255, 106, 61, 0.9) 0%, rgba(120, 30, 20, 0.6) 45%, transparent 75%), #120c16; }
.feat-closing p { font-size: clamp(1.8rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.01em; margin: 0; max-width: 16ch; }
.feat-foot { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 36px 16px 8px; }
.feat-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; }
.feat-foot nav a { color: var(--text-2); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; }
.feat-foot nav a:hover { color: var(--fe); }
.feat-foot > p:first-child { font-weight: 800; margin: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .feat-page { --fe-ink: #fdba74; } }
:root[data-theme="dark"] .feat-page { --fe-ink: #fdba74; }
@media (max-width: 760px) {
  .feat-cards { grid-template-columns: 1fr; gap: 36px; }
  .feat-card .feat-screen { max-width: 340px; aspect-ratio: auto; min-height: 200px; }
  .fm-cal { width: 220px; justify-self: center; }
  .feat-banner { align-items: end; min-height: 340px; }
  .feat-banner-art { top: 22px; right: 16px; transform: none; }
  .feat-banner-art span { width: 58px; font-size: 1.8rem; }
  .feat-hero-gem { right: -30%; opacity: 0.6; }
  .feat-tabs { gap: 22px; }
}
.lite .feat-banner-art span { backdrop-filter: none; }

/* =====================================================================================================
   Clean look (Nov 2026; same family as the Features page): white and near-black, one warm orange for actions,
   bold tight headings, small uppercase labels, flat cards with a thin line, a dark hero with an orange glow.
   Applies to every country (":not(#_)" outranks the US colour block). Voice stays purple (US: blue).
   ===================================================================================================== */
:root:not(#_) {
  --bg: #f6f6f4;
  --bg-2: #f6f6f4;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f2f1ee;
  --line: rgba(20, 20, 20, 0.08);
  --line-strong: rgba(20, 20, 20, 0.16);
  --text: #141414;
  --text-2: #4f4f4f;
  --text-3: #8a8a86;
  --accent: #ea580c;
  --accent-2: #fb7a3c;
  --accent-ink: #c2410c;
  --accent-tint: #fff1e8;
  --ember: #ff6a3d;
  --ember-2: #ffa15c;
  --on-accent: #fff;
  --bar: #fdc3a3;
  --empty-ring: #ebeae6;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px -14px rgba(0, 0, 0, 0.18);
  --glow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 18px 40px -22px rgba(234, 88, 12, 0.45);
  --side-bg: #121212;
  --radius: 16px;
  --radius-sm: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not(#_):not([data-theme="light"]) {
    --bg: #0e0e0f;
    --bg-2: #0e0e0f;
    --surface: #19191b;
    --surface-solid: #19191b;
    --surface-2: #232326;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.18);
    --text: #f4f4f2;
    --text-2: #bdbdb8;
    --text-3: #85857f;
    --accent: #ff7a45;
    --accent-2: #ff9a6a;
    --accent-ink: #ffb08a;
    --accent-tint: rgba(255, 122, 69, 0.14);
    --on-accent: #fff;
    --bar: #6b3018;
    --empty-ring: #2a2a2d;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -16px rgba(0, 0, 0, 0.7);
    --side-bg: #0a0a0b;
  }
}
:root:not(#_)[data-theme="dark"] {
  --bg: #0e0e0f;
  --bg-2: #0e0e0f;
  --surface: #19191b;
  --surface-solid: #19191b;
  --surface-2: #232326;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f4f2;
  --text-2: #bdbdb8;
  --text-3: #85857f;
  --accent: #ff7a45;
  --accent-2: #ff9a6a;
  --accent-ink: #ffb08a;
  --accent-tint: rgba(255, 122, 69, 0.14);
  --on-accent: #fff;
  --bar: #6b3018;
  --empty-ring: #2a2a2d;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -16px rgba(0, 0, 0, 0.7);
  --side-bg: #0a0a0b;
}

body { background: var(--bg); }
h1 { font-weight: 800; letter-spacing: -0.025em; }
h2 { font-weight: 800; letter-spacing: -0.015em; }
.eyebrow { letter-spacing: 0.12em; color: var(--text-2); }

/* Flat cards: white, thin line, no glass */
.card { border-radius: var(--radius); box-shadow: var(--shadow-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
.card-lite { box-shadow: none; }

/* Buttons: squarer, one solid orange for the main action */
.btn { border-radius: 10px; }
.btn-small { border-radius: 8px; }
.btn-lg { border-radius: 12px; }
.btn-primary, .btn-primary:hover { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -12px rgba(234, 88, 12, 0.9); }
.btn-primary:hover { filter: brightness(1.06); }

/* Top bar and menus */
.topbar { background: color-mix(in srgb, var(--surface-solid) 92%, transparent); }
.side { box-shadow: none; }
.side-household, .side-foot, .side-who small { color: #a3a3a3; }
.nav-link { color: #d6d6d6; border-radius: 10px; }
.nav-link.active { background: rgba(255, 255, 255, 0.08); color: #fff; box-shadow: inset 3px 0 0 var(--ember); }
.nav-link.primary { background: var(--ember); box-shadow: none; }
.brand img { filter: none; }
@media (max-width: 860px) {
  .tabbar { background: var(--surface-solid); border-radius: 18px; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.35); }
  .tab.active { color: var(--accent-ink); background: var(--accent-tint); }
  .tab.primary { background: var(--ember); box-shadow: 0 10px 20px -8px rgba(255, 106, 61, 0.75); }
}

/* The big money card: dark, with an orange glow rising from the bottom */
.hero-card { background: radial-gradient(110% 80% at 50% 120%, rgba(255, 106, 61, 0.85) 0%, rgba(190, 60, 20, 0.45) 35%, transparent 70%), linear-gradient(180deg, #121014 0%, #1d1114 100%); }
.hero-card::before { display: none; }
.hero-card .link-cta { color: #ffb48a; }

/* Home: big doors keep their colours (voice purple), just squarer */
.big-action { border-radius: 16px; box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.5); }
.ba-scan { background: linear-gradient(160deg, #ff7a45, #ea580c); }
.big-row { border-radius: 12px; }
.hub-tile { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.hub-tile .hub-ic { background: color-mix(in srgb, var(--c) 14%, transparent); }
.auth-family-hint { border-radius: 12px; }

/* Nothing on a page may be wider than the phone (a long button used to push Home sideways) */
.page { grid-template-columns: minmax(0, 1fr); }
.card .btn { white-space: normal; text-align: center; }
.simple-month { padding: 18px 20px; border-radius: var(--radius); color: #fff; background: radial-gradient(90% 140% at 100% 120%, rgba(255, 106, 61, 0.8) 0%, rgba(190, 60, 20, 0.35) 40%, transparent 70%), #141214; }
.simple-month strong { font-size: 1.7rem; letter-spacing: -0.02em; }

/* Clean look for every country: these replace the older US-only greens and the purple welcome card.
   (Voice keeps its own colour: purple, blue in the US.) */
:root:not(#_) body { background: var(--bg); }
:root:not(#_) .side-household, :root:not(#_) .side-foot, :root:not(#_) .side-who small { color: #a3a3a3; }
:root:not(#_) .nav-link.active { background: rgba(255, 255, 255, 0.08); box-shadow: inset 3px 0 0 var(--ember); }
:root:not(#_) .nav-link.primary, :root:not(#_) .ba-scan { background: linear-gradient(160deg, #ff7a45, #ea580c); box-shadow: 0 10px 24px -14px rgba(234, 88, 12, 0.8); }
:root:not(#_) .btn-primary, :root:not(#_) .btn-primary:hover { background: #ea580c; box-shadow: 0 8px 20px -12px rgba(234, 88, 12, 0.9); }
:root:not(#_) .hero-card, :root:not(#_)[data-region="us"] .sub-hero { background: radial-gradient(110% 80% at 50% 120%, rgba(255, 106, 61, 0.85) 0%, rgba(190, 60, 20, 0.45) 35%, transparent 70%), linear-gradient(180deg, #121014 0%, #1d1114 100%); }
:root:not(#_) .hero-card .link-cta { color: #ffb48a; }
:root:not(#_) .welcome-back { background: color-mix(in srgb, var(--ember) 8%, var(--surface)); }
:root:not(#_) .avatar, :root:not(#_) .lang-pill { background: #ea580c; }
:root:not(#_) .wa-glow { background: radial-gradient(closest-side at 50% 80%, rgba(255, 106, 61, 0.55), transparent); }
:root:not(#_) .wa-receipt { background: radial-gradient(120% 70% at 50% 115%, rgba(255, 106, 61, 0.7) 0%, rgba(160, 50, 20, 0.3) 40%, transparent 70%), linear-gradient(180deg, #151316 0%, #1c1216 100%); box-shadow: 0 50px 90px -30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1) inset; color: #fff; }
:root:not(#_) .wa-eyebrow, :root:not(#_) .wa-ring small { color: #ffb48a; }
:root:not(#_) .wa-total strong { background: none; color: #fff; }
:root:not(#_) .wa-ring { background: conic-gradient(var(--ember) calc(var(--p) * 1%), rgba(255, 255, 255, 0.14) 0); box-shadow: none; }
:root:not(#_) .wa-ring > span { background: #161316; }

/* ---------- My accounts, money score, growth cards ---------- */
.acc-hero { text-align: center; justify-items: center; }
.acc-hero .eyebrow { color: rgba(255, 255, 255, 0.75); display: flex; align-items: center; gap: 6px; }
.acc-net { font-size: clamp(2rem, 9vw, 2.8rem); font-weight: 850; margin: 0; letter-spacing: -0.02em; }
.acc-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.acc-split span { display: grid; gap: 2px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); }
.acc-split small { color: rgba(255, 255, 255, 0.7); }
.acc-row { width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.acc-sub { display: block; }
.score-hero { justify-items: center; text-align: center; }
.score-ring { --p: 0; --sc: #22c55e; width: 140px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; align-content: center; background: radial-gradient(closest-side, #19141a 78%, transparent 79%), conic-gradient(var(--sc) calc(var(--p) * 1%), rgba(255, 255, 255, 0.12) 0); }
.score-ring strong { font-size: 2.6rem; line-height: 1; }
.score-ring small { color: rgba(255, 255, 255, 0.65); }
.band-good { --sc: #84cc16; }
.band-fair { --sc: #f59e0b; }
.band-low { --sc: #ef4444; }
.score-band { font-size: 1.2rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 6px; }
.score-parts { list-style: none; padding: 0; margin: 0; display: grid; }
.score-part { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.score-part:first-child { border-top: 0; }
.score-part .grow { min-width: 0; }
.score-part p { margin: 4px 0 0; }
.score-part.off { opacity: 0.8; }
.score-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 6px; }
.score-bar span { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: inherit; }
.score-pts { font-weight: 800; white-space: nowrap; }
.score-badge { --sc: #22c55e; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 850; color: #fff; background: var(--sc); }
.grow-tip .btn { flex: 0 0 auto; }
@media (max-width: 480px) {
  .score-part { flex-wrap: wrap; }
  .score-part .grow { flex: 1 1 60%; }
}
/* Plain Features pages for search engines (/features, /te/features...): the same look, no app around them. */
.seo-page { margin: 0; background: var(--bg); color: var(--text); }
.seo-page .feat-page { max-width: 1100px; margin: 0 auto; padding: 0 16px 24px; }
.seo-screen { display: grid; place-items: center; font-size: 3rem; aspect-ratio: auto; min-height: 120px; }
.seo-langs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; }
.card > .udh-people { margin: 0; padding-top: 0; padding-bottom: 0; }
.acc-row { padding: 10px 4px; }
.grow-tip { flex-wrap: wrap; }
.grow-tip .grow { flex: 1 1 140px; min-width: 0; }
.grow-tip .icon-btn { order: 2; }
.grow-tip .btn { order: 3; margin-left: 52px; }
/* Indian scripts have tall vowel marks: big headings need more room between lines or they overlap. */
:is(:lang(te), :lang(hi), :lang(ta), :lang(kn), :lang(mr), :lang(bn)) :is(.feat-hero h1, .feat-lead, .feat-banner h2, .feat-closing p, .auth h1) { line-height: 1.35; }

/* Split with friends */
.split-page .udh-amt { font-size: 0.92rem; }
.split-page .udh-person { width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; color: inherit; text-decoration: none; }
.split-people { display: grid; gap: 6px; margin-top: 8px; }
.split-person { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; min-height: 44px; }
.split-person input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); }
.split-person .split-val { width: 110px; flex: 0 0 110px; min-height: 38px; padding: 6px 10px; }
.split-hint { min-height: 1.2em; }
.split-friends { display: grid; gap: 8px; }
.split-friend { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.split-friend input { min-width: 0; }
.split-settle { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.split-settle li { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.split-settle li:last-child { border-bottom: 0; padding-bottom: 0; }
.split-settle p { margin: 0; font-weight: 700; }
.split-list { padding: 0; }
.split-exp { width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; color: inherit; flex-wrap: wrap; }
.split-status { font-weight: 750; white-space: nowrap; }
.split-status.get { color: var(--good); }
.split-status.give { color: var(--bad); }
.split-mine p { margin: 6px 0 0; color: var(--text-2); }
.split-who h2 { margin-top: 0; }
.split-brand { margin: 0; font-weight: 850; color: var(--accent); }
.split-promo { display: grid; gap: 10px; justify-items: start; }
.split-promo p { margin: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Sign-in: country and language guessed from the phone, shown as one line ("🇮🇳 India · English · Change"). */
.region-line { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 4px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-solid); font: inherit; font-weight: 650; color: var(--text-2); text-align: left; cursor: pointer; min-height: 44px; }
.region-line .grow { flex: 1; min-width: 0; }
.region-change { color: var(--accent); font-weight: 750; white-space: nowrap; }
.region-countries { display: flex; flex-wrap: wrap; gap: 8px; }
.region-sheet .link-btn { justify-self: start; }

/* The "Speak" picture (a person holding a microphone) takes the size of the emoji it replaced. */
.speak-pic { display: block; width: 1.3em; height: 1.3em; pointer-events: none; }
.big-mic .speak-pic { width: 1.5em; height: 1.5em; margin: auto; }
.speak-title-pic { display: inline-block; vertical-align: -0.15em; }
.speak-title-pic .speak-pic { width: 1.15em; height: 1.15em; }
.nav-ic .speak-pic, .tab .speak-pic { margin: auto; }
