:root {
  --ink: #12312d;
  --ink-soft: #5f726d;
  --paper: #f7f7f2;
  --surface: #ffffff;
  --surface-tint: #eef5f0;
  --line: #e2e9e4;
  --primary: #0b5d52;
  --primary-deep: #0b2e2a;
  --primary-pale: #dff2e8;
  --mint: #bce8d3;
  --peach: #f7c2a8;
  --yellow: #f6dda0;
  --lavender: #ded6fb;
  --blue: #c9e1f5;
  --rose: #f7cfce;
  --danger: #b43e42;
  --danger-pale: #fff0ef;
  --shadow: 0 12px 32px rgba(23, 64, 56, 0.09);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --nav-height: 76px;
  color-scheme: light;
  font-family: Inter, ui-rounded, "SF Pro Rounded", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, select { font: inherit; }

button { cursor: pointer; }

button:disabled { cursor: not-allowed; opacity: 0.55; }

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(40, 146, 123, 0.36);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.app-shell {
  width: 100%;
  max-width: 720px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
}

.connection-strip {
  position: sticky;
  z-index: 20;
  top: 0;
  padding: 8px 20px;
  background: #f6e3a6;
  color: #674f14;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(20px, env(safe-area-inset-top)) 20px 14px;
  background: rgba(247, 247, 242, 0.92);
  backdrop-filter: blur(14px);
}

.topbar h1, .section-heading h2, .login-card h1, .sheet__heading h2, .confirm-dialog h2 {
  margin: 0;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -0.045em;
}

.topbar h1 { font-size: 27px; line-height: 1.06; }
.section-heading h2 { font-size: 27px; line-height: 1.1; }
.login-card h1 { font-size: clamp(31px, 8.2vw, 43px); line-height: 1.03; }

.eyebrow {
  margin: 0 0 5px;
  color: #709087;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

#app { padding: 4px 16px calc(var(--nav-height) + 32px + env(safe-area-inset-bottom)); }

.view { animation: fade-in 170ms ease-out; }

.view--subpage { padding-top: 0; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.section-heading--compact { margin-bottom: 21px; }

.section-intro {
  margin: -4px 4px 22px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 4px 13px rgba(16, 49, 43, 0.04);
}

.icon-button:active { transform: scale(0.95); }
.icon-button.is-spinning > span { display: inline-block; animation: rotate 700ms linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }

.text-button, .tertiary-button {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 14px;
  font-weight: 750;
}

.period-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
  padding: 4px;
  border-radius: 15px;
  background: #e8eee9;
}

.period-button {
  min-height: 36px;
  padding: 6px 8px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #5c716c;
  font-size: 13px;
  font-weight: 700;
}

.period-button.is-selected {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(28, 65, 56, 0.1);
}

.total-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 203px;
  margin: 18px 0;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--primary-deep);
  color: #fff;
  box-shadow: 0 16px 30px rgba(11, 46, 42, 0.2);
}

.total-card__glow {
  position: absolute;
  z-index: -1;
  right: -53px;
  bottom: -78px;
  width: 217px;
  height: 217px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(130, 219, 182, 0.38), rgba(130, 219, 182, 0) 66%);
}

.total-card p, .total-card span { display: block; }

.total-card p {
  margin: 0 0 8px;
  color: #c6ded5;
  font-size: 13px;
  font-weight: 650;
}

.total-card strong {
  display: block;
  margin-bottom: 7px;
  color: #fffefb;
  font-size: clamp(35px, 10vw, 48px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.06em;
  line-height: 1;
}

.total-card span {
  color: #c7e1d6;
  font-size: 13px;
  font-weight: 600;
}

.total-card__action {
  position: absolute;
  right: 17px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.total-card__action:active { background: rgba(255, 255, 255, 0.24); }

.quick-grid, .stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 20px;
}

.metric-card {
  display: flex;
  min-width: 0;
  min-height: 136px;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(22, 52, 46, 0.035);
}

.metric-card__icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin-bottom: auto;
  border-radius: 9px;
  font-size: 18px;
  font-weight: 800;
}

.mint { background: var(--mint); }
.peach { background: var(--peach); }
.yellow { background: var(--yellow); }
.lavender { background: var(--lavender); }
.blue { background: var(--blue); }
.rose { background: var(--rose); }

.metric-card > span:not(.metric-card__icon) {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

.metric-card strong {
  overflow: hidden;
  margin-top: 5px;
  color: var(--ink);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card small {
  overflow: hidden;
  margin-top: 4px;
  color: #84938f;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-section {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(22, 52, 46, 0.035);
}

.card-section__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.card-section__heading h3 { margin: 0; font-size: 17px; letter-spacing: -0.025em; }
.card-section__heading > span { color: var(--ink-soft); font-size: 11px; font-weight: 600; }

.transaction-list { display: grid; }

.transaction-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid #edf1ee;
  background: transparent;
  color: inherit;
  text-align: left;
}

.transaction-row:last-child { border-bottom: 0; }
.transaction-row--clickable:active { opacity: 0.62; }

.transaction-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-tint);
  color: var(--primary);
  font-size: 19px;
}

.transaction-main { min-width: 0; }
.transaction-main strong, .transaction-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transaction-main strong { font-size: 14px; font-weight: 760; }
.transaction-main small { margin-top: 3px; color: #80918c; font-size: 11px; }
.transaction-amount { color: var(--ink); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

.transaction-date-divider {
  margin: 18px 0 3px;
  color: #789088;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.transaction-list--full { min-height: 220px; }

.empty-state {
  display: grid;
  min-height: 190px;
  place-items: center;
  padding: 26px;
  border: 1px dashed #cbdad2;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.55);
  color: var(--ink-soft);
  text-align: center;
}

.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 15px; }
.empty-state p { max-width: 235px; margin: 0; font-size: 13px; line-height: 1.4; }

.skeleton {
  position: relative;
  overflow: hidden;
  min-height: 66px;
  margin: 8px 0;
  border-radius: var(--radius-md);
  background: #e9efeb;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer { to { transform: translateX(100%); } }

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  max-width: 720px;
  min-height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  margin: auto;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(218, 229, 222, 0.9);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 -6px 22px rgba(10, 46, 39, 0.05);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-direction: column;
  padding: 3px 1px;
  border: 0;
  background: transparent;
  color: #778983;
}

.nav-item > span { display: grid; height: 29px; place-items: center; font-size: 22px; line-height: 1; }
.nav-item small { overflow: hidden; max-width: 100%; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.is-active { color: var(--primary); }
.nav-item.is-active:not(.nav-item--add) > span { font-weight: 900; }

.nav-item--add > span {
  width: 42px;
  height: 42px;
  margin-top: -22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 28px;
  box-shadow: 0 8px 16px rgba(11, 93, 82, 0.28);
}

.nav-item--add small { margin-top: 4px; }

.expense-form, .sheet-form { display: grid; gap: 8px; }

.expense-form {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.expense-form--compact { padding: 0; border: 0; border-radius: 0; box-shadow: none; }

.form-label {
  display: block;
  margin: 8px 0 1px;
  color: #526962;
  font-size: 12px;
  font-weight: 800;
}

.form-input, .amount-input-row input, .amount-input-row select, .custom-period-row input {
  width: 100%;
  min-height: 49px;
  padding: 11px 13px;
  border: 1px solid #d9e5de;
  border-radius: 13px;
  background: #fbfcfa;
  color: var(--ink);
  font-size: 16px;
  outline: 0;
}

.form-input::placeholder, .amount-input-row input::placeholder { color: #a8b7b0; }
.form-input:focus, .amount-input-row input:focus, .amount-input-row select:focus, .custom-period-row input:focus { border-color: #76b4a3; background: #fff; }

.amount-input-row { display: grid; grid-template-columns: minmax(0, 1fr) 81px; gap: 8px; }
.amount-input-row input { min-width: 0; font-size: 24px; font-weight: 740; font-variant-numeric: tabular-nums; letter-spacing: -0.035em; }
.amount-input-row select { appearance: none; padding-right: 7px; color: var(--primary); font-size: 14px; font-weight: 800; text-align: center; }

.select-wrap { position: relative; }
.select-wrap::after { position: absolute; top: 50%; right: 14px; content: "⌄"; color: #597069; font-size: 18px; pointer-events: none; transform: translateY(-52%); }
.select-wrap select { appearance: none; padding-right: 37px; }

.date-fieldset { display: block; min-width: 0; margin: 8px 0 0; padding: 0; border: 0; }
.date-fieldset .form-label { width: 100%; padding: 0; }
.date-choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.date-choice {
  position: relative;
  display: flex;
  min-height: 63px;
  flex-direction: column;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid #d9e5de;
  border-radius: 14px;
  background: #fbfcfa;
  color: var(--ink-soft);
  text-align: left;
}

button.date-choice { cursor: pointer; }
.date-choice > span { font-size: 11px; font-weight: 700; }
.date-choice > strong { margin-top: 3px; color: var(--ink); font-size: 14px; }
.date-choice.is-selected { border-color: var(--primary); background: var(--primary-pale); }
.date-choice.is-selected > strong { color: var(--primary-deep); }
.date-choice input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.form-help { margin: 5px 0 4px; color: #83928d; font-size: 11px; line-height: 1.35; }

.primary-button, .secondary-button, .danger-button {
  min-height: 50px;
  padding: 12px 17px;
  border: 0;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
}

.primary-button { background: var(--primary); color: #fff; box-shadow: 0 7px 14px rgba(11, 93, 82, 0.2); }
.primary-button:active { background: #084b42; transform: translateY(1px); }
.primary-button--wide { width: 100%; margin-top: 8px; }
.secondary-button { border: 1px solid #d7e3dd; background: #fff; color: var(--ink); }
.danger-button { background: var(--danger); color: #fff; }

.filter-summary {
  margin: -7px 2px 13px;
  padding: 8px 11px;
  border-radius: 10px;
  background: #e7f3ec;
  color: #31705f;
  font-size: 12px;
  font-weight: 700;
}

.load-more { width: 100%; margin-top: 14px; min-height: 44px; border: 1px solid #d8e5de; border-radius: 13px; background: #fff; color: var(--primary); font-size: 13px; font-weight: 800; }

.budget-list { display: grid; gap: 11px; }

.budget-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(22, 52, 46, 0.035);
}

.budget-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.budget-card__title { margin: 0; font-size: 15px; font-weight: 800; }
.budget-card__remaining { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; }
.budget-card__amount { color: var(--ink); font-size: 13px; font-weight: 800; white-space: nowrap; }
.progress-track { height: 9px; overflow: hidden; margin: 15px 0 10px; border-radius: 99px; background: #eaf0ec; }
.progress-fill { height: 100%; min-width: 2px; border-radius: inherit; background: var(--primary); transition: width 350ms ease; }
.progress-fill.is-warning { background: #d79124; }
.progress-fill.is-danger { background: var(--danger); }
.budget-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #7c8e87; font-size: 11px; }
.budget-card__footer button { padding: 0; border: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 800; }

.menu-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: 0 4px 16px rgba(22, 52, 46, 0.035); }
.menu-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 16px; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid #edf1ee; background: transparent; color: var(--ink); text-align: left; }
.menu-row:last-child { border-bottom: 0; }
.menu-row:active { background: #f4f8f5; }
.menu-row__icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: var(--ink); font-size: 20px; font-weight: 800; }
.menu-row strong, .menu-row small { display: block; }
.menu-row strong { font-size: 14px; }
.menu-row small { margin-top: 3px; color: #82928c; font-size: 11px; }
.menu-row b { color: #9aaba4; font-size: 25px; font-weight: 400; }
.privacy-note { margin: 21px 9px; color: #84938f; font-size: 11px; line-height: 1.4; text-align: center; }

.back-button { margin: 4px 0 16px; padding: 7px 3px; border: 0; background: transparent; color: var(--primary); font-size: 14px; font-weight: 800; }

.custom-period-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin: 14px 0 18px; }
.custom-period-row label { min-width: 0; color: var(--ink-soft); font-size: 10px; font-weight: 800; }
.custom-period-row input { min-width: 0; min-height: 40px; margin-top: 4px; padding: 6px; font-size: 12px; }
.custom-period-row .secondary-button { align-self: end; min-height: 40px; padding: 7px 11px; font-size: 12px; }
.total-card--stats { min-height: 168px; margin-top: 0; }
.total-card--stats strong { font-size: 37px; }
.stats-grid .metric-card { min-height: 122px; }

.category-breakdown { display: grid; gap: 15px; }
.breakdown-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; }
.breakdown-row__label { min-width: 0; overflow: hidden; font-size: 13px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-row__amount { color: var(--ink-soft); font-size: 12px; font-weight: 750; white-space: nowrap; }
.breakdown-row__track { grid-column: 1 / -1; height: 7px; overflow: hidden; border-radius: 99px; background: #edf2ee; }
.breakdown-row__bar { height: 100%; border-radius: inherit; background: var(--primary); }

.category-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--surface); box-shadow: 0 4px 16px rgba(22, 52, 46, 0.035); }
.category-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 11px; width: 100%; padding: 13px 16px; border: 0; border-bottom: 1px solid #edf1ee; background: transparent; color: var(--ink); text-align: left; }
.category-row:last-child { border-bottom: 0; }
.category-row__icon { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 12px; background: var(--surface-tint); font-size: 17px; }
.category-row strong, .category-row small { display: block; }
.category-row strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.category-row small { margin-top: 3px; color: #6c877c; font-size: 10px; font-weight: 750; }
.category-row b { color: #9aaba4; font-size: 24px; font-weight: 400; }

.login-screen {
  display: flex;
  width: 100%;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding: max(30px, env(safe-area-inset-top)) 24px max(27px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 96% 0%, #c9eee1 0, transparent 38%), radial-gradient(circle at 0 100%, #f6d7ba 0, transparent 35%), var(--paper);
}

.login-screen__brand { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 27px; color: var(--primary-deep); font-size: 21px; font-weight: 850; letter-spacing: -0.04em; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 13px; background: var(--primary-deep); color: #fff; font-size: 23px; }
.login-card { padding: 29px 24px 25px; border: 1px solid rgba(255,255,255,0.7); border-radius: 29px; background: rgba(255,255,255,0.86); box-shadow: 0 18px 45px rgba(28, 74, 63, 0.12); backdrop-filter: blur(16px); }
.login-card > p:not(.eyebrow) { margin: 15px 0 23px; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.login-access-policy { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; margin-top: 18px; padding: 12px; border: 1px solid #d8e8df; border-radius: 14px; background: #f1f8f3; }
.login-access-policy__icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: var(--primary-pale); font-size: 16px; }
.login-access-policy strong { display: block; color: var(--ink); font-size: 12px; font-weight: 800; }
.login-access-policy p { margin: 3px 0 0; color: #638078; font-size: 11px; line-height: 1.35; }
.invite-access { margin-top: 12px; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.invite-access summary { color: var(--primary); font-weight: 780; cursor: pointer; }
.invite-access summary::marker { color: var(--primary); }
.invite-access p { margin: 8px 0 0; padding-left: 2px; }
.login-note { margin: 17px 0 0; color: #82928c; font-size: 11px; line-height: 1.4; }
.login-footer { margin: 20px auto 0; color: #687d75; font-size: 12px; line-height: 1.45; text-align: center; }

.sheet-backdrop { position: fixed; z-index: 29; inset: 0; background: rgba(9, 35, 30, 0.42); backdrop-filter: blur(2px); }
.sheet { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; width: 100%; max-width: 720px; max-height: min(89vh, 760px); margin: auto; overflow: auto; padding: 8px 20px calc(26px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: var(--surface); box-shadow: 0 -15px 40px rgba(6, 33, 28, 0.2); animation: sheet-in 190ms ease-out; }
@keyframes sheet-in { from { transform: translateY(25px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet__handle { width: 40px; height: 4px; margin: 2px auto 14px; border-radius: 99px; background: #d5dfda; }
.sheet__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.sheet__heading h2 { font-size: 22px; }

.toggle-row { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 6px 0; padding: 0 2px; color: var(--ink); font-size: 13px; font-weight: 650; }
.toggle-row input { width: 20px; height: 20px; accent-color: var(--primary); }

.export-info { margin: -3px 0 14px; color: var(--ink-soft); font-size: 13px; line-height: 1.4; }
.export-options { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.export-option { display: grid; grid-template-columns: 39px minmax(0, 1fr) 15px; align-items: center; gap: 11px; width: 100%; padding: 14px; border: 0; border-bottom: 1px solid #edf1ee; background: transparent; color: var(--ink); text-align: left; }
.export-option:last-child { border-bottom: 0; }
.export-option:active { background: #f4f8f5; }
.export-option__icon { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 12px; font-size: 17px; font-weight: 800; }
.export-option strong, .export-option small { display: block; }
.export-option strong { font-size: 14px; }
.export-option small { margin-top: 3px; color: #82928c; font-size: 11px; }
.export-option b { color: #9aaba4; font-size: 23px; font-weight: 400; }

.confirm-dialog { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(9, 35, 30, 0.48); backdrop-filter: blur(4px); }
.confirm-dialog__card { width: min(100%, 380px); padding: 25px; border-radius: 25px; background: #fff; box-shadow: 0 20px 55px rgba(4, 28, 23, 0.27); text-align: center; animation: dialog-in 170ms ease-out; }
@keyframes dialog-in { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.confirm-dialog__icon { display: grid; width: 45px; height: 45px; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: var(--danger-pale); color: var(--danger); font-size: 25px; font-weight: 800; }
.confirm-dialog h2 { font-size: 21px; }
.confirm-dialog p { margin: 9px 0 21px; color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.confirm-dialog__buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.toast-region { position: fixed; z-index: 50; right: 16px; bottom: calc(var(--nav-height) + 14px + env(safe-area-inset-bottom)); left: 16px; display: grid; justify-items: center; pointer-events: none; }
.toast { max-width: 520px; padding: 12px 15px; border-radius: 13px; background: #153e37; color: #fff; box-shadow: 0 10px 28px rgba(6, 35, 29, 0.24); font-size: 13px; font-weight: 700; animation: toast-in 180ms ease-out; }
.toast.is-error { background: #8a3134; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 721px) {
  body { background: #e4ebe6; }
  .app-shell { min-height: 100vh; box-shadow: 0 0 52px rgba(17, 55, 47, 0.13); }
  .bottom-nav { right: auto; left: 50%; transform: translateX(-50%); }
  .sheet { right: auto; left: 50%; transform: translateX(-50%); }
  .sheet[hidden] { transform: translateX(-50%); }
}

@media (max-width: 380px) {
  #app { padding-right: 12px; padding-left: 12px; }
  .topbar { padding-right: 16px; padding-left: 16px; }
  .total-card { padding: 21px; }
  .metric-card { padding: 13px; }
  .expense-form { padding: 16px; }
  .custom-period-row { grid-template-columns: 1fr 1fr; }
  .custom-period-row .secondary-button { grid-column: 1 / -1; }
}

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