/* Small readable stylesheet for the local web UI, including narrow phones. */
:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f8f4;
  color: #1b1f23;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

.site-header {
  align-items: center;
  border-bottom: 1px solid #d9ded6;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  background: #ffffff;
  padding: 0.85rem 1rem;
}

.brand {
  color: #17324d;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav {
  align-items: center;
  display: flex;
  gap: 0.8rem;
}

.site-nav a {
  align-items: center;
  color: #295b45;
  display: inline-flex;
  font-weight: 700;
  min-height: 44px;
  text-decoration: none;
}

.logout-form {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  margin: 0;
}

.logout-form button {
  min-height: 44px;
  padding: 0.45rem 0.7rem;
  width: auto;
}

.signed-in {
  color: #526056;
  font-size: 0.9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.badge {
  background: #7b2d26;
  border-radius: 999px;
  color: #ffffff;
  display: inline-block;
  font-size: 0.75rem;
  line-height: 1;
  margin-left: 0.25rem;
  min-width: 1.35rem;
  padding: 0.25rem 0.35rem;
  text-align: center;
}

.page {
  margin: 0 auto;
  max-width: 760px;
  padding: 1rem;
}

.llm-banner {
  background: #fff8d8;
  border-bottom: 1px solid #ead57a;
  color: #4f4210;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.65rem 1rem;
  text-align: center;
}

.panel,
.result-card {
  background: #ffffff;
  border: 1px solid #d9ded6;
  border-radius: 8px;
  padding: 1rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.85rem;
}

h1 {
  font-size: 1.45rem;
}

h2 {
  font-size: 1.2rem;
}

h3 {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.upload-form {
  display: grid;
  gap: 0.7rem;
}

.login-panel {
  background: #ffffff;
  border: 1px solid #d9ded6;
  border-radius: 8px;
  margin: 1rem auto;
  max-width: 28rem;
  padding: 1rem;
}

.login-form {
  display: grid;
  gap: 0.8rem;
}

.login-form label {
  display: grid;
  gap: 0.35rem;
}

.alert {
  background: #fff0ec;
  border: 1px solid #d89b8f;
  border-radius: 6px;
  color: #712e23;
  font-weight: 700;
  margin: 0 0 0.85rem;
  padding: 0.7rem;
}

label {
  font-weight: 700;
}

input,
select,
textarea,
button {
  border: 1px solid #aeb8ad;
  border-radius: 6px;
  font: inherit;
  min-height: 44px;
  padding: 0.65rem;
  width: 100%;
}

textarea {
  resize: vertical;
}

button {
  background: #295b45;
  border-color: #295b45;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.hint,
.notice {
  color: #526056;
  margin: -0.2rem 0 0.2rem;
}

.notice {
  background: #fff8d8;
  border: 1px solid #ead57a;
  border-radius: 6px;
  color: #4f4210;
  margin: 0 0 0.85rem;
  padding: 0.7rem;
}

.results {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.summary-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.summary-grid div {
  border-top: 1px solid #edf0eb;
  padding-top: 0.5rem;
}

dt {
  color: #526056;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  margin: 0.1rem 0 0;
}

.warnings {
  margin: 0.85rem 0 0;
  padding-left: 1.1rem;
}

.sorter-shell {
  display: grid;
  gap: 0.85rem;
}

.progress {
  color: #526056;
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0;
  text-transform: uppercase;
}

.transaction-card {
  background: #ffffff;
  border: 1px solid #d9ded6;
  border-radius: 8px;
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.transaction-card h1 {
  overflow-wrap: anywhere;
}

.suggestion {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
}

.suggestion span {
  background: #e5f0ff;
  border: 1px solid #9fbfe8;
  border-radius: 999px;
  color: #17324d;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.45rem;
  text-transform: uppercase;
}

.txn-facts {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.txn-facts div {
  border-top: 1px solid #edf0eb;
  padding-top: 0.5rem;
}

.txn-facts dd {
  overflow-wrap: anywhere;
}

.venmo-note {
  background: #f2f6fb;
  border-left: 4px solid #3f6f9f;
  margin: 0;
  overflow-wrap: anywhere;
  padding: 0.65rem 0.75rem;
}

.question-card {
  gap: 1rem;
}

.question-choices {
  display: grid;
  gap: 0.6rem;
}

.question-choice {
  display: grid;
  gap: 0.2rem;
  min-height: 64px;
  text-align: left;
}

.question-choice small {
  font-size: 0.82rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.category-grid {
  display: grid;
  gap: 0.55rem;
}

.category-button {
  align-items: center;
  background: #ffffff;
  border-color: #9fb0a3;
  color: #1b1f23;
  display: flex;
  justify-content: space-between;
  min-height: 52px;
  text-align: left;
}

.category-button small {
  color: #7b2d26;
  font-size: 0.72rem;
  font-weight: 800;
  margin-left: 0.5rem;
  text-transform: uppercase;
}

.category-button.is-suggested {
  border-color: #7b2d26;
  box-shadow: inset 0 0 0 1px #7b2d26;
}

.new-category-form {
  background: #ffffff;
  border: 1px dashed #aeb8ad;
  border-radius: 8px;
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
}

.inline-fields {
  display: grid;
  gap: 0.55rem;
}

.checkbox-row {
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid #d9ded6;
  border-radius: 8px;
  display: flex;
  gap: 0.65rem;
  padding: 0.8rem;
}

.checkbox-row input {
  flex: 0 0 auto;
  margin-top: 0.15rem;
  min-height: 1.2rem;
  width: 1.2rem;
}

.owner-tag-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.owner-tag-row span {
  color: #526056;
  font-weight: 800;
}

.owner-tag-row form {
  margin: 0;
}

.owner-tag-row button {
  width: auto;
}

.owner-tag-row .is-selected {
  border-color: #295b45;
  box-shadow: inset 0 0 0 1px #295b45;
}

.sorter-actions {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.secondary-button {
  background: #ffffff;
  border-color: #738074;
  color: #1b1f23;
}

.rule-offer {
  align-items: center;
  display: grid;
  gap: 0.65rem;
}

.end-screen {
  display: grid;
  gap: 0.85rem;
}

.text-link {
  color: #295b45;
  font-weight: 800;
}

.rules-shell,
.rules-heading,
.runs-shell,
.runs-heading,
.run-panel,
.run-list,
.checklist-list,
.run-actions,
.run-summary,
.run-links,
.create-rule,
.rule-form,
.rules-search,
.dashboard-shell,
.dashboard-heading,
.dashboard-grid,
.dashboard-list,
.charts-shell,
.charts-heading,
.chart-list,
.budgets-shell,
.budget-heading,
.budget-card-list,
.budget-actions,
.budget-form,
.goals-shell,
.goals-heading,
.goal-card-list,
.goal-form,
.merchant-search,
.dry-run-panel,
.merchants-shell,
.merchant-heading,
.merchant-list,
.merchant-workbench,
.merchant-filters,
.bulk-form,
.history-shell,
.history-heading,
.history-timeline,
.history-events,
.transactions-shell,
.transactions-heading,
.transaction-detail-shell,
.split-panel,
.split-form,
.split-rows,
.unsplit-form,
.reports-shell,
.reports-heading,
.chat-shell,
.chat-heading,
.chat-layout,
.chat-main,
.chat-transcript,
.chat-form,
.report-filters,
.report-list,
.report-actions,
.report-detail-shell,
.report-meta {
  display: grid;
  gap: 0.85rem;
}

.checklist-row {
  border-top: 1px solid #edf0eb;
  display: grid;
  gap: 0.55rem;
  padding-top: 0.7rem;
}

.checklist-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.checklist-row small {
  color: #526056;
  overflow-wrap: anywhere;
}

.run-actions {
  align-items: start;
}

.month-nav,
.card-title-row,
.progress-meta,
.total-cap-line,
.contribution-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: space-between;
}

.budget-card,
.goal-card,
.add-budget-row {
  background: #ffffff;
  border: 1px solid #d9ded6;
  border-radius: 8px;
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
}

.budget-card h2,
.goal-card h2 {
  margin: 0;
}

.budget-card p,
.goal-card p {
  margin: 0;
}

.budget-form,
.goal-form {
  grid-template-columns: 1fr;
}

.budget-actions {
  align-items: stretch;
}

.budget-safe {
  display: grid;
  gap: 0.85rem;
}

.mini-list {
  display: grid;
  gap: 0.55rem;
}

.mini-list > div {
  border-top: 1px solid #edf0eb;
  display: grid;
  gap: 0.25rem;
  padding-top: 0.55rem;
}

.mini-list span,
.progress-meta {
  color: #526056;
  font-size: 0.88rem;
}

.progress-block {
  display: grid;
  gap: 0.35rem;
}

progress {
  accent-color: #295b45;
  height: 1rem;
  width: 100%;
}

.warning-pill {
  background: #fff3e8;
  border-color: #e1a071;
  color: #613513;
}

.compact-list {
  gap: 0.65rem;
}

.single-action {
  margin-top: 0.7rem;
}

.dashboard-heading {
  align-items: start;
}

.quick-links {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-safe-strip {
  background: #17324d;
  border-radius: 8px;
  color: #ffffff;
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.dashboard-safe-strip .summary-grid div {
  border-top-color: rgba(255, 255, 255, 0.28);
}

.dashboard-safe-strip dt,
.dashboard-safe-strip .hint {
  color: #dbe6ef;
}

.dashboard-safe-strip strong {
  display: block;
  font-size: 2rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.kicker {
  color: #dbe6ef;
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sort-cta {
  background: #ffffff;
  border-radius: 6px;
  color: #17324d;
  display: block;
  font-weight: 800;
  min-height: 44px;
  padding: 0.75rem;
  text-align: center;
  text-decoration: none;
}

.dashboard-line {
  border-top: 1px solid #edf0eb;
  display: grid;
  gap: 0.45rem;
  padding-top: 0.65rem;
}

.dashboard-line:first-child {
  border-top: 0;
  padding-top: 0;
}

.dashboard-line small {
  color: #526056;
  overflow-wrap: anywhere;
}

.rules-search,
.merchant-search,
.merchant-filters,
.rule-form,
.history-filters {
  grid-template-columns: 1fr;
}

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

.rules-table {
  background: #ffffff;
  border-collapse: collapse;
  border: 1px solid #d9ded6;
  width: 100%;
}

.rules-table th,
.rules-table td {
  border-bottom: 1px solid #edf0eb;
  padding: 0.55rem;
  text-align: left;
  vertical-align: top;
}

.rules-table th {
  color: #526056;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.rules-table input,
.rules-table select {
  min-width: 7rem;
}

.amount-fields,
.rule-actions,
.impact-list {
  display: grid;
  gap: 0.45rem;
}

.amount-fields {
  grid-template-columns: repeat(2, minmax(4.5rem, 1fr));
}

.impact-row {
  background: #ffffff;
  border: 1px solid #ead57a;
  border-radius: 6px;
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem;
}

.history-message-success {
  background: #e6f4ec;
  border-color: #9ac7ad;
  color: #1f4c35;
}

.history-message-warning {
  background: #fff3e8;
  border-color: #e1a071;
  color: #613513;
}

.history-sessions,
.history-group {
  display: grid;
  gap: 0.7rem;
}

.session-grid {
  display: grid;
  gap: 0.65rem;
}

.session-card,
.merchant-card,
.history-event {
  background: #ffffff;
  border: 1px solid #d9ded6;
  border-radius: 8px;
  display: grid;
  gap: 0.7rem;
  padding: 0.85rem;
}

.session-card p,
.merchant-card p,
.history-event p {
  margin: 0;
}

.merchant-card {
  gap: 0.85rem;
}

.merchant-facts {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.bulk-toolbar {
  background: #ffffff;
  border: 1px solid #d9ded6;
  border-radius: 8px;
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
}

.selection-actions {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.merchant-preview,
.merchant-undo {
  align-items: center;
  display: grid;
  gap: 0.65rem;
}

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

.merchant-table {
  background: #ffffff;
  border-collapse: collapse;
  border: 1px solid #d9ded6;
  width: 100%;
}

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

.transaction-table {
  background: #ffffff;
  border-collapse: collapse;
  border: 1px solid #d9ded6;
  width: 100%;
}

.merchant-table th,
.merchant-table td,
.transaction-table th,
.transaction-table td {
  border-bottom: 1px solid #edf0eb;
  padding: 0.55rem;
  text-align: left;
  vertical-align: top;
}

.merchant-table th,
.transaction-table th {
  color: #526056;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.merchant-table td,
.transaction-table td {
  overflow-wrap: anywhere;
}

.transaction-table small {
  color: #526056;
  display: block;
  font-size: 0.82rem;
  margin-top: 0.2rem;
}

.merchant-table .row-check {
  min-height: 1.4rem;
  width: 1.4rem;
}

.history-group-header,
.event-meta,
.event-change {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.history-group-header {
  justify-content: space-between;
}

.event-meta {
  color: #526056;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.event-id {
  color: #295b45;
}

.history-facts {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0.65rem 0;
}

.history-facts dd,
.event-change span {
  overflow-wrap: anywhere;
}

.event-change {
  font-weight: 800;
}

.is-reverted .history-event-main {
  opacity: 0.66;
  text-decoration: line-through;
}

.reverted-note {
  color: #526056;
  font-size: 0.9rem;
}

.status-pill {
  background: #edf0eb;
  border: 1px solid #d9ded6;
  border-radius: 999px;
  color: #526056;
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.35rem 0.55rem;
  text-align: center;
}

.verified-pill {
  background: #e6f4ec;
  border-color: #9ac7ad;
  color: #1f4c35;
}

.template-pill {
  background: #fff3e8;
  border-color: #e1a071;
  color: #613513;
}

.report-card {
  background: #ffffff;
  border: 1px solid #d9ded6;
  border-radius: 8px;
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem;
}

.report-card p,
.chat-message p,
.report-text p {
  margin: 0;
}

.chat-sessions .session-card {
  color: inherit;
  text-decoration: none;
}

.session-card.is-selected {
  border-color: #295b45;
  box-shadow: inset 0 0 0 1px #295b45;
}

.chat-message {
  background: #ffffff;
  border: 1px solid #d9ded6;
  border-radius: 8px;
  display: grid;
  gap: 0.7rem;
  padding: 0.85rem;
}

.chat-user {
  border-left: 4px solid #3f6f9f;
}

.chat-assistant {
  border-left: 4px solid #295b45;
}

.tool-details {
  display: grid;
  gap: 0.55rem;
}

.tool-details summary {
  color: #295b45;
  cursor: pointer;
  font-weight: 800;
}

.tool-details code {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.report-text {
  display: grid;
  gap: 0.75rem;
}

.load-older {
  background: #ffffff;
  border: 1px solid #738074;
  border-radius: 6px;
  color: #1b1f23;
  display: block;
  font-weight: 800;
  min-height: 44px;
  padding: 0.7rem;
  text-align: center;
  text-decoration: none;
}

.transaction-filters {
  display: grid;
  gap: 0.55rem;
}

.chart-range-form {
  display: grid;
  gap: 0.65rem;
}

.chart-list {
  margin-top: 0.85rem;
}

.chart-panel {
  display: grid;
  gap: 0.8rem;
}

.chart-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: space-between;
}

.chart-title-row h2 {
  margin: 0;
}

.chart-table-toggle {
  width: auto;
}

.chart-canvas-wrap {
  height: 18rem;
  min-height: 18rem;
  position: relative;
}

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

.has-js .chart-table-wrap {
  display: none;
}

.has-js .chart-table-wrap.is-expanded {
  display: block;
}

.chart-table {
  background: #ffffff;
  border-collapse: collapse;
  border: 1px solid #d9ded6;
  width: 100%;
}

.chart-table th,
.chart-table td {
  border-bottom: 1px solid #edf0eb;
  padding: 0.55rem;
  text-align: left;
  vertical-align: top;
}

.chart-table th {
  color: #526056;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.report-table {
  background: #ffffff;
  border-collapse: collapse;
  border: 1px solid #d9ded6;
  width: 100%;
}

.report-table th,
.report-table td {
  border-bottom: 1px solid #edf0eb;
  overflow-wrap: anywhere;
  padding: 0.55rem;
  text-align: left;
  vertical-align: top;
}

.report-table th {
  color: #526056;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.compact-checkbox {
  margin: 0;
}

.detail-card {
  gap: 1rem;
}

.detail-heading {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: space-between;
}

.detail-heading strong {
  font-size: 1.25rem;
}

.detail-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split-row {
  align-items: end;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: minmax(0, 1fr);
}

.split-actions,
.pager {
  align-items: center;
  display: grid;
  gap: 0.55rem;
}

.pager {
  justify-items: center;
}

.offline-panel {
  display: grid;
  gap: 0.5rem;
}

.offline-panel p {
  margin: 0;
}

@media (min-width: 620px) {
  .page {
    max-width: 1120px;
    padding: 1.5rem;
  }

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

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

  .inline-fields {
    grid-template-columns: minmax(0, 1fr) 10rem 8rem;
  }

  .budget-form {
    align-items: end;
    grid-template-columns: minmax(9rem, 1fr) minmax(8rem, 0.6fr) 8rem;
  }

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

  .budget-card-list,
  .goal-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .budget-card-list.compact-list {
    grid-template-columns: 1fr;
  }

  .rules-search {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: minmax(0, 1fr) 10rem 8rem;
  }

  .merchant-search {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: minmax(0, 1fr) 8rem;
  }

  .merchant-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .bulk-toolbar {
    grid-template-columns: minmax(12rem, 1fr) minmax(12rem, 1fr) 10rem;
  }

  .rule-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .history-filters {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: minmax(8rem, 1fr) minmax(6rem, 0.7fr) minmax(8rem, 0.8fr) 8rem;
  }

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

  .history-event {
    grid-template-columns: minmax(0, 1fr) 11rem;
  }

  .transaction-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .report-filters {
    align-items: end;
    grid-template-columns: minmax(0, 1fr) 8rem;
  }

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

  .chat-layout {
    align-items: start;
    grid-template-columns: minmax(14rem, 0.55fr) minmax(0, 1.45fr);
  }

  .chart-range-form {
    align-items: end;
    grid-template-columns: minmax(9rem, 1fr) 10rem 10rem minmax(10rem, 0.8fr) 8rem;
  }

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

  .run-actions,
  .run-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-safe-strip {
    align-items: center;
    grid-template-columns: minmax(13rem, 0.8fr) minmax(0, 1.5fr) minmax(12rem, 0.7fr);
  }

  .split-row {
    grid-template-columns: minmax(12rem, 1fr) minmax(8rem, 0.7fr) 7rem;
  }

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

@media (max-width: 430px) {
  .page {
    padding: 0.75rem;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 0.35rem 0.7rem;
    width: 100%;
  }

  .logout-form {
    align-items: stretch;
    display: grid;
    width: 100%;
  }

  .logout-form button {
    width: 100%;
  }

  .txn-facts,
  .sorter-actions,
  .history-facts,
  .detail-facts,
  .month-nav {
    grid-template-columns: 1fr;
  }

  .month-nav {
    align-items: stretch;
    display: grid;
  }
}

@media (max-width: 390px) {
  .rules-table,
  .merchant-table,
  .transaction-table,
  .chart-table,
  .report-table,
  .rules-table tbody,
  .merchant-table tbody,
  .transaction-table tbody,
  .chart-table tbody,
  .report-table tbody,
  .rules-table tr,
  .merchant-table tr,
  .transaction-table tr,
  .chart-table tr,
  .report-table tr,
  .rules-table td {
    display: block;
    width: 100%;
  }

  .merchant-table td,
  .transaction-table td,
  .chart-table td,
  .report-table td {
    display: grid;
    gap: 0.25rem;
    width: 100%;
  }

  .rules-table thead,
  .merchant-table thead,
  .transaction-table thead,
  .chart-table thead,
  .report-table thead {
    display: none;
  }

  .rules-table tr,
  .merchant-table tr,
  .transaction-table tr,
  .chart-table tr,
  .report-table tr {
    border-bottom: 1px solid #d9ded6;
    padding: 0.6rem;
  }

  .rules-table td,
  .merchant-table td,
  .transaction-table td,
  .chart-table td,
  .report-table td {
    border-bottom: 0;
    padding: 0.35rem 0;
  }

  .rules-table td::before,
  .merchant-table td::before,
  .transaction-table td::before,
  .chart-table td::before,
  .report-table td::before {
    color: #526056;
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
  }

  .rules-table input,
  .rules-table select,
  .merchant-table select,
  .transaction-table select {
    min-width: 0;
  }

  .merchant-table .row-check {
    min-height: 2rem;
    width: 2rem;
  }

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

  .has-js .chart-table-wrap {
    display: block;
  }

  .chart-table-toggle {
    display: none;
  }
}
