:root {
  color-scheme: light;
  --bg: #f5f4ee;
  --surface: #fffefa;
  --surface-strong: #ffffff;
  --ink: #18231e;
  --muted: #7c8580;
  --line: #e7e7df;
  --green: #1f6b4f;
  --green-dark: #15533c;
  --green-soft: #e6f0e9;
  --amber: #ec9a42;
  --red: #d55d4a;
  --blue: #557dac;
  --shadow: 0 18px 50px rgba(32, 52, 43, 0.1);
  --soft-shadow: 0 8px 24px rgba(32, 52, 43, 0.06);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { background: #dfe4df; }

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 50% -20%, #eef2eb 0, #dfe4df 45%, #d8ded9 100%);
  -webkit-tap-highlight-color: transparent;
}

button, input, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }

.app-shell {
  position: relative;
  min-height: 100vh;
  width: min(100%, 520px);
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 70px rgba(26, 48, 38, 0.12);
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  height: calc(68px + env(safe-area-inset-top));
  padding: calc(12px + env(safe-area-inset-top)) 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(245, 244, 238, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .04em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px 11px 11px 4px;
  color: #fff;
  background: var(--green);
  font-family: Georgia, serif;
  font-size: 20px;
  box-shadow: 0 5px 14px rgba(31, 107, 79, .22);
}

.topbar-meta { display: flex; align-items: center; gap: 8px; }
.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid rgba(31, 107, 79, .12);
  border-radius: 999px;
  color: #557064;
  background: rgba(255,255,255,.54);
  font-size: 11px;
  font-weight: 600;
}
.local-badge span { color: #51a47f; font-size: 8px; }

.icon-button, .card-icon-button, .sheet-close {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
}
.icon-button { width: 38px; height: 38px; border-radius: 12px; }
.icon-button:active { background: #e9e9e2; }
.icon-button svg { width: 21px; fill: currentColor; }

main { padding: 6px 18px calc(110px + env(safe-area-inset-bottom)); }
.view { display: none; animation: view-in .28s ease; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }

h1, h2, p { margin: 0; }
h1 { font-size: clamp(25px, 7vw, 30px); line-height: 1.25; letter-spacing: -.04em; }
h2 { font-size: 20px; line-height: 1.3; letter-spacing: -.025em; }
.eyebrow { margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.welcome-row { display: flex; align-items: center; justify-content: space-between; padding: 17px 2px 20px; }
.day-token {
  width: 48px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px 16px 16px 5px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  color: var(--green);
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 24px;
}

.demo-banner {
  align-items: center;
  gap: 10px;
  margin: -5px 0 14px;
  padding: 10px 12px;
  border: 1px solid #e6d9b8;
  border-radius: 14px;
  background: #fff8e7;
  color: #705a2b;
}
.demo-banner:not([hidden]) { display: flex; }
.demo-icon { font-size: 18px; }
.demo-banner p { min-width: 0; flex: 1; display: flex; flex-direction: column; font-size: 12px; }
.demo-banner p span { margin-top: 2px; color: #9a8150; font-size: 10px; }
.demo-banner button { padding: 6px 9px; border: 0; border-radius: 8px; background: #efe2bc; color: #705a2b; font-size: 11px; font-weight: 700; }

.balance-card {
  position: relative;
  overflow: hidden;
  min-height: 315px;
  padding: 19px 20px 18px;
  border-radius: 27px 27px 27px 9px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, rgba(141, 205, 171, .26), transparent 30%),
    radial-gradient(circle at -5% 115%, rgba(239, 193, 119, .14), transparent 38%),
    linear-gradient(145deg, #236e52, #174f3d 70%);
  box-shadow: 0 18px 36px rgba(27, 85, 64, .22);
}
.balance-card::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  right: -90px;
  bottom: -100px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255,255,255,.025), 0 0 0 56px rgba(255,255,255,.018);
}
.month-switcher { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 10px; }
.card-icon-button { width: 28px; height: 28px; border-radius: 9px; color: rgba(255,255,255,.72); }
.card-icon-button:active { background: rgba(255,255,255,.1); }
.card-icon-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.month-label { padding: 5px 11px; border: 0; border-radius: 10px; color: rgba(255,255,255,.82); background: rgba(255,255,255,.08); font-size: 12px; font-weight: 650; }
.balance-caption { margin-top: 23px; text-align: center; color: rgba(255,255,255,.64); font-size: 12px; letter-spacing: .06em; }
.balance-amount { display: flex; align-items: baseline; justify-content: center; gap: 5px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.balance-amount span { color: rgba(255,255,255,.75); font-family: Georgia, serif; font-size: 22px; }
.balance-amount strong { font-family: Georgia, "Times New Roman", serif; font-size: clamp(43px, 12vw, 56px); font-weight: 500; letter-spacing: -.035em; }
.balance-summary { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; margin: 21px 0 18px; padding-top: 17px; border-top: 1px solid rgba(255,255,255,.14); }
.balance-summary > div { position: relative; padding-left: 17px; }
.balance-summary > div + div { border-left: 1px solid rgba(255,255,255,.14); padding-left: 35px; }
.summary-dot { position: absolute; left: 0; top: 3px; width: 7px; height: 7px; border-radius: 50%; }
.balance-summary > div + div .summary-dot { left: 18px; }
.summary-dot.expense { background: #f4b462; }
.summary-dot.income { background: #92d4b5; }
.balance-summary p { color: rgba(255,255,255,.55); font-size: 11px; }
.balance-summary strong { display: block; margin-top: 4px; font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.budget-block { position: relative; z-index: 1; }
.budget-copy { display: flex; justify-content: space-between; margin-bottom: 8px; color: rgba(255,255,255,.62); font-size: 10px; }
.progress-track { height: 4px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.16); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: #f0c779; transition: width .5s ease; }
.progress-track span.over { background: #ef8b74; }

.quick-section, .records-section, .category-section, .trend-section { margin-top: 30px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin: 0 2px 14px; }
.section-heading.compact { margin-bottom: 16px; }
.section-heading .eyebrow { margin-bottom: 3px; }
.text-button { padding: 5px 0; border: 0; background: transparent; color: var(--green); font-size: 12px; font-weight: 700; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.quick-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: #4c5752; font-size: 11px; font-weight: 650; }
.quick-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 18px 18px 18px 7px; font-family: Georgia, "Songti SC", serif; font-size: 17px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); transition: transform .18s ease; }
.quick-item:active .quick-icon { transform: scale(.92); }
.category-food { color: #a7612a; background: #f9e9d4; }
.category-transport { color: #52759a; background: #e2ebf4; }
.category-shopping { color: #8a5f85; background: #eee2ed; }
.category-more { color: #627169; background: #e5eae6; }

.transaction-list { overflow: hidden; border: 1px solid rgba(225,226,217,.9); border-radius: 22px 22px 22px 8px; background: rgba(255,255,252,.8); box-shadow: var(--soft-shadow); }
.transaction-row { width: 100%; display: grid; grid-template-columns: 45px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 14px; border: 0; background: transparent; text-align: left; }
.transaction-row + .transaction-row { border-top: 1px solid var(--line); }
.transaction-row:active { background: #f6f7f2; }
.transaction-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 15px 15px 15px 5px; color: var(--category-color, #587365); background: color-mix(in srgb, var(--category-color, #587365) 14%, white); font-family: Georgia, "Songti SC", serif; font-weight: 700; }
.transaction-main { min-width: 0; }
.transaction-main strong { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-main span { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-value { text-align: right; }
.transaction-value strong { display: block; font-family: Georgia, serif; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.transaction-value strong.income { color: var(--green); }
.transaction-value span { display: block; margin-top: 4px; color: #a4aaa7; font-size: 10px; }
.empty-state { padding: 36px 24px; text-align: center; }
.empty-state-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 19px 19px 19px 7px; background: var(--green-soft); color: var(--green); font-size: 23px; }
.empty-state strong { display: block; font-size: 15px; }
.empty-state p { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.6; }

.page-heading { padding: 21px 2px 22px; }
.page-heading.inline { display: flex; align-items: center; justify-content: space-between; }
.search-box { height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 15px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.8); }
.search-box svg { width: 19px; fill: none; stroke: #89928d; stroke-width: 2; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search-box input::placeholder { color: #a1a8a4; }
.filter-row { display: flex; gap: 8px; margin: 13px 0 18px; }
.filter-pill, .month-chip { padding: 7px 14px; border: 1px solid var(--line); border-radius: 99px; background: rgba(255,255,255,.55); color: #6c7671; font-size: 11px; font-weight: 650; }
.filter-pill.active { border-color: var(--green); color: #fff; background: var(--green); }
.bill-summary { display: flex; justify-content: space-between; padding: 13px 15px; border-radius: 14px; background: #e9eee8; color: #617069; font-size: 11px; }
.bill-summary strong { color: var(--ink); }
.grouped-transactions { margin-top: 20px; }
.date-group + .date-group { margin-top: 22px; }
.date-heading { display: flex; justify-content: space-between; margin: 0 3px 9px; color: var(--muted); font-size: 10px; font-weight: 650; }
.date-heading strong { color: #647069; font-weight: 650; }

.month-chip { color: var(--green); background: var(--green-soft); border-color: transparent; }
.insight-card { border-radius: 24px 24px 24px 8px; background: var(--surface); box-shadow: var(--soft-shadow); }
.overview-insight { display: flex; align-items: center; justify-content: space-between; padding: 23px 22px; }
.card-label { color: var(--muted); font-size: 11px; }
.insight-total { display: block; margin-top: 7px; font-family: Georgia, serif; font-size: 31px; font-weight: 500; }
.comparison { margin-top: 7px; color: var(--muted); font-size: 10px; }
.comparison.good { color: var(--green); }
.comparison.bad { color: var(--red); }
.donut { width: 92px; height: 92px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) 0, var(--green) 0%, #e7ebe7 0); position: relative; }
.donut::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--surface); }
.donut span { position: relative; z-index: 1; font-family: Georgia, serif; font-size: 17px; font-weight: 600; }
.muted-note { color: var(--muted); font-size: 10px; }
.category-breakdown { padding: 4px 17px; border: 1px solid var(--line); border-radius: 21px 21px 21px 8px; background: rgba(255,255,252,.78); }
.category-bar-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px 0; }
.category-bar-row + .category-bar-row { border-top: 1px solid var(--line); }
.mini-category-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 13px 13px 13px 4px; color: var(--category-color); background: color-mix(in srgb, var(--category-color) 13%, white); font-family: Georgia, "Songti SC", serif; font-weight: 700; }
.category-data { min-width: 0; }
.category-data div { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 11px; }
.category-data div span:last-child { color: var(--muted); }
.category-track { height: 5px; border-radius: 99px; background: #eaebe6; overflow: hidden; }
.category-track span { display: block; height: 100%; border-radius: inherit; background: var(--category-color); }
.category-sum { font-family: Georgia, serif; font-size: 14px; font-weight: 600; }
.bar-chart { height: 175px; display: flex; align-items: stretch; justify-content: space-around; gap: 7px; padding: 18px 13px 11px; border: 1px solid var(--line); border-radius: 21px 21px 21px 8px; background: rgba(255,255,252,.78); }
.bar-column { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.bar-value { color: #7c8781; font-family: Georgia, serif; font-size: 8px; opacity: 0; transition: opacity .2s; }
.bar-column:hover .bar-value { opacity: 1; }
.bar { width: min(24px, 70%); min-height: 4px; border-radius: 8px 8px 3px 3px; background: #9dbbab; transition: height .5s ease; }
.bar.today { background: var(--green); }

.settings-hero { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 13px; padding: 18px; border-radius: 22px 22px 22px 8px; color: #fff; background: linear-gradient(145deg, #2c765a, #18523e); box-shadow: 0 12px 28px rgba(31,107,79,.18); }
.settings-avatar { width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 17px 17px 17px 6px; background: rgba(255,255,255,.1); font-family: Georgia, serif; font-size: 23px; }
.settings-hero strong { display: block; font-size: 15px; }
.settings-hero span { display: block; margin-top: 4px; color: rgba(255,255,255,.62); font-size: 10px; }
.settings-hero .safe-tag { margin: 0; padding: 5px 8px; border-radius: 99px; color: #d2eddf; background: rgba(255,255,255,.1); font-size: 9px; font-weight: 700; }
.settings-group { margin-top: 28px; }
.settings-group > h2 { margin: 0 3px 10px; color: #7b8580; font-size: 11px; letter-spacing: .08em; }
.settings-group > .setting-row:first-of-type { border-radius: 18px 18px 0 0; }
.settings-group > .setting-row:last-of-type { border-radius: 0 0 18px 7px; }
.settings-group > .setting-row:only-of-type { border-radius: 18px 18px 18px 7px; }
.setting-row { width: 100%; min-height: 66px; display: grid; grid-template-columns: 39px minmax(0,1fr) auto 17px; align-items: center; gap: 11px; padding: 10px 14px; border: 0; background: rgba(255,255,252,.86); text-align: left; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-row:active:not(.static) { background: #f8f8f4; }
.setting-row.static { grid-template-columns: 39px minmax(0,1fr) auto; cursor: default; }
.setting-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 12px 12px 12px 4px; font-family: Georgia, "Songti SC", serif; font-weight: 700; }
.setting-icon.warm { color: #a7672d; background: #f7e6d4; }
.setting-icon.green { color: #38795e; background: #e2eee7; }
.setting-icon.blue { color: #5479a0; background: #e3ebf4; }
.setting-icon.violet { color: #7e6082; background: #eee5ef; font-size: 12px; }
.setting-icon.red { color: #b45447; background: #f5e3df; }
.setting-row strong { display: block; font-size: 13px; }
.setting-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.setting-value { color: #718079; font-size: 10px; }
.setting-row > svg { width: 16px; fill: none; stroke: #a3aaa6; stroke-width: 1.8; }
.setting-row.danger strong { color: #a95144; }
.version-note { margin: 25px 0 5px; text-align: center; color: #a3aaa6; font-size: 9px; }

.bottom-nav {
  position: fixed;
  z-index: 30;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 520px);
  height: calc(73px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr 64px 1fr 1fr;
  padding: 7px 9px env(safe-area-inset-bottom);
  border-top: 1px solid rgba(219,222,215,.85);
  background: rgba(255,255,252,.93);
  backdrop-filter: blur(20px);
  box-shadow: 0 -7px 26px rgba(34,52,44,.05);
}
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0; border: 0; background: transparent; color: #8c948f; font-size: 9px; }
.nav-item svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.nav-item.active { color: var(--green); font-weight: 700; }
.nav-item.active svg { stroke-width: 2.2; }
.fab { position: fixed; z-index: 35; left: 50%; bottom: calc(37px + env(safe-area-inset-bottom)); transform: translate(-50%, 50%); width: 58px; height: 58px; display: grid; place-items: center; padding: 0; border: 5px solid var(--surface); border-radius: 19px 19px 19px 8px; color: #fff; background: var(--green); box-shadow: 0 9px 22px rgba(31,107,79,.3); }
.fab:active { transform: translate(-50%, 50%) scale(.94); }
.fab svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 2; }

dialog { padding: 0; border: 0; color: var(--ink); }
dialog::backdrop { background: rgba(14, 28, 22, .43); backdrop-filter: blur(3px); }
.sheet-dialog { width: min(100%, 520px); max-width: none; max-height: 92vh; margin: auto auto 0; border-radius: 28px 28px 0 0; background: var(--surface); }
.sheet-dialog[open] { animation: sheet-in .28s cubic-bezier(.22,.82,.34,1); }
@keyframes sheet-in { from { transform: translateY(100%); } }
.entry-sheet { overflow-y: auto; max-height: 92vh; padding: 9px 20px calc(24px + env(safe-area-inset-bottom)); }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 10px; border-radius: 99px; background: #d5d8d2; }
.sheet-heading { height: 42px; display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; }
.sheet-heading h2 { text-align: center; font-size: 17px; }
.sheet-close { width: 36px; height: 36px; border-radius: 11px; background: #f1f1ec; }
.sheet-close svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.delete-entry { justify-self: end; padding: 7px 9px; border: 0; border-radius: 8px; color: var(--red); background: #faebe8; font-size: 11px; font-weight: 700; }
.type-switch { width: 190px; display: grid; grid-template-columns: 1fr 1fr; margin: 14px auto 10px; padding: 3px; border-radius: 12px; background: #eceee8; }
.type-switch button { padding: 8px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.type-switch button.active { color: var(--green); background: #fff; box-shadow: 0 3px 8px rgba(35,58,47,.08); }
.amount-field { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 7px 0 17px; border-bottom: 1px solid var(--line); }
.amount-field span { color: var(--green); font-family: Georgia, serif; font-size: 25px; }
.amount-field input { width: min(230px, 65vw); padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-family: Georgia, serif; font-size: 48px; font-weight: 500; text-align: center; }
.amount-field input::placeholder { color: #c9cec8; }
.amount-field input::-webkit-inner-spin-button { display: none; }
.form-block { margin-top: 18px; }
.form-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.form-label > span, .input-field > span { color: #66716c; font-size: 11px; font-weight: 700; }
.form-label small { color: #a1a8a4; font-size: 9px; }
.category-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 7px; }
.category-option { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: #7e8782; font-size: 9px; }
.category-option span { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid #e7e8e2; border-radius: 13px 13px 13px 4px; background: #f8f8f4; font-family: Georgia, "Songti SC", serif; font-size: 13px; font-weight: 700; }
.category-option.active { color: var(--green); font-weight: 700; }
.category-option.active span { border-color: var(--green); color: #fff; background: var(--green); box-shadow: 0 5px 12px rgba(31,107,79,.18); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.input-field { display: flex; flex-direction: column; gap: 7px; }
.input-field input, .input-field select { width: 100%; height: 43px; padding: 0 11px; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: var(--ink); background: #f8f8f4; font-size: 11px; }
.input-field input:focus, .input-field select:focus { border-color: #79a38f; box-shadow: 0 0 0 3px rgba(31,107,79,.08); }
.note-field { margin-top: 13px; }
.primary-button, .secondary-button, .danger-button { min-height: 48px; border: 0; border-radius: 14px 14px 14px 5px; font-weight: 750; font-size: 13px; }
.primary-button { color: #fff; background: var(--green); box-shadow: 0 8px 20px rgba(31,107,79,.18); }
.entry-sheet > .primary-button { width: 100%; margin-top: 20px; }
.secondary-button { color: #5e6863; background: #eceee9; }
.danger-button { color: #fff; background: var(--red); }

.center-dialog { width: min(calc(100% - 36px), 360px); max-width: none; border-radius: 24px 24px 24px 9px; background: var(--surface); }
.center-dialog[open] { animation: dialog-in .2s ease; }
@keyframes dialog-in { from { opacity: 0; transform: scale(.94); } }
.dialog-card { padding: 26px 22px 22px; text-align: center; }
.dialog-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 16px 16px 16px 5px; color: var(--green); background: var(--green-soft); font-family: Georgia, serif; font-size: 22px; font-weight: 700; }
.dialog-icon.danger-icon { color: var(--red); background: #fae9e5; }
.dialog-card h2 { font-size: 19px; }
.dialog-card > p { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.dialog-amount { display: flex; align-items: baseline; justify-content: center; gap: 5px; margin: 20px 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.dialog-amount span { color: var(--green); font-family: Georgia, serif; font-size: 20px; }
.dialog-amount input { width: 160px; border: 0; outline: 0; background: transparent; font-family: Georgia, serif; font-size: 35px; text-align: center; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 21px; }
.compact-card { padding-top: 24px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(94px + env(safe-area-inset-bottom)); transform: translate(-50%, 18px); max-width: calc(100% - 36px); padding: 10px 15px; border-radius: 12px; color: #fff; background: rgba(24,35,30,.94); box-shadow: var(--shadow); font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 760px) {
  body { padding: 18px 0; }
  .app-shell { min-height: calc(100vh - 36px); border-radius: 28px; }
  .bottom-nav { bottom: 18px; border-radius: 0 0 28px 28px; }
  .fab { bottom: calc(55px + env(safe-area-inset-bottom)); }
  .sheet-dialog { margin-bottom: 18px; border-radius: 28px; }
}

@media (max-width: 360px) {
  main { padding-left: 14px; padding-right: 14px; }
  .balance-card { padding-left: 16px; padding-right: 16px; }
  .balance-summary > div + div { padding-left: 27px; }
  .balance-summary > div + div .summary-dot { left: 12px; }
  .quick-grid { gap: 4px; }
  .quick-icon { width: 47px; height: 47px; }
  .category-picker { gap: 9px 3px; }
}

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