:root {
  --app-ink: #1c2b27;
  --app-muted: #5d6f69;
  --app-surface: #ffffff;
  --app-background: #f4f6f5;
  --app-border: #dce3e0;
  --app-primary: #176b55;
  --app-primary-dark: #0f513f;
  --app-nav: #173a31;
  --app-soft: #e8f1ee;
}

html {
  scroll-behavior: auto;
}

body {
  color: var(--app-ink);
  background: var(--app-background);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--app-primary);
}

a:hover {
  color: var(--app-primary-dark);
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2000;
  padding: 0.6rem 0.9rem;
  color: #fff;
  background: #000;
  border-radius: 0.35rem;
  transform: translateY(-180%);
}

.skip-link:focus {
  color: #fff;
  transform: translateY(0);
}

.app-navbar {
  min-height: 4rem;
  background: var(--app-nav);
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.brand-mark {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--app-nav);
  background: #fff;
  border-radius: 0.45rem;
  font-size: 0.9rem;
  font-weight: 800;
}

.nav-context-label {
  display: block;
  color: rgb(255 255 255 / 58%);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.household-toggle {
  line-height: 1.2;
  text-align: left;
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--app-primary);
}

.btn-primary {
  --bs-btn-bg: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary-dark);
  --bs-btn-hover-border-color: var(--app-primary-dark);
  --bs-btn-active-bg: var(--app-primary-dark);
  --bs-btn-active-border-color: var(--app-primary-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary);
  --bs-btn-hover-border-color: var(--app-primary);
}

.landing-section {
  display: flex;
  min-height: calc(100vh - 8.75rem);
  align-items: center;
  padding: 5rem 0;
  background: var(--app-surface);
}

.landing-section h1 {
  max-width: 13ch;
  color: #15332b;
  letter-spacing: -0.035em;
}

.landing-section .lead {
  max-width: 42rem;
}

.landing-panel {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--app-soft);
  border: 1px solid #cfe0da;
  border-radius: 0.9rem;
}

.feature-list {
  display: grid;
  gap: 1rem;
  padding-left: 1.25rem;
}

.feature-list li::marker {
  color: var(--app-primary);
}

.page-shell {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.eyebrow {
  color: var(--app-primary);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.tool-card,
.content-card,
.auth-card {
  border-color: var(--app-border);
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 1rem rgb(25 52 45 / 5%);
}

.tool-card {
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

.tool-card:hover,
.tool-card:focus-within {
  border-color: #a8beb6;
  box-shadow: 0 0.45rem 1.5rem rgb(25 52 45 / 10%);
  transform: translateY(-2px);
}

.tool-icon {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  color: var(--app-primary-dark);
  background: var(--app-soft);
  border-radius: 0.55rem;
  font-weight: 750;
}

.tool-link {
  font-weight: 650;
  text-decoration: none;
}

.empty-state {
  padding: clamp(1.5rem, 5vw, 3rem);
  background: var(--app-surface);
  border: 1px dashed #b9c8c3;
  border-radius: 0.75rem;
  text-align: center;
}

.content-card .card-header {
  padding: 1.1rem 1.25rem;
  border-color: var(--app-border);
  border-radius: 0.75rem 0.75rem 0 0;
}

.table > :not(caption) > * > * {
  padding: 0.9rem 1.25rem;
  border-color: var(--app-border);
}

.role-badge {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  color: #29483f;
  background: var(--app-soft);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 650;
}

.account-details {
  margin: 1.25rem 0;
}

.account-details dt {
  color: var(--app-muted);
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
}

.account-details dd {
  margin-bottom: 1rem;
}

.auth-shell {
  display: grid;
  min-height: calc(100vh - 8.75rem);
  padding: 3rem 1rem;
  place-items: center;
}

.auth-card {
  width: min(100%, 31rem);
}

.auth-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--app-border);
  text-align: center;
}

.auth-card input:not([type="hidden"]),
.content-card input:not([type="hidden"]),
.content-card select,
.content-card textarea {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  color: var(--app-ink);
  background: #fff;
  border: 1px solid #aab9b4;
  border-radius: 0.375rem;
}

.auth-card input:focus,
.content-card input:focus,
.content-card select:focus,
.content-card textarea:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 0.2rem rgb(23 107 85 / 18%);
  outline: 0;
}

.form-text ul {
  margin-top: 0.35rem;
  padding-left: 1.1rem;
}

.placeholder-note {
  max-width: 45rem;
  padding-left: 1.25rem;
  border-left: 4px solid var(--app-primary);
}

.placeholder-label {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.3rem 0.55rem;
  color: var(--app-primary-dark);
  background: var(--app-soft);
  border-radius: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.counter-card {
  max-width: 44rem;
  margin: 0 auto;
}

.counter-value {
  display: flex;
  flex-direction: column;
  margin-bottom: 2rem;
}

.counter-number {
  color: var(--app-primary-dark);
  font-size: clamp(4rem, 13vw, 7rem);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  letter-spacing: -0.05em;
  line-height: 1;
}

.counter-caption {
  color: var(--app-muted);
  font-size: 0.85rem;
}

.error-shell {
  width: min(42rem, calc(100% - 2rem));
  margin: 10vh auto;
  padding: clamp(1.5rem, 5vw, 3rem);
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 0.75rem;
  text-align: center;
}

.error-code {
  margin-bottom: 0.5rem;
  color: var(--app-primary);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.app-footer {
  padding: 1.25rem 0;
  background: #fff;
  border-top: 1px solid var(--app-border);
  font-size: 0.85rem;
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .nav-context-label {
    display: inline;
    margin-right: 0.35rem;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Budget */

.budget-shell {
  width: 100%;
  max-width: 100%;
  min-height: calc(100vh - 8.75rem);
  overflow-x: clip;
  padding: 0 0 5rem;
  background:
    radial-gradient(circle at 85% 5%, rgb(222 232 222 / 55%), transparent 24rem),
    #f6f5f0;
}

.budget-narrow {
  max-width: 1080px;
}

.budget-form-width {
  max-width: 760px;
}

.budget-tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  margin-bottom: 2rem;
  padding: 1.15rem 0 0.8rem;
  border-bottom: 1px solid #dcded6;
  scrollbar-width: none;
}

.budget-tabs::-webkit-scrollbar {
  display: none;
}

.budget-tabs a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  flex: 0 0 auto;
  padding: 0.55rem 0.75rem;
  color: #66736d;
  border-radius: 0.45rem;
  font-size: 0.87rem;
  font-weight: 650;
  text-decoration: none;
}

.budget-tabs a:hover {
  color: #183e34;
  background: rgb(255 255 255 / 70%);
}

.budget-tabs a:focus-visible,
.month-switcher a:focus-visible,
.icon-link:focus-visible,
.receipt-drop-card:focus-visible,
.category-list-row:focus-visible {
  outline: 3px solid rgb(23 107 85 / 28%);
  outline-offset: 2px;
}

.budget-tabs a.active {
  color: #173a31;
  background: #fff;
  box-shadow: 0 0.15rem 0.5rem rgb(24 62 52 / 8%);
}

.budget-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.3rem);
  color: #fff;
  background:
    linear-gradient(115deg, rgb(255 255 255 / 5%) 0 45%, transparent 45%),
    #173c32;
  border: 1px solid #244e42;
  border-radius: 1rem;
  box-shadow: 0 1rem 2.5rem rgb(25 53 45 / 13%);
}

.budget-hero > *,
.budget-content-grid > *,
.budget-summary-grid > *,
.budget-side-stack > * {
  min-width: 0;
}

.budget-hero h1,
.budget-page-heading h1 {
  margin: 0;
  letter-spacing: -0.045em;
}

.budget-hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 500;
}

.budget-hero p {
  margin: 0.6rem 0 0;
  color: rgb(255 255 255 / 66%);
}

.budget-hero p strong {
  color: #fff;
  font-weight: 650;
}

.budget-kicker {
  display: inline-block;
  color: #7a8a83;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.budget-hero .budget-kicker {
  color: #9fc1b3;
}

.analysis-pill,
.connection-badge,
.document-status,
.status-chip,
.source-label,
.review-flag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 0.38rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.analysis-pill {
  color: rgb(255 255 255 / 72%);
  background: rgb(255 255 255 / 9%);
}

.analysis-dot,
.connection-badge.connected span {
  width: 0.42rem;
  height: 0.42rem;
  background: #e1a269;
  border-radius: 50%;
}

.analysis-complete .analysis-dot,
.connection-badge.connected span {
  background: #75c397;
}

.analysis-failed .analysis-dot {
  background: #ed8f82;
}

.budget-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.budget-hero-actions form {
  margin: 0;
}

.budget-action-button {
  white-space: nowrap;
}

.btn-budget-accent {
  --bs-btn-color: #3c2718;
  --bs-btn-bg: #efaa70;
  --bs-btn-border-color: #efaa70;
  --bs-btn-hover-color: #2e1d11;
  --bs-btn-hover-bg: #f4b982;
  --bs-btn-hover-border-color: #f4b982;
  --bs-btn-active-color: #2e1d11;
  --bs-btn-active-bg: #e49b61;
  --bs-btn-active-border-color: #e49b61;
  font-weight: 700;
}

.month-switcher {
  display: inline-flex;
  align-items: center;
  height: calc(2.75rem + 2px);
  overflow: hidden;
  color: #fff;
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 0.5rem;
}

.month-switcher a {
  display: grid;
  width: 2.75rem;
  height: 100%;
  place-items: center;
  color: inherit;
  font-size: 1.35rem;
  text-decoration: none;
}

.month-switcher a:hover {
  color: #fff;
  background: rgb(255 255 255 / 10%);
}

.month-switcher span {
  min-width: 5rem;
  font-size: 0.78rem;
  font-weight: 750;
  text-align: center;
}

.month-switcher.light {
  color: #29483f;
  background: #fff;
  border-color: #d7ddd7;
}

.month-switcher.light a:hover {
  color: #173a31;
  background: #eef2ee;
}

.budget-inline-alert {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  color: #654032;
  background: #fff2e9;
  border: 1px solid #f2d1bb;
  border-radius: 0.65rem;
}

.budget-inline-alert > span {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  color: #fff;
  background: #b96d4b;
  border-radius: 50%;
  font-weight: 800;
}

.budget-inline-alert div {
  flex: 1;
}

.budget-inline-alert p {
  margin: 0.1rem 0 0;
  font-size: 0.84rem;
}

.budget-inline-alert a {
  font-size: 0.82rem;
  font-weight: 700;
}

.budget-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.25rem;
}

.budget-stat {
  display: flex;
  min-height: 8.8rem;
  flex-direction: column;
  justify-content: center;
  padding: 1.1rem 1.2rem;
  background: #fff;
  border: 1px solid #e0e2dc;
  border-radius: 0.75rem;
  box-shadow: 0 0.35rem 1.1rem rgb(30 52 45 / 4%);
}

.budget-stat.needs-attention {
  background: #fffaf5;
  border-color: #efdbc9;
}

.budget-stat-label {
  margin-bottom: 0.3rem;
  color: #7d8782;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.budget-stat > strong {
  color: #20342e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.85rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.budget-stat small {
  margin-top: 0.3rem;
  color: #7d8782;
  font-size: 0.75rem;
}

.budget-stat small a {
  color: inherit;
}

.positive {
  color: #36785a !important;
}

.stat-progress {
  height: 0.28rem;
  overflow: hidden;
  margin: 0.5rem 0 0.1rem;
  background: #e8ece8;
  border-radius: 999px;
}

.stat-progress span {
  display: block;
  height: 100%;
  background: #e29a60;
  border-radius: inherit;
}

.budget-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(19rem, 0.8fr);
  gap: 1.25rem;
}

.budget-side-stack {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 1.25rem;
}

.budget-panel {
  min-width: 0;
  padding: 1.35rem;
  background: #fff;
  border: 1px solid #e0e2dc;
  border-radius: 0.85rem;
  box-shadow: 0 0.35rem 1.2rem rgb(30 52 45 / 4%);
}

.budget-chart-panel {
  min-height: 35rem;
}

.budget-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.budget-panel-heading h2 {
  margin: 0.18rem 0 0;
  color: #253c35;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.budget-panel-heading > a {
  color: #526b61;
  font-size: 0.76rem;
  font-weight: 700;
}

.budget-bars {
  display: grid;
  gap: 1.12rem;
}

.budget-bar-meta {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.42rem;
  color: #3d504a;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.budget-bar-meta small {
  color: #9aa29e;
}

.budget-category-name,
.transaction-category {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.budget-category-name {
  min-width: 0;
  flex: 1;
  font-weight: 650;
}

.budget-category-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.budget-bar-amount {
  flex: 0 0 auto;
  white-space: nowrap;
}

.category-swatch {
  display: inline-block;
  width: 0.56rem;
  height: 0.56rem;
  flex: 0 0 auto;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 8%);
}

.category-swatch.large {
  width: 0.8rem;
  height: 0.8rem;
}

.budget-bar-track {
  max-width: 100%;
  height: 0.48rem;
  overflow: hidden;
  background: #ecefea;
  border-radius: 999px;
}

.budget-bar-track span {
  display: block;
  min-width: 0.35rem;
  height: 100%;
  border-radius: inherit;
}

.budget-bar-track.over-budget {
  background: #f7ddd5;
  box-shadow: 0 0 0 1px #eec2b6;
}

.over-budget-text {
  color: #b45e4b;
  font-weight: 750;
}

.receipt-drop-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  color: #34564b;
  background: #eff4ef;
  border: 1px dashed #adc1b4;
  border-radius: 0.65rem;
  text-decoration: none;
  transition:
    border-color 120ms ease,
    background 120ms ease;
}

.receipt-drop-card:hover {
  color: #173a31;
  background: #e6efe7;
  border-color: #6f9480;
}

.receipt-drop-card > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.receipt-drop-card strong {
  font-size: 0.84rem;
}

.receipt-drop-card small {
  overflow: hidden;
  color: #819087;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-drop-icon {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: #496e5d;
  border-radius: 0.55rem;
  font-size: 1.15rem;
}

.compact-transactions {
  display: grid;
}

.compact-transaction {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.68rem 0;
  color: #273b35;
  border-bottom: 1px solid #eef0ec;
  text-decoration: none;
}

.compact-transaction:last-child {
  border-bottom: 0;
}

.compact-transaction:hover {
  color: #173a31;
}

.transaction-monogram {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  color: #526c61;
  background: #edf1ed;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
}

.compact-transaction-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.compact-transaction-copy strong,
.compact-transaction-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-transaction-copy strong {
  font-size: 0.78rem;
}

.compact-transaction-copy small {
  color: #8b9590;
  font-size: 0.68rem;
}

.compact-transaction-copy em {
  color: #b0674c;
  font-style: normal;
}

.transaction-amount {
  color: #263a34;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.budget-empty-compact {
  display: grid;
  min-height: 15rem;
  place-items: center;
  align-content: center;
  padding: 2rem;
  color: #6f7f78;
  text-align: center;
}

.budget-empty-compact > span {
  color: #789686;
  font-size: 2rem;
}

.budget-empty-compact h2,
.budget-empty-compact h3 {
  margin: 0.65rem 0 0.35rem;
  color: #30463f;
  font-size: 1rem;
}

.budget-empty-compact p {
  max-width: 32rem;
  margin: 0 0 1rem;
  font-size: 0.82rem;
}

.quick-entry-modal {
  border: 0;
  border-radius: 0.9rem;
  box-shadow: 0 2rem 5rem rgb(20 45 38 / 25%);
}

.quick-entry-modal .modal-header,
.quick-entry-modal .modal-footer {
  padding: 1.2rem 1.4rem;
  border-color: #e8eae5;
}

.quick-entry-modal .modal-body {
  padding: 1.4rem;
}

.quick-entry-modal label,
.budget-form-panel label,
.upload-controls label,
.simplefin-connect-form label {
  display: block;
  margin-bottom: 0.35rem;
  color: #586962;
  font-size: 0.72rem;
  font-weight: 750;
}

.quick-entry-modal input:not([type="hidden"]),
.quick-entry-modal select,
.budget-form-panel input:not([type="hidden"], [type="checkbox"], [type="color"]),
.budget-form-panel select,
.budget-form-panel textarea,
.transaction-filters input,
.transaction-filters select,
.upload-controls select,
.simplefin-connect-form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  color: #263b34;
  background: #fbfcfa;
  border: 1px solid #cfd6d0;
  border-radius: 0.5rem;
}

.quick-entry-modal input:focus,
.quick-entry-modal select:focus,
.budget-form-panel input:focus,
.budget-form-panel select:focus,
.budget-form-panel textarea:focus,
.transaction-filters input:focus,
.transaction-filters select:focus,
.upload-controls select:focus,
.simplefin-connect-form textarea:focus {
  background: #fff;
  border-color: #4f806a;
  box-shadow: 0 0 0 0.2rem rgb(52 108 84 / 12%);
  outline: 0;
}

.money-input-wrap {
  position: relative;
  display: block;
}

.money-input-wrap > span {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  z-index: 1;
  color: #78867f;
  transform: translateY(-50%);
}

.money-input-wrap input {
  padding-left: 1.7rem !important;
}

.budget-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.4rem;
}

.budget-page-heading h1 {
  color: #203a32;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
}

.budget-page-heading p {
  max-width: 42rem;
  margin: 0.45rem 0 0;
  color: #748079;
  font-size: 0.9rem;
}

.transaction-filters {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.transaction-filters input,
.transaction-filters select {
  height: 2.5rem;
  font-size: 0.82rem;
}

.filter-search {
  position: relative;
  min-width: 13rem;
  flex: 1;
}

.filter-search span {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  z-index: 1;
  color: #849089;
  transform: translateY(-50%);
}

.filter-search input {
  padding-left: 2rem;
}

.transaction-table-wrap {
  max-width: calc(100% + 2.7rem);
  overflow-x: auto;
  margin: 0 -1.35rem;
}

.budget-transaction-table {
  width: 100%;
  border-collapse: collapse;
}

.budget-transaction-table th,
.budget-transaction-table td {
  padding: 0.8rem 1rem;
  border-top: 1px solid #eceee9;
  vertical-align: middle;
}

.budget-transaction-table th {
  color: #859089;
  background: #fafbf8;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.budget-transaction-table td {
  color: #43544e;
  font-size: 0.78rem;
}

.transaction-review-row {
  background: #fffcf8;
}

.transaction-date {
  color: #7d8983 !important;
  white-space: nowrap;
}

.transaction-title-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 15rem;
}

.transaction-title-cell > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.transaction-title-cell strong,
.transaction-title-cell small {
  overflow: hidden;
  max-width: 24rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-title-cell strong {
  color: #2e413b;
  font-size: 0.8rem;
}

.transaction-title-cell small {
  color: #909a95;
  font-size: 0.68rem;
}

.source-label {
  color: #67766f;
  background: #eff1ee;
}

.review-flag {
  min-height: 2.75rem;
  color: #9b543d;
  background: #fcebe4;
  border: 0;
  cursor: pointer;
}

.review-complete {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: 0.25rem 0.65rem;
  color: #4d7562;
  background: #e7f1eb;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.transaction-category-controls,
.inline-category-form {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.4rem;
}

.plan-category,
.category-list-row > span:nth-child(2),
.rule-copy,
.transaction-category,
.document-copy,
.settings-card-main {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quick-category-select {
  width: auto;
  min-width: 0;
  min-height: 2.75rem;
  max-width: 12rem;
  padding: 0.35rem 1.8rem 0.35rem 0.55rem;
  color: #435b51;
  background-color: #f1f4f0;
  border: 1px solid #d8ded8;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.quick-category-select:hover,
.quick-category-select:focus {
  background-color: #fff;
  border-color: #7ea08b;
}

.quick-category-select.uncategorized {
  color: #a75b42;
  background-color: #fff8f4;
  border-color: #e2b8aa;
}

.uncategorized-link {
  padding-bottom: 0.1rem;
  color: #a75b42;
  border-bottom: 1px dashed #cf9b88;
  font-weight: 700;
  text-decoration: none;
}

.icon-link {
  display: inline-flex;
  min-width: 2.75rem;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  color: #718078;
  background: none;
  border: 0;
  font-weight: 800;
  text-decoration: none;
}

.edit-action-text {
  display: none;
}

.icon-link.danger {
  color: #ad6351;
  font-size: 1.35rem;
}

.table-limit-note {
  margin: 1rem 0 0;
  color: #89938e;
  font-size: 0.7rem;
  text-align: center;
}

.budget-form-panel {
  padding: clamp(1.3rem, 4vw, 2rem);
}

.budget-form-panel label small {
  color: #9aa39e;
  font-weight: 500;
}

.budget-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid #e9ebe6;
}

.form-stack {
  display: grid;
  gap: 1.2rem;
}

.form-check {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
}

.form-check input {
  width: 1rem !important;
  height: 1rem;
}

.errorlist {
  margin: 0.35rem 0 0;
  padding: 0;
  color: #a74f3d;
  font-size: 0.72rem;
  list-style: none;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  color: #714438;
  background: #fff8f5;
  border: 1px solid #eed9d1;
  border-radius: 0.7rem;
}

.danger-zone p {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
}

.plan-panel {
  padding: 0;
  overflow: hidden;
}

.plan-state-note {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  color: #5f6f67;
  background: #f3f6f2;
  border: 1px solid #dfe6df;
  border-radius: 0.65rem;
  font-size: 0.76rem;
}

.plan-state-note strong {
  color: #365247;
}

.plan-state-note.inherited {
  color: #705d42;
  background: #fbf7ee;
  border-color: #eadfc7;
}

.plan-state-note.inherited strong {
  color: #675033;
}

.plan-table-heading,
.plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 11rem;
  align-items: center;
  gap: 1rem;
}

.plan-table-heading {
  padding: 0.85rem 1.3rem;
  color: #829089;
  background: #fafbf8;
  border-bottom: 1px solid #e5e8e2;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.plan-table-heading span:last-child {
  text-align: right;
}

.plan-row {
  margin: 0;
  padding: 0.7rem 1.3rem;
  border-bottom: 1px solid #eef0ec;
}

.plan-row:hover {
  background: #fbfcfa;
}

.plan-category {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #344942;
  font-size: 0.82rem;
  font-weight: 650;
}

.plan-money {
  width: 11rem;
}

.plan-money input {
  width: 100%;
  padding: 0.55rem 0.7rem 0.55rem 1.65rem;
  text-align: right;
  background: #fbfcfa;
  border: 1px solid #d2d8d2;
  border-radius: 0.45rem;
  font-variant-numeric: tabular-nums;
}

.plan-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  background: #fafbf8;
}

.plan-footer p {
  margin: 0;
  color: #87918c;
  font-size: 0.73rem;
}

.category-columns {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  align-items: start;
  gap: 1.2rem;
}

.count-badge {
  display: grid;
  min-width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  color: #567065;
  background: #edf2ed;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
}

.category-list {
  display: grid;
  margin: 0 -0.4rem;
}

.category-list-row {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.4rem;
  color: #344942;
  border-bottom: 1px solid #eff0ec;
  font-size: 0.8rem;
  font-weight: 650;
  text-decoration: none;
}

.category-list-row:last-child {
  border-bottom: 0;
}

.category-list-row:hover {
  color: #173a31;
  background: #fafbf8;
}

.color-field input[type="color"] {
  width: 4rem;
  height: 2.6rem;
  padding: 0.2rem;
  background: #fff;
  border: 1px solid #cfd6d0;
  border-radius: 0.5rem;
}

.rule-list {
  display: grid;
}

.rule-row {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #eceeea;
}

.rule-row:last-child {
  border-bottom: 0;
}

.rule-disabled {
  opacity: 0.58;
}

.rule-priority {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: #687a71;
  background: #eef1ed;
  border-radius: 0.45rem;
  font-size: 0.7rem;
  font-weight: 800;
}

.rule-copy strong {
  color: #30443e;
  font-size: 0.85rem;
}

.rule-copy p {
  margin: 0.35rem 0 0;
  color: #75817b;
  font-size: 0.76rem;
}

.rule-copy mark {
  padding: 0.1rem 0.3rem;
  color: #405a50;
  background: #edf3ee;
  border-radius: 0.25rem;
}

.status-chip {
  margin-left: 0.35rem;
  color: #777;
  background: #eee;
}

.reference-intro {
  margin: -0.4rem 0 1rem;
  color: #7b8781;
  font-size: 0.76rem;
}

.correction-list {
  display: grid;
}

.correction-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) auto minmax(8rem, 0.7fr) auto auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #eceeea;
  font-size: 0.76rem;
}

.correction-row:last-child {
  border-bottom: 0;
}

.correction-row code {
  overflow: hidden;
  color: #3e574d;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.correction-row small {
  color: #8b958f;
  white-space: nowrap;
}

.upload-panel {
  padding: 0;
  overflow: hidden;
}

.upload-drop-zone {
  position: relative;
  display: grid;
  min-height: 14rem;
  place-items: center;
  align-content: center;
  padding: 2rem;
  color: #718078;
  background: #f9fbf8;
  border: 2px dashed #c5d1c8;
  border-radius: 0.85rem 0.85rem 0 0;
  text-align: center;
}

.upload-drop-zone:hover {
  background: #f1f6f1;
  border-color: #7ea08b;
}

.upload-large-icon {
  display: grid;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.7rem;
  place-items: center;
  color: #fff;
  background: #496e5d;
  border-radius: 0.8rem;
  font-size: 1.4rem;
}

.upload-drop-zone h2 {
  margin: 0;
  color: #324940;
  font-size: 1rem;
}

.upload-drop-zone p {
  margin: 0.35rem 0 0;
  font-size: 0.76rem;
}

.upload-drop-zone .selected-upload-name {
  display: inline-block;
  max-width: min(32rem, 90vw);
  margin-top: 0.85rem;
  padding: 0.35rem 0.7rem;
  overflow: hidden;
  color: #7c8982;
  background: #edf1ed;
  border-radius: 999px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-drop-zone .selected-upload-name.has-file {
  color: #315346;
  background: #dfece3;
}

.upload-drop-zone input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: pointer;
  inset: 0;
  opacity: 0;
}

.upload-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.upload-controls > div {
  min-width: 17rem;
}

.document-list {
  display: grid;
}

.document-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid #eceee9;
}

.document-row:last-child {
  border-bottom: 0;
}

.document-icon,
.settings-card-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #4d6a5e;
  background: #ebf0eb;
  border-radius: 0.55rem;
}

.document-icon {
  width: 2.3rem;
  height: 2.3rem;
}

.document-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.document-copy a {
  overflow: hidden;
  color: #30463e;
  font-size: 0.8rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-copy small {
  color: #8a948f;
  font-size: 0.68rem;
}

.document-error {
  margin: 0.2rem 0 0;
  color: #a55845;
  font-size: 0.68rem;
}

.document-status {
  color: #5d6d65;
  background: #edf0ed;
  text-decoration: none;
}

a.document-status:hover {
  color: #71392d;
  box-shadow: 0 0 0 2px rgb(147 78 61 / 12%);
}

.status-complete {
  color: #397056;
  background: #e3f1e8;
}

.status-processing,
.status-pending {
  color: #745939;
  background: #f7eddd;
}

.status-failed,
.status-needs_review {
  color: #934e3d;
  background: #f9e7e1;
}

.settings-stack {
  display: grid;
  gap: 1.2rem;
}

.settings-card {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  padding: 1.5rem;
}

.settings-card-icon {
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.1rem;
  font-weight: 800;
}

.openai-mark {
  color: #fff;
  background: #2f5a4b;
}

.simplefin-mark {
  color: #fff;
  background: #47788b;
}

.settings-card-main {
  min-width: 0;
  flex: 1;
}

.settings-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.settings-card-heading h2 {
  margin: 0;
  color: #2d433b;
  font-size: 1rem;
}

.settings-card-heading p {
  margin: 0.3rem 0 0;
  color: #7b8781;
  font-size: 0.78rem;
}

.connection-badge {
  color: #6c7771;
  background: #eff1ef;
}

.connection-badge.connected {
  color: #326b50;
  background: #e4f2e9;
}

.connection-badge.attention {
  color: #9b573f;
  background: #f9e9e3;
}

.connection-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-top: 1.2rem;
  padding: 0.9rem 1rem;
  background: #f8faf7;
  border-radius: 0.6rem;
}

.connection-details > span {
  display: flex;
  min-width: 8rem;
  flex-direction: column;
}

.connection-details small {
  color: #8a9690;
  font-size: 0.65rem;
  font-weight: 750;
  text-transform: uppercase;
}

.connection-details strong {
  margin-top: 0.15rem;
  color: #3c5149;
  font-size: 0.76rem;
}

.connection-error strong {
  color: #9a523e;
}

.connected-account-list {
  display: grid;
  margin-top: 0.8rem;
  border: 1px solid #e6e9e4;
  border-radius: 0.6rem;
}

.connected-account-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #eceeea;
  font-size: 0.78rem;
}

.connected-account-list > div:last-child {
  border-bottom: 0;
}

.connected-account-list span {
  display: flex;
  flex-direction: column;
}

.connected-account-list small {
  color: #8b9690;
  font-size: 0.67rem;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.simplefin-steps {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.5rem 0.7rem;
  margin: 1.1rem 0;
}

.simplefin-steps > span {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  color: #fff;
  background: #547667;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 800;
}

.simplefin-steps p {
  margin: 0.1rem 0 0;
  color: #68766f;
  font-size: 0.76rem;
}

.simplefin-connect-form {
  display: grid;
  gap: 0.65rem;
}

.simplefin-connect-form button {
  justify-self: start;
}

.settings-note {
  margin-top: 1rem;
  padding: 0.8rem 0.9rem;
  color: #705344;
  background: #fff5ed;
  border: 1px solid #f0d9c8;
  border-radius: 0.55rem;
  font-size: 0.75rem;
}

@media (max-width: 991.98px) {
  .budget-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .budget-hero-actions {
    width: 100%;
    flex-wrap: wrap;
  }

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

  .budget-content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .budget-chart-panel {
    min-height: auto;
  }
}

@media (max-width: 767.98px) {
  .budget-shell {
    padding-bottom: 3rem;
  }

  .budget-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    overflow: visible;
    padding-top: 0.8rem;
  }

  .budget-tabs a {
    min-width: 0;
    justify-content: center;
    padding: 0.6rem 0.35rem;
    text-align: center;
  }

  .budget-shell .container-xl,
  .budget-page-heading > *,
  .budget-panel-heading > *,
  .budget-bar-row,
  .receipt-drop-card > *,
  .compact-transaction > * {
    min-width: 0;
  }

  .budget-shell :where(
    input:not([type="hidden"], [type="checkbox"], [type="radio"], [type="color"]),
    select,
    textarea
  ) {
    font-size: 1rem;
  }

  .budget-shell .btn:not(.btn-close),
  .app-navbar .navbar-toggler {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .quick-entry-modal .btn-close {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0.75rem;
  }

  .budget-page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .transaction-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .transaction-filters input,
  .transaction-filters select {
    height: 2.75rem;
    font-size: 1rem;
  }

  .filter-search {
    min-width: 0;
  }

  .transaction-table-wrap {
    max-width: 100%;
    overflow: visible;
    margin: 0;
  }

  .budget-transaction-table,
  .budget-transaction-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .budget-transaction-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    margin: -1px;
    border: 0;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .budget-transaction-table tbody {
    display: grid;
    gap: 0.75rem;
  }

  .budget-transaction-table tr {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e5df;
    border-radius: 0.7rem;
    box-shadow: 0 0.25rem 0.8rem rgb(30 52 45 / 4%);
  }

  .budget-transaction-table tr.transaction-review-row {
    background: #fffcf8;
    border-color: #eddfd2;
  }

  .budget-transaction-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .budget-transaction-table td::before {
    display: block;
    margin-bottom: 0.3rem;
    color: #8a948f;
    content: attr(data-label);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .budget-transaction-table td[colspan] {
    grid-column: 1 / -1;
  }

  .budget-transaction-table td[colspan]::before,
  .transaction-actions-cell::before {
    display: none;
  }

  .transaction-description-cell {
    grid-column: 1;
    grid-row: 1;
  }

  .budget-transaction-table .transaction-amount {
    grid-column: 2;
    grid-row: 1;
  }

  .budget-transaction-table .transaction-date {
    grid-column: 1;
    grid-row: 2;
  }

  .transaction-source-cell {
    grid-column: 2;
    grid-row: 2;
  }

  .transaction-category-cell,
  .transaction-actions-cell {
    grid-column: 1 / -1;
  }

  .transaction-category-cell {
    grid-row: 3;
  }

  .transaction-actions-cell {
    grid-row: 4;
    padding-top: 0.2rem !important;
  }

  .transaction-title-cell {
    min-width: 0;
  }

  .transaction-title-cell strong,
  .transaction-title-cell small {
    max-width: none;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .transaction-category-controls {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
  }

  .inline-category-form {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .quick-category-select {
    width: 100%;
    max-width: 100%;
    font-size: 1rem;
  }

  .review-flag,
  .review-complete {
    min-height: 2.75rem;
    font-size: 0.78rem;
  }

  .review-noscript-form {
    grid-column: 1 / -1;
  }

  .transaction-edit-link {
    width: 100%;
    gap: 0.45rem;
    color: #425e52;
    border: 1px solid #cfd8d1;
    border-radius: 0.5rem;
    font-weight: 750;
  }

  .transaction-edit-link:hover,
  .transaction-edit-link:focus-visible {
    color: #173a31;
    background: #f4f7f4;
    border-color: #91a89a;
  }

  .edit-action-icon {
    display: none;
  }

  .edit-action-text {
    display: inline;
  }

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

  .document-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .document-status {
    grid-column: 2;
    grid-row: 2;
  }

  .document-row form {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 575.98px) {
  .budget-hero {
    margin-right: -0.2rem;
    margin-left: -0.2rem;
    border-radius: 0.8rem;
  }

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

  .budget-hero-actions .month-switcher {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .budget-hero-actions form,
  .budget-action-button {
    width: 100%;
  }

  .budget-summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .budget-stat {
    min-height: 7.5rem;
    padding: 0.85rem;
  }

  .budget-stat > strong {
    font-size: 1.45rem;
  }

  .budget-panel {
    padding: 1rem;
  }

  .transaction-table-wrap {
    margin: 0;
  }

  .plan-table-heading,
  .plan-row {
    grid-template-columns: minmax(0, 1fr) 8.5rem;
  }

  .plan-money {
    width: 8.5rem;
  }

  .plan-footer,
  .upload-controls,
  .settings-card {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-controls > div {
    min-width: 0;
  }

  .rule-row {
    grid-template-columns: 2rem minmax(0, 1fr);
  }

  .correction-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .correction-row > span[aria-hidden="true"] {
    display: none;
  }

  .rule-row > .btn {
    grid-column: 2;
    justify-self: start;
  }

  .settings-card-heading,
  .danger-zone {
    align-items: flex-start;
    flex-direction: column;
  }
}
