:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  background: #f7f8f5;
  color: #20352e;
  --ink: #20352e;
  --muted: #788982;
  --green: #116b57;
  --green-dark: #075440;
  --green-soft: #e9f4ef;
  --orange: #d2774c;
  --orange-soft: #fff1e7;
  --border: #e7ece7;
  --surface: #ffffff;
  --surface-alt: #f9fbf8;
  --shadow: 0 10px 34px rgb(21 55 42 / 5%);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: #c6e6d8; }
:focus-visible { outline: 3px solid #72b7a2; outline-offset: 3px; }

.loading-screen { display: grid; place-content: center; justify-items: center; gap: 16px; min-height: 100vh; color: var(--muted); }
.loading-screen p { margin: 0; }
.brand-lockup { display: inline-flex; align-items: center; gap: 11px; font-size: 22px; font-weight: 800; letter-spacing: -.04em; color: #153c31; }
.brand-mark { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 13px; background: #126b56; color: white; font-size: 21px; font-weight: 750; box-shadow: 0 7px 16px rgb(18 107 86 / 16%); }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .15em; }

.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(430px, 1fr) minmax(400px, 1fr); background: #fff; }
.auth-panel { width: min(390px, calc(100% - 60px)); margin: 0 auto; padding-top: clamp(32px, 8vh, 84px); }
.auth-copy { margin: clamp(70px, 13vh, 132px) 0 38px; }
.auth-copy h1 { margin: 14px 0 10px; font-size: clamp(31px, 3vw, 39px); letter-spacing: -.06em; line-height: 1.25; }
.auth-copy p { margin: 0; color: var(--muted); }
.auth-footnote { margin-top: 27px; font-size: 12px; color: #9aa6a0; }
.auth-illustration { display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, #e7f1e9 0%, #d3e8dc 60%, #e5eee0 100%); }
.auth-illustration-inner { width: min(480px, 80%); aspect-ratio: 1; position: relative; }
.illustration-sun { position: absolute; inset: 13%; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #f6f9eb, #c4ddc8); box-shadow: inset -16px -24px 60px rgb(69 128 88 / 7%); }
.illustration-orbit { position: absolute; border: 1px solid rgb(255 255 255 / 76%); border-radius: 50%; transform: rotate(-28deg); }
.orbit-one { inset: 4%; }
.orbit-two { inset: -12% 20%; }
.illustration-card { position: absolute; z-index: 1; background: rgb(255 255 255 / 90%); box-shadow: 0 24px 50px rgb(47 90 66 / 12%); backdrop-filter: blur(12px); }
.card-one { width: 58%; top: 21%; left: 12%; min-height: 170px; border-radius: 24px; padding: 25px; transform: rotate(-8deg); }
.card-one .small-line, .card-one .long-line { display: block; height: 8px; border-radius: 99px; background: #cce4d6; }
.card-one .small-line { width: 28%; margin-bottom: 11px; }
.card-one .long-line { width: 65%; margin-bottom: 29px; }
.card-one strong { font-size: 31px; color: #136d56; letter-spacing: -.05em; }
.card-two { display: flex; align-items: center; gap: 14px; top: 54%; left: 29%; padding: 20px 24px; border-radius: 20px; transform: rotate(5deg); color: #476d59; font-size: 14px; white-space: nowrap; }
.coin-circle { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 50%; background: #f7dfbe; color: #bd793e; font-size: 25px; }

.app-layout { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 29px 18px 24px; background: #fff; border-right: 1px solid var(--border); }
.sidebar-brand { margin: 0 12px 63px; }
.sidebar-label { padding: 0 15px; margin-bottom: 12px; color: #a3aea8; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.main-nav { display: grid; gap: 5px; }
.main-nav a { display: flex; align-items: center; gap: 13px; min-height: 45px; padding: 0 15px; border-radius: 12px; color: #6a7d72; font-weight: 600; transition: background .15s, color .15s; }
.main-nav a:hover { background: #f6f8f5; color: var(--ink); }
.main-nav a.active { background: var(--green-soft); color: var(--green); }
.nav-icon { display: grid; place-items: center; width: 22px; font-size: 22px; font-weight: 400; line-height: 1; }
.sidebar-bottom { margin-top: auto; padding: 0 10px; }
.sidebar-note { display: flex; align-items: flex-start; gap: 11px; padding: 15px; margin-bottom: 19px; border-radius: 14px; background: #f5f9f3; color: #6f8374; font-size: 12px; }
.sidebar-note-icon { color: #79aa7d; font-size: 17px; line-height: 1; }
.text-button { padding: 4px 5px; border: 0; background: none; color: #86958a; font-size: 12px; }
.text-button:hover { color: var(--green); text-decoration: underline; }
.workspace { min-width: 0; }
.topbar { min-height: 105px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px clamp(24px, 4vw, 58px); border-bottom: 1px solid var(--border); background: rgb(255 255 255 / 75%); }
.topbar-heading { line-height: 1.15; }
.topbar-heading #topbar-kicker { display: block; margin-bottom: 7px; color: #93a19a; font-size: 12px; font-weight: 600; }
.topbar h1 { margin: 0; font-size: 24px; font-weight: 760; letter-spacing: -.04em; }
.mobile-brand { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.currency-switch { display: flex; gap: 2px; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: #f7f9f6; }
.currency-switch button { padding: 8px 11px; border: 0; border-radius: 8px; background: transparent; color: #8a9b91; white-space: nowrap; font-size: 12px; font-weight: 650; }
.currency-switch button.active { background: #fff; color: var(--green); box-shadow: 0 2px 6px rgb(19 55 40 / 8%); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; font-size: 13px; white-space: nowrap; transition: transform .12s, background .12s, box-shadow .12s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { background: var(--green); color: #fff; box-shadow: 0 7px 16px rgb(17 107 87 / 15%); }
.button-primary:hover:not(:disabled) { background: var(--green-dark); }
.button-secondary { background: #fff; border-color: #dce6de; color: var(--ink); }
.button-secondary:hover:not(:disabled) { background: #f6faf6; }
.button-danger { background: #fff; border-color: #f4dbd3; color: #b45f48; }
.button-danger:hover:not(:disabled) { background: #fff5f1; }
.button-quiet { background: #f3f6f2; color: var(--ink); }
.button-full { width: 100%; }
.button-small { min-height: 33px; padding: 6px 11px; font-size: 12px; }
.button-icon { width: 34px; min-height: 34px; padding: 0; font-size: 19px; }
.mobile-nav { display: none; }
.content { max-width: 1450px; margin: 0 auto; padding: 34px clamp(24px, 4vw, 58px) 80px; }
.view-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.view-intro h2 { margin: 0 0 5px; font-size: 24px; letter-spacing: -.05em; }
.view-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.section-head h2 { margin: 0; font-size: 18px; letter-spacing: -.04em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.section-head .link-button { white-space: nowrap; }
.link-button { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 6px 0; background: none; color: var(--green); font-size: 12px; font-weight: 750; }
.link-button:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.rate-note { display: inline-flex; gap: 5px; align-items: center; color: var(--muted); font-size: 12px; }
.rate-note::before { content: "•"; color: #9db6a8; }

.period-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 35px; }
.period-card, .panel { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.period-card { min-width: 0; padding: 22px; border-radius: 17px; }
.period-card:first-child { border-color: #c8ded1; background: linear-gradient(150deg, #f7fcf8, #fff 70%); }
.period-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 25px; }
.period-heading { display: flex; flex-direction: column; gap: 3px; }
.period-heading strong { font-size: 15px; }
.period-heading small { font-size: 11px; color: var(--muted); }
.period-controls { display: inline-flex; align-items: center; gap: 3px; }
.period-controls button, .icon-button { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid #e5ece5; border-radius: 8px; background: #fff; color: #7c9384; font-size: 19px; line-height: 1; }
.period-controls button:hover, .icon-button:hover { color: var(--green); border-color: #b7d3c4; }
.period-controls button:disabled { opacity: .3; }
.period-main-label { color: #7a9185; font-size: 11px; font-weight: 650; }
.period-main-value { display: block; margin: 2px 0 22px; color: var(--ink); font-size: clamp(23px, 2.6vw, 34px); font-variant-numeric: tabular-nums; font-weight: 780; letter-spacing: -.055em; overflow-wrap: anywhere; }
.currency-line { display: block; white-space: nowrap; }
.period-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 16px; border-top: 1px solid #edf1eb; }
.metric-label { display: flex; align-items: center; gap: 6px; color: #7e9086; font-size: 11px; }
.metric-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.metric-label.expense::before { background: var(--orange); }
.metric-value { display: block; margin-top: 4px; font-size: 14px; font-weight: 740; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, .85fr); gap: 20px; }
.panel { border-radius: 17px; min-width: 0; }
.panel-pad { padding: 22px; }
.quick-card { padding: 26px; background: #ecf5eb; border-color: #d9e9da; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; overflow: hidden; position: relative; }
.quick-card::after { content: ""; position: absolute; width: 190px; height: 190px; right: -58px; bottom: -73px; border: 22px solid rgb(82 148 96 / 8%); border-radius: 50%; }
.quick-card .eyebrow { position: relative; z-index: 1; }
.quick-card h2 { position: relative; z-index: 1; max-width: 220px; margin: 13px 0 8px; font-size: 26px; line-height: 1.3; letter-spacing: -.05em; }
.quick-card p { position: relative; z-index: 1; margin: 0 0 27px; color: #698571; font-size: 12px; }
.quick-card button { position: relative; z-index: 1; }
.transaction-list { display: grid; }
.transaction-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 0; border: 0; border-bottom: 1px solid #edf0ec; background: none; text-align: left; }
.transaction-row:last-child { border-bottom: 0; }
.transaction-row:hover .transaction-title { color: var(--green); }
.transaction-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: #f2f6f1; color: #5a9a73; font-size: 18px; }
.transaction-icon.income { background: #e7f4ec; color: #208366; }
.transaction-icon.expense { background: #fff1e9; color: #cd7750; }
.transaction-body { min-width: 0; flex: 1; }
.transaction-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 710; }
.transaction-subtitle { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; color: var(--muted); font-size: 11px; }
.transaction-amount { flex: none; text-align: right; font-size: 14px; font-weight: 760; font-variant-numeric: tabular-nums; }
.transaction-amount.income { color: var(--green); }
.transaction-amount.expense { color: #b66648; }
.transaction-amount small { display: block; font-size: 10px; font-weight: 500; color: #99a69e; }
.empty-state { display: grid; place-items: center; gap: 7px; padding: 55px 20px; color: var(--muted); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 7px; border-radius: 18px; background: #edf6ee; color: #559879; font-size: 25px; }
.empty-state strong { color: var(--ink); font-size: 15px; }
.empty-state p { max-width: 310px; margin: 0; font-size: 12px; }
.empty-state .button { margin-top: 12px; }
.loading-content { padding: 42px 20px; color: var(--muted); text-align: center; font-size: 13px; }
.error-state { padding: 27px; border: 1px solid #f1dcd1; border-radius: 12px; background: #fff7f3; color: #a6583b; font-size: 13px; }
.error-state button { margin-top: 12px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 18px; }
.toolbar .field { min-width: 118px; flex: 1; }
.toolbar .field.date-field { min-width: 145px; }
.toolbar .button { align-self: end; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span, .field > label { color: #5d7267; font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #dfe8e0; border-radius: 10px; outline: none; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 75px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #8abfa6; box-shadow: 0 0 0 3px rgb(67 154 109 / 12%); }
.field input::placeholder, .field textarea::placeholder { color: #b0bbb3; }
.field-hint { font-size: 11px; color: #9baaa0; }
.form-error { margin: 0; padding: 10px 12px; border-radius: 9px; background: #fff2ed; color: #b45a3d; font-size: 12px; }
.form-stack { display: grid; gap: 17px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.segmented { display: inline-flex; gap: 3px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: #f7f9f6; }
.segmented button { min-height: 32px; padding: 5px 13px; border: 0; border-radius: 7px; background: transparent; color: #83958a; font-size: 12px; font-weight: 700; }
.segmented button.active { background: #fff; box-shadow: 0 2px 8px rgb(39 73 50 / 9%); color: var(--green); }
.segmented.wide { display: flex; }
.segmented.wide button { flex: 1; }
.filter-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filter-bar .field { min-width: 132px; flex: 1 1 132px; }
.filter-bar .field.date-field { flex: 1 1 154px; }
.filter-bar .filter-actions { padding-bottom: 1px; }
.ledger-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px 5px; }
.ledger-head h2 { margin: 0; font-size: 15px; }
.ledger-head span { color: var(--muted); font-size: 12px; }
.ledger-list { padding: 0 22px 10px; }
.ledger-date-heading { margin: 23px 0 3px; color: #85968b; font-size: 11px; font-weight: 700; }
.ledger-date-heading:first-child { margin-top: 13px; }

.stats-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 19px; }
.stats-controls .period-pager { margin-left: auto; }
.period-pager { display: flex; align-items: center; gap: 6px; }
.period-pager .period-label { min-width: 125px; text-align: center; font-size: 12px; font-weight: 700; }
.period-pager .button { min-height: 33px; padding: 4px 9px; }
.stats-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 19px; }
.stats-summary .panel { padding: 18px 20px; }
.stats-summary span { display: block; color: var(--muted); font-size: 11px; }
.stats-summary strong { display: block; margin-top: 5px; font-size: clamp(17px, 2.5vw, 24px); font-variant-numeric: tabular-nums; letter-spacing: -.045em; overflow-wrap: anywhere; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.stats-grid .panel { padding: 22px; }
.stats-grid .panel.full-span { grid-column: 1 / -1; }
.stat-list { display: grid; gap: 18px; margin-top: 22px; }
.stat-item { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; }
.stat-item.clickable:hover .stat-label { color: var(--green); text-decoration: underline; }
.stat-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 7px; }
.stat-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.stat-values { flex: none; color: #52665a; font-size: 11px; font-variant-numeric: tabular-nums; }
.stat-values b { color: var(--ink); font-size: 12px; }
.stat-bar { height: 7px; border-radius: 99px; overflow: hidden; background: #eef2ed; }
.stat-bar-fill { display: block; height: 100%; border-radius: inherit; background: #4da387; }
.stat-bar-fill.expense { background: #e6a180; }
.stat-bar-fill.tag { background: #a5abda; }
.tag-note { padding: 12px 13px; margin-top: 18px; border-radius: 9px; background: #f5f5fb; color: #7a7b96; font-size: 11px; }
.event-summary { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.event-summary > div { flex: 1; min-width: 115px; padding: 13px 15px; border-radius: 10px; background: #f6f9f5; }
.event-summary span { display: block; color: var(--muted); font-size: 10px; }
.event-summary strong { display: block; margin-top: 3px; font-size: 16px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-grid .panel { padding: 22px; }
.settings-grid .wide-panel { grid-column: 1 / -1; }
.settings-section h2 { margin: 0 0 5px; font-size: 16px; }
.settings-section > p { margin: 0 0 17px; color: var(--muted); font-size: 12px; }
.setting-inline { display: flex; align-items: end; gap: 10px; }
.setting-inline .field { flex: 1; }
.setting-inline .button { flex: none; }
.setting-list { display: grid; gap: 6px; margin-top: 17px; }
.setting-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 39px; padding: 6px 11px; border: 1px solid #eaf0e9; border-radius: 9px; font-size: 12px; }
.setting-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setting-item button { flex: none; border: 0; padding: 4px; background: none; color: #a57a6d; font-size: 11px; }
.setting-item button:hover { color: #bb6045; text-decoration: underline; }
.setting-item .builtin { color: #a0aaa2; font-size: 10px; }
.setting-tabbar { margin: 13px 0; }
.backup-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.backup-actions input { display: none; }
.backup-preview { margin-top: 16px; padding: 16px; border: 1px solid #dce8dc; border-radius: 12px; background: #f9fbf8; }
.backup-preview h3 { margin: 0 0 8px; font-size: 14px; }
.backup-preview p { margin: 4px 0; color: #617367; font-size: 12px; }
.backup-preview-list { max-height: 250px; overflow: auto; margin: 12px 0; }
.backup-preview-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-top: 1px solid #e4ebe2; font-size: 12px; }
.backup-preview-item input { margin-top: 3px; }
.conflict-options { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 5px; color: var(--muted); font-size: 11px; }
.conflict-options select { min-height: 30px; padding: 4px 6px; border: 1px solid #dfe8e0; border-radius: 6px; background: #fff; color: var(--ink); }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: flex; justify-content: center; align-items: center; padding: 18px; background: rgb(20 41 31 / 48%); backdrop-filter: blur(3px); }
.modal { width: min(100%, 570px); max-height: min(90vh, 800px); display: flex; flex-direction: column; border-radius: 19px; background: #fff; box-shadow: 0 30px 100px rgb(20 48 31 / 25%); overflow: hidden; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 23px 25px 13px; }
.modal-header h2 { margin: 0; font-size: 20px; letter-spacing: -.04em; }
.modal-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.modal-close { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: #f3f6f2; color: #829387; font-size: 21px; }
.modal-body { padding: 4px 25px 25px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 25px; }
.modal-actions .right-actions { display: flex; gap: 9px; margin-left: auto; }
.chip-tray { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 4px 8px; border: 1px solid #d5e8da; border-radius: 7px; background: #eef7ee; color: #29664d; font-size: 11px; font-weight: 700; }
.chip button { padding: 0 1px; border: 0; background: none; color: #66957b; font-size: 15px; line-height: 1; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suggestions button { padding: 4px 8px; border: 1px solid #e2eae0; border-radius: 7px; background: #fff; color: #718879; font-size: 11px; }
.suggestions button:hover { border-color: #a9d1b8; color: var(--green); }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.details-grid > div { min-width: 0; }
.details-grid dt { color: var(--muted); font-size: 11px; }
.details-grid dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 650; }
.details-grid .wide-detail { grid-column: 1 / -1; }
.confirm-text { margin: 9px 0 0; color: #607166; font-size: 13px; line-height: 1.7; }
.toast { position: fixed; z-index: 30; right: 22px; bottom: 22px; max-width: min(420px, calc(100% - 44px)); padding: 12px 16px; border-radius: 10px; background: #274b3d; color: white; box-shadow: 0 12px 30px rgb(30 64 45 / 25%); font-size: 12px; }
.toast.error { background: #a85540; }

@media (max-width: 1080px) {
  .period-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .period-card:first-child { grid-column: 1 / -1; }
  .split-layout { grid-template-columns: 1fr; }
  .quick-card { min-height: 190px; }
  .quick-card h2 { max-width: unset; }
  .stats-grid { grid-template-columns: 1fr; }
  .stats-grid .panel.full-span { grid-column: auto; }
}
@media (max-width: 760px) {
  .app-layout { display: block; }
  .sidebar { display: none; }
  .topbar { min-height: 81px; padding: 15px 18px; }
  .mobile-brand { display: block; margin-bottom: 2px; color: var(--green); font-size: 12px; font-weight: 800; }
  .topbar-heading #topbar-kicker { display: none; }
  .topbar h1 { font-size: 19px; }
  .topbar-actions { gap: 8px; }
  .topbar .add-button { display: none; }
  .currency-switch button { padding: 6px 8px; font-size: 11px; }
  .content { padding: 23px 17px 100px; }
  .mobile-nav { position: fixed; z-index: 10; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: 72px; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--border); background: rgb(255 255 255 / 96%); box-shadow: 0 -7px 20px rgb(22 65 42 / 5%); }
  .mobile-nav a { display: grid; justify-items: center; gap: 0; color: #96a399; }
  .mobile-nav a.active { color: var(--green); }
  .mobile-nav a > span { font-size: 24px; line-height: 1; }
  .mobile-nav small { font-size: 10px; font-weight: 650; }
  .mobile-add { width: 45px; height: 45px; margin: -15px auto 0; border: 0; border-radius: 14px; background: var(--green); color: white; box-shadow: 0 8px 16px rgb(17 107 87 / 20%); font-size: 28px; line-height: 1; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .wide-panel { grid-column: auto; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-panel { width: min(390px, calc(100% - 44px)); padding-top: 35px; }
  .auth-copy { margin: 100px 0 33px; }
  .auth-illustration { display: none; }
}
@media (max-width: 580px) {
  .period-grid { grid-template-columns: 1fr; gap: 11px; }
  .period-card:first-child { grid-column: auto; }
  .period-card { padding: 18px; }
  .period-head { margin-bottom: 16px; }
  .period-main-value { margin-bottom: 15px; }
  .stats-summary { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stats-summary .panel:last-child { grid-column: 1 / -1; }
  .view-intro h2 { font-size: 21px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .modal-header { padding: 21px 19px 12px; }
  .modal-body { padding: 3px 19px calc(20px + env(safe-area-inset-bottom)); }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .period-pager .period-label { min-width: 110px; }
}
