:root {
  color-scheme: light dark;
  --bg: #f7f5f0;
  --panel: #fffdf8;
  --text: #1e2520;
  --muted: #68736c;
  --line: #e1d9cc;
  --brand: #23745f;
  --brand-2: #d59a2b;
  --red: #bd3b45;
  --green: #22995b;
  --blue: #3077a7;
  --shadow: 0 12px 26px rgba(34, 43, 38, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141714; --panel: #20251f; --text: #f4f1e8; --muted: #aeb8ad; --line: #333b34; --shadow: none; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, .button, input, select { border-radius: 8px; font: inherit; min-height: 44px; }
input, select { width: 100%; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 10px 12px; }
button, .button { border: 0; padding: 10px 14px; display: inline-flex; align-items: center; justify-content: center; font-weight: 750; cursor: pointer; }
.primary { background: var(--brand); color: white; }
.ghost, .button { background: transparent; border: 1px solid var(--line); color: var(--text); }
.full { width: 100%; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px 1fr; }
.sidebar { border-right: 1px solid var(--line); padding: 24px 18px; position: sticky; top: 0; height: 100vh; background: color-mix(in srgb, var(--panel) 84%, transparent); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 850; font-size: 20px; margin-bottom: 28px; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--brand); color: white; display: inline-grid; place-items: center; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a { padding: 11px 12px; border-radius: 8px; color: var(--muted); font-weight: 700; }
.sidebar nav a.active, .bottom-nav a.active { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.sidebar form { margin-top: 24px; }
.content { width: min(1180px, 100%); margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 100px; }
.personal-signature {
  grid-column: 2;
  display: flex;
  justify-content: center;
  padding: 0 clamp(20px, 3vw, 42px) 30px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.personal-signature span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 6px 6px 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  border-right: 0;
  border-radius: 999px 0 0 999px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  box-shadow: var(--shadow);
}
.personal-signature a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px 6px 0;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  border-left: 0;
  border-radius: 0 999px 999px 0;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  color: var(--brand);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: color .15s, transform .15s;
}
.personal-signature a:hover { color: var(--brand-2); transform: translateY(-1px); }
.personal-signature-login {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  padding: 0 18px;
}
.page-head { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 22px; }
.eyebrow { color: var(--muted); text-transform: uppercase; font-size: 12px; font-weight: 850; letter-spacing: .08em; margin: 0 0 4px; }
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: 20px; margin-bottom: 12px; }
.inline-filter, .filters, .grid-form { display: grid; gap: 10px; }
.inline-filter { grid-template-columns: 80px 110px 150px auto; }
.month-title { display: inline-flex; align-items: center; gap: 12px; }
.month-step { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--brand); background: color-mix(in srgb, var(--panel) 88%, transparent); font-size: 28px; font-weight: 850; line-height: 1; }
.month-step:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--panel); }
.month-filter { display: grid; grid-template-columns: 170px 170px 72px; gap: 10px; align-items: center; }
.future-toggle { min-height: 44px; padding: 10px 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 800; white-space: nowrap; }
.future-toggle.active { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.filters { grid-template-columns: repeat(7, minmax(0, 1fr)); margin-bottom: 18px; }
.grid-form { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.recurring-form { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.recurring-form label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.recurring-form label > span { padding-left: 2px; }
.recurring-form .loan-field[hidden] { display: none; }
.recurring-form input, .recurring-form select { min-height: 42px; font-weight: 650; }
.recurring-name, .recurring-note { grid-column: span 2; }
.recurring-save { align-self: end; min-height: 42px; }
.recurring-generate { display: grid; grid-template-columns: auto 150px 110px; gap: 8px; align-items: center; }
.recurring-generate > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.category-create { margin-bottom: 18px; }
.category-create-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) 140px; gap: 10px; align-items: center; }
.transactions-head { display: grid; grid-template-columns: minmax(320px, 1fr) auto; align-items: end; margin-bottom: 18px; }
.transactions-head h1 { font-size: clamp(34px, 5vw, 56px); line-height: .95; }
.transactions-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.transactions-month-filter { width: 430px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 72px; flex: 0 0 auto; }
.loans-month-filter { width: 250px; grid-template-columns: minmax(0, 1fr) 72px; flex: 0 0 auto; }
.recurring-month-filter { width: 250px; grid-template-columns: minmax(0, 1fr) 72px; }
.section-tabs { width: max-content; max-width: 100%; display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 3px; margin: -6px 0 20px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--line) 30%, transparent); }
.section-tabs a { min-height: 38px; display: grid; place-items: center; padding: 7px 14px; border-radius: 6px; color: var(--muted); font-weight: 800; }
.section-tabs a:hover { color: var(--brand); }
.section-tabs a.active { color: white; background: var(--brand); }
.top-actions { display: inline-flex; align-items: center; gap: 8px; }
.icon-action { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel) 88%, transparent); color: var(--muted); font-size: 20px; font-weight: 850; }
.icon-action:hover { border-color: color-mix(in srgb, var(--brand) 38%, var(--line)); color: var(--brand); }
.filter-line { margin: 0 0 18px; }
.filters-bar { grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(140px, 1fr)) 104px; margin-bottom: 0; align-items: center; }
.filters-bar input, .filters-bar select { background: transparent; border-color: transparent; border-bottom-color: var(--line); border-radius: 0; padding-inline: 2px; }
.filters-bar input:focus, .filters-bar select:focus { outline: 0; border-bottom-color: var(--brand); }
.filter-button { min-height: 40px; background: color-mix(in srgb, var(--panel) 80%, transparent); }
.quick-entry { margin-bottom: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, white), var(--panel)); box-shadow: var(--shadow); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.subtle-link { color: var(--brand); font-weight: 800; }
.transaction-form { display: grid; grid-template-columns: minmax(170px, 1.2fr) minmax(130px, .8fr) minmax(145px, .8fr) minmax(130px, 1fr) minmax(150px, 1fr) minmax(140px, 1fr) 112px; gap: 10px; align-items: center; }
.type-switch { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #f0ece3; }
.type-switch label { display: grid; place-items: center; cursor: pointer; }
.type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.type-switch span { width: 100%; min-height: 34px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); font-weight: 850; }
.type-switch input:checked + span { background: var(--brand); color: white; }
.amount-input { font-size: 18px; font-weight: 800; }
.quick-repeat { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 10px; }
.quick-repeat summary { width: max-content; max-width: 100%; cursor: pointer; color: var(--brand); font-weight: 850; list-style: none; }
.quick-repeat summary::-webkit-details-marker { display: none; }
.quick-repeat summary::before { content: "↻"; margin-right: 8px; color: var(--brand-2); }
.quick-repeat[open] { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quick-repeat[open] summary { flex: 0 0 auto; }
.quick-repeat[open] > select,
.quick-repeat[open] > input { width: auto; min-width: 0; min-height: 40px; padding: 8px 10px; }
.quick-repeat[open] select[name="frequency"] { flex: 0 0 145px; }
.quick-repeat[open] input[name="interval_count"] { flex: 0 0 68px; }
.quick-repeat[open] input[name="end_date"] { flex: 0 0 150px; }
.quick-repeat[open] .loan-field { flex: 0 0 140px; }
.transaction-repeat { margin-top: 12px; }
.compact-check { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel) 86%, transparent); color: var(--muted); font-weight: 800; white-space: nowrap; }
.compact-check input { width: 16px; height: 16px; min-height: 16px; flex: 0 0 16px; margin: 0; padding: 0; accent-color: var(--brand); }
.transfer-panel { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.transfer-panel summary { width: max-content; max-width: 100%; cursor: pointer; color: var(--brand); font-weight: 850; list-style: none; }
.transfer-panel summary::-webkit-details-marker { display: none; }
.transfer-panel summary::before { content: "⇄"; margin-right: 8px; color: var(--brand-2); }
.transfer-form { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(140px, 1fr) minmax(130px, .8fr) minmax(145px, .8fr) minmax(150px, 1fr) 112px; gap: 10px; margin-top: 12px; align-items: center; }
.stack .quick-repeat[open] { grid-template-columns: 1fr; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.metric, .editor, .account-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; box-shadow: var(--shadow); }
.metric span, .account-card span, .tx span, small, .muted { color: var(--muted); }
.metric strong { display: block; margin-top: 8px; font-size: clamp(24px, 4vw, 34px); }
.metric small { display: block; margin-top: 6px; font-size: 12px; line-height: 1.25; }
.income strong { color: var(--green); } .expense strong { color: var(--red); } .transfer strong, .carryover strong { color: var(--brand-2); } .balance strong { color: var(--blue); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.dashboard-panels { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(360px, 1.45fr) minmax(220px, .83fr); gap: 18px; align-items: start; }
.summary-panel { min-width: 0; }
.summary-panel h2 { margin-bottom: 12px; }
.category-list, .account-list { display: grid; gap: 6px; }
.account-selector { display: grid; gap: 8px; }
.account-choice { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel) 82%, transparent); color: var(--muted); font-weight: 800; }
.account-choice span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-choice strong { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.account-choice strong.negative { color: var(--red); }
.account-choice:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); color: var(--brand); background: var(--panel); }
.account-choice.active { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.account-choice.active strong { color: var(--brand); }
.account-choice.active strong.negative { color: var(--red); }
.category-row { display: grid; gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.category-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; }
.category-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-main strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.category-bar { height: 6px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--line) 62%, transparent); }
.category-bar span { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: var(--red); }
.income-panel .category-bar span { background: var(--green); }
.compact .category-row { padding-block: 8px; }
.more-list { display: grid; gap: 6px; }
.more-list summary { margin-top: 8px; padding: 10px 0; cursor: pointer; color: var(--brand); font-weight: 850; list-style: none; border-bottom: 1px solid var(--line); }
.more-list summary::-webkit-details-marker { display: none; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.category-card { background: color-mix(in srgb, var(--panel) 90%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 14px; box-shadow: var(--shadow); }
.category-card.inactive { opacity: .62; }
.category-card form { display: grid; gap: 12px; }
.category-visual { aspect-ratio: 1; width: 84px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, var(--panel)), color-mix(in srgb, var(--brand-2) 14%, var(--panel))); color: var(--brand); font-size: 36px; font-weight: 900; }
.category-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.category-edit-fields { display: grid; gap: 8px; }
.category-edit-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 750; }
.category-edit-fields input { font-weight: 750; }
.category-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.list, .stack { display: grid; gap: 10px; }
.row, .account-card { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; }
.row { border-bottom: 1px solid var(--line); padding: 13px 0; }
.editor { margin-bottom: 18px; }
.accounts-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 18px; align-items: start; }
.accounts-list { display: grid; gap: 10px; }
.account-tools { display: grid; gap: 14px; }
.account-tool { margin-bottom: 0; }
.account-editor { background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 14px; box-shadow: var(--shadow); }
.account-editor.inactive { opacity: .72; }
.account-editor form { display: grid; gap: 12px; }
.account-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.account-editor-head > div { display: grid; gap: 6px; }
.account-editor-head strong { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.account-status { width: max-content; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.account-status.active { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.account-status.inactive { color: var(--muted); background: color-mix(in srgb, var(--line) 55%, transparent); }
.account-fields { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, .55fr); gap: 10px; align-items: end; }
.account-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 750; }
.account-fields input { font-weight: 750; }
.account-check { margin-top: -2px; }
.switch-line { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 800; white-space: nowrap; }
.switch-line input { width: 18px; min-height: 18px; accent-color: var(--brand); }
.tx-list { display: grid; gap: 6px; }
.tx { position: relative; display: grid; grid-template-columns: 4px 42px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid transparent; border-bottom-color: var(--line); border-radius: 8px; padding: 10px 12px; }
.tx:hover { border-color: var(--line); background: var(--panel); box-shadow: var(--shadow); }
.tx.recurring { background: color-mix(in srgb, var(--blue) 5%, var(--panel)); border-color: color-mix(in srgb, var(--blue) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 9%, transparent); }
.tx.recurring:hover { border-color: color-mix(in srgb, var(--blue) 32%, var(--line)); background: color-mix(in srgb, var(--blue) 7%, var(--panel)); }
.tx-accent { width: 4px; height: 34px; border-radius: 999px; background: var(--red); }
.tx.income .tx-accent { background: var(--green); }
.tx.transfer .tx-accent { background: var(--brand-2); }
.tx-icon { width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; background: #ece8df; font-weight: 850; }
.tx.recurring .tx-icon { background: color-mix(in srgb, var(--blue) 10%, #ece8df); color: var(--blue); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 16%, transparent); }
.tx-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.tx-copy { display: grid; gap: 2px; min-width: 0; }
.tx-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-amount { font-size: 20px; font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tx.expense .tx-amount { color: var(--red); } .tx.income .tx-amount { color: var(--green); } .tx.transfer .tx-amount { color: var(--brand-2); }
.duplicate { opacity: .52; }
.tx-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.icon-button { width: 34px; height: 34px; min-height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: color-mix(in srgb, var(--muted) 72%, transparent); font-size: 22px; padding: 0; }
.icon-button:hover { color: var(--red); background: color-mix(in srgb, var(--red) 8%, transparent); }
.edit-button { font-size: 18px; }
.edit-button:hover { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.repeat-button { font-size: 18px; }
.repeat-button:hover { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.active-repeat { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.tx.recurring .active-repeat { color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.tx-inline-editor { grid-column: 1 / -1; display: grid; gap: 10px; margin-top: 6px; padding: 12px 14px 10px 58px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 68%, transparent); border-radius: 0 0 8px 8px; }
.tx-inline-editor[hidden] { display: none; }
.inline-edit-grid { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(130px, .65fr) minmax(150px, .75fr) minmax(150px, .85fr) minmax(160px, .9fr) minmax(160px, 1fr); gap: 10px; align-items: end; }
.transfer-edit-grid { grid-template-columns: minmax(150px, .7fr) minmax(130px, .65fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(180px, 1fr); }
.tx-inline-editor label { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.tx-inline-editor input, .tx-inline-editor select { min-height: 40px; padding: 8px 10px; font-weight: 700; }
.compact-type-switch { min-height: 40px; }
.compact-type-switch span { min-height: 30px; }
.wide-field { min-width: 0; }
.inline-repeat { border-top: 1px solid var(--line); padding-top: 10px; }
.inline-repeat summary { width: max-content; max-width: 100%; cursor: pointer; color: var(--brand); font-weight: 850; list-style: none; }
.inline-repeat summary::-webkit-details-marker { display: none; }
.inline-repeat summary::before { content: "↻"; margin-right: 8px; color: var(--brand-2); }
.inline-repeat[open] { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 10px; }
.inline-repeat[open] summary { flex: 0 0 auto; }
.tx-inline-editor .compact-check { display: inline-flex; min-height: 40px; gap: 8px; padding: 0 12px; color: var(--muted); font-size: 13px; font-weight: 800; }
.tx-inline-editor .compact-check input { width: 16px; height: 16px; min-height: 16px; flex: 0 0 16px; }
.inline-repeat[open] > select,
.inline-repeat[open] > input { width: auto; min-width: 0; min-height: 40px; padding: 8px 10px; }
.inline-repeat[open] select[name="frequency"] { flex: 0 0 145px; }
.inline-repeat[open] input[name="interval_count"] { flex: 0 0 68px; }
.inline-repeat[open] select[name="rule_kind"] { flex: 0 0 125px; }
.inline-repeat[open] input[name="end_date"] { flex: 0 0 150px; }
.inline-repeat[open] .loan-balance-input { display: none; flex: 0 0 140px; }
.inline-repeat.loan-repeat[open] .loan-balance-input { display: block; width: auto; }
.inline-edit-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-edit-actions .primary, .inline-edit-actions .ghost { min-height: 40px; }
.edit-scope-actions { width: min(720px, 100%); margin: 22px auto 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.edit-scope-actions button { min-height: 50px; }
.bottom-nav { display: none; }
.edit-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 22px; }
.edit-nav h1 { font-size: clamp(28px, 4vw, 40px); text-align: center; }
.edit-nav a, .text-submit { color: #765744; font-size: 22px; font-weight: 700; }
.text-submit { justify-self: end; padding: 0; min-height: 0; background: transparent; border: 0; }
.transaction-editor { display: grid; gap: 18px; }
.edit-type-switch { width: min(720px, 100%); margin: 0 auto; grid-template-columns: repeat(2, 1fr); }
.settings-section { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow); }
.section-strip { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 18px; background: color-mix(in srgb, var(--line) 72%, var(--panel)); color: var(--muted); font-size: 20px; }
.help-dot { width: 30px; height: 30px; border: 2px solid currentColor; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 850; color: var(--text); }
.settings-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: center; border-top: 1px solid var(--line); min-height: 70px; }
.settings-row > span { padding: 0 16px; color: #506987; text-align: right; font-size: 20px; }
.settings-row input, .settings-row select { border: 0; border-left: 1px solid var(--line); border-radius: 0; min-height: 70px; background: transparent; font-size: 26px; }
.switch-input { appearance: none; -webkit-appearance: none; width: 74px; height: 42px; min-height: 42px; margin-left: 22px; padding: 0; border: 0; border-radius: 999px; background: #c9c3b8; position: relative; cursor: pointer; }
.switch-input::after { content: ""; position: absolute; width: 34px; height: 34px; left: 4px; top: 4px; border-radius: 50%; background: white; box-shadow: 0 2px 8px rgba(0,0,0,.18); transition: transform .18s ease; }
.switch-input:checked { background: #765744; }
.switch-input:checked::after { transform: translateX(32px); }
.danger { background: #ff2a12; color: white; }
.delete-button { width: min(720px, 100%); margin: 28px auto 0; font-size: 24px; min-height: 58px; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 26px; box-shadow: var(--shadow); }
.login-brand { margin-bottom: 20px; }
.check { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.check input { width: auto; min-height: auto; }
.quick-links { display: flex; gap: 10px; flex-wrap: wrap; }
.rule-meta { display: grid; gap: 2px; color: var(--muted); font-size: 13px; text-align: right; }
.recurring-rule { grid-template-columns: 44px 1fr auto auto auto; }
.recurring-manage-head { margin-bottom: 12px; }
.recurring-manage-title { display: flex; align-items: center; gap: 10px; }
.rule-count { min-width: 38px; min-height: 32px; display: inline-grid; place-items: center; padding: 5px 9px; border-radius: 8px; color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); font-size: 13px; }
.recurring-rule-filters { display: grid; grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(150px, .65fr)) 90px; gap: 10px; align-items: center; margin-bottom: 14px; }
.recurring-rule-filters input, .recurring-rule-filters select { min-height: 40px; border-color: transparent; border-bottom-color: var(--line); border-radius: 0; background: transparent; padding-inline: 3px; }
.recurring-rule-filters input:focus, .recurring-rule-filters select:focus { outline: 0; border-bottom-color: var(--brand); }
.recurring-rule-filters button { min-height: 40px; }
.form-notice { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--red); color: var(--red); background: color-mix(in srgb, var(--red) 7%, transparent); font-size: 13px; font-weight: 700; }
.recurring-rules { margin-top: 0; }
.recurring-rules > .section-title { margin-bottom: 10px; }
.recurring-rules > .section-title > strong { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.recurring-rule-list { display: grid; gap: 6px; }
.recurring-rule-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid transparent; border-bottom-color: var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel) 76%, transparent); }
.recurring-rule-card:hover { border-color: var(--line); background: var(--panel); box-shadow: var(--shadow); }
.recurring-rule-card.stopped { opacity: .72; }
.recurring-rule-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 8px; color: var(--red); background: color-mix(in srgb, var(--red) 9%, var(--panel)); font-size: 18px; font-weight: 900; }
.recurring-rule-icon img { width: 22px; height: 22px; object-fit: contain; }
.recurring-rule-card.income .recurring-rule-icon { color: var(--green); background: color-mix(in srgb, var(--green) 9%, var(--panel)); }
.recurring-rule-card.loan .recurring-rule-icon { color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--panel)); }
.recurring-rule-copy { display: grid; gap: 3px; min-width: 0; }
.recurring-rule-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.recurring-rule-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.recurring-rule-title > span { flex: 0 0 auto; padding: 2px 6px; border-radius: 999px; color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.recurring-rule-copy p { margin: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.recurring-rule-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.recurring-rule-tags span { padding: 2px 6px; border-radius: 5px; color: var(--muted); background: color-mix(in srgb, var(--line) 28%, transparent); font-size: 10px; font-weight: 750; }
.recurring-rule-tags .rule-status-stopped { color: var(--red); background: color-mix(in srgb, var(--red) 9%, transparent); }
.recurring-rule-value { display: grid; gap: 2px; text-align: right; }
.recurring-rule-value strong { color: var(--red); font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recurring-rule-card.income .recurring-rule-value strong { color: var(--green); }
.recurring-rule-value span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.recurring-rule-actions { display: flex; align-items: center; gap: 6px; }
.recurring-rule-actions form button { min-height: 38px; }
.recurring-rule-actions .recurring-delete-future { color: var(--red); }
.recurring-rule-actions .recurring-delete-future:hover { border-color: var(--red); background: color-mix(in srgb, var(--red) 7%, transparent); }
.rule-edit-toggle { color: var(--muted); }
.rule-edit-toggle:hover { color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent); }
.rule-edit-toggle[aria-expanded="true"] { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.recurring-rule-edit-form { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 14px 0 4px; border-top: 1px solid var(--line); }
.recurring-rule-edit-form[hidden] { display: none; }
.recurring-rule-edit-form label { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: 11px; font-weight: 800; }
.recurring-rule-edit-form .rule-loan-field[hidden] { display: none; }
.recurring-rule-edit-form input, .recurring-rule-edit-form select { min-height: 40px; padding-block: 8px; font-weight: 650; }
.rule-edit-name, .rule-edit-note { grid-column: span 2; }
.rule-edit-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.rule-edit-actions button { min-height: 38px; }
.chart-filter { display: grid; grid-template-columns: 110px 190px 72px; gap: 10px; align-items: center; }
.chart-card { background: color-mix(in srgb, var(--panel) 90%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 18px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.chart-legend { display: inline-flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 800; }
.chart-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.legend-income::before { background: var(--green); }
.legend-expense::before { background: var(--red); }
.legend-balance::before { background: var(--blue); }
.monthly-chart { min-height: 250px; display: grid; grid-template-columns: repeat(12, minmax(36px, 1fr)); gap: 12px; align-items: end; padding-top: 12px; }
.month-column { display: grid; gap: 8px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 850; }
.month-bars { height: 190px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; align-items: end; padding: 8px 6px; border-radius: 8px; background: color-mix(in srgb, var(--line) 28%, transparent); }
.bar { min-height: 3px; border-radius: 999px 999px 2px 2px; }
.bar.zero { min-height: 0; }
.income-bar { background: var(--green); }
.expense-bar { background: var(--red); }
.balance-bar { background: var(--blue); }
.balance-bar.negative { background: var(--brand-2); }
.loans-head { margin-bottom: 14px; }
.loans-head h1 { font-size: clamp(32px, 4vw, 44px); }
.loan-metrics { grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.loan-metrics .metric { min-height: 92px; padding: 13px 15px; }
.loan-metrics .metric strong { margin-top: 5px; font-size: clamp(24px, 3vw, 30px); }
.loan-list { display: grid; gap: 8px; align-items: start; }
.loan-card { display: grid; grid-template-columns: minmax(220px, .9fr) auto minmax(150px, .7fr) minmax(350px, 1.4fr); gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel) 92%, transparent); box-shadow: var(--shadow); }
.loan-card.inactive { opacity: .78; }
.loan-card.completed { border-color: color-mix(in srgb, var(--green) 30%, var(--line)); background: color-mix(in srgb, var(--green) 5%, var(--panel)); }
.loan-head { min-width: 0; }
.loan-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.loan-head h2 { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 19px; line-height: 1.1; }
.loan-head p { margin: 3px 0 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.25; }
.loan-amount { padding: 5px 8px; border-radius: 7px; color: var(--red); background: color-mix(in srgb, var(--red) 8%, transparent); font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.loan-card.income .loan-amount { color: var(--green); }
.loan-card.transfer .loan-amount { color: var(--brand-2); }
.loan-card.completed .loan-amount { color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); }
.loan-kind { display: inline-flex; flex: 0 0 auto; width: max-content; padding: 3px 7px; border-radius: 999px; color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.loan-card.completed .loan-kind { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.loan-progress-wrap { display: grid; gap: 6px; min-width: 0; align-self: center; }
.loan-progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 850; }
.loan-progress-head strong { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.loan-progress { height: 8px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--line) 64%, transparent); }
.loan-progress span { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: var(--brand); }
.loan-card.expense .loan-progress span { background: var(--red); }
.loan-card.transfer .loan-progress span { background: var(--brand-2); }
.loan-card.completed .loan-progress span { background: var(--green); }
.loan-card.completed .loan-progress-head strong { color: var(--green); }
.loan-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.loan-stats div { display: grid; gap: 2px; min-width: 0; padding: 7px 9px; border-radius: 7px; background: color-mix(in srgb, var(--line) 22%, transparent); }
.loan-stats span, .loan-stats small, .loan-foot { color: var(--muted); }
.loan-stats span { font-size: 12px; }
.loan-stats strong { overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; font-size: 15px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.loan-card.expense .loan-stats div:nth-child(2) strong { color: var(--red); }
.loan-card.transfer .loan-stats div:nth-child(2) strong { color: var(--brand-2); }
.loan-card.completed .loan-stats div:nth-child(2) strong { color: var(--green); }
.loan-stats small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; line-height: 1.2; }
.loan-foot { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 11px; font-weight: 800; }
.loan-foot span + span::before { content: "·"; margin-right: 8px; }
.recurring-metrics { grid-template-columns: repeat(2, minmax(180px, 1fr)); margin-bottom: 20px; }
.commitment-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 26px; }
.commitment-panel { min-width: 0; }
.commitment-panel .section-title { margin-bottom: 8px; }
.commitment-panel h2 { margin-bottom: 0; }
.commitment-list { display: grid; gap: 4px; }
.commitment-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.category-commitment { grid-template-columns: 36px minmax(0, 1fr) auto; }
.commitment-category-icon, .fixed-payment-icon { display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: color-mix(in srgb, var(--line) 42%, transparent); }
.commitment-category-icon { width: 36px; height: 36px; font-size: 18px; }
.commitment-category-icon img, .fixed-payment-icon img { width: 100%; height: 100%; object-fit: cover; }
.commitment-copy { display: grid; gap: 2px; min-width: 0; }
.commitment-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commitment-copy span { color: var(--muted); font-size: 12px; }
.commitment-amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.commitment-bar { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--line) 62%, transparent); }
.category-commitment .commitment-bar { grid-column: 2 / -1; }
.commitment-bar span { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: var(--red); }
.account-commitment .commitment-bar span { background: var(--brand-2); }
.fixed-payment-section { margin-top: 6px; }
.fixed-payment-list { display: grid; gap: 5px; }
.fixed-payment-row { display: grid; grid-template-columns: 42px minmax(180px, 1.2fr) minmax(220px, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid transparent; border-bottom-color: var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel) 74%, transparent); }
.fixed-payment-row:hover { border-color: var(--line); background: var(--panel); box-shadow: var(--shadow); }
.fixed-payment-icon { width: 42px; height: 42px; font-size: 21px; }
.fixed-payment-copy, .fixed-payment-schedule, .fixed-payment-value { display: grid; gap: 2px; min-width: 0; }
.fixed-payment-copy strong, .fixed-payment-copy span, .fixed-payment-schedule span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fixed-payment-copy span, .fixed-payment-schedule span, .fixed-payment-value span { color: var(--muted); font-size: 12px; }
.fixed-payment-schedule { color: var(--muted); font-size: 13px; }
.fixed-payment-value { text-align: right; }
.fixed-payment-value strong { color: var(--red); font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty-state { padding: 32px 0; border-top: 1px solid var(--line); }
.empty-state p { margin: 8px 0 16px; }
@media (max-width: 1180px) {
  .transaction-form, .transfer-form, .filters-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transaction-form .type-switch, .transaction-form .note-input { grid-column: span 2; }
  .transaction-form .primary, .transfer-form .primary, .filter-button { width: 100%; }
  .inline-edit-grid, .transfer-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-edit-grid .type-switch, .wide-field { grid-column: span 2; }
  .dashboard-panels, .chart-grid { grid-template-columns: 1fr 1fr; }
  .expense-panel { grid-column: 1 / -1; }
  .accounts-layout { grid-template-columns: 1fr; }
  .account-tools { grid-template-columns: 1fr 1fr; }
  .loan-card { grid-template-columns: minmax(0, 1fr) auto; }
  .loan-progress-wrap { grid-column: 1 / -1; }
  .loan-stats { grid-column: 1 / -1; }
  .fixed-payment-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .fixed-payment-schedule { grid-column: 2 / -1; }
  .recurring-rule-card { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .recurring-rule-actions { grid-column: 2 / -1; justify-self: end; }
  .recurring-rule-edit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recurring-rule-filters { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .recurring-rule-filters input { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .content { padding-top: 18px; }
  .personal-signature { grid-column: auto; padding: 0 16px 94px; }
  .personal-signature-login { padding: 0 18px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .transactions-head { grid-template-columns: 1fr; align-items: stretch; }
  .transactions-head-actions { justify-content: flex-start; }
  .transactions-month-filter { width: 100%; }
  .top-actions { align-self: flex-end; }
  .inline-filter, .filters, .grid-form, .metric-grid, .split, .dashboard-panels, .filters-bar, .transaction-form, .month-filter, .category-create-form, .chart-filter, .chart-grid { grid-template-columns: 1fr; }
  .dashboard-content { display: flex; flex-direction: column; }
  .dashboard-content .dashboard-panels { display: contents; }
  .dashboard-content .accounts-panel { order: 1; margin-bottom: 24px; }
  .dashboard-content .metric-grid { order: 2; }
  .dashboard-content .income-panel { order: 3; margin-bottom: 18px; }
  .dashboard-content .expense-panel { order: 4; }
  .account-tools, .account-fields { grid-template-columns: 1fr; }
  .account-editor-head { align-items: stretch; flex-direction: column; }
  .expense-panel { grid-column: auto; }
  .month-title { width: 100%; justify-content: space-between; }
  .section-title { align-items: flex-start; }
  .type-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transfer-form { grid-template-columns: 1fr; }
  .transaction-form .type-switch, .transaction-form .note-input { grid-column: auto; }
  .tx-inline-editor { padding: 12px; }
  .inline-edit-grid, .transfer-edit-grid { grid-template-columns: 1fr; }
  .quick-repeat[open] > select,
  .quick-repeat[open] > input,
  .inline-repeat[open] > select,
  .inline-repeat[open] > input,
  .inline-repeat[open] .loan-balance-input { flex: 1 1 132px; width: auto; }
  .inline-edit-grid .type-switch, .wide-field { grid-column: auto; }
  .inline-edit-actions { justify-content: stretch; }
  .inline-edit-actions .primary, .inline-edit-actions .ghost { flex: 1 1 140px; }
  .edit-scope-actions { grid-template-columns: 1fr; }
  .tx, .recurring-rule { grid-template-columns: 4px 38px minmax(0, 1fr) auto auto; }
  .tx-icon { width: 38px; height: 38px; }
  .rule-meta { grid-column: 2 / -1; text-align: left; }
  .tx-amount { font-size: 18px; }
  .edit-nav a, .text-submit { font-size: 18px; }
  .settings-row { grid-template-columns: 112px minmax(0, 1fr); min-height: 58px; }
  .settings-row > span { font-size: 16px; padding-inline: 10px; }
  .settings-row input, .settings-row select { min-height: 58px; font-size: 20px; }
  .section-strip { font-size: 18px; }
  .monthly-chart { gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .month-column { min-width: 42px; }
  .loan-metrics, .loan-card { grid-template-columns: 1fr; }
  .loan-card { gap: 12px; padding: 14px; }
  .loan-amount, .loan-progress-wrap { grid-column: auto; justify-self: start; }
  .loan-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-column: auto; }
  .section-tabs { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section-tabs a { padding-inline: 6px; font-size: 13px; }
  .recurring-generate { width: 100%; grid-template-columns: 1fr auto; }
  .recurring-generate > span { grid-column: 1 / -1; }
  .recurring-form { grid-template-columns: 1fr; }
  .recurring-name, .recurring-note { grid-column: auto; }
  .recurring-rule-card { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; padding-inline: 8px; }
  .recurring-rule-icon { width: 38px; height: 38px; }
  .recurring-rule-copy, .recurring-rule-value, .recurring-rule-actions { grid-column: 2 / -1; }
  .recurring-rule-value { text-align: left; }
  .recurring-rule-actions { grid-row: auto; justify-self: start; flex-wrap: wrap; }
  .recurring-rule-actions form { min-width: 0; }
  .recurring-rule-actions form button { max-width: 100%; white-space: normal; }
  .recurring-rule-edit-form { grid-template-columns: 1fr; }
  .rule-edit-name, .rule-edit-note { grid-column: auto; }
  .recurring-rule-filters { grid-template-columns: 1fr; }
  .recurring-rule-filters button { width: 100%; }
  .recurring-metrics, .commitment-overview { grid-template-columns: 1fr; }
  .fixed-payment-row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; padding-inline: 8px; }
  .fixed-payment-icon { width: 38px; height: 38px; }
  .fixed-payment-schedule { grid-column: 2 / -1; }
  .fixed-payment-value { align-self: start; }
  .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(6, 1fr); padding: 8px max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right)); background: color-mix(in srgb, var(--panel) 94%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(16px); }
  .bottom-nav a { display: grid; place-items: center; gap: 2px; padding: 6px 2px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 750; }
  .bottom-nav span { font-size: 20px; line-height: 1; }
}

/* Visual system refresh */
:root {
  --bg: #f2f5f3;
  --panel: #ffffff;
  --panel-soft: #f7f9f8;
  --text: #17211c;
  --muted: #637168;
  --line: #dbe3de;
  --brand: #16725b;
  --brand-strong: #0d5947;
  --brand-soft: #e6f2ed;
  --brand-2: #b7791f;
  --red: #c13d49;
  --green: #16874e;
  --blue: #2f6f9f;
  --shadow: 0 8px 24px rgba(23, 33, 28, .055);
}
body { min-width: 320px; overflow-x: hidden; line-height: 1.45; }
button, .button, input, select { min-height: 42px; }
button, .button { gap: 7px; transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease; }
button:active, .button:active { transform: translateY(1px); }
button:focus-visible, .button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 24%, transparent);
  outline-offset: 2px;
}
input, select { background: var(--panel); }
input:focus, select:focus { border-color: color-mix(in srgb, var(--brand) 58%, var(--line)); }
.primary { background: var(--brand); }
.primary:hover { background: var(--brand-strong); }
.ghost:hover, .button:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); color: var(--brand); background: var(--brand-soft); }

.app-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-block;
  background: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}
.icon-dashboard { -webkit-mask-image: url("/static/icons/layout-dashboard.svg"); mask-image: url("/static/icons/layout-dashboard.svg"); }
.icon-charts { -webkit-mask-image: url("/static/icons/chart-no-axes-column-increasing.svg"); mask-image: url("/static/icons/chart-no-axes-column-increasing.svg"); }
.icon-recurring { -webkit-mask-image: url("/static/icons/repeat-2.svg"); mask-image: url("/static/icons/repeat-2.svg"); }
.icon-transactions { -webkit-mask-image: url("/static/icons/list.svg"); mask-image: url("/static/icons/list.svg"); }
.icon-accounts { -webkit-mask-image: url("/static/icons/wallet-cards.svg"); mask-image: url("/static/icons/wallet-cards.svg"); }
.icon-categories { -webkit-mask-image: url("/static/icons/tags.svg"); mask-image: url("/static/icons/tags.svg"); }
.icon-settings { -webkit-mask-image: url("/static/icons/settings-2.svg"); mask-image: url("/static/icons/settings-2.svg"); }
.icon-logout { -webkit-mask-image: url("/static/icons/log-out.svg"); mask-image: url("/static/icons/log-out.svg"); }
.icon-download { -webkit-mask-image: url("/static/icons/download.svg"); mask-image: url("/static/icons/download.svg"); }
.icon-pencil { -webkit-mask-image: url("/static/icons/pencil.svg"); mask-image: url("/static/icons/pencil.svg"); }
.icon-trash { -webkit-mask-image: url("/static/icons/trash-2.svg"); mask-image: url("/static/icons/trash-2.svg"); }
.icon-chevron-left { -webkit-mask-image: url("/static/icons/chevron-left.svg"); mask-image: url("/static/icons/chevron-left.svg"); }
.icon-chevron-right { -webkit-mask-image: url("/static/icons/chevron-right.svg"); mask-image: url("/static/icons/chevron-right.svg"); }

.app-shell { grid-template-columns: 224px minmax(0, 1fr); }
.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 0;
  padding: 22px 14px;
  background: #14271f;
  color: #f3f8f5;
}
.brand { gap: 11px; margin: 0 8px 30px; font-size: 19px; }
.brand-mark { background: #2a9776; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.sidebar nav { gap: 4px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 43px;
  padding: 10px 12px;
  color: #a9bab2;
  font-size: 14px;
}
.sidebar nav a:hover { color: #ffffff; background: rgba(255,255,255,.07); }
.sidebar nav a.active { color: #ffffff; background: rgba(255,255,255,.11); box-shadow: inset 3px 0 #58c09e; }
.sidebar form { margin-top: auto; padding-top: 24px; }
.sidebar-logout { width: 100%; justify-content: flex-start; color: #a9bab2; border-color: rgba(255,255,255,.14); }
.sidebar-logout:hover { color: #ffffff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.07); }
.content { width: min(1280px, 100%); min-width: 0; padding: 30px clamp(20px, 3vw, 42px) 84px; }
.page-head { margin-bottom: 20px; }
.eyebrow { margin-bottom: 3px; color: var(--muted); font-size: 11px; letter-spacing: .06em; }
h1 { font-size: clamp(30px, 3vw, 42px); line-height: 1.05; }
h2 { font-size: 19px; }
.month-step { width: 38px; height: 38px; min-height: 38px; background: var(--panel); box-shadow: var(--shadow); }
.month-step .app-icon { width: 19px; height: 19px; }
.month-filter { grid-template-columns: 172px 172px 66px; gap: 8px; }
.future-toggle { min-height: 40px; padding-inline: 13px; }

.metric-grid { gap: 10px; margin-bottom: 22px; }
.metric { position: relative; min-height: 116px; padding: 15px 16px; overflow: hidden; box-shadow: var(--shadow); }
.metric::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--blue); }
.metric.income::before { background: var(--green); }
.metric.expense::before { background: var(--red); }
.metric.transfer::before, .metric.carryover::before { background: var(--brand-2); }
.metric span { font-size: 13px; font-weight: 700; }
.metric strong { margin-top: 7px; font-size: 29px; line-height: 1.1; }
.dashboard-panels { gap: 24px; }
.summary-panel h2 { padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.account-selector { gap: 6px; }
.account-choice { min-height: 40px; padding: 9px 11px; background: var(--panel); box-shadow: 0 2px 8px rgba(23, 33, 28, .025); }
.account-choice.active { background: var(--brand-soft); }
.category-row { padding-block: 8px; }

.quick-entry, .editor, .account-card, .chart-card, .account-editor, .category-card, .loan-card {
  background: var(--panel);
  box-shadow: var(--shadow);
}
.quick-entry { padding: 16px; }
.section-title { margin-bottom: 13px; }
.transactions-head h1 { font-size: clamp(34px, 4vw, 48px); line-height: 1; }
.transactions-month-filter { width: 420px; }
.icon-action { width: 42px; height: 42px; background: var(--panel); }
.transaction-form { grid-template-columns: 150px 112px 135px 125px 140px minmax(130px, 1fr) 96px; gap: 8px; }
.transfer-form { grid-template-columns: 135px 135px 115px 130px minmax(140px, 1fr) 96px; gap: 8px; }
.type-switch { background: var(--panel-soft); }
.type-switch input { width: 1px; height: 1px; min-height: 1px; }
.filters-bar input, .filters-bar select, .recurring-rule-filters input, .recurring-rule-filters select { background: transparent; }
.tx-list { gap: 5px; }
.tx { min-height: 60px; padding: 8px 10px; background: var(--panel); border-color: var(--line); box-shadow: 0 2px 8px rgba(23, 33, 28, .025); }
.tx:hover { box-shadow: 0 7px 20px rgba(23, 33, 28, .07); }
.tx-icon { background: var(--panel-soft); }
.icon-button .app-icon { width: 16px; height: 16px; }
.tx-inline-editor { background: var(--panel-soft); }

.accounts-layout { gap: 20px; }
.account-tools { position: sticky; top: 24px; }
.account-editor { padding: 15px; }
.account-editor-head strong { font-size: 23px; }
.account-editor form > .primary { width: auto; min-width: 158px; justify-self: end; }
.category-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.category-visual { width: 64px; background: var(--brand-soft); font-size: 28px; }
.settings-section { box-shadow: var(--shadow); }
.section-strip { min-height: 42px; background: var(--panel-soft); font-size: 17px; font-weight: 750; }
.settings-row { min-height: 58px; }
.settings-row > span { color: var(--muted); font-size: 15px; font-weight: 750; }
.settings-row input, .settings-row select { min-height: 58px; font-size: 18px; }
.switch-input { width: 58px; height: 32px; min-height: 32px; }
.switch-input::after { width: 26px; height: 26px; left: 3px; top: 3px; }
.switch-input:checked { background: var(--brand); }
.switch-input:checked::after { transform: translateX(26px); }
.delete-button { min-height: 50px; font-size: 17px; }
.chart-card { padding: 15px; }
.recurring-rule-card, .fixed-payment-row { background: var(--panel); border-color: var(--line); }
.login-body { background: var(--bg); }
.login-panel { padding: 28px; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101713;
    --panel: #18211c;
    --panel-soft: #1d2822;
    --text: #edf4ef;
    --muted: #9caaa2;
    --line: #2d3a33;
    --brand: #55b795;
    --brand-strong: #68c7a7;
    --brand-soft: #203a31;
    --shadow: none;
  }
  .sidebar { background: #0b1510; }
  .primary { color: #0d2119; }
  .tx.recurring .tx-icon { background: color-mix(in srgb, var(--blue) 14%, var(--panel)); }
}

@media (max-width: 1400px) and (min-width: 821px) {
  .transaction-form, .transfer-form, .filters-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transaction-form .type-switch, .transaction-form .note-input { grid-column: span 2; }
  .transaction-form > .primary, .transfer-form > .primary { width: 100%; grid-column: 1 / -1; }
  .filter-button { width: 100%; }
  .transactions-head { grid-template-columns: 1fr; align-items: stretch; }
  .transactions-head-actions { justify-content: flex-start; }
}

@media (max-width: 820px) {
  .sidebar { display: none; }
  .content { padding: 20px 16px 112px; }
  .page-head { gap: 13px; margin-bottom: 18px; }
  h1 { font-size: 34px; }
  h2 { font-size: 18px; }
  .eyebrow { font-size: 10px; }
  .month-title { gap: 8px; }
  .month-step { width: 36px; height: 36px; min-height: 36px; }
  .month-filter { width: 100%; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 62px; gap: 7px; }
  .transactions-month-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 62px; }
  .chart-filter { width: 100%; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) 62px; }
  .recurring-month-filter, .loans-month-filter { width: 100%; grid-template-columns: minmax(0, 1fr) 62px; }
  .future-toggle { width: max-content; min-height: 38px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { min-height: 94px; padding: 12px 11px; }
  .metric span { font-size: 12px; }
  .metric strong { margin-top: 6px; font-size: 21px; }
  .metric small { font-size: 10px; }
  .metric.balance:last-child { grid-column: 1 / -1; }
  .dashboard-content .accounts-panel { margin-bottom: 20px; }
  .dashboard-panels { gap: 18px; }
  .summary-panel h2 { margin-bottom: 8px; }
  .account-choice { min-height: 42px; }
  .quick-entry { padding: 13px; }
  .transaction-form, .transfer-form, .filters-bar, .category-create-form { grid-template-columns: 1fr; gap: 8px; }
  .transaction-form .type-switch, .transaction-form .note-input { grid-column: auto; }
  .transactions-head-actions { width: 100%; gap: 8px; }
  .transactions-head-actions .transactions-month-filter { flex: 1 1 100%; }
  .tx { grid-template-columns: 3px 36px minmax(0, 1fr) auto; gap: 8px; padding: 9px 8px; }
  .tx-icon { width: 36px; height: 36px; }
  .tx-amount { grid-column: 3; justify-self: start; font-size: 16px; }
  .tx-actions { grid-column: 4; grid-row: 1 / span 2; flex-direction: column; }
  .account-tools { position: static; }
  .account-editor form > .primary { width: 100%; justify-self: stretch; }
  .category-grid { grid-template-columns: 1fr; }
  .settings-row { grid-template-columns: 104px minmax(0, 1fr); }
  .settings-row > span { padding-inline: 8px; font-size: 13px; }
  .settings-row input, .settings-row select { font-size: 16px; }
  .recurring-rule-card { padding: 10px; }
  .recurring-rule-actions { gap: 5px; }
  .bottom-nav {
    left: 10px;
    right: 10px;
    bottom: max(9px, env(safe-area-inset-bottom));
    z-index: 1000;
    gap: 2px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    box-shadow: 0 12px 30px rgba(23, 33, 28, .16);
  }
  .bottom-nav a { gap: 3px; min-width: 0; min-height: 50px; padding: 5px 1px; border-radius: 8px; font-size: 10px; }
  .bottom-nav a.active { color: var(--brand); background: var(--brand-soft); }
  .bottom-nav .app-icon { width: 19px; height: 19px; flex-basis: 19px; }
  .bottom-nav span { font-size: inherit; line-height: 1; }
}

@media (max-width: 390px) {
  .content { padding-inline: 12px; }
  h1 { font-size: 31px; }
  .month-filter { grid-template-columns: 1fr 1fr; }
  .month-filter .primary { grid-column: 1 / -1; }
  .transactions-month-filter, .chart-filter { grid-template-columns: 1fr 1fr; }
  .transactions-month-filter .primary, .chart-filter .primary { grid-column: 1 / -1; }
  .bottom-nav a { font-size: 9px; }
}

/* ==========================================================================
   Financial cockpit
   ========================================================================== */
.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.brand-copy strong { color: #fff; line-height: 1.1; }
.brand-copy small {
  color: #7f968b;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sidebar-quick-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 42px;
  margin: -15px 8px 20px;
  border: 1px solid rgba(116, 211, 177, .3);
  border-radius: 11px;
  color: #dff8ef;
  background: rgba(88, 192, 158, .11);
  font-size: 13px;
  font-weight: 800;
}
.sidebar-quick-action:hover {
  color: #fff;
  background: rgba(88, 192, 158, .2);
}
.sidebar nav .nav-group-label {
  margin: 15px 12px 5px;
  color: #668076;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.sidebar nav .nav-group-label:first-child { margin-top: 0; }

.period-head h1 span {
  color: var(--muted);
  font-size: .55em;
  font-weight: 650;
}
.finance-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .78fr);
  gap: 1px;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, #16241e);
  border-radius: 22px;
  color: #f5fbf8;
  background:
    radial-gradient(circle at 12% 8%, rgba(86, 194, 156, .2), transparent 33%),
    linear-gradient(135deg, #10251d 0%, #162f26 60%, #1d3930 100%);
  box-shadow: 0 22px 50px rgba(21, 42, 33, .16);
  animation: cockpit-rise .45s ease both;
}
.finance-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .17;
  background-image: radial-gradient(circle, rgba(255,255,255,.55) 1px, transparent 1px);
  background-size: 19px 19px;
  mask-image: linear-gradient(90deg, #000, transparent 60%);
}
.hero-balance,
.annual-story {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  min-height: 220px;
  padding: clamp(24px, 4vw, 46px);
}
.hero-label {
  color: #9fc7b9;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.hero-amount {
  display: block;
  margin: 6px 0 5px;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(43px, 6vw, 76px);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .98;
}
.hero-amount.negative { color: #ff9f90; }
.hero-balance p,
.annual-story p,
.finance-status p {
  margin: 0;
  color: #a9bbb4;
  font-size: 13px;
  line-height: 1.5;
}
.finance-status {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  padding: 28px;
  border-left: 1px solid rgba(255,255,255,.11);
  background: rgba(255,255,255,.045);
}
.finance-status > strong {
  margin: 5px 0 4px;
  color: #d9eee5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(31px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: -.03em;
}
.finance-status.negative > strong { color: #ff9f90; }
.finance-status.neutral > strong { color: #e9d8aa; }
.hero-actions { display: flex; gap: 8px; margin-top: 20px; }
.hero-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  color: #e4efe9;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255,255,255,.06);
}
.hero-action:hover { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.11); }
.hero-action.primary { border-color: #68c7a7; color: #10251d; background: #68c7a7; }

.kpi-ribbon {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--panel) 95%, transparent);
  box-shadow: var(--shadow);
  animation: cockpit-rise .45s .06s ease both;
}
.kpi-item {
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 88px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}
.kpi-item:last-child { border-right: 0; }
.kpi-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand-2);
}
.kpi-item.income::before { background: var(--green); }
.kpi-item.expense::before { background: var(--red); }
.kpi-item span,
.insight-card span,
.annual-totals span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.kpi-item strong { font-size: clamp(19px, 2vw, 25px); line-height: 1.15; }
.kpi-item small { color: var(--muted); font-size: 10px; }
.hero-amount,
.finance-status > strong,
.kpi-item strong,
.annual-totals strong,
.insight-card strong {
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.cockpit-panels {
  grid-template-columns: minmax(210px, .75fr) minmax(360px, 1.35fr) minmax(240px, .9fr);
  align-items: stretch;
}
.panel-card {
  min-width: 0;
  margin: 0;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: var(--shadow);
  animation: cockpit-rise .45s .12s ease both;
}
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
.panel-heading h2 { margin: 0; }
.panel-heading > a { color: var(--brand); font-size: 12px; font-weight: 800; }
.panel-heading > strong { white-space: nowrap; font-size: 16px; }
.panel-card.summary-panel h2 { margin: 0; padding: 0; border: 0; }
.panel-card .category-row { padding-block: 7px; }
.panel-card .category-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-copy { padding: 16px 0; }

.annual-hero { grid-template-columns: minmax(0, 1.25fr) minmax(380px, .9fr); }
.annual-totals {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: center;
  gap: 8px;
  padding: 24px;
  border-left: 1px solid rgba(255,255,255,.11);
  background: rgba(255,255,255,.035);
}
.annual-totals > div {
  display: grid;
  gap: 7px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 13px;
  background: rgba(255,255,255,.045);
}
.annual-totals strong {
  overflow-wrap: normal;
  color: #fff;
  font-size: clamp(16px, 1.6vw, 21px);
  white-space: nowrap;
}
.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.insight-card {
  display: grid;
  gap: 4px;
  min-height: 94px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.insight-card strong { overflow: hidden; font-size: 21px; text-overflow: ellipsis; white-space: nowrap; }
.insight-card small { color: var(--muted); font-size: 11px; }
.evolution-card { padding: 20px; border-radius: 16px; }
.chart-scroll { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.evolution-card .monthly-chart { min-width: 780px; min-height: 285px; gap: 9px; }
.evolution-card .month-column { grid-template-rows: 20px 1fr 18px; gap: 6px; }
.month-net {
  overflow: hidden;
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.month-net.negative { color: var(--red); }
.evolution-card .month-bars { height: 220px; background: color-mix(in srgb, var(--line) 20%, transparent); }
.evolution-card .bar { opacity: .86; transition: opacity .18s ease, filter .18s ease; }
.evolution-card .month-column:hover .bar { opacity: 1; filter: saturate(1.2); }
.evolution-card .balance-bar.negative { background: var(--red); }
.chart-grid .chart-card { min-height: 300px; padding: 20px; border-radius: 16px; }

@keyframes cockpit-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .finance-hero, .kpi-ribbon, .panel-card { animation: none; }
}
@media (max-width: 1120px) and (min-width: 821px) {
  .cockpit-panels { grid-template-columns: minmax(210px, .72fr) minmax(0, 1.28fr); }
  .cockpit-panels .income-panel { grid-column: 1 / -1; }
  .annual-hero { grid-template-columns: 1fr; }
  .annual-totals { border-top: 1px solid rgba(255,255,255,.11); border-left: 0; }
  .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .finance-hero { grid-template-columns: 1fr; border-radius: 18px; }
  .hero-balance, .annual-story { min-height: 174px; padding: 25px 22px; }
  .finance-status { padding: 22px; border-top: 1px solid rgba(255,255,255,.11); border-left: 0; }
  .hero-amount { font-size: clamp(41px, 13vw, 59px); }
  .kpi-ribbon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-item { min-height: 78px; padding: 14px; }
  .kpi-item:nth-child(2) { border-right: 0; }
  .kpi-item:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .dashboard-content .cockpit-panels {
    display: grid;
    grid-template-columns: 1fr;
    order: 3;
  }
  .dashboard-content .cockpit-panels .accounts-panel,
  .dashboard-content .cockpit-panels .income-panel,
  .dashboard-content .cockpit-panels .expense-panel {
    order: initial;
    margin-bottom: 0;
  }
  .chart-grid { grid-template-columns: 1fr; }
  .panel-card { padding: 16px; }
  .annual-totals { grid-template-columns: 1fr; padding: 16px; border-top: 1px solid rgba(255,255,255,.11); border-left: 0; }
  .annual-totals > div { min-height: 68px; }
  .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-card { min-height: 84px; padding: 14px; }
  .evolution-card { padding: 15px 12px; }
  .evolution-card .section-title { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) {
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .kpi-item strong { font-size: 18px; }
  .insight-grid { grid-template-columns: 1fr; }
  .insight-card { min-height: 76px; }
  .panel-heading { align-items: flex-end; }
}
