:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #687484;
  --line: #d9dee7;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --danger: #b42318;
  --success: #166534;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 32px auto;
}

.login-shell {
  width: min(440px, calc(100vw - 32px));
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.login-form {
  margin-top: 20px;
}

.wide-shell {
  width: min(1440px, calc(100vw - 32px));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-actions form {
  margin: 0;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 30px;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  margin-bottom: 12px;
}

.eyebrow, .label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 16px;
}

.grid strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.notice {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid;
  background: #fff;
}

.success {
  border-color: #86efac;
  color: var(--success);
}

.error {
  border-color: #fca5a5;
  color: var(--danger);
}

.muted {
  color: var(--muted);
  margin-top: 6px;
}

.form {
  display: grid;
  gap: 12px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.status {
  color: var(--success);
  border: 1px solid #86efac;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.lock-panel,
.sca-panel {
  border-color: #fca5a5;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}

.sca-panel {
  border-color: #93c5fd;
}

.settings-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.settings-form label:nth-child(6) {
  grid-column: span 2;
}

.sync {
  grid-template-columns: 180px 180px minmax(220px, 1fr) auto;
  align-items: end;
}

.depot-sync {
  grid-template-columns: minmax(220px, 360px) auto;
  align-items: end;
}

.app-settings-form {
  grid-template-columns: minmax(220px, 300px) minmax(180px, 240px) minmax(220px, 1fr) auto;
  align-items: end;
}

.setting-preview {
  font-size: 18px;
  font-weight: 750;
  margin-top: 6px;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.narrow {
  max-width: 360px;
  margin-top: 14px;
}

label {
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 8px;
}

.icon-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.check-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.check-row input {
  width: auto;
}

.contact-form {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
  margin-top: 12px;
}

.bank-switch {
  min-width: 240px;
}

.transaction-sync-panel {
  align-items: end;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 620px);
  margin: 0 0 16px;
  padding: 14px;
}

.transaction-filter-panel {
  align-items: end;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.2fr) repeat(2, minmax(130px, 160px)) auto auto;
  margin: 0 0 16px;
  padding: 14px;
}

.transaction-search-field {
  position: relative;
}

.transaction-search-field input {
  min-width: 0;
  width: 100%;
}

.search-status {
  color: var(--muted);
  display: block;
  font-size: 11px;
  min-height: 15px;
  padding-top: 3px;
}

.transaction-filter-copy h3 {
  font-size: 18px;
  margin: 2px 0 0;
}

.transaction-filter-copy .muted {
  margin: 5px 0 0;
}

.transaction-filter-panel .date-preset-row {
  grid-column: 1 / -1;
}

.transaction-pagination {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
}

.transaction-list-toolbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 2px 0 12px;
}

.transaction-list-toolbar p {
  margin: 0;
}

.transaction-list-toolbar span {
  color: var(--muted);
  margin-left: 5px;
}

.transaction-sort-link {
  align-items: center;
  color: inherit;
  display: inline-flex;
  gap: 5px;
  text-decoration: none;
}

.transaction-sort-link:hover,
.transaction-sort-link:focus-visible,
.transaction-sort-link.active {
  color: var(--accent);
}

.transaction-total {
  align-items: end;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: flex-end;
  margin-top: 14px;
  padding: 12px 14px;
  text-align: right;
}

.transaction-total span,
.transaction-total small {
  color: var(--muted);
}

.transaction-total strong {
  font-size: 18px;
}

.transaction-page-size label {
  align-items: center;
  display: flex;
  gap: 8px;
}

.transaction-page-size select {
  min-width: 92px;
  width: auto;
}

.transaction-page-links {
  align-items: center;
  display: flex;
  gap: 10px;
}

.transaction-pagination > div {
  align-items: center;
  display: flex;
  gap: 10px;
}

.transaction-pagination strong {
  color: var(--ink);
  font-size: 14px;
}

.transaction-sync-panel h3 {
  font-size: 18px;
  margin: 2px 0 0;
}

.transaction-sync-form {
  grid-template-columns: repeat(2, minmax(140px, 1fr)) auto;
  align-items: end;
}

.date-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
  margin-top: -2px;
}

.date-preset-row button {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  min-height: 34px;
  padding: 7px 11px;
}

.date-preset-row button:hover,
.date-preset-row button:focus-visible {
  border-color: rgba(15, 118, 110, 0.44);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.10);
  outline: none;
}

.date-preset-row button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.transaction-sync-form.all-banks input:disabled {
  background: #eef2f7;
  color: var(--muted);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}

.quick-actions .button {
  margin-top: 0;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.summary-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.summary-tile strong {
  display: block;
  font-size: 26px;
  margin-top: 6px;
}

.summary-tile.main {
  background: #102a43;
  border-color: #102a43;
  color: #f8fafc;
}

.summary-tile.main .label,
.summary-tile.main .muted {
  color: #cbd5e1;
}

.dashboard-bank-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-actions {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr auto;
}

.sync-window {
  color: var(--ink);
  margin-top: 10px;
}

.sync-window span {
  color: var(--muted);
  display: inline-block;
  margin-left: 8px;
}

.dashboard-action-stack {
  align-items: end;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.inline-settings-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(190px, 240px) auto;
}

.input-with-unit {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(90px, 1fr) auto;
}

.input-with-unit span {
  color: var(--muted);
  font-weight: 700;
}

.balance-strip {
  overflow: hidden;
}

.balance-days {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.balance-days article {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.balance-days span,
.balance-days small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.balance-days strong {
  font-size: 16px;
}

.bank-card {
  --card-bg: #f8fafc;
  --card-line: #d9dee7;
  --card-ink: #17202a;
  --logo-bg: #17202a;
  --logo-ink: #ffffff;
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  border-radius: 8px;
  color: var(--card-ink);
  display: grid;
  gap: 16px;
  min-height: 260px;
  padding: 18px;
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover,
.clickable-card:focus-visible {
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  outline: none;
  transform: translateY(-1px);
}

.bank-card.postbank {
  --card-bg: #fff8d7;
  --card-line: #facc15;
  --logo-bg: #ffd400;
  --logo-ink: #13294b;
}

.bank-card.comdirect {
  --card-bg: #fff4df;
  --card-line: #f59e0b;
  --logo-bg: #f59e0b;
  --logo-ink: #111827;
}

.bank-card.miles {
  --card-bg: #eef2ff;
  --card-line: #6366f1;
  --logo-bg: #111184;
  --logo-ink: #ffffff;
}

.bank-card.volksbank {
  --card-bg: #eef6ff;
  --card-line: #2563eb;
  --logo-bg: #0f3f8c;
  --logo-ink: #ffffff;
}

.bank-card.n26 {
  --card-bg: #f0fdfa;
  --card-line: #14b8a6;
  --logo-bg: #0f766e;
  --logo-ink: #ffffff;
}

.bank-card.default {
  --card-bg: #ecfdf5;
  --card-line: #10b981;
  --logo-bg: #047857;
  --logo-ink: #ffffff;
}

.bank-card-top {
  align-items: center;
  display: flex;
  gap: 12px;
}

.bank-card h2 {
  margin-bottom: 0;
}

.bank-logo {
  align-items: center;
  background: var(--logo-bg);
  border-radius: 999px;
  color: var(--logo-ink);
  display: inline-flex;
  font-weight: 900;
  height: 52px;
  justify-content: center;
  min-width: 52px;
  padding: 0 8px;
}

.bank-balance {
  font-size: 30px;
  font-weight: 850;
  letter-spacing: 0;
}

.bank-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.bank-meta dt {
  color: rgba(23, 32, 42, 0.68);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.bank-meta dd {
  font-weight: 750;
  margin: 2px 0 0;
}

.bank-warning {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  color: #991b1b;
  font-weight: 750;
  padding: 8px 10px;
}

.bank-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.14);
  color: #17202a;
  min-height: 36px;
  padding: 8px 10px;
}

.tx-open-detail {
  cursor: pointer;
}

tr.tx-open-detail:hover {
  background: #f8fafc;
}

.tx-detail-cell,
.tx-detail-template {
  display: none;
}

.tx-detail-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.36);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 22px;
  position: fixed;
  z-index: 80;
}

.tx-detail-popover {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.26);
  max-height: min(760px, 88vh);
  max-width: 760px;
  overflow: auto;
  padding: 20px;
  width: min(100%, 760px);
}

.tx-detail-head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.tx-detail-head h3 {
  font-size: 22px;
  line-height: 1.15;
  margin: 4px 0 0;
}

.tx-detail-close {
  align-items: center;
  background: #eef2f7;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.tx-detail-amount {
  border-bottom: 1px solid var(--line);
  font-size: 28px;
  font-weight: 900;
  margin: 14px 0 16px;
  padding-bottom: 14px;
}

.tx-detail-amount.expense {
  color: #991b1b;
}

.tx-detail-amount.income {
  color: #166534;
}

.tx-detail-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.tx-detail-grid div {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 10px 12px;
}

.tx-detail-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.tx-detail-grid dd {
  color: var(--ink);
  margin: 0;
  overflow-wrap: anywhere;
}

.tx-detail-raw {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 12px;
}

.tx-detail-raw summary {
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tx-detail-raw pre {
  background: #0f172a;
  border-radius: 12px;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.45;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.tx-meta-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
  padding-top: 16px;
}

.tx-meta-form label:first-of-type,
.tx-meta-form .tx-attachment-link,
.tx-meta-form button {
  grid-column: 1 / -1;
}

textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 84px;
  padding: 10px 11px;
  resize: vertical;
  width: 100%;
}

.tx-attachment-link {
  color: var(--muted);
  margin: 0;
}

.tx-flag-dot {
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
  display: inline-block;
  height: 12px;
  width: 12px;
}

.tx-flag-dot.inline {
  border-width: 1px;
  flex: 0 0 auto;
  height: 14px;
  margin-right: 8px;
  width: 14px;
}

.tx-flag-pill {
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  margin: 0 6px 4px 0;
  padding: 3px 7px;
  vertical-align: middle;
}

.tx-flag-dot.green,
.tx-flag-pill.green { background: #16a34a; }
.tx-flag-dot.red,
.tx-flag-pill.red { background: #dc2626; }
.tx-flag-dot.yellow,
.tx-flag-pill.yellow { background: #ca8a04; }
.tx-flag-dot.blue,
.tx-flag-pill.blue { background: #2563eb; }
.tx-flag-dot.purple,
.tx-flag-pill.purple { background: #7c3aed; }
.tx-flag-dot.orange,
.tx-flag-pill.orange { background: #ea580c; }
.tx-flag-dot.gray,
.tx-flag-pill.gray { background: #64748b; }

.flag-settings-form {
  align-items: end;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}

.flag-label-heading {
  align-items: center;
  display: flex;
}

.add-bank-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.compact {
  margin-top: 14px;
}

.compact table {
  min-width: 720px;
}

.button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  min-height: 42px;
  padding: 10px 14px;
  font-weight: 750;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  gap: 8px;
  position: relative;
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button.is-loading {
  opacity: 0.78;
}

.button.is-loading::before {
  animation: spin 0.8s linear infinite;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  border-top-color: #ffffff;
  content: "";
  height: 15px;
  width: 15px;
}

.button.disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.is-submitting {
  opacity: 0.82;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.danger {
  background: var(--danger);
}

.secondary {
  background: #243447;
}

.secondary.active {
  background: #0f766e;
}

.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--danger);
  padding: 12px 0 0;
  font: inherit;
  cursor: pointer;
}

.challenge {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: #fafafa;
  border-radius: 6px;
  padding: 12px;
  white-space: pre-wrap;
  overflow: auto;
}

.challenge-image {
  display: block;
  margin-top: 12px;
  max-width: 320px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.audit-table {
  min-width: 1120px;
}

.audit-wrap {
  max-height: 720px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.audit-table th {
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1) {
  width: 220px;
  white-space: nowrap;
}

.audit-table th:nth-child(2),
.audit-table td:nth-child(2) {
  width: 150px;
}

.audit-table th:nth-child(3),
.audit-table td:nth-child(3) {
  width: 120px;
}

.audit-message {
  min-width: 620px;
  white-space: normal;
  word-break: break-word;
}

.audit-meta,
.audit-pagination {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.audit-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.audit-pagination {
  justify-content: flex-end;
  margin-top: 12px;
}

.audit-log.is-refreshing {
  opacity: 0.86;
  transition: opacity 0.15s ease;
}

.pill {
  border-radius: 999px;
  display: inline-flex;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 750;
  background: #eef2f7;
  color: #475569;
  white-space: nowrap;
}

.pill.ok,
.pill.tan,
.pill.sca {
  background: #dcfce7;
  color: #166534;
}

.pill.start,
.pill.konfiguration,
.pill.bank {
  background: #e0f2fe;
  color: #075985;
}

.pill.fehler,
.pill.blockiert {
  background: #fee2e2;
  color: #991b1b;
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.num {
  text-align: right;
  white-space: nowrap;
}

.tx-side {
  align-items: end;
  display: grid;
  gap: 2px;
  justify-items: end;
}

.tx-inline-balance {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  opacity: 0.62;
  white-space: nowrap;
}

.tx-inline-balance::before {
  content: "≈ ";
}

.tx-inline-balance.desktop {
  margin-bottom: 2px;
}

.tx-detail-grid small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 750;
  margin-top: 2px;
}

.counterparty-name {
  font-weight: 650;
}

.counterparty-iban {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
  white-space: nowrap;
}

.bank-account-list {
  display: grid;
  gap: 12px;
}

.bank-account-group {
  --group-line: var(--line);
  border: 1px solid var(--group-line);
  border-radius: 8px;
  overflow: hidden;
}

.bank-account-group.postbank {
  --group-line: #facc15;
}

.bank-account-group.comdirect {
  --group-line: #f59e0b;
}

.bank-account-group.miles {
  --group-line: #6366f1;
}

.bank-account-group.volksbank {
  --group-line: #2563eb;
}

.bank-account-group.n26 {
  --group-line: #14b8a6;
}

.bank-account-group summary {
  align-items: center;
  background: #fbfcfe;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: auto 1fr auto;
  list-style: none;
  padding: 14px;
}

.bank-account-group summary::-webkit-details-marker {
  display: none;
}

.bank-account-group summary::after {
  color: var(--muted);
  content: "Aufklappen";
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.bank-account-group[open] summary::after {
  content: "Zuklappen";
}

.bank-account-group[open] summary {
  border-bottom: 1px solid var(--group-line);
}

.bank-account-group .account-grid {
  padding: 14px;
}

.bank-group-sync {
  align-items: center;
  border-top: 1px solid var(--group-line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 0 14px 14px;
}

.bank-group-sync span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.bank-logo.small {
  font-size: 13px;
  height: 40px;
  min-width: 40px;
}

.bank-group-main {
  display: grid;
  gap: 2px;
}

.bank-group-main strong {
  font-size: 18px;
}

.bank-group-main span,
.bank-group-balance {
  color: var(--muted);
}

.bank-group-balance {
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.account-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: 6px;
  min-height: 150px;
  padding: 14px;
  text-decoration: none;
}

.account-card:hover {
  border-color: var(--accent);
}

.account-card strong {
  font-size: 17px;
}

.account-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.account-balance {
  font-size: 26px;
  font-weight: 800;
  margin-top: 12px;
}

.detail-card {
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  margin-top: 14px;
  overflow: hidden;
}

.detail-card:first-of-type {
  margin-top: 0;
}

.detail-card.income {
  border-left-color: #16a34a;
}

.detail-card.expense {
  border-left-color: #dc2626;
}

.detail-summary {
  background: #fbfcfe;
  display: grid;
  grid-template-columns: 132px minmax(260px, 1fr) 180px;
  gap: 16px;
  padding: 14px 16px;
  align-items: start;
}

.detail-summary strong {
  display: block;
  margin-top: 3px;
}

.date-chip {
  white-space: nowrap;
}

.summary-main strong {
  font-size: 17px;
}

.summary-main p {
  color: var(--muted);
  margin-top: 6px;
}

.subline {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.amount-box {
  text-align: right;
}

.amount {
  font-size: 18px;
  text-align: right;
}

.detail-card.income .amount {
  color: #166534;
}

.detail-card.expense .amount {
  color: #991b1b;
}

.detail-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.field-group {
  border-right: 1px solid var(--line);
  padding: 14px 16px;
  min-width: 0;
}

.field-group:last-child {
  border-right: 0;
}

.field-group h3 {
  font-size: 14px;
  margin: 0 0 10px;
}

.field-group dl,
.raw-grid {
  margin: 0;
}

.field-group dt,
.raw-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-top: 8px;
}

.field-group dt:first-child,
.raw-grid dt:first-child {
  margin-top: 0;
}

.field-group dd,
.raw-grid dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.raw-details {
  border-top: 1px solid var(--line);
  padding: 12px 16px 14px;
}

.raw-details summary {
  cursor: pointer;
  font-weight: 750;
}

.raw-grid {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 12px;
}

.raw-grid > div {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-width: 0;
  padding: 10px;
}

.raw-grid > div:nth-child(even) {
  border-right: 0;
}

.raw-grid > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.raw-json {
  margin-top: 12px;
}

.raw-block {
  background: #111827;
  border-radius: 6px;
  color: #f9fafb;
  font-size: 12px;
  margin: 12px 0 0;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 30px;
}

@media (max-width: 820px), (hover: none) and (pointer: coarse) and (max-width: 1366px) {
  body {
    background: #eef2f7;
    font-size: 16px;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .shell,
  .wide-shell {
    margin: 0 auto;
    min-height: 100vh;
    padding: 14px 12px 28px;
    width: min(100%, 520px);
  }

  .topbar, .sync, .depot-sync, .app-settings-form, .settings-form, .section-head, .lock-panel, .sca-panel, .contact-form, .add-bank-form, .transaction-filter-panel, .transaction-sync-panel, .transaction-sync-form, .quick-actions, .detail-summary, .detail-groups, .raw-grid, .account-hero, .dashboard-summary, .dashboard-bank-grid, .dashboard-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar {
    background: #17202a;
    border-radius: 22px;
    color: #fff;
    margin: 0 0 14px;
    padding: 16px;
    position: sticky;
    top: 8px;
    z-index: 10;
  }

  .topbar .eyebrow {
    color: #cbd5e1;
  }

  h1 {
    font-size: 28px;
    line-height: 1.05;
  }

  h2 {
    font-size: 21px;
  }

  .top-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: flex-start;
    margin: 4px -4px 0;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: none;
  }

  .top-actions::-webkit-scrollbar {
    display: none;
  }

  .top-actions .button {
    flex: 0 0 auto;
    min-height: 42px;
    white-space: nowrap;
    width: auto;
  }

  .top-actions form {
    flex: 0 0 auto;
  }

  .panel,
  .summary-tile,
  .bank-card,
  .login-panel {
    border-color: rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    margin-bottom: 12px;
    padding: 16px;
  }

  .summary-tile {
    min-height: 96px;
  }

  .summary-tile.main {
    background: linear-gradient(135deg, #17324d, #0f766e);
  }

  .dashboard-bank-grid {
    gap: 12px;
  }

  .bank-card {
    min-height: 0;
    padding: 18px;
  }

  .bank-card-top {
    align-items: center;
  }

  .bank-logo {
    height: 46px;
    width: 46px;
  }

  .bank-balance,
  .account-balance {
    font-size: 30px;
    letter-spacing: 0;
  }

  .bank-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bank-actions,
  .quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-actions {
    margin-top: 12px;
  }

  .button {
    align-items: center;
    border-radius: 12px;
    display: inline-flex;
    justify-content: center;
    min-height: 46px;
    padding: 11px 14px;
  }

  input,
  select,
  textarea {
    border-radius: 12px;
    font-size: 16px;
    min-height: 46px;
  }

  .dashboard-action-stack {
    justify-items: stretch;
  }

  .inline-settings-form {
    grid-template-columns: 1fr auto;
  }

  .sync-window span {
    display: block;
    margin: 2px 0 0;
  }

  .balance-days {
    display: flex;
    margin: 0 -16px;
    overflow-x: auto;
    padding: 0 16px 2px;
    scroll-snap-type: x mandatory;
  }

  .balance-days article {
    border-radius: 14px;
    flex: 0 0 176px;
    scroll-snap-align: start;
  }

  .table-wrap {
    margin-left: -16px;
    margin-right: -16px;
    overflow-x: auto;
    padding: 0 16px;
  }

  table {
    min-width: 680px;
  }

  .notice {
    border-radius: 14px;
  }

  .amount-box,
  .amount {
    text-align: left;
  }

  .field-group {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .field-group:last-child {
    border-bottom: 0;
  }

  .raw-grid > div,
  .raw-grid > div:nth-child(even),
  .raw-grid > div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .raw-grid > div:last-child {
    border-bottom: 0;
  }

  .settings-form label:nth-child(6) {
    grid-column: auto;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .bank-account-group summary {
    grid-template-columns: auto 1fr;
  }

  .bank-group-balance {
    grid-column: 1 / -1;
    text-align: left;
  }

  .bank-account-group summary::after {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1100px) and (min-width: 821px) {
  .account-grid,
  .dashboard-bank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 821px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  .shell {
    width: min(100%, 820px);
  }

  .wide-shell {
    width: min(100%, 920px);
  }
}

.mobile-header-actions,
.mobile-tabbar,
.mobile-wallet-card,
.mobile-section-title,
.transaction-list {
  display: none;
}

@media (max-width: 820px), (hover: none) and (pointer: coarse) and (max-width: 1366px) {
  :root {
    --bg: #edf1f5;
    --panel: #ffffff;
    --ink: #111827;
    --muted: #667085;
    --line: #e6eaf0;
    --accent: #0d9488;
  }

  body {
    background:
      radial-gradient(circle at 15% -10%, rgba(13, 148, 136, 0.20), transparent 34%),
      linear-gradient(180deg, #f8fafc 0%, #edf1f5 42%, #e9eef5 100%);
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .shell,
  .wide-shell {
    padding: 12px 14px 0;
    width: min(100%, 460px);
  }

  .topbar {
    align-items: center;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.10);
    color: var(--ink);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: 0 0 16px;
    padding: 12px 14px;
    position: sticky;
    top: 10px;
    z-index: 30;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }

  .top-title {
    min-width: 0;
  }

  .topbar .eyebrow {
    color: #64748b;
    font-size: 11px;
  }

  h1 {
    font-size: 24px;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  h2 {
    font-size: 20px;
    line-height: 1.15;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-header-actions {
    display: block;
  }

  .mobile-round-action {
    align-items: center;
    background: #111827;
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 12px;
    font-weight: 850;
    height: 42px;
    justify-content: center;
    text-decoration: none;
    width: 42px;
  }

  .mobile-tabbar {
    background: rgba(17, 24, 39, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 26px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.28);
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    left: 50%;
    max-width: 430px;
    padding: 8px;
    position: fixed;
    transform: translateX(-50%);
    width: calc(100vw - 28px);
    z-index: 60;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
  }

  .mobile-tabbar a {
    align-items: center;
    border-radius: 18px;
    color: rgba(255, 255, 255, 0.66);
    display: grid;
    gap: 2px;
    justify-items: center;
    min-height: 56px;
    text-decoration: none;
  }

  .mobile-tabbar a.active {
    background: #f8fafc;
    color: #111827;
  }

  .mobile-tabbar span {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    height: 24px;
    justify-content: center;
    width: 24px;
  }

  .mobile-tabbar strong {
    font-size: 11px;
    line-height: 1;
  }

  .notice {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  }

  .panel {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
    margin-bottom: 14px;
    padding: 16px;
  }

  .mobile-wallet-card {
    background:
      linear-gradient(135deg, rgba(17, 24, 39, 0.96), rgba(15, 118, 110, 0.94)),
      #111827;
    border-radius: 30px;
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.30);
    color: #fff;
    display: grid;
    gap: 22px;
    margin: 2px 0 14px;
    overflow: hidden;
    padding: 22px;
    position: relative;
  }

  .mobile-wallet-card::after {
    background: rgba(255, 255, 255, 0.10);
    border-radius: 999px;
    content: "";
    height: 160px;
    position: absolute;
    right: -68px;
    top: -52px;
    width: 160px;
  }

  .mobile-wallet-card .label {
    color: rgba(255, 255, 255, 0.72);
  }

  .mobile-wallet-card strong {
    display: block;
    font-size: clamp(32px, 9vw, 46px);
    letter-spacing: 0;
    line-height: 1;
    margin-top: 10px;
    position: relative;
    z-index: 1;
  }

  .mobile-wallet-card span:not(.label) {
    color: rgba(255, 255, 255, 0.70);
    display: block;
    margin-top: 8px;
  }

  .wallet-action {
    background: #ffffff;
    color: #111827;
    min-height: 54px;
    width: 100%;
  }

  .dashboard-summary {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 14px;
  }

  .desktop-balance-tile {
    display: none;
  }

  .summary-tile {
    border: 0;
    border-radius: 20px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    min-height: 92px;
    padding: 14px;
  }

  .summary-tile strong {
    font-size: 24px;
  }

  .dashboard-actions {
    gap: 14px;
  }

  .transaction-sync-panel {
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 253, 250, 0.92)),
      #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    grid-template-columns: 1fr;
    margin: 4px 0 16px;
    padding: 14px;
  }

  .transaction-filter-panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    margin: 4px 0 16px;
    padding: 14px;
  }

  .transaction-filter-panel .button {
    width: 100%;
  }

  .transaction-list-toolbar {
    gap: 10px;
  }

  .transaction-list-toolbar .button {
    flex: 0 0 auto;
  }

  .transaction-total {
    align-items: stretch;
    flex-direction: column;
    text-align: left;
  }

  .transaction-pagination {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .transaction-page-links {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .transaction-page-links .button:last-child {
    justify-self: end;
  }

  .transaction-page-size label {
    justify-content: space-between;
  }

  .transaction-sync-panel h3 {
    font-size: 19px;
    line-height: 1.15;
  }

  .transaction-sync-form {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
  }

  .date-preset-row {
    flex-wrap: nowrap;
    margin: 0 -14px;
    overflow-x: auto;
    padding: 2px 14px 4px;
    scrollbar-width: none;
  }

  .date-preset-row::-webkit-scrollbar {
    display: none;
  }

  .date-preset-row button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 13px;
  }

  .bank-switch {
    min-width: 0;
    width: 100%;
  }

  .dashboard-action-stack {
    justify-items: stretch;
  }

  .inline-settings-form {
    background: #f8fafc;
    border-radius: 18px;
    grid-template-columns: 1fr auto;
    padding: 10px;
  }

  .mobile-section-title {
    align-items: end;
    display: flex;
    justify-content: space-between;
    margin: 18px 2px 10px;
  }

  .mobile-section-title a {
    color: #0f766e;
    font-weight: 800;
    text-decoration: none;
  }

  .dashboard-bank-grid {
    display: flex;
    gap: 14px;
    margin: 0 -14px 14px;
    overflow-x: auto;
    padding: 0 14px 4px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .dashboard-bank-grid::-webkit-scrollbar {
    display: none;
  }

  .bank-card {
    border: 0;
    border-radius: 26px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
    flex: 0 0 min(82vw, 340px);
    min-height: 250px;
    padding: 18px;
    scroll-snap-align: start;
  }

  .bank-logo {
    border-radius: 18px;
    height: 48px;
    min-width: 48px;
  }

  .bank-balance {
    font-size: 30px;
    line-height: 1.08;
  }

  .bank-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .button,
  .button.ghost {
    border-radius: 16px;
    min-height: 48px;
  }

  .button.ghost {
    background: rgba(255, 255, 255, 0.68);
  }

  input,
  select,
  textarea {
    border: 1px solid #dbe3ec;
    border-radius: 16px;
    min-height: 50px;
  }

  .section-head {
    align-items: start;
  }

  .grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid > div {
    background: #f8fafc;
    border-radius: 18px;
    padding: 12px;
  }

  .transaction-table-wrap {
    display: none;
  }

  .transaction-list {
    display: grid;
    gap: 10px;
  }

  .transaction-card {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 20px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    display: grid;
    gap: 10px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    padding: 12px;
    position: relative;
  }

  .transaction-card > .tx-flag-dot {
    position: absolute;
    right: 10px;
    top: 10px;
  }

  .transaction-card:active,
  .transaction-card:focus-visible {
    border-color: rgba(13, 148, 136, 0.45);
    box-shadow: 0 10px 26px rgba(13, 148, 136, 0.14);
    outline: none;
  }

  .tx-icon {
    align-items: center;
    background: #e0f2fe;
    border-radius: 16px;
    color: #075985;
    display: flex;
    font-size: 12px;
    font-weight: 900;
    height: 44px;
    justify-content: center;
    text-transform: uppercase;
    width: 44px;
  }

  .transaction-card.expense .tx-icon {
    background: #fee2e2;
    color: #991b1b;
  }

  .transaction-card.income .tx-icon {
    background: #dcfce7;
    color: #166534;
  }

  .tx-main {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .tx-main strong,
  .tx-main span,
  .tx-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tx-main strong {
    font-size: 15px;
  }

  .tx-main span,
  .tx-main small {
    color: var(--muted);
    font-size: 12px;
  }

  .tx-amount {
    font-weight: 900;
    white-space: nowrap;
  }

  .tx-side {
    min-width: 86px;
  }

  .tx-inline-balance {
    font-size: 9px;
    max-width: 98px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .transaction-card.expense .tx-amount {
    color: #991b1b;
  }

  .transaction-card.income .tx-amount {
    color: #166534;
  }

  .tx-detail-open {
    overflow: hidden;
  }

  .tx-detail-backdrop {
    align-items: end;
    padding: 0;
  }

  .tx-detail-popover {
    border-radius: 26px 26px 0 0;
    max-height: min(82vh, 760px);
    padding: 18px 16px calc(22px + env(safe-area-inset-bottom));
    width: 100%;
  }

  .tx-detail-head h3 {
    font-size: 19px;
  }

  .tx-detail-amount {
    font-size: 25px;
  }

  .tx-detail-grid {
    grid-template-columns: 1fr;
  }

  .tx-meta-form,
  .flag-settings-form {
    grid-template-columns: 1fr;
  }

  .bank-account-list {
    gap: 14px;
  }

  .bank-account-group {
    border: 0;
    border-radius: 24px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  }

  .bank-account-group summary {
    background: #fff;
    grid-template-columns: auto 1fr;
    padding: 16px;
  }

  .bank-group-balance {
    background: #f8fafc;
    border-radius: 16px;
    grid-column: 1 / -1;
    padding: 10px 12px;
    text-align: left;
  }

  .bank-account-group summary::after {
    color: #0f766e;
    content: "Oeffnen";
    grid-column: 1 / -1;
  }

  .bank-account-group[open] summary::after {
    content: "Schliessen";
  }

  .account-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
  }

  .bank-group-sync {
    align-items: stretch;
    background: #fff;
    display: grid;
    gap: 8px;
    padding: 0 16px 16px;
  }

  .bank-group-sync span {
    text-align: center;
  }

  .account-card {
    background: #fff;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    min-height: 0;
    padding: 16px;
  }

  .account-hero {
    background: linear-gradient(135deg, #111827, #134e4a);
    color: #fff;
    display: grid;
  }

  .account-hero .muted,
  .account-hero .eyebrow {
    color: rgba(255, 255, 255, 0.72);
  }

  .account-hero .secondary {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
  }

  .account-balance {
    font-size: clamp(32px, 9vw, 42px);
    line-height: 1;
  }

  .balance-days {
    margin: 0 -16px;
  }

  .balance-days article {
    background: #fff;
    border: 0;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  }

  .sync,
  .depot-sync,
  .app-settings-form,
  .settings-form,
  .contact-form,
  .add-bank-form,
  .transaction-sync-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quick-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .table-wrap {
    margin-left: 0;
    margin-right: 0;
    padding: 0;
  }
}

@media (min-width: 821px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
  body {
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  .shell,
  .wide-shell {
    margin-left: auto;
    margin-right: auto;
    padding-left: 22px;
    padding-right: 22px;
    width: min(980px, calc(100vw - 44px));
  }

  .wide-shell {
    width: min(1080px, calc(100vw - 44px));
  }

  .topbar {
    margin-left: auto;
    margin-right: auto;
    max-width: none;
    padding: 16px 18px;
  }

  .panel {
    padding: 22px;
  }

  .section-head {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .section-head .button {
    width: auto;
  }

  .mobile-wallet-card {
    grid-template-columns: 1fr minmax(180px, 240px);
    align-items: end;
  }

  .dashboard-bank-grid {
    margin-left: -22px;
    margin-right: -22px;
    padding-left: 22px;
    padding-right: 22px;
  }

  .bank-card {
    flex-basis: 360px;
  }

  .account-grid {
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  .bank-account-group summary {
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) minmax(180px, auto);
    padding: 18px;
  }

  .bank-group-balance {
    grid-column: auto;
    text-align: right;
  }

  .bank-account-group summary::after {
    grid-column: 1 / -1;
  }

  .bank-group-sync {
    align-items: center;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    padding: 0 18px 18px;
  }

  .bank-group-sync span {
    text-align: left;
  }

  .transaction-list {
    display: none;
  }

  .transaction-table-wrap {
    display: block;
  }

  table {
    min-width: 880px;
  }

  th,
  td {
    padding: 12px 10px;
  }

  .tx-inline-balance {
    font-size: 10px;
    opacity: 0.54;
  }

  .mobile-tabbar {
    max-width: 520px;
  }
}

@media print {
  @page {
    margin: 10mm;
    size: A4 portrait;
  }

  body {
    background: #fff !important;
    color: #111 !important;
    font-size: 8pt;
    padding: 0 !important;
  }

  .shell,
  .wide-shell {
    margin: 0;
    max-width: none;
    min-height: 0;
    padding: 0;
    width: 100%;
  }

  .topbar,
  .mobile-tabbar,
  .notice,
  .lock-panel,
  .sca-panel,
  .tan,
  .panel.grid,
  .section-head form,
  .section-head .muted,
  .transaction-sync-panel,
  .transaction-filter-panel,
  .transaction-list-toolbar .button,
  .transaction-list,
  .transaction-pagination,
  .tx-detail-cell,
  .tx-inline-balance {
    display: none !important;
  }

  .panel {
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .section-head {
    border-bottom: 1px solid #111;
    display: block;
    margin: 0 0 4mm;
    padding: 0 0 2mm;
  }

  .section-head h2 {
    font-size: 16pt;
    margin: 0;
  }

  .section-head .eyebrow {
    color: #555;
  }

  .transaction-list-toolbar {
    display: block;
    font-size: 8pt;
    margin: 0 0 2mm;
  }

  .transaction-table-wrap {
    display: block !important;
    overflow: visible;
  }

  table {
    border-collapse: collapse;
    min-width: 0 !important;
    table-layout: fixed;
    width: 100%;
  }

  thead {
    display: table-header-group;
  }

  tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  th,
  td {
    border-bottom: 0.25pt solid #bbb;
    font-size: 7.5pt;
    line-height: 1.22;
    overflow-wrap: anywhere;
    padding: 1.5mm 1mm;
    vertical-align: top;
  }

  th {
    background: #eee !important;
    color: #111 !important;
    font-weight: 700;
  }

  th:nth-child(1), td:nth-child(1) { width: 11%; }
  th:nth-child(2), td:nth-child(2) { width: 12%; }
  th:nth-child(3), td:nth-child(3) { width: 17%; }
  th:nth-child(4), td:nth-child(4) { width: 20%; }
  th:nth-child(5), td:nth-child(5) { width: 29%; }
  th:nth-child(6), td:nth-child(6) { width: 11%; }

  .transaction-sort-link {
    color: #111 !important;
  }

  .transaction-sort-link span {
    display: none;
  }

  .counterparty-iban,
  .subline {
    color: #555 !important;
    font-size: 6.7pt;
  }

  .transaction-total {
    background: #fff !important;
    border: 0;
    border-top: 1pt solid #111;
    border-radius: 0;
    color: #111;
    display: flex !important;
    margin-top: 2mm;
    padding: 2mm 0 0;
  }

  .transaction-total strong {
    font-size: 10pt;
  }
}
