/* Ledger — compact, neutral finance UI. Colors are tokens; dark mode is
   selected separately (OS preference, overridable via [data-theme]). */
:root {
  color-scheme: light;
  --bg: #f6f6f5;
  --surface: #ffffff;
  --surface-2: #f1f1ef;
  --line: #e3e3e0;
  --line-strong: #cfcfcb;
  --text: #18181a;
  --text-2: #55554f;
  --muted: #74746d;
  --accent: #18181a;
  --accent-ink: #ffffff;
  --focus: #2a78d6;
  --danger: #c4332f;
  --danger-bg: #fdf0ef;
  --info-bg: #eef4fc;
  /* Data series (validated categorical slots 1 and 3). */
  --spend: #2a78d6;
  --income: #1baf7a;
  --income-text: #13744f;
  --grid: #ececea;
  --radius: 6px;
  --shadow: 0 8px 28px rgb(0 0 0 / 0.12);
  --font:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121212;
    --surface: #1a1a19;
    --surface-2: #232322;
    --line: #2e2e2c;
    --line-strong: #41413e;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --muted: #96958c;
    --accent: #f0efec;
    --accent-ink: #121212;
    --focus: #6da7ec;
    --danger: #ef7d7a;
    --danger-bg: #3a1f1e;
    --info-bg: #1b2533;
    --spend: #3987e5;
    --income: #199e70;
    --income-text: #4cc596;
    --grid: #2a2a28;
    --shadow: 0 8px 28px rgb(0 0 0 / 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212;
  --surface: #1a1a19;
  --surface-2: #232322;
  --line: #2e2e2c;
  --line-strong: #41413e;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --muted: #96958c;
  --accent: #f0efec;
  --accent-ink: #121212;
  --focus: #6da7ec;
  --danger: #ef7d7a;
  --danger-bg: #3a1f1e;
  --info-bg: #1b2533;
  --spend: #3987e5;
  --income: #199e70;
  --income-text: #4cc596;
  --grid: #2a2a28;
  --shadow: 0 8px 28px rgb(0 0 0 / 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 64px;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 20px;
}
h2 {
  font-size: 15px;
}
h3 {
  font-size: 14px;
}
p {
  margin: 0;
}
a {
  color: inherit;
}
small {
  font-size: 12px;
}
code {
  font-family: var(--mono);
}
.muted {
  color: var(--muted);
}
.eyebrow {
  color: var(--muted);
  font-size: 12px;
}
.number,
.figure,
.data td,
.tabular {
  font-variant-numeric: tabular-nums;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: absolute;
  left: 8px;
  top: -40px;
  padding: 6px 10px;
  background: var(--surface);
  border-radius: var(--radius);
  z-index: 50;
}
.skip-link:focus {
  top: 8px;
}
.error:not(:empty) {
  color: var(--danger);
  background: var(--danger-bg);
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 13px;
}
.income-text {
  color: var(--income-text);
}

/* Controls */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
summary.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.primary:hover:not(:disabled) {
  opacity: 0.88;
}
.secondary {
  background: var(--surface);
  border-color: var(--line-strong);
}
.secondary:hover:not(:disabled),
.ghost:hover:not(:disabled) {
  background: var(--surface-2);
}
.ghost {
  color: var(--text-2);
}
.small {
  min-height: 28px;
  padding: 0 8px;
  font-size: 13px;
}
.danger:hover:not(:disabled) {
  color: var(--danger);
}
.link {
  min-height: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
input,
select,
textarea {
  width: 100%;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14px;
  font-weight: 400;
}
select {
  appearance: none;
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(-45deg, transparent 50%, var(--muted) 50%);
  background-position:
    right 13px top 50%,
    right 9px top 50%;
  background-size: 4px 4px;
  background-repeat: no-repeat;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--muted);
}
input:disabled {
  opacity: 0.5;
}
textarea {
  min-height: 72px;
  resize: vertical;
}
.hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.stack {
  display: grid;
  gap: 12px;
}

/* Top bar */
body:not([data-view="app"]) .topbar {
  display: none;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  height: 48px;
}
.brand {
  font-weight: 650;
  font-size: 15px;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.topnav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
}
.topnav a {
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
}
.topnav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.topbar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.menu {
  position: relative;
}
.menu summary {
  list-style: none;
  max-width: 220px;
}
.menu summary::-webkit-details-marker {
  display: none;
}
.menu summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
#user-email {
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  display: grid;
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.menu-panel button {
  justify-content: flex-start;
  width: 100%;
}
.menu-group {
  display: grid;
  gap: 2px;
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

/* Auth */
body[data-view="auth"],
body[data-view="loading"] {
  min-height: 100vh;
}
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.auth-card,
.consent-card {
  width: min(380px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.auth-card h1 {
  font-size: 18px;
}
.social-login {
  display: grid;
  gap: 8px;
}
.social-login:not(:empty) {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.social-login button {
  width: 100%;
  border-color: var(--line-strong);
}
.auth-card .primary {
  width: 100%;
}
.auth-switch {
  display: flex;
  gap: 6px;
  font-size: 13px;
}
.consent-card {
  margin: 10vh auto;
  width: min(460px, calc(100% - 32px));
}
#consent-details {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
}
#consent-details dt {
  font-size: 12px;
  color: var(--muted);
}
#consent-details dd {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Layout */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  display: grid;
  gap: 28px;
}
main:focus {
  outline: none;
}
#overview {
  display: grid;
  gap: 14px;
}
.page-head,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}
.section-head {
  align-items: center;
  margin-bottom: 10px;
}
.actions {
  display: flex;
  gap: 4px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.filters label {
  flex: 1 1 140px;
}
.filters .f-currency {
  flex: 0 1 90px;
}
.filter-actions {
  display: flex;
  gap: 4px;
}
#message:empty {
  display: none;
}
#message {
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
}
#message[data-tone="info"] {
  background: var(--info-bg);
  color: var(--text-2);
}

.segmented {
  display: inline-flex;
  justify-self: start;
  padding: 2px;
  gap: 2px;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.segmented label {
  display: block;
}
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented span {
  display: block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}
.segmented input:checked + span {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line);
}
.segmented input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* KPI tiles */
#summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
#summary:has(> .empty, > .welcome) {
  display: block;
}
.kpi {
  padding: 12px 14px;
  display: grid;
  gap: 2px;
  align-content: start;
}
.kpi + .kpi {
  border-left: 1px solid var(--line);
}
.kpi dt {
  font-size: 12px;
  color: var(--muted);
}
.kpi dd {
  margin: 0;
}
.figure {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.kpi small {
  color: var(--muted);
}
.empty {
  padding: 16px;
  color: var(--muted);
}
.welcome {
  padding: 18px;
  display: grid;
  gap: 10px;
}
.steps {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  color: var(--text-2);
}

/* Panels & charts */
.analytics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.panel {
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.span-2 {
  grid-column: 1 / -1;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.panel-head p {
  font-size: 12px;
}
.panel-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}
.inline select {
  width: auto;
  min-height: 28px;
  padding-top: 2px;
  padding-bottom: 2px;
  font-size: 13px;
}
.legend {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--text-2);
}
.legend li {
  display: flex;
  align-items: center;
  gap: 5px;
}
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.s-spend {
  background: var(--spend);
}
.s-income {
  background: var(--income);
}
.chart svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.chart svg:focus-visible {
  outline-offset: 4px;
}
.axis text {
  fill: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.gridline {
  stroke: var(--grid);
}
.baseline {
  stroke: var(--line-strong);
}
.bar-spend {
  fill: var(--spend);
}
.bar-income {
  fill: var(--income);
}
.line-spend,
.line-income {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.line-spend {
  stroke: var(--spend);
}
.line-income {
  stroke: var(--income);
}
.area-spend {
  fill: var(--spend);
  opacity: 0.08;
}
.end-label {
  fill: var(--text-2);
  font-size: 11px;
  font-weight: 500;
}
.dot {
  stroke: var(--surface);
  stroke-width: 2;
}
.dot.spend {
  fill: var(--spend);
}
.dot.income {
  fill: var(--income);
}
.hover-band {
  fill: var(--text);
  opacity: 0;
}
.hover-band.active {
  opacity: 0.05;
}
.crosshair {
  stroke: var(--line-strong);
  stroke-dasharray: 3 3;
}
.chart-empty {
  padding: 28px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.chart-tip {
  position: fixed;
  z-index: 40;
  min-width: 150px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 12px;
  pointer-events: none;
}
.chart-tip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}
.tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.tip-row b {
  margin-left: auto;
  padding-left: 12px;
  font-weight: 600;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.facts dd {
  margin: 0;
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.facts div {
  display: flex;
  gap: 6px;
}
.table-view {
  margin-top: 10px;
  font-size: 12px;
}
.table-view summary {
  cursor: pointer;
  color: var(--muted);
  width: max-content;
}
.table-view .table-scroll {
  max-height: 260px;
  overflow: auto;
  margin-top: 6px;
}

/* Horizontal bar lists */
.hbars {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  font-size: 13px;
}
.hbar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hbar-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.hbar-value small {
  color: var(--muted);
  margin-left: 6px;
}
.track {
  grid-column: 1 / -1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}
.track span {
  display: block;
  height: 100%;
  background: var(--spend);
  border-radius: 3px;
}
.hbar.sub {
  padding-left: 14px;
  color: var(--text-2);
}
.hbar.sub .track {
  height: 4px;
}
.hbar.sub .track span {
  opacity: 0.6;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
}
.data th,
.data td,
.table-view th,
.table-view td,
.mini th,
.mini td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table-view th,
.table-view td,
.mini th,
.mini td {
  padding: 5px 6px;
}
.data th,
.table-view th,
.mini th {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  position: sticky;
  top: 0;
}
.data tbody tr:last-child td,
.mini tbody tr:last-child td {
  border-bottom: 0;
}
.data tbody tr:hover {
  background: var(--surface-2);
}
th.number,
td.number {
  text-align: right;
  white-space: nowrap;
}
.data small,
.mini small {
  display: block;
  color: var(--muted);
}
.t-date {
  white-space: nowrap;
}
.t-merchant {
  max-width: 280px;
}
.t-merchant small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-2);
}
.t-amount {
  font-weight: 500;
}
.t-actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}
.row-actions {
  display: inline-flex;
  gap: 2px;
}
.empty-row td {
  text-align: center;
}
.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 8px;
}
.rank {
  width: 1%;
  color: var(--muted);
}
.mini .bar-cell {
  width: 30%;
}
.mini .track {
  display: block;
  height: 4px;
}

/* Accounts */
.account {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.account + .account {
  margin-top: 8px;
}
.account-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--line);
}
.account-title p {
  font-size: 12px;
}
.card-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}
.card-rows li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 10px 5px 14px;
}
.card-rows li + li {
  border-top: 1px solid var(--line);
}
.card-rows .digits {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.card-rows .row-actions {
  margin-left: auto;
}
.no-cards {
  padding: 8px 14px;
  font-size: 13px;
}

/* Dialogs */
dialog {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: rgb(0 0 0 / 0.35);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
#fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#fields > label:only-child,
#fields .wide {
  grid-column: 1 / -1;
}
.direction legend {
  float: left;
  width: 100%;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.direction {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 0;
  border: 0;
}
.direction .seg {
  display: block;
  position: relative;
}
.direction .seg input {
  position: absolute;
  opacity: 0;
}
.direction .seg span {
  display: block;
  padding: 6px;
  text-align: center;
  border: 1px solid var(--line-strong);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.direction .seg:first-of-type span {
  border-radius: var(--radius) 0 0 var(--radius);
}
.direction .seg:last-of-type span {
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: 0;
}
.direction .seg input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.direction .seg input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
#form-error:not(:empty),
#token-error:not(:empty) {
  margin-top: 12px;
}

/* Tokens */
.token-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.token-form .grow {
  flex: 1 1 180px;
}
.token-form select {
  width: 130px;
}
.token-form .days {
  width: 80px;
}
.token-form .full {
  flex-basis: 100%;
}
.token-form .full:empty {
  display: none;
}
.token-form .warn {
  color: var(--text-2);
}
.new-token {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.new-token code {
  flex: 1;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.list-title {
  margin: 18px 0 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.token-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.token-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 8px 7px 12px;
}
.token-list li + li {
  border-top: 1px solid var(--line);
}
.token-list li.muted {
  padding: 10px 12px;
}
.token-meta {
  display: grid;
}
.token-meta small {
  color: var(--muted);
}

/* Responsive */
@media (max-width: 900px) {
  #summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .kpi:nth-child(4) {
    border-left: 0;
  }
  .kpi:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }
  .analytics {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .topnav {
    display: none;
  }
  #summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi:nth-child(odd) {
    border-left: 0;
  }
  .kpi:nth-child(4) {
    border-left: 1px solid var(--line);
  }
  .kpi:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .panel-head {
    flex-direction: column;
  }
  .page-head {
    align-items: center;
  }
  #fields {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Transactions become stacked rows on phones. */
  .data thead {
    display: none;
  }
  .data tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
  }
  .data td {
    padding: 0;
    border: 0;
  }
  .data .t-merchant {
    grid-column: 1;
    grid-row: 1;
  }
  .data .t-amount {
    grid-column: 2;
    grid-row: 1;
  }
  .data .t-date,
  .data .t-category,
  .data .t-source {
    grid-column: 1;
    font-size: 12px;
    color: var(--muted);
  }
  .data .t-source small {
    display: inline;
    margin-left: 4px;
  }
  .data .t-actions {
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: end;
    width: auto;
  }
  .data .t-date small {
    display: inline;
    margin-left: 4px;
  }
}
@media (forced-colors: active) {
  .bar-spend,
  .bar-income,
  .track span,
  .swatch {
    forced-color-adjust: none;
  }
}
.kpi-list {
  display: contents;
}
.t-source small {
  display: inline;
  margin-left: 6px;
}
