@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;450;500;550;600;650;700;750;800&display=swap");

/* -- Design Tokens ------- */
:root {
  font-family:
    Manrope,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
  color-scheme: light;
  --surface: #f7f5f0;
  --paper: #fffdf9;
  --ink: #242630;
  --muted: #6b6a72;
  --line: #e5e2db;
  --blue: #5146a5;
  --accent-soft: #eeebf7;
  --green: #397565;
  --red: #ac5045;
  --amber: #936624;
  --radius: 20px;
  color: var(--ink);
  background: var(--surface);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
  color: inherit;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #8d84c3;
  outline-offset: 4px;
}
a {
  color: var(--blue);
}
h1,
h2,
h3,
p {
  margin: 0;
}
button svg {
  flex-shrink: 0;
}
svg {
  display: block;
}
input,
select,
textarea {
  font-size: 16px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid #5146a526;
  outline-offset: 2px;
  border-color: var(--blue);
}
[hidden] {
  display: none !important;
}
strong,
b {
  font-weight: 700;
}
input[type="checkbox"] {
  accent-color: var(--blue);
}

/* -- Shell and Navigation ------- */
.app-shell {
  width: 100%;
  max-width: 1160px;
  min-height: 100dvh;
  margin: auto;
  position: relative;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 24px 24px;
  padding-top: max(28px, env(safe-area-inset-top));
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -1.4px;
  color: var(--ink);
  line-height: 1;
}
.brand img {
  display: block;
  object-fit: contain;
  width: 43px;
  height: 43px;
}
.brand-dot {
  color: var(--blue);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.demo-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 10px;
  background: #edeae4;
  border-radius: 30px;
}
.avatar,
.icon-btn,
.logout-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  flex-shrink: 0;
}
.logout-button {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 0;
}
.page {
  padding: 8px 24px calc(115px + env(safe-area-inset-bottom));
  min-width: 0;
}
.page-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 28px;
}
.page-heading h1 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -1.25px;
  font-weight: 750;
}
.eyebrow {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 9px;
}
.subtitle {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  margin-top: 10px;
}
.bottom-nav {
  position: fixed;
  z-index: 15;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  padding: 10px 8px max(12px, env(safe-area-inset-bottom));
  background: #fffdf9f5;
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.nav-btn {
  width: 24%;
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  background: transparent;
  border-radius: 14px;
}
.nav-btn.selected {
  color: var(--blue);
  background: var(--accent-soft);
}
.nav-btn svg {
  width: 21px;
  height: 21px;
}
.nav-note {
  display: none;
}

/* -- Budget Overview ------- */
.overview-layout {
  display: grid;
  gap: 24px;
}
.overview-primary,
.overview-secondary {
  min-width: 0;
}
.balance-card {
  padding: 25px 0 0;
  background: transparent;
  color: var(--ink);
}
.balance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 550;
}
.balance-head button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  border-radius: 50%;
  margin: -8px 0;
}
.balance-value {
  font-size: clamp(38px, 11.5vw, 64px);
  font-weight: 650;
  letter-spacing: -3px;
  line-height: 1.2;
  margin: 16px 0 12px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.balance-value span {
  font-size: 0.58em;
  color: #97949e;
  font-weight: 450;
  letter-spacing: -1px;
}
.daily {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}
.daily strong {
  color: var(--ink);
  font-weight: 650;
}
.balance-context {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  color: var(--green);
  margin-top: 15px;
}
.balance-context svg {
  flex-shrink: 0;
  margin-top: 2px;
}
.hero-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 27px;
  padding-top: 19px;
}
.hero-footer p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}
.hero-footer strong {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 25px 0;
}
.quick-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 52px;
  padding: 13px 10px;
  border-radius: 13px;
  background: var(--blue);
  color: white;
  font-size: 13px;
  font-weight: 650;
}
.quick-actions button:last-child {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}
.notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  text-align: left;
  width: 100%;
  padding: 17px;
  background: #f3edde;
  border: 1px solid #e8ddc4;
  border-radius: 15px;
}
.notice-icon {
  color: var(--amber);
  flex-shrink: 0;
  padding-top: 2px;
}
.notice h3 {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}
.notice p {
  font-size: 13px;
  color: #76674c;
  line-height: 1.6;
  margin-top: 5px;
}
.notice-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 650;
  color: var(--amber);
  margin-top: 10px;
}
.notice.success {
  background: #e8f0ea;
  border-color: #dce7df;
}
.notice.success p,
.notice.success .notice-icon,
.notice.success .notice-link {
  color: var(--green);
}
.upcoming-payment {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 22px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.upcoming-payment > div {
  flex: 1;
  min-width: 0;
}
.upcoming-payment p,
.upcoming-payment span:not(.neutral-icon) {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.upcoming-payment strong {
  display: block;
  font-size: 14px;
  margin: 3px 0;
  overflow-wrap: anywhere;
}
.upcoming-payment .text-btn {
  font-size: 13px;
  max-width: 42%;
  text-align: right;
  justify-content: flex-end;
}
.section-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 28px 0 13px;
}
.section-top h2 {
  font-size: 17px;
  letter-spacing: -0.5px;
  font-weight: 750;
}
.overview-secondary > .section-top {
  margin-top: 0;
}
.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 0;
  min-height: 44px;
  font-size: 13px;
  font-weight: 650;
  color: var(--blue);
  background: transparent;
  line-height: 1.5;
}
.fund-summary {
  border-top: 1px solid var(--line);
}
.fund-summary-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 76px;
  padding: 14px 0;
  background: transparent;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.fund-summary-row > span:not(.fund-icon) {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
}
.fund-summary-row strong {
  font-size: 14px;
  font-weight: 650;
  text-align: right;
  max-width: 43%;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.fund-summary-row > svg {
  color: #a39eae;
}
.fund-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--fund-tint, var(--accent-soft));
  color: var(--fund-color, var(--blue));
}
.track {
  height: 4px;
  border-radius: 5px;
  background: var(--line);
  overflow: hidden;
  margin-top: 18px;
}
.track span {
  display: block;
  height: 100%;
  background: var(--fund-color, var(--blue));
  border-radius: 5px;
}
.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-top: 9px;
}
.setup-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  text-align: left;
  border: 1px dashed #c9c3d7;
  background: transparent;
  padding: 18px;
  border-radius: 15px;
  margin: 24px 0 0;
}
.setup-card .assistant-symbol {
  width: 32px;
  height: 32px;
  margin: 0;
  flex-shrink: 0;
}
.setup-card strong {
  display: block;
  font-size: 14px;
  letter-spacing: -0.2px;
}
.setup-card small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 5px;
}
.setup-card b {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--blue);
  margin-top: 11px;
}
.setup-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
  margin-top: 15px;
}
.setup-mini svg:last-child {
  margin-left: auto;
}
.save-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
  margin: 0 0 22px;
}
.save-strip > span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.save-strip button {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 6px 0;
  color: var(--blue);
  background: transparent;
  font-size: 12px;
}

/* -- Lists and Funds ------- */
.list-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 16px;
  width: 100%;
  background: transparent;
  border-bottom: 1px solid var(--line);
  text-align: left;
  min-width: 0;
}
.list-row:last-child {
  border-bottom: 0;
}
.row-copy {
  flex: 1;
  min-width: 0;
}
.row-title {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.row-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 4px;
}
.row-number {
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  max-width: 45%;
  text-align: right;
  overflow-wrap: anywhere;
}
.row-number.positive {
  color: var(--green);
}
.neutral-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 37px;
  height: 37px;
  border-radius: 12px;
  background: #efede7;
  color: #78747f;
}
.row-arrow {
  color: #aaa4b1;
}
.fund-overview {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.fund-overview > p {
  font-size: 13px;
  color: var(--muted);
}
.fund-overview > strong {
  display: block;
  font-size: 38px;
  font-weight: 650;
  letter-spacing: -1.5px;
  margin: 7px 0 25px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.stacked-bar {
  display: flex;
  gap: 4px;
  height: 7px;
  border-radius: 8px;
  overflow: hidden;
}
.stacked-bar span {
  min-width: 0;
}
.fund-list {
  display: grid;
  gap: 12px;
}
.fund-full {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 21px;
  text-align: left;
  width: 100%;
  min-width: 0;
}
.fund-full-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fund-full .row-number {
  font-size: 17px;
  letter-spacing: -0.5px;
}
.fund-full-top > svg {
  color: #9991a5;
  flex-shrink: 0;
}
.percent-pill {
  font-size: 12px;
  background: var(--accent-soft);
  padding: 3px 6px;
  border-radius: 6px;
  margin-left: 4px;
  color: var(--blue);
}
.intro-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
  padding: 16px 0;
  line-height: 1.6;
}
.intro-strip svg {
  flex-shrink: 0;
}

/* -- Buttons, Forms and Sheets ------- */
.wide-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 14px;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 650;
  background: var(--blue);
  color: white;
  margin-top: 16px;
}
.wide-btn.secondary {
  background: var(--accent-soft);
  color: var(--blue);
}
.wide-btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
dialog {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  max-width: 520px;
  width: 100%;
  position: fixed;
  top: auto;
  bottom: 0;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 24px 100px #24263026;
  scroll-padding-top: 24px;
}
dialog::backdrop {
  background: #24263066;
  backdrop-filter: blur(5px);
}
.sheet-grip {
  width: 34px;
  height: 4px;
  background: #d8d3df;
  border-radius: 5px;
  margin: 11px auto 4px;
}
.sheet-inner {
  padding: 18px 24px max(28px, env(safe-area-inset-bottom));
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 23px;
}
.sheet-head h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.8px;
  min-width: 0;
}
.sheet-head h2:focus {
  outline: none;
}
.sheet-head .icon-btn {
  background: var(--surface);
  margin-top: -6px;
}
.sheet-copy {
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 20px;
}
.field-label,
.amount-label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.6;
  color: #55515e;
  margin: 18px 0 9px;
}
.field-input,
.field-select {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px;
  border: 1px solid #d9d4df;
  background: var(--surface);
  color: var(--ink);
  border-radius: 12px;
}
.field-input:focus,
.field-select:focus {
  background: var(--paper);
}
.amount-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0 18px;
  margin-bottom: 20px;
}
.amount-input {
  font-size: 42px;
  letter-spacing: -1.6px;
  font-weight: 600;
  border: 0;
  min-width: 0;
  width: 100%;
  background: transparent;
  color: var(--ink);
  border-radius: 4px;
  padding: 0;
}
.amount-wrap > span {
  font-size: 27px;
  color: #99939f;
}
.form-preview {
  margin-top: 22px;
}
.form-preview .list-row {
  padding: 13px 0;
}
.form-preview .fund-icon {
  width: 33px;
  height: 33px;
}
.preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
.preview-total {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
}
.preview-total strong {
  overflow-wrap: anywhere;
  min-width: 0;
}
.helper-box {
  background: #efede7;
  color: #645d6d;
  border-radius: 12px;
  padding: 15px;
  font-size: 13px;
  line-height: 1.75;
  margin-top: 18px;
}
.helper-box strong {
  color: var(--ink);
}
.form-error {
  color: var(--red);
  font-size: 14px;
  line-height: 1.6;
  margin-top: 14px;
  background: #f8eae5;
  border: 1px solid #edd1c8;
  border-radius: 10px;
  padding: 12px;
}
.form-error:empty {
  display: none;
}
.success-symbol {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8f0ea;
  color: var(--green);
  margin: 12px auto 22px;
}
.success-screen {
  text-align: center;
  padding-bottom: 12px;
}
.success-screen h3 {
  font-size: 27px;
  letter-spacing: -0.8px;
  margin-bottom: 10px;
}
.success-screen > p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}
.success-screen .success-number {
  font-size: 37px;
  font-weight: 650;
  letter-spacing: -1.4px;
  color: var(--blue);
  margin-top: 19px;
  overflow-wrap: anywhere;
}
.detail-balance {
  font-size: 40px;
  letter-spacing: -1.5px;
  font-weight: 650;
  margin: 14px 0 5px;
  overflow-wrap: anywhere;
}
.detail-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.detail-buttons .wide-btn {
  font-size: 13px;
}
.detail-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 15px;
  font-size: 14px;
  line-height: 1.6;
  margin: 24px 0;
}
.detail-table dt {
  color: var(--muted);
}
.detail-table dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
  font-weight: 650;
}
.percent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.percent-row > label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
}
.percent-input {
  width: 60px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 11px 3px;
  text-align: center;
  color: var(--blue);
  font-weight: 700;
}
.percent-row > span {
  color: var(--muted);
}
.calculation-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  line-height: 1.7;
  margin: 16px 0;
}
.calculation-line span {
  color: var(--muted);
}
.calculation-line strong {
  overflow-wrap: anywhere;
}
.calculation-result {
  background: var(--accent-soft);
  padding: 20px;
  border-radius: 15px;
  margin: 23px 0 12px;
}
.calculation-result p {
  font-size: 13px;
  color: #68607e;
}
.calculation-result strong {
  display: block;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -1px;
  color: var(--blue);
  margin-top: 7px;
  overflow-wrap: anywhere;
}
.toast {
  position: fixed;
  z-index: 50;
  bottom: calc(100px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: calc(100% - 32px);
  max-width: 440px;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 14px;
  box-shadow: 0 8px 30px #24263020;
  font-size: 13px;
  line-height: 1.6;
}
.toast button {
  min-height: 44px;
  background: transparent;
  color: #cfc6ff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.empty-message {
  padding: 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}
.muted {
  color: var(--muted);
}
.danger-text {
  color: var(--red);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* -- Weekly Plan ------- */
.calendar {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-bottom: 26px;
}
.calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 8px;
  padding: 13px 0;
  border-radius: 12px;
  color: #5e5868;
  font-size: 15px;
}
.calendar-day span {
  font-size: 12px;
  color: var(--muted);
}
.calendar-day.today {
  background: var(--blue);
  color: white;
}
.calendar-day.today span {
  color: #e5dfff;
}
.calendar-day b {
  width: 4px;
  height: 4px;
  background: #b4abc6;
  border-radius: 50%;
}
.calendar-day.today b {
  background: white;
}
.plan-card {
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.plan-card .row-title {
  font-size: 16px;
}
.plan-caption {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 13px;
}
.plan-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 18px;
}
.plan-stats > div {
  min-width: 0;
}
.plan-stats p {
  font-size: 12px;
  color: var(--muted);
}
.plan-stats strong {
  display: block;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.6px;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.small-status {
  display: inline-block;
  padding: 5px 8px;
  font-size: 11px;
  border-radius: 6px;
  background: #f3edde;
  color: var(--amber);
  margin-top: 7px;
}
.small-status.ok {
  background: #e8f0ea;
  color: var(--green);
}
.timeline {
  border-left: 1px solid #d9d1df;
  margin-left: 7px;
  padding-left: 20px;
}
.timeline-item {
  position: relative;
  margin-bottom: 23px;
}
.timeline-item:before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border: 3px solid var(--surface);
  box-sizing: content-box;
  background: #b2a9c5;
  border-radius: 50%;
  top: 2px;
  left: -28px;
}
.timeline-date {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.timeline-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 17px;
  border-radius: 14px;
}
.timeline-card > div {
  min-width: 0;
  flex: 1 1 120px;
}
.timeline-card strong {
  font-size: 16px;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.timeline-card .text-btn {
  font-size: 13px;
}
.payment-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.payment-tools .text-btn {
  font-size: 12px;
}
.week-reviewed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--green);
  font-size: 13px;
  margin-top: 18px;
}
.page > section.helper-box {
  margin: 0 0 20px;
}
.page > section.helper-box p {
  margin-top: 8px;
}

/* -- Budget Explanations ------- */
.assistant-intro {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--line);
}
.assistant-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--accent-soft);
  color: var(--blue);
  border-radius: 13px;
  margin-bottom: 20px;
}
.assistant-intro h2 {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -1px;
  line-height: 1.3;
}
.assistant-intro p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 480px;
  margin-top: 15px;
}
.suggestions {
  display: grid;
  gap: 9px;
  margin: 22px 0;
}
.suggestions button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  font-size: 14px;
  line-height: 1.6;
  min-height: 55px;
}
.suggestions button svg {
  flex-shrink: 0;
  color: var(--blue);
}
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 22px 0;
}
.bubble {
  border: 1px solid var(--line);
  border-radius: 17px 17px 17px 4px;
  background: var(--paper);
  padding: 19px;
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.bubble.user {
  align-self: flex-end;
  border-radius: 17px 17px 4px 17px;
  background: var(--accent-soft);
  border-color: #dfd8ed;
  max-width: 90%;
}
.bubble-label {
  display: block;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
}
.chat-form {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 7px 7px 15px;
  background: var(--paper);
  border: 1px solid #d5cfdd;
  border-radius: 15px;
  margin-top: 22px;
}
.chat-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 10px 0;
}
.chat-form input:focus {
  outline: none;
}
.chat-form:focus-within {
  outline: 3px solid #5146a526;
}
.send-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: white;
  border-radius: 11px;
  flex-shrink: 0;
}
.demo-footnote {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
  margin-top: 15px;
}

/* -- Onboarding, Import and Scenarios ------- */
.step-track {
  display: flex;
  gap: 6px;
}
.step-track span {
  flex: 1;
  height: 4px;
  background: var(--line);
  border-radius: 4px;
}
.step-track .done {
  background: var(--blue);
}
.step-caption {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 25px;
}
.method-note {
  font-size: 14px;
  line-height: 1.75;
  margin: 20px 0;
  color: var(--muted);
}
.method-note summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--blue);
  min-height: 44px;
  padding: 10px 0;
}
.method-note p {
  margin: 10px 0;
}
.onboarding-summary {
  background: var(--accent-soft);
  color: var(--ink);
  border: 1px solid #ded8ef;
  padding: 22px;
  border-radius: 17px;
  margin-bottom: 22px;
}
.onboarding-summary p {
  font-size: 13px;
  color: #68607e;
  margin-bottom: 7px;
}
.onboarding-summary strong {
  display: block;
  font-size: 30px;
  letter-spacing: -1px;
  overflow-wrap: anywhere;
  margin-bottom: 18px;
}
.onboarding-summary strong:last-child {
  margin-bottom: 0;
}
.setup-funds {
  padding: 0 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 22px 0;
}
.setup-funds > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.setup-funds > div:last-child {
  border: 0;
}
.setup-funds strong {
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.setup-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.7;
  margin: 22px 0;
}
.setup-consent input {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}
.expense-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}
.expense-choices button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--blue);
  border-radius: 24px;
  padding: 11px 15px;
  min-height: 44px;
  font-size: 13px;
}
.setup-expense {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 15px;
  padding: 17px;
  margin: 22px 0;
  min-width: 0;
}
.setup-expense legend {
  font-size: 14px;
  font-weight: 650;
  padding: 0 8px;
  color: #55515e;
}
.setup-expense .setup-consent {
  margin: 16px 0;
}
.setup-expense .text-btn {
  color: var(--red);
}
.onboarding-actions {
  position: sticky;
  bottom: calc(-1 * max(28px, env(safe-area-inset-bottom)));
  background: var(--paper);
  border-top: 1px solid var(--line);
  margin: 24px -24px calc(-1 * max(28px, env(safe-area-inset-bottom)));
  padding: 12px 24px max(20px, env(safe-area-inset-bottom));
  z-index: 2;
}
.onboarding-actions .wide-btn {
  margin: 0;
}
.onboarding-actions .wide-btn + .wide-btn {
  margin-top: 7px;
  border: 0;
  min-height: 44px;
}
.scenario-banner {
  background: #efede7;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 18px;
  margin-bottom: 25px;
}
.scenario-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.scenario-top > span,
.scenario-top button {
  display: flex;
  align-items: center;
  gap: 6px;
}
.scenario-top button {
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  min-height: 44px;
}
.scenario-banner h2 {
  font-size: 18px;
  font-weight: 650;
  margin-top: 10px;
  letter-spacing: -0.4px;
}
.scenario-comparison {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 17px;
}
.scenario-comparison > div {
  min-width: 0;
}
.scenario-comparison p {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.scenario-comparison strong {
  font-size: 21px;
  letter-spacing: -0.6px;
  overflow-wrap: anywhere;
}
.scenario-comparison > svg {
  color: #8b829a;
  flex-shrink: 0;
}
.scenario-caption {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.75;
  margin-top: 14px;
}
.scenario-choices {
  display: grid;
  gap: 12px;
}
.scenario-choices button {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.scenario-choices button > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.scenario-choices strong {
  display: block;
  font-size: 15px;
}
.scenario-choices small {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 7px;
}
.scenario-choices button > svg {
  flex-shrink: 0;
  color: var(--blue);
  margin-top: 10px;
}
#statement-rows {
  max-height: 45dvh;
  overflow: auto;
}
input[type="date"],
select {
  max-width: 100%;
  min-width: 0;
}
input[type="file"] {
  white-space: normal;
  width: 100%;
}
.boot {
  padding-top: 75px;
  text-align: center;
  max-width: 460px;
  margin: auto;
}
.boot .brand {
  margin-bottom: 40px;
}
.boot h1 {
  font-size: 26px;
  letter-spacing: -0.7px;
  margin-top: 24px;
}
.boot .wide-btn {
  margin-top: 22px;
}
.loading-ring {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  margin: auto;
  animation: spin 0.85s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* -- Account Entry ------- */
.auth-shell {
  max-width: 1120px;
  min-height: 100dvh;
  margin: auto;
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
}
.auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.auth-header > span:not(.brand) {
  font-size: 12px;
  color: var(--muted);
}
.auth-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: center;
  flex: 1;
  padding: 60px 0;
}
.auth-kicker {
  font-size: 14px;
  color: var(--blue);
  font-weight: 600;
}
.auth-intro h1 {
  font-size: clamp(48px, 6.8vw, 82px);
  font-weight: 600;
  letter-spacing: -4px;
  line-height: 1.02;
  margin: 24px 0 18px;
}
.auth-translation {
  font-size: 18px;
  color: #5d5967;
  letter-spacing: -0.5px;
}
.auth-description {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
  margin-top: 21px;
}
.auth-card {
  padding: 36px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
}
.auth-card h2 {
  font-size: 25px;
  letter-spacing: -0.9px;
  font-weight: 700;
  line-height: 1.25;
}
.auth-caption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 9px;
}
#auth-form {
  width: 100%;
  text-align: left;
  margin-top: 32px;
}
#auth-form .field {
  display: block;
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 19px;
  color: #56515f;
}
#auth-form input {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px;
  margin-top: 9px;
  border: 1px solid #d9d4df;
  background: var(--surface);
  border-radius: 11px;
  color: var(--ink);
  font-size: 14px;
}
#auth-form input::placeholder {
  color: #86808e;
  font-size: 12px;
}
#auth-error {
  font-size: 13px;
  line-height: 1.6;
  color: var(--red);
}
.auth-divider {
  margin: 30px 0 18px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}
.auth-footer {
  text-align: center;
  font-size: 11px;
  color: #79737f;
  padding: 20px 0 5px;
}
.auth-illustration {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 38px;
  max-width: 450px;
}
.illustration-fund {
  flex: 1;
  min-width: 0;
  padding: 15px 12px;
  background: #ebe7f2;
  border-radius: 12px 12px 4px 4px;
  min-height: 102px;
}
.illustration-fund:nth-child(2) {
  background: #e3eae1;
  min-height: 132px;
}
.illustration-fund:nth-child(3) {
  background: #ede4d6;
  min-height: 158px;
}
.illustration-fund span {
  display: block;
  font-size: 9px;
  line-height: 1.6;
  color: #64616a;
}
.illustration-fund b {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  margin-top: 9px;
  letter-spacing: -0.3px;
}
.illustration-fund i {
  display: block;
  height: 3px;
  width: 24px;
  background: currentColor;
  opacity: 0.25;
  margin-top: 16px;
  border-radius: 5px;
}

/* -- Responsive Layout and Motion ------- */
@media (min-width: 900px) {
  .app-shell {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    column-gap: 38px;
    padding: 0 28px;
  }
  .topbar {
    grid-column: 1/-1;
    padding: 32px 0 35px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 32px;
  }
  .page {
    grid-column: 2;
    grid-row: 2;
    padding: 0 0 65px;
  }
  .bottom-nav {
    grid-column: 1;
    grid-row: 2;
    position: sticky;
    top: 24px;
    bottom: auto;
    left: auto;
    align-self: start;
    width: auto;
    flex-direction: column;
    gap: 8px;
    padding: 0 0 24px;
    background: transparent;
    border: 0;
    backdrop-filter: none;
  }
  .nav-btn {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 13px 17px;
    min-height: 48px;
    font-size: 14px;
    border-radius: 11px;
  }
  .nav-note {
    display: block;
    padding: 30px 17px;
    font-size: 12px;
    line-height: 1.9;
    color: #8c8692;
  }
  .overview-layout {
    grid-template-columns: 1.15fr 1fr;
    gap: 35px;
  }
  .balance-card {
    padding-top: 0;
  }
  .balance-value {
    font-size: 57px;
  }
  .overview-secondary {
    padding-top: 4px;
  }
  .overview-secondary > .section-top {
    margin-top: 0;
    gap: 4px;
  }
  .overview-secondary > .section-top h2 {
    font-size: 15px;
  }
  .fund-summary-row {
    min-height: 69px;
  }
  .fund-summary-row strong {
    font-size: 13px;
  }
  .fund-list {
    grid-template-columns: 1fr 1fr;
  }
  .fund-full-top {
    flex-wrap: wrap;
  }
  .fund-full .row-number {
    margin-left: auto;
  }
  .fund-overview {
    padding: 30px;
  }
  .page-heading h1 {
    font-size: 34px;
  }
  .save-strip {
    margin-bottom: 22px;
  }
  .scenario-banner {
    padding: 18px 22px;
  }
  .scenario-comparison {
    justify-content: flex-start;
    gap: 30px;
  }
  .suggestions {
    grid-template-columns: repeat(3, 1fr);
  }
  .suggestions button {
    align-items: flex-start;
    font-size: 13px;
    flex-direction: column;
  }
  .calendar {
    max-width: 650px;
  }
  .fund-list + .wide-btn {
    max-width: 280px;
  }
  .fund-list ~ .wide-btn.secondary {
    max-width: 280px;
  }
  .toast {
    bottom: 25px;
  }
}
@media (min-width: 600px) {
  dialog {
    border-radius: 22px;
    top: 0;
    bottom: 0;
    margin: auto;
    height: fit-content;
    max-height: 90dvh;
  }
  .sheet-grip {
    display: none;
  }
  .sheet-inner {
    padding-top: 27px;
  }
}
@media (min-width: 600px) and (max-width: 899px) {
  .app-shell {
    max-width: 680px;
  }
  .page {
    padding-left: 32px;
    padding-right: 32px;
  }
  .topbar {
    padding-left: 32px;
    padding-right: 32px;
  }
  .overview-layout {
    grid-template-columns: 1fr 1fr;
    gap: 25px;
  }
  .balance-value {
    font-size: 45px;
  }
  .fund-summary-row {
    flex-wrap: wrap;
  }
  .fund-summary-row strong {
    margin-left: auto;
  }
  .auth-layout {
    gap: 32px;
  }
  .auth-intro h1 {
    font-size: 52px;
  }
  .auth-card {
    padding: 25px;
  }
  .auth-illustration {
    display: none;
  }
}
@media (max-width: 599px) {
  .auth-shell {
    padding: 25px 24px;
  }
  .auth-header > span:not(.brand) {
    display: none;
  }
  .auth-layout {
    display: block;
    padding: 35px 0 15px;
  }
  .auth-intro h1 {
    font-size: 43px;
    letter-spacing: -2px;
    line-height: 1.12;
    margin: 14px 0 10px;
    max-width: 340px;
  }
  .auth-intro h1 br {
    display: none;
  }
  .auth-intro h1 br:after {
    content: " ";
  }
  .auth-kicker {
    font-size: 12px;
  }
  .auth-translation {
    font-size: 16px;
  }
  .auth-description,
  .auth-illustration {
    display: none;
  }
  .auth-card {
    margin-top: 30px;
    padding: 25px 22px;
    border-radius: 20px;
  }
  .auth-card h2 {
    font-size: 23px;
  }
  .auth-caption {
    font-size: 12px;
  }
  .auth-footer {
    padding-top: 18px;
  }
  #auth-form {
    margin-top: 26px;
  }
  #auth-form input {
    font-size: 16px;
  }
  .auth-intro h1 {
    white-space: normal;
  }
}
@media (max-width: 365px) {
  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }
  .page {
    padding-left: 18px;
    padding-right: 18px;
  }
  .brand {
    font-size: 24px;
  }
  .brand img {
    width: 36px;
    height: 36px;
  }
  .demo-tag {
    font-size: 10px;
    padding: 6px 8px;
  }
  .header-right {
    gap: 3px;
  }
  .avatar {
    width: 38px;
    height: 38px;
  }
  .page-heading h1 {
    font-size: 27px;
  }
  .balance-value {
    font-size: 43px;
    letter-spacing: -2px;
  }
  .quick-actions {
    gap: 7px;
  }
  .quick-actions button {
    font-size: 12px;
    padding-left: 7px;
    padding-right: 7px;
  }
  .sheet-inner {
    padding-left: 18px;
    padding-right: 18px;
  }
  .onboarding-actions {
    margin-left: -18px;
    margin-right: -18px;
    padding-left: 18px;
    padding-right: 18px;
  }
  .fund-full {
    padding: 16px;
  }
  .fund-full-top {
    gap: 8px;
    flex-wrap: wrap;
  }
  .fund-full .row-number {
    margin-left: auto;
    max-width: 100%;
  }
  .auth-shell {
    padding-left: 18px;
    padding-right: 18px;
  }
  .auth-card {
    padding: 22px 18px;
  }
  .auth-intro h1 {
    font-size: 37px;
  }
  .upcoming-payment .text-btn {
    font-size: 12px;
  }
}
@media (max-height: 600px) {
  .onboarding-actions {
    position: static;
  }
  .boot {
    padding-top: 24px;
  }
}
@media (hover: hover) {
  .fund-full:hover,
  .fund-summary-row:hover,
  .suggestions button:hover,
  .list-row:hover {
    background: #f0ece5;
  }
  .wide-btn:hover,
  .quick-actions button:first-child:hover {
    filter: brightness(0.94);
  }
  .nav-btn:not(.selected):hover {
    background: #eeebe5;
  }
}
@media (prefers-reduced-motion: no-preference) {
  dialog[open] {
    animation: sheet-in 0.18s ease-out;
  }
  .track span {
    transition: width 0.2s ease;
  }
  .wide-btn,
  .nav-btn {
    transition: background-color 0.15s ease;
  }
  @keyframes sheet-in {
    from {
      opacity: 0;
      translate: 0 8px;
    }
    to {
      opacity: 1;
      translate: 0 0;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* -- Language Control ------- */
.language-control {
  flex-shrink: 0;
  margin-left: auto;
}
.language-control select {
  font: inherit;
  font-size: 12px;
  color: var(--ink, #242630);
  background: transparent;
  border: 1px solid #dedbd3;
  border-radius: 10px;
  padding: 7px 8px;
  cursor: pointer;
  max-width: 105px;
}
.language-control select:focus-visible {
  outline: 2px solid #5146a5;
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 480px) {
  .topbar {
    gap: 8px;
    flex-wrap: wrap;
  }
  .topbar .demo-tag {
    display: none;
  }
  .language-control select {
    max-width: 95px;
  }
}
