:root {
  --bg: #f4f5ef;
  --surface: #ffffff;
  --surface-soft: #edf0e8;
  --ink: #172018;
  --muted: #687268;
  --line: #dde2d8;
  --accent: #244c35;
  --accent-2: #d7f25b;
  --accent-soft: #e5ebdc;
  --income: #277a52;
  --expense: #b55445;
  --transfer: #526c9b;
  --danger: #a13c31;
  --shadow: 0 12px 36px rgba(31, 47, 34, .07);
  --radius: 20px;
  --radius-sm: 12px;
  --content: 1120px;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--ink); }
body, button, input, textarea, select { font: inherit; }
button, input, textarea, select { color: inherit; }
a { color: inherit; }
svg { display: block; width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-160%); padding: 8px 12px; border-radius: 8px; background: var(--ink); color: white; }
.skip-link:focus { transform: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.desktop-only { display: none !important; }

.topbar { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 max(20px, env(safe-area-inset-left)); border-bottom: 1px solid rgba(221,226,216,.8); background: rgba(244,245,239,.9); backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; letter-spacing: -.02em; text-decoration: none; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: var(--ink); color: var(--accent-2); font-family: Georgia, serif; font-size: 1.15rem; }
.brand-mark-large { width: 54px; height: 54px; border-radius: 17px; font-size: 1.7rem; box-shadow: 0 8px 25px rgba(23,32,24,.18); }
.topbar-actions { display: flex; align-items: center; margin-left: auto; gap: 8px; }
.user-chip { max-width: 100px; overflow: hidden; padding: 7px 10px; color: var(--muted); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.inline-form { margin: 0; }
.icon-button { display: grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.65); color: var(--muted); cursor: pointer; }
.icon-button:hover { border-color: #bdc7bb; color: var(--ink); }

.page { width: min(100%, var(--content)); margin: 0 auto; padding: 28px 18px 112px; }
.page-narrow { max-width: 760px; }
.page-heading, .hero-row, .section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-heading { margin: 4px 0 24px; }
.page-heading h1, .hero-row h1 { margin: 4px 0 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(1.9rem, 7vw, 3rem); font-weight: 500; letter-spacing: -.04em; line-height: 1.08; }
.page-heading p { max-width: 38rem; margin: 9px 0 0; color: var(--muted); line-height: 1.6; }
.hero-row { margin: 4px 0 25px; }
.eyebrow { color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }

.card { border: 1px solid rgba(221,226,216,.9); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 1px solid transparent; border-radius: 12px; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid rgba(36,76,53,.22); outline-offset: 2px; }
.button-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 18px rgba(36,76,53,.18); }
.button-primary:hover { background: #193d29; }
.button-secondary { border-color: var(--line); background: var(--surface); color: var(--accent); }
.button-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button-danger { border-color: #e7c3bd; background: #fff3f1; color: var(--danger); }
.button-block { width: 100%; }
.button-group { display: flex; flex-wrap: wrap; gap: 10px; }
.text-link { align-self: center; color: var(--muted); font-size: .88rem; }

.summary-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.summary-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.65); }
.summary-card > span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .84rem; }
.summary-card strong { display: block; margin: 12px 0 6px; font-family: Georgia, serif; font-size: clamp(1.45rem, 5vw, 2.4rem); font-weight: 500; line-height: 1; overflow-wrap: anywhere; }
.summary-card small { color: var(--muted); }
.summary-balance { grid-column: 1 / -1; padding: 24px; border-color: transparent; background: var(--ink); color: white; box-shadow: 0 18px 36px rgba(23,32,24,.14); }
.summary-balance > span, .summary-balance small { color: #b9c4b9; }
.summary-balance strong { color: var(--accent-2); font-size: clamp(2.1rem, 9vw, 3.4rem); }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-income { background: var(--income); }
.dot-expense { background: var(--expense); }

.ai-quick-card { position: relative; display: grid; margin: 18px 0 38px; padding: 20px; gap: 14px; border: 1px solid #d5dcab; border-radius: var(--radius); background: linear-gradient(135deg, #ecf1dc, #f5f8e8); overflow: hidden; }
.ai-quick-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -80px; top: -100px; border-radius: 50%; background: rgba(215,242,91,.28); }
.ai-orb { position: relative; z-index: 1; display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: var(--accent); color: var(--accent-2); box-shadow: 0 8px 18px rgba(36,76,53,.18); }
.ai-orb-large { width: 52px; height: 52px; border-radius: 17px; font-size: 1.25rem; }
.ai-quick-copy { position: relative; z-index: 1; }
.ai-quick-copy h2 { margin: 0; font-size: 1.1rem; }
.ai-quick-copy p { margin: 5px 0 0; color: var(--muted); font-size: .88rem; }
.ai-inline-form { position: relative; z-index: 1; display: flex; min-width: 0; padding: 5px; border: 1px solid rgba(36,76,53,.15); border-radius: 14px; background: white; box-shadow: 0 6px 20px rgba(36,76,53,.08); }
.ai-inline-form input { min-width: 0; flex: 1; padding: 8px 10px; border: 0; outline: none; background: transparent; }
.ai-inline-form button { min-width: 66px; border: 0; border-radius: 10px; background: var(--accent); color: white; font-weight: 700; cursor: pointer; }
[data-ai-form].is-loading button { cursor: wait; opacity: .8; }
.loading-dot { display: none; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.45); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
[data-ai-form].is-loading .loading-dot { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.section-heading { margin: 0 2px 13px; }
.section-heading h2 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; }
.section-heading > a { color: var(--accent); font-size: .85rem; font-weight: 700; text-decoration: none; }
.transaction-list { padding: 4px 16px; overflow: hidden; }
.transaction-row { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 76px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.transaction-row:last-child { border-bottom: 0; }
.transaction-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 13px; font-size: .77rem; font-weight: 800; }
.transaction-icon.expense { background: #f8e9e5; color: var(--expense); }
.transaction-icon.income { background: #e2f3e9; color: var(--income); }
.transaction-icon.transfer { background: #e7ecf6; color: var(--transfer); }
.transaction-main { min-width: 0; }
.transaction-title { display: flex; align-items: center; min-width: 0; gap: 7px; }
.transaction-title strong { overflow: hidden; font-size: .93rem; text-overflow: ellipsis; white-space: nowrap; }
.transaction-main p { margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: .77rem; text-overflow: ellipsis; white-space: nowrap; }
.ai-badge { flex: none; padding: 2px 5px; border-radius: 5px; background: #edf2d1; color: var(--accent); font-size: .58rem; font-weight: 900; letter-spacing: .05em; }
.transaction-side { min-width: 72px; text-align: right; }
.transaction-side strong { display: block; font-size: .95rem; }
.transaction-side time { display: block; margin-top: 5px; color: var(--muted); font-size: .71rem; }
.money.positive, .positive { color: var(--income); }
.money.negative { color: var(--ink); }
.money.neutral { color: var(--transfer); }
.row-link { position: absolute; inset: 0; }
.transaction-row:hover .transaction-title strong { color: var(--accent); }

.empty-state { padding: 48px 20px; text-align: center; }
.empty-icon { display: grid; width: 54px; height: 54px; margin: 0 auto 16px; place-items: center; border-radius: 18px; background: var(--surface-soft); color: var(--accent); font-family: Georgia, serif; font-size: 1.45rem; }
.empty-state h2, .empty-state h3 { margin: 0; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.empty-state p { margin: 9px 0 18px; color: var(--muted); }

.filter-card { margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.search-field { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px; background: var(--surface-soft); color: var(--muted); }
.search-field input { width: 100%; padding: 11px 0; border: 0; outline: 0; background: transparent; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.filter-row label { min-width: 115px; flex: 1; }
.filter-row input, .filter-row select { width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.filter-row .button { min-height: 42px; }
.list-summary { display: flex; margin: 0 2px 12px; gap: 14px; color: var(--muted); font-size: .79rem; }
.list-summary strong { color: var(--ink); }
.list-summary .positive { color: var(--income); }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 18px; color: var(--muted); font-size: .82rem; }
.pagination a { color: var(--accent); font-weight: 700; text-decoration: none; }
.pagination a:last-child { text-align: right; }

.entry-form { padding: 18px; }
.type-switch { display: grid; margin: 0 0 24px; padding: 4px; border: 0; border-radius: 14px; background: var(--surface-soft); grid-template-columns: repeat(3, 1fr); }
.type-switch label { cursor: pointer; }
.type-switch input { position: absolute; opacity: 0; }
.type-switch span { display: block; padding: 9px; border-radius: 10px; color: var(--muted); font-size: .88rem; font-weight: 700; text-align: center; }
.type-switch input:checked + span { background: white; color: var(--ink); box-shadow: 0 3px 12px rgba(31,47,34,.08); }
.type-switch input:focus-visible + span { outline: 3px solid rgba(36,76,53,.22); }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span:first-child { color: #475148; font-size: .81rem; font-weight: 700; }
.field em { color: var(--muted); font-size: .7rem; font-style: normal; font-weight: 400; }
.field input, .field select, .field textarea, .add-inline-form input, .add-inline-form select { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: #fbfcf9; outline: none; transition: border .15s, box-shadow .15s; }
.field input, .field select, .add-inline-form input, .add-inline-form select { height: 46px; padding: 0 12px; }
.field textarea { padding: 11px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .add-inline-form input:focus, .add-inline-form select:focus { border-color: #91a395; box-shadow: 0 0 0 3px rgba(36,76,53,.08); }
.amount-field { margin-bottom: 20px; text-align: center; }
.amount-field > span:first-child { text-align: left; }
.amount-input { display: flex; align-items: center; justify-content: center; gap: 8px; }
.amount-input b { color: var(--muted); font-family: Georgia, serif; font-size: 1.7rem; font-weight: 400; }
.amount-input input { width: min(100%, 320px); height: 64px; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-family: Georgia, serif; font-size: clamp(2rem, 10vw, 3.2rem); text-align: center; }
.field-error { min-height: 1em; color: var(--danger); font-size: .72rem; }
.form-grid { display: grid; gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 24px; gap: 10px; }
.transfer-only { display: none; }
.entry-form[data-type="transfer"] .transfer-only { display: grid; }
.entry-form[data-type="transfer"] .category-only { display: none; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding: 18px; gap: 16px; border: 1px solid #ead2cd; border-radius: var(--radius); }
.danger-zone strong { font-size: .9rem; }
.danger-zone p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }

.ai-compose-card { display: grid; padding: 20px; gap: 16px; border: 1px solid #d5dcab; border-radius: var(--radius); background: linear-gradient(145deg,#f0f3e2,#fff); box-shadow: var(--shadow); }
.ai-compose-card form > label { display: block; margin-bottom: 8px; font-weight: 750; }
.ai-compose-card textarea { width: 100%; min-height: 130px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.8); line-height: 1.6; outline: none; resize: vertical; }
.ai-compose-card textarea:focus { border-color: #91a395; box-shadow: 0 0 0 3px rgba(36,76,53,.08); }
.compose-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; color: var(--muted); font-size: .75rem; }
.clarification-card { margin-top: 20px; padding: 22px; border: 1px solid #e7d6aa; border-radius: var(--radius); background: #fff9e9; }
.clarification-card h2 { margin: 6px 0 18px; font-family: Georgia, serif; font-size: 1.25rem; font-weight: 500; line-height: 1.45; }
.clarification-card form { display: grid; gap: 12px; }
.clarification-card .button { justify-self: end; }
.draft-section { margin-top: 30px; }
.status-pill { padding: 5px 9px; border-radius: 100px; background: #fff3d3; color: #7d611b; font-size: .7rem; font-weight: 700; }
.draft-form { display: grid; gap: 14px; }
.draft-card { min-width: 0; margin: 0; padding: 18px; }
.draft-card legend { padding: 0 8px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.draft-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.draft-head strong { font-family: Georgia, serif; font-size: 1.75rem; font-weight: 500; }
.type-label { padding: 5px 9px; border-radius: 8px; font-size: .72rem; font-weight: 800; }
.type-expense { background: #f8e9e5; color: var(--expense); }
.type-income { background: #e2f3e9; color: var(--income); }
.type-transfer { background: #e7ecf6; color: var(--transfer); }
.uncertain-note { padding: 9px 11px; border-radius: 9px; background: #fff7dc; color: #725b1b; font-size: .78rem; }
.sticky-actions { position: sticky; bottom: 78px; z-index: 5; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.92); box-shadow: 0 10px 30px rgba(31,47,34,.12); backdrop-filter: blur(12px); }
.tips { margin: 28px 4px; color: var(--muted); font-size: .85rem; line-height: 1.7; }
.tips h2 { color: var(--ink); font-family: Georgia, serif; font-size: 1.15rem; font-weight: 500; }
.tips ul { padding-left: 20px; }
.tips > p { font-weight: 700; }

.settings-grid { display: grid; gap: 16px; }
.settings-panel { min-width: 0; padding: 20px; }
.panel-heading h2, .data-panel h2 { margin: 0; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.panel-heading p, .data-panel p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; }
.manage-list { margin: 18px 0; padding: 0; list-style: none; }
.manage-list li { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; min-height: 58px; gap: 10px; border-bottom: 1px solid var(--line); }
.manage-list li:last-child { border-bottom: 0; }
.manage-list strong, .manage-list small { display: block; }
.manage-list strong { font-size: .88rem; }
.manage-list small { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.manage-list a { color: var(--accent); font-size: .75rem; font-weight: 700; }
.account-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot-color); }
.manage-balance { font-size: .82rem; font-weight: 700; }
.category-symbol { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: var(--surface-soft); color: var(--accent); font-weight: 800; }
.category-list li { grid-template-columns: auto minmax(0,1fr) auto; }
.add-inline-form { display: flex; align-items: stretch; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.add-inline-form label:first-of-type { min-width: 80px; flex: 1; }
.add-inline-form select { width: 80px; padding: 0 6px; }
.add-inline-form .button { flex: none; padding-inline: 13px; }
.mini-empty { margin: 20px 0; padding: 26px 10px; border-radius: 12px; background: var(--surface-soft); color: var(--muted); text-align: center; font-size: .83rem; }
.data-panel { display: flex; flex-direction: column; margin-top: 16px; padding: 20px; gap: 16px; }
.ai-settings-form { display: grid; gap: 20px; }
.secret-summary { display: flex; align-items: center; justify-content: space-between; padding: 14px; gap: 14px; border-radius: 13px; background: var(--surface-soft); }
.secret-summary strong, .secret-summary small { display: block; }
.secret-summary small { margin-top: 4px; color: var(--muted); font-size: .74rem; }
.status-ready { background: #e2f3e9; color: var(--income); }
.check-row { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .82rem; cursor: pointer; }
.check-row input { width: 17px; height: 17px; accent-color: var(--accent); }
.price-grid { display: grid; gap: 16px; }
.secret-note, .provider-defaults { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcf9; }
.secret-note strong, .provider-defaults > strong { font-size: .86rem; }
.secret-note p { margin: 7px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.65; }
.secret-note code, .provider-defaults code { padding: 2px 5px; border-radius: 5px; background: var(--surface-soft); font-size: .75rem; }
.provider-defaults ul { margin: 9px 0 0; padding-left: 19px; color: var(--muted); font-size: .74rem; line-height: 1.75; overflow-wrap: anywhere; }

.alert { display: flex; align-items: flex-start; justify-content: space-between; margin: 0 0 18px; padding: 12px 14px; gap: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: .85rem; line-height: 1.5; }
.alert-success { border-color: #bcdcc8; background: #edfaf2; color: #215d3d; }
.alert-error { border-color: #e5bbb4; background: #fff1ef; color: #84392f; }
.alert-info { border-color: #becce2; background: #f0f4fa; color: #3d587e; }
.alert a { font-weight: 700; }
.alert-close { border: 0; background: transparent; color: currentColor; cursor: pointer; font-size: 1.2rem; line-height: 1; }

.bottom-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; height: calc(70px + env(safe-area-inset-bottom)); padding: 7px 8px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255,255,255,.94); grid-template-columns: repeat(5, 1fr); backdrop-filter: blur(18px); }
.bottom-nav > a { display: flex; min-width: 0; align-items: center; justify-content: center; flex-direction: column; gap: 4px; color: #7d867e; font-size: .64rem; font-weight: 650; text-decoration: none; }
.bottom-nav > a svg { width: 20px; height: 20px; }
.bottom-nav > a.active { color: var(--accent); }
.bottom-nav .nav-add { position: relative; }
.nav-add-icon { display: grid; width: 42px; height: 42px; margin-top: -25px; place-items: center; border: 4px solid var(--bg); border-radius: 50%; background: var(--accent); color: white; box-shadow: 0 5px 14px rgba(36,76,53,.22); }
.nav-add-icon svg { width: 21px !important; height: 21px !important; }
.site-footer { display: none; }

.auth-page, .error-page { background: radial-gradient(circle at 10% 10%, #edf1d8, transparent 34%), radial-gradient(circle at 95% 90%, #dfe9df, transparent 30%), var(--bg); }
.auth-main, .error-main { display: grid; min-height: 100vh; padding: 20px; place-items: center; }
.auth-card { width: min(100%, 420px); padding: 30px 24px; border: 1px solid rgba(221,226,216,.9); border-radius: 28px; background: rgba(255,255,255,.82); box-shadow: 0 30px 70px rgba(31,47,34,.12); backdrop-filter: blur(14px); }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand p { color: var(--muted); font-size: .72rem; font-weight: 900; letter-spacing: .18em; }
.auth-copy { margin: 36px 0 24px; }
.auth-copy h1 { margin: 5px 0 8px; font-family: Georgia, serif; font-size: 2.35rem; font-weight: 500; letter-spacing: -.04em; }
.auth-copy p, .auth-note { color: var(--muted); }
.stack-form { display: grid; gap: 16px; }
.password-field { position: relative; }
.password-field input { padding-right: 64px; }
.text-button { position: absolute; right: 8px; top: 50%; padding: 5px 7px; border: 0; background: transparent; color: var(--accent); font-size: .75rem; font-weight: 700; transform: translateY(-50%); cursor: pointer; }
.auth-note { margin: 22px 0 0; font-size: .74rem; text-align: center; }
.error-main { align-content: center; gap: 26px; }
.error-card { width: min(100%, 520px); text-align: center; }
.error-code { color: var(--accent); font-family: Georgia, serif; font-size: clamp(4rem, 20vw, 8rem); line-height: 1; opacity: .22; }
.error-card h1 { margin: -10px 0 8px; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.error-card p { margin: 0 auto 22px; color: var(--muted); line-height: 1.6; }
.error-card .button-group { justify-content: center; }
.error-card small { display: block; margin-top: 26px; color: var(--muted); }

@media (min-width: 680px) {
  .page { padding: 40px 28px 118px; }
  .desktop-only { display: inline-flex !important; }
  .summary-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .summary-balance { grid-column: auto; }
  .ai-quick-card { grid-template-columns: auto minmax(150px,.6fr) minmax(280px,1.4fr); align-items: center; padding: 22px 24px; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .field-wide { grid-column: 1 / -1; }
  .compact-grid { grid-template-columns: repeat(2, 1fr); }
  .data-panel { align-items: center; justify-content: space-between; flex-direction: row; }
  .price-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .auth-card { padding: 38px; }
}

@media (min-width: 940px) {
  .app-shell { padding-left: 220px; }
  .topbar { z-index: 35; height: 74px; padding: 0 34px; backdrop-filter: none; }
  .bottom-nav { position: fixed; top: 0; right: auto; width: 220px; height: 100vh; padding: 104px 18px 30px; border: 0; border-right: 1px solid var(--line); background: #eef0e9; grid-template-columns: 1fr; grid-template-rows: repeat(5, 48px) 1fr; align-content: start; gap: 6px; backdrop-filter: none; }
  .bottom-nav > a { justify-content: flex-start; flex-direction: row; padding: 0 13px; gap: 12px; border-radius: 12px; font-size: .86rem; }
  .bottom-nav > a.active { background: var(--surface); box-shadow: 0 4px 14px rgba(31,47,34,.05); }
  .bottom-nav .nav-add { grid-row: 3; }
  .nav-add-icon { width: 28px; height: 28px; margin: 0; border: 0; border-radius: 9px; box-shadow: none; }
  .nav-add-icon svg { width: 17px !important; height: 17px !important; }
  .topbar .brand { position: fixed; z-index: 40; left: 30px; top: 20px; }
  .page { padding: 46px 42px 70px; }
  .page-narrow { max-width: 820px; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .site-footer { display: block; padding: 0 42px 24px; color: var(--muted); font-size: .7rem; text-align: center; }
  .sticky-actions { bottom: 20px; }
}

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