#view-insights,
.settle-overlay {
  --line-soft: #edf0e9;
  --radius: 17px;
}
.insights-page {
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 15px;
}
.insights-page > * { min-width: 0; }

.ins-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0 8px;
}
.ins-title-block { display: grid; gap: 7px; }
.preview-badge {
  width: max-content;
  padding: 5px 9px;
  border: 1px solid #d4ddd4;
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.72);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.range-picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid #d7ded5;
  border-radius: 11px;
  background: #e8ece5;
}
.segmented button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 8px 11px;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}
.segmented button:hover { color: var(--ink); }
.segmented button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(29, 41, 36, 0.08);
}
button.primary { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
button.quiet { border: 1px solid #cbd3c9; background: transparent; color: var(--ink); }
button.quiet:hover { background: #f2f5ee; }
button.quiet.danger { color: var(--danger); border-color: #e0b9b4; }
button.quiet.danger:hover { background: #f7e2df; }
button.primary:disabled, button.quiet:disabled { opacity: 0.45; cursor: not-allowed; }
button.small { padding: 6px 10px; font-size: 12px; }
button:focus-visible, input:focus-visible {
  outline: 3px solid rgba(47, 107, 82, 0.2);
  outline-offset: 1px;
  border-color: var(--accent);
}

.custom-range {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
}
.custom-range label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 650; }
.insights-page input[type="date"] {
  min-height: 40px;
  border: 1px solid #cbd3c9;
  border-radius: 9px;
  background: var(--panel);
  padding: 8px 10px;
  color: var(--ink);
}

.range-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 20px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.range-dot { opacity: 0.5; }

.ins-card {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.kpi-grid { display: grid; grid-template-columns: 1.18fr 1fr 1fr 1fr; gap: 13px; min-width: 0; }
.kpi {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 4px;
  min-height: 126px;
  padding: 17px 18px;
}
.kpi-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.kpi strong {
  margin-top: 2px;
  font-size: clamp(25px, 2.8vw, 33px);
  letter-spacing: -0.045em;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}
.kpi-note, .kpi-delta { color: var(--muted); font-size: 12px; }
.kpi-delta { margin-top: auto; display: flex; align-items: center; gap: 5px; }
.kpi-delta.up { color: var(--warn); }
.kpi-delta.down { color: var(--accent); }
.spend-kpi { background: var(--ink); border-color: var(--ink); color: #fffefa; }
.spend-kpi .kpi-label, .spend-kpi .kpi-delta, .spend-kpi .kpi-note { color: #b8c5be; }
.spend-kpi .kpi-delta.up { color: #f2c27a; }
.spend-kpi .kpi-delta.down { color: #9fd3b8; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 13px;
}
.trend-card { grid-column: span 8; padding: 18px 20px 14px; display: flex; flex-direction: column; }
.top-card { grid-column: span 4; padding: 18px 20px; }
.shopper-card { grid-column: span 12; padding: 18px 20px; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}
.card-head h2 { margin-bottom: 1px; }
.card-sub { color: var(--muted); font-size: 12px; }

.legend { display: flex; align-items: center; gap: 12px; padding-top: 2px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend-dot.current { background: var(--accent); }
.legend-dot.previous { background: #b3bdb6; }

.trend-wrap { position: relative; flex: 1; min-height: 292px; }
.trend-wrap canvas { width: 100% !important; height: 100% !important; }
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.top-list { display: grid; gap: 11px; }
.top-item { display: grid; gap: 5px; }
.top-line { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.top-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.top-spend { margin-left: auto; flex: none; color: var(--ink); font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.top-meta { color: var(--muted); font-size: 11.5px; }
.top-track { height: 5px; overflow: hidden; border-radius: 99px; background: var(--line-soft); }
.top-fill { height: 100%; border-radius: inherit; background: var(--accent); }
.top-item:first-child .top-fill { background: var(--accent); }

.shopper-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.shopper-list .empty { grid-column: 1 / -1; }
.shopper-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: inherit;
  text-align: left;
}
.shopper-row:not(:disabled):hover { background: #f7f9f4; border-color: var(--line-soft); }
.shopper-row:disabled { cursor: default; opacity: 0.72; }
.shopper-arrow { color: var(--muted); font-size: 19px; line-height: 1; }
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.shopper-main { display: grid; gap: 4px; min-width: 0; }
.shopper-line { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.shopper-name { font-size: 13px; font-weight: 650; }
.shopper-meta { color: var(--muted); font-size: 11.5px; }
.shopper-spend { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.shopper-track { height: 4px; overflow: hidden; border-radius: 99px; background: var(--line-soft); }
.shopper-fill { height: 100%; border-radius: inherit; background: #8bb49e; }

.recent-card { padding: 18px 20px 12px; }
.table-wrap { overflow-x: auto; }
.recent-table { width: 100%; border-collapse: collapse; }
.recent-table th {
  padding: 7px 9px 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}
.recent-table th.num { text-align: right; }
.recent-table td {
  padding: 10px 9px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  white-space: nowrap;
}
.recent-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.recent-table tbody tr:hover { background: #fafbf7; }
.recent-table .item-cell { font-weight: 650; }
.export-card { padding: 18px 20px; }
.export-card .card-head { align-items: center; margin-bottom: 7px; }
.export-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.export-card > .settle-note { max-width: 760px; }
.empty { padding: 26px 10px; color: var(--muted); text-align: center; font-size: 13px; }
.preview-foot { padding: 3px 2px 0; color: #8c968f; font-size: 11.5px; }

body.settle-open,
body.purchase-detail-open { overflow: hidden; }
.purchase-detail { width: min(460px, 100%); }
.purchase-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.purchase-detail-head h2 {
  margin-top: 3px;
  font-size: clamp(22px, 4vw, 28px);
  letter-spacing: -0.04em;
}
.purchase-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}
.purchase-detail-grid div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #f7f9f4;
}
.purchase-detail-grid .wide { grid-column: 1 / -1; }
.purchase-detail-grid dt {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.purchase-detail-grid dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 650;
}
.settle-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  background: rgba(29, 41, 36, 0.42);
  top: var(--visual-viewport-top, 0px);
  bottom: auto;
  height: var(--visual-viewport-height, 100dvh);
}
.settle-sheet {
  width: min(640px, 100%);
  height: var(--visual-viewport-height, 100dvh);
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: -18px 0 55px rgba(29, 41, 36, 0.18);
}
.settle-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.settle-head h2 { margin-top: 2px; font-size: clamp(24px, 4vw, 32px); letter-spacing: -0.045em; }
.settle-head .card-sub { margin-top: 3px; }
.settle-reimbursed { margin-top: 3px; color: var(--accent-strong); font-weight: 600; }
.settle-lock {
  margin-top: 4px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 650;
}
.settle-history { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid #e0e7df; border-radius: 12px; background: #fbfcf9; }
.settle-history-head { font-size: 11px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.settle-history-row { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 12.5px; }
.settle-history-text { flex: 1; min-width: 0; color: var(--muted); }
.settle-history-row strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.settle-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.settle-tool-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.settle-filter.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.settle-note { line-height: 1.35; }
.settle-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 1px 4px 1px 1px;
}
.settle-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  cursor: pointer;
}
.settle-row:hover { border-color: #b9c9bd; }
.settle-row.is-claimed { opacity: 0.62; background: #f4f5f1; }
.settle-row.is-claimed .settle-check { accent-color: var(--muted); }
.settle-row:has(input:checked) { border-color: var(--accent); background: #f4f9f5; }
.settle-check { width: 18px; height: 18px; accent-color: var(--accent); }
.settle-main { display: grid; gap: 2px; min-width: 0; }
.settle-name { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settle-meta { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.settle-row-total { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.settle-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.settle-total-block { display: grid; gap: 1px; }
.settle-total-block span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; }
.settle-total-block strong { font-size: 23px; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.received-sheet { gap: 10px; }
.received-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.received-range-row label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.received-range-row select {
  width: auto;
  min-height: 34px;
  padding: 5px 28px 5px 9px;
  font-size: 12px;
}
.received-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.received-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #e8ece5;
}
.received-tab {
  flex: 1;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 650;
}
.received-tab.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(29, 41, 36, 0.08);
}
.unresolved-card {
  display: grid;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.unresolved-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.unresolved-group > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
}
.unresolved-group > summary::-webkit-details-marker { display: none; }
.unresolved-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: transform 120ms ease;
}
.unresolved-group[open] .unresolved-chevron { transform: rotate(90deg); }
.unresolved-group-right {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}
.unresolved-group-body {
  display: grid;
  gap: 0;
  padding: 0 12px 10px 30px;
  border-top: 1px solid var(--line-soft);
}
.unresolved-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--line-soft);
}
.unresolved-line:first-child { border-top: 0; }
.unresolved-line-main { display: grid; gap: 2px; min-width: 0; }
.unresolved-line-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 620;
}
.unresolved-line-meta { color: var(--muted); font-size: 11px; }
.unresolved-line-total {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.unresolved-line-total.pending { color: var(--warn); }
.unresolved-line-adjustment .unresolved-line-name { color: var(--muted); }
.unresolved-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.unresolved-main { display: grid; gap: 2px; min-width: 0; }
.unresolved-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}
.unresolved-meta { color: var(--muted); font-size: 11.5px; }
.unresolved-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.unresolved-stat {
  display: grid;
  gap: 1px;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f7f9f4;
}
.unresolved-stat span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.unresolved-stat strong { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.unresolved-stat.pending { background: var(--warn-soft); }
.received-summary-item {
  display: grid;
  gap: 2px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.received-summary-item span {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.received-summary-item strong {
  font-size: 21px;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.received-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 1px 3px 1px 1px;
}
.received-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.received-card[open] { border-color: #b9c9bd; }
.received-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
}
.received-card summary::-webkit-details-marker { display: none; }
.received-main { display: grid; gap: 2px; min-width: 0; }
.received-payer {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
}
.received-meta { color: var(--muted); font-size: 11.5px; }
.received-amount {
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.received-badge {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.received-badge.paid { background: var(--accent-soft); color: var(--accent-strong); }
.received-badge.pending { background: var(--warn-soft); color: var(--warn); }
.received-badge.cancelled,
.received-badge.expired { background: var(--danger-soft); color: var(--danger); }
.received-claims {
  display: grid;
  gap: 6px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line-soft);
}
.received-message { margin: 0 0 2px; }
.received-claim {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: baseline;
  font-size: 12px;
}
.received-claim-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}
.received-claim-qty { color: var(--muted); white-space: nowrap; }
.received-claim-total { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.settle-preview-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.settle-preview-actions .primary { flex: 1; }
.settle-status { min-height: 1.2em; color: var(--accent-strong); }
.settle-status:empty { display: none; }
.settle-preview {
  display: grid;
  gap: 9px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.swish-details { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; }
.swish-details div { display: grid; gap: 2px; min-width: 0; }
.swish-details span { color: var(--muted); font-size: 9.5px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.swish-details strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swish-qr-wrap {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}
.swish-qr { display: grid; place-items: center; width: 190px; height: 190px; }
.swish-qr svg { display: block; width: 100%; height: 100%; }
.swish-qr-caption { color: var(--muted); font-size: 11.5px; }
.swish-deeplink {
  display: none;
  gap: 7px;
  justify-items: center;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}
.swish-deeplink a {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}
.swish-deeplink a:hover { background: var(--accent-strong); }

@media (max-width: 1050px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .trend-card { grid-column: span 12; }
  .top-card { grid-column: span 12; }
  .top-list { grid-template-columns: 1fr 1fr; column-gap: 24px; }
}

@media (max-width: 720px) {
  .insights-page { padding: 0; gap: 12px; }
  .ins-head { align-items: stretch; flex-direction: column; gap: 15px; }
  .range-picker { justify-content: flex-start; }
  .segmented { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .segmented::-webkit-scrollbar { display: none; }
  .segmented button { flex: 1 1 0; min-width: 0; padding: 7px 5px; font-size: 11.5px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi { min-height: 112px; padding: 14px; }
  .spend-kpi strong { font-size: clamp(18px, 5.2vw, 23px); white-space: nowrap; }
  .spend-kpi .kpi-delta { font-size: 11px; line-height: 1.35; }
  .kpi strong { font-size: clamp(21px, 7vw, 27px); }
  .dashboard-grid { gap: 9px; }
  .trend-card, .top-card, .shopper-card { grid-column: span 12; }
  .trend-card, .top-card, .shopper-card, .recent-card, .export-card { padding: 15px; }
  .export-card .card-head { align-items: flex-start; flex-direction: column; }
  .export-card .export-actions { width: 100%; }
  .export-card .export-actions button { flex: 1 1 100%; width: 100%; }
  .trend-wrap { height: 238px; min-height: 238px; flex: none; }
  .legend { display: none; }
  .top-list { grid-template-columns: 1fr; }
  .shopper-list { grid-template-columns: 1fr; }
  .recent-card { padding-bottom: 8px; }
  .recent-table thead { display: none; }
  .recent-table, .recent-table tbody { display: block; }
  .recent-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 14px;
    align-items: center;
    gap: 10px;
    padding: 12px 2px;
    border-top: 1px solid var(--line-soft);
    cursor: pointer;
  }
  .recent-table tr::after {
    content: "›";
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
  }
  .recent-table tr:active { background: #f1f6ef; }
  .recent-table tr:focus-visible {
    outline: 3px solid rgba(47, 107, 82, 0.2);
    outline-offset: -2px;
    border-radius: 8px;
  }
  .recent-table td { display: none; padding: 0; border: 0; }
  .recent-table td.item-cell,
  .recent-table td.total-cell { display: block; }
  .recent-table td.item-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 650;
  }
  .recent-table td.total-cell {
    text-align: right;
    white-space: nowrap;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
  }
  .custom-range { display: grid; grid-template-columns: 1fr 1fr; }
  .custom-range button { grid-column: 1 / -1; }
  .received-summary { grid-template-columns: 1fr 1fr; }
  .received-summary-item:last-child { grid-column: 1 / -1; }
  .received-range-row { justify-content: space-between; }
  .received-range-row select { flex: 1; max-width: 230px; }
  .settle-sheet { width: 100%; padding: max(16px, env(safe-area-inset-top)) 13px max(16px, env(safe-area-inset-bottom)); }
  .settle-head h2 { font-size: 25px; }
  .swish-details { grid-template-columns: 1fr 1fr; }
  .swish-details div:last-child { grid-column: 1 / -1; }
  .settle-preview { max-height: 58vh; }
  .swish-qr { width: 160px; height: 160px; }
  .swish-qr-wrap { display: none; }
  .swish-deeplink { display: grid; }
  .settle-preview-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .purchase-detail-grid { grid-template-columns: 1fr; }
  .purchase-detail-grid .wide { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

.settle-group {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid #cbd9ce;
  border-radius: 10px;
  background: #eef5ef;
  cursor: pointer;
}
.settle-group-check { width: 18px; height: 18px; accent-color: var(--accent); }
.settle-group-main { display: grid; gap: 1px; min-width: 0; }
.settle-group-date { font-size: 12.5px; font-weight: 750; }
.settle-group-meta { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.settle-group-total { font-size: 12.5px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.settle-row.settle-adjustment { border-style: dashed; background: #fbfaf4; }
.settle-row.settle-adjustment:has(input:checked) { border-color: var(--accent); background: #f4f9f5; }
.settle-row-total.negative { color: var(--danger); }

/* Expandable transaction tree */
.settle-group {
  grid-template-columns: 18px minmax(0, 1fr);
  padding: 4px 8px;
}
.settle-group.is-selected { border-color: var(--accent); background: #e5f1e8; }
.settle-group-toggle {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 5px 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.settle-group-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.settle-group-chevron { color: var(--muted); font-size: 15px; line-height: 1; }
.settle-children {
  display: grid;
  gap: 6px;
  margin: 2px 0 5px 9px;
  padding-left: 12px;
  border-left: 2px solid #d5e2d8;
}
.settle-children .settle-row { padding: 9px 10px; }

.settle-item-discount {
  color: var(--danger);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.settle-group.has-receipt { grid-template-columns: 18px minmax(0, 1fr) auto; }
.settle-receipt { border: 1px solid #cbd9ce; background: #fff; color: var(--accent-strong); font: inherit; font-size: 11px; font-weight: 700; border-radius: 7px; padding: 5px 7px; cursor: pointer; white-space: nowrap; }
.settle-receipt:hover { background: #f4f9f5; }
.receipt-action { margin-top: 6px; align-self: flex-start; }
