/* 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; font-size: 0.85rem; color: #b9addf; }

.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="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; 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; }
.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: 1fr; }
  .auth-hero { height: 300px; 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; gap: 10px; }
.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%; }
