/* Ethan Bank - private family bank.
   Deep navy + warm gold. Rounded numerals so money reads like coins.
   No inline styles anywhere: dynamic values arrive as CSS custom properties via CSSOM. */

:root {
  --navy-950: #060c22;
  --navy-900: #0e1b3d;
  --navy-800: #16275a;
  --navy-700: #213a7c;
  --gold-600: #b3872f;
  --gold-500: #c9a24a;
  --gold-400: #ddb863;
  --gold-300: #eed28e;
  --gold-100: #f8eed3;
  --mint-600: #12805c;
  --mint-500: #1fa077;
  --mint-100: #dcf2e9;
  --coral-600: #bf432c;
  --coral-100: #fbe4dd;
  --sky-600: #2c5fd6;
  --sky-500: #4a7cf0;
  --sky-100: #e2eafc;

  --bg: #f2f4f9;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef1f8;
  --line: #e1e6f0;
  --line-strong: #cdd5e5;
  --text: #0e1b3d;
  --text-2: #3a4768;
  --muted: #64718f;
  --focus: #2c5fd6;
  --checking: var(--sky-600);
  --savings: var(--gold-500);
  --credit: var(--mint-600);
  --debit: var(--coral-600);
  --shadow-1: 0 1px 2px rgba(14, 27, 61, 0.06), 0 1px 1px rgba(14, 27, 61, 0.04);
  --shadow-2: 0 2px 6px rgba(14, 27, 61, 0.06), 0 12px 28px -12px rgba(14, 27, 61, 0.18);
  --shadow-3: 0 24px 60px -20px rgba(6, 12, 34, 0.55), 0 8px 20px -10px rgba(6, 12, 34, 0.35);

  --font-display: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", "Segoe UI",
    system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.953rem;
  --step-4: 2.441rem;
  --step-5: clamp(2.4rem, 9vw, 3.6rem);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --gutter: clamp(16px, 4vw, 28px);
  --tap: 48px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #050a1b;
    --surface: #0c1430;
    --surface-2: #101a3a;
    --surface-3: #152146;
    --line: #1d2950;
    --line-strong: #2a3a6a;
    --text: #eef1fa;
    --text-2: #c6cde2;
    --muted: #93a0c2;
    --focus: #8fb0ff;
    --checking: var(--sky-500);
    --savings: var(--gold-400);
    --credit: #3ccf99;
    --debit: #ff8a72;
    --mint-100: #0f3a2d;
    --coral-100: #3d1a14;
    --sky-100: #15295a;
    --gold-100: #3a2f12;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.35), 0 16px 32px -16px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0) / 1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.num,
.money {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--navy-900);
  color: #fff;
  border-radius: var(--r-sm);
}

.skip-link:focus {
  top: calc(12px + env(safe-area-inset-top, 0px));
}

/* ---------- boot + skeleton ---------- */

.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: radial-gradient(120% 80% at 50% 0%, var(--navy-800), var(--navy-950));
  color: var(--gold-300);
}

.boot__mark {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: url("/static/icons/favicon.svg") center / cover no-repeat;
  box-shadow: 0 0 0 1px rgba(238, 210, 142, 0.25), 0 20px 50px -10px rgba(0, 0, 0, 0.6);
  animation: breathe 1.6s var(--ease) infinite alternate;
}

.boot__text {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  opacity: 0.85;
}

@keyframes breathe {
  from {
    transform: scale(0.96);
    opacity: 0.8;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-3);
  border-radius: var(--r-md);
  min-height: 1em;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.3s infinite;
}

@media (prefers-color-scheme: dark) {
  .skeleton::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  }
}

.skeleton--card {
  height: 220px;
  border-radius: var(--r-xl);
}

.skeleton--row {
  height: 64px;
}

.skeleton--block {
  height: 160px;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

/* ---------- login ---------- */

.login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  background: radial-gradient(140% 90% at 50% -10%, var(--navy-700), var(--navy-950) 70%);
  color: #fff;
  padding: calc(24px + env(safe-area-inset-top, 0px)) var(--gutter)
    calc(24px + env(safe-area-inset-bottom, 0px));
}

.login__inner {
  width: 100%;
  max-width: 420px;
  margin: auto;
  display: grid;
  gap: 28px;
}

.login__brand {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.login__brand .logo {
  width: 64px;
  height: 64px;
}

.login__title {
  font-size: var(--step-4);
  font-weight: 700;
  color: var(--gold-300);
}

.login__tagline {
  color: rgba(255, 255, 255, 0.72);
}

.login__panel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(238, 210, 142, 0.18);
  border-radius: var(--r-xl);
  padding: 22px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-3);
  display: grid;
  gap: 18px;
}

.who {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.who__btn {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 6px 12px;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  min-height: var(--tap);
  transition: transform 0.2s var(--spring), background 0.2s, border-color 0.2s;
}

.who__btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.who__btn[aria-pressed="true"] {
  border-color: var(--gold-400);
  background: rgba(221, 184, 99, 0.16);
  transform: translateY(-2px);
}

.who__face {
  font-size: 2rem;
  line-height: 1;
}

.who__name {
  font-family: var(--font-display);
  font-weight: 600;
}

.login .field__label {
  color: rgba(255, 255, 255, 0.8);
}

.login .input {
  background: rgba(6, 12, 34, 0.55);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.login .input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.login .link-btn {
  color: var(--gold-300);
}

.login__google {
  display: grid;
  gap: 16px;
}

/* Google's sign-in button, light theme: white, #747775 outline, #1f1f1f label, 4-color G. */
.gbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #747775;
  background: #ffffff;
  color: #1f1f1f;
  font-family: Roboto, var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s var(--ease);
}

.gbtn:hover {
  background: #f8faff;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

.gbtn:active {
  transform: scale(0.98);
}

.gbtn:focus-visible {
  outline: 3px solid var(--gold-300);
  outline-offset: 3px;
}

.gbtn__mark {
  width: 18px;
  height: 18px;
  flex: none;
}

.login__or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  font-size: var(--step--1);
  color: rgba(255, 255, 255, 0.6);
}

.login__or::before,
.login__or::after {
  content: "";
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.login__error {
  background: rgba(191, 67, 44, 0.22);
  border: 1px solid rgba(255, 138, 114, 0.45);
  color: #ffd9cf;
  padding: 10px 12px;
  border-radius: var(--r-sm);
}

.login__fine {
  text-align: center;
  font-size: var(--step--1);
  color: rgba(255, 255, 255, 0.55);
}

/* ---------- shell ---------- */

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) var(--gutter) 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  min-height: var(--tap);
}

.brand .logo {
  width: 34px;
  height: 34px;
  flex: none;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.brand__role {
  font-size: var(--step--1);
  color: var(--muted);
  display: block;
  line-height: 1.1;
}

.topbar__spacer {
  flex: 1;
}

.topnav {
  display: none;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
  border: 1px solid var(--line);
}

.topnav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  min-height: 40px;
  transition: background 0.2s, color 0.2s;
}

.topnav__link:hover {
  color: var(--text);
  background: var(--surface-3);
}

.topnav__link[aria-current="page"] {
  background: var(--navy-900);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .topnav__link[aria-current="page"] {
    background: var(--gold-400);
    color: var(--navy-950);
  }
}

.level-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  color: var(--navy-950);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  box-shadow: 0 6px 16px -8px rgba(179, 135, 47, 0.9);
  min-height: 36px;
}

.level-chip__num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy-900);
  color: var(--gold-300);
  font-size: 0.8125rem;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.icon-btn:hover {
  background: var(--surface-3);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn--sm {
  width: 40px;
  height: 40px;
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.icon--sm {
  width: 18px;
  height: 18px;
}

.main {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px var(--gutter) calc(110px + env(safe-area-inset-bottom, 0px));
  outline: none;
}

.main--kid {
  max-width: 780px;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}

.tabbar__link {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-height: 56px;
  border-radius: var(--r-md);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.6875rem;
  font-weight: 600;
  transition: color 0.2s;
}

.tabbar__link .icon {
  width: 24px;
  height: 24px;
  transition: transform 0.25s var(--spring);
}

.tabbar__link[aria-current="page"] {
  color: var(--text);
}

.tabbar__link[aria-current="page"] .icon {
  transform: translateY(-2px);
  stroke: var(--gold-600);
}

@media (prefers-color-scheme: dark) {
  .tabbar__link[aria-current="page"] .icon {
    stroke: var(--gold-400);
  }
}

.tabbar__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  top: 2px;
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: var(--gold-500);
}

.dot {
  position: absolute;
  top: 6px;
  left: calc(50% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--coral-600);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.topnav__link .dot {
  position: static;
}

@media (min-width: 900px) {
  .topnav {
    display: flex;
  }
  .tabbar {
    display: none;
  }
  .main {
    padding-bottom: 64px;
  }
}

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

.stack {
  display: grid;
  gap: 18px;
}

.stack--lg {
  gap: 28px;
}

.stack--sm {
  gap: 10px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.row--between {
  justify-content: space-between;
}

.row--nowrap {
  flex-wrap: nowrap;
}

.grow {
  flex: 1;
  min-width: 0;
}

.grid-2 {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.grid-kpi {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
}

.dash {
  display: grid;
  gap: 18px;
}

@media (min-width: 1000px) {
  .dash {
    grid-template-columns: 1.35fr 1fr;
    align-items: start;
  }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.page-title {
  font-size: var(--step-3);
  font-weight: 700;
}

.page-sub {
  color: var(--muted);
  margin-top: 4px;
  max-width: 60ch;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: var(--step--1);
}

.center {
  text-align: center;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-2);
  min-width: 0;
}

.card--flat {
  box-shadow: none;
}

.card--tight {
  padding: 14px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card__title {
  font-size: var(--step-1);
  font-weight: 700;
}

.card__link {
  color: var(--sky-600);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 8px 4px;
}

@media (prefers-color-scheme: dark) {
  .card__link {
    color: var(--sky-500);
  }
}

/* ---------- the vault card (hero) ---------- */

.vault {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--r-xl);
  padding: 22px 22px 20px;
  color: #fff;
  background: radial-gradient(130% 120% at 100% 0%, #2a4592 0%, transparent 55%),
    linear-gradient(160deg, var(--navy-800), var(--navy-950) 75%);
  box-shadow: var(--shadow-3);
  min-height: 220px;
  display: grid;
  gap: 16px;
}

.vault::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(238, 210, 142, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.vault::after {
  content: "";
  position: absolute;
  inset: -40% -60%;
  z-index: -1;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 236, 180, 0.16) 50%,
    transparent 60%
  );
  transform: translateX(-60%);
  pointer-events: none;
}

.vault.is-shining::after {
  animation: sheen 1.4s var(--ease);
}

@keyframes sheen {
  from {
    transform: translateX(-60%);
  }
  to {
    transform: translateX(60%);
  }
}

.vault__engraving {
  position: absolute;
  right: -90px;
  top: -70px;
  width: 340px;
  height: 340px;
  z-index: -1;
  opacity: 0.55;
  pointer-events: none;
}

.vault__engraving ellipse {
  fill: none;
  stroke: rgba(238, 210, 142, 0.28);
  stroke-width: 0.6;
}

.vault__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vault__label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9375rem;
}

.vault__chip {
  width: 42px;
  height: 32px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-600));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
  position: relative;
}

.vault__chip::before,
.vault__chip::after {
  content: "";
  position: absolute;
  inset: 8px 6px;
  border: 1px solid rgba(80, 55, 10, 0.35);
  border-radius: 4px;
}

.vault__chip::after {
  inset: 15px 0;
  border-width: 1px 0 0;
  border-radius: 0;
}

.vault__total {
  font-size: var(--step-5);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(180deg, #fff3cf 0%, var(--gold-300) 45%, var(--gold-500) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 0 transparent;
  filter: drop-shadow(0 2px 10px rgba(201, 162, 74, 0.25));
}

.vault__accounts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.vault__acct {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 2px;
}

.vault__acct-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.78);
}

.vault__acct-name::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sky-500);
}

.vault__acct--savings .vault__acct-name::before {
  background: var(--gold-400);
}

.vault__acct-value {
  font-size: var(--step-2);
  font-weight: 700;
}

.vault__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8125rem;
}

.vault__holder {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.82);
}

.bump {
  animation: bump 0.6s var(--spring);
}

@keyframes bump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

.muted-on-dark {
  color: rgba(255, 255, 255, 0.55);
}

a.card {
  color: inherit;
  text-decoration: none;
  display: grid;
  transition: transform 0.2s var(--spring), box-shadow 0.2s;
}

a.card.row {
  display: flex;
}

a.card:hover {
  transform: translateY(-2px);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.2s, background 0.2s, opacity 0.2s;
  -webkit-user-select: none;
  user-select: none;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--gold {
  color: var(--navy-950);
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  box-shadow: 0 8px 20px -10px rgba(179, 135, 47, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn--gold:hover:not(:disabled) {
  box-shadow: 0 12px 26px -10px rgba(179, 135, 47, 1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn--navy {
  color: #fff;
  background: var(--navy-900);
  box-shadow: 0 8px 20px -12px rgba(14, 27, 61, 0.9);
}

@media (prefers-color-scheme: dark) {
  .btn--navy {
    background: var(--surface-3);
    border-color: var(--line-strong);
  }
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--surface-3);
}

.btn--mint {
  background: var(--mint-600);
  color: #fff;
}

.btn--danger {
  background: var(--coral-600);
  color: #fff;
}

.btn--soft-danger {
  background: var(--coral-100);
  color: var(--coral-600);
}

@media (prefers-color-scheme: dark) {
  .btn--soft-danger {
    color: #ffb3a3;
  }
}

.btn--block {
  width: 100%;
}

.btn--lg {
  min-height: 56px;
  font-size: 1.0625rem;
  padding: 0 16px;
}

.btn--sm {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.875rem;
}

.btn.is-busy {
  position: relative;
  color: transparent;
}

.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--navy-900) transparent var(--navy-900) transparent;
  animation: spin 0.8s linear infinite;
}

.btn--navy.is-busy::after,
.btn--mint.is-busy::after,
.btn--danger.is-busy::after {
  border-color: #fff transparent #fff transparent;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.link-btn {
  background: none;
  border: 0;
  padding: 8px 4px;
  color: var(--sky-600);
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.actions--4 {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 620px) {
  .actions--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.action-tile {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  text-align: left;
  min-height: 104px;
  transition: transform 0.2s var(--spring), box-shadow 0.2s, border-color 0.2s;
}

a.action-tile {
  color: inherit;
  text-decoration: none;
}

.action-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--line-strong);
}

.action-tile:active {
  transform: scale(0.98);
}

.action-tile__emoji {
  font-size: 1.75rem;
  line-height: 1;
}

.action-tile__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
}

.action-tile__sub {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.35;
}

.action-tile--gold {
  background: linear-gradient(160deg, var(--gold-100), var(--surface) 70%);
  border-color: color-mix(in srgb, var(--gold-500) 45%, var(--line));
}

/* ---------- forms ---------- */

.field {
  display: grid;
  gap: 6px;
}

.field__label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-2);
}

.field__hint {
  font-size: 0.8125rem;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 22%, transparent);
}

.money-input {
  position: relative;
}

.money-input::before {
  content: "$";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--muted);
  font-size: 1.25rem;
  pointer-events: none;
}

.money-input .input {
  padding-left: 34px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.money-input--xl .input {
  min-height: 72px;
  font-size: 2.25rem;
  padding-left: 42px;
  text-align: left;
}

.money-input--xl::before {
  font-size: 2rem;
  left: 18px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background 0.15s, border-color 0.15s, transform 0.15s var(--spring);
}

.chip:hover {
  background: var(--surface-3);
}

.chip[aria-pressed="true"],
.chip[aria-checked="true"] {
  background: var(--navy-900);
  color: #fff;
  border-color: var(--navy-900);
}

@media (prefers-color-scheme: dark) {
  .chip[aria-pressed="true"],
  .chip[aria-checked="true"] {
    background: var(--gold-400);
    color: var(--navy-950);
    border-color: var(--gold-400);
  }
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 4px;
  gap: 4px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  max-width: 100%;
}

.segmented--block {
  display: grid;
  width: 100%;
}

.segmented__btn {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.segmented__btn[aria-pressed="true"],
.segmented__btn[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-1);
}

@media (prefers-color-scheme: dark) {
  /* Dark tokens put --surface and --surface-3 at ~1.2:1; use the gold selected style chips use. */
  .segmented__btn[aria-pressed="true"],
  .segmented__btn[aria-selected="true"] {
    background: var(--gold-400);
    color: var(--navy-950);
  }
}

.switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  min-height: var(--tap);
}

.switch__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch__track {
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  flex: none;
  transition: background 0.2s;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s var(--spring);
}

.switch__input:checked + .switch__track {
  background: var(--mint-500);
}

.switch__input:checked + .switch__track::after {
  transform: translateX(20px);
}

.switch__input:focus-visible + .switch__track {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.range {
  width: 100%;
  accent-color: var(--gold-500);
  min-height: 32px;
}

.form-error {
  color: var(--coral-600);
  background: var(--coral-100);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .form-error {
    color: #ffc2b5;
  }
}

.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.callout--gold {
  background: var(--gold-100);
  border-color: color-mix(in srgb, var(--gold-500) 40%, transparent);
}

.callout--mint {
  background: var(--mint-100);
  border-color: color-mix(in srgb, var(--mint-500) 35%, transparent);
}

.callout--coral {
  background: var(--coral-100);
  border-color: color-mix(in srgb, var(--coral-600) 30%, transparent);
}

.callout__emoji {
  font-size: 1.5rem;
  line-height: 1.2;
}

/* ---------- progress ---------- */

.bar {
  height: 12px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  position: relative;
}

.bar--lg {
  height: 16px;
}

.bar__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-400), var(--gold-500));
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform 1s var(--ease);
}

.bar__fill--xp {
  background: linear-gradient(90deg, var(--sky-500), #7a5cf0);
}

.bar--done .bar__fill {
  background: linear-gradient(90deg, var(--mint-500), #4fd1a5, var(--mint-500));
  background-size: 200% 100%;
  animation: flow 2.5s linear infinite;
}

@keyframes flow {
  to {
    background-position: -200% 0;
  }
}

.ring {
  width: 96px;
  height: 96px;
  flex: none;
}

.ring__track {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 9;
}

.ring__fill {
  fill: none;
  stroke: url(#ringGold);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s var(--ease);
}

.ring__text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  fill: var(--text);
}

.ring__sub {
  font-size: 11px;
  fill: var(--muted);
  font-weight: 600;
}

/* ---------- lists / feed ---------- */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.feed-group + .feed-group {
  margin-top: 8px;
}

.feed-day {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
  padding: 10px 4px 6px;
}

.tx {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
}

.list > .tx:first-child,
.feed-day + .list > .tx:first-child {
  border-top: 0;
}

.tx__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  background: var(--surface-3);
}

.tx__icon--credit {
  background: var(--mint-100);
}

.tx__icon--debit {
  background: var(--coral-100);
}

.tx__icon--move {
  background: var(--gold-100);
}

.tx__main {
  min-width: 0;
}

.tx__title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx__reason {
  font-size: 0.875rem;
  color: var(--text-2);
  font-style: italic;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tx__meta {
  font-size: 0.8125rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx__amt {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tx__amt--credit {
  color: var(--credit);
}

.tx__amt--debit {
  color: var(--text);
}

.tx__amt--move {
  color: var(--muted);
}

.tx--reversed .tx__title,
.tx--reversed .tx__amt {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity: 0.6;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
}

.tag--gold {
  background: var(--gold-100);
  color: #7a5a14;
}

.tag--mint {
  background: var(--mint-100);
  color: var(--mint-600);
}

.tag--coral {
  background: var(--coral-100);
  color: var(--coral-600);
}

.tag--sky {
  background: var(--sky-100);
  color: var(--sky-600);
}

@media (prefers-color-scheme: dark) {
  .tag--gold {
    color: var(--gold-300);
  }
  .tag--mint {
    color: #7fe3bd;
  }
  .tag--coral {
    color: #ffb3a3;
  }
  .tag--sky {
    color: #a9c2ff;
  }
}

.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
}

.empty__emoji {
  font-size: 2.25rem;
}

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

.goal {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.goal--next {
  border-color: color-mix(in srgb, var(--gold-500) 55%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-400) 18%, transparent), var(--shadow-1);
}

.goal__emoji {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  background: var(--surface-3);
}

.goal__body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.goal__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  overflow-wrap: anywhere;
}

.goal__nums {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--muted);
}

.goal__tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.trophies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.trophy {
  text-align: center;
  padding: 16px 10px;
  border-radius: var(--r-lg);
  background: linear-gradient(170deg, var(--gold-100), var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold-500) 35%, var(--line));
  display: grid;
  gap: 4px;
  justify-items: center;
}

.trophy__emoji {
  font-size: 2rem;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
}

.emoji-btn {
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.15s var(--spring);
}

.emoji-btn[aria-pressed="true"] {
  border-color: var(--gold-500);
  background: var(--gold-100);
  transform: scale(1.06);
}

/* ---------- badges ---------- */

.badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.badge {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 6px;
  padding: 16px 10px 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.badge__medal {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  background: radial-gradient(circle at 35% 30%, var(--gold-100), var(--gold-400) 75%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.55), 0 8px 16px -8px rgba(179, 135, 47, 0.9);
}

.badge--locked .badge__medal {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 2px var(--line-strong);
  filter: grayscale(1);
  opacity: 0.55;
}

.badge__name {
  font-family: var(--font-display);
  font-weight: 700;
}

.badge__desc {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.35;
}

.badge .bar {
  width: 100%;
  height: 6px;
}

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

.kpi {
  display: grid;
  gap: 4px;
}

.kpi__label {
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi__label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--kpi-color, var(--line-strong));
}

.kpi__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.kpi--checking {
  --kpi-color: var(--checking);
}

.kpi--savings {
  --kpi-color: var(--savings);
}

.kpi--total {
  --kpi-color: var(--navy-700);
}

.kpi--earned {
  --kpi-color: var(--credit);
}

.kpi--spent {
  --kpi-color: var(--debit);
}

.chart {
  position: relative;
}

.chart__svg {
  width: 100%;
  height: 180px;
  display: block;
  overflow: visible;
  touch-action: pan-y;
}

.chart__area--savings {
  fill: url(#gradSavings);
}

.chart__area--checking {
  fill: url(#gradChecking);
}

.chart__line {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart__line--savings {
  stroke: var(--savings);
}

.chart__line--checking {
  stroke: var(--checking);
}

.chart__line--total {
  stroke: var(--text);
  stroke-dasharray: 4 4;
  stroke-width: 1.5;
}

.chart__grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart__cursor {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.chart__dot {
  stroke: var(--surface);
  stroke-width: 2;
}

.chart__tip {
  position: absolute;
  top: 0;
  left: var(--x, 0);
  transform: translateX(-50%);
  background: var(--navy-900);
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.8125rem;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-2);
  display: grid;
  gap: 1px;
}

.chart__axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.875rem;
  color: var(--text-2);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--sw);
}

.donut-wrap {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  align-items: center;
}

@media (max-width: 420px) {
  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

.donut {
  width: 150px;
  height: 150px;
}

.donut__seg {
  fill: none;
  stroke-width: 18;
  transition: stroke-dasharray 0.9s var(--ease);
}

.donut__hole-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  fill: var(--text);
}

.donut__hole-sub {
  font-size: 9px;
  fill: var(--muted);
}

.cat-list {
  display: grid;
  gap: 8px;
  width: 100%;
}

.cat-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 0.9375rem;
}

.bars {
  display: grid;
  grid-template-columns: repeat(var(--n, 6), minmax(0, 64px));
  justify-content: space-around;
  gap: 10px;
  align-items: end;
  height: 140px;
}

.bars__col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  align-items: end;
  height: 100%;
}

.bars__bar {
  border-radius: 6px 6px 2px 2px;
  height: calc(var(--h, 0) * 100%);
  min-height: 2px;
  transition: height 0.8s var(--ease);
}

.bars__bar--earned {
  background: var(--credit);
}

.bars__bar--spent {
  background: var(--debit);
  opacity: 0.75;
}

.bars__labels {
  display: grid;
  grid-template-columns: repeat(var(--n, 6), minmax(0, 64px));
  justify-content: space-around;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-top: 6px;
}

/* ---------- requests ---------- */

.req {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}

.req__top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
}

.req__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  overflow-wrap: anywhere;
}

.req__details {
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.req__note {
  position: relative;
  padding: 10px 14px;
  border-radius: 4px 16px 16px 16px;
  background: var(--surface-3);
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.req__amount {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.req__amount--void {
  text-decoration: line-through;
  color: var(--muted);
}

.money-field {
  display: grid;
  gap: 6px;
}

.field__hint--error {
  color: var(--coral-600);
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .field__hint--error {
    color: #ffc2b5;
  }
}

.req__decide {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}

.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.chore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.chore-tile {
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  min-height: 96px;
  transition: transform 0.15s var(--spring), border-color 0.15s, background 0.15s;
}

.chore-tile[aria-pressed="true"] {
  border-color: var(--gold-500);
  background: var(--gold-100);
  transform: translateY(-2px);
}

.chore-tile__emoji {
  font-size: 1.6rem;
}

.chore-tile__name {
  font-weight: 600;
  line-height: 1.25;
}

.chore-tile__amt {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--credit);
}

/* ---------- home bits ---------- */

.greet {
  display: grid;
  gap: 2px;
}

.greet__hello {
  font-size: var(--step-2);
  font-weight: 700;
}

.tip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
}

.tip__bulb {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: var(--gold-100);
}

.tip__text {
  font-size: 1.0625rem;
  line-height: 1.5;
  transition: opacity 0.3s;
}

.tip__text.is-fading {
  opacity: 0;
}

.xp {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}

.preview {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-align: center;
}

.preview__label {
  font-size: 0.8125rem;
  color: var(--muted);
}

.preview__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

.preview__arrow {
  color: var(--gold-600);
}

.calc-result {
  display: grid;
  gap: 4px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--navy-800), var(--navy-950));
  color: #fff;
}

.calc-result__big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-4);
  color: var(--gold-300);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.calc-result__sub {
  color: rgba(255, 255, 255, 0.75);
}

/* ---------- table (audit) ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table th {
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text-2);
}

.table td.wrap {
  white-space: normal;
  min-width: 200px;
}

.person {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.person:first-child {
  border-top: 0;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: var(--surface-3);
}

/* ---------- sheets (dialog) ---------- */

.sheet {
  border: 0;
  padding: 0;
  margin: auto auto 0;
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}

.sheet[open] {
  animation: sheet-up 0.38s var(--ease);
}

.sheet::backdrop {
  background: rgba(4, 8, 24, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in 0.25s;
}

@media (min-width: 640px) {
  .sheet {
    margin: auto;
    border-radius: var(--r-xl);
  }
  .sheet[open] {
    animation: pop-in 0.3s var(--ease);
  }
}

.sheet__inner {
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 22px calc(22px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 18px;
}

.sheet__grab {
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: 0 auto;
}

.sheet__head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.sheet__title {
  font-size: var(--step-2);
  font-weight: 700;
}

.sheet__sub {
  color: var(--muted);
  margin-top: 4px;
}

@keyframes sheet-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes pop-in {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.celebrate {
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 10px 0 4px;
}

.celebrate__big {
  font-size: 4rem;
  line-height: 1;
  animation: wiggle 1.2s var(--spring);
}

@keyframes wiggle {
  0% {
    transform: scale(0.3) rotate(-20deg);
  }
  60% {
    transform: scale(1.15) rotate(8deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

/* ---------- toasts + confetti ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 60;
  display: grid;
  gap: 8px;
  width: min(92vw, 440px);
  pointer-events: none;
}

@media (min-width: 900px) {
  .toasts {
    bottom: 28px;
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--navy-900);
  color: #fff;
  box-shadow: var(--shadow-3);
  font-weight: 600;
  animation: toast-in 0.35s var(--spring);
  /* Never intercept a tap: the button under a toast must still work. */
  pointer-events: none;
}

.toast--error {
  background: var(--coral-600);
}

.toast--gold {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  color: var(--navy-950);
}

.toast.is-leaving {
  animation: toast-out 0.3s var(--ease) forwards;
}

@keyframes toast-in {
  from {
    transform: translateY(16px) scale(0.96);
    opacity: 0;
  }
}

@keyframes toast-out {
  to {
    transform: translateY(8px);
    opacity: 0;
  }
}

.confetti {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  pointer-events: none;
  z-index: 80;
}

.float-xp {
  position: fixed;
  z-index: 81;
  left: 50%;
  top: 38%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  color: var(--gold-500);
  text-shadow: 0 2px 0 var(--navy-900);
  pointer-events: none;
  animation: float-up 1.6s var(--ease) forwards;
}

@keyframes float-up {
  0% {
    transform: translate(-50%, 20px) scale(0.6);
    opacity: 0;
  }
  20% {
    transform: translate(-50%, 0) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -80px) scale(1);
    opacity: 0;
  }
}

.fade-in {
  animation: fade-in 0.35s var(--ease);
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .vault.is-shining::after {
    animation: none;
  }
}

.person__google {
  overflow-wrap: anywhere;
}
