* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  -webkit-touch-callout: none;
  font-family: var(--font);
  color: var(--text);
  background: var(--bgMid);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--purple); text-decoration: none; }
.i { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Sky background ---------- */
.sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, var(--bgTop) 0%, var(--bgMid) 48%, var(--bgBottom) 100%);
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(70px);
  opacity: var(--blobOpacity);
  animation: drift 22s ease-in-out infinite alternate;
}
.blob-orange { width: 260px; height: 260px; background: var(--orange); top: -70px; right: -90px; }
.blob-purple { width: 300px; height: 300px; background: var(--purple); top: 38%; left: -150px; animation-delay: -7s; }
.blob-blue { width: 280px; height: 280px; background: var(--blue); bottom: -90px; right: -70px; animation-delay: -14s; }
@keyframes drift { to { transform: translate(30px, 40px) scale(1.12); } }

.sky-arc { position: absolute; left: 50%; top: 0; width: min(460px, 100%); height: 240px; transform: translateX(-50%); }
.sky-orb {
  position: absolute; left: var(--orb-x, 50%); top: var(--orb-y, 40%);
  width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff 0%, var(--orb-color) 70%);
  box-shadow: 0 0 40px 12px var(--orb-color), 0 0 120px 50px var(--orb-color);
  opacity: var(--orb-opacity, 0);
  transition: opacity 0.8s ease;
}

/* ---------- Layout ---------- */
.app {
  position: relative; z-index: 1;
  max-width: 460px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 22px) 16px calc(env(safe-area-inset-bottom) + 130px);
}

.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.greet-sub { font-size: 13px; font-weight: 500; color: var(--textMuted); }
.greet { font-size: 26px; font-weight: 800; letter-spacing: -0.6px; margin-top: 2px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.icon-btn .i { width: 21px; height: 21px; }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--surfaceBorder);
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 18px 40px -14px var(--shadow);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
}
.chip {
  position: absolute; top: 18px; right: 18px;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px;
  background: var(--track); color: var(--textMuted);
}

/* ---------- Month calendar (Home) ---------- */
.cal { padding: 16px 14px 12px; }
.cal-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; }
.cal-arrow { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--track); color: var(--text); transition: opacity 0.2s ease, transform 0.15s ease; }
.cal-arrow .i { width: 19px; height: 19px; stroke-width: 2.2; }
.cal-arrow:active { transform: scale(0.92); }
.cal-arrow:disabled { opacity: 0.3; cursor: default; }
.cal-title { text-align: center; min-width: 0; }
.cal-title h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; }
.cal-sum { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; font-size: 12px; color: var(--textMuted); }
.cal-sum b { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.cal-sum .in b { color: var(--income); }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); margin: 14px 0 6px; text-align: center; font-size: 11px; font-weight: 700; color: var(--textMuted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; touch-action: pan-y; }
.cal-grid.slide-l { animation: cal-l 0.35s var(--ease-out); }
.cal-grid.slide-r { animation: cal-r 0.35s var(--ease-out); }
@keyframes cal-l { from { opacity: 0; transform: translateX(28px); } }
@keyframes cal-r { from { opacity: 0; transform: translateX(-28px); } }
.cal-day {
  position: relative; height: 50px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: color-mix(in srgb, var(--orange) var(--heat, 0%), transparent);
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.cal-day.blank { background: none; }
.cal-day:not(.blank):not(:disabled):active { transform: scale(0.92); }
.cal-num { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cal-amt { min-height: 12px; font-size: 10px; font-weight: 700; line-height: 1.2; color: color-mix(in srgb, var(--orange) 65%, var(--text)); font-variant-numeric: tabular-nums; }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--purple); }
.cal-day.today .cal-num { color: var(--purpleText); }
.cal-day.future { opacity: 0.32; cursor: default; }
.cal-in { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--income); }
.cal-day[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--purple), var(--blue)); color: #fff;
  box-shadow: 0 8px 16px -8px var(--purple);
}
.cal-day[aria-pressed="true"] .cal-num, .cal-day[aria-pressed="true"] .cal-amt { color: #fff; }
.cal-day[aria-pressed="true"] .cal-in { box-shadow: 0 0 0 1.5px #fff; }
.cal-foot { display: flex; align-items: center; gap: 14px; min-height: 36px; margin-top: 8px; padding: 0 2px; }
.cal-key { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--textMuted); }
.cal-key i { width: 10px; height: 10px; border-radius: 3px; }
.key-out { background: color-mix(in srgb, var(--orange) 38%, transparent); }
.key-in { border-radius: 50% !important; width: 7px !important; height: 7px !important; background: var(--income); }
.cal-foot .link-btn { margin-left: auto; padding: 8px 2px; font-size: 13px; }
.cal-foot .link-btn[hidden] { display: none; }
.cal-head > span { width: 40px; }
@media (max-height: 720px) { .cal-day { height: 44px; } .cal-week { margin-top: 10px; } }

/* The chosen day's heading and empty state */
.list-head { align-items: center; }
.day-tot { display: flex; gap: 10px; margin-top: 1px; font-size: 12.5px; font-weight: 700; color: var(--textMuted); font-variant-numeric: tabular-nums; }
.day-tot:empty { display: none; }
.day-tot .in { color: var(--income); }
.day-empty { padding: 14px 4px 8px; text-align: center; }
.day-empty p { font-size: 14px; line-height: 1.45; color: var(--textMuted); }
.day-empty p b { color: var(--purpleText); }
.day-empty .pill { margin-top: 12px; font-weight: 700; color: var(--purpleText); }

/* ---------- Liquid-glass shortcut orbs ---------- */
.shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 26px 0; }
.shortcut { display: flex; flex-direction: column; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; }
.orb {
  position: relative; isolation: isolate;
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  transition: transform 0.3s var(--ease-out);
}
/* Coloured glow behind the glass so the blur has something to bend */
.orb::before {
  content: ''; position: absolute; inset: 10px; z-index: -2; border-radius: 50%;
  background: var(--tint); filter: blur(14px); opacity: 0.6;
}
.orb-glass {
  position: absolute; inset: 0; z-index: -1; border-radius: 50%;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, calc(var(--glassShine) * 0.55)), rgba(255, 255, 255, 0) 55%),
    var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(200%);
  backdrop-filter: blur(14px) saturate(200%);
  border: 1px solid var(--glassBorder);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, var(--glassShine)),
    inset 0 -6px 12px -4px var(--tint),
    0 10px 22px -10px var(--tint);
}
/* Specular highlight */
.orb-glass::after {
  content: ''; position: absolute; top: 6px; left: 14px; width: 22px; height: 10px; border-radius: 50%;
  background: rgba(255, 255, 255, calc(var(--glassShine) * 0.8)); filter: blur(2px); transform: rotate(-20deg);
}
.orb .i { position: relative; width: 26px; height: 26px; color: var(--tint); stroke-width: 2; }
@media (hover: hover) { .shortcut:hover .orb { transform: translateY(-3px) scale(1.04); } }
.jelly { animation: jelly 0.55s var(--ease-out); }
@keyframes jelly {
  0% { transform: scale(1); }
  30% { transform: scale(1.12, 0.88); }
  55% { transform: scale(0.94, 1.06); }
  80% { transform: scale(1.03, 0.97); }
  100% { transform: scale(1); }
}

/* ---------- Transaction list ---------- */
.list-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.list-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; }
.list-head a { font-size: 13px; font-weight: 600; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--surfaceBorder); }
.list-head + .row, #todayList > .row:first-child { border-top: 0; }
.row-ic {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  color: var(--tint); background: color-mix(in srgb, var(--tint) 16%, transparent);
}
.row-ic .i { width: 21px; height: 21px; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-size: 12.5px; color: var(--textMuted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-amt { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Bottom tab bar ---------- */
.tabbar {
  position: fixed; z-index: 20;
  left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(436px, calc(100% - 24px)); height: 72px;
  border-radius: 28px; padding: 0 6px;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--tabBar);
}
.tab {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--textMuted);
  transition: color 0.3s ease;
}
.tab .i { width: 23px; height: 23px; }
.tab.active { color: var(--purple); }
.add-btn {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--purple) 65%, var(--blue));
  box-shadow: 0 12px 24px -8px var(--purple), inset 0 1.5px 0 rgba(255, 255, 255, 0.55);
  transform: translateY(-14px);
}
.add-btn .i { width: 26px; height: 26px; stroke-width: 2.4; }
.add-btn.jelly { animation: jelly-raised 0.55s var(--ease-out); }
@keyframes jelly-raised {
  30% { transform: translateY(-14px) scale(1.12, 0.88); }
  55% { transform: translateY(-14px) scale(0.94, 1.06); }
  100% { transform: translateY(-14px) scale(1); }
}

/* ---------- Profile icon with time-of-day light ---------- */
.avatar-wrap { position: relative; width: 30px; height: 30px; display: grid; place-items: center; }
.avatar {
  position: relative; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--blue));
}
.avatar .i { width: 17px; height: 17px; stroke-width: 2; }
.tab-profile { color: var(--textMuted); }

.fx {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  border-radius: 50%; pointer-events: none;
  transform: translate(-50%, -50%);
}
/* Sunrise: a soft blurry glow behind the icon */
.fx-sunrise {
  width: 62px; height: 62px; opacity: var(--fx-sunrise);
  background: radial-gradient(circle, rgba(255, 176, 92, 1) 0%, rgba(255, 128, 64, 0.7) 40%, rgba(255, 110, 70, 0) 70%);
  filter: blur(5px);
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: translate(-50%, -50%) scale(1.18); } }
/* Daytime: light streaks (rays) behind the icon */
.fx-day {
  width: 76px; height: 76px; opacity: var(--fx-day);
  background: repeating-conic-gradient(from 0deg,
    rgba(255, 186, 90, 0) 0deg 13deg, rgba(255, 186, 90, 0.9) 17deg, rgba(255, 186, 90, 0) 21deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 14px, #000 16px, transparent 38px);
  mask: radial-gradient(circle, transparent 14px, #000 16px, transparent 38px);
  animation: spin 28s linear infinite;
}
/* Sunset: a dim orange horizon streak... */
.fx-sunset {
  top: 64%; width: 88px; height: 16px; opacity: var(--fx-sunset);
  background: radial-gradient(ellipse at center, rgba(255, 150, 70, 0.95), rgba(255, 110, 60, 0.5) 45%, rgba(255, 90, 60, 0) 72%);
  filter: blur(3px);
}
.fx-sunset::after {
  content: ''; position: absolute; left: -10%; right: -10%; top: 50%; height: 2px; margin-top: -1px;
  background: linear-gradient(90deg, transparent, rgba(255, 210, 160, 0.95), transparent);
}
/* ...with a faint white overlay on top of the icon */
.fx-veil {
  z-index: 3; width: 30px; height: 30px;
  opacity: calc(var(--fx-sunset) * 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.15) 60%, rgba(255, 255, 255, 0));
}
/* Night: a white streak circling the icon */
.fx-night {
  width: 42px; height: 42px; opacity: var(--fx-night);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.9));
  animation: spin 6s linear infinite;
}
.fx-night-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255, 255, 255, 0) 0deg 140deg, rgba(255, 255, 255, 0.95) 330deg, rgba(255, 255, 255, 0) 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
}
.fx-night::before {
  content: ''; position: absolute; inset: 3px; border-radius: 50%;
  box-shadow: 0 0 12px 2px rgba(255, 255, 255, 0.25);
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ---------- Appearance sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(10, 8, 30, 0.35);
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.sheet-backdrop.open { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }
.sheet {
  position: fixed; z-index: 41; left: 50%; bottom: 0;
  width: min(460px, 100%); max-height: 90vh; overflow-y: auto;
  transform: translate(-50%, 105%);
  transition: transform 0.45s var(--ease-out);
  background: var(--sheet);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  backdrop-filter: blur(30px) saturate(160%);
  border: 1px solid var(--surfaceBorder); border-bottom: 0;
  border-radius: 30px 30px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px -10px var(--shadow);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-handle { width: 40px; height: 5px; border-radius: 9px; background: var(--track); margin: 4px auto 16px; }
.sheet h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
.sheet .hint { font-size: 13px; color: var(--textMuted); margin: 4px 0 16px; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 14px 6px; border-radius: 20px;
  background: var(--surface); border: 1.5px solid var(--surfaceBorder);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.mode-opt:active { transform: scale(0.97); }
.mode-opt b { font-size: 14px; }
.mode-opt small { font-size: 11.5px; color: var(--textMuted); }
.mode-opt[aria-pressed="true"] { border-color: var(--purple); box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 22%, transparent); }
.swatch { width: 46px; height: 46px; border-radius: 50%; margin-bottom: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.sw-day {
  background:
    radial-gradient(circle at 32% 34%, #ffc79a 0 15%, transparent 16%),
    radial-gradient(circle at 68% 40%, #cdbdff 0 13%, transparent 14%),
    radial-gradient(circle at 50% 72%, #b9c6ee 0 13%, transparent 14%),
    #ffffff;
}
.sw-adaptive { background: conic-gradient(from 200deg, #ffffff, #ffc79a, #ff8a3d, #7c5cff, #1e3a8a, #2e1660, #ffffff); }
.sw-night {
  background:
    radial-gradient(circle at 68% 32%, #ff9c52 0 11%, transparent 12%),
    radial-gradient(circle at 34% 64%, #a8a8be 0 8%, transparent 9%),
    linear-gradient(160deg, #2e1660, #0a1c52);
}
.mode-desc { font-size: 13.5px; line-height: 1.5; color: var(--textMuted); margin: 14px 2px 20px; min-height: 60px; }

.tools { border-top: 1px dashed var(--surfaceBorder); padding-top: 16px; }
.tools-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.tag { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; color: var(--orange); background: color-mix(in srgb, var(--orange) 16%, transparent); }
.tools label { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--textMuted); margin: 14px 0 8px; }
.tools label b { color: var(--text); }
.tools input[type="range"] { width: 100%; accent-color: var(--purple); }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pill { padding: 10px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--track); }
.pill.primary { color: #fff; background: linear-gradient(135deg, var(--orange), var(--purple)); }

/* ---------- 24-hour simulation controls ---------- */
.sim-hud {
  position: fixed; z-index: 30; left: 50%;
  bottom: calc(14px + 72px + 12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(436px, calc(100% - 24px));
  border-radius: 24px; padding: 14px 16px 12px;
}
.sim-hud.glass { background: var(--sheet); }
.sim-hud[hidden] { display: none; }
.sim-top { display: flex; align-items: center; gap: 10px; }
.sim-info { flex: 1; min-width: 0; }
.sim-time { font-size: 24px; font-weight: 800; letter-spacing: -0.6px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sim-stage { font-size: 13px; font-weight: 700; color: var(--purple); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-avatar { width: 52px; height: 52px; flex: none; display: grid; place-items: center; }
.sim-avatar .avatar-wrap { transform: scale(1.6); }
.sim-btns { display: flex; gap: 6px; flex: none; }
.sim-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--track); }
.sim-btn .i { width: 18px; height: 18px; stroke-width: 2.2; }
.sim-detail { font-size: 11.5px; font-weight: 500; color: var(--textMuted); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The scrubber track is itself a picture of the day */
#simScrub {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px; margin-top: 12px; border-radius: 99px; cursor: pointer;
  background: linear-gradient(90deg, #1d1652 0%, #1d1652 18%, #ffb37a 26%, #fff3e6 33%, #ffffff 50%, #fff3e6 64%, #ff8a50 75%, #3a1f6e 84%, #1d1652 100%);
  box-shadow: inset 0 0 0 1px var(--surfaceBorder);
}
#simScrub::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--purple); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
#simScrub::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--purple); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.sim-ticks { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10.5px; font-weight: 600; color: var(--textMuted); }

/* ---------- Home: list states ---------- */
.row.is-new { animation: row-in 0.7s var(--ease-out); }
@keyframes row-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } }
.row-amt.in { color: var(--income); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Add expense / income screen ---------- */
body.add-open { overflow: hidden; }
.add-screen {
  position: fixed; inset: 0; z-index: 60;
  display: flex; justify-content: center; align-items: center;
  background: rgba(10, 8, 30, 0.35);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.5s;
}
.add-screen.open { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }
.add-panel {
  position: relative; overflow-x: hidden; overflow-y: auto; outline: none;
  width: min(460px, 100%); height: 100%;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 16px);
  /* A frosted layer that follows the text colour keeps it readable at sunset and dawn */
  background:
    linear-gradient(color-mix(in srgb, var(--sheet) 80%, transparent), color-mix(in srgb, var(--sheet) 80%, transparent)),
    linear-gradient(180deg, var(--bgTop) 0%, var(--bgMid) 50%, var(--bgBottom) 100%);
  transform: translateY(100%);
  transition: transform 0.5s var(--ease-out);
}
.add-screen.open .add-panel { transform: none; }
/* Soft colour behind the glass, like Home */
.add-panel::before, .add-panel::after {
  content: ''; position: absolute; z-index: 0; border-radius: 50%; filter: blur(80px);
  opacity: var(--blobOpacity); pointer-events: none;
}
.add-panel::before { width: 280px; height: 280px; background: var(--purple); top: -90px; left: -120px; }
.add-panel::after { width: 260px; height: 260px; background: var(--orange); bottom: 120px; right: -130px; }
.add-panel > * { position: relative; z-index: 1; }
@media (min-width: 520px) {
  .add-screen { padding: 20px; }
  .add-panel { height: min(100%, 880px); border-radius: 34px; border: 1px solid var(--surfaceBorder); box-shadow: 0 30px 80px -20px rgba(10, 8, 30, 0.45); }
}

.add-head { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; }
.seg {
  position: relative; justify-self: center; width: 100%; max-width: 210px;
  display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 99px; background: var(--track);
}
.seg button { position: relative; z-index: 1; padding: 9px 0; border-radius: 99px; font-size: 13.5px; font-weight: 700; color: var(--textMuted); transition: color 0.3s ease; }
.seg button[aria-checked="true"] { color: #fff; }
.seg-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 99px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  box-shadow: 0 6px 14px -6px var(--purple);
  transition: transform 0.45s var(--ease-out);
}
.seg[data-type="expense"] .seg-thumb { transform: translateX(100%); background: linear-gradient(135deg, var(--orange), var(--purple)); }

.date-pill {
  position: relative; display: flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 14px; border-radius: 99px;
  font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.date-pill .i { width: 17px; height: 17px; color: var(--purple); }
.date-pill input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; }

.add-amount {
  flex: 1 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 6px 0;
}
.amt-label { font-size: 14px; font-weight: 600; color: var(--textMuted); }
.amt {
  display: flex; align-items: baseline; margin: 4px 0 0;
  font-size: var(--amt-size, 60px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.12;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  transition: font-size 0.2s ease;
}
.amt small { font-size: 0.4em; font-weight: 700; letter-spacing: 0; color: var(--textMuted); margin-right: 8px; }
.amt.empty #amtValue { color: var(--textMuted); opacity: 0.45; }
.amt.bump #amtValue { display: inline-block; animation: bump 0.2s var(--ease-out); }
.amt.shake { animation: shake 0.4s ease; }
.caret { align-self: center; width: 3px; height: 0.72em; margin-left: 5px; border-radius: 3px; background: var(--purple); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes bump { 40% { transform: scale(1.06); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.note {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 380px; height: 46px; padding: 0 16px; margin-top: 6px; border-radius: 99px;
  transition: box-shadow 0.25s ease;
}
.note:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 30%, transparent); }
.note .i { width: 18px; height: 18px; color: var(--textMuted); }
.note input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; font-weight: 500; color: var(--text); }
.note input::placeholder { color: var(--textMuted); opacity: 0.85; }
.auto-hint { min-height: 18px; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--purpleText); }
.auto-hint.err { color: var(--orange); font-size: 12.5px; }

.add-section { margin-top: 8px; }
.sec-title { margin: 0 2px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: var(--textMuted); }
.cats, .picks {
  display: flex; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding-left: 16px; padding-right: 16px;
  scroll-snap-type: x proximity; scroll-padding: 0 16px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  mask: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}
.cats::-webkit-scrollbar, .picks::-webkit-scrollbar { display: none; }
.cats { gap: 2px; padding-top: 6px; padding-bottom: 2px; }
.cat {
  flex: none; min-width: 70px; padding: 0 3px; white-space: nowrap; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; color: var(--textMuted); transition: color 0.25s ease;
}
.cat .orb { width: 50px; height: 50px; outline: 2.5px solid transparent; outline-offset: 3px; transition: transform 0.3s var(--ease-out), outline-color 0.25s ease; }
.cat .orb .i { width: 22px; height: 22px; }
.cat .orb-glass::after { top: 5px; left: 11px; width: 17px; height: 8px; }
.cat[aria-checked="true"] { color: var(--text); font-weight: 700; }
.cat[aria-checked="true"] .orb { outline-color: var(--tint); }
.cat[aria-checked="true"] .orb::before { opacity: 0.9; }
.picks { gap: 8px; padding-top: 2px; padding-bottom: 2px; }
.pick {
  flex: none; scroll-snap-align: start;
  padding: 9px 15px; border-radius: 99px; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--surfaceBorder);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.pick[aria-checked="true"] { color: var(--purpleText); border-color: var(--purple); background: color-mix(in srgb, var(--purple) 14%, var(--surface)); }

.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.pad button {
  height: clamp(44px, 7dvh, 60px); border-radius: 18px;
  display: grid; place-items: center;
  font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--surface); border: 1px solid var(--surfaceBorder);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  transition: transform 0.12s ease, background 0.2s ease;
}
.pad button:active, .pad button.press { transform: scale(0.94); background: var(--track); }
.pad [data-k="000"] { font-size: 19px; }
.pad .i { width: 26px; height: 26px; }

.save-btn {
  flex: none; width: 100%; height: 56px; margin-top: 12px; border-radius: 20px;
  font-size: 16px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--orange), var(--purple) 65%, var(--blue));
  box-shadow: 0 14px 28px -12px var(--purple), inset 0 1.5px 0 rgba(255, 255, 255, 0.5);
  transition: opacity 0.25s ease, transform 0.15s ease;
}
.save-btn.income { background: linear-gradient(135deg, var(--purple), var(--blue)); }
.save-btn.idle { opacity: 0.7; }
.save-btn:active { transform: scale(0.98); }

/* Short phones (e.g. iPhone SE): tighten everything so it fits without scrolling */
@media (max-height: 720px) {
  .add-panel { padding-top: calc(env(safe-area-inset-top) + 10px); padding-bottom: calc(env(safe-area-inset-bottom) + 10px); }
  .add-amount { padding: 0; }
  .amt { font-size: calc(var(--amt-size, 60px) * 0.82); }
  .note { height: 42px; margin-top: 4px; }
  .auto-hint { margin-top: 4px; }
  .add-section { margin-top: 2px; }
  .cats { padding-top: 5px; }
  .cat { gap: 5px; }
  .cat .orb { width: 44px; height: 44px; }
  .cat .orb .i { width: 20px; height: 20px; }
  .pad { gap: 6px; margin-top: 10px; }
  .pad button { height: 44px; border-radius: 16px; }
  .save-btn { height: 50px; margin-top: 10px; }
}

/* ---------- + button bubbles: Income, Scan bill, Expense ---------- */
.quick {
  position: fixed; inset: 0; z-index: 19;
  background: rgba(10, 8, 30, 0.3);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.35s;
}
.quick.open { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }
.quick-items {
  position: absolute; left: 50%; bottom: calc(14px + 72px + 6px + env(safe-area-inset-bottom));
  width: 310px; height: 170px; transform: translateX(-50%);
}
.quick-item {
  position: absolute; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700;
  opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3);
  transition: transform 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) calc(var(--i) * 55ms), opacity 0.25s ease calc(var(--i) * 55ms);
}
.quick-item[data-quick="income"] { left: 14px; bottom: 6px; --dx: 104px; --dy: 70px; }
.quick-item[data-quick="scan"] { left: calc(50% - 40px); bottom: 74px; --dx: 0px; --dy: 130px; }
.quick-item[data-quick="expense"] { right: 14px; bottom: 6px; --dx: -104px; --dy: 70px; }
.quick.open .quick-item { opacity: 1; transform: none; }
.quick-item .orb { width: 66px; height: 66px; }
.quick-item .orb .i { width: 28px; height: 28px; }
.quick-item > span:last-child {
  padding: 4px 11px; border-radius: 99px; white-space: nowrap;
  background: var(--sheet); box-shadow: 0 6px 16px -8px var(--shadow);
}
.tab-add .add-btn .i { transition: transform 0.4s var(--ease-out); }
.tab-add.open .add-btn .i { transform: rotate(135deg); }

/* ---------- Shared bits: money field, card pictures, bank initials ---------- */
.money-field {
  display: flex; align-items: baseline; gap: 8px; width: 100%;
  padding: 14px 18px; border-radius: 22px;
}
.money-field small { font-size: 18px; font-weight: 700; color: var(--textMuted); }
.money-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text);
  font: inherit; font-size: 34px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.money-field input::placeholder { color: var(--textMuted); opacity: 0.5; }
.money-field.small { padding: 0 14px; height: 46px; align-items: center; border-radius: 16px; }
.money-field.small small { font-size: 14px; }
.money-field.small input { font-size: 16px; font-weight: 600; letter-spacing: 0; }
.money-field.small input::placeholder { opacity: 0.8; font-weight: 500; }
.money-field:focus-within, .last4:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 30%, transparent); }

.mini-card {
  position: relative; flex: none; width: 40px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 10px -4px var(--shadow);
}
.mini-card.credit { background: linear-gradient(135deg, var(--orange), var(--purple)); }
.mini-card.cash { background: linear-gradient(135deg, #2fbf86, #1a8f63); }
.mini-card i { position: absolute; left: 6px; top: 8px; width: 9px; height: 7px; border-radius: 2px; background: rgba(255, 224, 160, 0.9); }
.mini-card.cash i { left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }
.bank-mark {
  flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  font-size: 15px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--blue));
}
.link-btn { font-size: 14px; font-weight: 700; color: var(--purpleText); padding: 10px 4px; min-width: 44px; text-align: right; }

/* ---------- First-run setup ---------- */
.setup-head { display: grid; grid-template-columns: 44px 1fr 56px; align-items: center; gap: 10px; }
.dots { display: flex; justify-content: center; gap: 7px; }
.dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--track); transition: width 0.35s var(--ease-out), background 0.35s ease; }
.dots i.on { width: 22px; background: linear-gradient(90deg, var(--orange), var(--purple)); }
.setup-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 2px 16px; display: flex; flex-direction: column; }
.setup-body > :first-child.setup-hero { margin-top: auto; }
.setup-body > .promise:last-child { margin-bottom: auto; }
.setup-hero { display: grid; place-items: center; margin: 18px 0 26px; }
.setup-hero .loader-logo { margin: 0; }
.setup-title { font-size: 27px; font-weight: 800; letter-spacing: -0.6px; line-height: 1.2; }
.setup-text { font-size: 15px; line-height: 1.5; color: var(--textMuted); margin: 8px 0 20px; }
.setup-text b { color: var(--text); }
.setup-note { font-size: 13px; color: var(--textMuted); margin-top: 12px; }
.promise { list-style: none; display: grid; gap: 12px; }
.promise li { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--surfaceBorder); font-size: 14px; line-height: 1.45; color: var(--textMuted); }
.promise b { color: var(--text); }
.promise .i { width: 22px; height: 22px; color: var(--purple); flex: none; margin-top: 1px; }

.bank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bank-chip {
  position: relative; display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 10px; border-radius: 18px; min-height: 58px;
  background: var(--surface); border: 1.5px solid var(--surfaceBorder);
  font-size: 13.5px; font-weight: 700; line-height: 1.2;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.bank-chip:active { transform: scale(0.97); }
.bank-chip small { display: block; font-size: 11.5px; font-weight: 600; color: var(--textMuted); margin-top: 2px; }
.bank-chip .tick {
  position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--purple);
  opacity: 0; transform: scale(0.5); transition: opacity 0.2s ease, transform 0.3s var(--ease-out);
}
.bank-chip .tick .i { width: 13px; height: 13px; stroke-width: 3; }
.bank-chip[aria-pressed="true"] { border-color: var(--purple); background: color-mix(in srgb, var(--purple) 10%, var(--surface)); }
.bank-chip[aria-pressed="true"] .tick { opacity: 1; transform: none; }
.other-bank { display: flex; gap: 8px; margin-top: 12px; }
.other-bank input {
  flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: 16px; outline: 0;
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--surfaceBorder);
}

.acct { border-radius: 24px; padding: 14px; margin-bottom: 14px; }
.acct-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.acct-head b { font-size: 16px; }
.acct-head small { font-size: 12px; font-weight: 600; color: var(--textMuted); }
.card-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--surfaceBorder); }
.card-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card-row-main b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.card-row-main small { font-size: 12.5px; color: var(--textMuted); }
.card-del { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--track); color: var(--textMuted); }
.card-del .i { width: 16px; height: 16px; }
.card-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 10px; border-top: 1px solid var(--surfaceBorder); }
.mini-seg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 14px; background: var(--track); }
.mini-seg button { border-radius: 11px; font-size: 13px; font-weight: 700; color: var(--textMuted); }
.mini-seg button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px -3px var(--shadow); }
.last4 { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 16px; }
.last4 span { color: var(--textMuted); letter-spacing: 1px; }
.last4 input { width: 100%; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 16px; font-weight: 700; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.last4 input::placeholder { letter-spacing: 0; font-weight: 500; color: var(--textMuted); }
.card-form .money-field.small { grid-column: 1 / -1; }
.add-card { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; }
.add-card .i { width: 18px; height: 18px; stroke-width: 2.4; }
.form-error { font-size: 12.5px; font-weight: 600; color: var(--orange); margin-top: 6px; }
.form-error:empty { display: none; }
.no-card { margin-top: 10px; }
.no-card p { font-size: 12.5px; color: var(--textMuted); margin-bottom: 8px; }
/* "I have a card" / "No card" for each bank or wallet */
.acct-mode { height: 40px; margin-bottom: 2px; }
.acct-mode + .card-form { margin-top: 10px; }
.card-more { grid-column: 1 / -1; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--textMuted); }

/* ---------- Bank logos ---------- */
/* Logos sit on a white plate so they stay readable in Day, Adaptive and Night */
.logo-plate {
  position: relative; flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden;
  width: 100%; height: 58px; padding: 7px 9px; border-radius: 14px;
  background: #fff; box-shadow: inset 0 0 0 1px rgba(20, 20, 60, 0.06);
}
.logo-plate img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; min-width: 0; min-height: 0; object-fit: contain; }
.logo-plate.square img { border-radius: 8px; }
.logo-plate.nologo img { display: none; }
.logo-plate.nologo::after {
  content: attr(data-letter); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px;
  font-weight: 800; font-size: 16px; color: #fff; background: linear-gradient(135deg, var(--purple), var(--blue));
}
.logo-plate.small { width: 48px; height: 34px; padding: 4px 5px; border-radius: 10px; }
.logo-plate.small.nologo::after, .logo-plate.row.nologo::after { width: 26px; height: 26px; font-size: 13px; border-radius: 8px; }
.logo-plate.tiny { width: 30px; height: 22px; padding: 2px 3px; border-radius: 7px; }
.logo-plate.tiny.nologo::after { width: 18px; height: 18px; font-size: 10px; border-radius: 5px; }
.logo-plate.row { width: 64px; height: 40px; padding: 5px 7px; border-radius: 11px; }
.logo-plate.stack { width: 44px; height: 30px; padding: 4px; border-radius: 9px; box-shadow: 0 0 0 2px var(--sheet), 0 4px 10px -4px var(--shadow); }
.logo-plate.stack + .logo-plate.stack { margin-left: -14px; }

/* 5 x 3 grid of the popular ones */
.bank-grid15 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bank-tile {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 7px 7px 9px; border-radius: 20px; text-align: center;
  background: var(--surface); border: 1.5px solid var(--surfaceBorder);
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.15s ease;
}
.bank-tile:active { transform: scale(0.96); }
.bank-tile-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.5em; font-size: 12px; font-weight: 700; line-height: 1.25;
}
.bank-tile[aria-pressed="true"] { border-color: var(--purple); box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 22%, transparent); }
.bank-tile .tick, .more-row .tick {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff;
  background: var(--purple); box-shadow: 0 2px 6px -2px var(--purple);
  opacity: 0; transform: scale(0.5); transition: opacity 0.2s ease, transform 0.3s var(--ease-out);
}
.bank-tile .tick { position: absolute; top: -6px; right: -6px; }
.bank-tile .tick .i, .more-row .tick .i { width: 13px; height: 13px; stroke-width: 3; }
.bank-tile[aria-pressed="true"] .tick, .more-row[aria-pressed="true"] .tick { opacity: 1; transform: none; }

/* Picked from the More list */
.picked-title { margin: 18px 2px 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: var(--textMuted); }
.picked-list { display: flex; flex-wrap: wrap; gap: 8px; }
.picked-chip {
  display: flex; align-items: center; gap: 7px; padding: 4px 4px 4px 5px; border-radius: 99px;
  font-size: 13px; font-weight: 600; background: var(--surface); border: 1px solid var(--purple);
}
.picked-x { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--track); color: var(--textMuted); }
.picked-x .i { width: 14px; height: 14px; }

/* The big "More banks & wallets" button */
.more-banks {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 78px; margin-top: 16px;
  padding: 14px 16px; border-radius: 24px; text-align: left;
  transition: transform 0.15s ease;
}
.more-banks:active { transform: scale(0.98); }
.more-stack { display: flex; flex: none; }
.more-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.more-text b { font-size: 16px; font-weight: 800; }
.more-text small { font-size: 12.5px; color: var(--textMuted); line-height: 1.35; }
.more-banks .chev { width: 22px; height: 22px; color: var(--textMuted); }

/* The More list (slides in from the right) */
.more-sheet {
  position: fixed; inset: 0; z-index: 85; display: flex; justify-content: center;
  visibility: hidden; transition: visibility 0s linear 0.45s;
}
.more-sheet.open { visibility: visible; transition: none; }
.more-panel {
  width: min(460px, 100%); height: 100%; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 14px);
  background:
    linear-gradient(color-mix(in srgb, var(--sheet) 88%, transparent), color-mix(in srgb, var(--sheet) 88%, transparent)),
    linear-gradient(180deg, var(--bgTop), var(--bgMid) 50%, var(--bgBottom));
  transform: translateX(105%); transition: transform 0.45s var(--ease-out);
}
.more-sheet.open .more-panel { transform: none; }
@media (min-width: 520px) { .more-sheet { padding: 20px; } .more-panel { height: min(100%, 880px); margin: auto 0; border-radius: 34px; } }
.more-head { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; }
.more-head h3 { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.more-head p { font-size: 12.5px; font-weight: 600; color: var(--purpleText); min-height: 16px; }
.more-search { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; margin: 14px 0 4px; border-radius: 16px; }
.more-search .i { width: 19px; height: 19px; color: var(--textMuted); }
.more-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 16px; }
.more-search input::placeholder { color: var(--textMuted); }
.more-search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 30%, transparent); }
.more-list { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 2px 8px; margin: 0 -2px; }
.more-group { margin: 16px 4px 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: var(--textMuted); }
.more-row {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 8px; padding: 8px 12px 8px 8px; border-radius: 18px;
  text-align: left; background: var(--surface); border: 1.5px solid var(--surfaceBorder);
  transition: border-color 0.2s ease;
}
.more-row[aria-pressed="true"] { border-color: var(--purple); }
.more-row-name { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 700; }
.more-row .tick { opacity: 1; transform: none; background: transparent; box-shadow: inset 0 0 0 2px var(--surfaceBorder); color: transparent; }
.more-row[aria-pressed="true"] .tick { background: var(--purple); color: #fff; box-shadow: none; }
.more-empty { padding: 24px 4px; text-align: center; font-size: 14px; color: var(--textMuted); }
.more-panel .other-bank { margin-top: 8px; }

/* ---------- Chooser sheet ("Which card did you use?") ---------- */
.picker {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(10, 8, 30, 0.4);
  opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0s linear 0.3s;
}
.picker.open { opacity: 1; visibility: visible; transition: opacity 0.25s ease; }
.picker-sheet {
  width: min(460px, 100%); max-height: 80vh; overflow-y: auto;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  border-radius: 30px 30px 0 0; background: var(--sheet);
  -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%);
  border: 1px solid var(--surfaceBorder); border-bottom: 0;
  transform: translateY(100%); transition: transform 0.4s var(--ease-out);
}
.picker.open .picker-sheet { transform: none; }
.picker-sheet h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
.picker-sheet .hint { font-size: 13px; color: var(--textMuted); margin: 4px 0 14px; }
.picker-sheet .hint:empty { display: none; }
.picker-list { display: grid; gap: 8px; }
.picker-opt {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  padding: 12px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--surfaceBorder);
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.picker-opt:active { transform: scale(0.98); }
.picker-opt[aria-pressed="true"] { border-color: var(--purple); }
.picker-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.picker-main b { font-size: 15px; }
.picker-main small { font-size: 12.5px; color: var(--textMuted); }
.picker-badge { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 99px; color: var(--orange); background: color-mix(in srgb, var(--orange) 15%, transparent); white-space: nowrap; }
.picker-opt .row-ic { width: 38px; height: 38px; border-radius: 12px; }
.picker-cancel { display: block; width: 100%; margin-top: 12px; padding: 13px; }

/* ---------- "Your money" in the You panel ---------- */
.money-list { display: grid; gap: 8px; margin-bottom: 12px; }
.money-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.money-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.money-main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.money-main small { font-size: 12px; color: var(--textMuted); }
.money-val { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-val.neg { color: var(--orange); }
.money-empty { font-size: 13px; color: var(--textMuted); padding: 2px 4px; }
.sheet-h { margin-top: 26px; }

/* ---------- Scan a bill ---------- */
.scan-screen {
  position: fixed; inset: 0; z-index: 70; overflow: hidden; color: #fff;
  background: #07061a;
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.scan-screen.open { opacity: 1; visibility: visible; transition: opacity 0.3s ease; }
.scan-screen::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity 0.35s ease; }
.scan-screen.flash::after { opacity: 0.85; transition: none; }
#scanVideo, #scanShot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#scanShot { object-fit: contain; background: #07061a; }
.scan-ui {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  padding: calc(env(safe-area-inset-top) + 14px) 18px calc(env(safe-area-inset-bottom) + 26px);
  background: linear-gradient(180deg, rgba(7, 6, 26, 0.55), transparent 22%, transparent 70%, rgba(7, 6, 26, 0.7));
}
.scan-head { width: 100%; max-width: 460px; display: flex; align-items: center; justify-content: space-between; }
.scan-title { font-size: 16px; font-weight: 800; }
.scan-round {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #fff;
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.scan-round.ghost { visibility: hidden; }
.scan-round .i { width: 22px; height: 22px; }
.scan-frame { position: relative; flex: 1; width: min(84%, 380px); max-height: 560px; margin: 22px 0 14px; }
.scan-frame i { position: absolute; width: 34px; height: 34px; border: 3.5px solid #fff; filter: drop-shadow(0 0 6px rgba(124, 92, 255, 0.8)); }
.scan-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 16px; }
.scan-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 16px; }
.scan-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 16px; }
.scan-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 16px; }
.scan-line {
  position: absolute; left: 6%; right: 6%; top: 0; height: 3px; border-radius: 3px; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--orange), #fff, var(--purple), transparent);
  box-shadow: 0 0 18px 4px rgba(255, 138, 61, 0.55);
}
.scan-screen[data-state="busy"] .scan-line { opacity: 1; animation: sweep 1.6s ease-in-out infinite alternate; }
@keyframes sweep { to { top: calc(100% - 3px); } }
.scan-tip { font-size: 14px; font-weight: 600; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); margin-bottom: 18px; }
.scan-foot { width: 100%; max-width: 360px; display: flex; align-items: center; justify-content: space-between; }
.shutter { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; border: 4px solid #fff; transition: transform 0.15s ease; }
.shutter span { width: 62px; height: 62px; border-radius: 50%; background: #fff; transition: transform 0.15s ease; }
.shutter:active span { transform: scale(0.88); }
.scan-screen:not([data-state="camera"]) .scan-foot,
.scan-screen:not([data-state="camera"]) .scan-tip { visibility: hidden; }
.scan-screen[data-state="result"] .scan-frame, .scan-screen[data-state="ask"] .scan-frame { opacity: 0.25; }

.scan-ask, .scan-busy, .scan-result {
  position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom));
  width: min(436px, calc(100% - 24px)); transform: translateX(-50%);
  border-radius: 28px; padding: 22px; color: var(--text);
  animation: card-up 0.45s var(--ease-out);
}
.scan-ask.glass, .scan-busy.glass, .scan-result.glass { background: var(--sheet); }
.scan-ask[hidden], .scan-busy[hidden], .scan-result[hidden] { display: none; }
@keyframes card-up { from { opacity: 0; transform: translate(-50%, 24px); } }
.scan-ask { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ask-ic { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--orange), var(--purple)); box-shadow: 0 12px 24px -10px var(--purple); }
.ask-ic .i { width: 32px; height: 32px; }
.scan-ask h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; margin-top: 4px; }
.scan-ask p { font-size: 14px; line-height: 1.5; color: var(--textMuted); }
.scan-ask .save-btn { margin-top: 6px; }
.scan-ask .pill { cursor: pointer; }
.busy-title { font-size: 16px; font-weight: 800; }
.scan-busy .loader-bar { width: 100%; margin-top: 14px; }
.scan-busy .loader-bar span { transition: width 0.3s ease; }

.res-title { font-size: 13px; font-weight: 700; color: var(--textMuted); text-transform: uppercase; letter-spacing: 0.7px; }
.res-amt { font-size: 44px; font-weight: 800; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.res-amt small { font-size: 20px; font-weight: 700; color: var(--textMuted); margin-right: 6px; letter-spacing: 0; }
.res-shop { font-size: 14px; font-weight: 600; color: var(--textMuted); margin-top: 2px; }
.res-rows { margin: 14px 0 4px; border-radius: 18px; overflow: hidden; border: 1px solid var(--surfaceBorder); }
.res-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; text-align: left; background: var(--surface); }
.res-row + .res-row { border-top: 1px solid var(--surfaceBorder); }
.res-k { font-size: 13px; color: var(--textMuted); width: 74px; flex: none; }
.res-v { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-ic { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; color: var(--tint); background: color-mix(in srgb, var(--tint) 16%, transparent); flex: none; }
.res-ic .i { width: 16px; height: 16px; }
.res-row .chev { width: 18px; height: 18px; color: var(--textMuted); }
.res-more { display: flex; gap: 8px; margin-top: 10px; }
.res-more .pill { flex: 1; }

/* ---------- Toast (after saving) ---------- */
.toast {
  position: fixed; z-index: 35; left: 50%;
  bottom: calc(14px + 72px + 12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(436px, calc(100% - 24px));
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 12px; border-radius: 20px;
  font-size: 13.5px; font-weight: 600;
  animation: toast-in 0.45s var(--ease-out);
}
.toast.glass { background: var(--sheet); }
.toast[hidden] { display: none; }
.toast.out { opacity: 0; transform: translate(-50%, 10px); transition: opacity 0.3s ease, transform 0.3s ease; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } }
.toast-ic { width: 34px; height: 34px; flex: none; border-radius: 12px; display: grid; place-items: center; color: var(--tint); background: color-mix(in srgb, var(--tint) 16%, transparent); }
.toast-ic .i { width: 18px; height: 18px; }
.toast-text { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.toast-btn { flex: none; padding: 8px 14px; border-radius: 99px; font-size: 13px; font-weight: 700; color: var(--purpleText); background: var(--track); }

/* ---------- Loading screen ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 28px; text-align: center; cursor: pointer;
  background: linear-gradient(180deg, var(--bgTop) 0%, var(--bgMid) 50%, var(--bgBottom) 100%);
  transition: opacity 0.4s ease;
}
.loader.hide { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.7s ease, visibility 0s linear 0.7s; }
.loader::before, .loader::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--blobOpacity);
}
.loader::before { width: 340px; height: 340px; background: var(--purple); top: -100px; left: -110px; }
.loader::after { width: 320px; height: 320px; background: var(--orange); bottom: -110px; right: -100px; }

.loader-logo { position: relative; z-index: 1; width: 84px; height: 84px; margin-bottom: 34px; }
.logo-core {
  position: absolute; inset: 14px; border-radius: 50%;
  background: conic-gradient(var(--orange), var(--purple), var(--blue), var(--orange));
  filter: blur(7px);
  animation: rotate 3s linear infinite;
}
.logo-glass { position: absolute; inset: 0; border-radius: 50%; }
@keyframes rotate { to { transform: rotate(360deg); } }

.loader-line { position: relative; z-index: 1; max-width: 360px; font-size: clamp(22px, 6vw, 28px); font-weight: 800; letter-spacing: -0.5px; line-height: 1.3; }
.loader-line.is-quote { font-size: clamp(19px, 5vw, 23px); font-weight: 700; letter-spacing: -0.3px; }
.loader-author { position: relative; z-index: 1; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--textMuted); }
.loader-bar { position: relative; z-index: 1; margin-top: 36px; width: 120px; height: 4px; border-radius: 9px; background: var(--track); overflow: hidden; }
.loader-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--orange), var(--purple), var(--blue)); }
.loader-hint { position: absolute; z-index: 1; bottom: calc(28px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--textMuted); }

.loader.run .loader-line { animation: rise 0.8s var(--ease-out) 0.15s both; }
.loader.run .loader-author { animation: rise 0.8s var(--ease-out) 0.4s both; }
.loader.run .loader-bar span { animation: fill var(--dur, 3s) linear forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fill { to { width: 100%; } }

/* Home screen slides in once the loader leaves */
.app > *, .tabbar { transition: opacity 0.6s ease, transform 0.6s var(--ease-out); }
body:not(.ready) .app > * { opacity: 0; transform: translateY(16px); }
body:not(.ready) .tabbar { opacity: 0; transform: translate(-50%, 20px); }
.app > :nth-child(2) { transition-delay: 0.06s; }
.app > :nth-child(3) { transition-delay: 0.12s; }
.app > :nth-child(4) { transition-delay: 0.18s; }
body.ready .tabbar { transition-delay: 0.2s; }

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

/* ---------- Tappable entries (Home and See all) ---------- */
.list-head .see-all { font-size: 13px; font-weight: 700; padding: 6px 0; min-width: 0; }
.row.tap { width: 100%; text-align: left; border-radius: 0; transition: background-color 0.15s ease; }
.row.tap:active { background: color-mix(in srgb, var(--text) 5%, transparent); }
@media (hover: hover) { .row.tap:hover .row-title { color: var(--purpleText); } }
.row-tag {
  display: inline-block; margin-left: 7px; padding: 2px 7px; border-radius: 99px; vertical-align: 2px;
  font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--purpleText);
  background: color-mix(in srgb, var(--purple) 14%, transparent);
}

/* ---------- Edit entry: delete button next to Save ---------- */
.save-row { flex: none; display: flex; gap: 10px; }
.save-row .save-btn { flex: 1; width: auto; }
.del-btn {
  flex: none; width: 56px; height: 56px; margin-top: 12px; border-radius: 20px; display: grid; place-items: center;
  color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 28%, transparent);
}
.del-btn[hidden] { display: none; }
.del-btn .i { width: 22px; height: 22px; }
.del-btn:active { transform: scale(0.94); }
@media (max-height: 720px) { .del-btn { width: 50px; height: 50px; margin-top: 10px; } }

/* ---------- See all ---------- */
body.all-open { overflow: hidden; }
.all-sheet { z-index: 32; }
.all-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.sum-tile {
  display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--surfaceBorder);
}
.sum-tile small { font-size: 12px; font-weight: 600; color: var(--textMuted); }
.sum-tile b { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.sum-tile.in b { color: var(--income); }

.all-seg {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; margin: 10px 0 6px;
  border-radius: 99px; background: var(--track);
}
.all-seg button { position: relative; z-index: 1; padding: 8px 0; border-radius: 99px; font-size: 13.5px; font-weight: 700; color: var(--textMuted); transition: color 0.3s ease; }
.all-seg button[aria-checked="true"] { color: #fff; }
.all-seg-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 99px;
  background: linear-gradient(135deg, var(--purple), var(--blue)); box-shadow: 0 6px 14px -6px var(--purple);
  transition: transform 0.45s var(--ease-out);
}
.all-seg[data-f="expense"] .all-seg-thumb { transform: translateX(100%); background: linear-gradient(135deg, var(--orange), var(--purple)); }
.all-seg[data-f="income"] .all-seg-thumb { transform: translateX(200%); }

.all-list { padding-top: 6px; }
.all-list .more-group:first-child { margin-top: 6px; }
.all-day {
  margin-bottom: 12px; padding: 2px 14px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--surfaceBorder);
}
.all-day h4 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 0 4px; font-size: 13.5px; font-weight: 800; }
.all-day-tot { display: flex; gap: 10px; font-size: 12.5px; font-weight: 700; color: var(--textMuted); font-variant-numeric: tabular-nums; }
.all-day-tot .in { color: var(--income); }
.all-day h4 + .row { border-top: 0; }
.all-day .row.tap { margin: 0 -14px; padding-left: 14px; padding-right: 14px; width: calc(100% + 28px); }
.all-day .row.tap + .row.tap { border-top-color: var(--surfaceBorder); }
.all-day .row.tap:last-child { border-radius: 0 0 20px 20px; }
.all-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 18px; text-align: center; }
.all-empty b { font-size: 17px; font-weight: 800; }
.all-empty p { max-width: 300px; font-size: 14px; line-height: 1.45; color: var(--textMuted); }
.all-empty .pill { margin-top: 8px; padding: 12px 20px; font-size: 14px; }
.all-empty-ic {
  width: 64px; height: 64px; margin-bottom: 6px; border-radius: 22px; display: grid; place-items: center;
  color: var(--purpleText); background: color-mix(in srgb, var(--purple) 14%, transparent);
}
.all-empty-ic .i { width: 30px; height: 30px; }
.all-foot { padding: 6px 0 14px; text-align: center; font-size: 12.5px; color: var(--textMuted); }

/* ---------- Menu (bottom bar) ---------- */
.menu-sheet { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-item {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  min-height: 112px; padding: 14px; border-radius: 22px; text-align: left;
  background: var(--surface); border: 1px solid var(--surfaceBorder);
  transition: transform 0.15s ease, border-color 0.2s ease;
}
.menu-item:active { transform: scale(0.97); }
@media (hover: hover) { .menu-item:not(.soon):hover { border-color: color-mix(in srgb, var(--tint) 55%, transparent); } }
.menu-ic {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  color: var(--tint); background: color-mix(in srgb, var(--tint) 16%, transparent);
}
.menu-ic .i { width: 22px; height: 22px; }
.menu-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.menu-text b { font-size: 14.5px; font-weight: 800; letter-spacing: -0.2px; }
.menu-text small { font-size: 12px; line-height: 1.3; color: var(--textMuted); }
.menu-item.soon .menu-ic { opacity: 0.6; }
.menu-item.soon .menu-text b { color: color-mix(in srgb, var(--text) 75%, transparent); }
.menu-soon {
  position: absolute; top: 12px; right: 12px; padding: 3px 8px; border-radius: 99px;
  font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--textMuted); background: var(--track);
}
.menu-item.nudge { animation: nudge 0.4s ease; }
@keyframes nudge { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* ---------- Home top bar: Import beside the bell ---------- */
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn.small { width: 36px; height: 36px; }
.icon-btn.small .i { width: 17px; height: 17px; }
.cal + .list, .home-bud + .list, .home-bud[hidden] + .list { margin-top: 16px; }

/* ---------- Budgets ---------- */
.bud-month { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; margin: 14px 0 4px; text-align: center; }
.bud-month b { font-size: 15px; font-weight: 800; }
.bud-list { padding-top: 8px; }
.bud-hero {
  padding: 18px; border-radius: 24px; margin-bottom: 6px;
  background: var(--surface); border: 1px solid var(--surfaceBorder);
}
.bud-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bud-hero-top .link-btn { padding: 4px 0; font-size: 13px; }
.bud-hero-label { font-size: 13.5px; font-weight: 600; color: var(--textMuted); }
.bud-big { margin: 4px 0 14px; font-size: 40px; font-weight: 800; letter-spacing: -1.4px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.bud-big small { margin-right: 6px; font-size: 19px; font-weight: 700; letter-spacing: -0.3px; color: var(--textMuted); }
.bud-hero.over .bud-big { color: var(--orange); }
.bud-hero-sub { margin-top: 10px; font-size: 12.5px; color: var(--textMuted); }
.bud-tip { margin-top: 10px; padding: 10px 12px; border-radius: 14px; font-size: 13px; line-height: 1.4; background: var(--track); }
.bud-tip b { color: var(--purpleText); }
.bud-hero.over .bud-tip b { color: var(--orange); }
.bud-warn { margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--orange); }
.bud-hero.intro { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 22px 18px 18px; }
.bud-hero.intro b { font-size: 17px; font-weight: 800; }
.bud-hero.intro p { max-width: 320px; font-size: 13.5px; line-height: 1.45; color: var(--textMuted); }
.bud-hero-ic {
  width: 56px; height: 56px; margin-bottom: 4px; border-radius: 19px; display: grid; place-items: center;
  color: var(--purpleText); background: color-mix(in srgb, var(--purple) 14%, transparent);
}
.bud-hero-ic .i { width: 27px; height: 27px; }
.bud-set-total { margin-top: 8px; height: 50px; }

/* Progress bar with a "today" mark */
.bud-bar { position: relative; height: 8px; border-radius: 99px; background: var(--track); }
.bud-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--blue)); }
.bud-bar.over span { background: linear-gradient(90deg, var(--orange), color-mix(in srgb, var(--orange) 70%, var(--danger))); }
.bud-today { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--text); opacity: 0.35; }
.bud-hero .bud-bar { height: 10px; }

/* Categories with a budget */
.bud-rows, .bud-others { display: grid; gap: 8px; }
.bud-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 20px; text-align: left;
  background: var(--surface); border: 1px solid var(--surfaceBorder); transition: transform 0.15s ease;
}
.bud-row:active, .bud-other:active { transform: scale(0.98); }
.bud-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.bud-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bud-row-top b { min-width: 0; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bud-row-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--textMuted); font-variant-numeric: tabular-nums; }
.bud-row-sub span:last-child { font-weight: 700; color: var(--text); }
.bud-row-sub .neg { color: var(--orange) !important; }
.bud-tag { flex: none; padding: 3px 8px; border-radius: 99px; font-style: normal; font-size: 10.5px; font-weight: 700; }
.bud-tag.ok { color: var(--income); background: color-mix(in srgb, var(--income) 14%, transparent); }
.bud-tag.warn { color: color-mix(in srgb, var(--orange) 80%, var(--text)); background: color-mix(in srgb, var(--orange) 14%, transparent); }
.bud-tag.over { color: #fff; background: var(--orange); }

/* Categories without a budget */
.bud-other {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 18px; text-align: left;
  background: var(--surface); border: 1px solid var(--surfaceBorder); transition: transform 0.15s ease;
}
.bud-other .row-ic { width: 38px; height: 38px; border-radius: 12px; }
.bud-other .row-ic .i { width: 19px; height: 19px; }
.bud-other-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bud-other-main b { font-size: 14px; font-weight: 700; }
.bud-other-main small { font-size: 12px; color: var(--textMuted); }
.bud-add { flex: none; padding: 7px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 700; color: var(--purpleText); background: var(--track); }

/* Set a budget sheet */
.bud-edit { z-index: 50; }
.bud-edit-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.bud-edit-head .row-ic { flex: none; width: 44px; height: 44px; }
.bud-edit-head .hint { margin: 2px 0 0 !important; }
.bud-input { align-items: center; }
.bud-per { flex: none; font-size: 14px; font-weight: 600; color: var(--textMuted); }
.bud-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bud-chips .pill { font-weight: 700; }
.bud-edit .save-btn { margin-top: 14px; }
.bud-edit-foot { display: flex; gap: 8px; margin-top: 10px; }
.bud-edit-foot .pill { flex: 1; padding: 13px; }
.bud-remove { color: var(--danger); }
.bud-remove[hidden] { display: none; }

/* ---------- Home: week view + budget bar ---------- */
.cal.is-week .cal-day { height: 58px; }
.cal.is-week .cal-num { font-size: 16px; }
.cal.is-week .cal-amt { font-size: 11px; }
.home-bud {
  display: block; width: 100%; margin-top: 12px; padding: 16px 18px; text-align: left; border-radius: 24px;
  transition: transform 0.15s ease;
}
.home-bud[hidden] { display: none; }
.home-bud:active { transform: scale(0.98); }
.hb-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.hb-label { font-size: 13px; font-weight: 600; color: var(--textMuted); }
.hb-left { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.home-bud.over .hb-left { color: var(--orange); }
.hb-sub { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; font-size: 12px; color: var(--textMuted); font-variant-numeric: tabular-nums; }

/* ---------- Calendar screen (Menu) ---------- */
.cal-scroll { padding-top: 12px; }
.cal-big {
  padding: 14px 12px 8px; border-radius: 24px;
  background: var(--surface); border: 1px solid var(--surfaceBorder);
}
.cal-day-list { margin-top: 14px; padding: 16px 16px 6px; border-radius: 24px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
#calDayList > .row:first-child { border-top: 0; }

/* ---------- Accounts & cards (Menu) ---------- */
#acctEdit { text-align: right; }
.acct-list { padding-top: 12px; }
.acct-hero {
  padding: 18px; border-radius: 24px; color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  box-shadow: 0 18px 34px -16px var(--purple);
}
.acct-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.acct-hero-top p { font-size: 13.5px; font-weight: 600; opacity: 0.85; }
.acct-eye {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px 7px 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 700; color: #fff; background: rgba(255, 255, 255, 0.18);
}
.acct-eye .i { width: 17px; height: 17px; }
.acct-total { margin: 6px 0 4px; font-size: 40px; font-weight: 800; letter-spacing: -1.4px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-total small { margin-right: 6px; font-size: 19px; font-weight: 700; letter-spacing: -0.3px; opacity: 0.8; }
.acct-split { display: flex; gap: 3px; height: 8px; margin: 10px 0 4px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, 0.2); }
.acct-split span { min-width: 4px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5); }
.acct-hero-sub { margin-top: 8px; font-size: 12.5px; opacity: 0.85; }

.acct-group { margin-bottom: 10px; padding: 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.acct-group-head { display: flex; align-items: center; gap: 12px; }
.acct-group-head .mini-card { flex: none; }
.acct-group-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.acct-group-main b { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-group-main small { font-size: 12px; color: var(--textMuted); }
.acct-group-val { display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.acct-items { margin-top: 10px; padding-top: 4px; border-top: 1px solid var(--surfaceBorder); }
.acct-item { display: flex; align-items: center; gap: 12px; padding: 9px 2px 3px; }
.acct-item .mini-card { flex: none; }
.acct-item-dot { flex: none; width: 40px; display: grid; place-items: center; }
.acct-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.acct-item-main b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.acct-item-main small { font-size: 12px; color: var(--textMuted); }
.acct-item-val { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-item-val.credit { color: var(--textMuted); }
.acct-group-val.neg, .acct-item-val.neg, .acct-total.neg { color: var(--orange); }
.acct-hero .acct-total.neg { color: #ffd2b3; }
.acct-empty { padding: 18px 4px 4px; text-align: center; }
.acct-empty p { margin-bottom: 12px; font-size: 14px; color: var(--textMuted); }

/* ---------- Loans ---------- */
.loan-detail-sheet { z-index: 34; }
.loan-form-sheet { z-index: 36; }
.loan-list { padding-top: 12px; }
.sum-tile.owe b { color: var(--orange); }
.loan-rows { display: grid; gap: 8px; }
.loan-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 20px; text-align: left;
  background: var(--surface); border: 1px solid var(--surfaceBorder); transition: transform 0.15s ease;
}
.loan-row:active { transform: scale(0.98); }
.loan-row.done { opacity: 0.7; }
.loan-av {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  font-size: 17px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #2fbf86, #1a8f63);
}
.loan-row.borrowed .loan-av { background: linear-gradient(135deg, var(--orange), color-mix(in srgb, var(--orange) 60%, var(--purple))); }
.loan-row.done .loan-av { background: var(--track); color: var(--textMuted); }
.loan-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.loan-main b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loan-main small { font-size: 12px; color: var(--textMuted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loan-main small.overdue { color: var(--danger); font-weight: 700; }
.loan-main small.soon { color: color-mix(in srgb, var(--orange) 80%, var(--text)); font-weight: 700; }
.loan-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.loan-amt b { font-size: 15px; font-weight: 800; }
.loan-row.lent .loan-amt b { color: var(--income); }
.loan-row.borrowed .loan-amt b { color: var(--orange); }
.loan-row.done .loan-amt b { color: var(--textMuted); }
.loan-amt small { font-size: 11.5px; color: var(--textMuted); }
.loan-start { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.loan-start .pill { padding: 12px 18px; font-size: 14px; font-weight: 700; }
.loan-clear { padding: 18px 4px 4px; text-align: center; font-size: 14px; color: var(--textMuted); }

/* One loan */
.ld-hero { padding: 18px; margin-top: 12px; border-radius: 24px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.ld-label { font-size: 13.5px; font-weight: 600; color: var(--textMuted); }
.ld-hero.lent .bud-big { color: var(--income); }
.ld-hero.borrowed .bud-big { color: var(--orange); }
.ld-hero.done .bud-big { color: var(--textMuted); text-decoration: line-through; text-decoration-thickness: 2px; }
.ld-hero.lent .bud-bar span { background: linear-gradient(90deg, #2fbf86, var(--income)); }
.ld-due { margin-top: 8px; font-size: 13px; font-weight: 600; }
.ld-due.overdue { color: var(--danger); }
.ld-due.soon { color: color-mix(in srgb, var(--orange) 80%, var(--text)); }
.ld-due.done { color: var(--income); }
.ld-note { margin-top: 10px; font-size: 13.5px; font-style: italic; color: var(--textMuted); }
#ldBody .save-btn { margin-top: 14px; }
.ld-settle { display: block; width: 100%; margin-top: 10px; padding: 13px; font-weight: 700; }
.ld-hist { padding: 4px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.ld-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--surfaceBorder); }
.ld-row:first-child { border-top: 0; }
.ld-ic { flex: none; width: 10px; height: 10px; margin: 0 6px; border-radius: 50%; background: var(--textMuted); }
.ld-ic.in { background: var(--income); }
.ld-ic.done { background: var(--purple); }
.ld-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ld-main b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ld-main small { font-size: 12px; color: var(--textMuted); }
.ld-delete { display: block; width: 100%; margin: 18px 0 8px; padding: 13px; font-weight: 700; color: var(--danger); }

/* Loan form */
.lf-body { padding-top: 14px; }
.lf-seg { margin: 0 0 4px; }
.lf-seg[data-f="borrowed"] .all-seg-thumb { transform: translateX(100%); background: linear-gradient(135deg, var(--orange), var(--purple)); }
.lf-seg { grid-template-columns: 1fr 1fr; }
.lf-seg .all-seg-thumb { width: calc((100% - 8px) / 2); }
.lf-field { display: block; margin-top: 16px; }
.lf-label { display: block; margin: 0 4px 7px; font-size: 12px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--textMuted); }
.lf-label i { font-style: normal; font-weight: 600; text-transform: none; letter-spacing: 0; }
.lf-input {
  display: block; width: 100%; height: 48px; padding: 0 14px; border-radius: 16px; outline: 0;
  font: inherit; font-size: 16px; font-weight: 600; color: var(--text);
}
.lf-input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 30%, transparent); }
.lf-input::placeholder { color: var(--textMuted); font-weight: 500; }
input[type="date"].lf-input { -webkit-appearance: none; appearance: none; min-width: 0; }
.lf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lf-row .lf-field { min-width: 0; }
.lf-hint { margin: 8px 4px 0; font-size: 12px; line-height: 1.4; color: var(--textMuted); }
.pick-none { border-style: dashed !important; }
.lf-body .save-btn { margin: 18px 0 10px; }
#payEdit .lf-field { margin-top: 12px; }
.lf-field .picks { display: flex; flex-wrap: wrap; overflow: visible; margin: 0; padding-left: 0; padding-right: 0; }

/* ---------- Loan payment plans & reminders ---------- */
/* Reminder cards at the top of Home */
.reminders { display: grid; gap: 10px; margin-bottom: 14px; }
.reminders[hidden] { display: none; }
.rem-card {
  padding: 12px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--surfaceBorder);
  box-shadow: 0 14px 30px -16px var(--shadow), inset 3px 0 0 var(--orange);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  animation: row-in 0.5s var(--ease-out);
}
.rem-card.lent { box-shadow: 0 14px 30px -16px var(--shadow), inset 3px 0 0 var(--income); }
.rem-card.late { box-shadow: 0 14px 30px -16px var(--shadow), inset 3px 0 0 var(--danger); }
.rem-main, .plan-day-main { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.rem-ic {
  flex: none; width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center;
  color: var(--orange); background: color-mix(in srgb, var(--orange) 15%, transparent);
}
.lent .rem-ic { color: var(--income); background: color-mix(in srgb, var(--income) 15%, transparent); }
.rem-ic .i { width: 20px; height: 20px; }
.rem-ic.small { width: 36px; height: 36px; border-radius: 12px; }
.rem-ic.small .i { width: 18px; height: 18px; }
.rem-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rem-text b { font-size: 14.5px; font-weight: 800; }
.rem-text small { font-size: 12px; color: var(--textMuted); }
.rem-card.late .rem-text small { color: var(--danger); font-weight: 600; }
.rem-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 10px; }
.rem-actions .pill { padding: 10px 8px; font-weight: 800; text-align: center; }
.rem-paid { color: #fff; background: linear-gradient(135deg, var(--purple), var(--blue)); }
.lent .rem-paid { background: linear-gradient(135deg, #2fbf86, var(--income)); }
.rem-whole { color: var(--purpleText); }

/* Planned payments in a day's list */
.plan-day { padding: 12px 0; border-top: 1px solid var(--surfaceBorder); }
#todayList > .plan-day:first-child, #calDayList > .plan-day:first-child { border-top: 0; }
.plan-day.paid .rem-text b { text-decoration: line-through; color: var(--textMuted); }
.plan-day.missed .rem-text small { color: var(--danger); font-weight: 600; }

/* The plan on a loan's page */
.plan-box { padding: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.plan-head b { font-size: 15px; font-weight: 800; }
.plan-head span { font-size: 12.5px; font-weight: 700; color: var(--textMuted); }
.plan-sub { margin: 3px 0 8px; font-size: 12.5px; color: var(--textMuted); }
.plan-rows { max-height: 300px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.plan-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid var(--surfaceBorder); }
.plan-row:has(.plan-paid) { grid-template-columns: 1fr auto auto auto; }
.plan-date { font-size: 13.5px; font-weight: 600; }
.plan-amt { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-tag { min-width: 64px; text-align: right; font-size: 11.5px; font-weight: 700; color: var(--textMuted); }
.plan-row.paid .plan-tag { color: var(--income); }
.plan-row.paid .plan-date, .plan-row.paid .plan-amt { color: var(--textMuted); text-decoration: line-through; }
.plan-row.missed .plan-tag { color: var(--danger); }
.plan-row.due .plan-tag { color: var(--purpleText); }
.plan-row .plan-tag:empty { display: none; }
.plan-paid { padding: 7px 14px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--purple), var(--blue)); }
.plan-whole { display: block; width: 100%; margin-top: 10px; padding: 12px; font-weight: 800; color: var(--purpleText); }

/* Calendar: a ring on loan payment days */
.cal-plan {
  position: absolute; top: 6px; left: 6px; width: 7px; height: 7px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--orange);
}
.cal-plan.paid { box-shadow: none; background: var(--textMuted); opacity: 0.6; }
.cal-day[aria-pressed="true"] .cal-plan { box-shadow: inset 0 0 0 2px #fff; }
.cal-day.ahead { opacity: 0.85; }
.cal-day.ahead .cal-num { color: var(--textMuted); }
.cal-key[hidden] { display: none; }
.key-plan { width: 9px !important; height: 9px !important; border-radius: 50% !important; box-shadow: inset 0 0 0 2px var(--orange); }

/* Loan form: plan switch */
.lf-plan { margin-top: 16px; padding: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.lf-toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.lf-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lf-switch {
  position: relative; flex: none; width: 46px; height: 28px; border-radius: 99px; background: var(--track);
  transition: background 0.25s ease;
}
.lf-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); transition: transform 0.3s var(--ease-out);
}
.lf-toggle input:checked + .lf-switch { background: linear-gradient(135deg, var(--purple), var(--blue)); }
.lf-toggle input:checked + .lf-switch::after { transform: translateX(18px); }
.lf-toggle input:focus-visible + .lf-switch { box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 35%, transparent); }
.lf-toggle-text { display: flex; flex-direction: column; gap: 1px; }
.lf-toggle-text b { font-size: 14.5px; font-weight: 800; }
.lf-toggle-text small { font-size: 12px; color: var(--textMuted); }
.lf-plan-body { margin-top: 4px; }
.lf-plan-body[hidden] { display: none; }
.lf-plan .lf-field { margin-top: 12px; }
.lf-plan .money-field.small { height: 48px; }
.lf-field[hidden] { display: none; }
.lf-every { margin: 0; }
.lf-every button { font-size: 12.5px; }
.lf-every[data-f="week"] .all-seg-thumb { transform: translateX(100%); }
.lf-every[data-f="month"] .all-seg-thumb { transform: translateX(200%); }
.lf-plan-preview { margin: 12px 2px 0; font-size: 12.5px; line-height: 1.45; color: var(--textMuted); }
.lf-plan-preview b { color: var(--text); }
.lf-row:has(#lfDueField[hidden]) { grid-template-columns: 1fr; }

/* ---------- Mini statement ---------- */
.mini-share { display: flex; align-items: center; gap: 5px; }
.mini-share .i { width: 17px; height: 17px; stroke-width: 2.2; }
.mini-picks { display: flex; overflow-x: auto; margin: 14px -16px 2px; padding: 2px 16px 4px; scrollbar-width: none; }
.mini-picks::-webkit-scrollbar { display: none; }
.mini-list { padding-top: 8px; }
.mini-hero {
  padding: 16px 18px; border-radius: 24px; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 18px 34px -16px var(--purple);
}
.mini-hero .acct-hero-top p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-bal-label { margin-top: 8px; font-size: 12.5px; opacity: 0.8; }
.mini-bal { font-size: 32px; font-weight: 800; letter-spacing: -1px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.mini-inout { display: flex; gap: 16px; margin-top: 10px; font-size: 12.5px; opacity: 0.9; }
.mini-inout b { font-variant-numeric: tabular-nums; }
.mini-when { margin-top: 6px; font-size: 11.5px; opacity: 0.7; }
.mini-rows { border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.mini-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; text-align: left; border-top: 1px solid var(--surfaceBorder); }
.mini-row:first-child { border-top: 0; }
.mini-row:active { background: color-mix(in srgb, var(--text) 5%, transparent); }
.mini-date { flex: none; width: 36px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.mini-date b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mini-date small { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--textMuted); }
.mini-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mini-main b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-main small { font-size: 12px; color: var(--textMuted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mini-amt b { font-size: 14.5px; font-weight: 800; }
.mini-amt b.in { color: var(--income); }
.mini-amt small { font-size: 11.5px; color: var(--textMuted); }
.mini-more { display: block; width: 100%; margin-top: 12px; padding: 13px; font-weight: 700; color: var(--purpleText); }
.toast-btn[hidden] { display: none; }
.share-text {
  display: block; width: 100%; padding: 12px 14px; border-radius: 16px; resize: none; outline: 0;
  font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; color: var(--text);
}

/* ---------- Statement ---------- */
.st-list { padding-top: 8px; }
.st-period { display: flex; flex-direction: column; align-items: stretch; }
.st-month { margin: 6px 0 0; }
.st-month[hidden], .st-range[hidden] { display: none; }
.st-range .lf-field { margin-top: 4px; }
.st-custom { align-self: center; margin-top: 2px; padding: 8px 4px; font-size: 13px; text-align: center; }
.st-picks { margin-top: 2px; }
.st-summary { margin-top: 8px; padding: 16px; border-radius: 24px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.st-grid div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-grid small { font-size: 12px; font-weight: 600; color: var(--textMuted); }
.st-grid b { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-grid b.in { color: var(--income); }
.st-grid b.out { color: var(--orange); }
.st-note { margin-top: 12px; font-size: 12.5px; color: var(--textMuted); }
.st-box { padding: 6px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.st-cat { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--surfaceBorder); }
.st-cat:first-child { border-top: 0; }
.st-cat .row-ic { width: 38px; height: 38px; border-radius: 12px; }
.st-cat .row-ic .i { width: 19px; height: 19px; }
.st-cat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.st-cat-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.st-cat-top b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-cat-top span { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-cat-bar { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; }
.st-cat-bar i { display: block; height: 100%; border-radius: inherit; background: var(--tint); }
.st-cat small { font-size: 11.5px; color: var(--textMuted); }
.st-line { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid var(--surfaceBorder); font-size: 14px; }
.st-line:first-child { border-top: 0; }
.st-line b { font-weight: 800; font-variant-numeric: tabular-nums; }
.st-line b.in { color: var(--income); }
.st-actions { flex: none; display: grid; grid-template-columns: auto 1fr; gap: 10px; padding-top: 10px; }
.st-actions .pill, .st-actions .save-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; }
.st-actions .pill { padding: 0 18px; height: 56px; border-radius: 20px; font-weight: 800; }
.st-actions .i { width: 19px; height: 19px; }
.st-actions button:disabled { opacity: 0.45; }


/* Mini statement: a row opens to show the exact time */
.mini-item { border-top: 1px solid var(--surfaceBorder); }
.mini-item:first-child { border-top: 0; }
.mini-item .mini-row { border-top: 0; }
.mini-item.open { background: color-mix(in srgb, var(--purple) 6%, transparent); }
.mini-detail { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px 12px 62px; }
.mini-detail[hidden] { display: none; }
.mini-time { font-size: 12.5px; color: var(--textMuted); }
.mini-time b { font-size: 14px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }
.mini-detail .pill { flex: none; padding: 8px 12px; font-size: 12.5px; font-weight: 700; color: var(--purpleText); }

/* Statement: dates */
.st-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.st-range .lf-field { margin-top: 12px; }
.st-days { margin: 8px 4px 2px; font-size: 12.5px; font-weight: 700; color: var(--textMuted); }
.st-days.over { color: var(--orange); }
.st-email { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 10px; padding: 22px 18px 14px; text-align: center; border-radius: 24px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.st-email b { font-size: 17px; font-weight: 800; }
.st-email p { max-width: 320px; font-size: 13.5px; line-height: 1.45; color: var(--textMuted); }
.st-email .save-btn { margin-top: 8px; opacity: 0.5; }
.st-soon { position: static; }
.st-email .link-btn { margin-top: 4px; text-align: center; font-size: 13.5px; }
.st-list { overflow-x: hidden; } .st-list .st-picks { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }

/* ---------- Goals ---------- */
.goal-list { padding-top: 12px; }
.goal-cards { display: grid; gap: 10px; }
.goal-ic {
  flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  color: var(--tint); background: color-mix(in srgb, var(--tint) 16%, transparent);
}
.goal-ic .i { width: 21px; height: 21px; }
.goal-ic.big { width: 56px; height: 56px; border-radius: 18px; }
.goal-ic.big .i { width: 28px; height: 28px; }
.goal-card {
  display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 14px; border-radius: 22px; text-align: left;
  background: var(--surface); border: 1px solid var(--surfaceBorder); transition: transform 0.15s ease;
}
.goal-card:active { transform: scale(0.98); }
.goal-card.done { opacity: 0.8; }
.goal-top { display: flex; align-items: center; gap: 12px; }
.goal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.goal-main b { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-main small { font-size: 12px; color: var(--textMuted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-main small.behind, .goal-main small.late { color: color-mix(in srgb, var(--orange) 80%, var(--text)); font-weight: 600; }
.goal-main small.done { color: var(--income); font-weight: 700; }
.goal-pct { font-size: 17px; font-weight: 800; color: var(--tint); font-variant-numeric: tabular-nums; }
.goal-bar { display: block; position: relative; height: 9px; border-radius: 99px; background: var(--track); overflow: hidden; }
.goal-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--tint) 65%, #fff), var(--tint)); transition: width 0.6s var(--ease-out); }
.goal-nums { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--textMuted); font-variant-numeric: tabular-nums; }
.goal-nums span:first-child { font-weight: 700; color: var(--text); }

/* One goal */
.goal-hero { margin-top: 12px; padding: 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.goal-hero-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.goal-ring {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--tint) calc(var(--p) * 1%), var(--track) 0);
}
.goal-ring span {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  font-size: 14px; font-weight: 800; color: var(--tint); background: var(--sheet);
}
.goal-hero .bud-big { color: var(--text); }
.goal-hero.done .bud-big { color: var(--income); }
.goal-hero .goal-bar { margin-top: 2px; }
.goal-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 14px; }
.goal-actions .save-btn { margin: 0; }
.goal-actions .pill { padding: 0 20px; height: 56px; border-radius: 20px; font-weight: 800; }
.goal-actions .pill:disabled { opacity: 0.45; }

/* Icon picker in the form */
.goal-icons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.goal-icon-opt {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px 8px; border-radius: 16px;
  color: var(--tint); background: var(--surface); border: 1.5px solid var(--surfaceBorder); transition: border-color 0.2s ease;
}
.goal-icon-opt .i { width: 22px; height: 22px; }
.goal-icon-opt span { font-size: 10.5px; font-weight: 700; line-height: 1.2; color: var(--textMuted); text-align: center; }
.goal-icon-opt[aria-checked="true"] { border-color: var(--tint); background: color-mix(in srgb, var(--tint) 12%, var(--surface)); }
.goal-icon-opt[aria-checked="true"] span { color: var(--text); }
.lf-field[hidden] { display: none; }

/* Home: goals bar */
.home-goal { margin-top: 10px; }
.home-goal .goal-bar { height: 10px; }
.hb-more { margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--purpleText); }

/* ---------- Coming soon: a see-through layer on hover (or on tap, on phones) ---------- */
.menu-item.soon { overflow: hidden; }
.menu-item.soon::after {
  content: 'Coming soon'; position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit;
  font-size: 14px; font-weight: 800; letter-spacing: 0.2px; color: var(--text);
  background: color-mix(in srgb, var(--sheet) 62%, transparent);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  opacity: 0; transition: opacity 0.25s ease; pointer-events: none;
}
@media (hover: hover) { .menu-item.soon:hover::after { opacity: 1; } }
.menu-item.soon.peek::after { opacity: 1; }
.hb-sub { flex-wrap: wrap; row-gap: 2px; } .hb-sub span { white-space: nowrap; }

/* Bank logos: no outline around the logo. In light mode the logo sits straight on the card;
   in dark mode it keeps its white backing so dark logos stay readable. */
.logo-plate { box-shadow: none; }
.logo-plate.stack { box-shadow: 0 0 0 2px var(--sheet), 0 4px 10px -4px var(--shadow); }
html[data-surface="light"] .logo-plate:not(.stack):not(.nologo) { background: transparent; }

/* Home: loans bar */
.home-loan.late { box-shadow: 0 18px 40px -14px var(--shadow), inset 3px 0 0 var(--danger); }
.hb-due.overdue { color: var(--danger); font-weight: 700; }
.hb-due.soon { color: color-mix(in srgb, var(--orange) 80%, var(--text)); font-weight: 700; }

/* Sheets: swiping inside them never scrolls the page behind */
.sheet, .picker-sheet, .more-list, .add-panel, .setup-body { overscroll-behavior: contain; }
.sheet-backdrop, .picker, .quick { touch-action: none; }
.picker-sheet { touch-action: pan-y; }
.sheet .sheet-handle, .picker-sheet .sheet-handle { cursor: grab; }

/* ---------- Insights (bottom tab) ---------- */
/* Chart colours: one accent + a grey for comparison, checked with the dataviz validator (light and dark) */
:root { --chAccent: #7c5cff; --chBase: #85829f; }
html[data-surface="dark"] { --chAccent: #8f72ff; --chBase: #6a6699; }
.ins-sheet { z-index: 18; } /* under the bottom bar (20), so the tabs stay visible */
.ins-panel { padding-bottom: calc(env(safe-area-inset-bottom) + 100px); }
.ins-body { padding-top: 6px; }
.ins-hero { padding: 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.ins-label { font-size: 13.5px; font-weight: 600; color: var(--textMuted); }
.ins-big { margin: 4px 0 6px; font-size: 48px; font-weight: 800; letter-spacing: -1.6px; line-height: 1.05; }
.ins-big small { margin-right: 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.3px; color: var(--textMuted); }
.ins-delta { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--textMuted); }
.ins-delta.down .ins-arrow { color: var(--income); }
.ins-delta.up .ins-arrow { color: var(--orange); }
.ins-arrow { font-size: 10px; }
.ins-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.ins-tile { min-width: 0; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.ins-tile small { display: block; font-size: 11.5px; font-weight: 600; color: var(--textMuted); }
.ins-tile b { display: block; margin-top: 3px; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-tile b.neg { color: var(--orange); }
.ins-card { margin-top: 10px; padding: 14px; border-radius: 22px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.ins-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ins-card-head h4 { font-size: 15px; font-weight: 800; }
.ins-note { font-size: 12px; color: var(--textMuted); }
.ch-legend { display: flex; gap: 12px; font-size: 12px; color: var(--textMuted); }
.ch-legend span { display: flex; align-items: center; gap: 5px; }
.key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; background: var(--chAccent); }
.key.base { background: var(--chBase); }
.ch-wrap { position: relative; }
.ch { display: block; width: 100%; height: auto; overflow: visible; }
.ch-grid { stroke: var(--surfaceBorder); stroke-width: 1; }
html[data-surface="light"] .ch-grid { stroke: rgba(30, 30, 80, 0.09); }
.ch-tick { font-size: 10.5px; fill: var(--textMuted); font-variant-numeric: tabular-nums; }
.ch-val { font-size: 11px; font-weight: 700; fill: var(--text); }
.ch-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-line.accent { stroke: var(--chAccent); }
.ch-line.base { stroke: var(--chBase); }
.ch-area { fill: var(--chAccent); opacity: 0.1; }
.ch-dot { fill: var(--chAccent); stroke: var(--sheet); stroke-width: 2; }
.ch-cross { stroke: var(--textMuted); stroke-width: 1; opacity: 0; }
.ch-hdot { stroke: var(--sheet); stroke-width: 2; opacity: 0; }
.ch-hdot.accent { fill: var(--chAccent); }
.ch-hdot.base { fill: var(--chBase); }
.hovering .ch-cross, .hovering .ch-hdot { opacity: 1; }
.ch-hit, .ch-hitcol { fill: transparent; cursor: crosshair; }
.ch-hitcol.on { fill: color-mix(in srgb, var(--text) 6%, transparent); }
.ch-col { fill: var(--chAccent); }
.ch-col.future { opacity: 0.4; }
.ch-tip {
  position: absolute; top: -6px; z-index: 2; display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: 12px;
  font-size: 12px; white-space: nowrap; pointer-events: none;
  background: var(--sheet); color: var(--text); box-shadow: 0 8px 24px -8px var(--shadow), 0 0 0 1px var(--surfaceBorder);
  transform: translateY(-100%);
}
.ch-tip[hidden] { display: none; }
.ch-tip b { font-size: 12px; }
.ch-tip span { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
/* Ranked bars (one hue) */
.rk { padding: 4px 14px; }
.rk-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; text-align: left; border-top: 1px solid var(--surfaceBorder); }
.rk-row:first-child { border-top: 0; }
.rk-ic { width: 36px; height: 36px; border-radius: 12px; flex: none; }
.rk-ic .i { width: 18px; height: 18px; }
.rk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rk-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.rk-top b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-top span { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; }
.rk-top small { font-weight: 600; color: var(--textMuted); }
.rk-bar { height: 8px; border-radius: 0 4px 4px 0; background: var(--track); overflow: hidden; }
.rk-bar i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--chAccent); }
.ins-place { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; text-align: left; border-top: 1px solid var(--surfaceBorder); }
.ins-place:first-child { border-top: 0; padding-top: 2px; }
.ins-place .rk-main { gap: 1px; }
.ins-place .rk-main b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-place .rk-main small { font-size: 12px; color: var(--textMuted); }
.ins-rank { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--textMuted); background: var(--track); }
.ins-amt { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ins-big-list { padding: 2px 14px; }
.ins-big-list > .row:first-child { border-top: 0; }

/* ---------- Import ---------- */
.imp-body { padding-top: 10px; }
.imp-sources { display: flex; flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
#impStart, #impPass, #impReview { margin-top: 14px; }
.imp-option { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 22px; cursor: pointer; }
label.imp-option { flex-direction: row; align-items: center; gap: 14px; }
.imp-ic { flex: none; width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: var(--purpleText); background: color-mix(in srgb, var(--purple) 14%, transparent); }
.imp-ic .i { width: 24px; height: 24px; }
.imp-text { display: flex; flex-direction: column; gap: 3px; }
.imp-text b { font-size: 15.5px; font-weight: 800; }
.imp-text small { font-size: 12.5px; line-height: 1.4; color: var(--textMuted); }
.imp-paste { cursor: default; }
.imp-paste .pill { align-self: flex-start; padding: 11px 18px; font-weight: 700; }
.imp-or { margin: 10px 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--textMuted); text-transform: uppercase; letter-spacing: 0.6px; }
.imp-busy { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 48px 0; color: var(--textMuted); font-size: 14px; }
.imp-busy[hidden], #impStart[hidden], #impPass[hidden], #impReview[hidden], .imp-foot[hidden] { display: none; }
.imp-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--track); border-top-color: var(--purple); animation: imp-spin 0.9s linear infinite; }
@keyframes imp-spin { to { transform: rotate(360deg); } }
.imp-summary { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.imp-summary b { font-size: 16px; font-weight: 800; }
.imp-summary small { font-size: 12.5px; color: var(--textMuted); }
.imp-tools { display: flex; justify-content: space-between; align-items: center; margin: 8px 2px 4px; font-size: 12.5px; font-weight: 600; color: var(--textMuted); }
.imp-tools .link-btn { text-align: left; padding: 8px 0; }
.imp-list { border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.imp-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--surfaceBorder); }
.imp-row:first-child { border-top: 0; }
.imp-row:not(.on) .imp-main, .imp-row:not(.on) .imp-amt { opacity: 0.5; }
.imp-check { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: transparent; box-shadow: inset 0 0 0 2px var(--surfaceBorder); background: var(--track); }
.imp-row.on .imp-check { color: #fff; background: var(--purple); box-shadow: none; }
.imp-check .i { width: 15px; height: 15px; stroke-width: 3; }
.imp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.imp-main b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-main small { font-size: 12px; color: var(--textMuted); }
.imp-row.dup .imp-main small { color: color-mix(in srgb, var(--orange) 80%, var(--text)); }
.imp-cat { align-self: flex-start; display: flex; align-items: center; gap: 5px; margin-top: 3px; padding: 4px 9px 4px 6px; border-radius: 99px; font-size: 11.5px; font-weight: 700; color: var(--text); background: color-mix(in srgb, var(--tint) 14%, transparent); }
.imp-cat .i { width: 14px; height: 14px; color: var(--tint); }
.imp-amt { flex: none; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.imp-amt.in { color: var(--income); }
.imp-foot { flex: none; padding-top: 8px; }
.imp-foot .save-btn { margin: 0; }
.imp-foot .save-btn:disabled { opacity: 0.45; }
#impText { font: 500 14px/1.45 inherit; font-family: inherit; }
.imp-row.own .imp-main small, .imp-own-note { color: var(--purpleText) !important; }
.imp-warn { color: color-mix(in srgb, var(--orange) 80%, var(--text)) !important; font-weight: 600; }

/* ---------- Transfers between your own accounts ---------- */
.row-amt.move { color: var(--textMuted); }
.xfer-sheet .lf-field { margin-top: 10px; }
.xfer-sheet .picks { display: flex; flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.xfer-sheet .pick:disabled { opacity: 0.35; }
.xfer-swap { display: grid; place-items: center; width: 40px; height: 40px; margin: 6px auto -4px; border-radius: 50%; color: var(--purpleText); background: var(--track); }
.xfer-swap .i { width: 19px; height: 19px; }
.xfer-sheet .bud-input { margin-top: 14px; }
.acct-move { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 13px; font-weight: 700; color: var(--purpleText); }
.acct-move .i { width: 18px; height: 18px; }
.imp-move { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; margin-top: 3px; padding: 4px 9px 4px 6px; border-radius: 99px; font-size: 11.5px; font-weight: 700; color: var(--text); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.imp-move .i { width: 14px; height: 14px; color: var(--purpleText); }
.imp-amt.move { color: var(--textMuted); }

/* ---------- You page ---------- */
.you-profile { display: flex; align-items: center; gap: 14px; margin: 2px 0 6px; }
.you-avatar {
  position: relative; flex: none; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  font-size: 28px; font-weight: 800; color: #fff; overflow: visible;
  background: linear-gradient(135deg, var(--orange), var(--purple) 60%, var(--blue));
  box-shadow: 0 10px 24px -10px var(--purple);
}
.you-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.you-avatar img[hidden], .you-avatar span[hidden] { display: none; }
.you-cam {
  position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text); background: var(--sheet); box-shadow: 0 2px 8px -2px var(--shadow), 0 0 0 1px var(--surfaceBorder);
}
.you-cam .i { width: 14px; height: 14px; }
.you-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.you-name {
  width: 100%; padding: 4px 0; border: 0; outline: 0; background: none; color: var(--text);
  font: inherit; font-size: 22px; font-weight: 800; letter-spacing: -0.4px; border-bottom: 1.5px dashed transparent;
}
.you-name:focus { border-bottom-color: var(--purple); }
.you-name::placeholder { color: var(--textMuted); }
.you-id small { font-size: 12.5px; color: var(--textMuted); }
.you-photo-remove { align-self: flex-start; padding: 4px 0; font-size: 12.5px; text-align: left; }
.you-photo-remove[hidden] { display: none; }
.sheet .sheet-h { margin-top: 22px; }
.you-backup { display: flex; flex-wrap: wrap; gap: 8px; }
.you-backup .pill { padding: 12px 16px; font-weight: 700; cursor: pointer; }
.set-list { border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--surfaceBorder); margin-top: 10px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 58px; padding: 11px 14px; text-align: left; border-top: 1px solid var(--surfaceBorder); }
.set-row:first-child { border-top: 0; }
.set-row[hidden] { display: none; }
.set-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.set-text b { font-size: 14.5px; font-weight: 700; }
.set-text small { font-size: 12px; line-height: 1.35; color: var(--textMuted); }
.set-row.lf-toggle { cursor: pointer; }
.set-row .lf-switch { order: 2; }
.set-row .chev { width: 18px; height: 18px; color: var(--textMuted); }
.set-row.danger b { color: var(--danger); }
.set-seg { flex: none; width: 116px; height: 36px; }
.tools summary { list-style: none; cursor: pointer; }
.tools summary::-webkit-details-marker { display: none; }
.tools summary::after { content: '›'; margin-left: auto; font-size: 18px; color: var(--textMuted); transition: transform 0.2s ease; }
.tools[open] summary::after { transform: rotate(90deg); }
details.tools { margin-top: 22px; }
.you-about { margin-top: 18px; text-align: center; font-size: 11.5px; color: var(--textMuted); }

/* ---------- App lock ---------- */
.lock-screen {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 20px) 24px calc(env(safe-area-inset-bottom) + 20px);
  background: linear-gradient(180deg, var(--bgTop), var(--bgMid) 50%, var(--bgBottom));
}
.lock-screen[hidden] { display: none; }
body.locked { overflow: hidden; }
.lock-box { width: min(340px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; }
.lock-avatar {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; margin-bottom: 14px;
  font-size: 30px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--orange), var(--purple) 60%, var(--blue));
}
.lock-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lock-box h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.lock-hint { min-height: 20px; margin-top: 4px; font-size: 13.5px; color: var(--textMuted); }
.lock-dots { display: flex; gap: 16px; margin: 22px 0 8px; }
.lock-dots i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--textMuted); transition: background 0.15s ease, box-shadow 0.15s ease; }
.lock-dots i.on { background: var(--purple); box-shadow: none; }
.lock-dots.bad i { box-shadow: inset 0 0 0 2px var(--danger); }
.lock-dots.shake { animation: nudge 0.4s ease; }
.lock-pad { width: 100%; margin-top: 16px; }
.lock-pad button { height: 64px; font-size: 24px; }
.lock-link { margin-top: 14px; text-align: center; font-size: 14px; }

/* ---------- Notification centre ---------- */
.bell { position: relative; }
.bell-badge {
  position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: var(--danger);
  box-shadow: 0 0 0 2px var(--sheet);
}
.bell-badge[hidden] { display: none; }
.nt-list { padding-top: 6px; }
.nt-row { position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; margin-bottom: 8px; padding: 12px 14px; border-radius: 20px; text-align: left; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.nt-row.unread { border-color: color-mix(in srgb, var(--purple) 45%, var(--surfaceBorder)); background: color-mix(in srgb, var(--purple) 6%, var(--surface)); }
.nt-ic { flex: none; width: 40px; height: 40px; border-radius: 14px; }
.nt-ic .i { width: 20px; height: 20px; }
.nt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nt-main b { font-size: 14.5px; font-weight: 800; }
.nt-body { font-size: 13.5px; line-height: 1.4; color: var(--text); opacity: 0.85; }
.nt-main small { font-size: 11.5px; color: var(--textMuted); }
.nt-dot { position: absolute; top: 14px; right: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--purple); }

/* For testing → Look */
.tools-sub { margin: 4px 0 8px; font-size: 13px; font-weight: 700; }
#osLook .pill[aria-pressed="true"] { color: #fff; background: linear-gradient(135deg, var(--orange), var(--purple)); }
#osLookNote { margin: 8px 0 16px; }

/* ---------- The Anchor logo (replaces the old glowing orb everywhere .loader-logo is used) ---------- */
.loader-logo {
  background: url(../icons/logo-256.png) center / contain no-repeat; border-radius: 22.2%;
  box-shadow: 0 18px 36px -14px rgba(40, 30, 140, 0.55);
}
.loader-logo > .logo-core, .loader-logo > .logo-glass { display: none; }
.loader.run .loader-logo { animation: logo-float 3.2s ease-in-out infinite; }
@keyframes logo-float { 50% { transform: translateY(-6px); } }

/* ---------- Notification centre tabs, bank messages ---------- */
.nt-tabs-wrap { padding: 2px 0 6px; }
.nt-tabs { grid-template-columns: 1fr 1fr 1fr; height: 38px; }
.mini-seg.three { grid-template-columns: 1fr 1fr 1fr; }
.set-seg.three { width: 168px; }
.set-seg.three button { font-size: 12px; }
.logo-plate.nt-logo { width: 46px; height: 40px; padding: 5px; border-radius: 13px; }
.logo-plate.nt-logo.nologo::after { width: 26px; height: 26px; font-size: 13px; border-radius: 8px; }
.bk-row.unread .bk-title { padding-right: 14px; }
.bk-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bk-title > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-amt { flex: none; font-size: 14.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bk-amt.in { color: var(--income); }
.bk-amt.out { color: var(--text); }
.bk-msg { font-size: 12.5px; line-height: 1.4; color: var(--textMuted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bk-msg.open { -webkit-line-clamp: unset; }
.bk-st { font-weight: 700; }
.bk-st.ok { color: var(--income); }
.bk-st.warn { color: var(--orange); }
.nt-main small.bk-note { color: var(--text); opacity: 0.75; }
.bk-body { padding-bottom: 32px; }
.bk-card { margin-bottom: 8px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--surfaceBorder); }
.set-row.bk-card { width: 100%; text-align: left; }
.bk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bk-two .bk-card { margin: 0; align-items: flex-start; }
.bk-setup { margin-top: 8px; }
.bk-url { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 10px 10px 10px 12px; border-radius: 14px; background: var(--track); }
.bk-url code { flex: 1; min-width: 0; font-size: 11.5px; word-break: break-all; color: var(--text); }
.bk-steps { margin: 0; padding-left: 20px; display: grid; gap: 9px; font-size: 13.5px; line-height: 1.45; }
.bk-small { margin: 10px 2px 0; font-size: 12px; line-height: 1.45; color: var(--textMuted); }
.bk-try { width: 100%; min-height: 76px; resize: vertical; font-size: 13.5px; }
.bk-connect { display: block; margin-top: 14px; text-align: center; text-decoration: none; }
