:root {
  --bg: #f6f1e9;
  --bg-deep: #eee8df;
  --surface: #fffaf4;
  --surface-soft: #f1f4ee;
  --ink: #102a38;
  --ink-strong: #081c28;
  --muted: #6f7d82;
  --line: rgba(15, 76, 78, 0.14);
  --teal: #056b6c;
  --teal-dark: #004f53;
  --mint: #dceae2;
  --mint-2: #b9dcd0;
  --positive: #258b76;
  --hero-end: #087879;
  --on-teal: #ffffff;
  --on-teal-muted: rgba(255, 255, 255, .74);
  --on-teal-soft: rgba(255, 255, 255, .15);
  --positive-on-teal: #c8f4e4;
  --surface-alpha: rgba(255, 250, 244, .76);
  --surface-faint: rgba(255, 250, 244, .68);
  --nav-bg: rgba(250, 247, 241, .94);
  --field-bg: rgba(255, 255, 255, .5);
  --focus-ring: rgba(5, 107, 108, .45);
  --soft-line: rgba(15, 76, 78, .09);
  --decorative-ring: rgba(255, 255, 255, .055);
  --skeleton-start: rgba(5, 107, 108, .08);
  --skeleton-mid: rgba(5, 107, 108, .16);
  --sheet-backdrop: rgba(8, 28, 40, .28);
  --elevated-shadow: rgba(8, 28, 40, .12);
  --spinner-track: rgba(5, 107, 108, .2);
  --desktop-shell: rgba(246, 241, 233, .88);
  --tg-content-safe-top: 0px;
  --tg-content-safe-bottom: 0px;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-top));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-bottom));
  color-scheme: light;
  font-family: "Avenir Next", "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }

body {
  background:
    radial-gradient(circle at 80% -10%, color-mix(in srgb, var(--mint-2) 36%, transparent), transparent 36%),
    radial-gradient(circle at -10% 30%, color-mix(in srgb, var(--surface) 78%, transparent), transparent 34%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.bottom-nav button:focus-visible { outline-offset: -3px; border-radius: 13px; }

.app-shell { width: min(100%, 560px); min-height: 100vh; margin: 0 auto; position: relative; }

.topbar {
  height: 74px;
  padding: max(14px, var(--safe-top)) 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  color: var(--teal-dark);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-mark { width: 32px; height: 23px; display: inline-flex; position: relative; }
.brand-mark i {
  position: absolute;
  width: 18px;
  height: 23px;
  border: 7px solid var(--teal);
  border-bottom: 0;
  border-radius: 12px 12px 3px 3px;
}
.brand-mark i:first-child { left: 0; }
.brand-mark i:last-child { right: 0; }

.avatar, .profile-avatar {
  border: 1px solid var(--line);
  background: var(--mint);
  color: var(--teal-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.avatar { width: 38px; height: 38px; border-radius: 14px; }

main { padding: 2px 16px calc(104px + var(--safe-bottom)); }
.screen { display: none; animation: fade-in 180ms ease; }
.screen.active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.intro { padding: 15px 4px 21px; }
.compact-intro { min-height: 66px; padding: 4px 4px 10px; display: flex; flex-direction: column; justify-content: center; }
.overview-greeting { margin: 0; color: var(--ink-strong); font-size: 16px; line-height: 1.3; font-weight: 650; letter-spacing: -.012em; }
.money-quote { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; opacity: 0; transform: translateY(2px); transition: opacity 350ms ease, transform 350ms ease; }
.money-quote.visible { opacity: 1; transform: none; }
.eyebrow { margin: 0 0 6px; color: var(--teal); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; color: var(--ink-strong); font-size: clamp(29px, 8vw, 40px); line-height: 1.08; letter-spacing: -0.038em; font-weight: 650; }
h2 { margin: 0; color: var(--ink-strong); font-size: 19px; letter-spacing: -0.018em; }

.period-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface-faint);
}
.period-tabs button {
  border: 0;
  min-height: 36px;
  padding: 5px;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.period-tabs button.active { background: var(--teal); color: white; }
.period-tabs.compact { margin: 18px 0 0; }

.period-nav { height: 30px; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; color: var(--muted); }
.period-nav > button { min-width: 26px; min-height: 26px; padding: 0 4px; border: 0; background: transparent; color: var(--teal); font-size: 18px; line-height: 1; }
.period-nav > button:disabled { opacity: .22; }
.period-nav .period-current { min-width: 112px; color: var(--muted); font-size: 11px; font-weight: 650; }
.period-nav .period-current:active { color: var(--teal); }
.compact-period-nav { margin-bottom: 4px; }

.hero-card {
  min-height: 148px;
  padding: 21px;
  border-radius: 27px;
  background: linear-gradient(145deg, var(--teal-dark), var(--hero-end));
  color: var(--on-teal);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}
.hero-card::after { content: ""; position: absolute; width: 150px; height: 150px; border: 28px solid var(--decorative-ring); border-radius: 50%; right: -57px; bottom: -80px; }
.card-label { margin: 0 0 9px; font-size: 13px; color: var(--muted); }
.hero-card .card-label { color: var(--on-teal-muted); }
.hero-amount { display: block; font-size: clamp(37px, 11vw, 52px); letter-spacing: -0.045em; line-height: 1; font-weight: 650; }
.trend { margin: 13px 0 0; display: inline-flex; padding: 5px 8px; border-radius: 9px; font-size: 12px; background: color-mix(in srgb, var(--on-teal) 11%, transparent); }
.trend.positive { color: var(--positive-on-teal); }.trend.more, .trend.neutral { color: var(--on-teal-muted); }

.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.metrics-grid.budget-mode #primary-metric-card { grid-column: 1 / -1; min-height: 76px; }
.metrics-grid.budget-mode #top-category-card { display: none; }
.metric-card, .content-card, .profile-stats article {
  border: 1px solid var(--line);
  background: var(--surface-alpha);
}
.metric-card { min-height: 76px; padding: 10px 12px; border-radius: 18px; display: grid; grid-template-columns: 22px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 6px; row-gap: 4px; }
.metric-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.2; }
.metric-card strong { font-size: 15px; line-height: 1.15; color: var(--ink-strong); }
.metric-card strong { min-height: 17px; display: block; grid-column: 1 / -1; }
.skeleton-line { display: block; width: 76%; height: 17px; border-radius: 7px; background: linear-gradient(90deg, var(--skeleton-start), var(--skeleton-mid), var(--skeleton-start)); background-size: 200% 100%; animation: skeleton-wave 1.25s ease-in-out infinite; }
.skeleton-line.short { width: 60%; }
@keyframes skeleton-wave { to { background-position: -200% 0; } }
.metric-icon { width: 22px; height: 22px; border-radius: 8px; background: var(--mint); color: var(--teal); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.category-metric-icon { background: color-mix(in srgb, var(--metric-color, var(--teal)) 16%, var(--surface)); color: var(--metric-color, var(--teal)); }

.content-card { border-radius: 24px; padding: 19px; margin-top: 10px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.section-heading .eyebrow { margin-bottom: 4px; }
.text-button { border: 0; background: transparent; color: var(--teal); font-size: 13px; padding: 5px 0; }

.chart-layout { display: grid; grid-template-columns: 132px 1fr; align-items: center; gap: 17px; }
.donut { width: 132px; aspect-ratio: 1; border-radius: 50%; position: relative; background: conic-gradient(var(--mint) 0 100%); }
.donut::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: var(--surface); }
.donut > div { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut strong { font-size: 14px; color: var(--ink-strong); }
.donut span { color: var(--muted); font-size: 10px; margin-top: 2px; }
.donut.large { width: min(60vw, 225px); margin: 22px auto 4px; }
.donut.large::after { inset: 34px; background: var(--surface-soft); }
.donut.large strong { font-size: 23px; }
.legend { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.legend-row { display: grid; grid-template-columns: 8px 1fr auto; gap: 7px; align-items: center; font-size: 11px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); }
.legend-amount { color: var(--ink); font-weight: 650; }

.operation-list, .history-list { display: flex; flex-direction: column; }
.operation-row { min-height: 62px; display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 11px; align-items: center; border-top: 1px solid var(--soft-line); }
.operation-row:first-child { border-top: 0; }
.operation-group .operation-row:nth-child(2), .history-group .operation-row:nth-child(2) { border-top: 0; }
.operation-icon { width: 38px; height: 38px; border-radius: 13px; background: var(--mint); background: color-mix(in srgb, var(--category-color, var(--teal)) 18%, var(--surface)); color: var(--category-color, var(--teal)); display: grid; place-items: center; font-size: 16px; font-weight: 700; }
.operation-main { min-width: 0; }
.operation-main strong, .operation-main span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.operation-main strong { color: var(--ink-strong); font-size: 13px; }
.operation-main span, .operation-value span { color: var(--muted); font-size: 10px; }
.operation-main span { margin-top: 3px; }
.operation-value { min-width: 82px; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.operation-value strong { color: var(--ink-strong); font-size: 13px; }
.operation-value strong.income { color: var(--positive); }
.operation-day { padding: 13px 0 5px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.chat-cta { width: 100%; min-height: 58px; margin-top: 12px; padding: 0 19px; border: 0; border-radius: 19px; background: var(--teal); color: white; display: flex; align-items: center; justify-content: space-between; font-weight: 650; }

.screen-title { padding: 23px 4px 4px; }
.screen-title h1 { font-size: 35px; }
.screen-title > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.category-total-card { text-align: center; background: var(--surface-soft); }
.category-total-card > strong { color: var(--ink-strong); font-size: 31px; }
.category-details { display: flex; flex-direction: column; gap: 9px; margin-top: 11px; }
.category-row { border: 1px solid var(--line); border-radius: 18px; background: var(--surface-faint); padding: 15px 16px; }
.category-row-head { display: grid; grid-template-columns: 30px 1fr auto; gap: 9px; align-items: center; }
.category-row-icon { width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--category-color) 18%, var(--surface)); color: var(--category-color); }
.category-row-head strong { font-size: 14px; }.category-row-head span:last-child { font-weight: 650; font-size: 14px; }
.category-row-meta { margin: 7px 0 9px 19px; color: var(--muted); font-size: 11px; }
.progress { height: 5px; border-radius: 5px; background: var(--bg-deep); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; }

.history-summary { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; padding: 3px 4px 11px; }
.history-summary strong { color: var(--ink); }
.history-group { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 22px; padding: 4px 16px; background: var(--surface-faint); }
.history-date { padding: 13px 0 8px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.empty-state { padding: 34px 15px; text-align: center; color: var(--muted); font-size: 14px; }

.profile-title { display: flex; align-items: center; gap: 15px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 23px; font-size: 23px; flex: 0 0 auto; }
.profile-title h1 { font-size: 29px; }
.profile-title > div:last-child > p:last-child { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.subscription-card { margin-top: 22px; padding: 23px; border-radius: 27px; background: linear-gradient(145deg, var(--teal-dark), var(--hero-end)); color: var(--on-teal); overflow: hidden; position: relative; }
.subscription-card::after { content: ""; position: absolute; width: 150px; height: 150px; border: 26px solid var(--decorative-ring); border-radius: 50%; right: -62px; bottom: -72px; }
.subscription-topline { display: flex; align-items: center; justify-content: space-between; color: var(--on-teal-muted); font-size: 11px; }
.plus-badge { border-radius: 8px; background: var(--on-teal-soft); padding: 5px 8px; color: var(--on-teal); font-weight: 750; letter-spacing: .06em; }
.subscription-card h2 { margin-top: 25px; color: var(--on-teal); font-size: 26px; }
.subscription-card p { max-width: 310px; margin: 8px 0 20px; color: var(--on-teal-muted); font-size: 13px; line-height: 1.45; }
.light-button { position: relative; z-index: 1; border: 0; min-height: 43px; padding: 0 15px; border-radius: 14px; background: var(--on-teal); color: var(--teal-dark); font-weight: 650; font-size: 12px; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.profile-stats article { padding: 16px; border-radius: 19px; display: flex; flex-direction: column; gap: 5px; }
.profile-stats span { color: var(--muted); font-size: 11px; }.profile-stats strong { color: var(--ink-strong); font-size: 18px; }
.profile-info { padding: 7px 17px; }
.info-row { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--soft-line); font-size: 13px; }
.info-row:first-child { border-top: 0; }.info-row span { color: var(--muted); }.info-row strong { text-align: right; }
.notification-settings .section-heading { margin-bottom: 5px; }
.preference-row { width: 100%; min-height: 62px; padding: 11px 0; border: 0; border-top: 1px solid var(--soft-line); background: transparent; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; }
.preference-row > span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.preference-row strong { color: var(--ink-strong); font-size: 13px; }
.preference-row small { color: var(--muted); font-size: 10px; }
.preference-row > i { width: 38px; height: 22px; flex: 0 0 auto; border-radius: 12px; background: var(--line); position: relative; transition: background 180ms ease; }
.preference-row > i::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: var(--surface); transition: transform 180ms ease; }
.preference-row[aria-checked="true"] > i { background: var(--teal); }
.preference-row[aria-checked="true"] > i::after { transform: translateX(16px); }
.privacy-note { margin: 15px 13px 0; text-align: center; color: var(--muted); font-size: 11px; line-height: 1.5; }

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 560px);
  height: calc(76px + var(--safe-bottom));
  padding: 8px 10px var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
}
.bottom-nav button { border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; font-weight: 650; }
.bottom-nav button.active { color: var(--teal); }
.bottom-nav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav .nav-add { color: var(--teal); gap: 2px; }
.bottom-nav .nav-add > span {
  width: 34px;
  height: 34px;
  margin-top: 0;
  border: 1px solid color-mix(in srgb, var(--teal) 42%, var(--line));
  border-radius: 12px;
  background: var(--teal);
  color: var(--on-teal);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--teal-dark) 16%, transparent);
  font-size: 23px;
  font-weight: 400;
  line-height: 1;
}
.bottom-nav .nav-add small { font-size: 9px; font-weight: 650; }
.bottom-nav .nav-add:active > span { transform: scale(.96); }

.sheet-backdrop {
  position: fixed;
  z-index: 69;
  inset: 0;
  background: var(--sheet-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}
.expense-sheet {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 0;
  width: min(100%, 560px);
  max-height: min(88vh, 760px);
  padding: 9px 18px calc(18px + var(--safe-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  box-shadow: 0 -18px 55px var(--elevated-shadow);
  overflow-y: auto;
  transform: translate(-50%, 105%);
  transition: transform 300ms cubic-bezier(.22, .75, .2, 1);
}
.sheet-backdrop.active { opacity: 1; pointer-events: auto; }
.expense-sheet.active { transform: translate(-50%, 0); }
body.sheet-open { overflow: hidden; }
.sheet-handle { width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 14px; }
.sheet-close {
  position: absolute;
  top: 29px;
  right: 18px;
  width: 34px;
  height: 34px;
  padding: 0 0 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--muted);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 1;
}
.sheet-close:active { background: var(--mint); color: var(--teal); }
.sheet-heading { padding-right: 44px; }
.sheet-heading .eyebrow { margin-bottom: 3px; }
.sheet-heading h2 { font-size: 22px; }
.operation-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--field-bg);
}
.operation-type-toggle button { min-height: 36px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; }
.operation-type-toggle button.active { background: var(--teal); color: var(--on-teal); }
.amount-display { display: block; min-height: 55px; margin: 11px 0 7px; color: var(--ink-strong); font-size: 42px; line-height: 1.2; font-weight: 650; letter-spacing: -.04em; text-align: center; }
.number-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.number-pad button { min-height: 43px; border: 1px solid var(--line); border-radius: 14px; background: var(--field-bg); color: var(--ink-strong); font-size: 18px; }
.number-pad button:active { background: var(--mint); }
.sheet-field { margin-top: 15px; }
.sheet-field > span, .comment-field > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 650; }
.category-chips { display: flex; gap: 7px; margin-inline: -18px; padding: 0 18px 4px; overflow-x: auto; scrollbar-width: none; }
.category-chips::-webkit-scrollbar { display: none; }
.category-chip { flex: 0 0 auto; min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 13px; background: var(--field-bg); color: var(--muted); font-size: 11px; }
.category-chip.active { border-color: var(--category-color); background: color-mix(in srgb, var(--category-color) 15%, var(--surface)); color: var(--ink-strong); }
.comment-field { display: block; margin-top: 11px; }
.comment-field small { font-weight: 500; opacity: .75; }
.comment-field input { width: 100%; min-height: 43px; border: 1px solid var(--line); border-radius: 14px; background: var(--field-bg); color: var(--ink); padding: 0 13px; font: inherit; font-size: 13px; outline: none; }
.comment-field input::placeholder { color: var(--muted); opacity: .72; }
.comment-field input:focus { border-color: var(--teal); box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 14%, transparent); }
.save-expense { width: 100%; min-height: 47px; margin-top: 14px; border: 0; border-radius: 15px; background: var(--teal); color: var(--on-teal); font-weight: 700; }
.save-expense:disabled { opacity: .36; }
.bot-hint { width: 100%; border: 0; background: transparent; color: var(--muted); padding: 12px 3px 1px; font-size: 11px; }

.loading-layer { position: fixed; z-index: 50; inset: 0; background: var(--bg); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 19px; color: var(--muted); font-size: 13px; }
.loading-layer.active { display: flex; }
.loader-logo { width: 70px; height: 70px; border-radius: 25px; display: grid; place-items: center; background: var(--mint); animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); opacity: .72; } }
.period-nav.loading::after {
  content: "";
  width: 13px;
  height: 13px;
  margin-left: 7px;
  border: 2px solid var(--spinner-track);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(91px + var(--safe-bottom)); transform: translate(-50%, 18px); width: min(calc(100% - 32px), 500px); padding: 13px 16px; border-radius: 15px; background: var(--ink-strong); color: white; text-align: center; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.active { opacity: 1; transform: translate(-50%, 0); }

:root[data-theme="dark"] {
  --bg: #0d1b1d;
  --bg-deep: #112426;
  --surface: #15292b;
  --surface-soft: #193032;
  --ink: #d8e5e3;
  --ink-strong: #f3f8f6;
  --muted: #91a6a4;
  --line: rgba(139, 207, 196, .16);
  --teal: #59c7b7;
  --teal-dark: #0d5c5b;
  --hero-end: #167671;
  --mint: #203d3b;
  --mint-2: #2b514d;
  --positive: #71d0b1;
  --surface-alpha: rgba(21, 41, 43, .86);
  --surface-faint: rgba(21, 41, 43, .72);
  --nav-bg: rgba(13, 27, 29, .94);
  --field-bg: rgba(255, 255, 255, .045);
  --focus-ring: rgba(89, 199, 183, .5);
  --soft-line: rgba(139, 207, 196, .1);
  --decorative-ring: rgba(255, 255, 255, .045);
  --skeleton-start: rgba(119, 198, 186, .08);
  --skeleton-mid: rgba(119, 198, 186, .2);
  --sheet-backdrop: rgba(0, 0, 0, .5);
  --elevated-shadow: rgba(0, 0, 0, .34);
  --spinner-track: rgba(89, 199, 183, .2);
  --desktop-shell: rgba(13, 27, 29, .9);
  color-scheme: dark;
}
:root[data-theme="dark"] .brand,
:root[data-theme="dark"] .avatar { color: var(--teal); }

@media (min-width: 600px) {
  body { padding: 24px 0; }
  .app-shell { min-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: 34px; overflow: hidden; background: var(--desktop-shell); }
  .bottom-nav { bottom: 24px; border-radius: 0 0 34px 34px; }
  .expense-sheet { bottom: 24px; border-bottom: 1px solid var(--line); border-radius: 28px; }
}

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