/* ==========================================================================
   HomeHub — design system
   Light, quiet surfaces. Colour used for meaning, never for decoration.
   Mobile only: one column, thumb-reachable, 430px cap.
   ========================================================================== */

:root {
  /* neutrals */
  --bg:       #F4F5F7;
  --surface:  #FFFFFF;
  --sunken:   #F7F8FA;
  --chip:     #F1F2F5;
  --track:    #EDEFF3;
  --line:     rgba(16, 24, 40, .07);
  --line-2:   rgba(16, 24, 40, .12);

  --ink:      #101828;
  --on-ink:   #FFFFFF;   /* text on an ink-coloured surface */
  --ink-2:    #5A6478;
  --ink-3:    #98A0B0;

  /* accents */
  --red:      #E8465C;
  --red-soft: #FDEEF0;
  --blue:     #3D63F5;
  --blue-soft:#ECF0FE;
  --green:    #12B36A;
  --green-soft:#E8F8F0;
  --amber:    #E9A413;
  --amber-soft:#FDF3E0;
  --violet:   #6D5AF0;
  --teal:     #08A5A0;
  --orange:   #F2792B;
  --pink:     #EC4899;
  --sky:      #1899E0;

  --brand:    var(--blue);

  /* elevation */
  --glass:      rgba(255, 255, 255, .72);
  --glass-edge: rgba(255, 255, 255, .70);
  --blur: blur(22px) saturate(180%);

  --sh-1: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-2: 0 2px 8px rgba(16, 24, 40, .06);
  --sh-3: 0 12px 32px rgba(16, 24, 40, .12);
  --sh-4: 0 -6px 28px rgba(16, 24, 40, .10);

  /* shape */
  --r-xl: 22px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;

  --gap: 8px;
  --pad: 18px;
  --nav-h: 62px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text',
          'Segoe UI', Roboto, system-ui, sans-serif;
  --ease: cubic-bezier(.32, .72, 0, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Every icon gets a size here, first, so an icon used somewhere new can never
   fall back to the SVG default of 300x150 and bleed across the screen.
   Component rules below are more specific and still win. */
svg.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow-x: hidden;          /* nothing may push the page sideways */
  overscroll-behavior-y: none;
}

body::before {
  content: '';
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(34% 28% at 14% 10%, rgba(61, 99, 245, .30), transparent 62%),
    radial-gradient(30% 26% at 86% 6%,  rgba(232, 70, 92, .24), transparent 62%),
    radial-gradient(36% 30% at 84% 74%, rgba(18, 179, 106, .22), transparent 62%),
    radial-gradient(32% 28% at 16% 86%, rgba(233, 164, 19, .22), transparent 62%),
    radial-gradient(30% 26% at 50% 46%, rgba(109, 90, 240, .16), transparent 64%);
  filter: blur(42px);
}

body {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 450;
  line-height: 1.45;
  letter-spacing: -.011em;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }

.app {
  width: 100%;
  overflow-x: clip;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 126px);
  min-height: 100%;
}

.hide { display: none !important; }

/* one interaction language: everything tappable dips slightly */
.press { transition: transform .14s var(--ease), opacity .14s var(--ease), background-color .14s var(--ease); }
.press:active { transform: scale(.975); opacity: .88; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Header
   ========================================================================== */

.top {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: calc(env(safe-area-inset-top) + 18px) 0 16px;
}

.month { flex: 1; min-width: 0; display: flex; align-items: center; }

.month-name {
  font-size: 22px;
  font-weight: 640;
  letter-spacing: -.028em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.round {
  width: 36px; height: 36px;
  flex: 0 0 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--sh-1);
}
.round svg { width: 17px; height: 17px; }
.round.sm { width: 34px; height: 34px; flex-basis: 34px; }
.round.sm svg { width: 16px; height: 16px; }

.avatar {
  width: 36px; height: 36px;
  flex: 0 0 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  margin-left: 6px;
}

/* ==========================================================================
   Balance card
   ========================================================================== */

.money {
  display: block;
  width: 100%;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
  padding: 20px;
  margin-bottom: 18px;
}

.money-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.money-left .k,
.money-right .k {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: -.005em;
  margin-bottom: 3px;
}
.money-left .v {
  font-size: 34px;
  font-weight: 640;
  letter-spacing: -.035em;
  line-height: 1.08;
}
.money-right { text-align: right; }
.money-right .v { font-size: 16px; font-weight: 580; letter-spacing: -.02em; }

/* coloured hero variant (health, savings) */
.money.hero {
  background: linear-gradient(140deg, var(--hero), color-mix(in srgb, var(--hero) 76%, #000 24%));
  color: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--hero) 30%, transparent);
}
.money.hero .k { color: rgba(255, 255, 255, .78); }
.money.hero .money-right svg { width: 26px; height: 26px; opacity: .55; }

@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .money.hero { background: var(--hero); }
}

.bar {
  height: 6px;
  border-radius: 99px;
  background: var(--track);
  overflow: hidden;
  margin-top: 16px;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--green);
  transition: width .6s var(--ease);
}
.bar.warn > i { background: var(--amber); }
.bar.over > i { background: var(--red); }

/* ==========================================================================
   Health alert
   ========================================================================== */

.alert {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  background: var(--red-soft);
  color: var(--red);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.alert .ring {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
}
.alert .ring svg { width: 19px; height: 19px; }
.alert b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.015em; }
.alert span {
  font-size: 13px;
  font-weight: 450;
  color: color-mix(in srgb, var(--red) 78%, #000 22%);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.alert > svg { width: 18px; height: 18px; opacity: .55; flex: 0 0 18px; }

/* ==========================================================================
   Tiles
   ========================================================================== */

/* ==========================================================================
   The board
   A plain grid: every pocket is one identical cell, so the eye can scan
   down a column. Height comes from the content, so there is no dead space
   inside a block. One pocket may be set "wide" to take a whole row.
   ========================================================================== */

.board {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.tile {
  --c: var(--blue);
  --tint: var(--blue-soft);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  padding: 18px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--c) 94%, #fff 6%),
    color-mix(in srgb, var(--c) 64%, #000 36%));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 26%, transparent);
  overflow: hidden;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .tile { background: var(--c); }
}

.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 15px;
}

.tile .ic {
  width: 50px; height: 50px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .2);
  color: #fff;
  border-radius: 16px;
}
.tile .ic svg { width: 25px; height: 25px; }

.tile .flag {
  padding: 5px 10px;
  background: rgba(255, 255, 255, .22);
  color: #fff;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 560;
  letter-spacing: 0;
}

.tile .nm {
  display: block;
  font-size: 14.5px;
  font-weight: 540;
  color: rgba(255, 255, 255, .84);
  letter-spacing: -.012em;
  margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile .amt {
  display: block;
  font-size: 28px;
  font-weight: 640;
  letter-spacing: -.035em;
  line-height: 1.12;
}
.tile .sub {
  display: block;
  font-size: 12.5px;
  font-weight: 450;
  color: rgba(255, 255, 255, .8);
  margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.tile .mini {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .26);
  overflow: hidden;
  margin-top: 14px;
}
.tile .mini > i {
  display: block; height: 100%;
  background: #fff;
  border-radius: 99px;
  transition: width .6s var(--ease);
}

/* running low, and gone */
.tile.running-low .sub  { color: #FFF3D6; font-weight: 520; }
.tile.running-low .flag { background: #fff; color: #A9760A; }

.tile.spent-out {
  background: linear-gradient(150deg, #F2596C, #A61F32);
  box-shadow: 0 10px 26px rgba(232, 70, 92, .38);
}
.tile.spent-out .sub  { color: #FFE1E6; font-weight: 560; }
.tile.spent-out .flag { background: #fff; color: #C22B41; }

/* the wide option: a whole row, laid out sideways so it stays the same height */
.tile.xl {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 18px;
}
.tile.xl .ic { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 18px; }
.tile.xl .ic svg { width: 28px; height: 28px; }
.tile.xl .xl-body { flex: 1; min-width: 0; }
.tile.xl .amt { font-size: 30px; }
.tile.xl .flag { position: absolute; top: 18px; right: 18px; }
.tile.xl .mini { margin-top: 12px; }

/* ==========================================================================
   Sections, cards, rows
   ========================================================================== */

.head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 26px 2px 11px;
}
.head h2 { font-size: 15px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.head .more { font-size: 13.5px; font-weight: 520; color: var(--brand); }

.card {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-xl);
  box-shadow: 0 6px 20px rgba(16, 24, 40, .07), inset 0 1px 0 rgba(255, 255, 255, .7);
  padding: 6px 16px;
  margin-bottom: 14px;
}
.card.flat { box-shadow: var(--sh-1); padding: 4px 16px; }

.empty {
  text-align: center;
  padding: 34px 16px;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 450;
}
.empty svg { width: 26px; height: 26px; opacity: .4; display: block; margin: 0 auto 12px; }

.row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }

.row .dot {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: grid; place-items: center;
  border-radius: 11px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}
.row .dot svg { width: 17px; height: 17px; }
.row .dot.grad {
  --c: #64748B;
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--c) 94%, #fff 6%),
    color-mix(in srgb, var(--c) 66%, #000 34%));
  box-shadow: 0 3px 10px color-mix(in srgb, var(--c) 34%, transparent);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .row .dot.grad { background: var(--c); }
}
.row .txt { flex: 1; min-width: 0; }
.row .txt b {
  display: block;
  font-size: 14.5px;
  font-weight: 540;
  letter-spacing: -.015em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row .txt span {
  display: block;
  font-size: 12.5px;
  font-weight: 450;
  color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row .num { font-size: 14.5px; font-weight: 580; letter-spacing: -.02em; white-space: nowrap; }
.row .num.neg { color: var(--red); }
.row .num.pos { color: var(--green); }
.row > svg:last-child { width: 16px; height: 16px; color: var(--ink-3); flex: 0 0 16px; }

/* ==========================================================================
   Chips
   ========================================================================== */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 2px 16px 2px 0;
  margin-right: -16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips.scroll::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  height: 40px;
  padding: 0 14px;
  background: var(--chip);
  color: var(--ink-2);
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 520;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.chip svg { width: 16px; height: 16px; }
.chip .bub {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
  margin-left: -5px;
}
.bub {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
  flex: 0 0 auto;
}
.bub svg { width: 12px; height: 12px; }
.chip .bub svg { width: 12px; height: 12px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

/* ==========================================================================
   Bottom bar
   ========================================================================== */

.nav {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  transform: translateX(-50%);
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  width: calc(100% - 16px);
  max-width: 470px;
  height: var(--nav-h);
  border-radius: 24px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid var(--glass-edge);
  box-shadow: 0 10px 30px rgba(16, 24, 40, .16);
}

.nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 520;
  letter-spacing: -.005em;
  transition: color .16s var(--ease);
}
.nav button { padding: 0 2px; }
.nav button svg { width: 20px; height: 20px; }
.nav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav button[aria-current="page"] { color: var(--brand); }
.nav .spacer { pointer-events: none; }

.fab {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + var(--nav-h) + 20px);
  transform: translateX(-50%);
  z-index: 41;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: none;
  transition: transform .14s var(--ease);
}
.fab-ring {
  width: 62px; height: 62px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #4F7BFF, #1D3BC9 60%, #12279A);
  box-shadow:
    0 0 0 6px rgba(61, 99, 245, .16),
    0 0 26px 4px rgba(61, 99, 245, .52),
    0 10px 24px rgba(16, 24, 40, .28);
  animation: glow 2.6s ease-in-out infinite;
}
.fab-ring svg { width: 26px; height: 26px; stroke-width: 2.6; }
.fab-lb {
  padding: 4px 11px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink);
  font-size: 12px;
  font-weight: 580;
  letter-spacing: -.01em;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(16, 24, 40, .12);
}
.fab:active { transform: translateX(-50%) scale(.95); }

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 6px rgba(61, 99, 245, .14),
                         0 0 22px 3px rgba(61, 99, 245, .44),
                         0 10px 24px rgba(16, 24, 40, .26); }
  50%      { box-shadow: 0 0 0 10px rgba(61, 99, 245, .10),
                         0 0 34px 8px rgba(61, 99, 245, .62),
                         0 10px 24px rgba(16, 24, 40, .30); }
}

/* ==========================================================================
   Sheet
   ========================================================================== */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(16, 24, 40, .38);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade .2s var(--ease);
}
@keyframes fade { from { opacity: 0; } }

.sheet {
  width: 100%;
  max-width: 430px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--sh-4);
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 16px);
  animation: rise .34s var(--ease);
}
@keyframes rise { from { transform: translateY(100%); } }

.grab {
  width: 36px; height: 4px;
  background: var(--line-2);
  border-radius: 99px;
  margin: 4px auto 8px;
  flex: 0 0 auto;
}

.sheet-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 14px;
  flex: 0 0 auto;
}
.sheet-top h3 {
  flex: 1;
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -.024em;
  margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-top .round { background: var(--chip); box-shadow: none; }

.sheet-body { overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.sheet-body > .head:first-child { margin-top: 6px; }

/* ==========================================================================
   Amount + keypad
   ========================================================================== */

.amount-box {
  text-align: center;
  padding: 10px 0 20px;
}
.amount-box .cur {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.amount-box .big {
  font-size: 42px;
  font-weight: 640;
  letter-spacing: -.04em;
  line-height: 1.1;
  word-break: break-all;
}
.amount-box .big.zero { color: #C9CEDA; }

.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.pad button {
  height: 54px;
  display: grid; place-items: center;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--ink);
  background: transparent;
  border-radius: var(--r-md);
  transition: background-color .12s var(--ease);
}
.pad button:active { background: var(--chip); }
.pad button svg { width: 21px; height: 21px; color: var(--ink-2); }
.pad button.del { color: var(--ink-2); }
.pad button.go { background: var(--green); color: #fff; }

/* ==========================================================================
   Adding a spend
   Pick a pocket, tap an amount, done. Big targets, few words.
   ========================================================================== */

/* step 1 — which pocket */
.pick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-bottom: 6px;
}
.pick {
  --c: var(--blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 16px 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: center;
}
.pick-ic {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  background: var(--c);
  color: #fff;
  border-radius: 17px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 36%, transparent);
}
.pick-ic svg { width: 26px; height: 26px; }
.pick-nm {
  font-size: 13.5px; font-weight: 560; letter-spacing: -.015em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.pick-left { font-size: 11.5px; font-weight: 450; color: var(--ink-3); }

/* step 2 — the pocket you chose, always visible so you know where it lands */
.pad-cat {
  --c: var(--blue);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: color-mix(in srgb, var(--c) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 26%, transparent);
  border-radius: 16px;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .pad-cat { background: var(--surface); }
}
.pad-cat-ic {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center;
  background: var(--c); color: #fff; border-radius: 14px;
}
.pad-cat-ic svg { width: 22px; height: 22px; }
.pad-cat-nm { flex: 1; min-width: 0; }
.pad-cat-nm b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.pad-cat-nm span { font-size: 12.5px; font-weight: 450; color: var(--ink-3); }
.pad-swap {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  background: rgba(16, 24, 40, .05);
  color: var(--ink-2);
  border-radius: 12px;
}
.pad-swap svg { width: 17px; height: 17px; }

/* the cash-machine row: the amounts you actually use, one tap each */
.atm {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.atm-key {
  height: 52px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 16px;
  font-weight: 580;
  letter-spacing: -.02em;
}
.atm-key.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

.type-hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 450;
  color: var(--ink-3);
}
.type-hint svg { width: 13px; height: 13px; }

/* who it was for — faces, not a dropdown */
.who-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 14px;
}
.who-row::-webkit-scrollbar { display: none; }
.who-opt {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 66px;
  padding: 8px 4px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
}
.who-face {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  opacity: .5;
  transition: opacity .16s var(--ease), box-shadow .16s var(--ease);
}
.who-face.all { background: var(--ink-3); }
.who-face svg { width: 21px; height: 21px; }
.who-opt[aria-pressed="true"] { color: var(--ink); font-weight: 560; }
.who-opt[aria-pressed="true"] .who-face {
  opacity: 1;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink);
}

.btn.big { min-height: 58px; font-size: 17px; margin-top: 4px; }

/* ==========================================================================
   Pace bar — budget against the calendar
   ========================================================================== */

.pace {
  --tone: var(--blue);
  display: block;
  width: 100%;
  text-align: left;
  color: #fff;
  border-radius: var(--r-xl);
  padding: 20px;
  margin-bottom: 14px;
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--tone) 92%, #fff 8%),
    color-mix(in srgb, var(--tone) 60%, #000 40%));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--tone) 32%, transparent);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .pace { background: var(--tone); }
}
.pace-good  { --tone: var(--green); }
.pace-level { --tone: var(--blue); }
.pace-over  { --tone: var(--red); }

.pace-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.pace-k { display: block; font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,.82); margin-bottom: 2px; }
.pace-v { display: block; font-size: 33px; font-weight: 650; letter-spacing: -.035em; line-height: 1.06; }
.pace-of { text-align: right; }
.pace-of span { display: block; font-size: 11.5px; font-weight: 450; color: rgba(255,255,255,.8); }
.pace-of b { font-size: 15px; font-weight: 560; letter-spacing: -.02em; }

.pace-bar {
  position: relative;
  height: 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .26);
  overflow: hidden;
  margin: 15px 0 9px;
}
.pace-bar > i {
  display: block; height: 100%;
  border-radius: 99px;
  background: #fff;
  transition: width .6s var(--ease), background-color .3s var(--ease);
}
/* the notch shows where the month itself has got to */
.pace-bar > u {
  position: absolute;
  top: -2px; bottom: -2px;
  width: 2px;
  background: rgba(255, 255, 255, .85);
  border-radius: 2px;
}

.pace-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 450; color: rgba(255,255,255,.82); }
.pace-word { font-weight: 600; color: #fff; }

/* ==========================================================================
   Daily spending
   ========================================================================== */

.day-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.day-stat span { display: block; font-size: 11.5px; font-weight: 450; color: var(--ink-3); margin-bottom: 2px; }
.day-stat b { font-size: 17px; font-weight: 600; letter-spacing: -.025em; }
.day-stat b.pos { color: var(--green); }

.days {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 92px;
}
.days .day {
  flex: 1;
  min-width: 0;
  background: var(--blue);
  border-radius: 3px 3px 0 0;
  opacity: .75;
}
.days .day.empty { background: var(--track); opacity: 1; }
.days .day.today { background: var(--ink); opacity: 1; }
.days-avg {
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 1px dashed var(--ink-3);
  opacity: .7;
}

/* ==========================================================================
   Budget page
   ========================================================================== */

.bud-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.bud-row:last-child { border-bottom: 0; }
.bud-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bud-nm { flex: 1; min-width: 0; }
.bud-nm b { display: block; font-size: 14.5px; font-weight: 560; letter-spacing: -.015em; }
.bud-nm span { display: block; font-size: 12px; font-weight: 450; color: var(--ink-3); }

.bud-in { position: relative; flex: 0 0 116px; }
.bud-in i {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
}
.bud-in input {
  width: 100%;
  height: 42px;
  padding: 0 10px 0 34px;
  text-align: right;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 15px;
  font-weight: 560;
  letter-spacing: -.02em;
}
.bud-in input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}
.bud-row .track { display: block; height: 5px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bud-row .track > i { display: block; height: 100%; border-radius: 99px; }

/* ==========================================================================
   Note line in the add sheet
   ========================================================================== */

.note-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.note-line > svg { color: var(--ink-3); }
.note-line input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  background: none;
  font-size: 15px;
  font-weight: 450;
}
.note-line input:focus { outline: none; }
.note-line input::placeholder { color: var(--ink-3); }
.note-more {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(16, 24, 40, .05);
  color: var(--ink-2);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.field { margin-bottom: 14px; }
.field > label {
  display: block;
  font-size: 12.5px;
  font-weight: 520;
  color: var(--ink-3);
  margin-bottom: 7px;
  letter-spacing: -.005em;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 450;
  color: var(--ink);
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.field select { appearance: none; background-image: none; }

.two { display: flex; gap: 10px; }
.two > * { flex: 1; min-width: 0; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  font-size: 15.5px;
  font-weight: 560;
  letter-spacing: -.015em;
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--r-md);
}
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.blue { background: var(--brand); color: #fff; }
.btn.sm { min-height: 44px; font-size: 14px; padding: 10px 14px; }

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 520;
  text-align: left;
}
.switch .knob {
  width: 46px; height: 28px;
  flex: 0 0 46px;
  background: var(--track);
  border-radius: 99px;
  position: relative;
  transition: background-color .2s var(--ease);
}
.switch .knob::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 24px; height: 24px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .2);
  transition: transform .2s var(--ease);
}
.switch[aria-pressed="true"] .knob { background: var(--green); }
.switch[aria-pressed="true"] .knob::after { transform: translateX(18px); }

/* ==========================================================================
   People
   ========================================================================== */

.person {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-xl);
  box-shadow: 0 6px 20px rgba(16, 24, 40, .07);
  padding: 15px 16px;
  margin-bottom: 10px;
}
.person .face {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  border-radius: 14px;
}
.person .face svg { width: 20px; height: 20px; }
.person .info { flex: 1; min-width: 0; }
.person .info b { display: block; font-size: 15.5px; font-weight: 580; letter-spacing: -.02em; }
.person .info span { font-size: 12.5px; font-weight: 450; color: var(--ink-3); }
.person > svg:last-child { width: 16px; height: 16px; color: var(--ink-3); flex: 0 0 16px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 540;
  letter-spacing: -.005em;
  white-space: nowrap;
}
.pill svg { width: 12px; height: 12px; }
.pill.ok      { background: var(--green-soft); color: var(--green); }
.pill.soon    { background: var(--amber-soft); color: #A9760A; }
.pill.overdue { background: var(--red-soft);   color: var(--red); }


/* ==========================================================================
   Themes
   Bright is the default. Calm drops the gradients for soft tints and dark
   text. Dark inverts the neutrals. Everything else reads from these tokens,
   so no component needs to know which theme is on.
   ========================================================================== */

html[data-theme="calm"] {
  --bg:      #F5F6F8;
  --surface: #FFFFFF;
  --glass:   rgba(255, 255, 255, .86);
  --glass-edge: rgba(16, 24, 40, .06);
}
html[data-theme="calm"] body::before { opacity: .25; }

/* flat, tinted blocks with dark text instead of saturated gradients */
html[data-theme="calm"] .tile,
html[data-theme="calm"] .big-tile,
html[data-theme="calm"] .goal,
html[data-theme="calm"] .hero-tile,
html[data-theme="calm"] .pace {
  background: color-mix(in srgb, var(--c, var(--tone, var(--blue))) 11%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c, var(--tone, var(--blue))) 22%, transparent);
  box-shadow: var(--sh-1);
  color: var(--ink);
}
html[data-theme="calm"] .tile .ic,
html[data-theme="calm"] .big-tile .bt-ic,
html[data-theme="calm"] .goal .goal-ic {
  background: var(--c, var(--blue));
  color: #fff;
}
html[data-theme="calm"] .tile .nm,
html[data-theme="calm"] .big-tile .bt-nm,
html[data-theme="calm"] .goal-name span,
html[data-theme="calm"] .ht-k,
html[data-theme="calm"] .pace-k { color: var(--ink-3); }
html[data-theme="calm"] .tile .sub,
html[data-theme="calm"] .big-tile .bt-sub,
html[data-theme="calm"] .ht-foot,
html[data-theme="calm"] .pace-foot,
html[data-theme="calm"] .goal-foot,
html[data-theme="calm"] .goal-nums span { color: var(--ink-3); }
html[data-theme="calm"] .goal-pct,
html[data-theme="calm"] .pace-word { color: var(--c, var(--tone)); }
html[data-theme="calm"] .tile .mini,
html[data-theme="calm"] .goal-bar,
html[data-theme="calm"] .bt-bar,
html[data-theme="calm"] .pace-bar { background: rgba(16, 24, 40, .08); }
html[data-theme="calm"] .tile .mini > i,
html[data-theme="calm"] .goal-bar > i.saved,
html[data-theme="calm"] .bt-bar > i,
html[data-theme="calm"] .pace-bar > i { background: var(--c, var(--tone, var(--blue))); }
html[data-theme="calm"] .goal-bar > i.loan { background: color-mix(in srgb, var(--c) 40%, #fff); }
html[data-theme="calm"] .pace-bar > u { background: rgba(16, 24, 40, .4); }
html[data-theme="calm"] .tile .flag,
html[data-theme="calm"] .bt-edit { background: rgba(16, 24, 40, .06); color: var(--ink-2); }

html[data-theme="dark"] {
  --bg:      #0E1017;
  --surface: #171A23;
  --sunken:  #1C202B;
  --chip:    #232837;
  --track:   #262B39;
  --line:    rgba(255, 255, 255, .08);
  --line-2:  rgba(255, 255, 255, .16);

  --ink:     #EEF1F7;
  --on-ink:  #11141C;    /* ink is light in the dark theme, so this flips */
  --ink-2:   #A8B0C2;
  --ink-3:   #78819A;

  --glass:      rgba(28, 32, 44, .74);
  --glass-edge: rgba(255, 255, 255, .08);

  --red-soft:   #2B161C;
  --blue-soft:  #16203F;
  --green-soft: #12281F;
  --amber-soft: #2A2113;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .5);
  --sh-2: 0 2px 10px rgba(0, 0, 0, .55);
  --sh-3: 0 14px 36px rgba(0, 0, 0, .6);
  --sh-4: 0 -6px 30px rgba(0, 0, 0, .55);
}
html[data-theme="dark"] body::before { opacity: .5; filter: blur(60px); }
html[data-theme="dark"] .nav { background: rgba(23, 26, 35, .86); }
html[data-theme="dark"] .toast { background: rgba(238, 241, 247, .95); color: #10131B; }
html[data-theme="dark"] .toast .undo { color: #1D3BC9; }
html[data-theme="dark"] .fab-lb { background: rgba(23, 26, 35, .92); color: var(--ink); }
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .bud-in input,
html[data-theme="dark"] .k-in,
html[data-theme="dark"] .rate-in,
html[data-theme="dark"] .gcalc-in input,
html[data-theme="dark"] .gcalc-in select,
html[data-theme="dark"] .note-line,
html[data-theme="dark"] .icon-opt,
html[data-theme="dark"] .size-opt,
html[data-theme="dark"] .atm-key,
html[data-theme="dark"] .pick { background: var(--sunken); color: var(--ink); }
html[data-theme="dark"] .sum-list,
html[data-theme="dark"] .merge { background: var(--sunken); }
html[data-theme="dark"] .seg { background: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--sunken); }
html[data-theme="dark"] .days .day.today { background: var(--ink); }
html[data-theme="dark"] .btn.danger { background: rgba(232, 70, 92, .18); color: #FF8A9B; }
html[data-theme="dark"] .ctip { background: rgba(238, 241, 247, .96); color: #11141C; }
html[data-theme="dark"] .ctip span { color: rgba(17, 20, 28, .66); }
html[data-theme="dark"] .rate-in, html[data-theme="dark"] .logo-prev { background: var(--sunken); }
html[data-theme="dark"] .gate-bad { background: rgba(232, 70, 92, .16); }
html[data-theme="dark"] .wl-cell, html[data-theme="dark"] .bnr-cell { background: var(--sunken); }
html[data-theme="dark"] .wallet-strip { background: var(--line); }
html[data-theme="dark"] .rail { background: var(--surface); border-right-color: var(--line); }
html[data-theme="dark"] .stmt-due { background: rgba(61, 99, 245, .16); color: #94ADFF; }
html[data-theme="dark"] .sd-ic { background: var(--brand); color: #fff; }
html[data-theme="dark"] .ripple { opacity: .24; }
html[data-theme="dark"] .trend .stick { background: var(--track); }
html[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #1C202B 25%, #242938 50%, #1C202B 75%);
  background-size: 220% 100%;
}

/* the theme picker itself */
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-opt {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 12.5px;
  font-weight: 540;
  color: var(--ink-2);
}
.theme-opt .swatch-row { display: flex; gap: 3px; }
.theme-opt .swatch-row i { width: 13px; height: 22px; border-radius: 4px; }
.theme-opt[aria-pressed="true"] {
  border-color: var(--brand);
  color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}

/* ==========================================================================
   Splash
   Painted by the browser before any script runs, then faded out.
   ========================================================================== */

#splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px;
  text-align: center;
  color: #fff;
  background: linear-gradient(155deg, #8A6BFF 0%, #4F73FF 42%, #1FA6C9 74%, #08A58F 100%);
  animation: sp-in .4s var(--ease);
}
#splash.out {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
@keyframes sp-in { from { opacity: 0; } }

.sp-mark {
  width: 104px; height: 104px;
  display: grid; place-items: center;
  margin-bottom: 20px;
  border-radius: 32px;
  background: rgba(255, 255, 255, .16);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, .08), 0 20px 50px rgba(8, 20, 70, .3);
  animation: sp-pop .6s var(--ease) backwards;
}
.sp-mark svg { width: 64px; height: 64px; color: #fff; }
@keyframes sp-pop { from { opacity: 0; transform: scale(.7) translateY(14px); } }

.sp-nm {
  font-size: 32px;
  font-weight: 680;
  letter-spacing: -.035em;
  animation: sp-rise .6s .08s var(--ease) backwards;
}
.sp-sub {
  font-size: 13.5px;
  font-weight: 450;
  color: rgba(255, 255, 255, .82);
  animation: sp-rise .6s .16s var(--ease) backwards;
}
@keyframes sp-rise { from { opacity: 0; transform: translateY(10px); } }

.sp-dots { display: flex; gap: 7px; margin-top: 26px; }
.sp-dots i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  animation: sp-bounce 1.1s infinite ease-in-out;
}
.sp-dots i:nth-child(2) { animation-delay: .14s; }
.sp-dots i:nth-child(3) { animation-delay: .28s; }
@keyframes sp-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .55; }
  30%           { transform: translateY(-7px); opacity: 1; }
}

/* ==========================================================================
   Little celebrations
   Coins for gold, confetti for everything else. Purely decorative.
   ========================================================================== */

.party {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  overflow: hidden;
}
.party b {
  position: absolute;
  top: -24px;
  display: block;
  border-radius: 3px;
  animation: fall linear forwards;
}
.party b.coin {
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #FFE9A8, #F0B429 48%, #B07908);
  box-shadow: 0 2px 6px rgba(176, 121, 8, .45), inset 0 0 0 1.5px rgba(255, 244, 214, .7);
}
@keyframes fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(var(--spin)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .party { display: none; }
  .sp-dots i, .sp-mark, .sp-nm, .sp-sub { animation: none; }
}

/* ==========================================================================
   Header: the household name is the logo
   ========================================================================== */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 18px) 0 14px;
}
.brand-nm {
  flex: 1; min-width: 0;
  font-size: 20px;
  font-weight: 660;
  letter-spacing: -.028em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.month-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
  margin-bottom: 14px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: 99px;
}
.month-row .month-name { flex: 1; text-align: center; font-size: 16px; font-weight: 580; }
.month-row .round { background: transparent; box-shadow: none; }

/* ==========================================================================
   Profile and the private locker
   ========================================================================== */

.prof-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0 22px;
  text-align: center;
}
.prof-face {
  width: 78px; height: 78px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: 0;
  margin-bottom: 8px;
  box-shadow: 0 8px 22px rgba(16, 24, 40, .18);
}
.prof-nm { font-size: 22px; font-weight: 640; letter-spacing: -.03em; }
.prof-sub { font-size: 13px; font-weight: 450; color: var(--ink-3); }

.locker-hero {
  background: linear-gradient(140deg, #3B3A5C, #1B1A32 60%, #101024);
  box-shadow: 0 14px 34px rgba(27, 26, 50, .40);
}
.locker-hero .ht-k { display: flex; align-items: center; gap: 7px; }
.locker-hero .ht-k svg { width: 15px; height: 15px; }

.lede svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

/* ==========================================================================
   Big gradient blocks
   The same shape everywhere: money pages, budget, hubs.
   ========================================================================== */

.hero-tile {
  --c: var(--blue);
  display: block;
  padding: 22px 22px 20px;
  margin-bottom: 16px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--c) 92%, #fff 8%),
    color-mix(in srgb, var(--c) 62%, #000 38%));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--c) 32%, transparent);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .hero-tile { background: var(--c); }
}
.ht-k { display: block; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .8); margin-bottom: 4px; }
.ht-v { display: block; font-size: 38px; font-weight: 660; letter-spacing: -.04em; line-height: 1.05; }
.ht-foot {
  display: flex; flex-wrap: wrap; gap: 4px 18px;
  margin-top: 12px;
  font-size: 13px; font-weight: 450; color: rgba(255, 255, 255, .84);
}

.tiles-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.big-tile {
  --c: var(--blue);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  text-align: left;
  padding: 18px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--c) 94%, #fff 6%),
    color-mix(in srgb, var(--c) 64%, #000 36%));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 26%, transparent);
  overflow: hidden;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .big-tile { background: var(--c); }
}

.bt-ic {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .2);
  border-radius: 15px;
}
.bt-ic svg { width: 23px; height: 23px; }
.bt-body { display: block; }
.bt-nm {
  display: block;
  font-size: 13.5px; font-weight: 500;
  color: rgba(255, 255, 255, .84);
  margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bt-v { display: block; font-size: 26px; font-weight: 650; letter-spacing: -.035em; line-height: 1.12; }
.bt-sub {
  display: block;
  font-size: 12px; font-weight: 450;
  color: rgba(255, 255, 255, .78);
  margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bt-bar {
  display: block; height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .26);
  overflow: hidden;
  margin-top: 10px;
}
.bt-bar > i { display: block; height: 100%; background: #fff; border-radius: 99px; transition: width .6s var(--ease); }
.big-tile.over .bt-bar > i { background: #FFD7DD; }

.bt-edit {
  position: absolute;
  top: 18px; right: 18px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .2);
  border-radius: 9px;
}
.bt-edit svg { width: 14px; height: 14px; }

/* ==========================================================================
   Gold calculator
   ========================================================================== */

.rate-card { padding: 16px; }
.rate-card.stale { border-color: rgba(233, 164, 19, .5); }
.rate-card .seg { margin-bottom: 14px; }

.rate-in {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.rate-in i {
  font-style: normal;
  font-size: 14px; font-weight: 500;
  color: var(--ink-3);
}
.rate-in input {
  flex: 1; min-width: 0;
  height: 56px;
  border: 0; background: none;
  font-size: 24px; font-weight: 640;
  letter-spacing: -.03em;
}
.rate-in input:focus { outline: none; }
.rate-in b { font-size: 12px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.warn-txt { color: var(--red); font-weight: 500; }

.gcalc { padding: 12px 0; border-bottom: 1px solid var(--line); }
.gcalc:last-child { border-bottom: 0; }
.gcalc-in {
  display: grid;
  grid-template-columns: 1fr 92px 82px 42px;
  gap: 6px;
}
.gcalc-in input,
.gcalc-in select {
  width: 100%;
  min-height: 50px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 560;
}
.gcalc-in select { appearance: none; text-align: center; font-weight: 500; }
.gcalc-in input:focus, .gcalc-in select:focus {
  outline: none; border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(233, 164, 19, .18);
}
.gcalc-out {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-top: 8px; padding: 0 2px;
}
.gcalc-out .g-pure { font-size: 12.5px; font-weight: 450; color: var(--ink-3); }
.gcalc-out .g-val { font-size: 17px; font-weight: 620; letter-spacing: -.025em; color: #8A6008; }

/* ==========================================================================
   Gold page
   ========================================================================== */

.gold-hero {
  --c: var(--amber);
  background: linear-gradient(140deg, #F6C453, #C98A0E 55%, #8A5D06);
  box-shadow: 0 14px 34px rgba(201, 138, 14, .38);
}
.gold-page .head h2 { color: #8A5D06; }
.gold-btn { background: linear-gradient(140deg, #D9A21B, #A4700A); }

.rate-grid { padding: 14px 16px; }
.krate {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.krate:last-of-type { border-bottom: 0; }
.k-badge {
  width: 52px; flex: 0 0 52px;
  text-align: center;
  padding: 7px 0;
  border-radius: 10px;
  background: var(--amber-soft);
  color: #8A5D06;
  font-size: 13.5px;
  font-weight: 620;
}
.krate.own .k-badge { background: linear-gradient(140deg, #F6C453, #C98A0E); color: #fff; }
.k-in {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 7px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.k-in i { font-style: normal; font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.k-in input {
  flex: 1; min-width: 0;
  height: 48px;
  border: 0; background: none;
  font-size: 18px; font-weight: 600; letter-spacing: -.025em;
}
.k-in input:focus { outline: none; }
.krate:focus-within .k-in { border-color: #C98A0E; box-shadow: 0 0 0 3px rgba(201, 138, 14, .16); }
.k-note {
  flex: 0 0 76px;
  font-size: 10.5px;
  font-weight: 450;
  line-height: 1.2;
  color: var(--ink-3);
}

/* ==========================================================================
   Greeting banner
   ========================================================================== */

.brand-txt { flex: 1; min-width: 0; }
.brand-hi {
  font-size: 21px;
  font-weight: 660;
  letter-spacing: -.03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-nm {
  font-size: 12.5px;
  font-weight: 450;
  color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ==========================================================================
   Quick actions
   ========================================================================== */

.quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 4px;
}
.qk {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px;
  text-align: left;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: 18px;
  overflow: hidden;
}
.qk-ic {
  --c: var(--blue);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  margin-bottom: 4px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, var(--c), color-mix(in srgb, var(--c) 64%, #000 36%));
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .qk-ic { background: var(--c); }
}
.qk-nm { font-size: 13.5px; font-weight: 580; letter-spacing: -.015em; }
.qk-sub {
  font-size: 11.5px; font-weight: 450; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* ==========================================================================
   Ripple and chart tooltip
   ========================================================================== */

.ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: .18;
  pointer-events: none;
  transform: scale(0);
  animation: ripple .6s var(--ease) forwards;
}
@keyframes ripple {
  to { transform: scale(1); opacity: 0; }
}

.ctip {
  position: fixed;
  z-index: 170;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(16, 24, 40, .94);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .16s var(--ease), transform .16s var(--ease);
  box-shadow: 0 10px 26px rgba(16, 24, 40, .3);
}
.ctip.on { opacity: 1; transform: translateY(0); }
.ctip b { display: block; font-size: 15px; font-weight: 620; letter-spacing: -.02em; }
.ctip span { color: rgba(255, 255, 255, .72); }

.days .day, .trend .col .stick, .donut circle {
  transition: filter .18s var(--ease), opacity .18s var(--ease), transform .18s var(--ease);
  cursor: pointer;
}
/* a finger needs a target it can actually hit */
.donut circle { stroke-linecap: butt; }
.days .day { min-width: 6px; }
.days .day.chart-hot {
  filter: brightness(1.15) drop-shadow(0 0 8px currentColor);
  opacity: 1;
}
.trend .col.chart-hot .stick {
  filter: brightness(1.1) drop-shadow(0 4px 12px rgba(61, 99, 245, .5));
}
.trend .col.chart-hot .val { color: var(--ink); font-weight: 600; }
.donut circle.chart-hot { filter: drop-shadow(0 0 10px currentColor) brightness(1.08); }
.donut.has-hot circle:not(.chart-hot) { opacity: .5; }
.days.has-hot .day:not(.chart-hot) { opacity: .4; }
.day:focus-visible, .col:focus-visible, .donut circle:focus-visible { outline: 2px solid var(--brand); }

/* ==========================================================================
   Desktop rail
   Hidden on a phone, which keeps the bottom bar.
   ========================================================================== */

.rail { display: none; }

/* ==========================================================================
   Stats banner
   ========================================================================== */

.bnr {
  --tone: var(--blue);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 16px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, .22);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--tone) 26%, transparent);
}
.bnr-good  { --tone: var(--green); }
.bnr-level { --tone: var(--blue); }
.bnr-over  { --tone: var(--red); }
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .bnr { box-shadow: var(--sh-2); }
}

.bnr-cell {
  display: block;
  text-align: left;
  padding: 15px 14px;
  color: #fff;
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--tone) 92%, #fff 8%),
    color-mix(in srgb, var(--tone) 62%, #000 38%));
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .bnr-cell { background: var(--tone); }
}
.bc-k {
  display: block; font-size: 11px; font-weight: 500;
  color: rgba(255, 255, 255, .8); margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bc-v { display: block; font-size: 19px; font-weight: 650; letter-spacing: -.03em; }
.bc-s {
  display: block; font-size: 10.5px; font-weight: 450;
  color: rgba(255, 255, 255, .76); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

html[data-theme="calm"] .bnr-cell {
  background: color-mix(in srgb, var(--tone) 12%, var(--surface));
  color: var(--ink);
}
html[data-theme="calm"] .bc-k, html[data-theme="calm"] .bc-s { color: var(--ink-3); }
html[data-theme="calm"] .bnr { background: var(--line); box-shadow: var(--sh-1); }

/* ==========================================================================
   Header: logo, then the greeting above the month
   ========================================================================== */

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  text-align: left;
}
.brand-logo img,
.bl-mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  object-fit: cover;
  color: #fff;
  background: linear-gradient(145deg, #7C5CFF, #3D63F5 55%, #08A5A0);
}
.bl-mark svg { width: 20px; height: 20px; }
.bl-name {
  font-size: 17px;
  font-weight: 660;
  letter-spacing: -.03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-hi {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  margin: 0 2px 12px;
  letter-spacing: -.015em;
}

/* the rail already shows the logo, so the header does not repeat it */
@media (min-width: 1000px) {
  .brand-logo { display: none; }
  .brand { justify-content: flex-end; }
  .brand-hi { font-size: 17px; }
}

/* ==========================================================================
   Greeting beside the avatar
   ========================================================================== */

.brand-me {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border-radius: 16px;
}
.brand-me .avatar { width: 46px; height: 46px; flex: 0 0 46px; font-size: 17px; margin: 0; }

/* ==========================================================================
   Transactions
   ========================================================================== */

.seg.seg-wide { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin-bottom: 8px; }
.seg.seg-wide button { text-align: center; }
.tx-actions { margin-bottom: 14px; }
.row .num.move { color: var(--blue); }

/* ==========================================================================
   Logo picker
   ========================================================================== */

.logo-row { display: flex; align-items: center; gap: 14px; }
.logo-prev {
  width: 56px; height: 56px; flex: 0 0 56px;
  display: grid; place-items: center;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(145deg, #7C5CFF, #3D63F5 55%, #08A5A0);
  color: #fff;
}
.logo-prev img { width: 100%; height: 100%; object-fit: cover; }
.logo-prev .rl-glyph svg { width: 26px; height: 26px; }
.logo-btns { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }


/* ==========================================================================
   Desktop rail
   Only above 1000px, where there is genuinely room for it. The content
   is pushed over with padding on <body>; the rail itself is fixed, so
   the two cannot fight over the same space.
   ========================================================================== */

@media (min-width: 1000px) {
  body { padding-left: 264px; }
  body.rail-tight { padding-left: 84px; }
  /* no rail while signing in, so no offset either */
  body.at-gate, body.at-gate.rail-tight { padding-left: 0; }

  .nav { display: none; }
  .fab { display: none; }

  .rail {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 60;
    width: 264px;
    display: flex;
    flex-direction: column;
    padding: 18px 14px 16px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .22s var(--ease);
  }
  body.rail-tight .rail { width: 84px; }

  /* --- logo --- */
  .rail-logo { display: flex; align-items: center; gap: 11px; padding: 4px 6px 22px; }
  .rl-mark {
    width: 40px; height: 40px; flex: 0 0 40px;
    display: grid; place-items: center;
    border-radius: 13px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(145deg, #7C5CFF, #3D63F5 55%, #08A5A0);
  }
  .rl-mark img { width: 100%; height: 100%; object-fit: cover; }
  .rl-glyph svg { width: 21px; height: 21px; }
  .rl-name {
    flex: 1; min-width: 0;
    font-size: 16.5px; font-weight: 660; letter-spacing: -.03em;
    white-space: nowrap; overflow: hidden;
  }
  .rl-fold {
    width: 28px; height: 28px; flex: 0 0 28px;
    display: grid; place-items: center;
    border-radius: 8px;
    color: var(--ink-3);
    transition: background-color .14s var(--ease), transform .22s var(--ease);
  }
  .rl-fold:hover { background: var(--chip); color: var(--ink); }
  body.rail-tight .rl-name { display: none; }
  body.rail-tight .rl-fold { transform: rotate(180deg); }
  body.rail-tight .rail-logo { justify-content: center; padding-left: 0; padding-right: 0; }

  /* --- links --- */
  .rail-items { flex: 1; display: flex; flex-direction: column; gap: 2px; }
  .rail-group { display: block; }

  .rail-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border-radius: 11px;
    text-align: left;
    font-size: 14.5px;
    font-weight: 520;
    letter-spacing: -.012em;
    color: var(--ink-2);
    transition: background-color .14s var(--ease), color .14s var(--ease);
  }
  .rl-ic {
    width: 30px; height: 30px; flex: 0 0 30px;
    display: grid; place-items: center;
    border-radius: 9px;
    color: var(--c, var(--ink-3));
    background: color-mix(in srgb, var(--c, #64748B) 12%, transparent);
    transition: background-color .16s var(--ease), color .16s var(--ease);
  }
  .rl-ic svg { width: 17px; height: 17px; }
  .rl-lb { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail-link:hover { background: var(--chip); color: var(--ink); }
  .rail-link.on {
    background: color-mix(in srgb, var(--c, var(--brand)) 12%, transparent);
    color: var(--c, var(--brand));
  }
  .rail-link.on .rl-ic {
    background: var(--c, var(--brand));
    color: #fff;
    box-shadow: 0 3px 10px color-mix(in srgb, var(--c, var(--brand)) 36%, transparent);
  }
  @supports not (background: color-mix(in srgb, red 50%, blue)) {
    .rl-ic { background: var(--chip); }
    .rail-link.on { background: var(--blue-soft); color: var(--brand); }
    .rail-link.on .rl-ic { background: var(--brand); color: #fff; }
  }
  .rail-kid.on {
    color: var(--c, var(--brand));
    font-weight: 580;
    background: color-mix(in srgb, var(--c, var(--brand)) 10%, transparent);
  }

  .rl-chev { display: grid; place-items: center; transition: transform .2s var(--ease); }
  .rl-chev svg { width: 14px; height: 14px; }
  .rail-group.open .rl-chev { transform: rotate(180deg); }

  /* a single wrapper inside the grid row, so all the children collapse
     together instead of only the first one being clipped */
  .rail-kids {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .26s var(--ease);
    margin-left: 27px;
    border-left: 1px solid var(--line);
  }
  .rail-kids-in { overflow: hidden; min-height: 0; }
  .rail-group.open .rail-kids { grid-template-rows: 1fr; }
  .rail-kid {
    display: block;
    width: 100%;
    padding: 9px 12px;
    text-align: left;
    font-size: 13.5px;
    font-weight: 480;
    color: var(--ink-3);
    border-radius: 0 9px 9px 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .rail-kid:hover { background: var(--chip); color: var(--ink); }


  /* --- add, and me --- */
  .rail-add {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    height: 46px;
    margin: 16px 0 12px;
    border-radius: 13px;
    color: #fff;
    font-size: 14.5px; font-weight: 580; letter-spacing: -.015em;
    background: linear-gradient(145deg, #4F7BFF, #1D3BC9);
    box-shadow: 0 6px 18px rgba(29, 59, 201, .34);
  }
  .rail-add svg { width: 18px; height: 18px; }

  .rail-me {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 10px;
    border-radius: 13px;
    text-align: left;
    transition: background-color .14s var(--ease);
  }
  .rail-me:hover { background: var(--chip); }
  .rail-me .avatar { width: 36px; height: 36px; flex: 0 0 36px; font-size: 14px; margin: 0; }
  .rl-me-txt { flex: 1; min-width: 0; }
  .rl-me-txt b {
    display: block; font-size: 13.5px; font-weight: 580; letter-spacing: -.015em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .rl-me-txt span { display: block; font-size: 11.5px; font-weight: 450; color: var(--ink-3); }

  /* --- collapsed: icons only, with a tooltip --- */
  body.rail-tight .rail-link { justify-content: center; padding: 0; gap: 0; }
  body.rail-tight .rl-ic { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
  body.rail-tight .rl-ic svg { width: 19px; height: 19px; }
  body.rail-tight .rail-add svg { width: 20px; height: 20px; }
  body.rail-tight .rail-me .avatar { margin: 0; }
  body.rail-tight .rl-lb,
  body.rail-tight .rl-chev,
  body.rail-tight .rail-kids,
  body.rail-tight .rail-add span,
  body.rail-tight .rl-me-txt { display: none; }
  body.rail-tight .rail-add { margin-left: 4px; margin-right: 4px; }
  body.rail-tight .rail-me { justify-content: center; }

  body.rail-tight .rail-link::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) scale(.94);
    padding: 7px 11px;
    border-radius: 9px;
    background: rgba(16, 24, 40, .94);
    color: #fff;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .14s var(--ease), transform .14s var(--ease);
    z-index: 5;
  }
  body.rail-tight .rail-link:hover::after { opacity: 1; transform: translateY(-50%) scale(1); }

  /* the content has the rest of the window to itself */
  .app { max-width: 1120px; padding: 0 40px 72px; }
  .toast { left: calc(50% + 132px); }
  body.rail-tight .toast { left: calc(50% + 42px); }
  .offline { padding-left: 264px; }
  .scrim { padding-left: 296px; }
  body.rail-tight .scrim { padding-left: 116px; }

  .bnr { grid-template-columns: repeat(3, 1fr); }
  .bnr-cell { padding: 20px 22px; }
  .bc-k { font-size: 12.5px; }
  .bc-v { font-size: 27px; }
  .bc-s { font-size: 12px; }
}

@media (min-width: 1400px) {
  .app { max-width: 1280px; }
}

/* ==========================================================================
   Profile chip, wallet strip, statement
   ========================================================================== */

.me-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 4px 4px 4px 12px;
  border-radius: 99px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
}
.me-nm {
  font-size: 13.5px; font-weight: 560; letter-spacing: -.015em;
  max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.me-chip .avatar { width: 32px; height: 32px; flex: 0 0 32px; font-size: 13px; margin: 0; }

.brand { align-items: center; }
.brand-me { display: none; }

.wallet-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-bottom: 18px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--line);
}
.wl-cell {
  display: block;
  padding: 14px 12px;
  text-align: left;
  background: var(--surface);
}
.wl-k {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500; color: var(--ink-3); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden;
}
.wl-k svg { width: 12px; height: 12px; }
.wl-v { display: block; font-size: 17px; font-weight: 650; letter-spacing: -.028em; }

.stmt-due {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: var(--r-lg);
  background: var(--blue-soft);
  color: var(--brand);
}
.sd-ic {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
}
.sd-txt { flex: 1; min-width: 0; }
.sd-txt b { display: block; font-size: 14.5px; font-weight: 580; letter-spacing: -.015em; }
.sd-txt span { display: block; font-size: 12px; font-weight: 450; opacity: .85; }
.stmt-due > svg { width: 16px; height: 16px; opacity: .6; }

@media (min-width: 1000px) {
  .wallet-strip { max-width: 620px; margin-left: auto; margin-right: auto; }
  .wl-cell { padding: 18px 20px; }
  .wl-v { font-size: 22px; }
}

/* ==========================================================================
   Committee countdown
   ========================================================================== */

.cd-row { padding: 13px 0; border-bottom: 1px solid var(--line); }
.cd-row:last-child { border-bottom: 0; }
.cd-top { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.cd-left {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--chip);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 560;
  white-space: nowrap;
}
.cd-left.soon { background: var(--violet); color: #fff; }
.cd-row .track { display: block; height: 5px; border-radius: 99px; background: var(--track); overflow: hidden; }
.cd-row .track > i { display: block; height: 100%; border-radius: 99px; }

/* ==========================================================================
   Locker: the what-if total
   ========================================================================== */

.merge {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  margin-bottom: 14px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px dashed var(--line-2);
}
.mg-k { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-3); margin-bottom: 12px; }
.mg-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mg-row > span { display: block; }
.mg-row i { display: block; font-style: normal; font-size: 11px; font-weight: 450; color: var(--ink-3); }
.mg-row b { font-size: 16px; font-weight: 600; letter-spacing: -.025em; }
.mg-plus, .mg-eq {
  align-self: flex-end;
  padding-bottom: 2px;
  color: var(--ink-3);
  font-size: 15px;
  font-weight: 500;
}
.mg-plus svg { width: 13px; height: 13px; }
.mg-tot b { font-size: 20px; font-weight: 660; color: var(--green); }

/* ==========================================================================
   Children
   ========================================================================== */

.kid {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-1);
  padding: 16px;
  margin-bottom: 12px;
}
.kid-top { display: flex; align-items: center; gap: 13px; }
.kid-face {
  width: 46px; height: 46px; flex: 0 0 46px;
  display: grid; place-items: center;
  border-radius: 15px;
  color: #fff;
  font-size: 17px; font-weight: 620; letter-spacing: 0;
}
.kid-who { flex: 1; min-width: 0; }
.kid-who b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.kid-who span { font-size: 12.5px; font-weight: 450; color: var(--ink-3); }
.kid-bal { font-size: 19px; font-weight: 650; letter-spacing: -.03em; }

.kid-sums {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 12px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}
.kid-sums i { display: block; font-style: normal; font-size: 11px; font-weight: 450; color: var(--ink-3); }
.kid-sums b { font-size: 14.5px; font-weight: 580; letter-spacing: -.02em; }
.kid-sums b.pos { color: var(--green); }

.kid-acts { display: flex; gap: 8px; margin-top: 12px; }
.kid-acts .btn { flex: 1; }
.kid-acts .round { flex: 0 0 44px; height: 44px; background: var(--chip); box-shadow: none; }

@media (min-width: 1000px) {
  .kid { padding: 20px; }
}

/* ==========================================================================
   Goals
   The bar shows saved money and expected loan as separate slices,
   with the empty part being what is still missing.
   ========================================================================== */

.goals { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }

.goal {
  --c: var(--blue);
  display: block;
  width: 100%;
  text-align: left;
  padding: 18px;
  border-radius: var(--r-xl);
  color: #fff;
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--c) 94%, #fff 6%),
    color-mix(in srgb, var(--c) 62%, #000 38%));
  box-shadow: 0 10px 26px color-mix(in srgb, var(--c) 30%, transparent);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .goal { background: var(--c); }
}
.goal.done { box-shadow: 0 10px 26px rgba(18, 179, 106, .34); }

.goal-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.goal-ic {
  width: 42px; height: 42px; flex: 0 0 42px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .2); color: #fff;
  border-radius: 14px;
}
.goal-ic svg { width: 21px; height: 21px; }
.goal-name { flex: 1; min-width: 0; }
.goal-name b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.goal-name span { display: block; font-size: 12px; font-weight: 450; color: rgba(255,255,255,.8); }
.goal-pct { font-size: 15px; font-weight: 600; color: #fff; letter-spacing: -.02em; }

.goal-bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .24);
  overflow: hidden;
  margin-bottom: 10px;
}
.goal-bar.big { height: 14px; margin: 4px 0 12px; background: var(--track); }
.goal-bar.big > i.saved { background: var(--blue); }
.goal-bar.big > i.loan { background: #A9BCFB; }
.goal-bar > i { display: block; height: 100%; transition: width .6s var(--ease); }
.goal-bar > i.saved { background: #fff; }
.goal-bar > i.loan  { background: rgba(255, 255, 255, .5); }
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .goal-bar > i.loan { background: var(--ink-3); }
}

.goal-nums { display: flex; align-items: baseline; gap: 6px; }
.goal-nums b { font-size: 19px; font-weight: 640; letter-spacing: -.03em; }
.goal-nums span { font-size: 13px; font-weight: 450; color: rgba(255,255,255,.8); }

.goal-foot {
  display: flex; justify-content: space-between; gap: 10px;
  margin-top: 6px;
  font-size: 12.5px; font-weight: 450; color: rgba(255,255,255,.82);
}
.goal-foot .ok { color: #fff; font-weight: 600; }

.key-row {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 12px; font-weight: 450; color: var(--ink-3);
}
.key-row span { display: flex; align-items: center; gap: 6px; }
.key-row i { width: 10px; height: 10px; border-radius: 3px; }
.k-saved { background: var(--blue); }
.k-loan  { background: #A9BCFB; }
.k-gap   { background: var(--track); }

.sum-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 4px 16px;
  margin-bottom: 4px;
}
.sum-line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.sum-line:last-child { border-bottom: 0; }
.sum-line span { font-size: 13.5px; font-weight: 450; color: var(--ink-2); }
.sum-line b { font-size: 15.5px; font-weight: 600; letter-spacing: -.02em; }
.sum-line b.pos { color: var(--green); }
.sum-line b.neg { color: var(--red); }
.sum-line b.soon { color: var(--violet); }

/* ticking holdings into a goal */
.row.tick .box {
  width: 26px; height: 26px; flex: 0 0 26px;
  display: grid; place-items: center;
  border: 2px solid var(--line-2);
  border-radius: 9px;
  color: transparent;
  transition: background-color .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
}
.row.tick .box svg { width: 15px; height: 15px; }
.row.tick[aria-pressed="true"] .box {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.pick-total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 4px 14px;
}
.pick-total span { font-size: 13px; font-weight: 450; color: var(--ink-3); }
.pick-total b { font-size: 19px; font-weight: 640; letter-spacing: -.03em; }

.add-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  padding: 18px;
}
.add-ic {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center;
  background: var(--blue-soft); color: var(--brand);
  border-radius: 14px;
}
.add-ic svg { width: 21px; height: 21px; }
.add-card b { display: block; font-size: 15.5px; font-weight: 600; letter-spacing: -.02em; }
.add-card span span { font-size: 12.5px; font-weight: 450; color: var(--ink-3); }

.hint { margin: 6px 2px 0; font-size: 12px; font-weight: 450; color: var(--ink-3); }

/* ==========================================================================
   Savings
   ========================================================================== */

.num.soon { color: var(--violet); }

.rate-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 15px;
  margin: -4px 0 14px;
  background: var(--amber-soft);
  border: 1px solid rgba(233, 164, 19, .35);
  border-radius: var(--r-lg);
  color: #8A6008;
}
.rate-bar.stale { background: var(--red-soft); border-color: rgba(232, 70, 92, .35); color: var(--red); }
.rate-txt { flex: 1; min-width: 0; }
.rate-txt b { display: block; font-size: 14px; font-weight: 580; letter-spacing: -.015em; }
.rate-txt span { display: block; font-size: 12px; font-weight: 450; opacity: .85; }

.pot-head {
  --c: var(--green);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 16px 20px;
  text-align: center;
}
.pot-ic {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  background: var(--c); color: #fff;
  border-radius: 18px;
  margin-bottom: 8px;
}
.pot-ic svg { width: 27px; height: 27px; }
.pot-v { font-size: 32px; font-weight: 650; letter-spacing: -.035em; }
.pot-k { font-size: 13px; font-weight: 450; color: var(--ink-3); }

.goal-line { margin-bottom: 14px; }
.goal-line .track {
  display: block; height: 6px; border-radius: 99px;
  background: var(--track); overflow: hidden; margin-bottom: 6px;
}
.goal-line .track > i { display: block; height: 100%; border-radius: 99px; }
.goal-line > span { font-size: 12.5px; font-weight: 450; color: var(--ink-3); }

.gold-row {
  display: grid;
  grid-template-columns: 1fr 88px 76px 40px;
  gap: 6px;
  margin-bottom: 8px;
}
.gold-row input,
.gold-row select {
  width: 100%;
  min-height: 46px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 500;
}
.gold-row select { appearance: none; text-align: center; }
.gold-row input:focus, .gold-row select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}
.g-del {
  display: grid; place-items: center;
  border-radius: 11px;
  background: rgba(16, 24, 40, .05);
  color: var(--ink-3);
}

.bud-in.wide { flex: 1 1 auto; width: 100%; }
.bud-in.wide input { height: 48px; text-align: left; font-size: 16px; padding-left: 38px; }

/* ==========================================================================
   Report
   ========================================================================== */

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); margin-bottom: 14px; }
.stat {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 15px 16px;
}
.stat .k { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-bottom: 3px; }
.stat .v { font-size: 21px; font-weight: 620; letter-spacing: -.03em; }

.brow { display: block; padding: 13px 0; border-bottom: 1px solid var(--line); }
.brow:last-child { border-bottom: 0; }
.brow .t { display: flex; align-items: center; gap: 11px; margin-bottom: 9px; }
.brow .t .dot {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: #fff;
  font-size: 12px; font-weight: 600; letter-spacing: 0;
}
.brow .t .dot svg { width: 15px; height: 15px; }
.brow .t b { flex: 1; font-size: 14.5px; font-weight: 540; letter-spacing: -.015em; }
.brow .t .n { font-size: 14.5px; font-weight: 580; letter-spacing: -.02em; }
.brow .track { display: block; height: 5px; border-radius: 99px; background: var(--track); overflow: hidden; }
.brow .track > i { display: block; height: 100%; border-radius: 99px; }
.brow .cap { display: block; font-size: 12px; font-weight: 450; color: var(--ink-3); margin-top: 7px; }

.trend { display: flex; align-items: flex-end; gap: 10px; height: 152px; padding-top: 4px; }
.trend .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.trend .stick { width: 100%; max-width: 30px; border-radius: 6px; background: var(--track); min-height: 4px; transition: height .5s var(--ease); }
.trend .col.now .stick { background: var(--brand); }
.trend .lb { font-size: 11px; font-weight: 500; color: var(--ink-3); }


/* ==========================================================================
   Hero: the big pie and the month's figures
   ========================================================================== */

.card.hero { padding: 20px; margin-bottom: 16px; }

.seg {
  display: inline-flex;
  padding: 3px;
  background: rgba(16, 24, 40, .06);
  border-radius: 99px;
}
.seg button {
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 540;
  color: var(--ink-2);
  transition: background-color .16s var(--ease), color .16s var(--ease);
}
.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-1);
}

.hero-grid { display: flex; flex-direction: column; align-items: center; gap: 22px; }

.donut { position: relative; width: 170px; flex: 0 0 auto; }
.donut.big { width: 200px; }
.donut svg { display: block; width: 100%; height: auto; }
.donut circle { transition: stroke-dasharray .6s var(--ease); }
.donut-mid {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
  pointer-events: none;
}
.donut-mid b { font-size: 22px; font-weight: 640; letter-spacing: -.035em; }
.donut-mid span { font-size: 11.5px; font-weight: 450; color: var(--ink-3); }

.hero-side { width: 100%; }
.kv {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 7px 0;
}
.kv span { font-size: 13px; font-weight: 450; color: var(--ink-3); }
.kv b { font-size: 16px; font-weight: 580; letter-spacing: -.02em; }
.kv.lead { padding-top: 10px; border-top: 1px solid var(--line); margin-top: 4px; }
.kv.lead span { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.kv.lead b { font-size: 26px; font-weight: 650; letter-spacing: -.035em; }
.kv b.pos { color: var(--green); }
.kv b.neg { color: var(--red); }
.hero-side .bar { margin-top: 12px; }
.kv-foot {
  display: flex; justify-content: space-between; gap: 10px;
  margin-top: 9px; font-size: 12px; font-weight: 450; color: var(--ink-3);
}

.hero-empty {
  margin: 4px 0 2px; text-align: center;
  font-size: 13.5px; font-weight: 450; color: var(--ink-3);
}

.legend { list-style: none; margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); }
.legend li { display: block; }
.legend .lrow {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 8px 8px; margin: 0 -8px;
  border-radius: 9px;
  font-size: 13.5px;
  transition: background-color .14s var(--ease);
}
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.legend .ln {
  flex: 1; min-width: 0; font-weight: 480; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.legend .lv { font-weight: 560; letter-spacing: -.015em; }
.legend .lp { width: 42px; text-align: right; font-weight: 450; color: var(--ink-3); font-size: 12.5px; }

/* ==========================================================================
   Warnings
   ========================================================================== */

.warn-strip {
  background: rgba(253, 243, 224, .82);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(233, 164, 19, .38);
  border-radius: var(--r-lg);
  padding: 13px 14px 12px;
  margin-bottom: 16px;
}
.warn-top { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; color: #A9760A; }
.warn-top svg { width: 17px; height: 17px; }
.warn-top b { font-size: 14px; font-weight: 580; letter-spacing: -.015em; }
.chip.danger { background: rgba(255, 255, 255, .8); color: var(--ink); }

/* ==========================================================================
   Manage screens
   ========================================================================== */

.lede {
  margin: 0 2px 16px;
  font-size: 13.5px;
  font-weight: 450;
  color: var(--ink-3);
}
.foot-note {
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 450;
  margin: 22px 0 0;
}
.field-lab {
  font-size: 12.5px;
  font-weight: 520;
  color: var(--ink-3);
  margin: 0 0 8px 2px;
}

.pocket-row .move { display: flex; gap: 6px; flex: 0 0 auto; }
.pocket-row .move .round { background: rgba(16, 24, 40, .05); box-shadow: none; width: 32px; height: 32px; flex-basis: 32px; }
.pocket-row .move .round svg { width: 15px; height: 15px; }
.pocket-row .move .round[disabled] { opacity: .3; }

.size-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.size-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-align: center;
}
.size-opt b { font-size: 12.5px; font-weight: 560; }
.size-opt span { font-size: 11.5px; font-weight: 450; color: var(--ink-3); line-height: 1.25; }
.size-opt .box { background: var(--ink-3); border-radius: 4px; display: block; }
.size-opt .box.md { width: 18px; height: 18px; }
.size-opt .box.xl { width: 38px; height: 18px; }
.size-opt[aria-pressed="true"] { border-color: var(--brand); background: var(--blue-soft); }
.size-opt[aria-pressed="true"] .box { background: var(--brand); }

.icon-pick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.icon-opt {
  aspect-ratio: 1;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink-2);
}
.icon-opt svg { width: 18px; height: 18px; }
.icon-opt[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

.chip.swatch { padding: 0 8px; }
.chip.swatch .bub { width: 24px; height: 24px; margin: 0; }
.chip.swatch[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

.switch small { font-size: 12px; font-weight: 450; color: var(--ink-3); }

/* ==========================================================================
   Charts
   ========================================================================== */

.money-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  font-size: 12.5px;
  font-weight: 450;
}
.money.hero .money-foot { color: rgba(255, 255, 255, .8); }

.money .pct {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .2);
  color: #fff;
  font-size: 13px;
  font-weight: 560;
  letter-spacing: -.01em;
}

.charts { display: grid; gap: var(--gap); margin-top: 26px; min-width: 0; }
.charts > * { min-width: 0; }
.card.chart { min-width: 0; overflow: hidden; }
.days, .trend { max-width: 100%; overflow: hidden; }
.days .day, .trend .col { min-width: 0; }
.spark { max-width: 100%; }
.stat-grid > *, .tiles-2 > *, .board > *, .goals > * { min-width: 0; }

.card.chart { padding: 18px 18px 16px; margin-bottom: 0; }

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.chart-head h3 { font-size: 14.5px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.chart-head span { font-size: 12px; font-weight: 450; color: var(--ink-3); }

/* --- donut --- */

.donut { position: relative; width: 168px; flex: 0 0 auto; }
.donut svg { display: block; width: 100%; height: auto; }
.donut circle { transition: stroke-dasharray .6s var(--ease); }
.donut-mid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  pointer-events: none;
}
.donut-mid b { font-size: 18px; font-weight: 640; letter-spacing: -.03em; }
.donut-mid span { font-size: 11.5px; font-weight: 450; color: var(--ink-3); }

.legend { list-style: none; margin: 0; padding: 0; width: 100%; }
.legend li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  font-size: 13px;
}
.legend i { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.legend .ln {
  flex: 1; min-width: 0;
  font-weight: 450;
  color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.legend .lv { font-weight: 540; letter-spacing: -.015em; }
.legend .lp {
  width: 40px;
  text-align: right;
  font-weight: 450;
  color: var(--ink-3);
  font-size: 12.5px;
}

/* --- bars --- */
.trend .val { font-size: 11px; font-weight: 500; color: var(--ink-3); }
.trend .stick { max-height: calc(100% - 42px); }
.trend .col.now .val { color: var(--brand); font-weight: 560; }

/* --- running total --- */
.spark { display: block; width: 100%; height: 86px; overflow: visible; }
.spark-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 450;
  color: var(--ink-3);
}

/* ==========================================================================
   Sign in
   ========================================================================== */

.gate {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 28px) 22px calc(env(safe-area-inset-bottom) + 28px);
}

/* on a big screen the form sits in a panel, centred both ways */
@media (min-width: 760px) {
  body.at-gate { display: grid; place-items: center; min-height: 100dvh; }
  .gate {
    min-height: 0;
    max-width: 424px;
    margin: 32px auto;
    padding: 40px 36px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: 0 24px 60px rgba(16, 24, 40, .12);
  }
  .gate-form { padding-top: 48px; }
  .back-top { top: 18px; left: 18px; }
  .gate .pad { max-width: 260px; }
}
.gate h1 { font-size: 27px; font-weight: 660; letter-spacing: -.035em; margin: 0 0 4px; }
.gate p { margin: 0 0 26px; font-size: 14.5px; font-weight: 450; color: var(--ink-3); }
.gate .card { margin-bottom: 0; padding: 18px; }
.gate .card b { font-size: 15.5px; font-weight: 600; }
.gate .card p { margin: 6px 0 0; }
.gate code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--chip); padding: 2px 6px; border-radius: 6px; }

.who { display: flex; gap: 10px; margin-bottom: 26px; justify-content: center; flex-wrap: wrap; }
.who button {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  font-size: 14.5px;
  font-weight: 540;
  letter-spacing: -.015em;
  transition: background-color .16s var(--ease), color .16s var(--ease);
}
.who button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

.dots { display: flex; justify-content: center; gap: 14px; margin: 0 0 24px; }
.gate .pad { width: 100%; max-width: 300px; margin: 0 auto; }
.gate-alt {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 8px;
  font-size: 13.5px;
  font-weight: 520;
  color: var(--brand);
}
.gate code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  background: var(--chip);
  padding: 2px 5px;
  border-radius: 5px;
}
.dots i {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--line-2);
  transition: background-color .16s var(--ease), transform .16s var(--ease);
}
.dots i.on { background: var(--ink); transform: scale(1.1); }
.dots.bad i { background: var(--red); animation: shake .4s var(--ease); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* ==========================================================================
   Signing in
   ========================================================================== */

.gate-mark {
  width: 76px; height: 76px;
  display: grid; place-items: center;
  margin: 0 auto 18px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(145deg, #7C5CFF, #3D63F5 55%, #08A5A0);
  box-shadow: 0 12px 30px rgba(61, 99, 245, .32);
}
.gate-mark svg { width: 44px; height: 44px; }

.gate h1 { text-align: center; }
.gate > p { text-align: center; }

.gate-form {
  justify-content: center;
  padding-top: calc(env(safe-area-inset-top) + 72px);
}
/* once a form is taller than the screen it scrolls from the top instead */
@media (max-height: 720px) {
  .gate-form { justify-content: flex-start; }
}
.gate-form h1 { text-align: left; font-size: 25px; }
.gate-form > p { text-align: left; margin-bottom: 20px; }
.gate-form .gate-mark { margin-left: 0; }

.back-top {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 14px);
  left: 16px;
}

.gate-bad {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13.5px;
  font-weight: 500;
}
.gate-bad svg { width: 16px; height: 16px; }

@media (min-width: 720px) {
  .gate { max-width: 440px; }
  .gate-form { padding-top: 72px; }
}

.code-in {
  text-align: center;
  font-size: 30px !important;
  font-weight: 640;
  letter-spacing: .26em;
  padding-left: 14px !important;
}

/* ==========================================================================
   Toast, offline, loading
   ========================================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 112px);
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  background: rgba(16, 24, 40, .94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.015em;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .24);
  animation: pop-in .28s var(--ease);
}
.toast svg { width: 17px; height: 17px; flex: 0 0 17px; }
.toast .undo { color: #7FB0FF; font-weight: 560; white-space: nowrap; }
.toast.bad { background: rgba(232, 70, 92, .96); }
@keyframes pop-in { from { transform: translateX(-50%) translateY(12px); opacity: 0; } }

.offline {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  max-width: 430px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) 14px 8px;
  background: var(--amber-soft);
  color: #8A6008;
  text-align: center;
  font-size: 12.5px;
  font-weight: 500;
}

.skeleton {
  background: linear-gradient(90deg, #ECEEF2 25%, #F5F6F8 50%, #ECEEF2 75%);
  background-size: 220% 100%;
  animation: sweep 1.3s linear infinite;
  border-radius: var(--r-xl);
}
@keyframes sweep { to { background-position: -220% 0; } }

.stagger > * { animation: lift .38s var(--ease) backwards; }
@keyframes lift { from { opacity: 0; transform: translateY(6px); } }

/* ==========================================================================
   Wider screens
   Same single column of content, just more of the board side by side.
   No fixed rail, nothing overlapping.
   ========================================================================== */

@media (hover: hover) and (pointer: fine) {
  .type-hint { display: flex; }
}

@media (min-width: 720px) and (max-width: 999px) {
  .app { max-width: 720px; padding: 0 28px calc(var(--nav-h) + 64px); }

  .board { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .tile { padding: 20px; }
  .tile .amt { font-size: 30px; }

  .top { padding: 34px 0 22px; }
  .month-name { font-size: 26px; }
  .head { margin: 30px 2px 13px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }

  .nav { max-width: 470px; }

  .card { padding: 6px 12px; }
  .row { padding: 14px 8px; border-radius: 10px; }
  .brow { padding: 14px 8px; }
  .chips.scroll { flex-wrap: wrap; overflow: visible; margin-right: 0; padding-right: 0; }

  /* hero: pie, figures, legend in one row */
  .card.hero { padding: 26px; }
  .hero-grid { flex-direction: row; align-items: center; gap: 32px; }
  .donut.big { width: 210px; }
  .hero-side { flex: 0 0 220px; }
  .legend {
    flex: 1; min-width: 0;
    margin: 0; padding: 0 0 0 28px;
    border-top: 0; border-left: 1px solid var(--line);
  }

  .charts { grid-template-columns: 1fr 1fr; gap: 16px; }
  .goals { grid-template-columns: 1fr 1fr; }

  /* the wider screen gets more room, not bigger text */
  .brand { padding: 34px 0 16px; }
  .brand-nm { font-size: 24px; }
  .month-row { max-width: 320px; margin: 0 auto 20px; }
  .sp-mark { width: 124px; height: 124px; border-radius: 38px; }
  .sp-mark svg { width: 76px; height: 76px; }
  .sp-nm { font-size: 40px; }
  .sp-sub { font-size: 15px; }
  .prof-face { width: 92px; height: 92px; font-size: 34px; }
  .prof-nm { font-size: 26px; }
  .merge { padding: 20px 22px; }
  .mg-row b { font-size: 18px; }
  .mg-tot b { font-size: 24px; }
  .cd-top { gap: 14px; }
  .goal { padding: 20px; }
  .fab { bottom: calc(env(safe-area-inset-bottom) + var(--nav-h) + 26px); }
  .fab-ring { width: 66px; height: 66px; }
  .fab-ring svg { width: 28px; height: 28px; }
  .tiles-2 { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .ht-v { font-size: 44px; }
  .bt-v { font-size: 28px; }
  .card.chart { padding: 22px; }
  .spark { height: 110px; }
  .trend { height: 170px; }

  /* sheets become centred dialogs */
  .scrim { align-items: center; padding: 32px; }
  .sheet {
    max-width: 480px;
    max-height: 84vh;
    border-radius: 20px;
    padding: 12px 22px 22px;
    box-shadow: 0 32px 64px rgba(16, 24, 40, .22);
    animation: zoom .24s var(--ease);
  }
  .sheet .grab { display: none; }
  .sheet-top { padding-top: 8px; }
  @keyframes zoom { from { transform: translateY(10px) scale(.975); opacity: 0; } }
}

@media (min-width: 1000px) {
  .app { max-width: 1120px; }
  .board { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .tile .ic { width: 54px; height: 54px; }
  .tile .amt { font-size: 31px; }
  .month-name { font-size: 29px; }
  .donut.big { width: 232px; }
}

@media (min-width: 1400px) {
  .board { grid-template-columns: repeat(5, 1fr); }
}

/* a mouse gets hover feedback; a finger never sees it */
@media (hover: hover) and (pointer: fine) {
  .tile { transition: transform .16s var(--ease), box-shadow .16s var(--ease), opacity .14s var(--ease); }
  .tile:hover      { transform: translateY(-2px); }
  .money:hover,
  .person:hover    { box-shadow: 0 10px 26px rgba(16, 24, 40, .10); }
  button.row:hover { background: rgba(255, 255, 255, .6); }
  .legend .lrow:hover { background: rgba(16, 24, 40, .045); }
  .nav button:hover { color: var(--ink); }
  .nav button[aria-current="page"]:hover { color: var(--brand); }
  .chip:hover      { background: var(--track); }
  .chip[aria-pressed="true"]:hover { background: var(--ink); }
  .round:hover     { background: var(--chip); }
  .btn:hover       { opacity: .9; }
  .head .more:hover { text-decoration: underline; }
  .press:active    { transform: scale(.985); }
}

@media print {
  .nav, .fab, .top .round, .scrim, .toast { display: none !important; }
  body { background: #fff; }
  .card, .stat, .person, .money { box-shadow: none; border: 1px solid var(--line); }
}
