:root {
  color-scheme: light;
  --forest: #142a22;
  --forest-deep: #11251e;
  --ink: #182923;
  --muted: #5d6d64;
  --quiet: #6b7a71;
  --line: #e0e8e1;
  --paper: #fff;
  --wash: #f4f7f2;
  --green: #286448;
  --green-dark: #1d5038;
  --green-light: #e7f2e5;
  --lime: #d5ed9c;
  --rust: #a24031;
  --rust-light: #fcece7;
  --amber: #795513;
  --amber-light: #fff4d6;
  --radius: 16px;
  --shadow: 0 1px 2px #16322008;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--wash); color: var(--ink); font-size: 14px; line-height: 1.5; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { vertical-align: middle; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #8bbd62; outline-offset: 3px; }
.icon { width: 19px; height: 19px; flex: none; vertical-align: middle; }
.text-muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.app-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 30px 17px 17px;
  overflow-y: auto;
  background: var(--forest);
  color: #ecf4eb;
}
.brand, .topbar-brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; }
.sidebar .brand { margin: 0 11px 40px; }
.brand-mark {
  width: 39px;
  height: 39px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: var(--lime);
  border-radius: 11px;
}
.brand-mark .icon, .brand-mark svg { width: 21px; height: 21px; }
.brand-mark:not(:has(svg)):empty::before { content: ""; width: 14px; height: 14px; transform: rotate(45deg); border: 2px solid currentColor; border-radius: 3px; }
.brand-copy, .owner-meta { min-width: 0; }
.brand-name { display: block; font-size: 24px; line-height: .98; font-weight: 780; letter-spacing: -.085em; }
.brand-sub { display: block; margin-top: 6px; color: #acc3b1; font-size: 9px; font-weight: 700; line-height: 1; letter-spacing: .21em; text-transform: uppercase; }
.sidebar-label { margin: 0 11px 9px; color: #9fb8a7; font-size: 10px; font-weight: 740; letter-spacing: .15em; text-transform: uppercase; }
.area-links, .nav-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.area-links { margin-bottom: 31px; }
.area-link, .nav-link { position: relative; display: flex; align-items: center; min-height: 42px; padding: 9px 11px; gap: 10px; border-radius: 9px; font-weight: 580; }
.area-link { border: 1px solid #466054; color: #e1eee2; }
.area-link .icon, .nav-link .icon { width: 17px; height: 17px; }
.area-link .icon:first-child { margin-right: 1px; }
.area-link .icon:last-child:not(:first-child) { margin-left: auto; }
.area-link:hover, .nav-link:hover { background: #ffffff10; }
.area-link[aria-current]:not([aria-current="false"]), .area-link[aria-pressed="true"], .area-link.active { background: #2c4739; border-color: #4c6858; color: #f5f9f2; font-weight: 700; }
.area-link[aria-current]:not([aria-current="false"]) .icon, .area-link[aria-pressed="true"] .icon, .area-link.active .icon { color: #d4ec9c; }
.nav-link { color: #cfdfd4; }
.nav-link[aria-current]:not([aria-current="false"]), .nav-link.active { background: #30483b; color: #f3f9e9; font-weight: 700; }
.nav-link[aria-current]:not([aria-current="false"]) .icon, .nav-link.active .icon { color: #d6ebaa; }
.side-bottom, .side-footer { margin-top: auto; padding: 17px 6px 0; border-top: 1px solid #3d5548; display: flex; align-items: center; gap: 9px; }
.owner-avatar { width: 35px; height: 35px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #355544; color: #e1efca; font-weight: 760; font-size: 12px; }
.owner-meta { flex: 1; line-height: 1.25; }
.owner-meta > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-meta strong { color: #f3f7f0; font-size: 12px; }
.owner-meta small, .owner-meta span { margin-top: 4px; color: #b3c9bb; font-size: 10px; }
.logout-button { background: transparent; color: #cbdfd0; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 6px; border: 0; border-radius: 7px; gap: 5px; }
.logout-button:hover { background: #ffffff12; color: white; }
.logout-button .icon { width: 16px; height: 16px; }

.workspace { min-width: 0; }
.topbar { min-height: 67px; padding: 11px clamp(23px, 3.4vw, 52px); display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); background: #fffdf9; }
.topbar-brand { color: var(--green-dark); }
.topbar-brand .brand-copy { display: flex; align-items: baseline; gap: 8px; }
.topbar-brand .brand-name { font-size: 20px; }
.topbar-brand .brand-sub { margin: 0; color: var(--muted); letter-spacing: .15em; }
.topbar-brand .brand-mark, .mobile-area-links, .mobile-nav { display: none; }
.topbar-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topbar-date { color: var(--muted); font-size: 12px; }
.period-select { display: inline-flex; gap: 8px; align-items: center; min-width: 0; min-height: 40px; padding: 0 11px; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; font-weight: 650; }
.period-select .icon { width: 15px; height: 15px; color: var(--green); }
.period-select input, .period-select select { width: 9rem; min-width: 0; background: transparent; border: 0; padding: 0; }
.page-content { width: 100%; max-width: 1570px; margin: 0 auto; padding: 33px clamp(23px, 3.4vw, 52px) 47px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 27px; }
.page-heading h1 { font-size: clamp(30px, 3.1vw, 44px); line-height: 1.07; font-weight: 760; letter-spacing: -.062em; }
.page-heading p { margin-top: 9px; color: var(--muted); font-size: 14px; }
.eyebrow, .section-kicker { display: inline-flex; gap: 7px; align-items: center; margin-bottom: 9px; color: var(--green); font-size: 10px; font-weight: 780; letter-spacing: .15em; text-transform: uppercase; }
.eyebrow .icon, .section-kicker .icon { width: 13px; height: 13px; }
.kicker-dot { display: inline-block; width: 7px; height: 7px; background: #8bac62; border-radius: 50%; flex: none; }
.page-actions, .form-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid transparent; border-radius: 9px; font-weight: 680; font-size: 13px; line-height: 1.25; white-space: nowrap; }
.button .icon { width: 16px; height: 16px; }
.button-primary { background: var(--green-dark); color: #fff; box-shadow: 0 1px 2px #0b301626; }
.button-primary:hover { background: #28674a; }
.button-secondary { background: #fff; color: var(--ink); border-color: #dbe4db; }
.button-secondary:hover { border-color: #a0b5a4; background: #fbfdfb; }
.button-quiet { min-height: 34px; padding: 5px 8px; background: transparent; color: var(--green); }
.button-quiet:hover { background: var(--green-light); }
.button-danger { background: var(--rust-light); color: var(--rust); }
.button-danger:hover { background: #f7dcd4; }
.button:disabled { opacity: .55; cursor: default; }

.section-title { font-size: 19px; line-height: 1.22; font-weight: 730; letter-spacing: -.035em; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.metric-card { position: relative; display: flex; min-width: 0; min-height: 134px; flex-direction: column; justify-content: center; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.metric-label { color: #4e6255; font-size: 12px; font-weight: 680; }
.metric-value { display: block; margin-top: 8px; color: var(--ink); font-size: clamp(20px, 2.32vw, 34px); line-height: 1.08; font-weight: 740; letter-spacing: -.06em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-note { color: var(--quiet); margin-top: 7px; font-size: 11px; line-height: 1.3; }
.metric-icon { display: grid; width: 31px; height: 31px; place-items: center; flex: none; border-radius: 9px; color: var(--green); background: var(--green-light); }
.metric-card > .metric-icon { position: absolute; top: 14px; right: 14px; }
.metric-card:has(> .metric-icon) .metric-label { padding-right: 34px; }
.metric-icon .icon { width: 16px; height: 16px; }
.metric-negative .metric-icon, .metric-icon.metric-negative { color: var(--rust); background: var(--rust-light); }
.metric-positive .metric-value, .metric-value.metric-positive { color: var(--green-dark); }
.metric-negative .metric-value, .metric-value.metric-negative { color: var(--rust); }
.metric-card:first-child { border-color: #d9e8d3; background: #edf5e8; }
.metric-card:first-child .metric-icon { background: #dbeccd; }

.chart-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 15px; margin-bottom: 18px; }
.panel { min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.chart-grid .panel { container-type: inline-size; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 17px; }
.panel-heading .section-kicker { margin-bottom: 4px; }
.panel-heading p, .panel-subtitle { margin-top: 5px; color: var(--muted); font-size: 12px; }
.chart-legend { align-self: center; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 11px; font-weight: 630; }
.chart-legend > * { display: inline-flex; gap: 5px; align-items: center; }
.legend-dot { width: 8px; height: 8px; display: inline-block; border-radius: 3px; background: #487e58; }
.legend-dot.is-out, .chart-legend > :nth-child(2) .legend-dot { background: #bfd58c; }
.trend-plot { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; min-height: 147px; padding-top: 5px; }
.trend-group { display: grid; gap: 7px; align-content: start; min-width: 0; text-align: center; }
.trend-pair { display: flex; align-items: end; justify-content: center; width: 100%; height: 112px; gap: clamp(3px, .5vw, 7px); background: repeating-linear-gradient(to top, #e7eee7 0, #e7eee7 1px, transparent 1px, transparent 28px); }
.trend-bar { width: min(29%, 21px); height: var(--bar, 0%); border-radius: 4px 4px 0 0; background: #487e58; }
.trend-bar.is-in { background: #487e58; }
.trend-bar.is-out { background: #bfd58c; }
.trend-month { color: var(--muted); text-transform: capitalize; font-size: 11px; font-weight: 630; }
.trend-values { display: block; color: var(--muted); font-size: 10px; line-height: 1.35; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.trend-values > span { display: block; }
.trend-values > span:first-child { color: var(--green-dark); }
.trend-values > span:last-child { color: #536432; }
.spending-list { display: grid; gap: 14px; margin: 3px 0 0; list-style: none; padding: 0; }
.spend-row { min-width: 0; }
.spend-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3px 9px; margin-bottom: 6px; color: var(--ink); font-size: 12px; font-weight: 610; }
.spend-meta strong { max-width: 100%; font-weight: 720; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.spend-track { background: #eaf0e8; height: 7px; overflow: hidden; border-radius: 99px; }
.spend-fill { display: block; width: var(--fill, 0%); height: 100%; border-radius: inherit; background: #54815b; }
.spend-row:nth-child(2) .spend-fill { background: #77956b; }
.spend-row:nth-child(3) .spend-fill { background: #9bb275; }
.spend-row:nth-child(n+4) .spend-fill { background: #b7ca89; }
.empty-state { display: grid; gap: 7px; justify-items: center; align-content: center; min-height: 126px; padding: 20px 14px; color: var(--muted); text-align: center; background: #f7f9f5; border: 1px dashed #dce6d9; border-radius: 10px; }
.empty-state .icon { width: 24px; height: 24px; color: var(--green); }
.empty-state strong { color: var(--ink); }
.empty-state p { max-width: 38ch; }

.pending-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin: 0 0 18px; }
.pending-card { min-width: 0; padding: 15px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 12px; background: #f9fbf8; }
.pending-card .icon { color: var(--green); }
.pending-card:nth-child(2) .metric-icon { background: var(--amber-light); }
.pending-card:nth-child(2) .icon { color: var(--amber); }
.pending-card > div { min-width: 0; }
.pending-card p, .pending-card small { color: var(--muted); font-size: 12px; }
.pending-card strong { font-size: 17px; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
.list-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.list-table th { padding: 9px 11px; background: #f4f7f2; color: #586a5d; font-size: 10px; letter-spacing: .07em; font-weight: 760; text-transform: uppercase; white-space: nowrap; }
.list-table th:first-child { border-radius: 7px 0 0 7px; }
.list-table th:last-child { border-radius: 0 7px 7px 0; }
.list-table td { padding: 11px; border-bottom: 1px solid #eaf0e9; }
.list-table tr:last-child td { border-bottom: 0; }
.list-table tbody tr:hover td { background: #fbfcfa; }
.table-title { display: block; font-weight: 700; min-width: 108px; max-width: 36ch; overflow-wrap: anywhere; }
.table-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.amount-in, .amount-out { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount-in { color: var(--green-dark); }
.amount-out { color: var(--rust); }
.row-actions { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.row-actions .button { min-height: 33px; padding: 6px 8px; font-size: 12px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; background: #edf1ed; color: #485a4e; font-size: 10px; font-weight: 750; line-height: 1.15; white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; flex: none; border-radius: 50%; background: currentColor; }
.status-overdue { color: var(--rust); background: var(--rust-light); }
.status-pending { color: var(--amber); background: var(--amber-light); }
.status-settled { color: var(--green-dark); background: var(--green-light); }
.inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }

.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 15px; }
.filters .field { flex: 0 1 155px; }
.filters .field-wide { flex: 1 1 180px; }
.filters .button { min-height: 39px; }
.field { min-width: 0; display: grid; align-content: start; gap: 6px; }
.field > label, .field > span:first-child, .field label { color: var(--ink); font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { display: block; width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1px solid #d6e2d8; border-radius: 8px; background: #fff; }
.field input::placeholder, .field textarea::placeholder { color: #738278; }
.field textarea { min-height: 88px; resize: vertical; }
.field small { color: var(--muted); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 1px; }
.field input[type="checkbox"], .field input[type="radio"] { display: inline-block; width: auto; min-height: auto; accent-color: var(--green-dark); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .field-wide { grid-column: 1 / -1; }
.form-actions { margin-top: 19px; }
.form-panel { max-width: 760px; padding: clamp(16px, 3vw, 26px); }
.form-panel .panel-heading > * { min-width: 0; overflow-wrap: anywhere; }
.form-panel .panel-heading > strong { flex: 0 1 auto; text-align: right; font-variant-numeric: tabular-nums; }
.notice { padding: 11px 13px; margin: 0 0 15px; border: 1px solid #d7e5d5; border-radius: 8px; background: #eef6eb; color: var(--green-dark); font-size: 13px; }
.notice-error { border-color: #f3d1c9; background: #fff2ef; color: #8d3426; }
.notice-success { border-color: #d6e9cf; background: #edf7e8; color: var(--green-dark); }

.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 30px; background: #edf3ea; }
.auth-card { width: min(100%, 900px); min-height: 485px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); overflow: hidden; border: 1px solid #dce7da; border-radius: 24px; background: #fff; box-shadow: 0 18px 55px #19382213; }
.auth-aside { position: relative; isolation: isolate; min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; overflow: hidden; gap: 18px; padding: clamp(23px, 5vw, 54px); background: var(--forest); color: #f3f7ef; }
.auth-aside::after { content: ""; position: absolute; z-index: -1; width: 290px; height: 290px; right: -115px; bottom: -129px; transform: rotate(45deg); border: 1px solid #a8cb8e30; border-radius: 55px; box-shadow: 0 0 0 26px #a8cb8e0c, 0 0 0 55px #a8cb8e08, 0 0 0 85px #a8cb8e06; }
.auth-aside .brand { margin-bottom: 16px; }
.auth-aside h1, .auth-aside h2 { max-width: 12ch; font-size: clamp(30px, 4vw, 52px); line-height: 1.02; font-weight: 750; letter-spacing: -.067em; }
.auth-aside p { color: #c8dbca; font-size: 14px; max-width: 32ch; }
.auth-aside .eyebrow, .auth-aside .section-kicker { color: #dbedb6; }
.auth-form { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: clamp(23px, 5vw, 54px); }
.auth-form form { display: grid; gap: 13px; }
.auth-form h1, .auth-form h2 { font-size: 29px; font-weight: 760; line-height: 1.1; letter-spacing: -.05em; }
.auth-form p { color: var(--muted); font-size: 13px; }
.auth-form .button-primary { width: 100%; min-height: 43px; margin-top: 3px; }
.auth-form .form-grid { grid-template-columns: 1fr; gap: 13px; }
.auth-form .notice { margin-bottom: 0; }
.auth-footer { color: var(--muted); font-size: 11px; }
.auth-footer a { color: var(--green-dark); text-decoration: underline; text-underline-offset: 2px; }
.auth-qr-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9f5; }
.auth-qr { width: 11rem; max-width: 100%; height: auto; flex: none; image-rendering: pixelated; background: #fff; border-radius: 4px; }
.auth-manual-key { display: grid; gap: 6px; min-width: 0; flex: 1 1 10rem; font-size: 12px; }
.auth-manual-key p { font-size: 12px; }
.auth-manual-key code, .auth-recovery-codes code { display: block; color: var(--forest); overflow-wrap: anywhere; user-select: all; }
.auth-manual-key code { padding: 7px 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; letter-spacing: .035em; }
.auth-recovery-note { background: var(--amber-light); color: var(--amber); border-color: #efdfb5; }
.auth-recovery-codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: 7px; margin: 0; padding: 0; list-style: none; }
.auth-recovery-codes code { padding: 8px 6px; border: 1px solid var(--line); border-radius: 7px; background: #f7f9f5; text-align: center; font-size: 12px; font-weight: 700; }

@media (min-width: 1300px) {
  .app-shell { grid-template-columns: 250px minmax(0, 1fr); }
  .metric-grid, .chart-grid { gap: 17px; }
  .panel { padding: 22px; }
  .metric-card { padding: 19px; }
}

@media (min-width: 901px) {
  .metric-grid:has(> .metric-card:last-child:nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 205px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .metric-card { padding: 13px; min-height: 120px; }
  .metric-card > .metric-icon { right: 10px; top: 11px; }
  .metric-icon { width: 27px; height: 27px; }
}

@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card:last-child:nth-child(3) { grid-column: 1 / -1; }
  .metric-value { font-size: clamp(23px, 3.2vw, 34px); }
  .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 730px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { min-height: 61px; padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
  .topbar-brand { gap: 8px; }
  .topbar-brand .brand-copy { display: block; }
  .topbar-brand .brand-mark { display: grid; width: 32px; height: 32px; border-radius: 9px; }
  .topbar-brand .brand-mark .icon { width: 17px; height: 17px; }
  .topbar-brand .brand-sub { margin-top: 4px; font-size: 8px; }
  .mobile-area-links, .mobile-nav { display: flex; gap: 6px; }
  .topbar > .mobile-area-links, .topbar > .mobile-nav { flex: 1 0 100%; }
  .topbar-actions > .inline-form { min-width: 0; }
  .mobile-area-links .area-link, .mobile-nav .nav-link { min-height: 36px; padding: 6px 9px; border: 1px solid #dce5da; color: var(--ink); font-size: 12px; }
  .mobile-area-links .area-link[aria-current]:not([aria-current="false"]), .mobile-area-links .area-link[aria-pressed="true"], .mobile-area-links .area-link.active, .mobile-nav .nav-link[aria-current]:not([aria-current="false"]) { border-color: #d5e8cb; background: var(--green-light); color: var(--green-dark); }
  .mobile-area-links .area-link .icon, .mobile-nav .nav-link .icon { color: var(--green-dark) !important; width: 14px; height: 14px; }
  .topbar .logout-button { width: 38px; color: var(--green-dark); border: 1px solid var(--line); background: #fff; }
  .topbar .logout-button:hover { color: var(--green-dark); background: var(--green-light); }
  .page-content { padding: 25px 16px 34px; }
  .page-heading { margin-bottom: 18px; }
  .page-heading h1 { font-size: clamp(28px, 5.5vw, 37px); }
  .metric-grid { gap: 9px; margin-bottom: 12px; }
  .chart-grid, .pending-grid { gap: 10px; margin-bottom: 12px; }
  .panel { padding: 14px; }
  .auth-shell { padding: 19px; }
  .auth-card { width: min(100%, 485px); min-height: 0; grid-template-columns: 1fr; border-radius: 17px; }
  .auth-aside { gap: 12px; }
  .auth-aside .brand { margin-bottom: 5px; }
  .auth-aside h1, .auth-aside h2 { max-width: 22ch; }
}

@media (max-width: 480px) {
  .topbar-actions:has(> .inline-form) { flex: 1 1 100%; flex-wrap: nowrap; justify-content: space-between; gap: 6px; }
  .topbar-actions > .inline-form { gap: 6px; }
  .topbar-actions > .inline-form .button { padding-inline: 9px; }
  .period-select { gap: 5px; padding-inline: 7px; }
  .topbar > .mobile-area-links, .topbar > .mobile-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar > .mobile-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mobile-area-links .area-link, .mobile-nav .nav-link { gap: 5px; justify-content: center; padding: 6px 4px; text-align: center; line-height: 1.2; }
  .page-heading { display: grid; gap: 11px; align-items: start; }
  .page-heading p { margin-top: 5px; }
  .metric-card { min-height: 107px; padding: 10px; border-radius: 11px; }
  .metric-card > .metric-icon { width: 23px; height: 23px; top: 7px; right: 7px; }
  .metric-icon .icon { width: 14px; height: 14px; }
  .metric-card:has(> .metric-icon) .metric-label { padding-right: 23px; }
  .metric-label { font-size: 11px; }
  .metric-value { margin-top: 6px; font-size: 22px; }
  .metric-note { margin-top: 5px; font-size: 10px; }
  .pending-grid, .form-grid { grid-template-columns: 1fr; }
  .filters .field { flex: 1 1 130px; }
  .filters .field-wide { flex-basis: 100%; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .panel-heading { gap: 8px; }
  .chart-legend { align-self: flex-start; gap: 5px 8px; }
  .trend-plot { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 6px; }
  .trend-pair { height: 84px; }
}

@container (max-width: 350px) {
  .trend-plot { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 6px; }
  .trend-pair { height: 84px; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .area-link, .nav-link, .logout-button { transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease; }
}
