/* Glitter Dolphiggy Biggy Bank
   Eaten's system (Inter, 500-weight headings, outlined buttons, hairline rules
   that fade at both ends, small uppercase kickers) turned to a light theme,
   with an iridescent glitter wash across the header that fades downward. */

:root {
  --bg: #fbfaff;
  --surface: #ffffff;
  --surface-2: #f6f4fd;
  --ink: #1b1d2b;
  --ink-2: #555a6b;
  --ink-3: #676b7e;
  --line: rgba(27, 29, 43, 0.11);
  --line-strong: rgba(27, 29, 43, 0.22);
  --accent: #6254be;
  --accent-ink: #4f42a6;
  --accent-soft: #efecfc;
  --accent-2: #9184d9;
  --pos: #1c7556;
  --pos-soft: #e5f4ee;
  --neg: #ad4b22;
  --neg-soft: #fbece4;
  --pink: #efb3d3;
  --aqua: #a3e0e0;
  --peach: #f7d2b0;
  --lav: #cdc5fa;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(40, 30, 90, 0.05), 0 0 0 1px var(--line);
  --shadow-md: 0 8px 28px rgba(60, 40, 120, 0.10), 0 0 0 1px var(--line);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
p { margin: 0; }
.num, .money { font-variant-numeric: tabular-nums; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(98, 84, 190, 0.2); }

/* ---------- glitter ---------- */
.glitter {
  position: absolute; left: 0; right: 0; top: 0; height: 340px; z-index: 0;
  pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 100%);
}
.glitter .wash {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 90% at 12% 0%, rgba(239, 179, 211, 0.75), transparent 70%),
    radial-gradient(50% 80% at 88% 10%, rgba(163, 224, 224, 0.7), transparent 70%),
    radial-gradient(45% 70% at 55% -10%, rgba(205, 197, 250, 0.85), transparent 70%),
    linear-gradient(110deg, #fde7f3 0%, #ece7ff 28%, #e2f7f6 52%, #fff0e3 74%, #f1e7ff 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 220% 100%;
  animation: gd-shift 22s ease-in-out infinite alternate;
}
.glitter .dust, .glitter .dust2 {
  position: absolute; inset: 0;
}
.glitter .dust {
  background:
    radial-gradient(circle, rgba(255,255,255,0.95) 0 0.8px, transparent 1.4px) 0 0 / 23px 29px,
    radial-gradient(circle, rgba(255,255,255,0.9) 0 1px, transparent 1.6px) 11px 7px / 41px 37px,
    radial-gradient(circle, rgba(186,170,255,0.9) 0 1px, transparent 1.7px) 5px 19px / 53px 47px,
    radial-gradient(circle, rgba(255,160,205,0.85) 0 1px, transparent 1.7px) 31px 3px / 67px 59px;
  animation: gd-twinkle 3.2s ease-in-out infinite;
}
.glitter .dust2 {
  background:
    radial-gradient(circle, rgba(255,255,255,1) 0 1.1px, transparent 1.8px) 17px 13px / 31px 43px,
    radial-gradient(circle, rgba(140,215,215,0.95) 0 1px, transparent 1.7px) 3px 27px / 59px 53px,
    radial-gradient(circle, rgba(255,210,160,0.95) 0 1px, transparent 1.7px) 43px 11px / 71px 61px;
  animation: gd-twinkle 4.1s ease-in-out infinite reverse;
}
.glitter svg.sparkles { position: absolute; inset: 0; width: 100%; height: 100%; }
.glitter svg.sparkles path { fill: #fff; transform-box: fill-box; transform-origin: center; animation: gd-star 2.8s ease-in-out infinite; }
@keyframes gd-shift { from { background-position: 0 0, 0 0, 0 0, 0% 0; } to { background-position: 0 0, 0 0, 0 0, 100% 0; } }
@keyframes gd-twinkle { 0%, 100% { opacity: 0.95; } 50% { opacity: 0.35; } }
@keyframes gd-star { 0%, 100% { opacity: 0.15; transform: scale(0.55) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(20deg); } }
@media (prefers-reduced-motion: reduce) {
  .glitter .wash, .glitter .dust, .glitter .dust2, .glitter svg.sparkles path { animation: none; }
}

/* ---------- shell ---------- */
.app { position: relative; min-height: 100vh; min-height: 100dvh; }
.shell { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 0 32px 56px; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 18px 0 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; }
.brand svg { flex: none; filter: drop-shadow(0 2px 6px rgba(120, 90, 200, 0.18)); }
.brand-name { font-weight: 600; font-size: 24px; letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap; }
.brand-name span { display: block; font-weight: 500; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.sync { font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--pos); display: inline-block; }
.sync.saving i { background: var(--accent-2); }
.sync.error i { background: var(--neg); }

.hero { padding: 18px 0 20px; }
.hero .kicker { margin-bottom: 6px; }
.hero-balance { font-size: 52px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.hero-sub { margin-top: 8px; color: var(--ink-2); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; }

.tabs-top { display: flex; gap: 4px; background: rgba(255,255,255,0.7); padding: 4px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.tabs-top button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.tabs-top button:hover { color: var(--ink); }
.tabs-top button[aria-current="page"] { background: var(--ink); color: #fff; }

/* ---------- type helpers ---------- */
.kicker { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- rules ---------- */
.hr { height: 1px; border: 0; margin: 14px 0;
  background: linear-gradient(to right, transparent, var(--line) 40px, var(--line) calc(100% - 40px), transparent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 7px 14px; border-radius: var(--radius-md);
  border: 1px solid transparent; background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 500; line-height: 1.2; white-space: nowrap; text-decoration: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { flex: none; }
.btn-primary { color: var(--accent); border-color: var(--accent); background: rgba(255,255,255,0.7); }
.btn-primary:hover { background: var(--accent-soft); }
.btn-solid { color: #fff; background: var(--ink); border-color: var(--ink); }
.btn-solid:hover { background: #2d3044; }
.btn-secondary { border-color: var(--line-strong); background: rgba(255,255,255,0.7); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { color: var(--accent); padding-inline: 8px; }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { color: var(--neg); border-color: rgba(173, 75, 34, 0.45); }
.btn-danger:hover { background: var(--neg-soft); }
.btn-icon { width: 38px; padding: 0; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- forms ---------- */
.field > label, .label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 5px; color: var(--ink-2); }
.input {
  width: 100%; min-height: 42px; padding: 8px 11px; font-size: 16px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  caret-color: var(--accent); -webkit-appearance: none; appearance: none;
}
.input:hover { border-color: rgba(27,29,43,0.38); }
.input:focus-visible { border-color: var(--accent); outline: 2px solid rgba(98,84,190,0.25); outline-offset: 0; }
select.input { padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23555a6b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
textarea.input { min-height: 70px; resize: vertical; }
.money-wrap { position: relative; }
.money-wrap .cur { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.money-wrap .input { padding-left: 24px; }
.pct-wrap { position: relative; }
.pct-wrap .input { padding-right: 28px; }
.pct-wrap .cur { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.seg { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: rgba(255,255,255,0.75); }
.seg button { border: 0; border-radius: 7px; background: none; padding: 6px 12px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink-2); min-height: 30px; }
.seg button:hover:not([aria-pressed="true"]) { background: var(--surface-2); color: var(--ink); }
.seg button[aria-pressed="true"] { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: #d9d8e3; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 16px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.card-title { font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
.section-title { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin: 16px 0 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag.biz { background: #fdf0e3; color: #8a4a1c; }
.tag.sav { background: var(--accent-soft); color: var(--accent-ink); }
.tag.inc { background: var(--pos-soft); color: var(--pos); }

/* ---------- home toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 4px 0 12px; }
.toolbar .spacer { flex: 1; }

/* ---------- month card ---------- */
.month { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 14px; overflow: hidden; }
.month.current { box-shadow: 0 0 0 1.5px var(--accent-2), 0 10px 30px rgba(98, 84, 190, 0.12); }
.month-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: none; border: 0; cursor: pointer; text-align: left; }
.month-head h3 { font-size: 19px; }
.month-head .chev { transition: transform .2s; color: var(--ink-3); flex: none; }
.month-head[aria-expanded="true"] .chev { transform: rotate(90deg); }
.month-body { padding: 0 16px 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius-md); overflow: hidden; margin-bottom: 12px; }
.stat { background: var(--surface-2); padding: 10px 12px; min-width: 0; }
.stat .label { margin: 0 0 2px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.stat .v { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.stat .s { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.savings-line { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.savings-line b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

.goals { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.goals::-webkit-scrollbar { display: none; }
.goal-chip { flex: none; min-width: 150px; max-width: 220px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 8px 10px; background: var(--surface); }
.goal-chip .n { font-size: 13px; font-weight: 500; }
.goal-chip .a { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.bar { height: 6px; border-radius: 999px; background: #ecebf3; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), #c79ae0); }
.bar.over > i { background: var(--neg); }
.bar.inc > i { background: linear-gradient(90deg, #62b596, var(--pos)); }

.lines .line { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 0; cursor: pointer; border-bottom: 1px solid var(--line); }
.lines .line:last-child { border-bottom: 0; }
.line-top { display: flex; align-items: baseline; gap: 10px; }
.line-name { font-weight: 500; font-size: 14px; }
.line-amt { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; }
.line-sub { font-size: 12px; color: var(--ink-2); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.line-detail { margin: 6px 0 2px 12px; padding-left: 10px; border-left: 2px solid var(--line); }
.entry { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 6px 0; text-align: left; cursor: pointer; font-size: 13px; }
.entry:hover .entry-name { color: var(--accent); }
.entry-amt { margin-left: auto; font-variant-numeric: tabular-nums; }

.dated { list-style: none; margin: 0; padding: 0; }
.dated li button { width: 100%; display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.dated li:last-child button { border-bottom: 0; }
.dated li button:hover .d-name { color: var(--accent); }
.d-day { text-align: center; line-height: 1.05; }
.d-day b { display: block; font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.d-day span { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.d-name { font-size: 14px; font-weight: 500; }
.d-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.d-amt { font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; }
.skipped .d-name { text-decoration: line-through; color: var(--ink-3); }
.month-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.empty { padding: 10px 0; color: var(--ink-3); font-size: 13px; }

/* ---------- calendar ---------- */
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-nav h3 { font-size: 20px; margin-right: auto; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius-md); overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.cal .dow { background: var(--surface-2); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); padding: 6px; text-align: center; }
.cal .day { background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 3px; border: 0; text-align: left; cursor: pointer; font: inherit; min-width: 0; }
.cal .day:hover { background: #fcfbff; }
.cal .day.out { background: #faf9fc; }
.cal .day.out .dn { color: var(--ink-3); }
.cal .day.today .dn { background: var(--ink); color: #fff; border-radius: 999px; }
.cal .dn { font-size: 12px; font-weight: 500; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.cal .pill { font-size: 11px; line-height: 1.25; padding: 2px 5px; border-radius: 5px; background: var(--surface-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .pill.inc { background: var(--pos-soft); color: var(--pos); }
.cal .pill.sav { background: var(--accent-soft); color: var(--accent-ink); }
.cal .more { font-size: 11px; color: var(--ink-2); }

/* ---------- sheet / dialog ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(27, 29, 43, 0.28); display: flex; align-items: center; justify-content: center; padding: 24px; animation: gd-fade .15s ease-out; }
.sheet { width: 100%; max-width: 580px; max-height: calc(100vh - 48px); overflow: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-md);
  padding: 0 22px 18px; animation: gd-up .2s ease-out; overscroll-behavior: contain; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 16px 0 10px; background: var(--surface); }
.sheet-head h2 { font-size: 19px; margin-right: auto; }
.sheet-foot { position: sticky; bottom: -18px; display: flex; gap: 8px; padding: 12px 0 4px; background: var(--surface); margin-top: 16px; border-top: 1px solid var(--line); }
@keyframes gd-fade { from { opacity: 0; } }
@keyframes gd-up { from { transform: translateY(24px); opacity: 0.4; } }

/* ---------- overview ---------- */
.ov-grid { display: grid; gap: 14px; }
.ov-grid .card + .card { margin-top: 0; }
@media (min-width: 900px) { .ov-grid.two { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.csp-sec { margin-top: 14px; }
.csp-sec:first-child { margin-top: 0; }
.csp-head { display: flex; align-items: baseline; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-strong); }
.csp-head .t { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.csp-head .goal { font-size: 12px; color: var(--ink-2); }
.csp-head .pct { margin-left: auto; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.csp-head .pct.ok { background: var(--pos-soft); color: var(--pos); }
.csp-head .pct.warn { background: var(--neg-soft); color: var(--neg); }
.csp-row { display: flex; gap: 10px; padding: 6px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
.csp-row:last-child { border-bottom: 0; }
.csp-row .v { margin-left: auto; font-variant-numeric: tabular-nums; }
.csp-row.total { font-weight: 600; border-bottom: 0; }
.nw-row { display: grid; grid-template-columns: 1fr 150px; gap: 10px; align-items: center; padding: 5px 0; }
.nw-row .hint { font-size: 12px; color: var(--ink-2); }
.bigstats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bigstat { background: var(--surface-2); border-radius: var(--radius-md); padding: 10px 12px; }
.bigstat .v { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.bigstat .label { margin: 0; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.chart { width: 100%; height: auto; display: block; margin-top: 12px; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--ink-2); }
.offer { display: grid; grid-template-columns: 1fr 110px 36px; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.offer:last-of-type { border-bottom: 0; }
.offer .slider { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.offer input[type="range"] { flex: 1; accent-color: var(--accent); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-md); overflow: hidden; }
.stepper button { width: 34px; height: 34px; border: 0; background: var(--surface-2); cursor: pointer; font-size: 16px; }
.stepper input { width: 52px; height: 34px; border: 0; text-align: center; font-variant-numeric: tabular-nums; font-size: 15px; }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.compare th { font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); text-align: right; padding: 6px 0 6px 8px; }
.compare th:first-child { text-align: left; padding-left: 0; }
.compare td { padding: 7px 0 7px 8px; text-align: right; font-variant-numeric: tabular-nums; border-top: 1px solid var(--line); }
.compare td:first-child { text-align: left; padding-left: 0; color: var(--ink-2); }
.callout { border-radius: var(--radius-md); padding: 12px 14px; background: linear-gradient(110deg, #fdf0f7, #f0edff 45%, #e9f8f7); font-size: 14px; }
.callout b { font-weight: 600; }

/* ---------- setup ---------- */
.set-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; }
.set-row .input { min-height: 38px; font-size: 15px; }
.set-row .name { flex: 1 1 160px; min-width: 120px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.chip button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: none; cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; }
.chip button:hover { background: #e7e4f3; color: var(--ink); }
.subnav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 12px; scrollbar-width: none; }
.subnav button { border: 1px solid var(--line-strong); background: rgba(255,255,255,0.8); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.subnav button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- auth ---------- */
.auth { position: relative; z-index: 1; max-width: 400px; margin: 0 auto; padding: calc(56px + env(safe-area-inset-top)) 20px 40px; }
.auth h1 { font-size: 30px; letter-spacing: -0.025em; margin: 18px 0 6px; }
.auth .card { padding: 20px; margin-top: 22px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 28px; z-index: 60; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow-md); max-width: calc(100% - 32px); }
.banner { background: var(--neg-soft); color: var(--neg); border-radius: var(--radius-md); padding: 10px 14px; font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.loading { position: relative; z-index: 1; padding: 120px 20px; text-align: center; color: var(--ink-2); }

.cal .pill { display: flex; gap: 4px; }
.cal .pill .pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cal .pill .pa { flex: none; font-variant-numeric: tabular-nums; }
.chip .chip-name { width: auto; height: auto; border-radius: 4px; background: none; color: inherit; font: inherit; padding: 0; }
.chip .chip-name:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
.proto { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; padding: 8px 12px; border-radius: var(--radius-md); background: rgba(255,255,255,0.75); box-shadow: var(--shadow-sm); font-size: 13px; color: var(--ink-2); }

/* ---------- desktop layouts ---------- */
.month-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 36px; align-items: start; }
.month-cols .section-title { margin-top: 12px; }
.planner-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 36px; align-items: start; }
@media (max-width: 900px) {
  .month-cols, .planner-cols { grid-template-columns: minmax(0, 1fr); }
}

/* Setup: narrow cards so labels and controls stay close together */
.setup-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 400px)); gap: 14px; align-items: start; }
.setup-cols .card + .card { margin-top: 0; }
.setup-narrow { max-width: 600px; }
@media (max-width: 900px) { .setup-cols { grid-template-columns: minmax(0, 400px); } }
.set-row.nowrap { flex-wrap: nowrap; }
.set-row.nowrap .name { flex: 1 1 auto; min-width: 0; }

.hero.hero-card { padding: 16px 18px; }
.hero.hero-card .hero-balance { font-size: 40px; }
.app .shell main { padding-top: 6px; }

/* Overview spreadsheet */
.ov-sheet { max-width: 460px; }
.ov-sec + .ov-sec { margin-top: 18px; }
.ov-head { display: flex; align-items: baseline; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line-strong); }
.ov-head .t { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.ov-head .goal { font-size: 12px; color: var(--ink-2); }
.ov-head .pct { margin-left: auto; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ov-head .pct.below { background: #e8f0fb; color: #2f5d9b; }
.ov-head .pct.ok { background: var(--pos-soft); color: var(--pos); }
.ov-head .pct.over { background: var(--neg-soft); color: var(--neg); }
.ov-row { display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 3px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.ov-row .ov-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ov-row .ov-hint { font-size: 12px; color: var(--ink-3); }
.ov-row .ov-input { width: 108px; flex: none; }
.ov-row .ov-input .input { min-height: 30px; padding: 3px 8px; font-size: 14px; text-align: left; border-radius: 7px; }
.ov-row .ov-val { width: 108px; flex: none; text-align: left; padding-left: 9px; font-variant-numeric: tabular-nums; }
.ov-row.auto { color: var(--ink-2); }
.ov-row.short .ov-val { color: var(--neg); }
.ov-row.total { border-bottom: 0; font-weight: 600; }
.ov-pct { width: 44px; min-height: 26px; padding: 2px 6px; border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; font-size: 13px; text-align: right; }
.ov-legend { display: flex; gap: 16px; margin-top: 16px; }
.ov-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ov-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ov-legend i.below { background: #2f5d9b; }
.ov-legend i.ok { background: var(--pos); }
.ov-legend i.over { background: var(--neg); }

/* Fixed-size dialogs don't shift when their content changes */
.sheet.fixed { height: min(820px, calc(100vh - 48px)); display: flex; flex-direction: column; }
.sheet.fixed > .stack { flex: 1 0 auto; }
.sheet.fixed .sheet-foot { margin-top: auto; }

.toolbar .year-select { width: 104px; min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; font-weight: 500; }

/* Header (and each page's own toolbar) stay put; only the content below scrolls */
.app.fixed-mode { height: 100vh; overflow: hidden; }
.app.fixed-mode .shell { height: 100vh; display: flex; flex-direction: column; padding-bottom: 0; }
.app.fixed-mode main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.page-view { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.app.fixed-mode .page-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 2px 40px; margin: 0 -2px; overscroll-behavior: contain; }

.archived { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.archived-row { color: var(--ink-2); font-size: 14px; }

.input.ov-dollar { min-height: 30px; padding: 3px 8px; font-size: 14px; text-align: left; border-radius: 7px; }
.pct-wrap.small .input { min-height: 30px; padding: 3px 24px 3px 8px; font-size: 14px; border-radius: 7px; }
.pct-wrap.small .cur { right: 8px; font-size: 14px; }

/* Hover tooltips on row names */
.has-tip { position: relative; cursor: help; text-decoration: underline dotted rgba(27,29,43,0.35); text-underline-offset: 3px; }
.has-tip::after { content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 5; white-space: nowrap;
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 400; padding: 5px 9px; border-radius: 6px; box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(2px); pointer-events: none; transition: opacity .12s, transform .12s; }
.has-tip:hover::after, .has-tip:focus-visible::after { opacity: 1; transform: none; }

.ov-expand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: inherit; cursor: pointer; text-align: left; }
.ov-expand .chev { display: inline-flex; color: var(--ink-3); transition: transform .15s; }
.ov-expand[aria-expanded="true"] .chev { transform: rotate(90deg); }
.ov-expand:hover { color: var(--accent); }
.ov-row.ov-sub { padding-left: 18px; font-size: 13px; color: var(--ink-2); }

/* Quiet scrollbars */
.page-scroll, .sheet { scrollbar-width: thin; scrollbar-color: rgba(98, 84, 190, 0.18) transparent; }
.page-scroll::-webkit-scrollbar, .sheet::-webkit-scrollbar { width: 8px; }
.page-scroll::-webkit-scrollbar-track, .sheet::-webkit-scrollbar-track { background: transparent; }
.page-scroll::-webkit-scrollbar-thumb, .sheet::-webkit-scrollbar-thumb { background: rgba(98, 84, 190, 0.16); border-radius: 999px; }
.page-scroll::-webkit-scrollbar-thumb:hover, .sheet::-webkit-scrollbar-thumb:hover { background: rgba(98, 84, 190, 0.32); }

.ov-pill { display: inline-block; margin-left: -9px; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ov-pill.ok { background: var(--pos-soft); color: var(--pos); }
.ov-pill.over { background: var(--neg-soft); color: var(--neg); }

/* Overview: each section is its own capsule, five across; Guilt-Free wraps below */
.ov-sheet { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; max-width: none; }
.ov-sheet .ov-sec { margin: 0; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 12px 12px 8px; min-width: 0; }
.ov-sheet .ov-sec + .ov-sec { margin-top: 0; }
.ov-sheet .ov-head { flex-wrap: wrap; row-gap: 2px; }
.ov-sheet .ov-head .goal { order: 3; width: 100%; font-size: 11px; }
.ov-sheet .ov-row { gap: 8px; min-height: 34px; font-size: 13px; }
.ov-sheet .ov-row .ov-input, .ov-sheet .ov-row .ov-val { width: 84px; }
.ov-sheet .ov-row .ov-input .input { font-size: 13px; padding: 3px 7px; }
.ov-sheet .ov-row .ov-val { padding-left: 8px; }
.ov-sheet .ov-pill { margin-left: -8px; }
.ov-sheet .ov-row.ov-sub { padding-left: 12px; font-size: 12px; }
.ov-sheet .ov-expand { font-size: 13px; }
.ov-sheet .ov-row .ov-label { line-height: 1.25; }
@media (max-width: 1100px) { .ov-sheet { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ov-sheet .ov-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.setup-cols.three { grid-template-columns: minmax(0, 300px) minmax(0, 400px) minmax(0, 400px); }
@media (max-width: 1150px) { .setup-cols.three { grid-template-columns: minmax(0, 300px) minmax(0, 400px); } }
.sys-mark { color: var(--ink-3); cursor: help; }

.ov-sheet .ov-sec-fun { grid-column: 1; }
.ov-sheet .ov-row.auto .ov-label { flex-wrap: nowrap; white-space: nowrap; }
.ov-sheet .ov-pct { width: 36px; }
@media (max-width: 1100px) { .ov-sheet .ov-sec-fun { grid-column: auto; } }

/* Dialogs pinned near the top so switching options never moves their top edge */
.overlay.top { align-items: flex-start; padding-top: 12vh; }

.goal-top { align-items: baseline; gap: 12px; }
.goal-top .goal-name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.goal-top .goal-detail { font-size: 14px; color: var(--ink-2); }

.types-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 480px)); gap: 14px; align-items: start; }
.types-cols .card + .card { margin-top: 0; }
@media (max-width: 1000px) { .types-cols { grid-template-columns: minmax(0, 600px); } }

.input.input-sm, .sm-money .input { min-height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: 15px; }

/* Home month cards: narrower column. Add popup: sized to fields. */
.month { max-width: 920px; }
.item-form .input:not(textarea) { min-height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: 15px; }
.item-form select.input, .item-form input[type=date].input { width: 190px; }
.item-form .input.num { max-width: 90px; }
.item-form .money-wrap .input.num { max-width: none; }
.sheet:has(.item-form) { max-width: 568px; }
.compact-card { padding: 12px 16px; }
.compact-card .archived { margin-top: 8px; }
.settings-card .field > label { font-size: 14px; margin-bottom: 6px; }
.settings-card { max-width: 420px; }
.settings-card > .stack { gap: 10px; }
.settings-card .hr { margin: 2px 0; }
.add-row { margin: 0 0 8px; }
select.input.is-empty { color: #9a9cb0; }
select.input.is-empty option { color: var(--ink); }

/* Date picker */
.dp-btn { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; color: var(--ink); }
.dp-btn svg { color: var(--ink-3); flex: none; }
.dp-btn.is-empty { color: #9a9cb0; }
.dp-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(98, 84, 190, 0.14); }
.dp-pop { position: fixed; z-index: 1000; width: 268px; background: var(--surface); border: 1px solid var(--line, rgba(27, 29, 43, 0.1)); border-radius: 14px; box-shadow: 0 12px 32px rgba(27, 29, 43, 0.16); padding: 12px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-weight: 500; font-size: 14px; letter-spacing: -0.01em; }
.dp-nav { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.dp-nav:hover { background: rgba(98, 84, 190, 0.08); color: var(--accent); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow span { font-size: 11px; color: var(--ink-3); text-align: center; padding: 4px 0; text-transform: uppercase; letter-spacing: 0.04em; }
.dp-day { height: 34px; border: 0; background: transparent; border-radius: 8px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.dp-day:hover:not(:disabled) { background: rgba(98, 84, 190, 0.08); }
.dp-day.today { box-shadow: inset 0 0 0 1px rgba(98, 84, 190, 0.45); }
.dp-day.sel { background: var(--accent); color: #fff; font-weight: 500; }
.dp-day:disabled { color: rgba(27, 29, 43, 0.25); cursor: default; }
.dp-foot { display: flex; justify-content: flex-end; margin-top: 6px; border-top: 1px solid rgba(27, 29, 43, 0.08); padding-top: 6px; }
.item-form .dp-btn { width: 190px; }
.seg.full button { flex: 1 1 0; }
.half-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.item-form .half-grid select.input { width: 100%; }
.item-form .input.ov-dollar { max-width: none; width: 100%; text-align: left; }
.item-form select.input:disabled { color: #b4b6c4; background-color: var(--surface-2); cursor: not-allowed; opacity: 0.8; }
.item-form .half-grid.narrow select.input, .item-form .half-grid.narrow .dp-btn { width: 190px; }
.item-form .half-grid.narrow .field:nth-child(2) select.input { width: 130px; }
.ends-row { display: flex; gap: 12px; align-items: center; }
.ends-row .seg button { min-width: 110px; }
.dp-day.suggest { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.item-form .half-grid.narrow .input.num { max-width: 90px; }
.quarter-grid, .ends-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.ends-row > :nth-child(2) { grid-column: 2 / span 2; }
.ends-row .seg { display: flex; }
.ends-row .seg button { flex: 1; min-width: 0; }
.quarter-grid .input.num { max-width: 90px; }
.dated.month-items li button { grid-template-columns: 1fr auto; }

/* Home: month cards carousel */
.home-bar { display: grid; grid-template-columns: 1fr auto 1fr; }
.year-nav { display: flex; align-items: center; gap: 4px; }
.year-label { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.year-nav .btn-icon:disabled { opacity: 0.3; }
.carousel { overflow: hidden; padding: 4px 0 24px; touch-action: pan-y; user-select: none; }
.carousel .track { display: flex; align-items: flex-start; transition: transform .35s cubic-bezier(.2, .7, .2, 1); will-change: transform; }
.carousel .track.dragging { transition: none; }
.carousel .slot { flex: none; }
.mc { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: filter .3s, opacity .3s, transform .3s; }
.mc.current { box-shadow: var(--shadow-sm), inset 0 0 0 1.5px rgba(98, 84, 190, 0.35); }
.mc.side { filter: brightness(0.94) saturate(0.85); opacity: 0.7; transform: scale(0.96); cursor: pointer; }
.mc.side:hover { opacity: 0.85; }
.mc-head { padding: 16px 16px 10px; }
.mc-head h3 { font-size: 20px; }
.mc .stats { grid-template-columns: 1fr 1fr; }
.mc .section-title { margin-top: 14px; }
.mc .month-actions { margin-top: 16px; }
.mc .d-meta { flex-wrap: wrap; }
.carousel { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 90px, #000 calc(100% - 90px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 90px, #000 calc(100% - 90px), transparent 100%); }
.overlay.top { padding-top: 6vh; padding-bottom: 24px; }
.overlay.top .sheet { max-height: calc(100vh - 6vh - 24px); }
.year-seg button { display: grid; place-items: center; min-width: 34px; padding: 6px 8px; }
.year-seg button:disabled { opacity: 0.3; cursor: default; background: none; }
.year-seg .year-label { min-width: 64px; font-size: 13px; font-weight: 500; cursor: default; }
.year-nav { gap: 8px; }
.year-btn { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 999px; display: grid; place-items: center; }
.year-pill { display: inline-flex; align-items: center; justify-content: center; height: 38px; min-width: 76px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(255,255,255,0.75); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.mc-sec { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.mc .mc-sec + .section-title { margin-top: 8px; }
.mc .section-title { margin-bottom: 0; }
.mc .section-title + .dated > li:first-child > button { padding-top: 4px; }
.app.fixed-mode .page-scroll.home-scroll { display: flex; flex-direction: column; padding-bottom: 16px; }
.home-scroll > .carousel { flex: 1 0 auto; display: flex; padding-bottom: 8px; }
.home-scroll .carousel .track { align-items: stretch; }
.home-scroll .carousel .slot { display: flex; flex-direction: column; }
.home-scroll .carousel .mc { flex: 1; }
.item-form .seg.full button { padding-left: 6px; padding-right: 6px; }
.mc .dated:not(.month-items) li button { grid-template-columns: 36px 1fr auto; }
.mc .d-day { display: inline-grid; justify-items: center; justify-self: start; }
/* Cards fill the screen; long lists scroll inside the card. */
.app.fixed-mode .page-scroll.home-scroll { overflow: hidden; padding-bottom: 0; }
.home-scroll > .carousel { flex: 1 1 0; min-height: 0; padding-bottom: 16px; }
.home-scroll .carousel .track { height: 100%; }
.home-scroll .carousel .slot { height: 100%; }
.home-scroll .carousel .mc { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.mc .mc-top { padding-bottom: 0; flex: none; }
.mc .mc-list { flex: 1; min-height: 0; overflow-y: auto; padding-top: 0; scrollbar-width: thin; scrollbar-color: rgba(98, 84, 190, 0.18) transparent; }
.mc .mc-list > .mc-sec:first-child { margin-top: 12px; }
.mc .mc-top { padding-bottom: 10px; }
.mc .mc-list { border-top: 1px solid var(--line); margin: 0 16px; padding: 0 0 16px; }
.mc .mc-list > .mc-sec:first-child { border-top: 0; padding-top: 0; margin-top: 14px; }
.mc .mc-list { scrollbar-width: none; }
.mc .mc-list::-webkit-scrollbar { display: none; width: 0; height: 0; }
.year-nav .year-pill { height: auto; min-width: 72px; padding: 0 14px; border-radius: var(--radius-md, 10px); cursor: default; pointer-events: none; font-size: 14px; }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mc .stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mc .stats.three .stat { padding: 9px 10px; }
.mc .stats.three .v { font-size: 16px; }
.sav-dash { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 8px 10px 9px; margin-bottom: 4px; }
.sav-title { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
.sav-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sav-tiles > div { display: flex; flex-direction: column; min-width: 0; }
.sav-tiles span { font-size: 11px; color: var(--ink-2); }
.sav-tiles b { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sav-tiles i { font-style: normal; font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-dash .dash { display: grid; grid-template-columns: 3fr 4fr; gap: 12px; align-items: stretch; margin-bottom: 12px; }
.cal-dash .stats { margin-bottom: 0; }
.cal-dash .sav-dash { margin-bottom: 0; display: flex; flex-direction: column; justify-content: center; }
.cal-dash .sav-tiles b { font-size: 16px; }
.switch.mini .track { width: 30px; height: 18px; }
.switch.mini .track::after { top: 2px; left: 2px; width: 14px; height: 14px; }
.switch.mini input:checked + .track::after { transform: translateX(12px); }
.goal-chip.off .n { color: var(--ink-2); }
.goal-chip.off .bar { opacity: 0.5; }
.goal-chip { min-width: 190px; max-width: 260px; }
.sav-wrap { margin-bottom: 4px; }
.sav-wrap .sav-title { margin: 12px 0 4px; }
.sav-wrap .sav-dash { margin-bottom: 0; }
.cal-dash .sav-wrap { display: flex; flex-direction: column; margin: 0; }
.cal-dash .sav-wrap .sav-title { margin-top: 0; }
.cal-dash .dash { align-items: end; }
.cal-dash .sav-dash { flex: 1; }
.cal-dash .sav-tiles span::before { content: none; }
.stats.three .stat { padding: 8px 12px; }
.sav-dash { padding: 7px 12px; }
.cal-dash .dash { align-items: stretch; }
.cal-dash .stats { align-self: end; }
.goal-chip { width: 210px; min-width: 210px; max-width: 210px; }
.goals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; overflow: visible; }
.cal-dash ~ .goals, .goals { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
.goal-chip { width: auto; min-width: 0; max-width: none; padding: 7px 9px; }
.goal-amt { margin-top: 1px; }
.goal-chip .a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc .goals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mc .goals { margin-top: 10px; }
.ov-asset { gap: 6px; }
.ov-asset .input.ov-name { flex: 1; min-width: 0; min-height: 28px; height: 28px; padding: 3px 8px; font-size: 13px; border-radius: 7px; }
.ov-x { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border: 0; background: none; color: var(--ink-3); border-radius: 6px; cursor: pointer; padding: 0; }
.ov-x:hover { color: var(--neg); background: var(--surface-2); }
.ov-add { min-height: 26px; padding: 2px 8px; font-size: 12px; margin-left: -8px; }
.stats.three .stat { padding: 6px 12px; } .stats.three .stat .label { margin-bottom: 0; }
/* Compact one-line rows in month cards */
.mc .dated li button { padding: 6px 0; gap: 8px; }
.mc .dated li button > span:nth-last-child(2) { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mc .d-name { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.mc .d-meta { flex: 0 1 auto; flex-wrap: nowrap; margin: 0; min-width: 0; overflow: hidden; gap: 4px; }
.mc .d-meta .tag { flex: none; font-size: 10.5px; padding: 1px 6px; }
.mc .d-day { display: flex; align-items: baseline; gap: 3px; justify-items: start; }
.mc .d-day b { font-size: 14px; display: inline; }
.mc .d-day span { font-size: 9.5px; }
.mc .dated:not(.month-items) li button { grid-template-columns: 42px 1fr auto; }
.mc .d-amt { font-size: 14px; }
.mc .mc-group { margin-top: 4px; }
.mc .mc-group + .mc-group { margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--line); }
.mc .mc-group + .mc-group { margin-top: 14px; padding-top: 0; border-top: 0; }
.goal-chip { padding: 6px 8px; }
.goal-chip .row { gap: 4px !important; }
.goal-chip .goal-amt { margin: 0; flex: none; font-size: 11.5px; }
.switch.mini .track { width: 22px; height: 13px; }
.switch.mini .track::after { top: 2px; left: 2px; width: 9px; height: 9px; }
.switch.mini input:checked + .track::after { transform: translateX(9px); }
.goal-chip .a { margin-top: 2px !important; font-size: 11.5px; }
.goal-chip .n { font-size: 12.5px; }
.goal-chip .goal-amt { font-size: 11px; }
.mc .goals { gap: 6px; }
.sav-tiles .sav-click { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; margin: -4px -6px; padding: 4px 6px; border: 0; background: none; border-radius: 8px; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background .12s, box-shadow .12s; }
.sav-tiles .sav-click:hover, .sav-tiles .sav-click:focus-visible { background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(98, 84, 190, 0.35); outline: none; }
button.goal-chip { font: inherit; color: inherit; text-align: left; cursor: pointer; display: block; width: 100%; transition: border-color .12s, background .12s; }
button.goal-chip:hover { border-color: rgba(98, 84, 190, 0.45); background: var(--accent-soft); }
.goal-chip .switch.mini .track.on { background: var(--accent); }
.goal-chip .switch.mini .track.on::after { transform: translateX(9px); }
/* Header: brand left, Home view controls center, tabs right */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 14px 0 10px; }
.topbar .brand { margin-right: 0; justify-self: start; }
.topbar .tabs-top { justify-self: end; }
.header-slot { display: flex; justify-content: center; }
.home-bar { display: flex !important; align-items: center; gap: 14px; }
.mc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 10px; }
.mc-add { width: 34px; min-height: 34px; height: 34px; border-radius: 999px; }
.topbar { grid-template-columns: auto 1fr auto; }
.ov-fun-banner { grid-column: 1 / -1; display: flex; align-items: center; gap: 24px; padding: 22px 28px; border-radius: var(--radius-lg); background: linear-gradient(120deg, rgba(255,255,255,0.92), rgba(240,236,255,0.92)); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.ov-fun-banner .fb-text { flex: 1; min-width: 0; }
.ov-fun-banner .fb-title { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.ov-fun-banner .fb-goal { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.ov-fun-banner .fb-amt { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ov-fun-banner .fb-pct { font-size: 22px; font-weight: 600; padding: 6px 18px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ov-fun-banner .fb-pct.ok { background: var(--pos-soft); color: var(--pos); }
.ov-fun-banner .fb-pct.over { background: var(--neg-soft); color: var(--neg); }
/* Budgets */
.budget-switch { height: 34px; display: flex; align-items: center; }
.seg button:disabled { opacity: 0.35; cursor: not-allowed; }
.month-items .budget-line { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: -2px; }
.month-items .budget-line .bar { flex: 1; margin-top: 0; height: 5px; }
.budget-left { font-size: 11px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.budget-left.neg { color: var(--neg); }
.bp { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 10px 12px; }
.bp-head { display: flex; align-items: center; gap: 10px; }
.bp-title { font-size: 13px; font-weight: 600; flex: 1; }
.bp-sum { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bp-add { width: 30px; min-height: 30px; height: 30px; }
.bp-form { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.bp-form .input.input-sm { flex: 1; min-width: 0; }
.bp-form .dp-btn, .bp-form .input { min-height: 34px; }
.bp-list { list-style: none; margin: 8px 0 0; padding: 0; }
.bp-list li { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; }
.bp-date { width: 92px; color: var(--ink-2); flex: none; }
.bp-name { flex: 1; min-width: 0; }
.bp-amt { font-variant-numeric: tabular-nums; }
.carousel { overflow: clip; }
.mc .dated li button > .d-info { display: flex; align-items: center; gap: 6px; min-width: 0; }
/* Header spans the window: brand at the far left, Home controls beside it, tabs at the far right */
.topbar { grid-template-columns: auto auto 1fr auto; margin: 0 calc(50% - 50vw); padding-left: 24px; padding-right: 24px; }
.header-slot { justify-content: flex-start; padding-left: 12px; }
.topbar .tabs-top { grid-column: 4; }
/* Item rows: icon-only repeat, category capsules, amount column */
.rep-icon { display: inline-flex; color: var(--ink-3); flex: none; }
.cat-cap { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.mc .d-meta .cat-cap { font-size: 11px; }
.cat-label:not(.cat-cap), .type-label { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; flex: none; }
.d-name.cat-cap { padding: 1px 9px; max-width: 100%; }
.mc .dated li button .d-amt { width: 64px; text-align: left; justify-self: start; }
.mc .dated li button { grid-template-columns: 1fr 64px; }
.mc .dated:not(.month-items) li button { grid-template-columns: 42px 1fr 64px; }
/* Setup: color tiles and + buttons */
.add-plus { width: 34px; min-height: 34px; height: 34px; border-radius: 999px; padding: 0; flex: none; }
.color-tile-wrap { position: relative; flex: none; display: inline-flex; }
.color-tile { width: 22px; height: 22px; border-radius: 7px; border: 0; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08); }
.color-tile.none { background: repeating-linear-gradient(45deg, #fff 0 4px, #f0eff6 4px 8px); box-shadow: inset 0 0 0 1px var(--line-strong); }
.color-tile:hover { transform: scale(1.08); }
.color-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: -6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(27, 29, 43, 0.16); padding: 10px; width: 196px; }
.color-grid { display: grid; grid-template-columns: repeat(5, 28px); gap: 8px; }
.color-dot { width: 28px; height: 28px; border-radius: 8px; border: 0; cursor: pointer; padding: 0; transition: transform .1s; }
.color-dot:hover { transform: scale(1.1); }
.color-dot.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.color-none { margin-top: 8px; width: 100%; justify-content: center; }
.input.cat-cap-input { border-radius: 999px; font-weight: 500; border-color: transparent; }
.set-row { align-items: center; }
.bp .d-day { display: flex; align-items: baseline; gap: 3px; width: 46px; text-align: left; }
.bp .d-day b { font-size: 14px; font-weight: 500; display: inline; }
.bp .d-day span { font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.bp-list li { padding: 6px 0; }
button.goal-chip { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }
.topbar { position: relative; }
.header-slot .year-nav { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.mc-add { border-radius: var(--radius-md); width: 36px; height: 36px; min-height: 36px; }
.topbar .brand-name { font-size: 21px; }
.header-slot { padding-left: 4px; }
@media (max-width: 1360px) { .header-slot .year-nav { position: static; transform: none; } }
.color-pop.up { top: auto; bottom: calc(100% + 6px); }
.add-plus { border-radius: var(--radius-md); width: 36px; height: 36px; min-height: 36px; } .bp-add { width: 32px; height: 32px; min-height: 32px; }
button.goal-chip:hover { background: #f4f4f7; border-color: rgba(27, 29, 43, 0.28); box-shadow: 0 2px 8px rgba(27, 29, 43, 0.08); }
.ov-fun-banner { background: none; border: 0; box-shadow: none; padding: 8px 4px 0; margin-top: 18px; justify-self: start; width: auto; gap: 20px; }
.ov-fun-banner .fb-text { flex: none; }
.ov-fun-banner .fb-title { font-size: 21px; }
.ov-fun-banner .fb-goal { font-size: 13px; }
.ov-fun-banner .fb-amt { font-size: 30px; }
.ov-fun-banner .fb-pct { font-size: 17px; padding: 4px 14px; }
button.goal-chip:hover { background: #faf9ff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(98, 84, 190, 0.12); }
.month-items .budget-line { grid-column: 1; display: flex; align-items: center; margin-top: -2px; padding-right: 10px; }
.month-items .budget-left { grid-column: 2; justify-self: start; margin-top: -2px; line-height: 1; }
.sav-tiles .sav-click:hover, .sav-tiles .sav-click:focus-visible { background: #faf9ff; box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px rgba(98, 84, 190, 0.12); }
.cat-dot { flex: none; width: 10px; height: 10px; border-radius: 3px; }
/* Stronger card structure */
.mc .stats, .cal-dash .stats { border: 1px solid rgba(27, 29, 43, 0.22); background: rgba(27, 29, 43, 0.22); gap: 1px; }
.sav-dash { border-color: rgba(27, 29, 43, 0.22); }
.mc .mc-list { border-top-color: rgba(27, 29, 43, 0.22); }
.mc .mc-sec { border-top-color: rgba(27, 29, 43, 0.22); }
.goal-chip { border-color: rgba(27, 29, 43, 0.18); }
.sav-tiles { gap: 10px; }
.sav-tiles .sav-click { margin: -4px -4px; padding: 4px 4px; }
.sav-tiles .sav-click:hover, .sav-tiles .sav-click:focus-visible { box-shadow: inset 0 0 0 1px var(--accent), inset 0 0 0 3px rgba(98, 84, 190, 0.12); }
.tag.biz { background: #ececf1; color: var(--ink-2); border-radius: 999px; padding: 1px 8px; box-shadow: none; }
.tag.biz { box-shadow: inset 0 0 0 1px rgba(27, 29, 43, 0.22); }
.cal .pill { background: #fff; color: var(--ink); border: 1px solid rgba(27, 29, 43, 0.22); border-radius: 999px; padding: 1px 7px; }
/* Calendar: compact top, bolder grid */
.cal-title { font-size: 20px; margin: 0 0 6px; }
.cal-top { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 10px; }
.cal-top .cal-dash { flex: none; width: 700px; }
.cal-top .cal-dash .dash { margin-bottom: 0; grid-template-columns: 300px 1fr; }
.cal-top .goals { flex: 1; min-width: 0; margin: 0; padding: 0; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-self: flex-end; }
.cal { background: rgba(27, 29, 43, 0.2); box-shadow: 0 0 0 1px rgba(27, 29, 43, 0.22); }
.cal .day { min-height: 92px; }
.cal .dow { padding: 4px; }
.mc.flat { background: none; box-shadow: none; border: 0; }
.topbar { grid-template-columns: auto 1fr auto auto; }
.topbar .tabs-top { grid-column: 4; }
.header-slot-right { display: flex; justify-content: flex-end; }
.header-slot .year-nav { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
@media (max-width: 1360px) { .header-slot .year-nav { position: absolute; } }
.cal-month { padding: 12px 16px; }
.sheet-dow { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; margin-left: 2px; vertical-align: middle; }
.mc.no-day .d-day { display: none; }
.mc.no-day .dated:not(.month-items) li button { grid-template-columns: 1fr 64px; }
.cal-month .month-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; }
.cal-month .month-items li:last-child button { border-bottom: 1px solid var(--line); }
.cal-month.card { background: none; box-shadow: none; border: 0; padding: 0; }
.cal-month .month-items { column-gap: 10px; row-gap: 8px; }
.cal-month .month-items li button, .cal-month .month-items li:last-child button { border: 1px solid rgba(27, 29, 43, 0.2); border-radius: var(--radius-md); background: var(--surface); padding: 7px 12px; }
.cal-month .month-items li button:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(98, 84, 190, 0.12); }
.mc .d-day b, .bp .d-day b { display: inline-block; width: 1.2em; text-align: right; }
.header-slot-right .seg button { width: 32px; height: 32px; min-height: 32px; padding: 0; display: grid; place-items: center; }
.seg-ico { display: grid; place-items: center; }
.money-wrap .cur { left: 10px; color: var(--ink); } .money-wrap .input { padding-left: 20px; }
.cal-dash .sav-tiles .sav-click:hover, .cal-dash .sav-tiles .sav-click:focus-visible { background: transparent; }
.mc .d-day b, .bp .d-day b { text-align: left; width: 1.35em; }
.goal-top .goal-amt-col { width: 84px; text-align: left; flex: none; margin-left: auto; font-variant-numeric: tabular-nums; }
.goal-switch { flex: none; display: inline-flex; margin-left: 10px; }
.goal-switch .switch { gap: 0; }
.goal-top { align-items: center; }
/* Calendar page: fills the window; goals in a right-hand pane */
.app.fixed-mode .page-scroll.cal-scroll { overflow: hidden; padding-bottom: 12px; display: flex; flex-direction: column; }
.cal-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 236px; grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 16px; margin-left: -16px; margin-right: -16px; }
.cal-head { grid-column: 1; grid-row: 1; }
.cal-layout > .cal { grid-column: 1; grid-row: 2; min-height: 0; overflow: hidden; }
.cal-layout > .cal-month { grid-column: 1; grid-row: 3; margin-top: 10px; max-height: 96px; overflow-y: auto; scrollbar-width: none; }
.cal-goals { grid-column: 2; grid-row: 2 / 4; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.cal-goals::-webkit-scrollbar, .cal-layout > .cal-month::-webkit-scrollbar { display: none; }
.cal-goals .goals { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0 0 4px; overflow: visible; }
.cal-goals .goal-chip { width: 100%; }
.cal-layout .cal .day { min-height: 0; overflow: hidden; }
.cal-top { margin-bottom: 10px; }
.cal-top .cal-dash { width: 760px; }
/* Keep the tabs from shifting when Home adds its view toggle */
.header-slot-right { min-width: 84px; }
.tabs-top { transform: translateZ(0); }
.cal-layout { margin-left: 0; margin-right: 0; }
.cal-layout > .cal-month { padding: 2px; margin-left: -2px; margin-right: -2px; } .cal-goals { padding: 2px; margin: -2px; }
/* Savings box as four bordered tiles; hover outlines the tile itself */
.sav-dash { padding: 0; overflow: visible; }
.sav-tiles { gap: 0; }
.sav-tiles > div, .sav-tiles .sav-click { padding: 7px 12px; margin: 0; border-radius: 0; }
.sav-tiles > * + * { border-left: 1px solid rgba(27, 29, 43, 0.22) !important; }
.sav-tiles .sav-click { position: relative; }
.sav-tiles .sav-click:hover, .sav-tiles .sav-click:focus-visible { box-shadow: none; outline: 2px solid var(--accent); outline-offset: -1px; z-index: 1; }
.sav-tiles > :last-child, .sav-tiles > :last-child:hover { border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }
.mc .mc-list, .cal-goals, .cal-layout > .cal-month, .page-scroll { overscroll-behavior: none; }
.ov-sheet .ov-pct, .ov-pct { width: 30px; text-align: left; padding: 2px 5px; }
.settings-card .hr { margin: 8px 0; }
.bp-amt { width: 70px; text-align: left; flex: none; }
.settings-card .hr { margin: 12px 0 8px; }
.money-wrap .cur { color: #9a9cb0; } .money-wrap.has-value .cur { color: var(--ink); }
/* Log in */
.auth { max-width: 380px; padding-top: calc(10vh + env(safe-area-inset-top)); }
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; }
.auth-brand h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 12px 0 0; }
.auth-card { padding: 22px; margin-top: 24px; box-shadow: var(--shadow-md); }
.auth-title { font-size: 19px; font-weight: 500; margin: 0; }
.auth-msg { color: var(--accent-ink); margin: 0; }
.auth-links { justify-content: space-between; margin-top: 16px; }
.auth-links .btn-ghost:hover { background: transparent; }
.btn-block { width: 100%; }
.auth { max-width: 420px; } .auth-brand h1 { white-space: nowrap; font-size: 24px; }

/* Keep the scrolling list clear of the card edge. */
.home-scroll .carousel .mc { padding-bottom: 16px; }
