:root {
  color-scheme: light;
  --bg: #f4f5ef;
  --surface: #ffffff;
  --surface-soft: #eef0e8;
  --ink: #18332c;
  --muted: #718079;
  --line: #e2e6de;
  --green: #173f35;
  --green-2: #285a4c;
  --lime: #d8f584;
  --lime-soft: #eff9d8;
  --orange: #bd684d;
  --orange-soft: #fff0e9;
  --red: #b74f4b;
  --shadow: 0 14px 40px rgba(30, 55, 45, 0.07);
  --radius: 24px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:not(:disabled),
a {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(83, 126, 99, 0.28);
  outline-offset: 3px;
}

a {
  color: inherit;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  display: none;
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(18px, env(safe-area-inset-top)) 18px 12px;
  max-width: 1180px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--green);
  color: var(--lime);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.topbar .brand {
  display: none;
}

.month-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
}

.month-button,
.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: transparent;
}

.month-button:active,
.icon-button:active {
  background: var(--surface-soft);
}

.month-title {
  min-width: 130px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
}

.month-title span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.add-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 15px;
  background: var(--green);
  color: white;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.topbar .add-button {
  display: none;
}

.add-button {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 14px;
  background: var(--green);
  color: var(--lime);
}

.fab {
  position: fixed;
  z-index: 30;
  right: 20px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--green);
  color: var(--lime);
  box-shadow: 0 10px 28px rgba(23, 63, 53, 0.28);
}

.fab svg {
  width: 27px;
  height: 27px;
  stroke-width: 2;
}

.fab:active {
  transform: scale(0.94);
}

.add-button span {
  display: none;
}

.add-button:active,
.primary-button:active,
.secondary-button:active {
  transform: scale(0.97);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.content {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 18px calc(108px + env(safe-area-inset-bottom));
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0 22px;
}

.page-heading h1 {
  margin: 0 0 5px;
  font-size: clamp(27px, 6vw, 38px);
  line-height: 1.1;
  letter-spacing: -1.2px;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.card {
  border: 1px solid rgba(222, 227, 217, 0.8);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(24, 51, 44, 0.02);
}

.balance-card {
  position: relative;
  overflow: hidden;
  padding: 25px 22px 20px;
  border: 0;
  border-radius: 28px;
  background: var(--green);
  color: white;
  box-shadow: 0 18px 45px rgba(23, 63, 53, 0.16);
}

.balance-card::after {
  content: "";
  position: absolute;
  top: -90px;
  right: -65px;
  width: 220px;
  height: 220px;
  border: 46px solid rgba(216, 245, 132, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.balance-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.balance-label svg {
  width: 17px;
  height: 17px;
  color: var(--lime);
}

.balance-value {
  position: relative;
  z-index: 1;
  margin-bottom: 7px;
  color: var(--lime);
  font-size: clamp(34px, 9vw, 48px);
  font-weight: 750;
  letter-spacing: -1.8px;
  line-height: 1.15;
}

.balance-caption {
  position: relative;
  z-index: 1;
  min-height: 18px;
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  line-height: 1.5;
}

.balance-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 23px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.balance-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stat-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--lime);
}

.stat-icon.expense {
  color: #ffc2a6;
}

.stat-icon svg {
  width: 17px;
  height: 17px;
}

.balance-stat small,
.balance-stat strong {
  display: block;
}

.balance-stat small {
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

.balance-stat strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.stat-card {
  padding: 18px;
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 12px;
}

.category-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot, var(--green));
}

.stat-card-value {
  margin-bottom: 6px;
  font-size: clamp(18px, 4.5vw, 23px);
  font-weight: 750;
  letter-spacing: -0.5px;
}

.stat-card-note {
  color: var(--muted);
  font-size: 11px;
}

.goal-card {
  margin-top: 14px;
  padding: 20px;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-heading h2,
.card-heading h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.3px;
}

.card-heading a,
.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--green-2);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.goal-numbers {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 17px 0 12px;
}

.goal-numbers strong {
  font-size: 24px;
  letter-spacing: -0.7px;
}

.goal-numbers span {
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  overflow: hidden;
  height: 8px;
  border-radius: 99px;
  background: var(--surface-soft);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green-2);
  transition: width 0.35s ease;
}

.goal-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.section-block {
  margin-top: 26px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.5px;
}

.operations-card {
  overflow: hidden;
}

.operation-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.operation-row:last-child {
  border-bottom: 0;
}

.operation-category-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--dot, #55776d) 14%, white);
  color: var(--dot, #55776d);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.operation-main {
  flex: 1;
  min-width: 0;
}

.operation-title {
  overflow: hidden;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operation-amount {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.operation-amount.income {
  color: var(--green-2);
}

.operation-actions {
  display: flex;
  flex: 0 0 auto;
  margin-right: -7px;
}

.operation-actions .icon-button {
  width: 32px;
  height: 36px;
  color: var(--muted);
}

.operation-actions svg {
  width: 16px;
  height: 16px;
}

.empty-state {
  padding: 38px 24px;
  text-align: center;
}

.empty-illustration {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 17px;
  border-radius: 22px;
  background: var(--lime-soft);
  color: var(--green);
}

.empty-illustration svg {
  width: 29px;
  height: 29px;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.empty-state p {
  max-width: 330px;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 12px;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 520px;
  min-height: 68px;
  margin: 0 auto;
  padding: 7px;
  border: 1px solid rgba(226, 230, 222, 0.9);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 40px rgba(23, 63, 53, 0.14);
  backdrop-filter: blur(18px);
}

.nav-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 5px 2px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.nav-button svg {
  width: 21px;
  height: 21px;
}

.nav-button.active {
  background: var(--lime-soft);
  color: var(--green);
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -18px 17px;
  padding: 0 18px 4px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.filter-chip.active {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.date-group {
  margin-bottom: 18px;
}

.date-label {
  margin: 0 0 8px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.operations-summary {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.summary-pill {
  flex: 1;
  padding: 14px 16px;
  border-radius: 17px;
  background: var(--surface-soft);
}

.summary-pill span,
.summary-pill strong {
  display: block;
}

.summary-pill span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.summary-pill strong {
  font-size: 14px;
}

.scheme-list {
  display: grid;
  gap: 10px;
}

.scheme-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  text-align: left;
}

.scheme-option.active {
  border-color: var(--green-2);
  background: var(--lime-soft);
  box-shadow: inset 0 0 0 1px var(--green-2);
}

.scheme-radio {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1.5px solid #a9b3ac;
  border-radius: 50%;
}

.scheme-option.active .scheme-radio {
  border: 6px solid var(--green);
  background: white;
}

.scheme-option strong,
.scheme-option small {
  display: block;
}

.scheme-option strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.scheme-option small {
  color: var(--muted);
  font-size: 11px;
}

.savings-detail {
  margin-top: 16px;
  padding: 22px;
}

.savings-detail h2 {
  margin: 0 0 9px;
  font-size: 21px;
  letter-spacing: -0.6px;
}

.savings-description {
  margin: 0 0 21px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.target-panel {
  padding: 18px;
  border-radius: 18px;
  background: var(--green);
  color: white;
}

.target-panel > span {
  display: block;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
}

.target-panel > strong {
  display: block;
  margin-bottom: 9px;
  color: var(--lime);
  font-size: 29px;
  letter-spacing: -0.8px;
}

.target-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  line-height: 1.55;
}

.rate-control {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.rate-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 650;
}

.rate-label output {
  color: var(--green-2);
  font-weight: 800;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.ratio-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.ratio-row-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 11px;
}

.ratio-row-top span:last-child {
  color: var(--muted);
}

.ratio-row .progress-track {
  height: 6px;
}

.challenge-card {
  margin-top: 22px;
  padding: 22px;
  background: #edf1e7;
}

.challenge-kicker {
  display: inline-block;
  margin-bottom: 11px;
  padding: 5px 9px;
  border-radius: 8px;
  background: #dfe8d4;
  color: var(--green-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.challenge-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.challenge-card > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.challenge-form {
  display: flex;
  gap: 9px;
  margin-bottom: 16px;
}

.challenge-form label {
  flex: 1;
}

.challenge-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #d4ddcc;
  border-radius: 13px;
  background: white;
  color: var(--ink);
}

.challenge-form button {
  min-height: 44px;
  padding: 0 15px;
}

.challenge-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.challenge-result {
  padding: 14px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.65);
}

.challenge-result span,
.challenge-result strong {
  display: block;
}

.challenge-result span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.challenge-result strong {
  font-size: 14px;
}

.sources {
  margin: 24px 2px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.sources a {
  color: var(--green-2);
  text-underline-offset: 2px;
}

.analytics-grid {
  display: grid;
  gap: 14px;
}

.analytics-card {
  padding: 20px;
}

.category-chart {
  display: grid;
  place-items: center;
  gap: 24px;
  margin-top: 20px;
}

.donut {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--donut);
}

.donut::after {
  content: "";
  position: absolute;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: var(--surface);
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-center strong,
.donut-center span {
  display: block;
}

.donut-center strong {
  margin-bottom: 4px;
  font-size: 17px;
  letter-spacing: -0.4px;
}

.donut-center span {
  color: var(--muted);
  font-size: 10px;
}

.category-legend {
  width: 100%;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.legend-row:last-child {
  border-bottom: 0;
}

.legend-name {
  flex: 1;
  min-width: 0;
}

.legend-amount {
  font-weight: 700;
}

.legend-percent {
  width: 35px;
  color: var(--muted);
  text-align: right;
}

.insight-list {
  display: grid;
  gap: 10px;
}

.insight {
  display: flex;
  gap: 13px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-soft);
}

.insight.warning {
  background: var(--orange-soft);
}

.insight.good {
  background: var(--lime-soft);
}

.insight-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--green-2);
}

.insight.warning .insight-icon {
  color: var(--orange);
}

.insight-icon svg {
  width: 17px;
  height: 17px;
}

.insight h3 {
  margin: 1px 0 5px;
  font-size: 13px;
}

.insight p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.trend-chart {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 9px;
  height: 190px;
  margin-top: 22px;
  padding-top: 12px;
}

.trend-month {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 8px;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 145px;
  border-bottom: 1px solid var(--line);
}

.trend-bar {
  width: min(12px, 32%);
  min-height: 2px;
  border-radius: 5px 5px 0 0;
  background: #b9c7bd;
}

.trend-bar.expense {
  background: var(--green-2);
}

.trend-label {
  color: var(--muted);
  font-size: 10px;
  text-transform: capitalize;
}

.trend-legend {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

dialog {
  width: min(100% - 24px, 520px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 26px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(10, 35, 28, 0.25);
}

dialog::backdrop {
  background: rgba(14, 32, 27, 0.5);
  backdrop-filter: blur(4px);
}

.transaction-form {
  padding: 23px;
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.5px;
}

.dialog-heading .icon-button {
  background: var(--surface-soft);
}

.type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 20px;
  padding: 5px;
  border-radius: 15px;
  background: var(--surface-soft);
}

.type-switch button {
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.type-switch button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(23, 63, 53, 0.07);
}

.form-field {
  display: block;
  margin-bottom: 16px;
}

.form-field > span,
.required-label > span:first-child {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.form-field input,
.form-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcf9;
  color: var(--ink);
  font-size: 14px;
}

.amount-input {
  position: relative;
}

.amount-input input {
  padding-right: 42px;
  font-size: 22px;
  font-weight: 700;
}

.amount-input::after {
  content: "₽";
  position: absolute;
  top: 50%;
  right: 16px;
  color: var(--muted);
  font-size: 18px;
  transform: translateY(-50%);
}

.required-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 20px;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.required-label > span:first-child {
  margin: 0;
  color: var(--ink);
}

.required-label small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.switch-input {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  margin: 0;
  appearance: none;
  border-radius: 99px;
  background: #c8cec8;
  transition: background 0.2s;
}

.switch-input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.switch-input:checked {
  background: var(--green-2);
}

.switch-input:checked::after {
  transform: translateX(18px);
}

.form-submit {
  width: 100%;
  min-height: 50px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: calc(94px + env(safe-area-inset-bottom));
  left: 20px;
  max-width: 380px;
  margin: 0 auto;
  padding: 14px 18px;
  border-radius: 15px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  font-size: 13px;
  text-align: center;
}

@media (min-width: 600px) {
  .topbar {
    padding-right: 28px;
    padding-left: 28px;
  }

  .topbar .brand {
    display: inline-flex;
  }

  .month-switcher {
    margin-left: auto;
  }

  .add-button {
    width: auto;
    padding: 0 17px;
  }

  .add-button span {
    display: inline;
  }

  .content {
    padding-right: 28px;
    padding-left: 28px;
  }

  .overview-primary {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 14px;
  }

  .overview-primary .balance-card {
    grid-row: span 2;
  }

  .overview-primary .stats-grid {
    margin-top: 0;
  }

  .overview-primary .goal-card {
    margin-top: 0;
  }

  .balance-card {
    padding: 30px;
  }

  .balance-stats {
    margin-top: 40px;
  }

  .category-chart {
    grid-template-columns: auto 1fr;
  }

  .scheme-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .scheme-option {
    align-items: flex-start;
  }

  .savings-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 16px;
    align-items: start;
  }

  .savings-detail {
    margin-top: 0;
  }

  .challenge-results {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 960px) {
  .app-shell {
    display: grid;
    grid-template-columns: 224px 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: 30px 20px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.45);
  }

  .sidebar .brand {
    margin: 0 10px 38px;
  }

  .side-nav {
    display: grid;
    gap: 7px;
  }

  .side-nav .nav-button {
    flex-direction: row;
    justify-content: flex-start;
    gap: 13px;
    min-height: 48px;
    padding: 0 15px;
    border-radius: 15px;
    font-size: 13px;
  }

  .side-nav .nav-button.active {
    background: var(--green);
    color: white;
  }

  .sidebar-note {
    margin: auto 8px 0;
    padding: 16px;
    border-radius: 17px;
    background: var(--lime-soft);
    color: var(--green-2);
    font-size: 11px;
    line-height: 1.6;
  }

  .topbar {
    padding-top: 23px;
  }

  .topbar .brand,
  .bottom-nav {
    display: none;
  }

  .content {
    padding-top: 0;
    padding-bottom: 50px;
  }

  .page-heading {
    margin-top: 18px;
  }

  .analytics-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .analytics-card.trend-card {
    grid-column: 1 / -1;
  }

  .trend-chart {
    height: 220px;
  }

  .trend-bars {
    height: 175px;
  }

  .toast {
    bottom: 28px;
  }
}

@media (max-width: 380px) {
  .content,
  .topbar {
    padding-right: 14px;
    padding-left: 14px;
  }

  .month-title {
    min-width: 112px;
    font-size: 13px;
  }

  .operation-row {
    gap: 9px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .operation-category-icon {
    width: 36px;
    height: 36px;
  }

  .operation-actions .edit-operation {
    display: none;
  }
}

@media (min-width: 600px) {
  .topbar .add-button {
    display: inline-flex;
  }
}

@media (max-width: 959px) {
  .content {
    padding-bottom: calc(164px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 960px) {
  .fab {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
