:root {
  color-scheme: light;
  --page: #f3f4f6;
  --card: #ffffff;
  --topbar: #292b2f;
  --text: #17181a;
  --muted: #6b7078;
  --accent: #f47a20;
  --button: #e5e7eb;
  --border: #e2e4e8;
  --critical: #c73535;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(23, 24, 26, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(244, 122, 32, 0.35);
  outline-offset: 2px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(2.15rem, 3.2vw, 2.95rem); line-height: 1.06; letter-spacing: -.025em; }
h2 { margin-bottom: 0; font-size: clamp(1.5rem, 2.1vw, 1.9rem); line-height: 1.2; letter-spacing: -.012em; }
h3 { margin-bottom: 12px; font-size: 1rem; line-height: 1.3; }

.container { width: min(1440px, calc(100% - 48px)); margin-inline: auto; }
.topbar { padding: 32px 0 26px; background: var(--topbar); color: #fff; }
.topbar__content { display: grid; grid-template-columns: minmax(300px, 1fr) auto; gap: 18px 48px; align-items: start; }
.topbar__heading > p:last-child { margin-bottom: 0; color: #d0d3d8; font-size: 1.05rem; line-height: 1.4; }
.eyebrow { margin-bottom: 8px; color: var(--accent); font-size: .8rem; font-weight: 800; letter-spacing: .095em; text-transform: uppercase; }
.period-summary { display: grid; grid-template-columns: minmax(155px, auto) 112px; gap: 5px 14px; align-items: center; min-width: 370px; margin-top: 27px; border-left: 1px solid #4a4d52; padding: 1px 0 1px 24px; transform: translateY(8px); }
.period-summary label { color: #e0e2e5; font-size: 1.125rem; font-weight: 700; letter-spacing: .025em; text-transform: uppercase; }
.period-summary select { min-height: 38px; border: 1px solid #62666d; border-radius: 10px; background: #35383d; color: #fff; padding: 6px 30px 6px 12px; font-size: 1.05rem; font-weight: 800; }
.period-summary p { grid-column: 1 / -1; margin: 3px 0 0; color: #d5d7db; font-size: .94rem; }
.period-summary p:first-of-type { display: flex; flex-wrap: nowrap; gap: .35em; justify-content: flex-start; color: #fff; font-size: 1.3rem; line-height: 1.35; font-weight: 700; }
.period-summary p:first-of-type strong { color: var(--accent); }
.period-controls { grid-column: 1 / -1; display: grid; gap: 12px; }
.quick-periods, .month-picker { display: grid; width: min(100%, 820px); gap: 8px; }
.quick-periods { grid-template-columns: max-content max-content repeat(4, minmax(0, 1fr)); }
.month-picker { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.metric-switcher { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-button, .month-button, .metric-switcher button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--button);
  color: #292c31;
  font-weight: 700;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.filter-button { width: 100%; padding: 6px 18px; white-space: nowrap; }
.month-button { width: 100%; padding: 6px 10px; }
.filter-button:hover:not(:disabled), .month-button:hover:not(:disabled), .metric-switcher button:hover { transform: translateY(-1px); background: #fff; }
.filter-button.is-active, .month-button.is-active, .metric-switcher .is-active { background: var(--accent); color: #fff; }
.filter-button.is-active:hover:not(:disabled),
.filter-button.is-active:focus,
.filter-button.is-active:focus-visible { background: #f47a20; color: #fff; }
.filter-button:focus-visible { outline: 3px solid rgba(244, 122, 32, .72); outline-offset: 2px; }
.filter-button.is-active:focus-visible { outline-color: #fff; box-shadow: 0 0 0 2px #f47a20; }
.month-button.is-active:hover:not(:disabled),
.month-button.is-active:focus,
.month-button.is-active:focus-visible { background: #f47a20; color: #fff; }
.month-button:focus-visible { outline: 3px solid rgba(244, 122, 32, .72); outline-offset: 2px; }
.month-button.is-active:focus-visible { outline-color: #fff; box-shadow: 0 0 0 2px #f47a20; }
.filter-button:disabled, .month-button:disabled { border-color: #55595f; background: #3a3d42; color: #b8bbc0; cursor: not-allowed; opacity: .72; }

.dashboard { display: grid; gap: 28px; padding-block: 34px 52px; }
.section-heading, .card-heading { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.demo-note { margin: 4px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.4; text-align: right; }
.card { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.kpi-card { display: flex; flex-direction: column; min-height: 226px; padding: 25px 24px 23px; border-top: 3px solid var(--accent); }
.kpi-card h3 { min-height: 44px; color: #555a62; font-size: 1.06rem; line-height: 1.35; }
.metric-value { margin-bottom: 14px; font-size: clamp(1.7rem, 2.1vw, 2.2rem); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; overflow-wrap: anywhere; }
.change { margin-bottom: 22px; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.change--up { color: #357157; }
.change--down { color: #9a641e; }
.change--critical { color: var(--critical); }
.kpi-card a, .kpi-detail-button { margin-top: auto; color: var(--text); font-size: .94rem; font-weight: 800; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.kpi-detail-button { align-self: flex-start; border: 0; background: transparent; padding: 0; text-decoration-line: underline; cursor: pointer; }
.kpi-card a:hover, .kpi-detail-button:hover { color: var(--accent); }

.overview-grid, .paired-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.wide-card, .chart-card, .attention, .report-request { padding: clamp(20px, 3vw, 30px); }
.status-badge { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: 7px 11px; font-size: .8rem; line-height: 1.3; font-weight: 800; white-space: nowrap; }
.status-badge--neutral { background: #f0f1f3; color: var(--muted); }
.split-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.split-metric { min-width: 0; padding: 22px 20px 0 0; }
.split-metric + .split-metric { border-left: 1px solid var(--border); padding-left: 20px; }
.split-metric h3 { color: #555a62; font-size: 1.02rem; }
.detail-list { margin: 0; }
.detail-list div { display: flex; gap: 10px; justify-content: space-between; padding: 9px 0; border-top: 1px solid #f0f1f3; }
.detail-list dt { color: #61666e; font-size: .9rem; line-height: 1.35; }
.detail-list dd { margin: 0; font-size: .9rem; line-height: 1.35; font-weight: 800; text-align: right; overflow-wrap: anywhere; }

.attention-list { display: grid; gap: 10px; }
.attention-item { display: grid; grid-template-columns: 38px 1fr auto; gap: 15px; align-items: center; padding: 17px 18px; border: 1px solid var(--border); border-radius: 14px; background: #fafafa; }
.attention-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff0e6; color: #a95013; font-weight: 900; }
.attention-item h3 { margin-bottom: 4px; font-size: 1.02rem; }
.attention-item p { margin-bottom: 0; color: #62676f; font-size: .94rem; line-height: 1.45; }
.attention-item--critical { border-color: #edc2c2; background: #fffafa; }
.attention-item--critical .attention-icon { background: #fbe7e7; color: var(--critical); }
.status-badge--warning { background: #fff0e6; color: #9a4a12; }
.status-badge--check { background: #eef0f3; color: #555b64; }
.status-badge--critical { background: #fbe5e5; color: var(--critical); }
.attention-empty { margin: 0; border: 1px solid var(--border); border-radius: 14px; background: #fafafa; padding: 17px 18px; color: var(--muted); }
.attention-note { margin: 14px 0 0; color: var(--muted); font-size: .85rem; }

.comparison-chart-container { position: relative; width: 100%; min-width: 0; height: 360px; }
.comparison-chart-container canvas { display: block; max-width: 100%; }
.comparison-heading-note { display: grid; gap: 3px; min-width: min(100%, 330px); }
.comparison-heading-note .demo-note { margin-top: 4px; }
.comparison-index-note { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.4; text-align: right; }
.chart-message { display: grid; place-items: center; min-height: 220px; margin: 0; border: 1px solid var(--border); border-radius: 14px; background: #fafafa; color: var(--muted); text-align: center; }
.chart-message[hidden] { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.metric-switcher { margin-bottom: 18px; }
.metric-switcher button { min-width: 0; padding: 8px 14px; }
.trend-heading-copy { display: grid; gap: 9px; }
.trend-metric-caption { margin: 0; color: #4f545b; font-size: .94rem; font-weight: 700; }
.trend-chart-container { position: relative; width: 100%; min-width: 0; height: 360px; }
.trend-chart-container canvas { display: block; max-width: 100%; }

.mini-chart { min-height: 300px; padding: 24px; }
.mini-chart > p { color: var(--muted); font-size: .85rem; }
.mini-chart-heading { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.mini-chart-heading h3 { margin-bottom: 5px; }
.mini-chart-heading > div > p, .mini-chart-period, .inventory-chart-note { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.mini-chart-period { max-width: 230px; text-align: right; }
.inventory-chart-container, .inventory-history-chart-container, .receivables-chart-container, .receivables-history-chart-container { position: relative; width: 100%; min-width: 0; height: 320px; }
.inventory-chart-container canvas, .inventory-history-chart-container canvas, .receivables-chart-container canvas, .receivables-history-chart-container canvas { display: block; max-width: 100%; }
.inventory-chart-note { margin-top: 12px; }
.column-placeholder, .trend-placeholder { display: flex; gap: 8%; align-items: flex-end; height: 190px; margin-top: 22px; padding: 20px 7% 0; border-bottom: 1px solid #cfd2d7; background: repeating-linear-gradient(to bottom, transparent 0, transparent 46px, #eceef0 47px); }
.column-placeholder i { flex: 1; min-width: 12px; border-radius: 6px 6px 0 0; background: var(--accent); opacity: .82; }
.column-placeholder i:nth-child(1) { height: 48%; } .column-placeholder i:nth-child(2) { height: 62%; }
.column-placeholder i:nth-child(3) { height: 55%; } .column-placeholder i:nth-child(4) { height: 78%; }
.column-placeholder i:nth-child(5) { height: 68%; } .column-placeholder i:nth-child(6) { height: 84%; }
.column-placeholder--alt i { background: #60656d; }
.trend-placeholder { position: relative; display: block; }
.trend-placeholder span { position: absolute; right: 8%; left: 8%; height: 4px; border-radius: 4px; }
.trend-placeholder span:first-child { top: 45%; background: var(--accent); transform: rotate(-7deg); }
.trend-placeholder span:last-child { top: 64%; background: #aeb2b8; transform: rotate(4deg); }
.trend-placeholder--alt span:first-child { background: #60656d; transform: rotate(6deg); }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.form-grid label { display: grid; gap: 7px; color: #3f4349; font-size: .82rem; font-weight: 800; }
.form-grid select, .form-grid textarea { width: 100%; border: 1px solid #cfd2d7; border-radius: 10px; background: #fff; color: var(--text); padding: 11px 12px; }
.form-grid textarea { resize: vertical; min-height: 104px; }
.form-comment { grid-column: 1 / -1; }
.primary-button { margin-top: 20px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; padding: 12px 20px; font-weight: 800; box-shadow: 0 5px 12px rgba(244, 122, 32, .2); }
.primary-button:hover { background: #db6817; transform: translateY(-1px); }
.dialog-open { overflow: hidden; }
.expenses-dialog { width: min(calc(100% - 32px), 1000px); max-width: none; max-height: 90vh; border: 0; border-radius: 16px; background: transparent; padding: 0; color: var(--text); box-shadow: 0 18px 46px rgba(23, 24, 26, .2); overflow: hidden; }
.expenses-dialog::backdrop { background: rgba(23, 24, 26, .58); }
.expenses-dialog__panel { display: flex; flex-direction: column; max-height: 90vh; background: #fff; }
.expenses-dialog__header { display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--border); padding: 25px 28px 20px; }
.expenses-dialog__header h2 { margin-bottom: 7px; font-size: 1.55rem; }
.expenses-dialog__period { margin: 0; color: #4f545b; font-size: .95rem; font-weight: 700; line-height: 1.45; }
.expenses-dialog__vat-note { margin: 4px 0 0; color: var(--muted); font-size: .84rem; }
.expenses-dialog__close-icon { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: #f3f4f6; color: var(--text); font-size: 1.55rem; line-height: 1; cursor: pointer; }
.expenses-dialog__close-icon:hover { border-color: #c6c9ce; background: #e9eaec; }
.expenses-dialog__body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 28px; }
.expenses-dialog__message, .expenses-consistency-warning { margin: 0; border: 1px solid #e1b77f; border-radius: 12px; background: #fff8ef; padding: 14px 16px; color: #80501e; line-height: 1.45; }
.expenses-dialog__message[hidden], .expenses-consistency-warning[hidden] { display: none; }
.expenses-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-detail-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.expenses-summary article { min-width: 0; border: 1px solid var(--border); border-radius: 14px; background: #fafafa; padding: 16px 17px; }
.expenses-summary h3 { margin-bottom: 8px; color: var(--muted); font-size: .86rem; }
.expenses-summary p { margin: 0; font-size: 1.25rem; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.expenses-summary__change.is-increase { color: #9a641e; }
.expenses-summary__change.is-decrease { color: #357157; }
.expenses-summary__change.is-neutral { color: #4f545b; }
.expenses-consistency-warning { margin-bottom: 18px; }
.expenses-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.expenses-table caption { text-align: left; }
.expenses-table th, .expenses-table td { border-bottom: 1px solid var(--border); padding: 13px 11px; font-size: .86rem; line-height: 1.4; text-align: right; vertical-align: top; overflow-wrap: anywhere; }
.expenses-table th:first-child, .expenses-table td:first-child { width: 25%; text-align: left; }
.expenses-table thead th { background: #f3f4f6; color: #4f545b; font-size: .78rem; }
.expenses-table tbody th { font-weight: 750; }
.expenses-table__change { display: grid; gap: 2px; }
.expenses-table__change span:last-child { color: var(--muted); }
.expenses-table tfoot th, .expenses-table tfoot td { border-top: 2px solid #cfd2d7; border-bottom: 0; background: #fafafa; font-weight: 800; }
.expenses-table tfoot td:nth-child(4) span { display: block; }
.expenses-dialog__footer { display: flex; justify-content: flex-end; border-top: 1px solid var(--border); padding: 16px 28px; }
.expenses-dialog__close-button { border: 0; border-radius: 10px; background: var(--accent); color: #fff; padding: 11px 20px; font-weight: 800; cursor: pointer; }
.expenses-dialog__close-button:hover { background: #db6817; }
.markup-dialog { width: min(calc(100% - 32px), 1180px); }
.markup-dialog button:focus-visible { outline: 3px solid rgba(244, 122, 32, .72); outline-offset: 3px; }
.markup-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.markup-summary article { min-width: 0; border: 1px solid var(--border); border-radius: 14px; background: #fafafa; padding: 16px 17px; }
.markup-summary h3 { margin-bottom: 10px; color: #4f545b; font-size: .9rem; }
.markup-summary dl { margin: 0; }
.markup-summary dl div { display: flex; gap: 12px; justify-content: space-between; border-top: 1px solid #eceef0; padding: 8px 0; }
.markup-summary dt { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.markup-summary dd { margin: 0; font-size: .88rem; line-height: 1.35; font-weight: 800; text-align: right; white-space: nowrap; }
.markup-change.is-increase { color: #357157; }
.markup-change.is-decrease { color: #9a641e; }
.markup-change.is-neutral { color: #4f545b; }
.markup-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.markup-table caption { text-align: left; }
.markup-table th, .markup-table td { border-bottom: 1px solid var(--border); padding: 12px 9px; font-size: .78rem; line-height: 1.4; text-align: right; vertical-align: top; overflow-wrap: normal; }
.markup-table th:first-child, .markup-table td:first-child { width: 11%; text-align: left; }
.markup-table th:nth-child(2), .markup-table th:nth-child(3) { width: 15%; }
.markup-table th:nth-child(4) { width: 15%; }
.markup-table th:nth-child(5), .markup-table th:nth-child(6) { width: 22%; }
.markup-table thead th { background: #f3f4f6; color: #4f545b; font-size: .74rem; }
.markup-table tbody th { font-weight: 800; word-break: normal; overflow-wrap: normal; hyphens: none; }
.markup-table__change, .markup-table__rates { display: grid; gap: 2px; justify-items: end; text-align: right; white-space: nowrap; }
.markup-table__rates span:nth-child(2) { color: var(--muted); }
.markup-table tfoot th, .markup-table tfoot td { border-top: 2px solid var(--accent); border-bottom: 0; background: #fafafa; font-weight: 800; }
.footer { border-top: 1px solid #dedfe2; background: #e9eaec; padding: 24px 0; color: var(--muted); }
.footer strong { color: var(--text); }
.footer p { margin: 3px 0 0; font-size: .85rem; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview-grid, .paired-charts { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 28px, 1440px); }
  .topbar { padding-top: 26px; }
  .topbar__content { grid-template-columns: 1fr; gap: 22px; }
  .period-summary { min-width: 0; margin-top: 0; border-top: 1px solid #4a4d52; border-left: 0; padding: 18px 0 0; transform: none; }
  .period-summary p:first-of-type { flex-wrap: wrap; }
  .period-controls { grid-column: auto; }
  .quick-periods { display: flex; flex-wrap: wrap; }
  .quick-periods .filter-button { width: auto; }
  .month-picker { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 0; }
  .kpi-card h3 { min-height: 0; }
  .section-heading, .card-heading { flex-direction: column; gap: 8px; }
  .demo-note { text-align: left; }
  .comparison-heading-note { min-width: 0; }
  .comparison-index-note { text-align: left; }
  .split-metrics { grid-template-columns: 1fr; }
  .split-metric { padding-right: 0; }
  .split-metric + .split-metric { margin-top: 16px; border-top: 1px solid var(--border); border-left: 0; padding-left: 0; }
  .attention-item { grid-template-columns: 38px 1fr; align-items: start; }
  .attention-item .status-badge { grid-column: 2; white-space: normal; }
  .comparison-chart-container { height: 440px; }
  .trend-chart-container { height: 440px; }
  .mini-chart-heading { flex-direction: column; gap: 7px; }
  .mini-chart-period { max-width: none; text-align: left; }
  .inventory-chart-container, .inventory-history-chart-container, .receivables-chart-container, .receivables-history-chart-container { height: 410px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-comment { grid-column: auto; }
}

@media (max-width: 600px) {
  .quick-periods,
  .month-picker {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .quick-periods .filter-button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding-inline: 10px;
  }

  .quick-periods .filter-button:nth-child(-n + 2) { grid-column: span 6; }
  .quick-periods .filter-button:nth-child(n + 3) { grid-column: span 3; }

  .month-button {
    grid-column: span 2;
    min-width: 0;
    min-height: 48px;
  }

  .expenses-dialog { width: calc(100% - 18px); max-height: calc(100vh - 18px); border-radius: 14px; }
  .expenses-dialog__panel { max-height: calc(100vh - 18px); }
  .expenses-dialog__header { padding: 20px 18px 16px; }
  .expenses-dialog__header h2 { font-size: 1.35rem; }
  .expenses-dialog__body { padding: 18px; }
  .expenses-dialog__footer { padding: 14px 18px; }
  .expenses-summary { grid-template-columns: 1fr; gap: 10px; }
  .expenses-summary article { padding: 13px 14px; }
  .expenses-summary p { font-size: 1.1rem; }
  .expenses-table, .expenses-table tbody, .expenses-table tfoot, .expenses-table tr, .expenses-table th, .expenses-table td { display: block; width: 100%; }
  .expenses-table { table-layout: auto; }
  .expenses-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .expenses-table tbody tr, .expenses-table tfoot tr { display: grid; grid-template-columns: minmax(0, 1fr); margin-bottom: 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 8px 12px; }
  .expenses-table th, .expenses-table td, .expenses-table th:first-child, .expenses-table td:first-child { border-bottom: 1px solid #eceef0; padding: 9px 0; text-align: right; }
  .expenses-table tbody th:first-child, .expenses-table tfoot th:first-child { grid-column: 1 / -1; width: 100%; min-width: 0; text-align: left; font-weight: 800; word-break: normal; overflow-wrap: normal; hyphens: none; }
  .expenses-table tbody td, .expenses-table tfoot td { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 16px; align-items: start; white-space: nowrap; }
  .expenses-table td::before { content: attr(data-label); min-width: 0; color: var(--muted); font-size: .78rem; font-weight: 700; text-align: left; white-space: normal; }
  .expenses-table__change { justify-items: end; text-align: right; white-space: nowrap; }
  .expenses-table tbody tr > :last-child, .expenses-table tfoot tr > :last-child { border-bottom: 0; }
  .expenses-table tfoot th, .expenses-table tfoot td { background: transparent; }
  .expenses-table tfoot tr { border-top: 2px solid var(--accent); background: #fafafa; }
  .expenses-dialog__close-button { width: 100%; min-height: 44px; }

  .markup-summary { grid-template-columns: 1fr; gap: 10px; }
  .markup-summary article { padding: 13px 14px; }
  .markup-table, .markup-table tbody, .markup-table tfoot, .markup-table tr, .markup-table th, .markup-table td { display: block; width: 100%; }
  .markup-table { table-layout: auto; }
  .markup-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .markup-table tbody tr, .markup-table tfoot tr { display: grid; grid-template-columns: minmax(0, 1fr); margin-bottom: 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 8px 12px; }
  .markup-table th, .markup-table td, .markup-table th:first-child, .markup-table td:first-child { border-bottom: 1px solid #eceef0; padding: 9px 0; text-align: right; }
  .markup-table tbody th:first-child, .markup-table tfoot th:first-child { grid-column: 1 / -1; width: 100%; min-width: 0; text-align: left; font-weight: 800; word-break: normal; overflow-wrap: normal; hyphens: none; }
  .markup-table tbody td, .markup-table tfoot td { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 12px; align-items: start; white-space: nowrap; }
  .markup-table td::before { content: attr(data-label); min-width: 0; color: var(--muted); font-size: .76rem; font-weight: 700; line-height: 1.35; text-align: left; white-space: normal; }
  .markup-table__change, .markup-table__rates { justify-items: end; text-align: right; white-space: nowrap; }
  .markup-table tbody tr > :last-child, .markup-table tfoot tr > :last-child { border-bottom: 0; }
  .markup-table tfoot th, .markup-table tfoot td { background: transparent; }
  .markup-table tfoot tr { border-top: 2px solid var(--accent); background: #fafafa; }
}

@media (max-width: 420px) {
  .container { width: min(100% - 20px, 1440px); }
  .wide-card, .chart-card, .attention, .report-request, .mini-chart { padding: 18px; }
  .metric-value { font-size: 1.65rem; }
  .month-button { width: 100%; }
  .metric-switcher { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-switcher button { min-height: 44px; padding-inline: 10px; }
}

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