.site-header, main { width: min(calc(100% - 40px), 1160px); margin-inline: auto; }
.site-header {
  position: sticky;
  z-index: 2;
  top: 12px;
  margin-top: 12px;
  padding: 8px 12px;
  min-height: 61px;
  border-radius: 20px;
}
.site-header, .header-actions, footer, .bar, .actions, .row, .overview-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.site-header, .bar, .row { justify-content: space-between; }
.header-actions select { width: auto; }
main { padding-block: 26px 80px; }
.dashboard-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 19px; }
.dashboard-nav [aria-current="page"] { color: var(--amber); background: #5a3f5a; border-color: #f1bf7f75; }
.intro label { margin-bottom: 15px; }
.intro .actions { margin: 20px 0 0; }
.overview-bar { align-items: end; margin: 9px 0 19px; }
.overview-bar h1 { margin: 0; }
.overview-controls { align-items: end; }
.overview-controls label { min-width: 9rem; }
.hero {
  padding: clamp(18px, 3vw, 30px);
  background:
    radial-gradient(ellipse at 98% 0%, #f1a74542, transparent 45%),
    radial-gradient(ellipse at 0% 100%, #a674d02f, transparent 63%),
    var(--glass);
}
.hero h2 { margin: 0 0 17px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.card {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 17px;
  border: 1px solid #ffeee82e;
  background: linear-gradient(140deg, #fff0e51f, #b68eb216 55%, #14092169);
  box-shadow: var(--shine), 0 10px 18px #11061d38;
  overflow-wrap: anywhere;
  color: #f2e1f8;
}
.card strong { display: block; color: #ffe1b5; font-size: clamp(1.22rem, 2.6vw, 1.75rem); margin-top: 4px; }
.wallet-heading, .row-controls { display: flex; align-items: center; gap: 6px; }
.wallet-heading { justify-content: space-between; }
.wallet-heading b { min-width: 0; }
.row-controls { flex-wrap: wrap; }
.icon-action, .row .icon-action {
  display: inline-grid;
  place-items: center;
  padding: 0;
  margin: 0;
  width: 38px;
  height: 38px;
  min-height: 38px;
  font-size: 1.18rem;
  line-height: 1;
}
.actions { margin: 15px 0 24px; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dashboard-sidebar { display: grid; gap: 16px; min-width: 0; }
.dashboard-columns section { padding: 18px; min-width: 0; }
.dashboard-columns h2 { margin: 0 0 12px; }
.dashboard-columns .bar h2 { margin: 0; }
.dashboard-columns .bar { margin-block-end: 10px; }
.report-panel label { width: min(100%, 12rem); margin-block-end: 12px; }
.row { border-top: 1px solid #f0d9ff23; padding: 11px 0; overflow-wrap: anywhere; }
.row:last-child { padding-bottom: 0; }
.row button { margin-inline-start: 6px; min-height: 34px; padding-block: 5px; }
.transaction-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
}
.activity-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffdb9c24;
  color: var(--amber);
}
.activity-icon.income { color: #9be3be; background: #9be3be24; }
.activity-icon.transfer { color: #cab7ff; background: #cab7ff24; }
.transaction-values { text-align: end; font-weight: 680; }
.transaction-values small { display: block; font-weight: 500; }
.pending-sync { background: #ffdb9c0e; border-radius: 14px; margin-block-end: 14px; }
.pending-sync h3 { margin-block: 0 10px; }
.report-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  align-items: end;
  gap: 12px;
  padding: 16px;
  margin-block-end: 16px;
}
.report-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.report-total, .report-section { padding: 17px; margin-block-end: 14px; min-width: 0; }
.report-total h2, .report-section h2 { margin-block: 0 10px; }
.report-total h2 { color: var(--muted); font-size: .88rem; }
.report-total strong { display: block; overflow-wrap: anywhere; font-size: clamp(.95rem, 2.5vw, 1.45rem); }
.report-total.income { color: #9be3be; }
.report-total.expense { color: var(--amber); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .9rem; }
.chart-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-inline-end: 6px;
  border-radius: 50%;
  background: #9be3be;
}
.chart-legend .expense::before { background: var(--amber); }
.cash-chart {
  display: flex;
  overflow-x: auto;
  padding: 12px 5px 8px;
  scrollbar-color: #735983 transparent;
}
.chart-point {
  display: flex;
  flex: 1 0 64px;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  border: 0;
  border-radius: 9px;
  padding: 0 4px 4px;
  background: none;
  box-shadow: none;
}
.chart-point[aria-pressed="true"] { background: #e9c7ff18; }
.chart-bars {
  display: flex;
  justify-content: center;
  align-items: end;
  width: 100%;
  height: 140px;
  gap: 4px;
  border-bottom: 1px solid var(--edge);
  background: repeating-linear-gradient(to top, transparent 0 34px, #f0d9ff14 34px 35px);
}
.chart-bars span { width: 13px; height: var(--height); border-radius: 6px 6px 0 0; background: #9be3be; }
.chart-bars .expense { background: var(--amber); }
.chart-date { padding-block-start: 4px; color: var(--muted); font-size: .78rem; }
.chart-detail { margin-block: 8px 0; overflow-wrap: anywhere; }
.category-bar { margin-block-start: 12px; }
.category-bar > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.category-track { display: block; margin-block-start: 5px; border-radius: 12px; background: #f0d9ff20; }
.category-track span { display: block; height: 8px; width: var(--length); background: var(--amber); border-radius: inherit; }
.amount { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
dialog { width: min(490px, 94vw); max-height: 88vh; padding: 22px; color: var(--ink); }
dialog h2 { margin: 0 0 16px; }
dialog label { margin-bottom: 13px; }
dialog::backdrop { background: #100818a8; backdrop-filter: blur(8px); }
footer { justify-content: flex-end; }
pre { white-space: pre-wrap; max-height: 120px; overflow: auto; }
#message { position: fixed; z-index: 3; bottom: 14px; inset-inline-start: 4%; max-width: 92vw; padding: 10px 16px; }
#message:empty { display: none; }
#formError { color: #ffbdb5; }
.preview { max-height: 180px; max-width: 100%; object-fit: contain; }
.subtle { font-size: .9rem; }
@media (max-width: 800px) {
  .dashboard-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .site-header, main { width: calc(100% - 24px); }
  .brand small { display: none; }
  .header-actions { gap: 6px; }
  .header-actions select, .header-actions button { padding-inline: 8px; }
  .transaction-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .transaction-row .row-controls { grid-column: 2 / -1; justify-content: flex-end; }
  .report-total { padding: 10px; }
  .chart-point { flex-basis: 51px; }
}
