:root {
  color-scheme: light;
  --ink: #1b2b3a;
  --muted: #71808d;
  --line: #e3eaf0;
  --surface: #fff;
  --canvas: #f3f6f9;
  --green: #176178;
  --green-dark: #104c60;
  --green-soft: #e5f1f4;
  --shadow: 0 10px 28px rgba(28, 52, 72, .055);
  --font-body: Inter, Aptos, "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: Inter, "Aptos Display", "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  font-family: var(--font-body);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }

.sidebar {
  width: 248px; position: fixed; inset: 0 auto 0 0; z-index: 2; display: flex; flex-direction: column;
  background: #172d3b; border-right: 1px solid #233d4c; padding: 27px 18px 20px;
}
.brand { display: flex; align-items: center; gap: 11px; color: #f5f8fa; text-decoration: none; padding: 0 9px; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: #fff; background: #16867f; font: 800 22px var(--font-display); }
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy strong { font: 800 16px var(--font-display); letter-spacing: -.5px; }
.brand-copy small { color: #91a6b2; font-size: 8px; font-weight: 700; letter-spacing: 1.15px; }
.side-label { margin: 49px 9px 13px; color: #8398a4; font-size: 9px; font-weight: 700; letter-spacing: 1.15px; }
.main-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 9px; color: #b4c3cb; text-decoration: none; font-size: 13px; font-weight: 600; transition: background .18s, color .18s; }
.nav-link:hover { background: #203d4c; color: #fff; }
.nav-link.active { background: #214958; color: #fff; }
.nav-icon { width: 17px; color: #8da3af; text-align: center; font-size: 17px; }
.nav-link.active .nav-icon { color: #5bc4ba; }
.sidebar-note { margin: auto 5px 20px; padding: 17px 15px 15px; border: 1px solid #294655; border-radius: 12px; background: #1d3948; }
.note-icon { display: grid; width: 28px; height: 28px; place-items: center; margin-bottom: 12px; border-radius: 8px; color: #f0c66d; background: #3a4b4c; }
.sidebar-note strong { color: #f5f8fa; font: 700 12px var(--font-display); }
.sidebar-note p { margin: 6px 0 0; color: #a3b4bd; font-size: 11px; line-height: 1.6; }
.sidebar-footer { display: flex; align-items: center; gap: 8px; padding: 0 7px; color: #a3b4bd; font-size: 9px; line-height: 1.4; }
.status-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #5bc4a7; }

.main-content { min-height: 100vh; margin-left: 248px; }
.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 46px; border-bottom: 1px solid #e5ebf0; background: rgba(255,255,255,.88); }
.breadcrumb { color: #949b92; font-size: 11px; }
.breadcrumb span { margin: 0 9px; color: #c2c7bf; }
.breadcrumb strong { color: #566052; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 15px; }
.today-label { color: #818a80; font-size: 11px; text-transform: capitalize; }
.avatar { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; color: #24566a; background: #e5eff3; font-size: 12px; font-weight: 700; }
.page-content { max-width: 1370px; margin: 0 auto; padding: 42px 46px 24px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: #879283; font-size: 9px; font-weight: 700; letter-spacing: 1.25px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font: 750 27px var(--font-display); letter-spacing: -.8px; }
.heading-copy { margin: 0; color: #8a9288; font-size: 12px; }
.button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; font-size: 11px; font-weight: 700; transition: background .18s, transform .18s, box-shadow .18s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--green); box-shadow: 0 4px 10px rgba(23,97,120,.18); }
.button-primary:hover { background: var(--green-dark); }
.button-primary span { font-size: 16px; font-weight: 400; }
.button-secondary { border-color: #e5e9e1; color: #646d62; background: #fff; }
.button-secondary:hover { background: #f8f9f6; }
.button-income { border-color: #cfe7e4; color: #16736d; background: #e8f5f3; }
.button-income:hover { background: #dff0ed; }
.button-saving { border-color: #eadfbe; color: #8b6a24; background: #f8f3e7; }
.button-saving:hover { background: #f1e9d5; }
.button-withdrawal { border-color: #dfe6ec; color: #536879; background: #f4f7f9; }
.button-withdrawal:hover { background: #eaf0f4; }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.heading-actions, .empty-actions { display: flex; align-items: center; gap: 8px; }

.period-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.filter-label, .card-label { display: block; color: #959c91; font-size: 8px; font-weight: 700; letter-spacing: 1px; }
.period-controls { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.period-mode-label, .period-value-label { display: flex; align-items: center; gap: 7px; color: #969d93; font-size: 10px; white-space: nowrap; }
.period-controls select, .period-controls input { height: 32px; padding: 0 8px; border: 1px solid #e6e9e2; border-radius: 6px; outline: none; color: #505a4e; background: #fff; font-size: 10px; }
.period-controls select:focus, .period-controls input:focus { border-color: #86a990; box-shadow: 0 0 0 3px rgba(91,140,105,.1); }
.period-controls input[type="month"] { width: 137px; }
.period-controls input[type="date"] { width: 132px; }
.period-arrow { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid #e6e9e2; border-radius: 6px; color: #64705f; background: #fff; font-size: 19px; line-height: 1; }
.period-arrow:hover:not(:disabled) { color: var(--green); background: #f5f8f3; }
.period-arrow:disabled { cursor: not-allowed; opacity: .4; }
.date-filters { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.date-filters label { display: flex; align-items: center; gap: 7px; color: #969d93; font-size: 10px; }
.date-filters input { width: 126px; height: 32px; padding: 0 8px; border: 1px solid #e6e9e2; border-radius: 6px; outline: none; color: #505a4e; background: #fff; font-size: 10px; }
.date-filters input:focus, .form-field input:focus, .form-field select:focus { border-color: #86a990; box-shadow: 0 0 0 3px rgba(91,140,105,.1); }
.date-separator { color: #b6bcb3; font-size: 11px; }
.text-button { margin-left: 2px; padding: 7px 8px; border: 0; border-radius: 5px; color: var(--green); background: transparent; font-size: 10px; font-weight: 700; }
.text-button:hover { background: #eaf0e9; }
.period-hint { padding-bottom: 6px; color: #969d93; font-size: 10px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.summary-card { min-height: 125px; padding: 18px 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.total-card { border-color: #d7ebe8; background: linear-gradient(120deg, #f1f9f8, #fff 75%); }
.income-total-card { border-color: #d7ebe8; background: linear-gradient(120deg, #f1f9f8, #fff 75%); }
.balance-card { border-color: #dce5ec; background: linear-gradient(120deg, #f4f8fa, #fff 75%); }
.card-topline { display: flex; align-items: center; justify-content: space-between; }
.card-symbol { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; font-size: 13px; }
.total-symbol { color: #bd6c54; background: #fbefeb; }
.income-symbol { color: #16736d; background: #e4f3f0; }
.balance-symbol { color: #47728c; background: #eaf2f6; }
.savings-symbol { color: #98762c; background: #f7f1e2; }
.summary-value { display: block; margin-top: 11px; font: 750 23px var(--font-display); letter-spacing: -.35px; font-variant-numeric: tabular-nums; }
.summary-value.positive-balance { color: #16736d; }
.summary-value.negative-balance { color: #bd5d54; }
.card-caption { display: block; margin-top: 4px; color: #969d93; font-size: 10px; }

.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .9fr); gap: 15px; margin-bottom: 15px; }
.app-view { margin-bottom: 15px; }
.movements-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.movements-toolbar h2 { margin: 0 0 4px; font: 700 15px var(--font-display); }
.movements-toolbar p { margin: 0; color: #92998f; font-size: 10px; }
.movement-filter { display: flex; align-items: center; gap: 8px; color: #858e82; font-size: 10px; }
.movement-filter select { height: 32px; padding: 0 9px; border: 1px solid #e6e9e2; border-radius: 6px; outline: none; color: #505a4e; background: #fff; font-size: 10px; }
.movement-filter select:focus { border-color: #86a990; box-shadow: 0 0 0 3px rgba(91,140,105,.1); }
.movement-analytics { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .9fr); gap: 16px; margin-bottom: 16px; }
.chart-panel { min-width: 0; min-height: 340px; border-color: #e2e9ef; border-radius: 14px; }
.chart-panel .panel-heading { padding: 19px 20px 11px; }
.chart-panel .panel-heading h2 { color: #203647; font-size: 15px; }
.chart-panel .panel-heading p { color: #7d8b97; }
.chart-period-label { color: #82919d; font-size: 10px; white-space: nowrap; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 1px 20px 4px; color: #667886; font-size: 10px; }
.chart-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { display: inline-block; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 3px; background: var(--legend-color, #16867f); }
.trend-income { background: #16867f; }
.trend-expense { background: #d87962; }
.trend-savings { background: #b28a3b; }
.trend-chart { min-height: 265px; padding: 0 14px 10px 6px; }
.trend-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-body); }
.chart-gridline line { stroke: #eaf0f4; stroke-width: 1; }
.chart-gridline text { fill: #8a98a4; font-size: 9px; }
.chart-zero-line { stroke: #a8b5be; stroke-width: 1.2; }
.chart-axis-label { fill: #7d8c98; font-size: 9px; }
.chart-bar { transition: opacity .16s ease; }
.chart-bar:hover { opacity: .76; }
.chart-bar-income { fill: #16867f; }
.chart-bar-expense { fill: #d87962; }
.chart-bar-savings { fill: #b28a3b; }
.chart-empty { display: grid; min-height: 245px; place-items: center; padding: 24px; color: #8795a0; font-size: 11px; text-align: center; }
.expense-mix-content { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(110px, .95fr); align-items: center; gap: 3px; padding: 4px 18px 20px; }
.expense-donut { display: grid; min-width: 0; place-items: center; }
.donut-svg { display: block; width: min(100%, 210px); height: auto; overflow: visible; }
.donut-track { stroke: #edf1f4; }
.donut-total { fill: #203647; font: 700 16px var(--font-display); }
.donut-caption { fill: #83919d; font: 10px var(--font-body); }
.expense-legend { display: grid; gap: 11px; min-width: 0; }
.expense-legend-item { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 7px; color: #687986; font-size: 9px; }
.expense-legend-item strong { color: #304353; font-size: 10px; font-variant-numeric: tabular-nums; }
.expense-legend-details { display: grid; min-width: 0; gap: 3px; }
.expense-legend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expense-legend-amount { color: #8a98a4; font-size: 9px; font-variant-numeric: tabular-nums; }
.chart-empty-copy { grid-column: 1 / -1; margin: 0; color: #8795a0; font-size: 10px; line-height: 1.5; text-align: center; }
.comparison-panel .panel-heading { padding-bottom: 13px; }
.comparison-content { padding: 0 19px 16px; }
.comparison-bar { display: flex; overflow: hidden; height: 13px; border-radius: 9px; background: #f1f3ef; }
.comparison-segment { display: block; height: 100%; transition: width .25s ease; }
.income-segment { background: #16867f; }
.expense-segment { background: #d87962; }
.comparison-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 15px; }
.comparison-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
.legend-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; }
.income-dot { background: #16867f; }
.expense-dot { background: #d87962; }
.comparison-item > div { display: grid; min-width: 0; gap: 3px; }
.legend-label { color: #8d958a; font-size: 9px; }
.comparison-item strong { overflow: hidden; color: #394337; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.legend-percent { margin-left: auto; color: #4d594a; font: 700 12px var(--font-display); font-variant-numeric: tabular-nums; }
.comparison-caption { margin: 13px 0 0; color: #9aa197; font-size: 9px; }
.daily-highlights { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.day-card { display: flex; min-width: 0; min-height: 126px; flex-direction: column; justify-content: center; padding: 15px; }
.day-card-label { color: #929a8f; font-size: 8px; font-weight: 700; letter-spacing: .8px; line-height: 1.5; }
.day-amount { overflow: hidden; margin-top: 10px; color: #354136; font: 750 18px var(--font-display); font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.spending-day .day-amount { color: #b45d4d; }
.earning-day .day-amount { color: #16736d; }
.day-date { overflow: hidden; margin-top: 5px; color: #939b91; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(220px, .82fr); align-items: start; gap: 15px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 19px 16px; }
.panel-heading h2 { margin: 0 0 4px; font: 700 14px var(--font-display); letter-spacing: -.2px; }
.panel-heading p { margin: 0; color: #92998f; font-size: 10px; }
.result-count { padding: 5px 8px; border-radius: 5px; color: #7b8578; background: #f5f7f3; font-size: 9px; }
.transaction-table-wrap { position: relative; min-height: 195px; }
.transaction-table { width: 100%; border-collapse: collapse; text-align: left; }
.transaction-table thead { background: #fafbf9; }
.transaction-table th { padding: 10px 11px; color: #9ba197; font-size: 8px; font-weight: 700; letter-spacing: .65px; white-space: nowrap; }
.transaction-table th:first-child, .transaction-table td:first-child { padding-left: 19px; }
.transaction-table th:last-child, .transaction-table td:last-child { padding-right: 15px; }
.transaction-table td { padding: 11px; border-top: 1px solid #f0f2ed; color: #747d72; font-size: 10px; white-space: nowrap; }
.transaction-table tbody tr:hover { background: #fcfdfb; }
.expense-description-cell { display: flex; align-items: center; gap: 9px; color: #394337 !important; font-weight: 600; }
.expense-mark { display: grid; flex: 0 0 auto; width: 29px; height: 29px; place-items: center; border-radius: 8px; color: var(--tone); background: var(--tone-bg); font-size: 12px; }
.category-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 5px; color: var(--tone); background: var(--tone-bg); font-size: 9px; }
.category-pill::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.amount-cell { color: #364135 !important; text-align: right; font-weight: 700; }
.income-amount { color: #16736d !important; }
.expense-amount { color: #b45d4d !important; }
.savings-amount { color: #98762c !important; }
.amount-heading { text-align: right; }
.row-action { width: 25px; height: 25px; border: 0; border-radius: 6px; color: #a0a79d; background: transparent; font-size: 16px; }
.row-action:hover { color: #a74848; background: #fbefed; }
.empty-state { display: none; min-height: 195px; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; }
.empty-state.visible { display: flex; }
.empty-icon { display: grid; width: 37px; height: 37px; place-items: center; margin-bottom: 10px; border-radius: 50%; color: #287c80; background: #e8f3f4; font-size: 24px; }
.empty-state strong { color: #4a5448; font: 700 12px var(--font-display); }
.empty-state p { max-width: 230px; margin: 5px 0 12px; color: #939a91; font-size: 10px; line-height: 1.5; }
.empty-state .button { min-height: 32px; font-size: 10px; }

.categories-panel { padding-bottom: 7px; }
.categories-view .categories-panel { max-width: 860px; }
.categories-heading { padding-bottom: 13px; }
.category-group h3 { margin: 4px 17px 6px; color: #a0a69e; font-size: 8px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.category-group + .category-group { margin-top: 12px; }
.icon-button { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid #e6ebe3; border-radius: 7px; color: var(--green); background: #fff; font-size: 17px; }
.icon-button:hover { background: #f1f5f0; }
.category-list { padding: 0 14px; }
.category-item { display: flex; align-items: center; gap: 9px; padding: 9px 3px; border-top: 1px solid #f0f2ed; }
.category-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--tone); }
.category-name { flex: 1; overflow: hidden; color: #636d61; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.category-total { color: #384237; font-size: 10px; font-weight: 700; white-space: nowrap; }
.category-delete { width: 21px; height: 21px; padding: 0; border: 0; border-radius: 5px; color: #a2a99f; background: transparent; font-size: 14px; opacity: 0; }
.category-item:hover .category-delete, .category-delete:focus-visible { opacity: 1; }
.category-delete:hover { color: #a74848; background: #fbefed; }
.add-category-link { display: flex; align-items: center; gap: 6px; margin: 7px 16px 3px; padding: 6px 2px; border: 0; color: var(--green); background: transparent; font-size: 10px; font-weight: 700; }
.add-category-link:hover { color: var(--green-dark); }
.page-footer { display: grid; justify-items: center; gap: 9px; padding: 21px 0 0; color: #90998e; text-align: center; font-size: 9px; }
.backup-actions { display: flex; justify-content: center; gap: 7px; }
.backup-actions .button { min-height: 31px; padding: 0 10px; font-size: 9px; }
.backup-hint { color: #a0a69e; }

.app-dialog { width: min(440px, calc(100% - 32px)); padding: 24px; border: 1px solid #e8ece4; border-radius: 14px; color: var(--ink); box-shadow: 0 20px 70px rgba(27,43,30,.19); }
.app-dialog::backdrop { background: rgba(31,42,33,.36); backdrop-filter: blur(2px); }
.app-dialog form { display: grid; gap: 16px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 3px; }
.dialog-heading h2 { margin: 0; font: 750 20px var(--font-display); letter-spacing: -.4px; }
.dialog-close { display: grid; width: 29px; height: 29px; place-items: center; border: 0; border-radius: 7px; color: #899186; background: #f5f7f3; font-size: 20px; }
.form-field { display: grid; gap: 7px; color: #606a5e; font-size: 10px; font-weight: 700; }
.form-field input, .form-field select { width: 100%; height: 39px; padding: 0 11px; border: 1px solid #e5e9e2; border-radius: 7px; outline: none; color: #475145; background: #fff; font-size: 11px; font-weight: 400; }
.form-field input::placeholder { color: #b2b8af; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-prefix { position: relative; display: block; }
.input-prefix > span { position: absolute; top: 50%; left: 11px; color: #899286; transform: translateY(-50%); font-size: 11px; }
.input-prefix input { padding-left: 25px; }
.form-error { display: none; margin: -5px 0; color: #ad4949; font-size: 10px; }
.form-error.visible { display: block; }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.tone-sage { --tone: #16736d; --tone-bg: #e6f3f1; }
.tone-blue { --tone: #477da8; --tone-bg: #eaf1f7; }
.tone-lavender { --tone: #8274a8; --tone-bg: #f0edf7; }
.tone-peach { --tone: #c17a51; --tone-bg: #f8eee7; }
.tone-rose { --tone: #b66072; --tone-bg: #f8ecef; }
.tone-gold { --tone: #98762c; --tone-bg: #f7f1e2; }

@media (max-width: 1050px) {
  .sidebar { width: 215px; }
  .main-content { margin-left: 215px; }
  .topbar { padding: 0 30px; }
  .page-content { padding: 35px 30px 22px; }
  .heading-actions { flex-wrap: wrap; max-width: 520px; }
  .heading-actions .button { flex: 1 1 calc(50% - 6px); }
  .content-grid { grid-template-columns: minmax(0, 1.55fr) minmax(205px, .85fr); }
  .movement-analytics { grid-template-columns: minmax(0, 1.35fr) minmax(250px, .9fr); gap: 12px; }
  .transaction-table th, .transaction-table td { padding-right: 7px; padding-left: 7px; }
  .transaction-table th:first-child, .transaction-table td:first-child { padding-left: 13px; }
  .analytics-grid { grid-template-columns: minmax(0, 1.1fr) minmax(220px, .9fr); }
  .daily-highlights { gap: 8px; }
  .day-card { padding: 13px; }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; height: auto; padding: 13px 17px 10px; border-right: 0; border-bottom: 1px solid #233d4c; }
  .brand { padding: 0; }
  .brand-mark { width: 33px; height: 33px; border-radius: 10px; }
  .side-label, .sidebar-note, .sidebar-footer { display: none; }
  .main-nav { grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 12px; }
  .nav-link { justify-content: center; gap: 6px; padding: 8px 4px; font-size: 10px; }
  .nav-icon { width: auto; font-size: 14px; }
  .main-content { margin-left: 0; }
  .topbar { height: 48px; padding: 0 17px; }
  .today-label { font-size: 9px; }
  .avatar { width: 27px; height: 27px; }
  .page-content { padding: 26px 17px 20px; }
  .page-heading { align-items: start; flex-wrap: wrap; margin-bottom: 23px; }
  h1 { font-size: 23px; }
  .heading-copy { max-width: 230px; font-size: 11px; line-height: 1.5; }
  .heading-actions { width: 100%; max-width: none; flex: 0 0 100%; flex-wrap: wrap; justify-content: end; gap: 6px; }
  .heading-actions .button { min-height: 35px; flex: 1 1 calc(50% - 6px); padding: 0 10px; font-size: 9px; }
  .heading-actions .button span { font-size: 14px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .summary-card { min-height: 110px; padding: 13px 11px; }
  .card-label { max-width: 100px; font-size: 7px; line-height: 1.4; }
  .card-symbol { width: 23px; height: 23px; }
  .summary-value { margin-top: 12px; font-size: 18px; }
  .card-caption { font-size: 8px; line-height: 1.4; }
  .content-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
  .movement-analytics { grid-template-columns: 1fr; }
  .trend-svg { min-width: 600px; }
  .trend-chart { overflow-x: auto; }
  .daily-highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 510px) {
  .page-heading { flex-wrap: wrap; }
  .heading-actions { width: 100%; flex-wrap: wrap; }
  .heading-actions .button { flex: 1 1 calc(50% - 6px); padding: 0 6px; font-size: 8px; }
  .empty-actions { flex-wrap: wrap; justify-content: center; }
  .period-toolbar { align-items: start; flex-direction: column; }
  .period-controls { flex-wrap: wrap; gap: 5px; }
  .period-mode-label, .period-value-label { gap: 4px; font-size: 9px; }
  .period-controls select { max-width: 78px; padding: 0 5px; font-size: 9px; }
  .period-controls input[type="month"] { width: 123px; }
  .period-controls input[type="date"] { width: 116px; }
  .period-arrow { width: 26px; height: 27px; }
  .date-filters { gap: 5px; }
  .date-filters label { gap: 4px; font-size: 9px; }
  .date-filters input { width: 111px; font-size: 9px; }
  .period-hint { display: none; }
  .movements-toolbar { align-items: start; flex-direction: column; }
  .expense-mix-content { grid-template-columns: minmax(130px, 1fr) minmax(105px, .9fr); gap: 0; padding-right: 12px; padding-left: 12px; }
  .chart-panel .panel-heading { padding-right: 14px; padding-left: 14px; }
  .chart-legend { gap: 9px; padding-right: 14px; padding-left: 14px; font-size: 9px; }
  .comparison-content { padding-right: 13px; padding-left: 13px; }
  .comparison-legend { gap: 7px; }
  .comparison-item { gap: 5px; }
  .comparison-item strong { font-size: 9px; }
  .legend-percent { font-size: 10px; }
  .daily-highlights { gap: 7px; }
  .day-card { min-height: 111px; padding: 11px; }
  .day-amount { font-size: 15px; }
  .summary-card { min-height: 105px; padding: 13px 11px; }
  .summary-value { font-size: 16px; }
  .transaction-table th:nth-child(3), .transaction-table td:nth-child(3) { display: none; }
  .transaction-table th { font-size: 7px; }
  .transaction-table td { font-size: 9px; }
  .expense-description-cell { gap: 6px; }
  .expense-mark { width: 25px; height: 25px; }
  .category-pill { padding: 4px 5px; font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
