:root {
  color-scheme: light;
  font-family:
    -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR",
    "Segoe UI", sans-serif;
  color: #152138;
  background: #f5f7fb;
  font-synthesis: none;
  --navy: #173b78;
  --blue: #2864d7;
  --blue-soft: #edf3ff;
  --ink: #152138;
  --muted: #69758a;
  --line: #dce2ed;
  --danger: #c0363f;
  --danger-soft: #fff1f2;
  --success: #137356;
  --success-soft: #eaf8f2;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: pan-x pan-y;
  background:
    radial-gradient(circle at 90% -10%, rgb(40 100 215 / 10%), transparent 32rem), #f5f7fb;
  background-attachment: fixed;
  scrollbar-gutter: stable;
  scrollbar-color: rgb(105 117 138 / 42%) transparent;
}

/* App-like, viewport-fixed mobile entry and review screens. */
@media (max-width: 599px) {
  .page-shell.records-page {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  body.fixed-mobile-page {
    --mobile-install-footer-clearance: 44px;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.fixed-mobile-page .page-shell {
    display: flex;
    height: 100dvh;
    min-height: 0;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    flex-direction: column;
  }

  body.fixed-mobile-page .mobile-install-hint,
  body.records-calendar-active .mobile-install-hint {
    display: none;
  }

  body.fixed-mobile-page :is(.app-header) {
    position: relative;
    top: auto;
    flex: 0 0 auto;
    margin-bottom: 12px;
  }

  body.fixed-mobile-page .intro {
    flex: 0 0 auto;
  }

  body.fixed-mobile-page .compact-page .expense-intro {
    margin-bottom: 10px;
  }

  body.fixed-mobile-page .compact-page .expense-form-card {
    min-height: 0;
    padding: 12px 14px;
  }

  body.fixed-mobile-page .compact-page .field-group {
    margin-bottom: 9px;
  }

  body.fixed-mobile-page .compact-page .expense-form-card input,
  body.fixed-mobile-page .compact-page .expense-form-card .app-control-trigger {
    height: 46px;
  }

  body.fixed-mobile-page .compact-page .primary-button {
    min-height: 46px;
  }

  body.fixed-mobile-page .review-intro {
    margin-bottom: 12px;
  }

  body.fixed-mobile-page .review-intro .eyebrow {
    margin-bottom: 6px;
  }

  body.fixed-mobile-page .review-intro h1 {
    font-size: clamp(20px, 5.8vw, 24px);
  }

  body.fixed-mobile-page .review-intro .intro-copy {
    margin-top: 7px;
    font-size: 12px;
    line-height: 1.4;
  }

  body.fixed-mobile-page .review-section {
    min-height: 0;
    flex: 1 1 auto;
  }

  body.fixed-mobile-page .review-section .connection-section-heading {
    margin-bottom: 8px;
  }

  body.fixed-mobile-page .review-section .connection-section-heading .eyebrow {
    display: none;
  }

  body.fixed-mobile-page .review-section .connection-section-heading h2 {
    font-size: 20px;
  }

  body.fixed-mobile-page .review-page-status {
    margin-bottom: 7px;
    padding: 8px 10px;
    font-size: 11px;
  }

  body.fixed-mobile-page .review-progress {
    margin-bottom: 7px;
    font-size: 10px;
  }

  body.fixed-mobile-page .review-card {
    padding: 12px;
  }

  body.fixed-mobile-page .review-instruction {
    margin-bottom: 7px;
    font-size: 10px;
  }

  body.fixed-mobile-page .review-swipe-zone {
    height: min(184px, 29dvh);
    min-height: 142px;
  }

  body.fixed-mobile-page .review-card-actions {
    margin-top: 6px;
  }

  body.fixed-mobile-page .review-empty-state {
    padding: 24px 14px;
  }

  body.records-calendar-active {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.records-calendar-active .records-page {
    display: flex;
    height: 100dvh;
    min-height: 0;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-right: max(6px, env(safe-area-inset-right));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    padding-left: max(6px, env(safe-area-inset-left));
    flex-direction: column;
  }

  .records-page > :is(.app-header) {
    position: sticky;
    top: 0;
    flex: 0 0 auto;
    margin-bottom: 10px;
  }

  .records-page > .records-intro {
    margin: 0 2px 7px;
  }

  .records-page > .records-intro .eyebrow {
    margin: 0;
  }

  body.records-calendar-active .records-intro {
    display: block;
    flex: 0 0 auto;
  }

  body.records-calendar-active .records-section {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
  }

  body.records-calendar-active .records-section > .connection-section-heading {
    flex: 0 0 auto;
    margin-bottom: 8px;
  }

  body.records-calendar-active .records-section > .records-filters {
    flex: 0 0 auto;
    margin-bottom: 8px;
    padding: 7px;
  }

  body.records-calendar-active .records-filter-field .app-control-trigger,
  body.records-calendar-active .records-multiselect-trigger,
  body.records-calendar-active .records-filter-reset {
    height: 36px;
  }

  body.records-calendar-active .records-calendar {
    display: flex;
    min-height: 0;
    padding: 7px 4px;
    flex: 1 1 auto;
    flex-direction: column;
    border-radius: 16px;
  }

  body.records-calendar-active .records-calendar-header {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    flex: 0 0 auto;
    margin-bottom: 6px;
  }

  body.records-calendar-active .records-calendar-summary {
    min-height: 26px;
    margin-bottom: 5px;
  }

  body.records-calendar-active .records-calendar-header button {
    width: 34px;
    height: 31px;
  }

  body.records-calendar-active .records-calendar-header strong {
    font-size: 15px;
  }

  body.records-calendar-active .records-calendar-weekdays {
    flex: 0 0 auto;
    margin-bottom: 3px;
    font-size: 9px;
  }

  body.records-calendar-active .records-calendar-grid {
    min-height: 0;
    flex: 1 1 auto;
    grid-template-rows: repeat(6, minmax(0, 1fr));
    gap: 2px;
  }

  body.records-calendar-active .records-calendar-day {
    min-height: 0;
    padding: 5px 1px;
    gap: 4px;
    border-radius: 8px;
  }

  body.records-calendar-active .records-calendar-day-number {
    font-size: 10px;
  }

  body.records-calendar-active .records-calendar-day-total {
    align-self: center;
    font-size: clamp(7px, 2.3vw, 10px);
  }

  .records-calendar-day-dialog {
    width: calc(100% - 18px);
    max-height: calc(100dvh - 18px);
    margin: auto auto 9px;
    border-radius: 20px;
  }

  .records-calendar-day-panel {
    max-height: calc(100dvh - 18px);
    padding: 17px 14px max(14px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 599px) and (max-height: 650px) {
  body.fixed-mobile-page .review-intro .intro-copy,
  body.fixed-mobile-page .compact-page .intro-copy {
    display: none;
  }

  body.fixed-mobile-page .review-swipe-zone {
    height: min(154px, 27dvh);
    min-height: 122px;
  }

  body.fixed-mobile-page .review-expense-block {
    padding: 10px;
  }

  body.fixed-mobile-page .review-expense-block small {
    margin-bottom: 5px;
  }

  body.fixed-mobile-page .review-expense-block span {
    margin-top: 5px;
  }
}

/* Per-asset family permissions */
.financial-access-section {
  display: grid;
  gap: 16px;
}

.financial-add-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.financial-security-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid #cfe0f7;
  border-radius: 16px;
  color: #24466f;
  background: #f2f7fd;
}

.financial-security-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.financial-security-note strong {
  display: block;
  color: #17385f;
}

.financial-access-list,
.financial-permission-members {
  display: grid;
  gap: 12px;
}

.financial-access-item {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.financial-access-item-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.financial-access-item-heading h3 {
  display: inline;
  margin: 0 8px 0 0;
  font-size: 18px;
}

.financial-asset-kind,
.financial-asset-masked,
.financial-permission-identity span {
  color: #71809a;
  font-size: 12px;
}

.financial-asset-kind {
  display: block;
  margin-bottom: 5px;
  color: #315e9e;
  font-weight: 800;
}

.financial-service-tier {
  display: inline-flex;
  margin-top: 9px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.financial-service-tier.basic {
  color: #74530a;
  background: #fff4cf;
}

.financial-service-tier.premium {
  color: #315e9e;
  background: #edf4ff;
}

.financial-asset-actions,
.financial-asset-rename-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.financial-asset-actions {
  flex-shrink: 0;
}

.financial-asset-rename-form {
  padding: 12px;
  border: 1px solid #dce4f0;
  border-radius: 14px;
  background: #f8fafc;
}

.financial-asset-rename-form input {
  min-width: 0;
  flex: 1;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #cbd7e8;
  border-radius: 10px;
  background: #fff;
}

.financial-owner-help,
.financial-permission-empty,
.financial-access-empty {
  margin: 0;
  color: #63738f;
  font-size: 13px;
  line-height: 1.5;
}

.financial-access-empty {
  padding: 20px;
}

.financial-permission-member {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(330px, 1.6fr);
  gap: 16px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #e8edf5;
}

.financial-permission-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.financial-permission-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.financial-permission-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.financial-permission-toggle {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #dce4f0;
  border-radius: 12px;
  color: #33445f;
  background: #f8fafc;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.financial-permission-toggle:has(input:checked) {
  border-color: #9db9e2;
  color: #173f7c;
  background: #edf4ff;
}

.financial-permission-toggle input {
  inline-size: 18px;
  block-size: 18px;
  margin: 0;
  accent-color: #1f4b8f;
}

.financial-shared-permissions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.financial-permission-badge {
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.financial-permission-badge.enabled {
  color: #17643a;
  background: #e9f7ef;
}

.financial-permission-badge.disabled {
  color: #7b879b;
  background: #eef1f5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .financial-access-section .connection-section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: flex-start;
  }

  .financial-add-link {
    width: 100%;
    min-height: 36px;
    padding: 8px 11px;
    font-size: 12px;
  }

  .financial-access-item {
    padding: 16px;
  }

  .financial-access-item-heading,
  .financial-asset-rename-form {
    align-items: stretch;
    flex-direction: column;
  }

  .financial-asset-actions > :is(button),
  .financial-asset-rename-form > :is(button) {
    flex: 1;
  }

  .financial-permission-member {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .financial-permission-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .financial-permission-toggle {
    justify-content: space-between;
  }
}

/* AI insights */
.ai-insights-page {
  padding-bottom: 72px;
}

.ai-insights-intro {
  padding-bottom: 30px;
}

.card.insight-card,
.card.ai-briefing-card {
  margin-top: 22px;
  border: 1px solid #dfe6f2;
  border-radius: 26px;
}

.insight-card-heading,
.ai-briefing-topline,
.ai-briefing-action,
.latest-ai-report-heading,
.reduction-list article > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.insight-card-heading h2,
.ai-briefing-topline h2 {
  margin: 4px 0 0;
  color: #11213b;
  font-size: clamp(1.2rem, 3vw, 1.72rem);
}

.insight-card-heading p,
.ai-briefing-topline p {
  color: #6c7c96;
  line-height: 1.65;
}

.insight-card {
  padding: clamp(22px, 3vw, 32px);
}

.insight-card-heading p {
  margin: 7px 0 0;
}

.ai-quota-track {
  height: 8px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9edf5;
}

.ai-quota-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2a64d7, #5591f2);
  transition: width 700ms ease;
}

.insight-lead {
  display: block;
  margin-top: 20px;
  color: #234b91;
  font-size: 1.05rem;
}

.trend-driver-list {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.trend-driver-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding: 10px 11px;
  border-radius: 12px;
  background: #f5f8fd;
}

.trend-driver-list article strong {
  overflow: hidden;
  color: #1d345b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-driver-list article > span {
  color: #cd4f4f;
  font-size: 0.8rem;
  font-weight: 850;
}

.trend-driver-list article > span.decreased {
  color: #237b61;
}

.trend-driver-list article small {
  grid-column: 1 / -1;
  color: #78869c;
  font-size: 0.7rem;
}

.trend-driver-list .insight-empty {
  margin-top: 0;
  padding: 12px;
  font-size: 0.76rem;
}

.ranked-insight-list {
  display: grid;
  gap: 4px;
  margin-top: 16px;
}

.ranked-insight-list article {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid #edf0f5;
}

.ranked-insight-list article:last-child {
  border-bottom: 0;
}

.ranked-insight-list article > span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  color: #2864d7;
  background: #edf3ff;
  font-size: 0.78rem;
  font-weight: 900;
}

.ranked-insight-list div,
.ranked-insight-list div strong,
.ranked-insight-list div small {
  display: block;
  min-width: 0;
}

.ranked-insight-list div strong {
  overflow: hidden;
  color: #172946;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranked-insight-list div small {
  margin-top: 4px;
  color: #7b889d;
}

.ranked-insight-list article > strong {
  color: #233b63;
  font-size: 0.88rem;
}

.reduction-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.reduction-list article {
  padding: 18px;
  border: 1px solid #f0dfc3;
  border-radius: 17px;
  background: #fffaf2;
}

.reduction-list article > div strong {
  color: #4a3518;
}

.reduction-list article > div span {
  flex: none;
  padding: 5px 8px;
  border-radius: 999px;
  color: #8c5b12;
  background: #ffebc6;
  font-size: 0.72rem;
  font-weight: 900;
}

.reduction-list p {
  margin: 13px 0 9px;
  color: #6b573a;
  line-height: 1.55;
}

.reduction-list small {
  color: #907b5c;
}

.insight-empty {
  margin: 18px 0 0;
  padding: 18px;
  border-radius: 15px;
  color: #78869b;
  background: #f7f9fc;
  text-align: center;
}

.card.ai-briefing-card {
  padding: clamp(24px, 4vw, 38px);
  color: #edf4ff;
  border-color: #1c3c72;
  background:
    radial-gradient(circle at 100% 0%, rgba(67, 133, 244, 0.38), transparent 36%),
    linear-gradient(145deg, #102849 0%, #122f5c 100%);
  box-shadow: 0 20px 50px rgba(20, 48, 92, 0.18);
}

.ai-briefing-card .eyebrow {
  color: #82b1ff;
}

.ai-briefing-topline h2 {
  color: #ffffff;
}

.ai-briefing-topline p {
  max-width: 620px;
  margin: 8px 0 0;
  color: #b9c9e1;
}

.ai-quota-summary {
  flex: none;
  text-align: right;
}

.ai-quota-summary strong,
.ai-quota-summary span {
  display: block;
}

.ai-quota-summary span {
  margin-top: 4px;
  color: #9fb6d6;
  font-size: 0.82rem;
}

.ai-quota-track {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.14);
}

.ai-quota-track span {
  background: linear-gradient(90deg, #64d8b0, #73a8ff);
}

.ai-briefing-privacy {
  margin: 14px 0 0;
  color: #9fb3d0;
  font-size: 0.8rem;
  line-height: 1.65;
}

.ai-briefing-action {
  align-items: center;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.ai-briefing-action > span {
  color: #c8d6e9;
  font-size: 0.88rem;
}

.ai-briefing-action button {
  flex: none;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  color: #102849;
  background: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.ai-briefing-action button:disabled {
  color: #7f91aa;
  background: #dce4ef;
  cursor: not-allowed;
}

.ai-briefing-card > .form-status {
  margin-top: 14px;
}

.latest-ai-report {
  margin-top: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #edf4ff;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  filter: none;
  backdrop-filter: none;
}

.latest-ai-report-heading {
  align-items: center;
}

.ai-report-title-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.ai-report-symbol {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
  background: #2864d7;
  box-shadow: 0 8px 18px rgb(40 100 215 / 24%);
  font-size: 1.15rem;
}

.latest-ai-report-heading span {
  color: #2864d7;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.latest-ai-report-heading .ai-report-symbol {
  color: #ffffff;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.latest-ai-report-heading h3 {
  margin: 5px 0 0;
  color: #ffffff;
  font-size: clamp(1.16rem, 2.8vw, 1.46rem);
  line-height: 1.35;
}

.ai-briefing-card .ai-report-title-lockup > div > span {
  color: #8fbcff;
}

.latest-ai-report-heading small {
  flex: none;
  padding: 7px 10px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  color: #d9e6f7;
  background: rgb(255 255 255 / 10%);
  font-size: 0.74rem;
  font-weight: 700;
}

.ai-report-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  margin-top: 24px;
}

.ai-report-stage {
  min-width: 0;
  padding: clamp(18px, 2.8vw, 25px);
  border: 1px solid #dce5f0;
  border-radius: 20px;
  color: #162844;
  background: #f8fafc;
}

.previous-month-report {
  border-top: 4px solid #e59a35;
  background: #fffbf5;
}

.current-month-report {
  border-color: #c9daf6;
  border-top: 4px solid #2864d7;
  background: #f5f8ff;
}

.ai-period-report-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.ai-stage-number {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: #ffffff;
  background: #173b78;
  font-size: 0.9rem;
  font-weight: 900;
}

.previous-month-report .ai-stage-number {
  background: #bd6d13;
}

.current-month-report .ai-stage-number {
  background: #2864d7;
}

.ai-stage-title span,
.ai-action-board-heading > div > span {
  color: #5e6f86;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.ai-stage-title h4,
.ai-action-board-heading h4 {
  margin: 3px 0 0;
  color: #11213b;
  font-size: 1.03rem;
  line-height: 1.35;
}

.ai-period-report-heading > strong {
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  color: #8a561d;
  background: #fff0d8;
  font-size: 0.7rem;
  white-space: nowrap;
}

.current-month-report .ai-period-report-heading > strong {
  color: #2158ba;
  background: #e4edff;
}

.ai-stage-summary {
  margin: 18px 0 20px;
  padding: 15px 16px;
  border: 1px solid #eadcc8;
  border-radius: 15px;
  background: #ffffff;
}

.current-month-report .ai-stage-summary {
  border-color: #d3dff5;
}

.ai-stage-summary > span {
  display: block;
  margin-bottom: 7px;
  color: #9a6425;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.current-month-report .ai-stage-summary > span {
  color: #2864d7;
}

.ai-report-summary {
  margin: 0;
  color: #203451;
  font-size: 0.94rem;
  font-weight: 750;
  line-height: 1.65;
}

.ai-report-stage h5 {
  margin: 0 0 10px;
  color: #415673;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

.ai-stage-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: #6680a6;
}

.ai-stage-connector span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #d4dfed;
  border-radius: 999px;
  background: #ffffff;
  font-size: 1rem;
  font-weight: 900;
}

.ai-stage-connector small {
  width: 60px;
  color: #75869d;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.ai-report-findings {
  display: grid;
  gap: 10px;
}

.ai-report-findings article {
  padding: 14px 15px;
  border: 1px solid #e0e7f0;
  border-left: 4px solid #8ca0bb;
  border-radius: 14px;
  background: #ffffff;
}

.ai-report-findings article[data-tone="warning"] {
  border-left-color: #e38b2d;
}

.ai-report-findings article[data-tone="positive"] {
  border-left-color: #26a079;
}

.ai-finding-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-finding-signal {
  display: grid;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 8px;
  color: #536985;
  background: #edf1f6;
  font-size: 0.76rem;
  font-weight: 900;
}

[data-tone="warning"] .ai-finding-signal {
  color: #9b5b10;
  background: #fff0dc;
}

[data-tone="positive"] .ai-finding-signal {
  color: #087555;
  background: #def5ec;
}

.ai-report-findings strong {
  color: #172b4a;
  font-size: 0.9rem;
  line-height: 1.4;
}

.ai-report-findings p {
  margin: 0;
  line-height: 1.55;
}

.ai-finding-consequence {
  margin-top: 10px !important;
  color: #273e5e;
  font-size: 0.84rem;
  font-weight: 700;
}

.ai-finding-evidence {
  margin-top: 8px !important;
  color: #6d7c91;
  font-size: 0.76rem;
}

.ai-finding-evidence span {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 6px;
  border-radius: 5px;
  color: #55677e;
  background: #eef2f6;
  font-size: 0.65rem;
  font-weight: 900;
}

.ai-report-findings .insight-empty {
  color: #78869b;
  background: #f3f6fa;
}

.ai-action-board {
  margin-top: 18px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid #bae4d5;
  border-radius: 20px;
  background: #f1fbf7;
}

.ai-action-board-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ai-action-board-heading .ai-stage-number {
  background: #138262;
}

.ai-action-board-heading > div > span {
  color: #137356;
}

.ai-action-board-heading p {
  margin: 7px 0 0;
  color: #62768a;
  font-size: 0.8rem;
  line-height: 1.5;
}

.ai-action-plan {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.ai-action-plan > li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 15px;
  border: 1px solid #cee8de;
  border-radius: 15px;
  color: #29466f;
  background: #ffffff;
}

.ai-action-number {
  display: grid;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: #138262;
  font-size: 0.75rem;
  font-weight: 900;
}

.ai-action-plan > li > div {
  min-width: 0;
}

.ai-action-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.ai-action-heading strong {
  color: #163c32;
  font-size: 0.88rem;
  line-height: 1.4;
}

.ai-action-heading span {
  flex: none;
  padding: 3px 6px;
  border-radius: 6px;
  color: #176b55;
  background: #e1f5ed;
  font-size: 0.62rem;
  font-weight: 900;
}

.ai-action-plan p {
  margin: 8px 0 0;
  color: #637489;
  font-size: 0.76rem;
  line-height: 1.5;
}

.ai-action-plan .ai-action-result {
  color: #295c4e;
  font-weight: 700;
}

.ai-action-result span {
  display: inline-block;
  margin-right: 6px;
  color: #138262;
  font-size: 0.67rem;
  font-weight: 900;
}

.ai-action-plan .ai-action-empty {
  grid-column: 1 / -1;
  list-style: none;
  color: #78869b;
}

.ai-report-caution {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 16px 0 0;
  padding: 11px 13px;
  border: 1px solid #e2e7ee;
  border-radius: 12px;
  color: #66768b;
  background: #f7f9fc;
  font-size: 0.76rem;
  line-height: 1.55;
}

.ai-report-caution > span:first-child {
  display: grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  color: #735528;
  background: #fff0d2;
  font-size: 0.68rem;
  font-weight: 900;
}

@media (max-width: 900px) {
  .ai-report-route {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-stage-connector {
    min-height: 58px;
  }

  .ai-stage-connector span {
    transform: rotate(90deg);
  }

  .ai-stage-connector small {
    display: none;
  }

  .ai-action-plan {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .reduction-list {
    grid-template-columns: 1fr;
  }

  .insight-card-heading,
  .ai-briefing-topline,
  .ai-briefing-action,
  .latest-ai-report-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-period-report-heading {
    align-items: flex-start;
  }

  .ai-quota-summary {
    text-align: left;
  }

  .ai-briefing-action button {
    width: 100%;
  }

  .latest-ai-report-heading small {
    align-self: flex-start;
  }

}

@media (max-width: 480px) {
  .ai-period-report-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ai-period-report-heading > strong {
    grid-column: 2;
    justify-self: start;
  }

  .ai-action-heading {
    flex-direction: column;
  }
}

html::-webkit-scrollbar {
  width: 12px;
}

html::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgb(105 117 138 / 42%);
  background-clip: content-box;
}

body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: 100%;
  max-width: 1040px;
  min-width: 0;
  margin: 0 auto;
  padding:
    max(20px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(40px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.page-shell > :not(.app-header) {
  width: 100%;
  max-width: var(--page-content-max-width, 100%);
  margin-inline: auto;
}

.app-header {
  position: sticky;
  z-index: 100;
  top: 0;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  margin-top: -10px;
  margin-bottom: 26px;
  padding: 10px 0;
  background: transparent;
}

.app-header::before {
  position: absolute;
  z-index: -1;
  top: -24px;
  right: calc(0px - max(18px, env(safe-area-inset-right)));
  bottom: -12px;
  left: calc(0px - max(18px, env(safe-area-inset-left)));
  background: linear-gradient(
    to bottom,
    rgb(245 247 251 / 99%) 0%,
    rgb(245 247 251 / 97%) calc(100% - 14px),
    rgb(245 247 251 / 0%) 100%
  );
  -webkit-backdrop-filter: blur(16px) saturate(115%);
  backdrop-filter: blur(16px) saturate(115%);
  content: "";
  pointer-events: none;
}

.brand {
  display: inline-flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-family-brand-pending] {
  visibility: hidden;
}

.brand-mark {
  display: block;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 10px;
  object-fit: contain;
}

.phase-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.app-nav {
  display: flex;
  gap: 3px;
  align-items: center;
  padding: 3px;
  border-radius: 11px;
  background: #e9edf4;
}

.nav-menu-button {
  display: none;
}

.nav-link {
  position: relative;
  display: inline-flex;
  gap: 2px;
  padding: 5px 9px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: 8px;
  color: #68758a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.05;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link-icon {
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1;
}

.nav-review-count,
.nav-family-request-count {
  position: absolute;
  top: -8px;
  right: -6px;
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid #f5f7fb;
  border-radius: 999px;
  color: #fff;
  background: #e65065;
  box-shadow: 0 2px 5px rgb(129 33 52 / 22%);
  font-size: 10px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.nav-review-count[hidden],
.nav-family-request-count[hidden] {
  display: none;
}

.nav-link.active {
  color: var(--navy);
  background: #fff;
  box-shadow: 0 1px 4px rgb(25 48 83 / 10%);
}

.intro {
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.05em;
}

.intro-copy {
  max-width: 32rem;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -0.015em;
}

.card {
  min-width: 0;
  border: 1px solid rgb(220 226 237 / 85%);
  border-radius: 22px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 12px 35px rgb(25 48 83 / 7%);
}

.connection-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 2px 15px;
}

.connection-section-heading .eyebrow {
  margin-bottom: 7px;
}

.connection-section-heading h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.connection-loading {
  padding: 26px 18px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.error-text {
  color: var(--danger);
}

.remove-connection {
  min-width: 48px;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.field-group {
  min-width: 0;
  margin-bottom: 20px;
}

.field-group > label {
  display: block;
  margin: 0 0 8px;
  color: #334056;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.input-wrap,
.select-wrap {
  position: relative;
  min-width: 0;
}

input,
select {
  width: 100%;
  min-width: 0;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

textarea {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

input {
  padding: 0 14px;
}

select {
  appearance: none;
  padding: 0 45px 0 14px;
}

input::placeholder {
  color: #a0a9b8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(40 100 215 / 13%);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--danger);
}

select:disabled {
  color: #929baa;
  background: #f7f8fa;
}

.select-arrow {
  position: absolute;
  top: 50%;
  right: 17px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #667288;
  border-bottom: 2px solid #667288;
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.field-error {
  min-height: 0;
  margin: 6px 2px 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.field-error:empty {
  display: none;
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 8px 18px rgb(23 59 120 / 18%);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.025em;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 120ms ease;
}

.primary-button:active:not(:disabled) {
  transform: translateY(1px);
}

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

.button-spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgb(255 255 255 / 38%);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 700ms linear infinite;
}

.primary-button.loading .button-spinner {
  display: inline-block;
}

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

.form-status {
  margin-top: 14px;
  padding: 12px 13px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

.form-status.connecting {
  color: #28559f;
  background: var(--blue-soft);
}

.form-status.success {
  color: var(--success);
  background: var(--success-soft);
}

.form-status.error {
  color: var(--danger);
  background: var(--danger-soft);
}

.count-badge {
  padding: 5px 9px;
  border-radius: 999px;
  color: #526177;
  background: #e8ecf3;
  font-size: 12px;
  font-weight: 700;
}

.compact-page {
  --page-content-max-width: 644px;
}

.user-form-card {
  padding: 22px 18px 19px;
}

.expense-intro {
  margin-bottom: 22px;
}

.expense-form-card {
  padding: 22px 18px 19px;
}

.expense-fields {
  display: grid;
  min-width: 0;
  gap: 0;
}

.entry-title-row {
  display: flex;
  max-width: 100%;
  align-items: flex-end;
  gap: 8px;
}

.entry-type-toggle {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  margin: 0 0 5px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #47617f;
  background: transparent;
  font-size: 24px;
  font-weight: 850;
  cursor: pointer;
  transition:
    color 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    transform 120ms ease;
}

.entry-type-toggle:hover,
.entry-type-toggle:focus-visible {
  color: var(--blue);
  background: #edf3ff;
  outline: 3px solid rgb(40 100 215 / 13%);
}

.entry-type-toggle:active:not(:disabled) {
  transform: translateY(1px);
}

.entry-type-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.entry-type-toggle.income-active {
  color: #176f50;
  background: #eff9f4;
}

.mode-switch-out {
  pointer-events: none;
  animation: mode-switch-out 160ms ease-in forwards;
}

.mode-switch-in {
  animation: mode-switch-in 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes mode-switch-out {
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@keyframes mode-switch-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.expense-form-card[data-entry-mode="income"] {
  border-color: #b9ddcd;
}

.expense-form-card[data-entry-mode="income"] .primary-button {
  background: #176f50;
}

.income-source-empty-state {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 9px 8px 14px;
  border: 1px solid #b9ddcd;
  border-radius: 13px;
  background: #f4fbf7;
}

.income-source-empty-state[hidden] {
  display: none;
}

.income-source-empty-state p {
  margin: 0;
  color: #4f685d;
  font-size: 13px;
  font-weight: 700;
}

.income-source-register-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 10px;
  color: #fff;
  background: #176f50;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.income-source-register-button:focus-visible {
  outline: 3px solid rgb(23 111 80 / 18%);
  outline-offset: 2px;
}

.income-source-guide {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.income-source-guide[hidden] {
  display: none;
}

.income-source-guide a {
  color: #176f50;
  font-weight: 800;
  text-decoration: none;
}

.expense-suggestions-mobile-slot {
  display: none;
}


.expense-suggestions-panel {
  margin-top: 13px;
  padding: 13px 15px 15px;
  border: 1px solid #e1e6ee;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 7px 20px rgb(25 48 83 / 7%);
}

.expense-suggestions-panel[hidden] {
  display: none;
}

.expense-suggestions-title {
  margin: 0 0 9px;
  color: #7a8698;
  font-size: 11px;
  font-weight: 800;
}

.expense-description-suggestions {
  display: flex;
  max-height: min(210px, 34vh);
  flex-wrap: wrap;
  gap: 7px;
  overflow-y: auto;
  align-content: flex-start;
  overscroll-behavior: contain;
}

.expense-description-suggestion {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #59677c;
  background: #f1f3f7;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
}

.expense-description-suggestion:hover,
.expense-description-suggestion:focus-visible,
.expense-description-suggestion.active {
  color: var(--navy);
  background: var(--blue-soft);
  border-color: #cbdaf0;
  outline: none;
}

.expense-description-hint {
  margin: 6px 2px 0;
  color: #8a95a6;
  font-size: 11px;
  line-height: 1.4;
}

.amount-input-wrap {
  position: relative;
  min-width: 0;
}

.amount-input-wrap input {
  padding-right: 43px;
  font-size: 20px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.amount-unit {
  position: absolute;
  top: 50%;
  right: 15px;
  color: #667288;
  font-size: 15px;
  font-weight: 700;
  pointer-events: none;
  transform: translateY(-50%);
}

.expense-history {
  margin-top: 38px;
}

.expense-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
  padding: 13px 15px;
  border-radius: 13px;
  color: #56647a;
  background: #e9eef7;
  font-size: 13px;
}

.expense-summary strong {
  color: var(--navy);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.expenses-list {
  display: grid;
  min-width: 0;
  gap: 11px;
}

.expense-date-group {
  min-width: 0;
  overflow: hidden;
  padding: 0 15px;
}

.expense-date-group > h3 {
  margin: 0;
  padding: 15px 0 8px;
  color: #667288;
  font-size: 13px;
  font-weight: 750;
}

.expense-list-item {
  min-width: 0;
  padding: 14px 0 15px;
}

.expense-list-item + .expense-list-item {
  border-top: 1px solid #edf0f5;
}

.expense-marker {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ec7a69;
}

.expense-item-details {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.expense-item-details span {
  color: #263247;
  font-size: 15px;
  font-weight: 700;
}

.expense-item-details small {
  color: #929baa;
  font-size: 11px;
}

.expense-main-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  min-width: 0;
  align-items: center;
}

.expense-main-row > strong {
  color: #263247;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.category-review {
  margin: 12px 0 0 18px;
  padding: 12px;
  border: 1px solid #e3e9f3;
  border-radius: 14px;
  background: #f7f9fc;
}

.category-review.needs-review {
  border-color: #f0d59e;
  background: #fffaf0;
}

.category-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  color: #69768a;
  font-size: 11px;
  font-weight: 750;
}

.classification-status {
  padding: 3px 7px;
  border-radius: 999px;
  color: #28559f;
  background: var(--blue-soft);
  font-size: 10px;
}

.needs-review .classification-status {
  color: #926013;
  background: #fff0c9;
}

.category-swipe-control {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  min-height: 50px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #d7dfeb;
  border-radius: 13px;
  background: #fff;
  touch-action: pan-y;
  user-select: none;
}

.category-arrow {
  width: 42px;
  height: 48px;
  border: 0;
  color: #54709d;
  background: transparent;
  font-size: 27px;
  cursor: pointer;
}

.category-arrow:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -3px;
}

.category-name {
  color: var(--navy);
  font-size: 17px;
  text-align: center;
}

.category-swipe-hint {
  margin: 7px 0 0;
  color: #8b96a8;
  font-size: 10px;
  text-align: center;
}

.manual-category-button {
  width: 100%;
  min-height: 42px;
  margin-top: 9px;
  border: 0;
  border-radius: 10px;
  color: #596a83;
  background: #e9eef6;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.category-sheet[hidden] {
  display: none;
}

.category-sheet {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.category-sheet-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgb(19 29 46 / 48%);
}

.category-sheet-panel {
  position: relative;
  width: min(100%, 680px);
  max-height: 85vh;
  overflow-y: auto;
  padding: 10px 20px max(20px, env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -14px 40px rgb(19 29 46 / 18%);
}

.category-sheet-handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 19px;
  border-radius: 99px;
  background: #d7dde7;
}

.category-sheet-panel h2 {
  margin: 4px 0 5px;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.category-sheet-description {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 13px;
}

.category-options {
  display: grid;
  gap: 14px;
}

.manual-category-group h3 {
  margin: 0 0 7px;
  color: #526077;
  font-size: 12px;
  font-weight: 800;
}

.detailed-category-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.category-option {
  min-height: 48px;
  border: 1px solid #dfe5ee;
  border-radius: 12px;
  color: #445269;
  background: #f8fafc;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.category-option[aria-pressed="true"] {
  border-color: #9cb6e4;
  color: var(--blue);
  background: var(--blue-soft);
}

.category-sheet-close {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border: 0;
  border-radius: 12px;
  color: #617087;
  background: #eef1f5;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

body.category-sheet-open,
body.category-dialog-open,
body.app-confirm-open {
  overflow: hidden;
}

.app-confirm-dialog {
  width: min(420px, calc(100vw - 32px));
  max-width: 420px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 70px rgb(16 31 55 / 30%);
}

.app-confirm-dialog::backdrop {
  background: rgb(17 29 49 / 48%);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.app-confirm-shell {
  padding: 22px;
}

.app-confirm-body {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}

.app-confirm-icon {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 20px;
  font-weight: 900;
}

.app-confirm-body h2 {
  margin: 1px 0 7px;
  color: var(--navy);
  font-size: 18px;
  letter-spacing: -0.03em;
}

.app-confirm-body p {
  margin: 0;
  color: #68758a;
  font-size: 12px;
  line-height: 1.6;
}

.app-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}

.app-confirm-button {
  min-height: 43px;
  border: 0;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.app-confirm-button:focus-visible {
  outline: 3px solid rgb(40 100 215 / 18%);
  outline-offset: 2px;
}

.app-confirm-cancel {
  color: #58677d;
  background: #edf1f6;
}

.app-confirm-cancel:hover {
  color: var(--navy);
  background: #e2e8f1;
}

.app-confirm-submit.danger {
  color: #fff;
  background: var(--danger);
}

.app-confirm-submit.danger:hover {
  background: #aa2f38;
}

.app-confirm-submit.primary {
  color: #fff;
  background: var(--navy);
}

.app-confirm-submit.primary:hover {
  background: var(--blue);
}

.records-page {
  --page-content-max-width: 884px;
}

.records-intro {
  margin-bottom: 12px;
}

.records-intro .eyebrow {
  margin: 0;
}

.records-heading-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.records-heading-title .entry-type-toggle {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  margin: 0;
  font-size: 22px;
}

.records-section {
  min-width: 0;
}

.records-table[data-records-mode="income"] .records-cost {
  color: #176f50;
}

.records-view-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #dce3ee;
  border-radius: 12px;
  background: #edf1f6;
}

.records-view-toggle button {
  display: inline-flex;
  min-height: 36px;
  padding: 7px 11px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 9px;
  color: #68758a;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.records-view-toggle button[aria-pressed="true"] {
  color: var(--navy);
  background: #fff;
  box-shadow: 0 2px 7px rgb(25 48 83 / 11%);
}

.records-view-toggle button:focus-visible {
  outline: 3px solid rgb(40 100 215 / 18%);
  outline-offset: 1px;
}

.records-list-view-icon {
  display: grid;
  width: 14px;
  height: 12px;
  gap: 2px;
}

.records-list-view-icon::before {
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentcolor;
  box-shadow: 0 5px currentcolor, 0 10px currentcolor;
  content: "";
}

.records-calendar-view-icon {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  border: 1.7px solid currentcolor;
  border-radius: 3px;
}

.records-calendar-view-icon::before,
.records-calendar-view-icon::after {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 5px;
  border-radius: 2px;
  background: currentcolor;
  content: "";
}

.records-calendar-view-icon::before {
  left: 2px;
}

.records-calendar-view-icon::after {
  right: 2px;
}

.records-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px;
  padding: 10px;
  border-radius: 14px;
}

.records-filters[data-records-mode="income"] {
  grid-template-columns: minmax(0, 1fr) auto;
}

.records-filter-field {
  min-width: 0;
}

.records-filter-field label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.records-filter-field select {
  height: 44px;
  border-radius: 11px;
  font-size: 13px;
}

.records-multiselect-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.records-multiselect-trigger {
  display: grid;
  position: relative;
  width: 100%;
  height: 44px;
  min-width: 0;
  padding: 0 34px 0 12px;
  align-items: center;
  border: 1px solid #d9e1ec;
  border-radius: 11px;
  color: #536278;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.records-multiselect-trigger:hover,
.records-multiselect-trigger:focus-visible,
.records-multiselect-trigger.has-selection {
  border-color: #bdcce2;
  color: var(--navy);
  outline: none;
}

.records-multiselect-trigger > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-multiselect-arrow {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentcolor;
  border-bottom: 2px solid currentcolor;
  transform: translateY(-70%) rotate(45deg);
}

.records-filter-reset {
  min-width: 68px;
  height: 44px;
  border: 0;
  border-radius: 11px;
  color: #586981;
  background: #edf1f6;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.records-filter-reset:hover,
.records-filter-reset:focus-visible {
  color: var(--navy);
  background: #e3eaf5;
}

.records-table-card {
  overflow: hidden;
  border-radius: 18px;
}

.records-calendar {
  padding: 16px;
  overflow: hidden;
  border-radius: 18px;
}

.records-calendar-header {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
  margin-bottom: 11px;
}

.records-calendar-header strong {
  color: #263650;
  font-size: 17px;
  text-align: center;
  letter-spacing: -0.03em;
}

.records-calendar-header button {
  display: grid;
  width: 40px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid #dde4ee;
  border-radius: 10px;
  color: #52627a;
  background: #f6f8fb;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.records-calendar-header button:hover,
.records-calendar-header button:focus-visible {
  color: var(--navy);
  background: #edf3ff;
  outline: none;
}

.records-calendar-header button:disabled {
  color: #aeb7c5;
  background: #f5f6f8;
  cursor: default;
  opacity: 0.55;
}

.records-calendar-summary {
  display: flex;
  min-height: 34px;
  margin-bottom: 9px;
  align-items: stretch;
  justify-content: center;
  border: 1px solid #e4e9f1;
  border-radius: 10px;
  background: #f8fafc;
}

.records-calendar-summary-item {
  display: flex;
  min-width: 0;
  padding: 5px 10px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1 1 0;
  color: #59687f;
  white-space: nowrap;
}

.records-calendar-summary-item + .records-calendar-summary-item {
  border-left: 1px solid #e1e7f0;
}

.records-calendar-summary-item small {
  font-size: 9px;
  font-weight: 750;
}

.records-calendar-summary-item strong {
  overflow: hidden;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}

.records-calendar-summary-item.income strong {
  color: #177352;
}

.records-calendar-summary-item.expense strong {
  color: #285ba8;
}

.records-calendar-weekdays,
.records-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.records-calendar-weekdays {
  margin-bottom: 5px;
  color: #778398;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.records-calendar-weekdays span:first-child {
  color: #bd5360;
}

.records-calendar-weekdays span:last-child {
  color: #3866ad;
}

.records-calendar-grid {
  gap: 5px;
  touch-action: pan-y;
  user-select: none;
}

.records-calendar-day {
  display: flex;
  position: relative;
  min-width: 0;
  min-height: 72px;
  padding: 8px 6px;
  align-items: center;
  flex-direction: column;
  gap: 7px;
  border: 1px solid #e4e9f1;
  border-radius: 11px;
  color: #617087;
  background: #f8fafc;
  font: inherit;
}

button.records-calendar-day {
  cursor: pointer;
}

button.records-calendar-day:hover,
button.records-calendar-day:focus-visible {
  border-color: #b8cceb;
  background: #edf3fd;
  outline: none;
}

.records-calendar-day:nth-child(7n + 1) .records-calendar-day-number {
  color: #bd5360;
}

.records-calendar-day:nth-child(7n) .records-calendar-day-number {
  color: #3866ad;
}

.records-calendar-day.is-outside {
  border-color: transparent;
  color: #9aa5b5;
  background: transparent;
  opacity: 0.48;
}

.records-calendar-day.has-records {
  border-color: #cddbf0;
  color: var(--navy);
  background: #f2f6fd;
}

.records-calendar[data-records-mode="income"] .records-calendar-day.has-records {
  border-color: #c8e3d7;
  color: #176f50;
  background: #f1f9f5;
}

.records-calendar[data-records-mode="combined"] .records-calendar-day.has-incomes:not(.has-expenses) {
  border-color: #c8e3d7;
  background: #f1f9f5;
}

.records-calendar[data-records-mode="combined"] .records-calendar-day.has-incomes.has-expenses {
  border-color: #cfdaec;
  background: linear-gradient(145deg, #f1f9f5 0 49%, #f2f6fd 51% 100%);
}

.records-calendar-day.is-today {
  box-shadow: inset 0 0 0 2px rgb(40 100 215 / 25%);
}

.records-calendar-day:disabled {
  cursor: default;
  opacity: 1;
}

.records-calendar-day.is-unavailable {
  border-color: transparent;
  color: #bdc4cf;
  background: transparent;
  opacity: 0.35;
}

.records-calendar-day.has-memo::after {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7c5bd6;
  box-shadow: 0 0 0 2px #fff;
  content: "";
}

.records-calendar-day-number {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.records-calendar-day-total {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-calendar-day-total.income {
  color: #177352;
}

.records-calendar-day-total.expense {
  color: #285ba8;
}

.records-calendar-day-dialog {
  width: min(440px, calc(100% - 28px));
  max-height: min(620px, calc(100dvh - 28px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 80px rgb(15 29 52 / 28%);
}

.records-calendar-day-dialog::backdrop {
  background: rgb(18 29 47 / 55%);
  backdrop-filter: blur(2px);
}

.records-calendar-day-panel {
  display: flex;
  max-height: min(620px, calc(100dvh - 28px));
  padding: 20px;
  flex-direction: column;
  touch-action: pan-y;
  user-select: none;
}

.records-calendar-day-panel > header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.records-calendar-day-panel h2 {
  margin: 0;
  font-size: 22px;
}

.records-calendar-day-header-actions {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 7px;
}

#records-calendar-day-close {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 11px;
  color: #647188;
  background: #eef2f7;
  font-size: 23px;
  cursor: pointer;
}

.records-calendar-day-list {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 7px;
  margin-top: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.records-calendar-day-navigation {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  margin-top: 6px;
}

.records-calendar-day-navigation-button {
  display: grid;
  width: 32px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #8994a6;
  background: transparent;
  cursor: pointer;
}

.records-calendar-day-navigation-button::before {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  content: "";
}

.records-calendar-day-navigation-button.previous::before {
  border-right: 7px solid currentcolor;
}

.records-calendar-day-navigation-button.next::before {
  border-left: 7px solid currentcolor;
}

.records-calendar-day-navigation-button:hover:not(:disabled),
.records-calendar-day-navigation-button:focus-visible {
  color: #277663;
  background: #eff7f4;
  outline: none;
}

.records-calendar-day-navigation-button:disabled {
  cursor: default;
  opacity: 0.3;
}

.records-calendar-day-swipe-hint {
  margin: 0;
  color: #8994a6;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.records-calendar-day-memo-display,
.records-calendar-day-memo-form {
  display: grid;
  flex: 0 0 auto;
  gap: 6px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #e0e6ef;
  border-radius: 13px;
  background: #f8fafc;
}

.records-calendar-day-memo-display p {
  max-height: 116px;
  margin: 0;
  overflow-y: auto;
  color: #40506a;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.records-calendar-day-memo-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.records-calendar-day-memo-heading label,
.records-calendar-day-memo-heading strong {
  color: #263650;
  font-size: 12px;
  font-weight: 850;
}

.records-calendar-day-memo-heading span {
  padding: 3px 7px;
  border-radius: 999px;
  color: #6e52bd;
  background: #eee9fd;
  font-size: 9px;
  font-weight: 800;
}

.records-calendar-day-memo-form textarea {
  width: 100%;
  min-height: 54px;
  max-height: 96px;
  padding: 8px 10px;
  resize: vertical;
  border: 1px solid #d6dfeb;
  border-radius: 10px;
  outline: none;
  color: #263650;
  background: #fff;
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
}

.records-calendar-day-memo-form textarea:focus {
  border-color: #8eace0;
  box-shadow: 0 0 0 3px rgb(40 100 215 / 10%);
}

.records-calendar-day-memo-footer small {
  min-height: 15px;
  color: #718097;
  font-size: 9px;
  font-weight: 750;
}

.records-calendar-day-memo-footer small.success {
  color: #177352;
}

.records-calendar-day-memo-footer small.error {
  color: #bd3f4d;
}

.records-calendar-day-actions {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e9f0;
}

.records-calendar-day-actions.memo-only {
  grid-template-columns: minmax(0, 1fr);
}

.records-calendar-day-actions button {
  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

#records-calendar-day-add {
  border-color: #c9d7ed;
  color: #2459ac;
  background: #f1f6ff;
}

#records-calendar-day-memo-action {
  color: #fff;
  background: var(--navy);
}

.records-calendar-day-actions.memo-editing #records-calendar-day-add {
  border-color: transparent;
  color: #627087;
  background: #eef2f7;
}

.records-calendar-day-actions button:hover,
.records-calendar-day-actions button:focus-visible {
  outline: 3px solid rgb(40 100 215 / 14%);
  filter: brightness(0.98);
}

.records-calendar-day-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.records-calendar-day-empty {
  display: grid;
  min-height: 76px;
  margin: 0;
  place-items: center;
  border: 1px dashed #d9e1ec;
  border-radius: 13px;
  color: #8490a3;
  background: #f8fafc;
  font-size: 12px;
}

.records-calendar-day-item {
  display: flex;
  width: 100%;
  height: max-content;
  min-height: 62px;
  padding: 10px 12px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e2e7ef;
  border-radius: 13px;
  color: #26354d;
  background: #f8fafc;
  text-align: left;
}

button.records-calendar-day-item {
  cursor: pointer;
}

.records-calendar-day-item > span,
.records-calendar-day-item strong,
.records-calendar-day-item small {
  display: block;
  min-width: 0;
}

.records-calendar-day-item > span {
  overflow: hidden;
}

.records-calendar-day-item strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-calendar-day-item small {
  margin-top: 4px;
  color: #758197;
  font-size: 10px;
}

.records-calendar-day-classification {
  display: flex;
  min-width: 0;
  margin-top: 4px;
  align-items: center;
  gap: 5px;
  color: #758197;
  font-size: 10px;
}

.records-calendar-day-classification .records-category {
  min-height: 20px;
  padding: 2px 6px;
  gap: 3px;
  font-size: 9.5px;
}

.records-calendar-day-classification .records-category-icon {
  font-size: 10px;
}

.records-calendar-day-classification small {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-calendar-day-item b {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--navy);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.records-calendar-day-item.income b,
.combined-income-row .records-cost {
  color: #177352;
}

/* Daily records must keep long memo text inside the day dialog. */
.records-calendar-day-item > span {
  flex: 1 1 auto;
  max-width: 100%;
}

.records-calendar-day-item .records-memo,
.records-calendar-day-memo-display p {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip;
  white-space: pre-wrap;
}

.records-calendar-day-memo-display p {
  overflow-y: auto;
}

.records-entry-kind {
  display: inline-flex;
  min-height: 21px;
  padding: 3px 7px;
  align-items: center;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 850;
}

.records-entry-kind.income {
  color: #177352;
  background: #e8f6ef;
}

.records-category-filter-dialog {
  width: min(420px, calc(100% - 28px));
  max-height: min(640px, calc(100dvh - 28px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 80px rgb(15 29 52 / 28%);
}

.records-category-filter-dialog::backdrop {
  background: rgb(18 29 47 / 55%);
  backdrop-filter: blur(2px);
}

.records-category-filter-panel {
  display: flex;
  max-height: min(640px, calc(100dvh - 28px));
  padding: 20px;
  flex-direction: column;
}

.records-category-filter-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.records-category-filter-panel h2 {
  margin: 0;
  font-size: 21px;
}

.records-category-filter-close {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 11px;
  color: #647188;
  background: #eef2f7;
  font-size: 23px;
  cursor: pointer;
}

.records-category-filter-help {
  margin: 7px 0 12px;
  color: #718097;
  font-size: 12px;
}

.records-category-options {
  display: grid;
  min-height: 0;
  padding: 3px;
  gap: 7px;
  overflow-y: auto;
}

.records-category-options-heading {
  margin: 8px 2px 0;
  color: #6f7c91;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.records-category-option {
  display: flex;
  min-height: 44px;
  padding: 9px 12px;
  align-items: center;
  gap: 10px;
  border: 1px solid #e0e6ef;
  border-radius: 12px;
  color: #263650;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.records-category-option:has(input:checked) {
  border-color: #a9c2e8;
  background: #eef4ff;
}

.records-category-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.records-category-filter-panel > footer {
  display: grid;
  margin-top: 14px;
  grid-template-columns: 1fr 1.25fr;
  gap: 8px;
}

.records-category-filter-panel > footer button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

#records-category-filter-clear {
  color: #5d6c83;
  background: #edf1f6;
}

#records-category-filter-apply {
  color: #fff;
  background: var(--navy);
}

.records-search-panel {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 1px solid #cfdcf0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 3px rgb(40 100 215 / 7%);
}

.records-search-panel[hidden] {
  display: none;
}

.records-search-panel input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 0;
  outline: 0;
  color: #1c2b45;
  background: transparent;
  font: inherit;
  font-size: 12px;
}

.records-search-panel input::placeholder {
  color: #8b96a8;
}

.records-scroll-top {
  position: fixed;
  z-index: 30;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  width: 50px;
  height: 50px;
  padding: 0;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 65%);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #2e72e3, #173f86);
  box-shadow: 0 12px 30px rgb(23 59 120 / 32%);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.records-scroll-top:hover,
.records-scroll-top:focus-visible {
  background: linear-gradient(145deg, #3679e5, #1d4d9c);
  box-shadow: 0 12px 32px rgb(40 100 215 / 32%);
  transform: translateY(-2px);
}

.records-scroll-top span,
.records-scroll-top svg {
  display: block;
  width: 25px;
  height: 25px;
}

.records-scroll-top svg {
  fill: none;
  stroke: currentcolor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.records-scroll-top:focus-visible {
  outline: 3px solid rgb(40 100 215 / 28%);
  outline-offset: 3px;
}

.records-table-wrap {
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.records-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  table-layout: fixed;
}

.records-table th,
.records-table td {
  padding: 15px 17px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
  vertical-align: middle;
}

.records-table th {
  color: #607089;
  background: #f3f6fa;
  font-size: 12px;
  font-weight: 800;
}

.records-table th:nth-child(1) {
  width: 9%;
}

.records-table th:nth-child(2) {
  width: 31%;
}

.records-table th:nth-child(3) {
  width: 16%;
}

.records-table th:nth-child(4) {
  width: 23%;
}

.records-table th:nth-child(5) {
  width: 21%;
}

.records-table thead tr {
  height: 50px;
}

.records-table thead .records-list-summary-row {
  height: auto;
}

.records-table .records-list-summary-cell {
  width: auto;
  padding: 9px 17px 13px;
  background: #f3f6fa;
}

.records-list-summary {
  margin-bottom: 0;
}

.records-description-heading {
  position: relative;
}

.records-date-heading .app-control {
  width: fit-content;
}

.records-date-heading .app-control-trigger {
  width: auto;
  min-width: 0;
  height: 34px;
  padding: 0 21px 0 0;
  border: 0;
  color: #506079;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 850;
}

.records-date-heading .app-control-arrow {
  right: 3px;
  width: 7px;
  height: 7px;
  border-width: 0 1.7px 1.7px 0;
}

.records-search-toggle {
  position: relative;
  display: inline-grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 11px;
  color: #5d6c83;
  background: transparent;
  cursor: pointer;
}

.records-search-toggle:hover,
.records-search-toggle:focus-visible,
.records-search-toggle.is-open {
  color: var(--navy);
  background: #e5eaf2;
}

.records-search-toggle.has-query::after {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border: 2px solid #f3f6fa;
  border-radius: 50%;
  background: var(--blue);
  content: "";
}

.records-search-icon {
  position: relative;
  display: block;
  width: 15px;
  height: 15px;
  border: 2px solid currentcolor;
  border-radius: 50%;
  color: inherit;
}

.records-search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 2px;
  border-radius: 999px;
  background: currentcolor;
  transform: rotate(45deg);
  content: "";
}

.records-table[data-records-mode="income"] {
  min-width: 0;
}

.records-table[data-records-mode="income"] th:nth-child(1) {
  width: 18%;
}

.records-table[data-records-mode="income"] th:nth-child(2) {
  width: 52%;
}

.records-table[data-records-mode="income"] th:nth-child(3) {
  width: 30%;
}

.records-table tbody tr:last-child td {
  border-bottom: 0;
}

.records-row {
  cursor: pointer;
}

.income-records-row {
  cursor: default;
}

.records-row:hover td,
.records-row:focus td {
  background: #fbfcfe;
}

.records-row:focus {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.records-date {
  color: #59687f;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.records-cost,
.records-cost-heading {
  text-align: right !important;
}

.records-cost {
  color: #253249;
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.records-details {
  color: #253249;
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.records-details strong {
  display: block;
  font: inherit;
}

.records-mobile-classification {
  display: none;
}

.records-memo {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 5px;
  color: #7a8699;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.records-category {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  gap: 5px;
  color: #28559f;
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.records-category-icon {
  font-size: 13px;
  line-height: 1;
}

.records-category.category-transport {
  color: #2457a6;
  background: #eaf2ff;
}

.records-category.category-other {
  color: #586579;
  background: #eef1f5;
}

.records-category.category-medical {
  color: #a23f45;
  background: #fff0f1;
}

.records-category.category-living {
  color: #18705e;
  background: #e9f8f3;
}

.records-category.category-groceries {
  color: #467016;
  background: #f0f8df;
}

.records-category.category-leisure {
  color: #7048a5;
  background: #f4edff;
}

.records-category.category-dining {
  color: #a35417;
  background: #fff1e5;
}

.records-category.category-social {
  color: #a13f72;
  background: #fdeef6;
}

.records-category.category-loan {
  color: #31527f;
  background: #eaf0f7;
}

.records-category.category-annual {
  color: #8b6511;
  background: #fff6d9;
}

.records-category.category-fixed {
  color: #4f4e9f;
  background: #eeefff;
}

.records-category.category-custom {
  color: #31667b;
  background: #e9f6f8;
}

.records-category.needs-review {
  color: #926013;
  background: #fff0c9;
}

.records-detail-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 9px;
  color: #59677c;
  background: #f1f3f7;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.records-detail-badge.needs-review {
  color: #926013;
  background: #fff7e5;
}

.records-message {
  height: 120px;
  color: var(--muted);
  text-align: center !important;
}

.record-editor {
  width: min(620px, calc(100% - 28px));
  max-height: calc(100svh - 28px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 24px 80px rgb(15 29 52 / 28%);
}

.record-editor::backdrop {
  background: rgb(18 29 47 / 55%);
  backdrop-filter: blur(2px);
}

.record-editor-form {
  max-height: calc(100svh - 28px);
  padding: 22px;
  overflow-y: auto;
}

.record-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.record-editor-header .eyebrow {
  margin-bottom: 6px;
}

.record-editor-header h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.record-editor-close {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  color: #68758a;
  background: #f0f3f7;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.record-editor-source-note {
  margin: 13px 0 19px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #65738a;
  background: #f4f6f9;
  font-size: 12px;
  line-height: 1.5;
}

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

.record-editor-detail-cost-grid {
  grid-template-columns: 52px minmax(0, 1.35fr) minmax(150px, 0.85fr);
}

.record-edit-date-field {
  align-self: end;
  width: 52px;
  min-width: 0;
}

.record-edit-date-field .app-calendar-control,
.record-edit-date-field .app-control-trigger {
  width: 52px;
}

.record-edit-date-field .app-control-trigger {
  height: 50px;
  min-height: 50px;
  padding: 0;
  justify-content: center;
  border-color: var(--kkaebu-line, #c7e9e1);
  background: #f4f8f7;
}

.record-edit-date-field .app-control-value {
  display: none;
}

.record-edit-date-field .app-calendar-icon {
  right: 50%;
  transform: translate(50%, -50%);
}

.record-edit-date-field .app-calendar-icon svg {
  stroke: var(--kkaebu-deep-mint, #15584f);
}

.record-editor #record-edit-memo,
.record-editor #recurring-expense-memo {
  min-height: 132px;
  resize: vertical;
}

.record-editor .field-group {
  margin-bottom: 15px;
}

.record-editor .field-group > label {
  margin-bottom: 6px;
  font-size: 13px;
}

.optional-label {
  margin-left: 3px;
  color: #919baa;
  font-size: 11px;
  font-weight: 650;
}

.record-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 19px;
  padding-top: 17px;
  border-top: 1px solid #ebeff5;
}

.record-editor-main-actions {
  display: flex;
  gap: 8px;
}

.record-delete-button,
.record-cancel-button,
.record-save-button {
  min-height: 46px;
  padding: 10px 16px;
  border: 0;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.record-delete-button {
  color: var(--danger);
  background: var(--danger-soft);
}

.record-cancel-button {
  color: #5f6d82;
  background: #edf1f5;
}

.record-save-button {
  min-width: 92px;
  color: #fff;
  background: var(--navy);
}

.record-delete-button:disabled,
.record-cancel-button:disabled,
.record-save-button:disabled,
.record-editor-close:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.review-page {
  --page-content-max-width: 644px;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.review-intro {
  margin-bottom: 12px;
}

.review-page > .app-header,
.review-intro { flex-shrink: 0; }
.review-title-row { display: flex; align-items: center; gap: 12px; }
.review-title-row h1 { margin: 0; font-size: 24px; }
.review-section { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.review-section > :not(.review-list) { flex-shrink: 0; }

.review-page-status {
  margin: 0 0 12px;
}

.review-progress {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.review-list {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
}

.review-list:has(.review-purchase-details) {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.review-list:has(.review-purchase-details) > .review-card { flex-shrink: 0; }

.review-card {
  padding: 17px;
}

.review-purchase-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  text-align: left;
  overflow-wrap: anywhere;
}

.review-purchase-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 17px;
  flex-shrink: 0;
}

.review-purchase-heading h3 { margin: 0; font-size: 17px; }
.review-purchase-title { display: flex; align-items: baseline; gap: 8px; }
.review-split-button {
  flex-shrink: 0; padding: 7px 10px; border: 1px solid #dce5f3; border-radius: 9px;
  background: #f3f6fb; color: #244f91; font-size: 12px; font-weight: 700; cursor: pointer;
}
.review-product-name {
  padding: 0; border: 0; background: transparent; color: inherit;
  font: inherit; font-weight: 600; line-height: 1.5; text-align: left; cursor: pointer;
}
.review-split-button:disabled { opacity: 0.45; cursor: default; }
.review-product-category {
  display: inline-block; max-width: 100%; margin-top: 6px; padding: 4px 6px;
  border: 0; border-radius: 7px; background: #edf2fa; color: #45618a;
  font-size: 10px; font-weight: 600; white-space: normal; text-align: right; cursor: pointer;
}
.review-purchase-heading span,
.review-purchase-empty,
.review-purchase-reference { color: var(--muted); font-size: 12px; }
.review-purchase-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 70px; }
.review-purchase-details .review-purchase-table { min-width: 0; font-size: 13px; }
.review-purchase-details .review-purchase-table th:nth-child(1) { width: 59%; }
.review-purchase-details .review-purchase-table th:nth-child(2) { width: 13%; }
.review-purchase-details .review-purchase-table th:nth-child(3) { width: 28%; }
.review-purchase-table th { position: sticky; top: 0; z-index: 1; }
.review-purchase-details .review-purchase-table :is(th, td):nth-child(2) { text-align: center; }
.review-purchase-details .review-purchase-table :is(th, td):nth-child(3) { text-align: right; white-space: nowrap; }
.review-purchase-table strong { display: block; font-weight: 600; line-height: 1.5; }
.review-purchase-table small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.review-purchase-totals { display: grid; gap: 8px; margin: 16px 17px 0; font-size: 13px; }
.review-purchase-totals div { display: flex; justify-content: space-between; gap: 16px; }
.review-purchase-totals dd { margin: 0; white-space: nowrap; }
.review-purchase-total { padding-top: 8px; font-weight: 700; font-size: 15px; }
.review-purchase-reference, .review-purchase-empty { margin: 12px 17px 0; line-height: 1.5; }

@media (max-width: 599px) {
  body.fixed-mobile-page .review-list { gap: 10px; }
}

.review-instruction {
  margin: 0 0 11px;
  color: #758196;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.review-swipe-zone {
  position: relative;
  height: 184px;
  overflow: hidden;
  border-radius: 16px;
  background: #edf1f6;
}

.review-choice-target {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  gap: 5px;
  width: 50%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  white-space: normal;
  cursor: pointer;
}

.review-choice-left {
  left: 0;
  padding-right: 31%;
  background: #3f76cf;
}

.review-choice-right {
  right: 0;
  padding-left: 31%;
  background: #2f8a70;
}

.financial-choice-exclude {
  background: #b75b65;
}

.financial-choice-include {
  background: #2f8a70;
}

.review-choice-arrow {
  font-size: 19px;
  line-height: 1;
}

.review-choice-category {
  display: flex;
  gap: 3px;
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.review-choice-icon {
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1;
}

.review-choice-category strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-choice-detail {
  max-width: 100%;
  padding: 3px 6px;
  overflow: hidden;
  border-radius: 7px;
  background: rgb(255 255 255 / 16%);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-expense-block {
  position: absolute;
  z-index: 2;
  top: 10px;
  bottom: 10px;
  left: 20%;
  display: flex;
  width: 60%;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 1px solid #dce3ed;
  border-radius: 14px;
  outline: none;
  background: #fff;
  box-shadow: 0 7px 19px rgb(25 48 83 / 17%);
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    box-shadow 180ms ease;
}

.review-expense-block:focus-visible {
  box-shadow:
    0 0 0 3px rgb(40 100 215 / 24%),
    0 7px 19px rgb(25 48 83 / 17%);
}

.review-expense-block.dragging {
  cursor: grabbing;
  transition: none;
}

.review-expense-block.drag-left {
  box-shadow: 0 9px 22px rgb(63 118 207 / 30%);
}

.review-expense-block.drag-right {
  box-shadow: 0 9px 22px rgb(47 138 112 / 30%);
}

.review-expense-block.finalizing-left {
  opacity: 0;
  transform: translateX(-165%) rotate(-8deg) !important;
}

.review-expense-block.finalizing-right {
  opacity: 0;
  transform: translateX(165%) rotate(8deg) !important;
}

.review-expense-block small {
  margin-bottom: 8px;
  color: #8994a5;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.review-expense-block strong {
  max-width: 100%;
  overflow: hidden;
  color: #223047;
  font-size: 17px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-expense-block span {
  margin-top: 8px;
  color: #4f6078;
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.review-expense-block .review-financial-source {
  max-width: 100%;
  margin-top: 7px;
  overflow: hidden;
  color: #7d899b;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-manual-button {
  min-height: 34px;
  padding: 5px 10px;
  border: 0;
  border-radius: 9px;
  color: #7b8798;
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.review-card-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  margin-top: 9px;
}

.review-skip-button {
  min-height: 34px;
  padding: 5px 11px;
  border: 1px solid #d8e0eb;
  border-radius: 9px;
  color: #637189;
  background: #f7f9fc;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.review-skip-button:hover,
.review-skip-button:focus-visible {
  border-color: #bac6d6;
  color: var(--navy);
  background: #edf2f9;
}

.recurring-match-review-card {
  min-width: 0;
}

.recurring-review-transaction {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid #dce5f2;
  border-radius: 12px;
  background: #f7faff;
  text-align: center;
}

.recurring-review-transaction small,
.recurring-review-transaction em {
  overflow: hidden;
  color: #7a889e;
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-review-transaction strong {
  overflow: hidden;
  color: #20324f;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-review-transaction > span {
  color: var(--blue);
  font-size: 14px;
  font-weight: 850;
}

.recurring-review-choices {
  display: grid;
  max-height: min(224px, 35dvh);
  gap: 7px;
  margin-top: 9px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.recurring-review-choice {
  display: flex;
  min-width: 0;
  min-height: 50px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #cfdaea;
  border-radius: 11px;
  color: #243956;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.recurring-review-choice > span:first-child {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 9px;
  background: #edf3ff;
  font-size: 16px;
}

.recurring-review-choice > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.recurring-review-choice strong,
.recurring-review-choice small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-review-choice strong {
  font-size: 12px;
}

.recurring-review-choice small {
  color: #74839a;
  font-size: 9px;
}

.recurring-review-choice:hover,
.recurring-review-choice:focus-visible {
  border-color: #8eafe7;
  outline: none;
  background: #f4f8ff;
}

.recurring-review-not-matched {
  min-height: 34px;
  padding: 5px 11px;
  border: 1px solid #d8e0eb;
  border-radius: 9px;
  color: #53647d;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.review-manual-button:hover,
.review-manual-button:focus-visible {
  color: var(--navy);
  background: #edf2f9;
}

.review-empty-state {
  padding: 38px 20px;
  text-align: center;
}

.review-empty-state > span {
  display: inline-grid;
  width: 44px;
  height: 44px;
  margin-bottom: 13px;
  place-items: center;
  border-radius: 15px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 19px;
  font-weight: 850;
}

.review-empty-state strong {
  display: block;
  font-size: 16px;
}

.review-empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.expense-delete-button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 7px;
  border: 0;
  border-radius: 9px;
  color: #8792a4;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.expense-delete-button:focus-visible,
.expense-delete-button:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.expense-empty-state {
  padding: 34px 20px;
  text-align: center;
}

.expense-empty-state > span {
  display: inline-grid;
  width: 42px;
  height: 42px;
  margin-bottom: 13px;
  place-items: center;
  border-radius: 14px;
  color: var(--navy);
  background: var(--blue-soft);
  font-size: 18px;
  font-weight: 800;
}

.expense-empty-state strong {
  display: block;
  font-size: 16px;
}

.expense-empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.user-form-card h2 {
  margin: 0 0 20px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.users-list-section {
  margin-top: 36px;
}

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

.user-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 15px;
}

.user-avatar {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: var(--navy);
  background: var(--blue-soft);
  font-size: 16px;
  font-weight: 800;
}

.user-list-item strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-empty-state {
  padding: 30px 20px;
  text-align: center;
}

.users-empty-state strong {
  display: block;
  font-size: 16px;
}

.users-empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.analytics-page {
  --page-content-max-width: 1004px;
}

.analytics-intro {
  margin-bottom: 34px;
}

.analytics-filter-section {
  margin-bottom: 18px;
}

.analytics-filter-panel {
  padding: 0;
  overflow: visible;
}

.analytics-filter-panel > summary {
  display: flex;
  min-height: 64px;
  padding: 12px 15px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: inherit;
  list-style: none;
  cursor: pointer;
}

.analytics-filter-panel > summary::-webkit-details-marker {
  display: none;
}

.analytics-filter-panel > summary:focus-visible {
  outline: 3px solid rgb(40 100 215 / 15%);
  outline-offset: 2px;
}

.analytics-filter-panel[open] > summary {
  border-bottom: 1px solid #e7ecf3;
  border-radius: 22px 22px 0 0;
}

.analytics-filter-summary-copy {
  min-width: 0;
}

.analytics-filter-summary-copy > span,
.analytics-filter-summary-copy > strong {
  display: block;
}

.analytics-filter-summary-copy > span {
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.analytics-filter-summary-copy > strong {
  margin-top: 4px;
  overflow: hidden;
  color: #29384f;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-filter-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 11px;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  color: #315b96;
  background: #edf3fc;
  font-size: 11px;
  font-weight: 850;
}

.analytics-filter-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentcolor;
  border-bottom: 2px solid currentcolor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 180ms ease;
}

.analytics-filter-panel[open] .analytics-filter-chevron {
  transform: translateY(2px) rotate(225deg);
}

.analytics-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 15px;
}

.analytics-filter-panel > .analytics-filters {
  border-radius: 0 0 22px 22px;
  background: #fbfcfe;
}

.analytics-filter-field {
  min-width: 0;
}

.analytics-filter-field label {
  display: block;
  margin: 0 0 6px 2px;
  color: #65738a;
  font-size: 11px;
  font-weight: 800;
}

.analytics-filter-field input,
.analytics-filter-field select {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 8px 11px;
  border: 1px solid #d9e0ea;
  border-radius: 11px;
  outline: none;
  color: #263247;
  background: #fff;
  font-size: 12px;
}

.analytics-filter-field input:focus,
.analytics-filter-field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(40 100 215 / 12%);
}

.analytics-filter-field select:disabled {
  color: #8b95a4;
  background: #f3f5f8;
}

.analytics-multiselect {
  position: relative;
}

.analytics-multiselect > summary {
  position: relative;
  display: flex;
  height: 44px;
  padding: 0 38px 0 11px;
  overflow: hidden;
  align-items: center;
  border: 1px solid #d9e0ea;
  border-radius: 11px;
  color: #263247;
  background: #fff;
  font-size: 12px;
  font-weight: 650;
  list-style: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.analytics-multiselect > summary::-webkit-details-marker {
  display: none;
}

.analytics-multiselect > summary > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-multiselect[open] > summary,
.analytics-multiselect > summary:focus-visible {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgb(40 100 215 / 12%);
}

.analytics-multiselect[open] > summary .select-arrow {
  transform: translateY(-20%) rotate(225deg);
}

.analytics-multiselect-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  right: 0;
  width: min(280px, calc(100vw - 44px));
  padding: 10px;
  border: 1px solid #dfe5ee;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 14px 35px rgb(24 39 67 / 16%);
}

.analytics-multiselect-panel.wide {
  width: min(350px, calc(100vw - 44px));
}

.analytics-multiselect-actions {
  display: flex;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf0f5;
}

.analytics-multiselect-actions button {
  min-height: 29px;
  padding: 5px 9px;
  border: 0;
  border-radius: 8px;
  color: #53647c;
  background: #eef2f7;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.analytics-multiselect-actions button:hover,
.analytics-multiselect-actions button:focus-visible {
  color: var(--blue);
  outline: 2px solid rgb(40 100 215 / 16%);
}

.analytics-multiselect-options {
  display: grid;
  gap: 2px;
  max-height: 260px;
  padding-top: 7px;
  overflow-y: auto;
}

.analytics-filter-field .analytics-multiselect-option {
  display: flex;
  gap: 9px;
  min-height: 34px;
  margin: 0;
  padding: 7px 8px;
  align-items: center;
  border-radius: 8px;
  color: #35435a;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  cursor: pointer;
}

.analytics-multiselect-option:hover {
  background: #f3f6fb;
}

.analytics-multiselect-option input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  margin: 18px 0;
}

.analytics-kpi {
  min-width: 0;
  padding: 17px;
}

.analytics-kpi > span {
  display: block;
  margin-bottom: 10px;
  color: #718097;
  font-size: 11px;
  font-weight: 750;
}

.analytics-kpi > strong {
  display: block;
  overflow: hidden;
  color: var(--navy);
  font-size: clamp(18px, 2.5vw, 24px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-kpi > small {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: #8a95a5;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-kpi.target-kpi {
  background: linear-gradient(145deg, #f0f5ff, #fff);
}

.analytics-kpi.income-kpi {
  background: linear-gradient(145deg, #effaf5, #fff);
}

.analytics-kpi.spending-kpi {
  background: linear-gradient(145deg, #fff6f4, #fff);
}

.analytics-kpi.balance-kpi {
  background: linear-gradient(145deg, #f2f6ff, #fff);
}

.analytics-kpi #analytics-income,
.analytics-income-value,
.analytics-balance-value.positive {
  color: var(--success);
}

.analytics-kpi #analytics-balance.negative,
.analytics-balance-value.negative {
  color: var(--danger);
}

.analytics-chart-card,
.analytics-breakdown-card,
.analytics-monthly-card {
  margin-top: 13px;
  padding: 20px;
}

.analytics-card-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.analytics-card-heading.compact {
  margin-bottom: 18px;
}

.analytics-card-heading .eyebrow {
  margin-bottom: 5px;
}

.analytics-card-heading h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.analytics-card-heading p:not(.eyebrow) {
  margin: 6px 0 0;
  color: #7b8799;
  font-size: 11px;
  line-height: 1.5;
}

.analytics-heading-value {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--navy);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 800;
}

.analytics-trend-insight {
  margin: 4px 0 18px;
  padding: 14px;
  border: 1px solid #e4eaf3;
  border-radius: 14px;
  background: #f8faff;
}

.analytics-trend-insight h3 {
  margin: 0;
  color: #66768e;
  font-size: 12px;
}

.analytics-trend-insight .insight-lead {
  margin-top: 7px;
}

.trend-chart-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: flex-end;
  flex-direction: column;
}

.analytics-view-toggle {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(52px, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid #e7ecf3;
  border-radius: 12px;
  background: #f4f7fb;
}

.analytics-view-toggle button {
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  border-radius: 9px;
  color: #6d798b;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition:
    color 280ms ease,
    background-color 280ms ease,
    box-shadow 280ms ease,
    transform 280ms ease;
}

.analytics-view-toggle button:hover,
.analytics-view-toggle button:focus-visible {
  color: var(--navy);
  background: rgb(255 255 255 / 75%);
}

.analytics-view-toggle button[aria-pressed="true"] {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 5px 12px rgb(40 100 215 / 20%);
}

.analytics-view-toggle button[aria-pressed="true"]:active {
  transform: scale(0.98);
}

.analytics-chart-legend {
  display: flex;
  gap: 7px 14px;
  margin: -2px 0 12px;
  flex-wrap: wrap;
}

.analytics-chart-legend-item {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #5f6e83;
  font-size: 10.5px;
  font-weight: 700;
}

.analytics-chart-legend-item i,
.analytics-chart-tooltip-rows i {
  display: inline-block;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.analytics-chart {
  position: relative;
  min-height: 310px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #edf0f5;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfcfe, #fff);
  overscroll-behavior-inline: contain;
}

.analytics-chart svg {
  display: block;
  width: 100%;
  height: 310px;
  animation: analytics-chart-reveal 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes analytics-chart-reveal {
  from {
    opacity: 0.45;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.analytics-chart-grid {
  stroke: #e8edf4;
  stroke-width: 1;
}

.analytics-chart-y-label,
.analytics-chart-x-label {
  fill: #8793a5;
  font-size: 10px;
  font-weight: 650;
}

.analytics-chart-bar {
  fill: #bcd0f2;
}

.analytics-chart-segment {
  transition: opacity 280ms ease;
}

.analytics-chart-segment.grouped {
  opacity: 0.9;
}

.analytics-chart-hover-zone {
  fill: transparent;
  outline: none;
  cursor: crosshair;
}

.analytics-chart-hover-zone:hover,
.analytics-chart-hover-zone:focus {
  fill: rgb(40 100 215 / 5%);
}

.analytics-chart-tooltip {
  position: absolute;
  z-index: 4;
  top: 12px;
  box-sizing: border-box;
  width: min(250px, calc(100% - 24px));
  max-width: calc(100vw - 24px);
  padding: 12px;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 12px;
  color: #fff;
  background: rgb(25 39 62 / 94%);
  box-shadow: 0 10px 24px rgb(21 34 56 / 24%);
  pointer-events: none;
  transform: translateX(-50%);
}

.analytics-chart-tooltip > strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.analytics-chart-tooltip-rows {
  display: grid;
  gap: 6px;
  max-height: 195px;
  overflow: hidden;
}

.analytics-chart-tooltip-rows > div,
.analytics-chart-tooltip-total {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
}

.analytics-chart-tooltip-rows > div > span {
  display: flex;
  gap: 6px;
  min-width: 0;
  align-items: center;
}

.analytics-chart-tooltip-rows > div > span > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-chart-tooltip-rows b,
.analytics-chart-tooltip-total b {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.analytics-chart-tooltip-rows small {
  color: #c9d3e1;
  font-size: 10.5px;
}

.analytics-chart-tooltip-total {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgb(255 255 255 / 18%);
  font-size: 11.5px;
}

.analytics-chart-line {
  fill: none;
  stroke: var(--blue);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  pointer-events: none;
}

.analytics-chart-bar.target {
  fill: #b7ddcf;
}

.analytics-chart-line.target {
  stroke: var(--success);
}

.analytics-target-line {
  stroke: #d25a67;
  stroke-dasharray: 7 5;
  stroke-width: 2;
  pointer-events: none;
}

.analytics-target-line-label {
  fill: #b04752;
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
}

.analytics-settings-link {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.target-progress-summary {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
  margin: 18px 2px 9px;
}

.target-progress-summary > div span {
  display: block;
  margin-bottom: 4px;
  color: #7c899c;
  font-size: 11px;
}

.target-progress-summary > div strong {
  color: #26364f;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.target-progress-status {
  font-size: 11px;
  font-weight: 800;
}

.target-progress-status.within {
  color: var(--success);
}

.target-progress-status.over {
  color: var(--danger);
}

.target-progress-track {
  height: 10px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9edf3;
}

.target-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 220ms ease;
}

.target-progress-track span.within {
  background: var(--success);
}

.target-progress-track span.over {
  background: var(--danger);
}

.analytics-breakdown-heading {
  align-items: center;
}

.analytics-breakdown-description {
  max-width: 580px;
  margin: 7px 0 0;
  color: #748298;
  font-size: 12px;
  line-height: 1.55;
}

.analytics-breakdown-toggle {
  flex: 0 0 auto;
  grid-template-columns: repeat(2, 68px);
}

.analytics-breakdown-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
}

.analytics-breakdown-list {
  display: grid;
  gap: 0;
  margin-top: 20px;
  animation: analytics-breakdown-reveal 280ms ease both;
}

@keyframes analytics-breakdown-reveal {
  from {
    opacity: 0.35;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.analytics-breakdown-row {
  padding: 15px 0;
  border-bottom: 1px solid #edf1f6;
}

.analytics-breakdown-row:first-child {
  padding-top: 0;
}

.analytics-breakdown-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.analytics-breakdown-row > div:first-child {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.analytics-breakdown-row > div:first-child strong {
  min-width: 0;
  overflow: hidden;
  color: #34435a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-breakdown-row > div:first-child span {
  flex: 0 0 auto;
  color: #7d899a;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.analytics-breakdown-row-meta {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
}

.analytics-breakdown-row > div:first-child .analytics-breakdown-row-meta > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-breakdown-detail-toggle {
  display: inline-flex;
  min-height: 26px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  align-items: center;
  gap: 5px;
  justify-content: center;
  background: #edf3fc;
  color: #48617f;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  transition:
    color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.analytics-breakdown-detail-toggle:hover {
  background: #e2ebfa;
  color: #2259bd;
}

.analytics-breakdown-detail-toggle:active {
  transform: scale(0.97);
}

.analytics-breakdown-detail-toggle:focus-visible {
  outline: 3px solid rgb(40 100 215 / 22%);
  outline-offset: 2px;
}

.analytics-breakdown-detail-label {
  color: inherit;
  font-size: inherit;
}

.analytics-breakdown-detail-icon {
  display: block;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentcolor;
  border-bottom: 1.5px solid currentcolor;
  color: inherit;
  transform: translateY(-1px) rotate(45deg);
  transition: transform 220ms ease;
}

.analytics-breakdown-detail-toggle[aria-expanded="true"] .analytics-breakdown-detail-icon {
  transform: translateY(2px) rotate(225deg);
}

.analytics-breakdown-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f6;
}

.analytics-breakdown-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #77a0e5, #9db9e9);
}

.analytics-breakdown-forecast {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid #e0e8f4;
  border-radius: 12px;
  background: #f7f9fd;
  animation: analytics-forecast-detail-reveal 240ms ease both;
}

.analytics-breakdown-forecast[hidden] {
  display: none;
}

@keyframes analytics-forecast-detail-reveal {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.analytics-breakdown-forecast > span {
  min-width: 0;
  padding: 0 10px;
  border-right: 1px solid #e2e8f1;
}

.analytics-breakdown-forecast > span:first-child {
  padding-left: 0;
}

.analytics-breakdown-forecast > span:last-child {
  padding-right: 0;
  border-right: 0;
}

.analytics-breakdown-forecast small,
.analytics-breakdown-forecast strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-breakdown-forecast small {
  color: #7c899c;
  font-size: 10px;
  font-weight: 700;
}

.analytics-breakdown-forecast strong {
  margin-top: 4px;
  color: #34435a;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.analytics-breakdown-forecast .emphasized small,
.analytics-breakdown-forecast .emphasized strong {
  color: #2864d7;
}

.analytics-breakdown-total-row {
  padding-top: 0;
}

.analytics-breakdown-total-row + .analytics-breakdown-list,
.analytics-breakdown-total-row ~ .analytics-breakdown-list {
  margin-top: 0;
}

.analytics-breakdown-total-row > div:first-child b {
  color: inherit;
  font-weight: 800;
}

.analytics-breakdown-total-row .analytics-breakdown-track span {
  width: 100%;
}

.analytics-total-confidence {
  color: inherit;
  font-style: normal;
}

.analytics-total-confidence[data-level="medium"] {
  color: #2864d7;
}

.analytics-total-confidence[data-level="high"] {
  color: #137356;
}

.analytics-empty {
  display: grid;
  min-height: 100px;
  margin: 0;
  padding: 20px;
  place-items: center;
  color: #8994a5;
  font-size: 12px;
  text-align: center;
}

.analytics-monthly-heading {
  gap: 16px;
  align-items: center;
  flex-wrap: nowrap;
}

.analytics-monthly-heading > div:first-child {
  min-width: 0;
}

.analytics-monthly-navigation {
  display: grid;
  grid-template-columns: 34px minmax(108px, auto) 34px;
  gap: 5px;
  align-items: center;
  padding: 4px;
  border: 1px solid #e1e7f0;
  border-radius: 999px;
  background: #f5f7fb;
}

.analytics-monthly-navigation button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  place-items: center;
  color: #385782;
  background: #fff;
  box-shadow: 0 1px 4px rgb(32 54 88 / 9%);
  cursor: pointer;
}

.analytics-monthly-navigation button:focus-visible,
.analytics-monthly-carousel:focus-visible {
  outline: 3px solid rgb(40 100 215 / 18%);
  outline-offset: 2px;
}

.analytics-monthly-navigation button:disabled {
  color: #b6c0cf;
  background: transparent;
  box-shadow: none;
  cursor: default;
}

.analytics-monthly-navigation button span {
  width: 7px;
  height: 7px;
  border: solid currentcolor;
  border-width: 0 2px 2px 0;
}

.analytics-monthly-navigation button:first-child span {
  transform: rotate(135deg);
}

.analytics-monthly-navigation button:last-child span {
  transform: rotate(-45deg);
}

.analytics-monthly-navigation strong {
  color: #294261;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

.analytics-monthly-carousel {
  overflow: hidden;
  border-radius: 14px;
  outline: none;
  touch-action: pan-y;
  cursor: grab;
}

.analytics-monthly-carousel.is-swiping {
  cursor: grabbing;
}

.analytics-monthly-card-view {
  min-height: 180px;
  padding: 18px;
  border: 1px solid #e4e9f1;
  border-radius: 14px;
  background: #fbfcfe;
  transition: transform 220ms ease, opacity 220ms ease;
  will-change: transform, opacity;
}

.analytics-monthly-card-view.enter-from-left {
  animation: monthly-summary-from-left 360ms cubic-bezier(0.22, 0.7, 0.24, 1);
}

.analytics-monthly-card-view.enter-from-right {
  animation: monthly-summary-from-right 360ms cubic-bezier(0.22, 0.7, 0.24, 1);
}

@keyframes monthly-summary-from-left {
  from {
    opacity: 0.35;
    transform: translateX(-40px);
  }
}

@keyframes monthly-summary-from-right {
  from {
    opacity: 0.35;
    transform: translateX(40px);
  }
}

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

.analytics-monthly-metric {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border-radius: 11px;
  background: #f4f7fb;
  font-variant-numeric: tabular-nums;
}

.analytics-monthly-metric > span {
  color: #8592a7;
  font-size: 10px;
  font-weight: 800;
}

.analytics-monthly-metric > strong:not(.analytics-target-badge) {
  min-width: 0;
  overflow: hidden;
  color: #34465f;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-monthly-metric .analytics-target-badge {
  width: fit-content;
  max-width: 100%;
}

.analytics-monthly-swipe-hint {
  display: none;
  margin: 9px 0 0;
  color: #929db0;
  font-size: 10px;
  text-align: center;
}

.analytics-target-badge {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.analytics-target-badge.within {
  color: var(--success);
  background: var(--success-soft);
}

.analytics-target-badge.over {
  color: var(--danger);
  background: var(--danger-soft);
}

.analytics-income-value,
.analytics-balance-value {
  font-weight: 800;
}

.analytics-monthly-memo-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e5eaf2;
}

.analytics-monthly-memo-label {
  display: block;
  margin-bottom: 8px;
  color: #8592a7;
  font-size: 10px;
  font-weight: 800;
}

.analytics-monthly-memo-unavailable {
  margin: 0;
  color: #8b96a6;
  font-size: 14px;
  line-height: 1.45;
}

.analytics-monthly-memo-display {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.analytics-monthly-memo-display p {
  display: -webkit-box;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #536178;
  line-height: 1.5;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.analytics-monthly-memo-display p.empty {
  color: #9aa4b3;
}

.analytics-monthly-memo-display button,
.analytics-monthly-memo-actions button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #d7e0ec;
  border-radius: 8px;
  color: #5f6f87;
  background: #f7f9fc;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.analytics-monthly-memo-display button:hover,
.analytics-monthly-memo-display button:focus-visible,
.analytics-monthly-memo-actions button[type="submit"] {
  border-color: #b9cceb;
  color: var(--blue);
  background: var(--blue-soft);
}

.analytics-monthly-memo-form {
  display: grid;
  gap: 7px;
}

.analytics-monthly-memo-form textarea {
  width: 100%;
  min-height: 74px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid #d9e0ea;
  border-radius: 9px;
  outline: none;
  color: #344258;
  background: #fff;
  font: inherit;
  line-height: 1.5;
}

.analytics-monthly-memo-form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(40 100 215 / 12%);
}

.analytics-monthly-memo-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.analytics-monthly-memo-actions button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.analytics-monthly-memo-status {
  min-height: 14px;
  color: #7d899a;
  font-size: 10px;
}

.analytics-monthly-memo-status.error {
  color: var(--danger);
}

.categories-page {
  --page-content-max-width: 724px;
}

.categories-intro {
  margin-bottom: 22px;
}

.personal-learning-section {
  margin-top: 36px;
  margin-bottom: 18px;
}

.personal-learning-card {
  display: grid;
  gap: 22px;
  padding: 20px;
}

.family-learning-ai-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #dce5f2;
  border-radius: 14px;
  background: #f6f8fc;
}

.family-learning-ai-card[data-ai-enabled="true"] {
  border-color: #c9e7da;
  background: linear-gradient(135deg, #f2fbf7, #f7fafc);
}

.family-learning-ai-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: #718198;
  box-shadow: 0 7px 16px rgb(50 67 91 / 14%);
  font-size: 19px;
}

.family-learning-ai-card[data-ai-enabled="true"] .family-learning-ai-icon {
  background: linear-gradient(145deg, #15946e, #2777c9);
}

.family-learning-ai-heading {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.family-learning-ai-heading h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--navy);
  font-size: 13px;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-learning-ai-heading span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: #607087;
  background: #e9eef5;
  font-size: 9.5px;
  font-weight: 850;
}

.family-learning-ai-card[data-ai-enabled="true"] .family-learning-ai-heading span {
  color: #18785d;
  background: #dcf3e9;
}

.family-learning-ai-card p {
  margin: 5px 0 0;
  color: #6f7d90;
  font-size: 10.5px;
  line-height: 1.5;
}

.family-learning-ai-usage {
  margin-top: 11px;
}

.family-learning-ai-usage-line {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: #34445b;
  font-size: 10.5px;
}

.family-learning-ai-usage-line strong {
  color: #173d70;
  font-size: 11px;
}

.family-learning-ai-usage-track {
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce8e4;
}

.family-learning-ai-usage-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #15946e, #2878c9);
  transition: width 420ms ease;
}

.family-learning-ai-usage small {
  display: block;
  margin-top: 5px;
  color: #718096;
  font-size: 9.5px;
}

.family-learning-ai-privacy {
  margin: -14px 0 0;
  padding: 0 3px;
  color: #7a8799;
  font-size: 10px;
  line-height: 1.55;
}

.family-ai-learning-action {
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid #d7e5f2;
  border-radius: 15px;
  background: linear-gradient(145deg, #f8fbff, #f1f8f5);
}

.family-ai-learning-action h3,
.family-ai-learning-report h3,
.family-ai-learning-report h4 {
  margin: 0;
  color: var(--navy);
}

.family-ai-learning-action h3 {
  font-size: 13px;
}

.family-ai-learning-action p {
  margin: 5px 0 0;
  color: #6f7d90;
  font-size: 10.5px;
  line-height: 1.55;
}

.family-ai-learning-action button,
.family-ai-learning-report > button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #168d6b, #286fd0);
  box-shadow: 0 8px 18px rgb(30 93 138 / 18%);
  font-size: 11px;
  font-weight: 850;
}

.family-ai-learning-action button:disabled {
  color: #8995a5;
  background: #e7ebf1;
  box-shadow: none;
}

.family-ai-learning-report {
  padding: 17px;
  border: 1px solid #cce4da;
  border-radius: 16px;
  background: #f7fcfa;
}

.family-ai-learning-report-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.family-ai-learning-report-heading span {
  display: block;
  margin-bottom: 4px;
  color: #1a8667;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.family-ai-learning-report-heading h3 {
  font-size: 14px;
}

.family-ai-learning-report-heading small {
  flex: 0 0 auto;
  color: #728096;
  font-size: 9px;
  text-align: right;
}

#family-ai-learning-report-summary {
  margin: 10px 0 13px;
  color: #415269;
  font-size: 11px;
  line-height: 1.65;
}

.family-ai-learning-findings {
  display: grid;
  gap: 8px;
}

.family-ai-learning-findings article {
  padding: 11px;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 3px 12px rgb(31 74 67 / 7%);
}

.family-ai-learning-findings strong {
  color: #203955;
  font-size: 10.5px;
}

.family-ai-learning-findings p {
  margin: 4px 0 0;
  color: #66768b;
  font-size: 10px;
  line-height: 1.55;
}

.family-ai-learning-recommendations {
  margin: 14px 0;
}

.family-ai-learning-recommendations h4 {
  font-size: 11px;
}

.family-ai-learning-recommendations ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding-left: 18px;
  color: #53657a;
  font-size: 10px;
  line-height: 1.5;
}

.family-ai-learning-report > button {
  width: 100%;
  color: #166f57;
  background: #def3ea;
  box-shadow: none;
}

.family-learning-overview,
.family-learning-patterns,
.family-learning-conflicts {
  padding-bottom: 20px;
  border-bottom: 1px solid #e9edf3;
}

.family-learning-section-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 13px;
}

.family-learning-section-heading.compact {
  margin-bottom: 11px;
}

.family-learning-section-heading h3,
.learning-category-title {
  margin: 0;
  color: var(--navy);
  font-size: 14px;
  letter-spacing: -0.025em;
}

.family-learning-section-heading p {
  margin: 5px 0 0;
  color: #7a8799;
  font-size: 10.5px;
  line-height: 1.5;
}

.family-learning-section-heading > strong {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 9px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 10.5px;
}

.family-learning-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.family-learning-metrics article {
  min-width: 0;
  padding: 12px;
  border: 1px solid #edf1f5;
  border-radius: 12px;
  background: #f8fafc;
}

.family-learning-metrics span,
.family-learning-metrics strong {
  display: block;
}

.family-learning-metrics span {
  overflow: hidden;
  color: #7d899a;
  font-size: 9.5px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-learning-metrics strong {
  margin-top: 6px;
  color: var(--navy);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.family-learning-metrics strong.needs-attention {
  color: var(--danger);
}

.family-learning-coverage-track {
  height: 7px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f5;
}

.family-learning-coverage-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f9e78, #62bea0);
  transition: width 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.family-learning-coverage-help {
  margin: 9px 0 0;
  color: #6f7c8f;
  font-size: 10.5px;
  line-height: 1.55;
}

.learning-patterns-list,
.learning-conflicts-list {
  display: grid;
  gap: 7px;
}

.learning-pattern-row,
.learning-conflict-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 11px;
  border-radius: 11px;
  background: #f7f9fc;
}

.learning-pattern-row > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.learning-pattern-row strong,
.learning-conflict-row strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learning-pattern-row > div > span,
.learning-conflict-row > span {
  color: #6f7d90;
  font-size: 10px;
  line-height: 1.45;
}

.learning-pattern-evidence {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}

.family-learning-conflicts {
  padding: 14px;
  border: 1px solid #f2d8dc;
  border-radius: 13px;
  background: #fff8f8;
}

.learning-conflict-row {
  align-items: flex-start;
  flex-direction: column;
  background: #fff;
}

.learning-conflict-row small {
  color: var(--danger);
  font-size: 9.5px;
  font-weight: 750;
}

.learning-conflict-action {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.learning-conflict-review {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #cbdcf4;
  border-radius: 9px;
  color: #2159b6;
  background: #eef4ff;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
}

.learning-conflict-review:hover,
.learning-conflict-review:focus-visible {
  border-color: #9ebbea;
  color: #17448e;
  background: #e1ecff;
}

.family-learning-empty {
  margin: 0;
  padding: 12px;
  border-radius: 11px;
  color: #8792a2;
  background: #f7f9fc;
  font-size: 10.5px;
  text-align: center;
}

.learning-category-title {
  margin-top: 16px;
}

#learning-profile-form > label {
  display: block;
  margin-bottom: 7px;
  color: #526178;
  font-size: 12px;
  font-weight: 800;
}

.personal-learning-help {
  margin: 8px 0 0;
  color: #7a8799;
  font-size: 11px;
  line-height: 1.55;
}

#personal-classification-instructions {
  width: 100%;
  min-height: 110px;
  padding: 13px 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font: inherit;
  line-height: 1.55;
}

#personal-classification-instructions:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(40 100 215 / 12%);
}

.learning-category-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}

.learning-category-summary span {
  padding: 7px 10px;
  border-radius: 999px;
  color: #526178;
  background: #f1f4f8;
  font-size: 11px;
  font-weight: 750;
}

#learning-profile-form > .primary-button {
  max-width: 280px;
  margin-top: 15px;
}

.runtime-prompt-preview {
  border-top: 1px solid #e9edf3;
  padding-top: 16px;
}

.runtime-prompt-preview summary {
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.runtime-prompt-preview pre {
  max-height: 320px;
  margin: 13px 0 0;
  padding: 14px;
  overflow: auto;
  border-radius: 12px;
  color: #45536a;
  background: #f7f9fc;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.spending-target-section {
  margin-bottom: 18px;
}

.income-source-settings-section {
  margin-bottom: 18px;
}

.income-sources-card {
  padding: 20px;
}

.income-sources-help {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.income-sources-list {
  display: grid;
  gap: 9px;
}

.income-source-settings-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.income-source-settings-icon {
  width: 100%;
  min-width: 0;
}

.income-source-remove-button {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid #ecc9d0;
  border-radius: 11px;
  color: var(--danger);
  background: #fff7f8;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.income-source-remove-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.income-source-add-button {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border: 1px dashed #b9c8dd;
  border-radius: 11px;
  color: #42699f;
  background: #f5f8fc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.spending-target-card {
  padding: 20px;
}

.spending-target-amount-field {
  max-width: 360px;
}

.spending-target-amount-field > label,
.spending-target-categories legend {
  display: block;
  margin-bottom: 7px;
  color: #526178;
  font-size: 12px;
  font-weight: 800;
}

.spending-target-categories {
  min-width: 0;
  margin: 20px 0 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid #e9edf3;
}

.spending-target-categories > p {
  margin: -1px 0 12px;
  color: #7a8799;
  font-size: 11px;
  line-height: 1.55;
}

.spending-target-category-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spending-target-category-option {
  position: relative;
  cursor: pointer;
}

.spending-target-category-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.spending-target-category-option span {
  display: inline-flex;
  min-height: 37px;
  padding: 8px 11px;
  align-items: center;
  border: 1px solid #dbe2ec;
  border-radius: 999px;
  color: #65738a;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 750;
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background-color 150ms ease;
}

.spending-target-category-option input:checked + span {
  border-color: #9bb9e9;
  color: var(--navy);
  background: var(--blue-soft);
}

.spending-target-category-option input:focus-visible + span {
  outline: 3px solid rgb(40 100 215 / 18%);
  outline-offset: 2px;
}

.spending-target-status {
  margin-top: 15px;
}

.spending-target-card > .primary-button {
  max-width: 280px;
}

/* Personal spending challenges ------------------------------------------------ */
.spending-goals-builder {
  display: grid;
  gap: 16px;
}

.spending-goals-intro {
  margin: 0;
  padding: 14px 15px;
  border: 1px solid #cde6e0;
  border-radius: 15px;
  color: #42625c;
  background: #f1fbf8;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.65;
}

.spending-goal-presets,
.spending-goal-list-section {
  padding: 16px;
  border: 1px solid #e1ebe8;
  border-radius: 17px;
  background: #fff;
}

.spending-goal-section-heading,
.spending-goal-form-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.spending-goal-section-heading .eyebrow,
.spending-goal-form-heading .eyebrow {
  margin: 0 0 3px;
  color: #5b8a80;
  font-size: 10px;
}

.spending-goal-section-heading h3,
.spending-goal-form-heading h3 {
  margin: 0;
  color: #263a36;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.spending-goal-section-heading > span {
  color: #78908a;
  font-size: 11px;
  font-weight: 750;
  text-align: right;
}

.spending-goal-preset-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.spending-goal-preset {
  display: flex;
  min-height: 54px;
  gap: 8px;
  padding: 10px;
  align-items: center;
  border: 1px solid #d7ebe5;
  border-radius: 13px;
  color: #31564e;
  background: #fbfffd;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.spending-goal-preset > span {
  display: inline-grid;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  place-items: center;
  border-radius: 10px;
  background: #e8faf5;
  font-size: 16px;
}

.spending-goal-preset:hover,
.spending-goal-preset:focus-visible {
  border-color: #8dcbbb;
  outline: none;
  background: #f0fcf8;
  box-shadow: 0 7px 15px rgb(35 118 106 / 10%);
  transform: translateY(-1px);
}

.spending-goal-list {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.spending-goal-empty {
  margin: 0;
  padding: 17px 10px;
  border: 1px dashed #cdded9;
  border-radius: 12px;
  color: #70827e;
  background: #f9fcfb;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.spending-goal-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px;
  align-items: start;
  border: 1px solid #dbeae5;
  border-radius: 14px;
  background: #fbfffd;
}

.spending-goal-card-main {
  min-width: 0;
}

.spending-goal-card-title-row {
  display: flex;
  gap: 7px;
  align-items: center;
}

.spending-goal-card-title-row strong {
  overflow: hidden;
  color: #28443e;
  font-size: 13px;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spending-goal-card-kind {
  display: inline-flex;
  padding: 3px 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #3f796d;
  background: #e6f7f1;
  font-size: 10px;
  font-weight: 850;
}

.spending-goal-card-main > p {
  margin: 6px 0 0;
  overflow: hidden;
  color: #6a7e79;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spending-goal-card-actions {
  display: flex;
  gap: 5px;
}

.spending-goal-card-actions button,
.spending-goal-form-heading > button {
  min-height: 31px;
  padding: 5px 8px;
  border: 1px solid #d8e6e1;
  border-radius: 9px;
  color: #58746d;
  background: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.spending-goal-card-actions button:hover,
.spending-goal-card-actions button:focus-visible,
.spending-goal-form-heading > button:hover,
.spending-goal-form-heading > button:focus-visible {
  border-color: #99ccbf;
  color: #1e6759;
  outline: none;
  background: #effaf7;
}

.spending-goal-card-actions [data-goal-action="remove"] {
  border-color: #efd6d9;
  color: #ad5961;
  background: #fffafb;
}

.spending-goal-form {
  display: grid;
  gap: 17px;
  padding: 18px;
  border-color: #bddfd5;
  background: linear-gradient(145deg, #f9fffd 0%, #fff 66%);
}

.spending-goal-field {
  display: grid;
  gap: 7px;
}

.spending-goal-field > span:first-child,
.spending-goal-choice-group legend,
.spending-goal-filter-fields legend {
  color: #4f645f;
  font-size: 12px;
  font-weight: 850;
}

.spending-goal-field em {
  margin-left: 3px;
  color: #8a9c97;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.spending-goal-field input {
  width: 100%;
  min-height: 43px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #cfdfda;
  border-radius: 11px;
  color: #263b36;
  background: #fff;
  font: inherit;
  font-size: 14px;
}

.spending-goal-field input:focus {
  border-color: #74b9a8;
  outline: 3px solid rgb(116 185 168 / 18%);
}

.spending-goal-choice-group,
.spending-goal-filter-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.spending-goal-choice-group legend,
.spending-goal-filter-fields legend {
  margin-bottom: 8px;
}

.spending-goal-choice-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.spending-goal-choice-options label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.spending-goal-choice-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.spending-goal-choice-options span {
  display: flex;
  min-height: 43px;
  box-sizing: border-box;
  padding: 10px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d5e2de;
  border-radius: 11px;
  color: #637671;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background-color 150ms ease;
}

.spending-goal-choice-options input:checked + span {
  border-color: #8bc7b9;
  color: #1e6659;
  background: #e9faf5;
}

.spending-goal-choice-options input:focus-visible + span {
  outline: 3px solid rgb(116 185 168 / 20%);
  outline-offset: 2px;
}

.spending-goal-filter-fields > p {
  margin: 7px 0 0;
  color: #788985;
  font-size: 11px;
  line-height: 1.5;
}

.spending-goal-category-options {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.spending-goal-category-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spending-goal-category-bubble {
  min-height: 37px;
  padding: 8px 11px;
  border: 1px solid #d8e5e1;
  border-radius: 999px;
  color: #5f746e;
  background: #f8fbfa;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background-color 150ms ease;
}

.spending-goal-category-bubble.active {
  border-color: #8bc7b9;
  color: #1e6659;
  background: #e9faf5;
}

.spending-goal-category-bubble.has-selection::after {
  margin-left: 5px;
  color: #25826f;
  content: "✓";
  font-weight: 900;
}

.spending-goal-category-bubble:focus-visible {
  outline: 3px solid rgb(116 185 168 / 20%);
  outline-offset: 2px;
}

.spending-goal-subcategory-panel {
  padding: 11px 12px 12px;
  border: 1px solid #d8e5e1;
  border-radius: 12px;
  background: #fbfdfc;
}

.spending-goal-subcategory-panel[hidden] {
  display: none;
}

.spending-goal-subcategory-panel > strong {
  display: block;
  margin-bottom: 8px;
  color: #4f645f;
  font-size: 11px;
  font-weight: 850;
}

.spending-goal-category-whole-option,
.spending-goal-subcategory-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.spending-goal-category-whole-option input,
.spending-goal-subcategory-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.spending-goal-subcategory-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.spending-goal-category-whole-option span,
.spending-goal-subcategory-option span {
  display: block;
  padding: 7px 10px;
  border: 1px solid #d8e5e1;
  border-radius: 999px;
  color: #687b76;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background-color 150ms ease,
    opacity 150ms ease;
}

.spending-goal-category-whole-option span {
  border-color: #bddbd3;
  color: #446d63;
  background: #f2faf7;
}

.spending-goal-category-whole-option input:checked + span,
.spending-goal-subcategory-option input:checked + span {
  border-color: #8bc7b9;
  color: #1e6659;
  background: #e9faf5;
}

.spending-goal-category-whole-option input:focus-visible + span,
.spending-goal-subcategory-option input:focus-visible + span {
  outline: 3px solid rgb(116 185 168 / 20%);
  outline-offset: -2px;
}

.spending-goal-category-whole-option input:disabled + span,
.spending-goal-subcategory-option input:disabled + span {
  cursor: not-allowed;
  opacity: 0.45;
}

.spending-goal-limit-field .amount-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #cfdfda;
  border-radius: 11px;
  background: #fff;
}

.spending-goal-limit-field .amount-input-wrap:focus-within {
  border-color: #74b9a8;
  outline: 3px solid rgb(116 185 168 / 18%);
}

.spending-goal-limit-field .amount-input-wrap input {
  border: 0;
  border-radius: 0;
  outline: 0 !important;
}

.spending-goal-limit-field .amount-input-wrap strong {
  display: grid;
  min-width: 42px;
  padding: 0 12px;
  place-items: center;
  color: #5a716b;
  background: #f1f8f6;
  font-size: 13px;
}

.spending-goal-preview {
  margin: -5px 0 0;
  padding: 11px 12px;
  border-radius: 11px;
  color: #3f6c62;
  background: #eaf7f3;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.5;
}

.spending-goal-status {
  margin: -5px 0 0;
}

.spending-goal-form > .primary-button {
  width: 100%;
  max-width: none;
}

.spending-target-budget-details {
  margin-top: 19px;
  border-top: 1px solid #dbe7e3;
}

.spending-target-budget-details > summary {
  padding: 17px 1px 7px;
  color: #60746f;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.spending-target-budget-details > p {
  margin: 3px 0 12px;
  color: #7a8b87;
  font-size: 11px;
  line-height: 1.5;
}

.spending-target-budget-details .spending-target-card {
  margin: 0;
  border-color: #e0eae7;
  box-shadow: none;
}

@media (max-width: 440px) {
  .spending-goal-preset-list {
    grid-template-columns: 1fr;
  }

  .spending-goal-preset {
    min-height: 49px;
  }
}

.category-settings-launch-card {
  display: flex;
  gap: 18px;
  padding: 18px;
  align-items: center;
  justify-content: space-between;
}

.category-settings-section {
  margin-bottom: 18px;
}

.category-settings-launch-card > div {
  display: flex;
  gap: 12px;
  min-width: 0;
  align-items: center;
}

.category-settings-launch-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--blue-soft);
  font-size: 20px;
}

.category-settings-launch-card strong {
  display: block;
  color: var(--navy);
  font-size: 15px;
}

.category-settings-launch-card p {
  margin: 5px 0 0;
  color: #738096;
  font-size: 11px;
  line-height: 1.45;
}

.category-settings-launch-button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 8px 15px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--navy);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.category-settings-launch-button:hover,
.category-settings-launch-button:focus-visible {
  background: var(--blue);
  outline: 3px solid rgb(40 100 215 / 16%);
}

.category-settings-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
  max-height: calc(100svh - 32px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  background: #f5f7fb;
  box-shadow: 0 24px 70px rgb(16 31 55 / 30%);
}

.category-settings-dialog::backdrop {
  background: rgb(17 29 49 / 48%);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.category-settings-dialog-shell {
  display: flex;
  max-height: calc(100svh - 32px);
  flex-direction: column;
}

.category-settings-dialog-header {
  display: flex;
  flex: 0 0 auto;
  padding: 18px 20px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e7ef;
  background: #fff;
}

.category-settings-dialog-header .eyebrow {
  margin-bottom: 4px;
}

.category-settings-dialog-header h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.category-settings-dialog-close {
  display: inline-grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #66758a;
  background: #eef1f5;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.category-settings-dialog-close:hover,
.category-settings-dialog-close:focus-visible {
  color: var(--navy);
  background: #e2e8f2;
  outline: 3px solid rgb(40 100 215 / 14%);
}

.category-settings-dialog-close:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.category-settings-dialog-scroll {
  min-height: 0;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.category-settings-dialog .category-settings-note {
  margin-bottom: 18px;
}

.category-settings-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 28px;
  padding: 13px 15px;
  border: 1px solid #d8e3f2;
  border-radius: 13px;
  color: #53647c;
  background: #f2f7fd;
  font-size: 12px;
  line-height: 1.55;
}

.category-settings-note p {
  margin: 0;
}

.category-settings-status {
  margin-bottom: 12px;
}

.category-settings-list {
  display: grid;
  gap: 13px;
}

.category-settings-card {
  padding: 18px;
}

.category-settings-card-header {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: end;
}

.category-emoji-field,
.category-name-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #59677c;
  font-size: 11px;
  font-weight: 750;
}

.category-emoji-select,
.category-name-field input,
.subcategory-settings-row input {
  width: 100%;
  min-width: 0;
  height: 43px;
  border: 1px solid #d9e0ea;
  border-radius: 11px;
  outline: none;
  color: #263247;
  background: #fff;
}

.category-emoji-select {
  padding: 5px 9px;
  font-size: 22px;
  text-align: center;
}

.category-name-field input,
.subcategory-settings-row input {
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 700;
}

.category-emoji-select:focus,
.category-name-field input:focus,
.subcategory-settings-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(40 100 215 / 12%);
}

.category-remove-button,
.subcategory-remove-button,
.subcategory-move-button {
  min-height: 36px;
  padding: 6px 9px;
  border: 0;
  border-radius: 9px;
  color: #9a5962;
  background: #fff2f3;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.subcategory-move-button {
  color: #315f9e;
  background: #edf4ff;
}

.category-remove-button:disabled,
.subcategory-remove-button:disabled,
.subcategory-move-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.subcategory-settings-panel {
  margin-top: 15px;
  border-top: 1px solid #edf0f5;
}

.subcategory-settings-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 12px;
  gap: 8px;
  min-height: 40px;
  padding: 12px 4px 0;
  align-items: center;
  border-radius: 9px;
  list-style: none;
  cursor: pointer;
}

.subcategory-settings-summary::-webkit-details-marker {
  display: none;
}

.subcategory-settings-summary:hover,
.subcategory-settings-summary:focus-visible {
  color: var(--blue);
  outline: none;
}

.subcategory-settings-summary strong {
  color: #405069;
  font-size: 13px;
}

.subcategory-settings-summary:hover strong,
.subcategory-settings-summary:focus-visible strong {
  color: var(--blue);
}

.subcategory-settings-count {
  padding: 3px 7px;
  border-radius: 999px;
  color: #8792a3;
  background: #f1f4f8;
  font-size: 11px;
  font-weight: 700;
}

.subcategory-settings-arrow {
  width: 8px;
  height: 8px;
  border-right: 2px solid #77849a;
  border-bottom: 2px solid #77849a;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 150ms ease;
}

.subcategory-settings-panel[open] .subcategory-settings-arrow {
  transform: translateY(2px) rotate(225deg);
}

.subcategory-settings-body {
  padding-top: 10px;
}

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

.subcategory-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.subcategory-settings-row input {
  height: 38px;
  padding: 7px 10px;
  background: #f7f9fc;
  font-size: 12px;
}

.subcategory-settings-row-actions {
  display: flex;
  gap: 5px;
}

.subcategory-move-dialog[hidden] {
  display: none;
}

.subcategory-move-dialog {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
}

.subcategory-move-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgb(15 23 42 / 48%);
  cursor: default;
}

.subcategory-move-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 22px;
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(24 39 75 / 28%);
}

.subcategory-move-panel h3 {
  margin: 3px 0 8px;
  color: #263247;
  font-size: 20px;
}

.subcategory-move-panel > p:not(.eyebrow) {
  margin: 0 0 17px;
  color: #69758a;
  font-size: 13px;
  line-height: 1.55;
}

.subcategory-move-field {
  display: grid;
  gap: 7px;
  color: #526177;
  font-size: 12px;
  font-weight: 800;
}

.subcategory-move-field select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #d6deea;
  border-radius: 11px;
  color: #263247;
  background: #fff;
  font: inherit;
}

.subcategory-move-mobile-options {
  display: none;
}

.subcategory-move-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8px;
  margin-top: 18px;
}

.subcategory-move-actions button {
  min-height: 42px;
  margin: 0;
  border: 0;
  border-radius: 11px;
  font-weight: 800;
  cursor: pointer;
}

.subcategory-move-actions button:first-child {
  color: #59677c;
  background: #eef1f5;
}

.subcategory-add-button,
.category-add-button {
  min-height: 38px;
  border: 1px dashed #b9c8dd;
  border-radius: 10px;
  color: #42699f;
  background: #f5f8fc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.subcategory-add-button {
  width: 100%;
  margin-top: 8px;
}

.category-settings-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 9px;
  margin-top: 14px;
}

.category-settings-actions .primary-button {
  margin-top: 0;
}

.category-settings-dialog-actions {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 15px 18px;
  border-top: 1px solid #e2e7ef;
  background: #fff;
}

.settings-dialog-single-action {
  grid-template-columns: 1fr;
}

.settings-dialog-single-action .primary-button {
  width: 100%;
  max-width: none;
}

.deleted-expenses-section {
  margin-bottom: 18px;
}

.deleted-expenses-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 13px;
  padding: 13px 15px;
  border: 1px solid #ead9dc;
  border-radius: 13px;
  color: #705d62;
  background: #fff6f7;
  font-size: 12px;
  line-height: 1.55;
}

.deleted-expenses-note p {
  margin: 0;
}

.deleted-expenses-status {
  margin-bottom: 12px;
}

.deleted-expenses-list {
  display: grid;
  gap: 9px;
}

.deleted-expense-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.deleted-expense-content {
  min-width: 0;
}

.deleted-expense-labels,
.deleted-expense-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.deleted-expense-labels {
  margin-bottom: 7px;
}

.deleted-expense-source,
.deleted-expense-expiry {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.deleted-expense-source {
  color: #52647c;
  background: #edf1f6;
}

.deleted-expense-expiry {
  color: #a34853;
  background: #fff0f2;
}

.deleted-expense-content > strong {
  display: block;
  overflow: hidden;
  margin-bottom: 7px;
  color: #253249;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deleted-expense-meta {
  color: #6e7b8f;
  font-size: 11px;
  font-weight: 650;
}

.deleted-expense-meta span:not(:last-child)::after {
  margin-left: 7px;
  color: #c2cad5;
  content: "·";
}

.deleted-expense-memo {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: #8792a3;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deleted-expense-restore {
  min-width: 64px;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid #c9d8ee;
  border-radius: 10px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.deleted-expense-restore:hover,
.deleted-expense-restore:focus-visible {
  color: #fff;
  background: var(--blue);
}

.deleted-expense-restore:disabled {
  cursor: wait;
  opacity: 0.6;
}

.deleted-expenses-empty {
  padding: 30px 18px;
  text-align: center;
}

.deleted-expenses-empty span {
  display: inline-grid;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 12px;
  color: var(--success);
  background: var(--success-soft);
  font-weight: 850;
}

.deleted-expenses-empty strong {
  display: block;
  font-size: 14px;
}

@media (min-width: 600px) {
  .page-shell {
    padding-top: 34px;
  }

  .user-form-card {
    padding: 27px 27px 22px;
  }

  .expense-form-card {
    padding: 27px 27px 22px;
  }

  .expense-fields {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 2.2fr);
    gap: 13px;
  }

}

@media (max-width: 599px) {
  .mobile-hidden {
    display: none !important;
  }

  .compact-page {
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .compact-page .app-header {
    margin-bottom: 16px;
  }

  .compact-page .expense-intro {
    margin-bottom: 14px;
  }

  .compact-page .expense-intro h1 {
    font-size: clamp(20px, 6vw, 24px);
    white-space: nowrap;
  }

  .compact-page .eyebrow {
    margin-bottom: 6px;
  }

  .compact-page .intro-copy {
    margin-top: 8px;
    line-height: 1.45;
  }

  .compact-page .expense-form-card {
    padding: 14px;
  }

  .compact-page .field-group {
    margin-bottom: 12px;
  }

  .compact-page .expense-suggestions-mobile-slot {
    display: block;
    min-width: 0;
  }

  .compact-page .expense-suggestions-mobile-slot .expense-suggestions-panel {
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .compact-page .expense-suggestions-mobile-slot .expense-suggestions-title {
    margin: 0 2px 8px;
  }

  .compact-page .expense-suggestions-mobile-slot .expense-description-suggestions {
    max-height: min(112px, 18svh);
  }

  .compact-page .expense-form-card input {
    height: 50px;
  }

  .compact-page .primary-button {
    min-height: 50px;
    margin-top: 2px;
  }

  .compact-page .entry-title-row {
    gap: 5px;
  }

  .compact-page .entry-type-toggle {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    margin-bottom: 2px;
    border-radius: 8px;
    font-size: 21px;
  }

  .app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 14px;
    align-items: center;
  }

  .nav-menu-button {
    position: relative;
    display: inline-flex;
    width: 40px;
    height: 40px;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    border: 1px solid #dce3ed;
    border-radius: 11px;
    color: var(--navy);
    background: #fff;
    box-shadow: 0 4px 12px rgb(27 47 79 / 8%);
    cursor: pointer;
  }

  .nav-menu-button:focus-visible {
    outline: 3px solid rgb(40 100 215 / 18%);
    outline-offset: 2px;
  }

  .nav-menu-button .nav-menu-line {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentcolor;
    transition:
      opacity 140ms ease,
      transform 140ms ease;
  }

  .app-header.nav-menu-open .nav-menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .app-header.nav-menu-open .nav-menu-line:nth-child(2) {
    opacity: 0;
  }

  .app-header.nav-menu-open .nav-menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .nav-menu-review-count {
    position: absolute;
    top: -7px;
    right: -7px;
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    place-items: center;
    border: 2px solid #f5f7fb;
    border-radius: 999px;
    color: #fff;
    background: #e65065;
    box-shadow: 0 2px 5px rgb(129 33 52 / 22%);
    font-size: 10px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    pointer-events: none;
  }

  .nav-menu-review-count[hidden],
  .app-header.nav-menu-open .nav-menu-review-count {
    display: none;
  }

  .app-confirm-dialog {
    width: calc(100vw - 24px);
    border-radius: 16px;
  }

  .app-confirm-shell {
    padding: 18px;
  }

  .category-settings-launch-card {
    align-items: stretch;
    flex-direction: column;
  }

  .category-settings-launch-button {
    width: 100%;
  }

  .category-settings-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100svh - 20px);
    border-radius: 16px;
  }

  .category-settings-dialog-shell {
    max-height: calc(100svh - 20px);
  }

  .category-settings-dialog-header {
    padding: 16px;
  }

  .category-settings-dialog-scroll {
    padding: 14px;
  }

  .category-settings-dialog-actions {
    padding: 13px 14px;
  }

  .app-nav {
    position: absolute;
    z-index: 1;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    width: 100%;
    padding: 8px;
    flex-wrap: wrap;
    border: 1px solid rgb(207 216 229 / 78%);
    border-radius: 14px;
    background: rgb(233 237 244 / 96%);
    box-shadow: 0 14px 34px rgb(22 40 69 / 16%);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    transform-origin: top center;
    transition:
      opacity 150ms ease,
      transform 150ms ease,
      visibility 150ms ease;
  }

  .app-header.nav-menu-ready .app-nav {
    display: flex;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.985);
  }

  .app-header.nav-menu-ready.nav-menu-open .app-nav {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .nav-link {
    flex: 1 1 calc(33.333% - 3px);
    padding-inline: 5px;
    text-align: center;
  }

  .nav-link.active {
    background: rgb(255 255 255 / 96%);
  }

  .category-settings-card-header {
    grid-template-columns: 72px minmax(0, 1fr) auto;
  }

  .category-remove-button {
    min-height: 43px;
    align-self: end;
    justify-self: stretch;
  }

  .subcategory-settings-list {
    grid-template-columns: 1fr;
  }

  .subcategory-move-dialog {
    padding: 0;
    place-items: end center;
  }

  .subcategory-move-panel {
    width: 100%;
    padding: 21px 18px calc(18px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
  }

  .subcategory-move-field select {
    display: none;
  }

  .subcategory-move-mobile-options {
    display: grid;
    max-height: 270px;
    max-height: min(34dvh, 270px);
    gap: 6px;
    margin-top: 8px;
    padding: 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .subcategory-move-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #344258;
    background: #f5f7fa;
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
  }

  .subcategory-move-option.selected {
    border-color: #2f6fde;
    color: #1e56b6;
    background: #edf4ff;
    box-shadow: 0 0 0 3px rgb(47 111 222 / 10%);
  }

  .subcategory-move-option-check {
    margin-left: 12px;
    color: #1e56b6;
    font-size: 20px;
    line-height: 1;
  }

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

  .analytics-filter-panel > summary {
    min-height: 58px;
    padding: 10px 12px;
  }

  .analytics-filter-summary-copy > strong {
    font-size: 12px;
  }

  .analytics-filter-toggle {
    min-height: 32px;
    padding-inline: 10px;
  }

  .analytics-filters .records-filter-reset {
    grid-column: 1 / -1;
  }

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

  .analytics-breakdown-heading {
    gap: 12px;
    align-items: center;
    flex-direction: row;
  }

  .analytics-breakdown-toggle {
    width: auto;
  }

  .analytics-chart-card,
  .analytics-breakdown-card,
  .analytics-monthly-card {
    padding: 16px;
  }

  .analytics-card-heading.trend-card-heading {
    gap: 12px;
    align-items: stretch;
    flex-direction: column;
  }

  .trend-chart-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .analytics-view-toggle {
    flex: 1 1 210px;
  }

  .analytics-view-toggle.analytics-breakdown-toggle {
    width: auto;
    flex: 0 0 auto;
  }

  .analytics-heading-value {
    align-self: center;
  }

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

  .family-learning-section-heading {
    gap: 9px;
  }

  .learning-pattern-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .analytics-chart {
    min-width: 0;
    overflow-x: hidden;
  }

  .analytics-chart svg {
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
  }

  .analytics-monthly-heading {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
  }

  .analytics-monthly-heading h2 {
    font-size: 17px;
    white-space: nowrap;
  }

  .analytics-monthly-navigation {
    width: auto;
    flex: 0 0 auto;
    grid-template-columns: 28px minmax(76px, auto) 28px;
    gap: 2px;
    padding: 2px;
  }

  .analytics-monthly-navigation button {
    width: 28px;
    height: 28px;
  }

  .analytics-monthly-card-view {
    min-height: 250px;
    padding: 13px;
  }

  .analytics-monthly-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .analytics-monthly-metric {
    min-height: 68px;
    padding: 10px;
  }

  .analytics-monthly-metric > strong:not(.analytics-target-badge) {
    font-size: 12px;
  }

  .analytics-monthly-swipe-hint {
    display: block;
  }

  .analytics-monthly-metric .analytics-target-badge {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
  }

  .records-table th,
  .records-table td {
    padding: 12px 6px;
    vertical-align: top;
  }

  .records-table-wrap {
    overflow-x: hidden;
  }

  .records-table {
    min-width: 0;
  }

  .records-table th:nth-child(1) {
    width: 16%;
    padding-left: 10px;
  }

  .records-table th:nth-child(2) {
    width: 52%;
  }

  .records-table th:nth-child(3) {
    width: 32%;
    padding-right: 10px;
  }

  .records-category-heading,
  .records-detail-heading,
  .records-category-cell,
  .records-detail-cell {
    display: none;
  }

  .records-date {
    padding-left: 10px !important;
    color: #6f7c90;
    font-size: 11px;
  }

  .records-details {
    padding-right: 4px !important;
    padding-left: 4px !important;
    font-size: 13px;
    line-height: 1.35;
  }

  .records-cost {
    padding-right: 10px !important;
    padding-left: 4px !important;
    font-size: 13px;
  }

  .records-mobile-classification {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    align-items: center;
    flex-wrap: wrap;
  }

  .records-mobile-classification .records-category,
  .records-mobile-classification .records-detail-badge {
    min-height: 22px;
    padding: 3px 6px;
    font-size: 9.5px;
  }

  .records-mobile-classification .records-category {
    gap: 3px;
  }

  .records-mobile-classification .records-category-icon {
    font-size: 10px;
  }

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

  .records-filters[data-records-mode="income"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .records-filters[data-records-mode="income"] .records-filter-reset {
    grid-column: 1 / -1;
  }

  .records-filter-reset {
    width: 100%;
  }

  .record-editor-form {
    max-height: calc(100svh - 12px);
    padding: 14px;
  }

  .record-editor-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .record-editor-detail-cost-grid {
    grid-template-columns: 46px minmax(0, 1fr) minmax(100px, 0.72fr);
    gap: 8px;
  }

  .record-edit-date-field,
  .record-edit-date-field .app-calendar-control,
  .record-edit-date-field .app-control-trigger {
    width: 46px;
  }

  .record-edit-date-field .app-control-trigger {
    height: 46px;
    min-height: 46px;
    border-radius: 11px;
  }

  .record-editor-classification-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .record-editor {
    width: min(620px, calc(100% - 18px));
    max-height: calc(100svh - 12px);
    border-radius: 18px;
  }

  .record-editor-header {
    align-items: center;
  }

  .record-editor-header .eyebrow {
    display: none;
  }

  .record-editor-header h2 {
    font-size: 20px;
  }

  .record-editor-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 22px;
  }

  .record-editor-source-note {
    margin: 8px 0 10px;
    padding: 7px 9px;
    font-size: 11px;
    line-height: 1.4;
  }

  .record-editor .field-group {
    margin-bottom: 10px;
  }

  .record-editor .field-group > label {
    margin-bottom: 4px;
    font-size: 12px;
  }

  .record-editor input,
  .record-editor select {
    height: 46px;
    border-radius: 11px;
    font-size: 15px;
  }

  .record-editor .amount-input-wrap input {
    padding-right: 34px;
    font-size: 17px;
  }

  .record-editor .amount-unit {
    right: 11px;
    font-size: 12px;
  }

  .record-editor textarea {
    height: clamp(112px, 20svh, 150px);
    min-height: 112px;
    padding: 9px 11px;
    border-radius: 11px;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
  }

  .record-editor-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(82px, 0.8fr) minmax(0, 2fr);
    gap: 8px;
    margin-top: 4px;
    padding-top: 10px;
  }

  .record-editor-main-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .record-delete-button {
    width: 100%;
  }

  .record-delete-button,
  .record-cancel-button,
  .record-save-button {
    min-height: 42px;
    padding: 8px 10px;
  }
}

/* Supabase authentication and family account management */
.auth-page-shell {
  display: grid;
  width: min(100% - 36px, 480px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 0 max(32px, env(safe-area-inset-bottom));
  align-content: center;
  gap: 24px;
}

.auth-brand {
  justify-self: center;
}

.auth-card {
  padding: 36px;
  text-align: center;
}

.auth-card h1 {
  margin: 8px 0 12px;
  font-size: clamp(25px, 6vw, 34px);
  letter-spacing: -0.04em;
}

.auth-copy {
  margin: 0 auto 26px;
  color: var(--muted);
  line-height: 1.7;
}

.google-login-button,
.kakao-login-button,
.secondary-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
}

.google-login-button {
  width: 100%;
  gap: 10px;
  box-shadow: 0 8px 22px rgb(21 33 56 / 7%);
}

.auth-provider-buttons {
  display: grid;
  gap: 10px;
}

.kakao-login-button {
  width: 100%;
  gap: 10px;
  border-color: #fee500;
  background: #fee500;
  color: #191919;
  box-shadow: 0 8px 22px rgb(63 53 0 / 10%);
}

.kakao-login-button:hover {
  border-color: #f2d900;
  background: #f2d900;
}

.google-login-button:hover,
.secondary-button:hover {
  border-color: #b8c7df;
  background: #f9fbff;
}

.google-login-button:disabled,
.kakao-login-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.google-mark {
  display: grid;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #2864d7;
  place-items: center;
  font-weight: 850;
}

.auth-back-link {
  display: inline-block;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-underline-offset: 3px;
}

.auth-callback-card {
  display: grid;
  justify-items: center;
}

.auth-loader {
  width: 34px;
  height: 34px;
  border: 3px solid #dbe5f6;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}

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

.compact-action {
  min-height: 40px;
  padding: 0 16px;
  white-space: nowrap;
}

.account-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 30px 0 0;
  padding: 24px;
}

.account-summary-copy h2,
.family-name-panel h2,
.family-invite-panel h2 {
  margin: 4px 0 12px;
}

.account-name {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.account-email,
.section-supporting-copy {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.family-admin-layout {
  display: grid;
  gap: 16px;
  margin-top: 30px;
  margin-bottom: 18px;
}

.family-management-card {
  padding: 26px;
}

.family-name-panel .settings-card-copy {
  margin-bottom: 0;
}

.family-invite-panel {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.family-name-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
}

.family-name-form .field-group {
  margin: 0;
}

.family-name-form .primary-button {
  min-width: 120px;
}

.csv-import-card {
  padding: 26px;
}

.csv-import-card h2 {
  margin: 4px 0 8px;
}

.csv-format-rules {
  display: grid;
  gap: 6px;
  margin: 14px 0 20px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.csv-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.csv-import-actions button {
  min-width: 180px;
  flex: 1;
}

.csv-validation-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f9fafc;
}

.csv-file-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.csv-file-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.csv-error-list {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.csv-error-list li {
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 13px;
  line-height: 1.45;
}

.csv-preview-title {
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.csv-preview-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.csv-preview-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  padding: 11px 12px;
  border: 1px solid #e3e8f1;
  border-radius: 12px;
  background: #fff;
}

.csv-preview-item strong,
.csv-preview-category {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.csv-preview-amount {
  font-weight: 800;
}

.csv-preview-meta,
.csv-preview-category {
  color: var(--muted);
  font-size: 12px;
}

.csv-validation-panel > .primary-button {
  width: 100%;
}

#import-csv-button[aria-busy="true"],
#select-csv-button[aria-busy="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#import-csv-button[aria-busy="true"]::before,
#select-csv-button[aria-busy="true"]::before {
  width: 15px;
  height: 15px;
  border: 2px solid currentcolor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 700ms linear infinite;
  content: "";
}

.family-invite-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.34fr);
  gap: 16px;
  margin: 22px 0 4px;
}

.family-role-field .app-control,
.family-role-field select {
  width: 100%;
}

.invite-result {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #cddaf1;
  border-radius: 16px;
  background: var(--blue-soft);
}

.invite-result > label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 750;
}

.invite-link-row {
  display: flex;
  gap: 8px;
}

.invite-link-row input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.invite-result > p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.settings-menu-meta {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.settings-pending-badge {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #d34a52;
  box-shadow: 0 3px 9px rgb(191 46 57 / 24%);
  font-size: 11px;
  font-weight: 850;
}

.family-request-help {
  margin: -4px 2px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.family-join-request-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.verified-account-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  color: #17643a;
  background: #e7f6ed;
  font-size: 10px;
  font-weight: 850;
}

.family-request-time {
  margin-top: 3px;
  color: #8a95a6;
  font-size: 11px;
}

.family-request-actions,
.join-code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.family-request-actions .primary-button,
.family-request-actions .secondary-button {
  width: auto;
  min-height: 38px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 11px;
  font-size: 12px;
}

.family-request-empty {
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.family-join-code-panel > .primary-button {
  width: auto;
  min-height: 44px;
  margin-top: 18px;
  padding-inline: 20px;
  font-size: 14px;
}

.join-code-result {
  display: grid;
  gap: 13px;
  margin-top: 16px;
  padding: 17px;
  border: 1px solid #c9daf3;
  border-radius: 16px;
  background: #f2f7ff;
}

.join-code-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.join-code-heading > span,
.join-code-result label {
  color: #63738f;
  font-size: 12px;
  font-weight: 750;
}

.join-code-heading strong {
  color: var(--navy);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 23px;
  letter-spacing: 0.12em;
}

.join-code-result > p {
  margin: -5px 0 0;
  color: #607089;
  font-size: 12px;
}

.join-code-share-area {
  display: grid;
  gap: 8px;
}

.join-code-share-area input {
  height: 44px;
  background: #fff;
  font-size: 13px;
}

.join-code-actions .secondary-button {
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 11px;
  font-size: 12px;
}

.text-danger-button {
  width: max-content;
  min-height: 34px;
  padding: 6px 2px;
  border: 0;
  color: var(--danger);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.family-code-auth-card {
  text-align: left;
}

.family-code-auth-card > .eyebrow,
.family-code-auth-card > h1,
.family-code-auth-card > .auth-copy,
.family-code-auth-card > .auth-back-link {
  text-align: center;
}

.family-code-auth-card > .auth-back-link {
  width: max-content;
  margin-inline: auto;
}

.family-code-form {
  display: grid;
  gap: 8px;
}

.family-code-form > label {
  color: #334056;
  font-size: 13px;
  font-weight: 800;
}

.family-code-form input {
  height: 58px;
  border: 1px solid #cdd7e7;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.family-code-help {
  margin: 0 2px;
  color: var(--muted);
  font-size: 11px;
}

.family-code-form .field-error {
  margin-top: 0;
}

.family-code-form .primary-button {
  margin-top: 8px;
}

.family-code-security-note {
  margin: -8px 0 18px;
  padding: 12px 13px;
  border: 1px solid #cfe0f7;
  border-radius: 12px;
  color: #24466f;
  background: #f2f7fd;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.auth-copy.success-text {
  color: #17643a;
}

.my-join-requests {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.my-join-requests h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

#my-join-requests-list {
  display: grid;
  gap: 8px;
}

.my-join-request {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: #f5f7fa;
}

.my-join-request > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.my-join-request strong,
.my-join-request span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-join-request strong {
  font-size: 13px;
}

.my-join-request > div span {
  color: var(--muted);
  font-size: 10px;
}

.my-join-status-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: #6b5523;
  background: #fff0c7;
  font-size: 10px;
  font-weight: 850;
}

.my-join-request.status-approved .my-join-status-badge {
  color: #17643a;
  background: #e7f6ed;
}

.my-join-request.status-declined .my-join-status-badge {
  color: var(--danger);
  background: var(--danger-soft);
}

.family-member-item,
.pending-invite-item {
  min-width: 0;
}

.family-member-copy {
  display: grid;
  min-width: 0;
  flex: 1;
}

.family-member-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.family-member-heading strong,
.family-member-copy > strong,
.family-member-copy .account-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-role-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef1f6;
  color: #566277;
  font-size: 11px;
  font-weight: 800;
}

.family-role-badge.role-owner,
.family-role-badge.role-admin {
  background: var(--blue-soft);
  color: var(--navy);
}

.review-login-button {
  width: auto;
  margin-top: 6px;
  padding-inline: 24px;
  text-decoration: none;
}

@media (max-width: 599px) {
  .auth-card {
    padding: 28px 20px;
  }

  .account-summary-card {
    align-items: flex-start;
    padding: 20px;
  }

  .family-management-card {
    padding: 20px;
  }

  .family-invite-panel {
    margin-top: 22px;
    padding-top: 22px;
  }

  .family-name-form {
    grid-template-columns: 1fr;
  }

  .family-name-form .primary-button {
    width: 100%;
  }

  .csv-import-card {
    padding: 20px;
  }

  .csv-import-actions {
    flex-direction: column;
  }

  .csv-import-actions button {
    width: 100%;
    min-width: 0;
  }

  .family-invite-fields {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .family-role-field {
    margin-bottom: 12px;
  }

  .invite-link-row {
    align-items: stretch;
    flex-direction: column;
  }

  .invite-link-row input {
    min-height: 44px;
  }

  .pending-invite-item,
  .family-member-item,
  .family-join-request-item {
    gap: 10px;
  }

  .family-join-request-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .family-request-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .family-request-actions button {
    flex: 1;
  }

  .family-join-code-panel > .primary-button {
    width: 100%;
  }

  .join-code-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .join-code-actions .secondary-button:last-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 720px) {
  .page-shell {
    max-width: 1040px;
  }
}

@media (max-width: 340px) {
  .page-shell {
    padding-right: max(14px, env(safe-area-inset-right));
    padding-left: max(14px, env(safe-area-inset-left));
  }

  .category-settings-card {
    padding: 14px;
  }

  .category-settings-card-header {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    gap: 7px;
  }

  .category-remove-button {
    padding-inline: 6px;
    font-size: 10px;
  }

  .app-header {
    align-items: stretch;
  }

  .brand {
    margin-top: 3px;
  }

  .nav-link {
    padding-right: 3px;
    padding-left: 3px;
    font-size: 10.5px;
  }

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

  .records-filters[data-records-mode="income"] {
    grid-template-columns: 1fr;
  }

  .records-filters[data-records-mode="income"] .records-filter-reset {
    grid-column: auto;
  }

  .analytics-filters,
  .analytics-kpis {
    grid-template-columns: 1fr;
  }

  .transaction-item {
    gap: 8px;
    margin-inline: 13px;
  }

  .amount {
    font-size: 14px;
  }
}

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

/* Shared dropdown and calendar controls */
:root {
  --control-line: #d9e0ea;
  --control-text: #263247;
  --control-muted: #8b95a4;
  --control-hover: #f3f6fb;
  --control-selected: #edf3ff;
  --control-shadow: 0 16px 38px rgb(24 39 67 / 18%);
}

select.app-native-control,
input.app-native-control {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  opacity: 0 !important;
  clip-path: inset(50%) !important;
  pointer-events: none !important;
}

.app-control-host > .select-arrow {
  display: none;
}

.app-control {
  position: relative;
  width: 100%;
  min-width: 0;
}

.app-control-trigger,
.analytics-multiselect > summary {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  height: 54px;
  padding: 0 42px 0 14px;
  align-items: center;
  border: 1px solid var(--control-line);
  border-radius: 13px;
  outline: none;
  color: var(--control-text);
  background: #fff;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.app-control-trigger:hover,
.analytics-multiselect > summary:hover {
  border-color: #c7d1df;
  background: #fcfdff;
}

.app-control-trigger:focus-visible,
.app-control.is-open .app-control-trigger,
.app-control-trigger[aria-invalid="true"],
.analytics-multiselect[open] > summary,
.analytics-multiselect > summary:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(40 100 215 / 12%);
}

.app-control-trigger:disabled {
  color: var(--control-muted);
  background: #f3f5f8;
  cursor: not-allowed;
}

.app-control-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-control-trigger.is-placeholder .app-control-value {
  color: var(--control-muted);
}

.app-control-arrow,
.app-calendar-icon {
  position: absolute;
  right: 16px;
  flex: 0 0 auto;
  pointer-events: none;
}

.app-control-arrow {
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #667288;
  border-bottom: 2px solid #667288;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 140ms ease;
}

.app-control.is-open .app-control-arrow {
  transform: translateY(-25%) rotate(225deg);
}

.app-calendar-icon {
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
}

.app-calendar-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #667288;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.records-filter-field .app-control-trigger,
.records-filter-field .records-multiselect-trigger,
.analytics-filter-field .app-control-trigger,
.analytics-multiselect > summary {
  height: 44px;
  padding-right: 38px;
  padding-left: 11px;
  border-radius: 11px;
  font-size: 13px;
}

.analytics-filter-field .app-control-trigger,
.analytics-multiselect > summary {
  font-size: 12px;
}

.app-control--emoji .app-control-trigger {
  height: 43px;
  padding: 5px 34px 5px 9px;
  border-radius: 11px;
  font-size: 22px;
  justify-content: center;
}

.app-control--emoji .app-control-arrow {
  right: 11px;
}

.app-floating-panel,
.analytics-multiselect-panel {
  border: 1px solid #dfe5ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--control-shadow);
}

.app-floating-panel {
  position: fixed;
  z-index: 1200;
  max-height: min(370px, calc(100vh - 24px));
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

dialog .app-floating-panel {
  z-index: 10;
}

.app-dropdown-group {
  padding: 9px 10px 5px;
  color: #8994a5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.app-dropdown-option {
  display: flex;
  width: 100%;
  min-height: 38px;
  padding: 8px 9px 8px 11px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 9px;
  color: #35435a;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.app-dropdown-option:hover,
.app-dropdown-option:focus-visible {
  outline: none;
  color: var(--navy);
  background: var(--control-hover);
}

.app-dropdown-option[aria-selected="true"] {
  color: var(--blue);
  background: var(--control-selected);
}

.app-dropdown-option:disabled {
  color: #a0a9b8;
  cursor: not-allowed;
}

.app-dropdown-check {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
}

.app-dropdown-option[aria-selected="true"] .app-dropdown-check {
  opacity: 1;
}

.app-calendar-panel {
  padding: 12px;
  overflow-y: auto;
}

.app-calendar-header {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  gap: 6px;
  align-items: center;
  margin-bottom: 9px;
}

.app-calendar-header strong {
  color: var(--navy);
  font-size: 14px;
  font-weight: 850;
  text-align: center;
}

.app-calendar-nav {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #617089;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.app-calendar-nav:hover,
.app-calendar-nav:focus-visible {
  outline: none;
  color: var(--blue);
  background: var(--control-hover);
}

.app-calendar-weekdays,
.app-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.app-calendar-weekdays {
  margin-bottom: 3px;
}

.app-calendar-weekdays span {
  display: grid;
  height: 24px;
  place-items: center;
  color: #8a95a7;
  font-size: 10px;
  font-weight: 800;
}

.app-calendar-day,
.app-month-option {
  border: 0;
  border-radius: 9px;
  color: #44536a;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.app-calendar-day {
  height: 34px;
  padding: 0;
}

.app-calendar-day:hover,
.app-calendar-day:focus-visible,
.app-month-option:hover,
.app-month-option:focus-visible {
  outline: none;
  color: var(--blue);
  background: var(--control-hover);
}

.app-calendar-day.is-outside {
  color: #b7beca;
}

.app-calendar-day.is-today,
.app-month-option.is-current {
  box-shadow: inset 0 0 0 1px #b9c9e8;
}

.app-calendar-day.is-selected,
.app-month-option.is-selected {
  color: #fff;
  background: var(--blue);
  box-shadow: none;
  font-weight: 850;
}

.app-calendar-day:disabled,
.app-month-option:disabled {
  color: #c8ced7;
  background: transparent;
  cursor: not-allowed;
}

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

.app-month-option {
  min-height: 44px;
  padding: 8px;
}

.app-calendar-footer {
  display: flex;
  margin-top: 10px;
  padding-top: 10px;
  justify-content: flex-end;
  border-top: 1px solid #edf0f5;
}

.app-calendar-footer button {
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  border-radius: 9px;
  color: var(--blue);
  background: #eef3fc;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.app-calendar-footer button:hover,
.app-calendar-footer button:focus-visible {
  outline: 2px solid rgb(40 100 215 / 16%);
  background: #e4ecfa;
}

.app-calendar-footer button:disabled {
  color: #a0a9b8;
  background: #f3f5f8;
  cursor: not-allowed;
}

.analytics-multiselect-panel {
  z-index: 120;
  padding: 8px;
}

.analytics-filter-field .analytics-multiselect-option {
  min-height: 38px;
  padding: 8px 9px;
  border-radius: 9px;
  font-size: 12px;
}

.analytics-multiselect-option:hover {
  background: var(--control-hover);
}

@media (max-width: 599px) {
  .app-floating-panel {
    max-height: min(420px, calc(100vh - 24px));
  }

  .app-dropdown-option {
    min-height: 42px;
  }

  .brand {
    font-size: 17px;
  }

  h1 {
    font-size: clamp(20px, 6vw, 24px);
  }

  .intro-copy {
    font-size: 14px;
  }

  .connection-section-heading h2 {
    font-size: 22px;
  }

  .field-group > label {
    font-size: 13px;
  }

  .primary-button {
    font-size: 15px;
  }

  .amount-input-wrap input {
    font-size: 18px;
  }

  .amount-unit {
    font-size: 14px;
  }

  .form-status {
    font-size: 13px;
  }

  .category-sheet-panel h2 {
    font-size: 20px;
  }

  .category-option,
  .category-sheet-close {
    font-size: 13px;
  }

  .app-confirm-body h2 {
    font-size: 17px;
  }

  .record-editor-header h2 {
    font-size: 21px;
  }

  .record-delete-button,
  .record-cancel-button,
  .record-save-button {
    font-size: 13px;
  }

  .review-empty-state strong,
  .expense-empty-state strong,
  .user-list-item strong,
  .users-empty-state strong {
    font-size: 15px;
  }

  .user-form-card h2,
  .analytics-card-heading h2,
  .category-settings-dialog-header h2 {
    font-size: 18px;
  }

  .analytics-kpi > strong {
    font-size: 17px;
  }

  .target-progress-summary > div strong {
    font-size: 16px;
  }

  .category-settings-launch-card strong,
  .deleted-expense-content > strong {
    font-size: 14px;
  }

  .field-group .app-control-trigger {
    font-size: 15px;
  }
}

/* Keep the all-records filters on one compact row at every viewport width. */
@media (max-width: 599px) {
  .records-filters,
  .records-filters[data-records-mode="income"] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 54px;
    gap: 6px;
    align-items: center;
    padding: 10px;
  }

  .records-filters[data-records-mode="income"] {
    grid-template-columns: minmax(0, 1fr) 54px;
  }

  .records-filters[data-records-mode="income"] .records-filter-reset {
    grid-column: auto;
  }

  .records-filter-field .app-control-trigger,
  .records-filter-field .records-multiselect-trigger {
    height: 40px;
    padding-right: 25px;
    padding-left: 8px;
    font-size: 11px;
  }

  .records-filter-field .app-control-arrow {
    right: 10px;
    width: 7px;
    height: 7px;
  }

  .records-filter-reset {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding-inline: 4px;
    font-size: 11px;
  }

  .records-multiselect-arrow {
    right: 10px;
    width: 7px;
    height: 7px;
  }

  .records-calendar-summary-item {
    padding: 3px 4px;
    flex-direction: column;
    gap: 0;
  }

  .records-calendar-summary-item strong {
    max-width: 100%;
    font-size: 10px;
  }

  .records-category-filter-dialog {
    width: calc(100% - 18px);
    max-height: calc(100dvh - 18px);
    margin: auto auto 9px;
    border-radius: 20px;
  }

  .records-category-filter-panel {
    max-height: calc(100dvh - 18px);
    padding: 17px 14px max(14px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 340px) {
  .records-filters,
  .records-filters[data-records-mode="income"] {
    gap: 4px;
    padding: 8px;
  }

  .records-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 46px;
  }

  .records-filters[data-records-mode="income"] {
    grid-template-columns: minmax(0, 1fr) 46px;
  }

  .records-filter-field .app-control-trigger,
  .records-filter-field .records-multiselect-trigger {
    padding-right: 20px;
    padding-left: 6px;
    font-size: 10px;
  }

  .records-filter-field .app-control-arrow {
    right: 8px;
  }

  .records-multiselect-arrow {
    right: 8px;
  }

  .records-filter-reset {
    font-size: 10px;
  }
}

/* Place the decision cards directly on the blue briefing background on mobile. */
@media (max-width: 599px) {
  .page-shell.ai-insights-page {
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .ai-insights-page .card.ai-briefing-card {
    padding: 18px 14px;
  }

  .ai-insights-page .ai-briefing-topline,
  .ai-insights-page .ai-briefing-action {
    padding-inline: 2px;
  }

  .ai-insights-page .latest-ai-report {
    margin-top: 20px;
  }

  .ai-insights-page .latest-ai-report-heading,
  .ai-insights-page .ai-report-title-lockup {
    gap: 10px;
  }

  .ai-insights-page .ai-report-symbol {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 12px;
  }

  .ai-insights-page .ai-report-route {
    margin-top: 18px;
  }

  .ai-insights-page .ai-report-stage {
    padding: 14px 12px;
    border-radius: 16px;
  }

  .ai-insights-page .ai-stage-summary {
    margin: 14px 0 16px;
    padding: 12px;
  }

  .ai-insights-page .ai-report-findings article,
  .ai-insights-page .ai-action-plan > li {
    padding: 12px;
  }

  .ai-insights-page .ai-action-board {
    margin-top: 14px;
    padding: 14px 12px;
    border-radius: 16px;
  }

  .ai-insights-page .ai-report-caution {
    padding: 10px;
  }
}

/* Expandable quick actions */
.quick-actions {
  position: fixed;
  z-index: 90;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.quick-actions-menu {
  width: min(280px, calc(100vw - 36px));
  padding: 7px;
  border: 1px solid rgb(221 229 241 / 92%);
  border-radius: 18px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 18px 48px rgb(24 39 67 / 22%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  transform-origin: bottom right;
  animation: quick-actions-enter 150ms ease-out;
}

.quick-actions-menu[hidden] {
  display: none;
}

.quick-action-option {
  display: flex;
  width: 100%;
  min-height: 66px;
  padding: 10px;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 13px;
  color: #1c2d49;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.quick-action-option:hover,
.quick-action-option:focus-visible {
  outline: none;
  background: #f0f5fd;
}

.quick-action-option:focus-visible {
  box-shadow: inset 0 0 0 2px rgb(40 100 215 / 22%);
}

.quick-action-option-icon,
.quick-install-dialog-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #2e72e3, #1b51b2);
}

.quick-action-option-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  box-shadow: 0 7px 16px rgb(40 100 215 / 22%);
}

.quick-action-option-icon svg,
.quick-install-dialog-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-action-option-copy,
.quick-action-option-copy strong,
.quick-action-option-copy small {
  display: block;
}

.quick-action-option-copy {
  min-width: 0;
}

.quick-action-option-copy strong {
  font-size: 14px;
  font-weight: 850;
}

.quick-action-option-copy small {
  margin-top: 3px;
  color: #758198;
  font-size: 11px;
  font-weight: 650;
}

.quick-actions-trigger {
  display: grid;
  width: 56px;
  height: 56px;
  padding: 0;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 46%);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #2a8175 0%, #15584f 60%, #0d443d 100%);
  box-shadow:
    0 14px 30px rgb(21 88 79 / 36%),
    inset 0 1px 0 rgb(255 255 255 / 25%);
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.quick-actions-trigger:hover {
  background: linear-gradient(145deg, #329184 0%, #1b685d 60%, #104b43 100%);
  box-shadow:
    0 17px 36px rgb(21 88 79 / 42%),
    inset 0 1px 0 rgb(255 255 255 / 28%);
  transform: translateY(-2px);
}

.quick-actions-trigger:focus-visible {
  outline: 3px solid rgb(143 220 201 / 52%);
  outline-offset: 3px;
}

.quick-actions-trigger:active {
  box-shadow:
    0 8px 20px rgb(21 88 79 / 30%),
    inset 0 2px 4px rgb(5 39 34 / 22%);
  transform: translateY(0) scale(0.98);
}

.quick-actions-trigger svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 2;
  stroke-linecap: round;
  transition: transform 180ms ease;
}

.quick-actions.is-open .quick-actions-trigger svg {
  transform: rotate(45deg);
}

.has-quick-actions .records-scroll-top {
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 68px);
  width: 56px;
  height: 56px;
}

.quick-actions-open .records-scroll-top {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
}

.quick-install-dialog,
.quick-expense-dialog,
.quick-asset-type-dialog,
.quick-card-dialog {
  width: min(410px, calc(100% - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 28px 80px rgb(17 31 55 / 30%);
}

.quick-install-dialog::backdrop,
.quick-expense-dialog::backdrop,
.quick-asset-type-dialog::backdrop,
.quick-card-dialog::backdrop {
  background: rgb(15 27 47 / 52%);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.quick-install-dialog-panel {
  position: relative;
  padding: 28px;
}

.quick-expense-dialog-panel {
  position: relative;
  padding: 28px;
}

.quick-expense-dialog-panel > .eyebrow {
  margin: 0 44px 5px 0;
}

.quick-expense-dialog h2 {
  margin: 0 44px 7px 0;
  color: #172946;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.quick-expense-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.quick-expense-amount-control {
  position: relative;
  display: block;
}

.quick-card-field .quick-expense-amount-control input {
  padding-right: 52px;
  text-align: right;
}

.quick-expense-amount-control > span {
  position: absolute;
  top: 50%;
  right: 13px;
  color: #6f7d91;
  font-size: 13px;
  transform: translateY(-50%);
  pointer-events: none;
}

.quick-expense-submit {
  margin-top: 0;
}

.quick-expense-submit:disabled {
  cursor: wait;
  opacity: 0.68;
}

.quick-asset-type-panel {
  position: relative;
  padding: 28px;
}

.quick-asset-type-panel > .eyebrow {
  margin: 0 44px 5px 0;
}

.quick-asset-type-dialog h2 {
  margin: 0 44px 7px 0;
  color: #172946;
  font-size: 23px;
  letter-spacing: -0.04em;
}

.quick-asset-type-options {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.quick-asset-type-option {
  display: grid;
  width: 100%;
  min-height: 76px;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 14px;
  align-items: center;
  border: 1px solid #dce3ec;
  border-radius: 15px;
  color: #31435d;
  background: #f3f5f8;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.quick-asset-type-option:hover {
  border-color: #c7d3e2;
  background: #eaf0f7;
  transform: translateY(-1px);
}

.quick-asset-type-option:focus-visible {
  outline: 3px solid rgb(40 100 215 / 18%);
  outline-offset: 2px;
}

.quick-asset-type-option strong,
.quick-asset-type-option small {
  display: block;
}

.quick-asset-type-option strong {
  font-size: 15px;
  font-weight: 850;
}

.quick-asset-type-option small {
  margin-top: 4px;
  color: #748197;
  font-size: 11px;
  line-height: 1.45;
}

.quick-asset-type-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
}

.quick-asset-type-icon.card {
  background: linear-gradient(145deg, #2e72e3, #1b51b2);
}

.quick-asset-type-icon.bank {
  background: linear-gradient(145deg, #147c6c, #0d5148);
}

.quick-asset-type-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-asset-type-arrow {
  color: #8491a4;
  font-size: 25px;
  line-height: 1;
}

.quick-card-dialog {
  max-height: min(760px, calc(100dvh - 24px));
  overflow: hidden;
}

.quick-card-dialog-panel {
  position: relative;
  max-height: min(760px, calc(100dvh - 24px));
  padding: 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.quick-card-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-card-environment {
  margin-right: 34px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #8a5a00;
  background: #fff3cf;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.quick-card-environment[data-environment="production"] {
  color: #14633d;
  background: #dff6e9;
}

.quick-action-card-icon {
  background: linear-gradient(145deg, #147c6c, #0d5148);
  box-shadow: 0 7px 16px rgb(13 81 72 / 24%);
}

.quick-action-image-icon {
  background: linear-gradient(145deg, #3b9585, #176358);
  box-shadow: 0 7px 16px rgb(23 99 88 / 24%);
}

.quick-image-upload-picker {
  position: relative;
  display: grid;
  min-height: 112px;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 13px;
  padding: 18px;
  align-items: center;
  border: 1.5px dashed #91c4b8;
  border-radius: 16px;
  color: #27483f;
  background: #f2f9f6;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.quick-image-upload-picker:hover {
  border-color: #4c9a89;
  background: #eaf6f1;
}

.quick-image-upload-picker:focus-within {
  border-color: #287b6d;
  outline: none;
  box-shadow: 0 0 0 3px rgb(40 123 109 / 14%);
}

.quick-image-upload-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.quick-image-upload-picker-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, #3b9585, #176358);
  box-shadow: 0 8px 18px rgb(23 99 88 / 20%);
}

.quick-image-upload-picker-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-image-upload-picker-copy,
.quick-image-upload-picker-copy strong,
.quick-image-upload-picker-copy small {
  display: block;
  min-width: 0;
}

.quick-image-upload-picker-copy strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-image-upload-picker-copy small {
  margin-top: 5px;
  color: #6c7f78;
  font-size: 11px;
  font-weight: 700;
}

.quick-image-security-note {
  margin: 0;
}

.quick-image-expense-result {
  padding: 13px 14px;
  border: 1px solid #cce4dc;
  border-radius: 14px;
  color: #24463d;
  background: #f4faf7;
}

.quick-image-expense-result > strong {
  display: block;
  color: #155e52;
  font-size: 14px;
  font-weight: 900;
}

.quick-image-expense-result ul {
  display: grid;
  gap: 9px;
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
}

.quick-image-expense-result li,
.quick-image-expense-result li span,
.quick-image-expense-result li small {
  display: block;
  min-width: 0;
}

.quick-image-expense-result li span {
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 800;
}

.quick-image-expense-result li small {
  margin-top: 2px;
  color: #6c7f78;
  font-size: 11px;
  line-height: 1.4;
}

.quick-card-dialog h2 {
  margin: 18px 0 7px;
  color: #172946;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.quick-card-security-note {
  margin-top: 15px;
  padding: 11px 12px;
  border: 1px solid #d7e4f4;
  border-radius: 12px;
  color: #52637a;
  background: #f4f8fd;
  font-size: 12px;
  line-height: 1.55;
}

.quick-card-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

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

.quick-card-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #394a62;
  font-size: 12px;
  font-weight: 800;
}

.quick-card-field span small {
  color: #8793a5;
  font-size: 10px;
  font-weight: 700;
}

.quick-card-field input,
.quick-card-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  border: 1px solid #d7dfeb;
  border-radius: 11px;
  color: #1f314c;
  background: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
}

.quick-card-field input:focus,
.quick-card-field select:focus {
  border-color: #6c94dd;
  outline: 3px solid rgb(40 100 215 / 12%);
}

.quick-card-consent {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: #56657a;
  font-size: 11px;
  line-height: 1.5;
}

.quick-card-consent input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--blue);
}

.quick-card-status {
  min-height: 18px;
  margin: 0;
  color: #65738a;
  font-size: 12px;
  line-height: 1.5;
}

.quick-card-status[data-kind="error"] {
  color: #b33b3b;
}

.quick-card-status[data-kind="success"] {
  color: #167047;
}

.bank-lookup-guide {
  padding: 16px;
  border: 1px solid #efc8bd;
  border-radius: 15px;
  color: #43536b;
  background: linear-gradient(145deg, #fffaf6, #fff5ee);
  box-shadow: 0 10px 24px rgb(108 54 32 / 8%);
}

.bank-lookup-guide-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bank-lookup-guide-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #a35337;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.03em;
}

.bank-lookup-guide h3 {
  margin: 0;
  color: #502f25;
  font-size: 15px;
  letter-spacing: -0.025em;
}

.bank-lookup-guide-service {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: #9a4a2d;
  background: #ffe7da;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.bank-lookup-guide-summary {
  margin: 11px 0 0;
  color: #614b44;
  font-size: 12px;
  line-height: 1.55;
}

.bank-lookup-guide-steps {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: bank-guide-step;
}

.bank-lookup-guide-steps li {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: #4d4a4a;
  font-size: 11px;
  line-height: 1.55;
  counter-increment: bank-guide-step;
}

.bank-lookup-guide-steps li::before {
  display: grid;
  width: 23px;
  height: 23px;
  margin-top: -2px;
  place-items: center;
  border-radius: 8px;
  color: #a35337;
  background: #ffe4d5;
  font-size: 10px;
  font-weight: 900;
  content: counter(bank-guide-step);
}

.bank-lookup-guide-fields,
.bank-lookup-guide-note {
  margin: 13px 0 0;
  padding: 10px 11px;
  border-radius: 10px;
  color: #5f4f49;
  background: rgb(255 255 255 / 72%);
  font-size: 10px;
  line-height: 1.6;
}

.bank-lookup-guide-note {
  color: #785335;
  background: #fff0cc;
}

.bank-lookup-guide-link {
  display: inline-flex;
  min-height: 34px;
  margin-top: 13px;
  padding: 0 11px;
  align-items: center;
  border: 1px solid #d99070;
  border-radius: 10px;
  color: #8b3e25;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.bank-lookup-guide-link::after {
  margin-left: 5px;
  content: "↗";
}

.bank-lookup-guide-link:hover,
.bank-lookup-guide-link:focus-visible {
  color: #6e2e1a;
  outline: 2px solid rgb(163 83 55 / 18%);
  background: #fff9f5;
}

.quick-card-submit {
  margin-top: 0;
}

.quick-card-submit:disabled {
  cursor: wait;
  opacity: 0.68;
}

.quick-install-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #6e7b8f;
  background: #f0f3f8;
  cursor: pointer;
}

.quick-install-dialog-close:hover,
.quick-install-dialog-close:focus-visible {
  color: var(--navy);
  outline: 2px solid rgb(40 100 215 / 18%);
  background: #e8eef8;
}

.quick-install-dialog-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 2;
  stroke-linecap: round;
}

.quick-install-dialog-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  box-shadow: 0 9px 22px rgb(40 100 215 / 22%);
}

.quick-install-dialog h2 {
  margin: 18px 0 7px;
  color: #172946;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.quick-install-dialog-lead {
  margin: 0;
  color: #66748a;
  font-size: 14px;
  line-height: 1.65;
}

.quick-install-steps {
  display: grid;
  gap: 9px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: install-step;
}

.quick-install-steps li {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #43536b;
  font-size: 13px;
  line-height: 1.55;
  counter-increment: install-step;
}

.quick-install-steps li::before {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 900;
  content: counter(install-step);
}

.quick-install-dialog-done {
  width: 100%;
  min-height: 45px;
  margin-top: 24px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--navy);
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}

.quick-install-dialog-done:hover,
.quick-install-dialog-done:focus-visible {
  outline: 3px solid rgb(40 100 215 / 18%);
  background: var(--blue);
}

@keyframes quick-actions-enter {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 599px) {
  .quick-actions {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .quick-actions-trigger {
    width: 54px;
    height: 54px;
  }

  .has-quick-actions .records-scroll-top {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(max(14px, env(safe-area-inset-bottom)) + 66px);
    width: 54px;
    height: 54px;
  }

  .quick-install-dialog-panel {
    padding: 25px 22px 22px;
  }

  .quick-expense-dialog-panel {
    padding: 25px 20px 22px;
  }

  .quick-asset-type-panel {
    padding: 25px 20px 22px;
  }

  .quick-card-dialog-panel {
    padding: 25px 20px 22px;
  }

  .quick-card-field-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quick-actions-menu {
    animation: none;
  }

  .quick-actions-trigger,
  .quick-actions-trigger svg {
    transition: none;
  }
}

.mobile-install-hint {
  display: none;
}

@media (max-width: 599px) {
  .mobile-install-hint {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 13px;
    margin: 32px 0 80px;
    padding: 18px 42px 14px 14px;
    align-items: center;
    border: 1px solid #d8e3f1;
    border-radius: 20px;
    color: #344a66;
    background: #f3f6fa;
  }

  .mobile-install-hint-close {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #657893;
    background: transparent;
    font: inherit;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-install-hint-close:hover,
  .mobile-install-hint-close:focus-visible {
    color: #2f4561;
    background: #e4eaf3;
  }

  .mobile-install-hint-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    color: #4f6887;
    background: #e4eaf3;
  }

  .mobile-install-hint-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentcolor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-install-hint strong,
  .mobile-install-hint small {
    display: block;
  }

  .mobile-install-hint strong {
    color: #2f4561;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.025em;
  }

  .mobile-install-hint small {
    margin-top: 4px;
    color: #657893;
    font-size: 11px;
    line-height: 1.4;
  }
}

/* Connected cards and bank accounts */
.financial-page {
  padding-bottom: 90px;
}

.financial-intro {
  padding-bottom: 12px;
}

.financial-add-asset-card {
  display: grid;
  width: 100%;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 13px;
  margin: 8px 0 14px;
  padding: 15px 17px;
  align-items: center;
  border: 1px solid #dbe2eb;
  border-radius: 16px;
  color: #34465f;
  background: #eef1f5;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.financial-add-asset-card:hover {
  border-color: #c7d2e0;
  background: #e7ebf1;
  transform: translateY(-1px);
}

.financial-add-asset-card:focus-visible {
  outline: 3px solid rgb(40 100 215 / 18%);
  outline-offset: 2px;
}

.financial-add-asset-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 13px;
  color: #425a78;
  background: #fff;
  font-size: 25px;
  font-weight: 500;
  line-height: 1;
}

.financial-add-asset-copy strong,
.financial-add-asset-copy small {
  display: block;
}

.financial-add-asset-copy strong {
  font-size: 14px;
  font-weight: 850;
}

.financial-add-asset-copy small {
  margin-top: 4px;
  color: #748195;
  font-size: 11px;
  line-height: 1.45;
}

.financial-add-asset-arrow {
  color: #8290a4;
  font-size: 27px;
  line-height: 1;
}

.financial-status {
  margin: 8px 0 24px;
}

.financial-assets-section {
  margin-top: 18px;
}

.financial-assets-heading {
  align-items: flex-end;
}

.financial-balance-toggle {
  display: inline-flex;
  min-height: 38px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #ccd7e7;
  border-radius: 10px;
  color: #315d9e;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.financial-balance-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.financial-balance-toggle:hover,
.financial-balance-toggle:focus-visible {
  border-color: #7e9dcc;
  outline: 3px solid rgb(40 100 215 / 12%);
  background: #f7faff;
}

.financial-asset-table-group {
  overflow: hidden;
}

.financial-summary-line {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  padding: 12px 16px;
  align-items: center;
  border-bottom: 1px solid #e4eaf2;
  background: #f7f9fc;
}

.financial-summary-item {
  display: flex;
  min-width: 0;
  padding: 0 15px;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  border-left: 1px solid #dce3ed;
  white-space: nowrap;
}

.financial-summary-item:first-child {
  padding-left: 0;
  justify-content: flex-start;
  border-left: 0;
}

.financial-summary-item:last-child {
  padding-right: 0;
}

.financial-summary-item small {
  overflow: hidden;
  color: #68778d;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.financial-summary-item strong {
  overflow: hidden;
  color: #18345f;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
}

[data-balance-value][data-balance-hidden="true"] {
  letter-spacing: 0.08em;
}

.financial-asset-table-shell {
  overflow: hidden;
}

.financial-asset-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

.financial-asset-table th,
.financial-asset-table td {
  padding: 13px 15px;
  border-bottom: 1px solid #e7ebf2;
  color: #42516a;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.financial-asset-table th:nth-child(1) {
  width: 9%;
  text-align: center;
}

.financial-asset-table th:nth-child(2) {
  width: 35%;
}

.financial-asset-table th:nth-child(3) {
  width: 26%;
  text-align: right;
}

.financial-asset-table th:nth-child(4) {
  width: 30%;
}

.financial-asset-table th {
  color: #53627a;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.financial-asset-table tbody tr:last-child td {
  border-bottom: 0;
}

.financial-asset-type {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: #eef4ff;
  font-size: 16px;
}

.financial-asset-type.card {
  color: #6a50a6;
  background: #f4efff;
}

.financial-asset-name strong,
.financial-asset-name small {
  display: block;
}

.financial-asset-name strong {
  max-width: 180px;
  overflow: hidden;
  color: #172a49;
  font-size: 13px;
  text-overflow: ellipsis;
}

.financial-asset-name small {
  display: flex;
  min-width: 0;
  gap: 5px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.financial-asset-name small span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.financial-asset-name small span + span {
  flex: 0 0 auto;
}

.financial-asset-name small span + span::before {
  margin-right: 5px;
  content: "·";
}

.financial-asset-balance {
  color: #18345f !important;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right !important;
}

.financial-asset-status {
  white-space: normal !important;
}

.financial-asset-status > small {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.financial-asset-status.error > small,
.financial-asset-empty.error {
  color: var(--danger) !important;
}

.financial-asset-empty {
  padding: 26px 18px !important;
  color: var(--muted) !important;
  line-height: 1.55;
  text-align: center !important;
  white-space: normal !important;
}

.financial-section {
  margin-top: 42px;
}

.financial-heading-actions {
  display: flex;
  gap: 9px;
  align-items: center;
}

.financial-refresh-button {
  display: inline-flex;
  min-height: 36px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #d8e0eb;
  border-radius: 10px;
  color: #28559f;
  background: #fff;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.financial-refresh-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

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

.financial-instrument-card {
  display: flex;
  min-height: 164px;
  padding: 20px;
  flex-direction: column;
}

.financial-instrument-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.financial-instrument-heading > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.financial-instrument-heading strong {
  overflow: hidden;
  color: #172a49;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.financial-instrument-heading div > span {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.financial-instrument-icon {
  display: inline-grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 13px;
  background: #edf3ff;
  font-size: 20px;
}

.financial-instrument-icon.card-icon {
  background: #f4efff;
}

.financial-sync-badge {
  padding: 5px 7px;
  border-radius: 999px;
  color: #59667a;
  background: #edf0f5;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.financial-sync-badge.success {
  color: var(--success);
  background: var(--success-soft);
}

.financial-sync-badge.error {
  color: var(--danger);
  background: var(--danger-soft);
}

.financial-instrument-balance {
  margin-top: 23px;
  color: #132d58;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.financial-sync-copy {
  margin-top: auto;
  padding-top: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.financial-sync-copy.error {
  color: var(--danger);
}

.financial-empty-state {
  grid-column: 1 / -1;
  padding: 28px 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.financial-empty-state.error {
  color: var(--danger);
  background: var(--danger-soft);
}

.financial-transaction-list {
  overflow: hidden;
}

.financial-transaction-table-shell {
  overflow: hidden;
  scroll-margin-top: 84px;
}

.financial-transaction-pagination {
  display: grid;
  grid-template-columns: minmax(82px, auto) minmax(0, 1fr) minmax(82px, auto);
  gap: 12px;
  padding: 13px 15px;
  align-items: center;
  border-top: 1px solid #e2e8f1;
  background: #f8faff;
}

.financial-transaction-pagination[hidden] {
  display: none;
}

.financial-transaction-pagination > span {
  color: #63718a;
  font-size: 11px;
  font-weight: 750;
  text-align: center;
  white-space: nowrap;
}

.financial-transaction-pagination button {
  display: inline-flex;
  min-height: 34px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #cfdaea;
  border-radius: 10px;
  color: #2859a8;
  background: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.financial-transaction-pagination button:hover,
.financial-transaction-pagination button:focus-visible {
  border-color: #7e9dcc;
  outline: 3px solid rgb(40 100 215 / 12%);
}

.financial-transaction-pagination button:disabled {
  border-color: #e1e6ee;
  color: #9aa5b5;
  background: #f3f5f8;
  cursor: default;
  outline: none;
}

.financial-transaction-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.asset-plus-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  color: #fff;
  background: #285fc2;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  vertical-align: middle;
}

.quick-asset-type-icon.gmail {
  background: #fff0ee;
}

.financial-source-filter .app-control { width: 100%; min-width: 0; }
.financial-source-filter .app-control-trigger {
  width: 100%; min-width: 0; height: 30px; padding: 0 24px 0 0;
  border: 0; background: transparent; box-shadow: none;
  color: inherit; font-size: inherit; font-weight: inherit;
}
.financial-source-filter .app-control-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.financial-transaction-table th,
.financial-transaction-table td {
  padding: 14px 15px;
  border-bottom: 1px solid #e7ebf2;
  text-align: left;
  vertical-align: middle;
}

.financial-transaction-table th {
  color: #53627a;
  background: #f6f8fb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.financial-transaction-table tbody tr:last-child td {
  border-bottom: 0;
}

.financial-transaction-table td {
  color: #42516a;
  font-variant-numeric: tabular-nums;
}

.financial-transaction-table th:nth-child(1) {
  width: 18%;
}

.financial-transaction-table th:nth-child(2) {
  width: 57%;
}

.financial-transaction-table th:nth-child(3) {
  width: 25%;
  text-align: right;
}

.financial-transaction-date > span,
.financial-transaction-date > small {
  display: block;
  white-space: nowrap;
}

.financial-transaction-date > span {
  color: #42516a;
  font-weight: 750;
}

.financial-transaction-date > small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.financial-transaction-table .financial-table-description {
  min-width: 0;
  color: #1b2c48;
}

.financial-table-description > strong {
  display: block;
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.financial-transaction-meta {
  display: flex;
  gap: 5px;
  margin-top: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.financial-transaction-meta-badge {
  display: inline-flex;
  min-height: 24px;
  padding: 4px 7px;
  align-items: center;
  border-radius: 999px;
  color: #59667a;
  background: #f0f2f6;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.financial-transaction-meta-badge.account {
  color: #315fae;
  background: #eef4ff;
}

.financial-transaction-meta-badge.type {
  color: #6657a8;
  background: #f2efff;
}

.financial-transaction-meta .financial-spending-toggle,
.financial-transaction-meta .financial-spending-state {
  min-width: 0;
  min-height: 24px;
  padding: 4px 7px;
  font-size: 10px;
  line-height: 1.2;
}

.financial-direction-badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  color: #66758c;
  background: #eef1f6;
  font-size: 11px;
  font-weight: 800;
}

.financial-direction-badge.deposit {
  color: var(--success);
  background: var(--success-soft);
}

.financial-direction-badge.withdrawal {
  color: #315fae;
  background: var(--blue-soft);
}

.financial-table-amount {
  position: relative;
  text-align: right !important;
}

.financial-table-amount > strong,
.financial-transaction-balance {
  display: block;
  white-space: nowrap;
}

.financial-transaction-balance {
  position: absolute;
  right: 15px;
  bottom: 12px;
  margin-top: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.financial-transaction-balance[data-balance-hidden="true"] {
  visibility: hidden;
}

.financial-table-amount.deposit {
  color: var(--success);
  font-weight: 800;
}

.financial-table-amount.withdrawal {
  color: #315fae;
  font-weight: 800;
}

.financial-spending-count {
  background: #e9f7ef;
  color: #237a4b;
}

.financial-table-spending {
  text-align: center !important;
}

.financial-spending-toggle,
.financial-spending-state {
  display: inline-flex;
  min-width: 92px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.financial-spending-toggle {
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.financial-spending-toggle.included {
  border-color: #efc4ca;
  background: #fff5f6;
  color: #ae3e4c;
}

.financial-spending-toggle.excluded {
  border-color: #d8dee8;
  background: #f4f6f9;
  color: #59667a;
}

.financial-spending-toggle.pending {
  border-color: #cad9f2;
  color: #315fae;
  background: #eef4ff;
  text-decoration: none;
}

.financial-spending-toggle:hover,
.financial-spending-toggle:focus-visible {
  border-color: #5d6bf8;
  outline: none;
  box-shadow: 0 0 0 3px rgba(93, 107, 248, 0.14);
}

.financial-spending-toggle:disabled {
  cursor: wait;
  opacity: 0.65;
}

.financial-spending-state.unavailable {
  color: #8993a3;
}

.financial-spending-state.included {
  color: var(--success);
  background: var(--success-soft);
}

.financial-spending-state.excluded {
  color: #768296;
  background: #f0f2f6;
}

.financial-excluded-reconsider {
  min-width: 0;
  min-height: 28px;
  max-width: 100%;
  margin-top: 8px;
  padding: 5px 9px;
  font-size: 10px;
}

.financial-transaction-table-shell > .financial-empty-state {
  border: 0;
  box-shadow: none;
}

.financial-transaction-list > .financial-empty-state {
  border: 0;
  box-shadow: none;
}

.financial-transaction-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  padding: 17px 19px;
  align-items: center;
  border-bottom: 1px solid #e7ebf2;
}

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

.financial-transaction-icon {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #66758c;
  background: #eef1f6;
  font-size: 18px;
  font-weight: 850;
}

.financial-transaction-icon.deposit {
  color: var(--success);
  background: var(--success-soft);
}

.financial-transaction-icon.withdrawal {
  color: #315fae;
  background: var(--blue-soft);
}

.financial-transaction-copy,
.financial-transaction-values {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.financial-transaction-copy strong {
  overflow: hidden;
  color: #1b2c48;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.financial-transaction-copy span,
.financial-transaction-values span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.financial-transaction-values {
  align-items: flex-end;
  text-align: right;
}

.financial-transaction-values strong {
  color: #42516a;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.financial-transaction-values.deposit strong {
  color: var(--success);
}

.financial-transaction-values.withdrawal strong {
  color: #315fae;
}

@media (max-width: 760px) {
  .financial-instrument-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 599px) {
  .financial-intro {
    padding-bottom: 2px;
  }

  .financial-section {
    margin-top: 34px;
  }

  .financial-assets-section {
    margin-top: 18px;
  }

  .financial-section .connection-section-heading {
    gap: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .financial-heading-actions {
    width: 100%;
    justify-content: space-between;
  }

  .financial-summary-line {
    grid-template-columns: minmax(0, 1.55fr) repeat(2, minmax(0, 1fr));
    padding: 10px 8px;
  }

  .financial-summary-item {
    padding: 0 8px;
    align-items: center;
    flex-direction: column;
    gap: 2px;
  }

  .financial-summary-item:first-child {
    padding-left: 0;
    align-items: flex-start;
    justify-content: center;
  }

  .financial-summary-item small {
    max-width: 100%;
    font-size: 9px;
  }

  .financial-summary-item strong {
    max-width: 100%;
    font-size: 12px;
  }

  .financial-asset-table {
    min-width: 0;
  }

  .financial-asset-table th,
  .financial-asset-table td {
    padding: 10px 5px;
  }

  .financial-asset-table th:nth-child(1) {
    width: 11%;
  }

  .financial-asset-table th:nth-child(2) {
    width: 36%;
  }

  .financial-asset-table th:nth-child(3) {
    width: 24%;
  }

  .financial-asset-table th:nth-child(4) {
    width: 29%;
  }

  .financial-asset-type-cell {
    text-align: center !important;
  }

  .financial-asset-type {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    font-size: 14px;
  }

  .financial-asset-name strong {
    max-width: none;
    font-size: 11px;
  }

  .financial-asset-name small {
    gap: 3px;
    font-size: 8px;
  }

  .financial-asset-name small span + span::before {
    margin-right: 3px;
  }

  .financial-asset-balance {
    font-size: 10px;
  }

  .financial-asset-status .financial-sync-badge {
    padding: 4px 5px;
    font-size: 8px;
  }

  .financial-asset-status > small {
    margin-top: 4px;
    font-size: 7.5px;
    line-height: 1.35;
  }

  .financial-transaction-table th,
  .financial-transaction-table td {
    padding: 12px 6px;
    vertical-align: top;
  }

  .financial-transaction-pagination {
    grid-template-columns: minmax(70px, auto) minmax(0, 1fr) minmax(70px, auto);
    gap: 7px;
    padding: 10px;
  }

  .financial-transaction-pagination button {
    min-height: 32px;
    padding: 0 9px;
    font-size: 10px;
  }

  .financial-transaction-pagination > span {
    font-size: 10px;
  }

  .financial-transaction-table th:nth-child(1) {
    width: 24%;
    padding-left: 10px;
  }

  .financial-transaction-table th:nth-child(2) {
    width: 45%;
  }

  .financial-transaction-table th:nth-child(3) {
    width: 31%;
    padding-right: 10px;
  }

  .financial-transaction-date {
    padding-left: 10px !important;
  }

  .financial-transaction-date > span {
    font-size: 9.5px;
    line-height: 1.35;
    white-space: nowrap;
  }

  .financial-transaction-date > small {
    font-size: 9px;
  }

  .financial-table-description {
    padding-right: 3px !important;
    padding-left: 3px !important;
  }

  .financial-table-description > strong {
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .financial-transaction-meta {
    gap: 4px;
    margin-top: 6px;
  }

  .financial-transaction-meta-badge,
  .financial-transaction-meta .financial-spending-toggle,
  .financial-transaction-meta .financial-spending-state {
    min-height: 21px;
    padding: 3px 5px;
    font-size: 8.5px;
  }

  .financial-table-amount {
    padding-right: 10px !important;
    padding-left: 3px !important;
    font-size: 11.5px;
  }

  .financial-transaction-balance {
    right: 10px;
    bottom: 12px;
    margin-top: 0;
    font-size: 8.5px;
    line-height: 1.3;
    white-space: nowrap;
  }

  .financial-excluded-reconsider {
    min-height: 24px;
    margin-top: 6px;
    padding: 4px 6px;
    font-size: 8.5px;
  }

  .financial-instrument-card {
    min-height: 154px;
    padding: 17px;
  }

  .financial-instrument-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .financial-instrument-heading .financial-sync-badge {
    grid-column: 2;
    width: max-content;
  }

  .financial-transaction-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 15px;
  }

  .financial-transaction-values {
    grid-column: 2;
    align-items: flex-start;
    margin-top: -3px;
    text-align: left;
  }

  .financial-transaction-values span {
    display: none;
  }
}

/* Compact, app-style settings index. Editors keep using the scrollable dialogs above. */
.settings-page {
  --page-content-max-width: 620px;
}

.settings-heading {
  margin-bottom: 12px;
}

.settings-heading h1 {
  font-size: 28px;
}

.settings-menu-list {
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgb(25 48 83 / 6%);
}

.settings-menu-row {
  display: grid;
  width: 100%;
  min-height: 56px;
  grid-template-columns: 36px minmax(0, 1fr) auto 10px;
  gap: 10px;
  padding: 8px 13px;
  align-items: center;
  border: 0;
  color: inherit;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.settings-menu-row + .settings-menu-row {
  border-top: 1px solid #edf0f5;
}

.settings-menu-row:hover,
.settings-menu-row:active {
  background: #f6f9ff;
}

.settings-menu-row:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid rgb(40 100 215 / 22%);
  outline-offset: -3px;
  background: #f6f9ff;
}

.settings-menu-icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--blue-soft);
  font-size: 18px;
}

.settings-menu-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.settings-menu-copy strong,
.settings-menu-copy > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-menu-copy strong {
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.settings-menu-copy > span {
  color: #758197;
  font-size: 10.5px;
  line-height: 1.35;
}

.settings-menu-value {
  max-width: 116px;
  overflow: hidden;
  color: #68758a;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-menu-chevron {
  color: #9aa6b7;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  text-align: right;
}

.settings-dialog-section + .settings-dialog-section,
.settings-dialog-section + .settings-dialog-admin-section,
.settings-dialog-admin-section + .settings-dialog-section {
  margin-top: 18px;
}

.settings-dialog-section-heading,
.financial-dialog-heading {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 2px 12px;
}

.settings-dialog-section-heading .eyebrow {
  margin-bottom: 5px;
}

.settings-dialog-section-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  letter-spacing: -0.035em;
}

.financial-dialog-heading {
  align-items: center;
  margin-bottom: 0;
}

.financial-dialog-heading .section-supporting-copy {
  max-width: 510px;
  margin: 0;
}

.account-dialog {
  max-width: 520px;
}

.account-dialog-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  align-items: center;
}

.account-dialog-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--blue-soft);
  font-size: 19px;
}

.account-dialog-copy {
  min-width: 0;
}

.account-dialog-copy strong,
.account-dialog-copy p {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-dialog-copy strong {
  color: var(--navy);
  font-size: 14px;
}

.identity-link-card {
  margin-top: 12px;
}

.kakao-identity-icon {
  background: #fee500;
}

.kakao-identity-button {
  min-height: 40px;
  border: 1px solid #fee500;
  border-radius: 12px;
  background: #fee500;
  color: #191919;
  cursor: pointer;
  font-weight: 750;
}

.kakao-identity-button:hover {
  border-color: #f2d900;
  background: #f2d900;
}

.kakao-identity-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.account-identity-guide {
  margin: 12px 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 599px) {
  body.settings-index-page {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.settings-index-page .settings-page {
    display: flex;
    height: 100dvh;
    min-height: 0;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    flex-direction: column;
  }

  body.settings-index-page .settings-page > .app-header {
    position: relative;
    top: auto;
    flex: 0 0 auto;
    margin-bottom: 8px;
  }

  .settings-heading {
    flex: 0 0 auto;
    margin: 0 2px 8px;
  }

  .settings-heading h1 {
    font-size: 24px;
  }

  .settings-menu-list {
    flex: 0 0 auto;
    border-radius: 16px;
  }

  .settings-menu-row {
    min-height: 48px;
    grid-template-columns: 32px minmax(0, 1fr) auto 9px;
    gap: 8px;
    padding: 5px 10px;
  }

  .settings-menu-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 16px;
  }

  .settings-menu-value {
    max-width: 88px;
    font-size: 10px;
  }

  .settings-menu-chevron {
    font-size: 20px;
  }

  .financial-dialog-heading,
  .account-dialog-card {
    align-items: stretch;
  }

  .financial-dialog-heading {
    flex-direction: column;
  }

  .financial-dialog-heading .financial-add-link {
    width: 100%;
  }

  .account-dialog-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .account-dialog-card .compact-action {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 599px) and (max-height: 650px) {
  .settings-menu-row {
    min-height: 44px;
    grid-template-columns: 30px minmax(0, 1fr) auto 8px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .settings-menu-icon {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .settings-menu-copy > span {
    display: none;
  }
}

.records-load-more td {
  padding: 18px 12px;
  color: #71809a;
  font-size: 0.8rem;
  text-align: center;
  background: #f8faff;
}

.bankapi-free-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  background: #dcfce7;
  color: #166534;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.bankapi-success-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.bankapi-success-actions a {
  color: var(--primary, #2563eb);
  font-weight: 700;
}

.financial-refresh-assets-card {
  margin-top: -6px;
  background: #f6f8fb;
}

.financial-add-asset-icon.refresh {
  color: #166b5d;
  background: #edf9f5;
}

.bankapi-refresh-accounts {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid #dce4ef;
  border-radius: 12px;
  background: #fff;
}

.bankapi-refresh-accounts:empty {
  display: none;
}

.bankapi-refresh-account {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 6px 10px;
  border: 0;
}

.bankapi-refresh-account + .bankapi-refresh-account {
  border-top: 1px solid #edf0f5;
}

.bankapi-refresh-account-heading {
  display: flex;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  cursor: pointer;
}

.bankapi-refresh-account-heading input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #147c6c;
}

.bankapi-refresh-account-heading span,
.bankapi-refresh-account-heading strong,
.bankapi-refresh-account-heading small {
  display: block;
  min-width: 0;
}

.bankapi-refresh-account-heading strong {
  color: #20334e;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bankapi-refresh-account-heading small {
  margin-top: 3px;
  color: #748195;
  font-size: 11px;
}

.bankapi-refresh-password {
  width: 94px;
  margin: 0;
}

.bankapi-refresh-password input {
  height: 44px;
  padding-inline: 8px;
  text-align: center;
}

.bankapi-refresh-password input::placeholder {
  font-size: 12px;
  font-weight: 500;
}

.bankapi-refresh-dialog .quick-card-dialog-panel {
  padding: 20px 16px 16px;
}

.bankapi-refresh-dialog h2 {
  margin: 0 36px 6px 0;
  font-size: 20px;
}

.bankapi-refresh-dialog .quick-install-dialog-lead {
  margin: 0;
  font-size: 12px;
}

.bankapi-refresh-dialog .quick-card-form {
  gap: 10px;
  margin-top: 12px;
}

.bankapi-refresh-period {
  grid-template-columns: minmax(0, 1fr) 126px;
  align-items: center;
}

.bankapi-refresh-period .app-control-trigger {
  height: 44px;
  min-height: 44px;
  padding-left: 10px;
  font-size: 14px;
}

.bankapi-refresh-period[hidden] {
  display: none;
}

.bankapi-refresh-help {
  margin: 0;
  color: #748195;
  font-size: 11px;
  line-height: 1.5;
}

.bankapi-refresh-dialog .quick-card-submit {
  min-height: 44px;
  margin-top: 0;
}

.bankapi-refresh-unsupported {
  grid-column: 1 / -1;
  margin: 0 0 0 28px;
  color: #8a6370;
  font-size: 11px;
  line-height: 1.5;
}

.nav-recurring-match-count {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #d34a52;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.nav-recurring-match-count[hidden] {
  display: none;
}

.records-category.category-savings {
  color: #116954;
  background: #e7f6ef;
}

#financial-access-list,
#income-sources-list,
#deleted-expenses-list,
.category-settings-list.category-settings-table {
  display: block;
  overflow: hidden;
  border: 1px solid #dce4ef;
  border-radius: 12px;
  background: #fff;
}

/* Settings subpages share the main menu's compact, click-to-edit rows. */
.settings-compact-item + .settings-compact-item {
  border-top: 1px solid #edf0f5;
}

.settings-compact-item {
  min-width: 0;
}

.settings-compact-item > .settings-compact-row {
  min-height: 52px;
  border-radius: 0;
}

.settings-compact-row[aria-expanded="true"] {
  background: #f6f9ff;
}

.settings-compact-row[aria-expanded="true"] .settings-menu-chevron {
  transform: rotate(90deg);
}

.settings-compact-row .settings-menu-copy > span:not([hidden]) {
  display: block;
}

.settings-compact-row .settings-menu-value {
  max-width: 120px;
}

.settings-row-editor {
  padding: 12px;
  border-top: 1px solid #edf0f5;
  background: #f8faff;
}

.settings-row-editor[hidden] {
  display: none;
}

.settings-row-editor > .card,
.settings-row-editor > .category-settings-card {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.settings-row-editor > .category-settings-table-row .category-settings-card-header {
  grid-template-columns: 46px minmax(0, 1fr) auto;
  padding: 0 0 10px;
}

.settings-row-editor > .category-settings-table-row .subcategory-settings-body {
  padding: 0;
}

#income-sources-form {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#income-sources-form .income-source-settings-row {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 8px;
}

#financial-access-dialog .financial-asset-add-link {
  display: flex;
  min-height: 44px;
  margin-top: 8px;
  padding: 8px 12px;
  align-items: center;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

#financial-access-dialog .financial-access-section {
  gap: 0;
}

#financial-asset-dialog .financial-security-note,
#category-settings-dialog .category-settings-note,
#deleted-expenses-dialog .deleted-expenses-note {
  padding: 10px 12px;
  margin-bottom: 12px;
}

.category-settings-table-head,
.category-settings-table-row .category-settings-card-header {
  display: grid;
  grid-template-columns: 62px minmax(150px, 1fr) 132px 56px;
  gap: 10px;
  align-items: center;
}

.category-settings-table-head {
  min-height: 42px;
  padding: 8px 16px;
  border-bottom: 1px solid #dce4ef;
  color: #6d7b91;
  background: #f5f8fc;
  font-size: 11px;
  font-weight: 800;
}

.category-settings-table-head span:nth-child(3),
.category-settings-table-head span:nth-child(4) {
  text-align: center;
}

.category-settings-table-row {
  padding: 0;
  border-bottom: 1px solid #e7edf5;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

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

.category-settings-table-row .category-settings-card-header {
  padding: 11px 16px;
}

.category-settings-table-row .category-emoji-field,
.category-settings-table-row .category-name-field {
  display: block;
}

.category-settings-table-row .category-emoji-field > span,
.category-settings-table-row .category-name-field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.category-settings-table-row .category-emoji-select,
.category-settings-table-row .category-name-field input {
  height: 40px;
  border-radius: 9px;
}

.category-settings-table-row .category-emoji-select {
  padding: 4px 6px;
  font-size: 20px;
}

.category-settings-table-row .app-control--emoji .app-control-trigger {
  height: 40px;
  padding: 4px 18px 4px 4px;
  border-radius: 9px;
  font-size: 18px;
}

.category-settings-table-row .app-control--emoji .app-control-arrow {
  right: 7px;
}

.subcategory-detail-toggle {
  display: grid;
  gap: 2px;
  min-height: 40px;
  padding: 5px 8px;
  align-content: center;
  border: 1px solid #d7e2f2;
  border-radius: 9px;
  color: #285da9;
  background: #f5f8fd;
  text-align: center;
  cursor: pointer;
}

.subcategory-detail-toggle strong {
  font-size: 11px;
  white-space: nowrap;
}

.subcategory-detail-toggle span {
  color: #7a879a;
  font-size: 10px;
  font-weight: 700;
}

.subcategory-detail-toggle:hover,
.subcategory-detail-toggle:focus-visible,
.subcategory-detail-toggle[aria-expanded="true"] {
  border-color: #b9ceed;
  color: #174c98;
  background: #eaf2ff;
  outline: none;
}

.category-settings-table-row .category-remove-button {
  min-height: 40px;
  padding-inline: 8px;
}

.category-settings-table-row .subcategory-settings-body {
  padding: 0 16px 14px;
  border-top: 1px solid #edf1f6;
  background: #f8faff;
}

.category-settings-table-row .subcategory-settings-body[hidden] {
  display: none;
}

.subcategory-settings-subhead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 0 7px;
  color: #7a8799;
  font-size: 10px;
  font-weight: 800;
}

.category-settings-table-row .subcategory-settings-list {
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid #e0e7f0;
  border-radius: 9px;
  background: #fff;
}

.category-settings-table-row .subcategory-settings-row {
  padding: 7px 8px;
  border-bottom: 1px solid #edf1f6;
}

.category-settings-table-row .subcategory-settings-row:last-child {
  border-bottom: 0;
}

.category-settings-table-row .subcategory-settings-row input {
  border-color: transparent;
  background: transparent;
}

.category-settings-table-row .subcategory-add-button {
  margin-top: 9px;
}

@media (max-width: 599px) {
  .category-settings-table-head,
  .category-settings-table-row .category-settings-card-header {
    grid-template-columns: 46px minmax(0, 1fr) 92px 44px;
    gap: 6px;
  }

  .category-settings-table-head {
    padding-inline: 10px;
  }

  .category-settings-table-row .category-settings-card-header {
    padding: 9px 10px;
  }

  .category-settings-table-row .subcategory-settings-body {
    padding: 0 10px 12px;
  }

  .subcategory-detail-toggle {
    padding-inline: 4px;
  }

  .subcategory-detail-toggle strong {
    white-space: normal;
    line-height: 1.15;
  }

  .subcategory-settings-subhead span:last-child {
    max-width: 110px;
    text-align: right;
  }

  .category-settings-table-row .subcategory-settings-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.individual-family-section {
  display: grid;
  gap: 16px;
}

.individual-family-section[hidden],
.leave-family-section[hidden],
#family-members-section[hidden] {
  display: none;
}

.individual-status-card {
  display: flex;
  gap: 12px;
  padding: 15px;
  border: 1px solid #dbe5f2;
  border-radius: 14px;
  background: #f5f8fd;
}

.individual-status-card strong,
.family-choice-form h3,
.leave-family-section h3 {
  color: #172844;
}

.individual-status-card p,
.leave-family-section p {
  margin: 4px 0 0;
  color: #697991;
  font-size: 0.82rem;
  line-height: 1.55;
}

.family-choice-form {
  display: grid;
  gap: 11px;
  padding: 17px;
  border: 1px solid #dce4ef;
  border-radius: 15px;
  background: #fff;
}

.family-choice-form h3 {
  margin: 2px 0 0;
  font-size: 1rem;
}

.family-choice-form > label:not(.family-share-choice) {
  color: #46566e;
  font-size: 0.78rem;
  font-weight: 750;
}

.family-choice-form > input[type="text"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid #d8e0ec;
  border-radius: 11px;
  outline: none;
  color: #1b2a43;
  background: #fff;
  font: inherit;
  font-weight: 700;
}

.family-choice-form > input[type="text"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(40 100 215 / 12%);
}

.family-share-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px;
  border-radius: 11px;
  background: #f7f9fc;
  cursor: pointer;
}

.family-share-choice input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--blue);
}

.family-share-choice span {
  display: grid;
  gap: 3px;
}

.family-share-choice strong {
  color: #263750;
  font-size: 0.82rem;
}

.family-share-choice small {
  color: #718099;
  font-size: 0.72rem;
  line-height: 1.45;
}

.family-choice-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8793a5;
  font-size: 0.72rem;
}

.family-choice-divider::before,
.family-choice-divider::after {
  height: 1px;
  background: #e1e7f0;
  content: "";
  flex: 1;
}

.leave-family-section {
  padding-top: 18px;
  border-top: 1px solid #e6ebf2;
}

.leave-category-dialog .category-settings-dialog-shell {
  width: min(100%, 560px);
}

.leave-category-options {
  display: grid;
  gap: 12px;
}

.leave-category-option {
  margin: 0;
  padding: 15px;
  border: 1px solid #dce4ef;
  border-radius: 14px;
  background: #fff;
}

.leave-category-option:has(input:checked) {
  border-color: #8db2ea;
  background: #f3f7ff;
  box-shadow: 0 0 0 2px rgb(42 102 194 / 8%);
}

.family-request-sharing {
  color: #3766a5;
  font-size: 0.72rem;
  font-weight: 700;
}

/* Keep every mobile screen aligned to the same six-pixel outer gutter. */
@media (max-width: 599px) {
  main.page-shell.page-shell {
    padding-right: max(6px, env(safe-area-inset-right));
    padding-left: max(6px, env(safe-area-inset-left));
  }

  main.auth-page-shell {
    width: 100%;
    max-width: 480px;
    padding-right: max(6px, env(safe-area-inset-right));
    padding-left: max(6px, env(safe-area-inset-left));
  }
}

/* Prevent any route or overlay from widening the document viewport. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

.recurring-transfer-dialog-scroll {
  display: grid;
  max-width: 100%;
  gap: 24px;
  overflow-x: hidden;
}

.recurring-transfer-note {
  margin: 0;
}

.recurring-transfer-section {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.recurring-transfer-section + .recurring-transfer-section {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.recurring-transfer-section-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recurring-transfer-section-heading h3 {
  margin: 0;
  color: #1c2d49;
  font-size: 17px;
}

.recurring-transfer-heading-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.recurring-transfer-row-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  flex: 0 0 auto;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #d34a52;
  font-size: 10px;
  font-weight: 900;
}

.recurring-transfer-section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.recurring-transfer-list {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.recurring-transfer-table-shell {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce4ef;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 14px rgb(27 47 79 / 5%);
}

.recurring-transfer-table,
.recurring-transfer-match-table,
.recurring-transfer-recent-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.recurring-transfer-recent-table th,
.recurring-transfer-recent-table td {
  padding: 9px;
  border-bottom: 1px solid #e2e8f1;
  color: #263750;
  font-size: 11px;
  text-align: left;
}

.recurring-transfer-recent-table th {
  color: #6c7a91;
  background: #f7f9fc;
  font-size: 10px;
  font-weight: 800;
}

.recurring-transfer-recent-table th:nth-child(1),
.recurring-transfer-recent-table td:nth-child(1) {
  width: 20%;
  white-space: nowrap;
}

.recurring-transfer-recent-table th:nth-child(2),
.recurring-transfer-recent-table td:nth-child(2) {
  width: 52%;
}

.recurring-transfer-recent-table th:nth-child(3),
.recurring-transfer-recent-table td:nth-child(3) {
  width: 28%;
  text-align: right;
  white-space: nowrap;
}

.recurring-transfer-recent-table td:nth-child(2) strong,
.recurring-transfer-recent-table td:nth-child(2) small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-transfer-recent-table td:nth-child(2) small {
  margin-top: 2px;
  color: #738198;
  font-size: 9px;
}

.recurring-transfer-total-caption {
  padding: 0;
  caption-side: top;
  background: #eef4ff;
  border-bottom: 1px solid #dce4ef;
}

.recurring-transfer-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  color: #53647d;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.recurring-transfer-total-row strong {
  color: var(--blue);
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.recurring-transfer-table th,
.recurring-transfer-table td,
.recurring-transfer-match-table th,
.recurring-transfer-match-table td {
  min-width: 0;
  border-bottom: 1px solid #e2e8f1;
  text-align: left;
}

.recurring-transfer-table th {
  padding: 10px 9px;
  color: #6c7a91;
  background: #f7f9fc;
  font-size: 10px;
  font-weight: 800;
}

.recurring-transfer-table th:nth-child(1) {
  width: 48%;
}

.recurring-transfer-table th:nth-child(2) {
  width: 22%;
  text-align: right;
}

.recurring-transfer-table th:nth-child(3) {
  width: 13%;
  text-align: center;
}

.recurring-transfer-table th:nth-child(4) {
  width: 17%;
  text-align: right;
}

.recurring-transfer-summary-row {
  cursor: pointer;
  transition: background 140ms ease;
}

.recurring-transfer-summary-row:hover,
.recurring-transfer-summary-row:focus-visible,
.recurring-transfer-summary-row[aria-expanded="true"] {
  outline: none;
  background: #f5f9ff;
}

.recurring-transfer-summary-row.inactive {
  opacity: 0.62;
}

.recurring-transfer-summary-row > td {
  padding: 11px 9px;
  vertical-align: middle;
}

.recurring-transfer-summary-row .recurring-transfer-item-header {
  gap: 7px;
}

.recurring-transfer-summary-row .recurring-transfer-kind-icon {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 10px;
  font-size: 15px;
}

.recurring-transfer-summary-amount,
.recurring-transfer-summary-repeat,
.recurring-transfer-summary-action {
  overflow: hidden;
  color: #233a5e;
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-transfer-summary-amount {
  text-align: right !important;
}

.recurring-transfer-summary-repeat {
  text-align: center !important;
}

.recurring-transfer-summary-action {
  text-align: right !important;
}

.recurring-transfer-row-arrow {
  display: inline-block;
  margin-left: 5px;
  color: #70819a;
  font-size: 16px;
  line-height: 1;
  transition: transform 140ms ease;
}

.recurring-transfer-summary-row[aria-expanded="true"] .recurring-transfer-row-arrow {
  transform: rotate(180deg);
}

.recurring-transfer-detail-row > td {
  padding: 0;
  border-bottom: 1px solid #d7e0ec;
}

.recurring-transfer-table tbody:last-child .recurring-transfer-detail-row:last-child > td,
.recurring-transfer-match-table tbody tr:last-child td {
  border-bottom: 0;
}

.recurring-transfer-expanded-content {
  min-width: 0;
  padding: 3px 13px 14px;
  background: #fbfcfe;
}

.recurring-transfer-expanded-content.suggestion {
  background: #f8fbff;
}

.recurring-transfer-matches {
  min-width: 0;
  margin-top: 14px;
}

.recurring-transfer-matches h4 {
  margin: 0 0 7px;
  color: #273b5b;
  font-size: 12px;
}

.recurring-transfer-match-table {
  overflow: hidden;
  border: 1px solid #dfe6f0;
  border-radius: 10px;
  background: #fff;
}

.recurring-transfer-match-table th,
.recurring-transfer-match-table td {
  padding: 8px;
  font-size: 10px;
}

.recurring-transfer-match-table th {
  color: #718097;
  background: #f4f7fb;
  font-weight: 800;
}

.recurring-transfer-match-table th:nth-child(1),
.recurring-transfer-match-table td:nth-child(1) {
  width: 25%;
  white-space: nowrap;
}

.recurring-transfer-match-table th:nth-child(2),
.recurring-transfer-match-table td:nth-child(2) {
  width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-transfer-match-table th:nth-child(3),
.recurring-transfer-match-table td:nth-child(3) {
  width: 27%;
  text-align: right;
  white-space: nowrap;
}

.recurring-transfer-match-editable {
  cursor: pointer;
  transition: background 140ms ease;
}

.recurring-transfer-match-editable:hover,
.recurring-transfer-match-editable:focus-visible {
  outline: none;
  background: #edf5ff;
}

.recurring-transfer-match-table:not(.has-actions) .recurring-transfer-match-editable td:nth-child(2)::after {
  content: "수정";
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 999px;
  color: #2860ba;
  background: #e8f1ff;
  font-size: 8px;
  font-weight: 850;
}

.kakao-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  font-size: 18px;
}

.auth-linking-guide {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.auth-linking-guide strong {
  color: var(--navy);
}

.recurring-transfer-matches-empty {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  color: #718097;
  background: #f2f5f9;
  font-size: 11px;
}

.recurring-transfer-item {
  min-width: 0;
  padding: 15px;
  border: 1px solid #dce4ef;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 14px rgb(27 47 79 / 5%);
}

.recurring-transfer-item.suggestion {
  border-color: #cdddf6;
  background: #f8fbff;
}

.recurring-transfer-item.inactive {
  opacity: 0.68;
  background: #f7f8fa;
}

.recurring-transfer-item-header {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.recurring-transfer-kind-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 12px;
  background: #edf3ff;
  font-size: 18px;
}

.recurring-transfer-item-title {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.recurring-transfer-item-title strong,
.recurring-transfer-item-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-transfer-item-title strong {
  color: #172844;
  font-size: 14px;
}

.recurring-transfer-item-title span {
  color: #718099;
  font-size: 11px;
}

.recurring-transfer-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

.recurring-transfer-status.success {
  color: #137356;
  background: #e8f7f1;
}

.recurring-transfer-status.warning {
  color: #97610e;
  background: #fff5da;
}

.recurring-transfer-status.danger {
  color: #b43b48;
  background: #fff0f2;
}

.recurring-transfer-status.neutral,
.recurring-transfer-status.inactive {
  color: #58687f;
  background: #eef1f5;
}

.recurring-transfer-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

.recurring-transfer-details > div {
  min-width: 0;
  padding: 9px;
  border-radius: 10px;
  background: #f5f7fa;
}

.recurring-transfer-details dt {
  color: #7b889b;
  font-size: 10px;
  font-weight: 750;
}

.recurring-transfer-details dd {
  min-width: 0;
  margin: 4px 0 0;
  overflow: hidden;
  color: #263750;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recurring-transfer-item-footer,
.recurring-transfer-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.recurring-transfer-item-footer {
  justify-content: space-between;
}

.recurring-transfer-observed {
  color: #607089;
  font-size: 11px;
  font-weight: 750;
}

.recurring-transfer-add-button,
.recurring-transfer-dismiss-button,
.recurring-transfer-edit-button,
.recurring-transfer-assign-button,
.recurring-transfer-active-button,
.recurring-transfer-delete-button,
.recurring-transfer-action-toggle button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #d6deea;
  border-radius: 10px;
  color: #39506f;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.recurring-transfer-add-button {
  border-color: #2b65c7;
  color: #fff;
  background: #245ab5;
}

.recurring-transfer-suggestion-actions {
  display: flex;
  min-width: 0;
  gap: 7px;
}

.recurring-transfer-dismiss-button {
  color: #53637a;
  background: #fff;
}

.recurring-transfer-assign-button {
  color: #245caf;
  background: #f3f7ff;
}

.recurring-transfer-edit-button {
  color: #315374;
  background: #f8fafc;
}

.recurring-transfer-action-toggle {
  display: inline-flex;
  min-width: 0;
  padding: 2px;
  border-radius: 11px;
  background: #edf1f6;
}

.recurring-transfer-action-toggle button {
  min-height: 32px;
  border: 0;
  background: transparent;
}

.recurring-transfer-action-toggle button[aria-pressed="true"] {
  color: #1f58b8;
  background: #fff;
  box-shadow: 0 2px 6px rgb(31 60 105 / 12%);
}

.recurring-transfer-controls .recurring-transfer-assign-button {
  margin-left: auto;
}

.recurring-transfer-controls button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.recurring-transfer-delete-button {
  color: var(--danger);
}

.recurring-transfer-empty {
  display: flex;
  gap: 11px;
  padding: 17px;
  align-items: center;
  border: 1px dashed #d7dfeb;
  border-radius: 14px;
  color: #708097;
  background: #f8f9fb;
}

.recurring-transfer-empty > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  background: #eaf0f8;
  font-weight: 900;
}

.recurring-transfer-empty strong {
  display: block;
  color: #43536a;
  font-size: 13px;
}

.recurring-transfer-empty p {
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.45;
}

.manual-recurring-open,
.manual-recurring-form-heading button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #ced9e9;
  border-radius: 10px;
  color: #285cae;
  background: #fff;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.manual-recurring-panel {
  min-width: 0;
  padding: 15px;
  border: 1px solid #cfdcf0;
  border-radius: 16px;
  background: #f7faff;
}

.manual-recurring-form,
.manual-recurring-form-heading,
.manual-recurring-ledger-heading {
  min-width: 0;
}

.manual-recurring-form {
  display: grid;
  gap: 7px;
}

.manual-recurring-form-heading,
.manual-recurring-ledger-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.manual-recurring-form-heading h3 {
  margin: 0;
  color: #1b2f4e;
  font-size: 16px;
}

.manual-recurring-form-heading p {
  margin: 3px 0 0;
  color: #687991;
  font-size: 11px;
}

.manual-recurring-fields {
  display: grid;
  grid-template-columns: 62px minmax(0, 1.5fr) minmax(110px, 0.9fr) 92px;
  grid-auto-rows: 44px;
  gap: 0;
  overflow: hidden;
  border: 1px solid #d6dfeb;
  border-radius: 10px;
  background: #fff;
}

.manual-recurring-fields label {
  display: grid;
  min-width: 0;
  min-height: 0;
  gap: 1px;
  padding: 3px 8px;
  align-content: center;
  border-right: 1px solid #e1e7f0;
  color: #53647d;
  font-size: 9px;
  font-weight: 800;
}

.manual-recurring-fields label:last-child {
  border-right: 0;
}

.manual-recurring-fields input,
.manual-recurring-fields select {
  width: 100%;
  min-width: 0;
  height: 22px;
  min-height: 22px;
  box-sizing: border-box;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: #1c2e4a;
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
}

.manual-recurring-fields input:focus {
  box-shadow: inset 0 -2px #2c65c0;
}

.manual-recurring-icon-field select {
  text-align: center;
  font-size: 15px;
}

.manual-recurring-icon-field .app-control-trigger {
  height: 22px;
  min-height: 22px;
  padding: 0 17px 0 3px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-size: 15px;
}

.manual-recurring-icon-field .app-control-arrow {
  right: 5px;
  width: 6px;
  height: 6px;
}

.manual-recurring-money-input,
.manual-recurring-day-input {
  position: relative;
  min-width: 0;
}

.manual-recurring-money-input input,
.manual-recurring-day-input input,
.manual-recurring-day-input select {
  padding-right: 19px;
  text-align: right;
}

.manual-recurring-day-input .app-control-trigger {
  height: 22px;
  min-height: 22px;
  padding: 0 17px 0 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  justify-content: flex-end;
}

.manual-recurring-day-input .app-control-arrow {
  right: 5px;
  width: 6px;
  height: 6px;
}

.manual-recurring-money-input span,
.manual-recurring-day-input span {
  position: absolute;
  top: 50%;
  right: 10px;
  color: #697991;
  font-size: 11px;
  font-weight: 800;
  transform: translateY(-50%);
  pointer-events: none;
}

.manual-recurring-filters {
  display: grid;
  grid-template-columns: minmax(130px, 1.6fr) repeat(3, minmax(92px, 1fr)) auto;
  gap: 6px;
  align-items: center;
}

.manual-recurring-filters input,
.manual-recurring-filters select,
.manual-recurring-filters button {
  width: 100%;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  box-sizing: border-box;
  padding: 5px 8px;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  color: #40516b;
  background: #fff;
  font-size: 10px;
  font-weight: 750;
}

.manual-recurring-filters button {
  width: auto;
  color: #65748a;
  cursor: pointer;
}

.manual-recurring-filters .app-control-trigger {
  height: 32px;
  min-height: 32px;
  padding: 0 25px 0 8px;
  border-radius: 8px;
  font-size: 10px;
}

.manual-recurring-filters .app-control-arrow {
  right: 9px;
  width: 6px;
  height: 6px;
}

.manual-recurring-ledger-heading strong,
.manual-recurring-ledger-heading span {
  display: block;
}

.manual-recurring-ledger-heading strong {
  color: #243753;
  font-size: 13px;
}

.manual-recurring-ledger-heading span {
  margin-top: 2px;
  color: #2a64be;
  font-size: 10px;
  font-weight: 800;
}

.manual-recurring-help {
  margin: -7px 0 0;
  color: #718097;
  font-size: 10px;
}

.manual-recurring-transactions {
  min-width: 0;
  max-height: 310px;
  overflow-y: auto;
  border: 1px solid #dbe3ef;
  border-radius: 11px;
  background: #fff;
}

.manual-recurring-transaction-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.manual-recurring-transaction-table th,
.manual-recurring-transaction-table td {
  padding: 5px 6px;
  border-bottom: 1px solid #e5eaf2;
  overflow: hidden;
  color: #31435f;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-recurring-transaction-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #6d7b91;
  background: #f3f6fa;
  text-align: left;
  font-weight: 850;
}

.manual-recurring-transaction-table th:nth-child(1),
.manual-recurring-transaction-table td:nth-child(1) {
  width: 36px;
  text-align: center;
}

.manual-recurring-transaction-table th:nth-child(2),
.manual-recurring-transaction-table td:nth-child(2) {
  width: 64px;
}

.manual-recurring-transaction-table th:nth-child(4),
.manual-recurring-transaction-table td:nth-child(4) {
  width: 100px;
  text-align: right;
}

.manual-recurring-transaction-table tr.selected td {
  background: #edf5ff;
}

.manual-recurring-transaction-table tbody tr {
  cursor: pointer;
}

.manual-recurring-transaction-table input[type="checkbox"] {
  display: inline-block;
  width: 15px;
  min-width: 15px;
  height: 15px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 3px;
  accent-color: #2864c1;
}

.manual-recurring-transaction-table td:nth-child(3) strong,
.manual-recurring-transaction-table td:nth-child(3) small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-recurring-transaction-table td:nth-child(3) strong {
  color: #263a5a;
  font-size: 10px;
}

.manual-recurring-transaction-table td:nth-child(3) small {
  margin-top: 1px;
  color: #7b889b;
  font-size: 8px;
}

.manual-recurring-more {
  margin: 0;
  padding: 9px;
  color: #6f7e94;
  background: #f5f7fa;
  text-align: center;
  font-size: 10px;
}

.manual-recurring-save {
  min-height: 36px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: #245ab5;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.manual-recurring-save:disabled {
  opacity: 0.55;
  cursor: wait;
}

.recurring-assignment-dialog {
  width: min(720px, calc(100% - 24px));
}

.recurring-rule-editor-dialog {
  width: min(560px, calc(100% - 24px));
}

.recurring-rule-editor-scroll {
  display: grid;
  gap: 11px;
}

.recurring-rule-editor-help {
  margin: 0;
  color: #65758c;
  font-size: 11px;
  line-height: 1.5;
}

.recurring-rule-editor-actions {
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
}

.recurring-assignment-scroll {
  display: grid;
  gap: 9px;
}

.recurring-assignment-note {
  margin: 0;
}

.recurring-assignment-transactions {
  max-height: min(390px, 45dvh);
}

.recurring-assignment-actions {
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
}

.family-learning-recurring-feedback {
  padding: 13px 0;
  border-top: 1px solid #e3e9f2;
  border-bottom: 1px solid #e3e9f2;
}

.family-learning-recurring-feedback .family-learning-section-heading > strong {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: #225aa9;
  background: #eaf2ff;
  font-size: 11px;
}

.family-learning-kakao-feedback {
  display: grid;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #e3e9f2;
}

.family-learning-kakao-feedback .family-learning-section-heading > strong {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: #5b438b;
  background: #f1ebff;
  font-size: 11px;
}

.kakao-question-feedback-list {
  display: grid;
  gap: 10px;
}

.kakao-question-feedback-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dfe5ee;
  border-radius: 13px;
  background: #fbfcfe;
}

.kakao-question-feedback-heading {
  display: grid;
  gap: 4px;
}

.kakao-question-feedback-heading strong {
  color: #243248;
  font-size: 13px;
  line-height: 1.45;
}

.kakao-question-feedback-heading span {
  color: #748198;
  font-size: 11px;
}

.kakao-question-feedback-item label {
  display: grid;
  gap: 5px;
  color: #526176;
  font-size: 11px;
  font-weight: 700;
}

.kakao-question-feedback-item textarea {
  width: 100%;
  resize: vertical;
  min-height: 48px;
  box-sizing: border-box;
}

.kakao-question-feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.kakao-question-feedback-actions button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

@media (max-width: 599px) {
  .recurring-transfer-dialog-scroll {
    gap: 18px;
  }

  .recurring-transfer-section + .recurring-transfer-section {
    padding-top: 18px;
  }

  .recurring-transfer-item {
    padding: 12px;
  }

  .recurring-transfer-table th,
  .recurring-transfer-summary-row > td {
    padding-right: 6px;
    padding-left: 6px;
  }

  .recurring-transfer-table th:nth-child(1) {
    width: 42%;
  }

  .recurring-transfer-table th:nth-child(2) {
    width: 29%;
  }

  .recurring-transfer-table th:nth-child(3) {
    width: 12%;
  }

  .recurring-transfer-table th:nth-child(4) {
    width: 17%;
  }

  .recurring-transfer-summary-row .recurring-transfer-kind-icon {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
  }

  .recurring-transfer-summary-row .recurring-transfer-item-title strong {
    font-size: 12px;
  }

  .recurring-transfer-summary-row .recurring-transfer-item-title span {
    font-size: 9px;
  }

  .recurring-transfer-table .recurring-transfer-status {
    padding: 4px 5px;
    font-size: 9px;
  }

  .recurring-transfer-expanded-content {
    padding-right: 8px;
    padding-left: 8px;
  }

  .recurring-transfer-match-table th,
  .recurring-transfer-match-table td {
    padding-right: 5px;
    padding-left: 5px;
  }

  .recurring-transfer-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 11px;
  }

  .recurring-transfer-controls {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .recurring-transfer-item-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .recurring-transfer-suggestion-actions {
    width: 100%;
  }

  .recurring-transfer-suggestion-actions button {
    flex: 1;
  }

  .recurring-transfer-action-toggle {
    width: 100%;
  }

  .recurring-transfer-action-toggle button {
    flex: 1;
  }

  .recurring-transfer-controls .recurring-transfer-active-button {
    margin-left: 0;
    flex: 1;
  }

  .recurring-transfer-controls .recurring-transfer-assign-button {
    margin-left: 0;
    flex: 1;
  }

  .recurring-transfer-section-heading {
    align-items: flex-start;
  }

  .manual-recurring-panel {
    padding: 11px;
  }

  .manual-recurring-fields {
    grid-template-columns: 54px minmax(0, 1fr) 82px;
    grid-auto-rows: 42px;
    grid-template-areas:
      "icon name name"
      "amount amount day";
  }

  .manual-recurring-icon-field {
    grid-area: icon;
    border-bottom: 1px solid #e1e7f0;
  }

  .manual-recurring-name-field {
    grid-area: name;
    border-right: 0 !important;
    border-bottom: 1px solid #e1e7f0;
  }

  .manual-recurring-fields label:nth-child(3) {
    grid-area: amount;
  }

  .manual-recurring-fields label:nth-child(4) {
    grid-area: day;
  }

  .manual-recurring-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "search search reset"
      "month category detail";
    gap: 4px;
  }

  .manual-recurring-filters input {
    grid-area: search;
  }

  .manual-recurring-filter-month {
    grid-area: month;
  }

  .manual-recurring-filter-category {
    grid-area: category;
  }

  .manual-recurring-filter-detail {
    grid-area: detail;
  }

  .manual-recurring-filters button {
    grid-area: reset;
    width: 100%;
    height: 32px;
    min-height: 32px;
    padding-inline: 6px;
  }

  .manual-recurring-filters .app-control {
    min-width: 0;
  }

  .manual-recurring-filters .app-control-trigger {
    height: 32px;
    min-height: 32px;
    padding-right: 20px;
    padding-left: 7px;
    font-size: 9px;
  }

  .manual-recurring-filters .app-control-arrow {
    right: 8px;
  }

  .manual-recurring-ledger-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-recurring-transaction-table th:nth-child(2),
  .manual-recurring-transaction-table td:nth-child(2) {
    width: 61px;
  }

  .manual-recurring-transaction-table th:nth-child(4),
  .manual-recurring-transaction-table td:nth-child(4) {
    width: 72px;
  }
}
/* Gmail is an email source and intentionally has no asset balance. */
.gmail-source-manage { min-width: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--muted); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.gmail-source-table .financial-asset-name { white-space: normal; overflow-wrap: anywhere; }
.bankapi-refresh-account-heading small { overflow-wrap: anywhere; }
[data-bankapi-refresh-status] { white-space: pre-line; overflow-wrap: anywhere; }
.gmail-dialog { border: 0; border-radius: 24px; width: min(440px, calc(100vw - 24px)); max-height: 88dvh; padding: 0; color: #243247; }
.gmail-dialog::backdrop { background: rgb(18 31 49 / 45%); }
.gmail-panel { padding: 24px; overflow-wrap: anywhere; }
.gmail-panel > button:first-child { float: right; }
.gmail-panel p { line-height: 1.65; font-size: 14px; }
.gmail-panel h2 { margin: 16px 0; }
.gmail-period { padding: 12px; border-radius: 12px; background: #edf5ef; font-weight: 700; }
.gmail-panel button, .gmail-purchase button { min-height: 44px; margin: 5px 4px 5px 0; white-space: normal; }
.gmail-purchase { padding: 20px; margin: 12px 0; overflow-wrap: anywhere; }
.gmail-purchase h3 { margin: 10px 0; }
.gmail-purchase p { margin: 10px 0; font-size: 14px; line-height: 1.5; }
.gmail-form { display: grid; gap: 12px; }
.gmail-form label { display: grid; gap: 6px; font-size: 14px; }
.gmail-form input, .gmail-form select { width: 100%; min-height: 44px; font: inherit; padding: 10px; border: 1px solid #d4dce6; border-radius: 10px; box-sizing: border-box; }
.gmail-panel pre { white-space: pre-wrap; font-size: 12px; overflow-wrap: anywhere; }
.gmail-recent { max-height: 34dvh; overflow-y: auto; flex-shrink: 0; margin-top: 16px; }
body:has(.financial-page) { overflow-x: clip; }

/* Kkaebu brand refresh -----------------------------------------------------
   Mint and eggshell are the everyday foundation. Smart blue, lavender and
   gold are reserved for contextual signals so the financial UI stays calm. */
:root {
  --kkaebu-mint: #8fdcc9;
  --kkaebu-mint-soft: #e8faf5;
  --kkaebu-deep-mint: #15584f;
  --kkaebu-mint-action: #23766a;
  --kkaebu-blue: #67b7ea;
  --kkaebu-blue-deep: #2679a6;
  --kkaebu-blue-soft: #eaf6fd;
  --kkaebu-lavender: #b8b8e9;
  --kkaebu-lavender-soft: #f1f0ff;
  --kkaebu-gold: #ffd66b;
  --kkaebu-gold-soft: #fff8e3;
  --kkaebu-eggshell: #f4fcfa;
  --app-canvas: #eff3f2;
  --kkaebu-surface: #ffffff;
  --kkaebu-surface-muted: #fafcfb;
  --kkaebu-ink: #1f2a2e;
  --kkaebu-muted: #66757a;
  --kkaebu-line: #cde6e0;
  --surface-line: #d4dedb;
  --kkaebu-shadow: 0 18px 48px rgb(31 42 46 / 9%);
  --navy: var(--kkaebu-deep-mint);
  --blue: var(--kkaebu-mint-action);
  --blue-soft: var(--kkaebu-mint-soft);
  --ink: var(--kkaebu-ink);
  --muted: var(--kkaebu-muted);
  --line: var(--kkaebu-line);
  --danger: #b84f59;
  --danger-soft: #fff1f2;
  --success: #23766a;
  --success-soft: #e8faf5;
  color: var(--kkaebu-ink);
  background: var(--app-canvas);
}

html {
  background:
    radial-gradient(circle at 8% -8%, rgb(143 220 201 / 19%), transparent 28rem),
    radial-gradient(circle at 102% 18%, rgb(184 184 233 / 10%), transparent 26rem),
    linear-gradient(180deg, #f3f6f5 0%, #edf1f0 100%);
  background-attachment: fixed;
  scrollbar-color: rgb(35 118 106 / 35%) transparent;
}

html::-webkit-scrollbar-thumb {
  background: rgb(35 118 106 / 35%);
  background-clip: content-box;
}

body {
  color: var(--kkaebu-ink);
}

::selection {
  color: var(--kkaebu-deep-mint);
  background: rgb(143 220 201 / 55%);
}

a {
  text-decoration-color: rgb(35 118 106 / 42%);
}

.page-shell {
  max-width: 1080px;
}

.app-header {
  margin-top: 0;
  padding: 10px 12px;
  border: 1px solid rgb(212 222 219 / 94%);
  border-radius: 18px;
  background: rgb(255 255 255 / 82%);
  box-shadow: 0 10px 32px rgb(31 42 46 / 8%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
}

.app-header::before {
  display: none;
}

.brand {
  color: var(--kkaebu-deep-mint);
  font-weight: 850;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border: 1px solid rgb(21 88 79 / 8%);
  border-radius: 13px;
  box-shadow: 0 5px 13px rgb(21 88 79 / 14%);
}

.app-nav {
  gap: 4px;
  padding: 4px;
  border: 1px solid rgb(205 230 224 / 78%);
  border-radius: 13px;
  background: rgb(232 250 245 / 78%);
}

.nav-link {
  border-radius: 9px;
  color: #5e716d;
  transition:
    color 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--kkaebu-deep-mint);
  background: rgb(255 255 255 / 64%);
  outline: none;
}

.nav-link.active {
  color: var(--kkaebu-deep-mint);
  background: #ffffff;
  box-shadow: 0 3px 11px rgb(21 88 79 / 11%);
}

.nav-review-count,
.nav-family-request-count,
.nav-menu-review-count {
  border-color: var(--kkaebu-eggshell);
  background: var(--kkaebu-gold);
  color: #5e4700;
  box-shadow: 0 3px 8px rgb(167 122 0 / 22%);
}

.intro {
  margin-bottom: 28px;
}

.eyebrow {
  color: var(--kkaebu-mint-action);
  font-weight: 900;
  letter-spacing: 0.11em;
}

h1,
h2,
h3 {
  color: var(--kkaebu-ink);
}

h1 {
  letter-spacing: -0.045em;
}

.intro-copy {
  color: var(--kkaebu-muted);
}

.card {
  border-color: var(--surface-line);
  border-radius: 24px;
  background: rgb(255 255 255 / 97%);
  box-shadow: var(--kkaebu-shadow);
}

.connection-section-heading h2 {
  color: var(--kkaebu-deep-mint);
}

.field-group > label,
.settings-row-label,
.app-control-label {
  color: #405d58;
}

input,
select,
textarea,
.app-control-trigger,
.records-multiselect-trigger {
  border-color: var(--kkaebu-line);
  color: var(--kkaebu-ink);
  background-color: #ffffff;
}

input::placeholder,
textarea::placeholder {
  color: #899995;
}

input:focus,
select:focus,
textarea:focus,
.app-control-trigger:focus-visible,
.records-multiselect-trigger:focus-visible {
  border-color: var(--kkaebu-mint-action);
  box-shadow: 0 0 0 4px rgb(143 220 201 / 28%);
}

select:disabled,
input:disabled,
textarea:disabled {
  color: #87938f;
  background: #f3f8f6;
}

.primary-button,
.category-settings-launch-button,
.app-confirm-submit.primary,
.record-save-button,
.settings-primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--kkaebu-mint-action), var(--kkaebu-deep-mint));
  box-shadow: 0 10px 24px rgb(21 88 79 / 20%);
}

.primary-button:hover:not(:disabled),
.category-settings-launch-button:hover:not(:disabled),
.app-confirm-submit.primary:hover:not(:disabled),
.record-save-button:hover:not(:disabled),
.settings-primary-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #2d897c, #15584f);
}

.secondary-button,
.manual-category-button,
.records-filter-reset,
.category-sheet-close,
.app-confirm-cancel {
  border-color: var(--kkaebu-line);
  color: #45615c;
  background: #f1f8f6;
}

.secondary-button:hover,
.manual-category-button:hover,
.records-filter-reset:hover,
.category-sheet-close:hover,
.app-confirm-cancel:hover {
  color: var(--kkaebu-deep-mint);
  background: var(--kkaebu-mint-soft);
}

.form-status.connecting,
.classification-status,
.count-badge {
  color: var(--kkaebu-deep-mint);
  background: var(--kkaebu-mint-soft);
}

.expense-form-card {
  position: relative;
  overflow: hidden;
}

.expense-form-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--kkaebu-mint), var(--kkaebu-mint-action));
  content: "";
}

.entry-type-toggle {
  color: var(--kkaebu-mint-action);
}

.entry-type-toggle:hover,
.entry-type-toggle:focus-visible {
  color: var(--kkaebu-deep-mint);
  background: var(--kkaebu-mint-soft);
  outline-color: rgb(143 220 201 / 32%);
}

.expense-form-card[data-entry-mode="income"] {
  border-color: #9fd8ca;
}

.expense-form-card[data-entry-mode="income"] .primary-button,
.income-source-register-button {
  background: linear-gradient(135deg, var(--kkaebu-mint-action), var(--kkaebu-deep-mint));
}

.expense-description-suggestions-panel {
  border-color: var(--kkaebu-line);
  box-shadow: 0 10px 26px rgb(21 88 79 / 8%);
}

.expense-description-suggestion {
  color: #526863;
  background: #f1f8f6;
}

.expense-description-suggestion:hover,
.expense-description-suggestion:focus-visible,
.expense-description-suggestion.active {
  border-color: #a8dacf;
  color: var(--kkaebu-deep-mint);
  background: var(--kkaebu-mint-soft);
}

.expense-summary,
.records-filters,
.settings-index-card,
.category-settings-dialog {
  border-color: var(--surface-line);
  background: #f8faf9;
}

.expense-summary strong,
.category-name,
.settings-row strong,
.financial-access-item-heading h3 {
  color: var(--kkaebu-deep-mint);
}

.records-view-toggle,
.records-calendar-summary,
.records-search-panel,
.category-review,
.financial-asset-rename-form,
.financial-permission-toggle,
.subcategory-settings-row input {
  border-color: var(--surface-line);
  background: #f7f9f8;
}

.records-view-toggle button[aria-pressed="true"],
.records-category-option:has(input:checked),
.spending-target-category-option input:checked + span,
.financial-permission-toggle:has(input:checked) {
  border-color: #96d2c4;
  color: var(--kkaebu-deep-mint);
  background: var(--kkaebu-mint-soft);
}

.records-calendar-day.has-records,
.records-calendar[data-records-mode="income"] .records-calendar-day.has-records {
  border-color: #b7ccc7;
  background: #ffffff;
  box-shadow: inset 0 -3px 0 var(--kkaebu-mint);
}

.records-calendar-day.is-today {
  border-color: var(--kkaebu-mint-action);
  background: #f4f8f7;
  box-shadow: inset 0 0 0 2px var(--kkaebu-mint-action);
}

/* Calendar surfaces stay neutral so the structure reads before the brand color. */
.records-calendar {
  border: 1px solid #cbd7d4;
  background: #ffffff;
  box-shadow: 0 18px 44px rgb(31 42 46 / 11%);
}

.records-calendar-header {
  padding: 7px 8px;
  border: 1px solid #e0e7e5;
  border-radius: 13px;
  background: #f7f9f8;
}

.records-calendar-header strong {
  color: #2b3c38;
}

.records-calendar-header button {
  border-color: #d6dfdc;
  color: #4f625e;
  background: #ffffff;
}

.records-calendar-header button:hover,
.records-calendar-header button:focus-visible {
  border-color: #9fbeb7;
  color: var(--kkaebu-deep-mint);
  background: #f2f7f5;
}

.records-calendar-summary {
  border-color: #dce4e2;
  background: #f5f7f6;
}

.records-calendar-summary-item + .records-calendar-summary-item {
  border-left-color: #dce4e2;
}

.records-calendar-weekdays {
  padding: 5px 0 8px;
  border-bottom: 1px solid #e6ebe9;
  color: #6e7a77;
}

.records-calendar-grid {
  gap: 6px;
}

.records-calendar-day {
  border-color: #dfe6e4;
  color: #586964;
  background: #fbfcfc;
}

button.records-calendar-day:hover,
button.records-calendar-day:focus-visible {
  border-color: #9fbeb7;
  background: #f2f7f5;
}

.records-calendar-day.is-outside {
  border-color: transparent;
  color: #8e9996;
  background: #f5f7f6;
  opacity: 0.54;
}

.records-calendar[data-records-mode="income"] .records-calendar-day.has-records,
.records-calendar[data-records-mode="combined"] .records-calendar-day.has-incomes:not(.has-expenses),
.records-calendar[data-records-mode="combined"] .records-calendar-day.has-incomes.has-expenses {
  border-color: #b7ccc7;
  background: #ffffff;
  box-shadow: inset 0 -3px 0 var(--kkaebu-mint);
}

.records-calendar-day.is-today,
.records-calendar-day.is-today.has-records {
  border-color: var(--kkaebu-mint-action);
  background: #f4f8f7;
  box-shadow:
    inset 0 0 0 2px var(--kkaebu-mint-action),
    inset 0 -4px 0 var(--kkaebu-mint);
}

.records-calendar-day-total.income,
.records-calendar-summary-item.income strong {
  color: var(--kkaebu-mint-action);
}

.records-calendar-day-total.expense,
.records-calendar-summary-item.expense strong {
  color: #a45b63;
}

.records-category.category-transport,
.records-category.category-medical,
.records-category.category-living,
.records-category.category-groceries,
.records-category.category-leisure,
.records-category.category-dining,
.records-category.category-social,
.records-category.category-loan,
.records-category.category-annual,
.records-category.category-fixed,
.records-category.category-custom {
  border-color: rgb(205 230 224 / 82%);
}

.category-settings-note,
.financial-security-note {
  border-color: #b8ddd4;
  color: #315f57;
  background: var(--kkaebu-mint-soft);
}

.income-source-add-button,
.subcategory-add-button,
.category-add-button {
  border-color: #8fcbbc;
  color: var(--kkaebu-deep-mint);
  background: #f2fbf8;
}

.category-settings-launch-icon,
.quick-asset-type-icon,
.financial-asset-type {
  color: var(--kkaebu-deep-mint);
  background: var(--kkaebu-mint-soft);
}

/* Preserve white glyphs on the coloured asset-choice icons after the shared
   mint surface rule above. The dark glyphs were difficult to distinguish. */
.quick-asset-type-icon.bank,
.quick-asset-type-icon.card {
  color: #fff;
}

.category-settings-dialog-header,
.category-settings-dialog-actions,
.records-category-filter-panel,
.records-calendar-day-panel,
.category-sheet-panel,
.app-confirm-dialog,
.gmail-dialog {
  border-color: var(--kkaebu-line);
  background: #ffffff;
}

.category-settings-dialog::backdrop,
.records-category-filter-dialog::backdrop,
.records-calendar-day-dialog::backdrop,
.app-confirm-dialog::backdrop,
.gmail-dialog::backdrop {
  background: rgb(17 55 50 / 46%);
}

/* Smart blue is intentionally limited to analysis and explanation surfaces. */
.ai-insights-page .eyebrow,
.insight-card-heading .eyebrow,
.ai-briefing-card .eyebrow {
  color: var(--kkaebu-blue-deep);
}

.card.insight-card {
  border-color: #cfe9f5;
  background:
    radial-gradient(circle at 100% 0%, rgb(103 183 234 / 12%), transparent 22rem),
    #ffffff;
}

.card.ai-briefing-card {
  border-color: #3e857c;
  color: #f4fcfa;
  background:
    radial-gradient(circle at 100% 0%, rgb(103 183 234 / 34%), transparent 34%),
    linear-gradient(145deg, #15584f 0%, #174f62 100%);
  box-shadow: 0 22px 52px rgb(21 88 79 / 20%);
}

.ai-briefing-card .eyebrow,
.ai-briefing-card .ai-report-title-lockup > div > span {
  color: #9ad5f5;
}

.ai-briefing-card .ai-quota-track span {
  background: linear-gradient(90deg, var(--kkaebu-mint), var(--kkaebu-blue));
}

.ai-briefing-action button {
  color: var(--kkaebu-deep-mint);
  background: #ffffff;
}

.ranked-insight-list article > span,
.ai-report-symbol {
  color: #174f62;
  background: var(--kkaebu-blue-soft);
}

.reduction-list article,
.target-status-card.is-close,
.needs-review,
.category-review.needs-review {
  border-color: #f0d995;
  background: var(--kkaebu-gold-soft);
}

.reduction-list article > div span,
.needs-review .classification-status {
  color: #715500;
  background: #ffecb3;
}

.auth-page-shell {
  width: min(100% - 36px, 500px);
}

.auth-brand {
  padding: 8px 13px 8px 9px;
  border: 1px solid rgb(205 230 224 / 88%);
  border-radius: 15px;
  background: rgb(255 255 255 / 76%);
  box-shadow: 0 8px 28px rgb(21 88 79 / 8%);
}

.auth-card {
  position: relative;
  overflow: hidden;
  border-color: #b8ddd4;
  background:
    radial-gradient(circle at 50% -15%, rgb(143 220 201 / 28%), transparent 17rem),
    rgb(255 255 255 / 96%);
}

.auth-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--kkaebu-mint), var(--kkaebu-deep-mint));
  content: "";
}

.google-login-button {
  border-color: var(--kkaebu-line);
  box-shadow: 0 8px 22px rgb(21 88 79 / 7%);
}

.google-login-button:hover,
.secondary-button:hover {
  border-color: #a6d7cc;
  background: var(--kkaebu-mint-soft);
}

.google-mark {
  color: var(--kkaebu-blue-deep);
}

.auth-back-link {
  color: var(--kkaebu-mint-action);
}

@media (max-width: 599px) {
  .page-shell {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .app-header {
    padding: 9px 10px;
    border-radius: 16px;
  }

  .nav-menu-button {
    border-color: var(--kkaebu-line);
    color: var(--kkaebu-deep-mint);
    background: var(--kkaebu-mint-soft);
    box-shadow: none;
  }

  .nav-menu-button:focus-visible {
    outline-color: rgb(143 220 201 / 36%);
  }

  .app-nav {
    top: calc(100% + 8px);
    border-color: rgb(205 230 224 / 92%);
    background: rgb(244 252 250 / 97%);
    box-shadow: 0 16px 36px rgb(21 88 79 / 16%);
  }

  .nav-link.active {
    background: #ffffff;
  }

  .card {
    border-radius: 20px;
    box-shadow: 0 12px 34px rgb(21 88 79 / 8%);
  }

  .records-calendar {
    border-radius: 18px;
  }

  .auth-card {
    padding: 28px 22px;
  }

  body.fixed-mobile-page .mobile-install-hint {
    position: fixed;
    z-index: 80;
    right: calc(max(14px, env(safe-area-inset-right)) + 66px);
    bottom: calc(
      max(14px, env(safe-area-inset-bottom)) + var(--mobile-install-footer-clearance)
    );
    left: max(12px, env(safe-area-inset-left));
    display: grid;
    width: auto;
    margin: 0;
    border-color: #d8e3f1;
    color: #344a66;
    background: rgb(243 246 250 / 98%);
    box-shadow: 0 12px 30px rgb(47 69 97 / 12%);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  body.fixed-mobile-page:has(.mobile-install-hint) .quick-actions {
    bottom: calc(
      max(14px, env(safe-area-inset-bottom)) + var(--mobile-install-footer-clearance)
    );
  }
}

@media (max-width: 599px) and (max-height: 650px) {
  .mobile-install-hint {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
    padding: 14px 38px 10px 11px;
    border-radius: 16px;
  }

  .mobile-install-hint-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .mobile-install-hint small {
    display: block;
    margin-top: 2px;
    font-size: 9px;
  }

  body.fixed-mobile-page:has(.mobile-install-hint) .quick-actions {
    bottom: calc(
      max(14px, env(safe-area-inset-bottom)) + var(--mobile-install-footer-clearance)
    );
  }
}

/* Subscription plans and current-usage summary. */
.plans-page {
  --page-content-max-width: 920px;
}

a.settings-menu-row {
  text-decoration: none;
}

#open-plan-settings-link .settings-menu-icon {
  color: #8056bb;
  background: #f1eafe;
}

.plans-intro {
  max-width: 660px;
}

.plan-current-card {
  padding: clamp(20px, 4vw, 30px);
  margin-bottom: 32px;
  border-color: #cfe2db;
  background:
    linear-gradient(135deg, rgb(244 253 249 / 98%), rgb(255 255 255 / 96%) 58%),
    #fff;
}

.plan-current-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.plan-current-heading .eyebrow,
.plans-section-heading .eyebrow {
  margin-bottom: 6px;
}

.plan-current-heading h2,
.plans-section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 3vw, 26px);
  letter-spacing: -0.045em;
}

.plan-current-state {
  display: inline-flex;
  margin-left: 8px;
  padding: 4px 8px;
  vertical-align: 3px;
  border-radius: 999px;
  color: #24745b;
  background: #dff5eb;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: -0.01em;
}

.plan-current-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.plan-settings-back-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #c9dcd5;
  border-radius: 10px;
  color: #386b5b;
  background: rgb(255 255 255 / 72%);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.plan-settings-back-link:hover,
.plan-settings-back-link:focus-visible {
  outline: none;
  border-color: #95c5b4;
  background: #fff;
}

.plan-usage-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 0;
}

.plan-usage-list > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #dfebe6;
  border-radius: 13px;
  background: rgb(255 255 255 / 72%);
}

.plan-usage-list dt {
  overflow: hidden;
  color: #6a7c77;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-usage-list dd {
  margin: 5px 0 0;
  overflow: hidden;
  color: #24483c;
  font-size: 14px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-current-card > .form-status {
  margin: 14px 0 0;
}

.plans-section-heading {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 2px 14px;
}

.plan-supported-banks {
  margin: -4px 2px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

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

.plan-sync-explainer > div {
  padding: 13px 14px;
  border: 1px solid #dce9e4;
  border-radius: 14px;
  background: rgb(255 255 255 / 72%);
}

.plan-sync-explainer strong {
  color: #28594b;
  font-size: 12px;
}

.plan-sync-explainer p {
  margin: 5px 0 0;
  color: #62736e;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
}

.plan-sync-provider-link {
  margin: -4px 2px 16px;
  color: #667872;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.55;
}

.plan-sync-provider-link a {
  color: #27735f;
  font-weight: 850;
}

.plan-no-ads-badge,
.plan-current-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  color: #386b5b;
  background: #e3f6ee;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.plan-comparison-scroll {
  overflow-x: auto;
  border: 1px solid #d8e6e1;
  border-radius: 18px;
  background: rgb(255 255 255 / 84%);
  box-shadow: 0 10px 28px rgb(21 88 79 / 7%);
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.plan-comparison-scroll:focus-visible {
  outline: 3px solid rgb(47 155 120 / 28%);
  outline-offset: 3px;
}

.plan-comparison-table {
  width: 100%;
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.plan-comparison-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.plan-comparison-table th,
.plan-comparison-table td {
  min-width: 0;
  padding: 13px 12px;
  border-right: 1px solid #e4ece9;
  border-bottom: 1px solid #e4ece9;
  vertical-align: middle;
}

.plan-comparison-table tr > :last-child {
  border-right: 0;
}

.plan-comparison-table tbody tr:last-child > * {
  border-bottom: 0;
}

.plan-comparison-feature-heading {
  width: 24%;
  color: #46625b;
  background: #f4f8f6;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
}

.plan-comparison-plan {
  width: 25.333%;
  color: #294d43;
  background: #fbfdfc;
  text-align: center;
}

.plan-comparison-plan--plus {
  background: linear-gradient(180deg, #eef9f4 0%, #fbfdfc 100%);
}

.plan-comparison-plan--pro {
  background: linear-gradient(180deg, #edf5fb 0%, #fbfdfc 100%);
}

.plan-comparison-plan.is-current {
  box-shadow: inset 0 4px 0 #2f9b78;
}

.plan-comparison-kicker {
  display: block;
  margin-bottom: 4px;
  color: #5a7a70;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.plan-comparison-plan strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  letter-spacing: -0.035em;
}

.plan-comparison-plan small {
  display: block;
  min-height: 34px;
  margin-top: 5px;
  color: #63756f;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.plan-price {
  display: inline-flex;
  margin-top: 8px;
  padding: 5px 7px;
  border-radius: 8px;
  color: #315d50;
  background: #e9f6f0;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.plan-comparison-plan--pro .plan-price {
  color: #315a75;
  background: #eaf3f9;
}

.plan-comparison-plan .plan-current-badge {
  display: table;
  margin: 7px auto 0;
}

.plan-comparison-table tbody th {
  color: #4a615b;
  background: #f8fbfa;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.plan-comparison-table td {
  color: #40554f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.plan-comparison-benefit-row > * {
  color: #245e4d !important;
  background: #f1faf6 !important;
  font-weight: 850 !important;
}

.plan-comparison-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 45px;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.plan-comparison-status.is-included {
  color: #247056;
  background: #e2f6ec;
}

.plan-comparison-status.is-unavailable {
  color: #7b8582;
  background: #eef1f0;
}

.plan-payment-notice {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 15px 16px;
  border: 1px solid #d8e5df;
  border-radius: 15px;
  color: #50635e;
  background: rgb(245 250 248 / 76%);
}

.plan-payment-notice > span {
  flex: 0 0 auto;
  margin-top: 1px;
}

.plan-payment-notice p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

p.plan-payment-notice {
  display: block;
  font-size: 13px;
  line-height: 1.6;
}

p.plan-payment-notice > a {
  overflow-wrap: normal;
  white-space: nowrap;
}

.plan-payment-notice strong {
  color: #2f5549;
}

@media (max-width: 760px) {
  .plan-usage-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-sync-explainer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 599px) {
  .plans-page {
    --page-content-max-width: 620px;
  }

  .plan-current-card {
    padding: 18px;
  }

  .plan-current-heading,
  .plans-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .plan-current-heading h2,
  .plans-section-heading h2 {
    font-size: 20px;
  }

  .plan-current-state {
    margin-left: 5px;
    vertical-align: 2px;
  }

  .plan-usage-list {
    gap: 8px;
    margin-top: 18px;
  }

  .plan-usage-list > div {
    padding: 10px;
  }

  .plan-usage-list dd {
    font-size: 13px;
  }

  .plan-comparison-scroll {
    border-radius: 15px;
  }

  .plan-comparison-table {
    min-width: 620px;
  }

  .plan-comparison-table th,
  .plan-comparison-table td {
    padding: 10px 8px;
  }

  .plan-comparison-plan strong {
    font-size: 16px;
  }

  .plan-comparison-plan small {
    min-height: 31px;
    font-size: 10px;
  }

  .plan-comparison-table tbody th,
  .plan-comparison-table td {
    font-size: 11px;
  }
}

.recurring-transaction-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  margin: 0;
  white-space: nowrap;
}

.recurring-transaction-action-cell {
  overflow: hidden !important;
  padding-right: 5px !important;
  padding-left: 3px !important;
  text-align: right !important;
  white-space: nowrap !important;
}

.recurring-transfer-table-shell:has(> .has-actions) {
  overflow-x: hidden;
}

.recurring-transfer-recent-table.has-actions th:nth-child(1),
.recurring-transfer-recent-table.has-actions td:nth-child(1) {
  width: 15%;
}

.recurring-transfer-recent-table.has-actions th:nth-child(2),
.recurring-transfer-recent-table.has-actions td:nth-child(2) {
  width: 37%;
}

.recurring-transfer-recent-table.has-actions th:nth-child(3),
.recurring-transfer-recent-table.has-actions td:nth-child(3) {
  width: 18%;
}

.recurring-transfer-recent-table.has-actions th:nth-child(4),
.recurring-transfer-recent-table.has-actions td:nth-child(4) {
  width: 30%;
  text-align: right;
}

.recurring-transfer-match-table.has-actions th:nth-child(1),
.recurring-transfer-match-table.has-actions td:nth-child(1) {
  width: 18%;
}

.recurring-transfer-match-table.has-actions th:nth-child(2),
.recurring-transfer-match-table.has-actions td:nth-child(2) {
  width: 34%;
}

.recurring-transfer-match-table.has-actions th:nth-child(3),
.recurring-transfer-match-table.has-actions td:nth-child(3) {
  width: 18%;
}

.recurring-transfer-match-table.has-actions th:nth-child(4),
.recurring-transfer-match-table.has-actions td:nth-child(4) {
  width: 30%;
  text-align: right;
}

.recurring-transaction-actions button {
  min-height: 22px;
  padding: 2px 4px;
  border: 1px solid #d6deea;
  border-radius: 6px;
  color: #245caf;
  background: #f3f7ff;
  font-family: inherit;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.recurring-transaction-actions button:focus-visible {
  outline: 2px solid #245caf;
  outline-offset: 2px;
}

#recurring-reassignment-dialog .record-editor-source-note {
  overflow-wrap: anywhere;
}

#recurring-reassignment-dialog .record-editor-source-note + .record-editor-source-note {
  margin-top: -11px;
}

.recurring-reassignment-picker {
  margin-bottom: 12px;
}

.recurring-reassignment-picker h3 {
  margin: 0 0 7px;
  color: #263750;
  font-size: 13px;
}

.recurring-reassignment-rule-list {
  max-height: min(52svh, 430px);
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 15px;
}

.recurring-reassignment-rule-list .recurring-transfer-table-shell {
  border-radius: 15px;
  box-shadow: none;
}

.recurring-reassignment-row.selected {
  background: #edf8f5;
  box-shadow: inset 3px 0 #1b7768;
}

.recurring-reassignment-row[aria-disabled="true"] {
  cursor: wait;
}

.recurring-reassignment-choice-mark {
  display: inline-grid;
  min-width: 40px;
  min-height: 24px;
  padding: 4px 7px;
  place-items: center;
  border-radius: 999px;
  color: #65748a;
  background: #edf1f5;
  font-size: 9px;
  font-weight: 850;
}

.recurring-reassignment-choice-mark.selected {
  color: #0d6c5b;
  background: #e5f7f1;
}

#recurring-reassignment-dialog .record-editor-actions {
  justify-content: space-between;
}

@media (max-width: 599px) {
  .recurring-reassignment-rule-list {
    max-height: min(48svh, 390px);
  }

  .recurring-reassignment-choice-mark {
    min-width: 34px;
    padding-right: 5px;
    padding-left: 5px;
  }
}

.plan-purchase-button,
.billing-cancel-button {
  min-height: 42px;
  margin-top: 10px;
  border: 1px solid #8fcbbc;
  border-radius: 10px;
  padding: 8px 14px;
  background: #fff;
  color: #15584f;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.plan-purchase-button {
  width: 100%;
  border-color: #1f8268;
  color: #fff;
  background: linear-gradient(135deg, #229779, #16735f);
  box-shadow: 0 7px 16px rgb(31 130 104 / 20%);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    filter 150ms ease;
}

.plan-comparison-plan--pro .plan-purchase-button {
  border-color: #337ba6;
  background: linear-gradient(135deg, #408cb9, #2e6f9a);
  box-shadow: 0 7px 16px rgb(48 116 157 / 20%);
}

.plan-basic-change-button {
  border-color: #aabbb5;
  color: #355149;
  background: #f7faf8;
  box-shadow: none;
}

.plan-purchase-button:not(:disabled):hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgb(31 130 104 / 25%);
}

.plan-purchase-button:focus-visible {
  outline: 3px solid rgb(47 155 120 / 28%);
  outline-offset: 2px;
}

.plan-purchase-button:disabled,
.billing-cancel-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.billing-cancel-button {
  color: #5f6977;
  border-color: #d8e0e8;
}

.billing-consent-dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: 90dvh;
  overflow: hidden auto;
  border: 0;
  border-radius: 26px;
  padding: 0;
  color: #243247;
  background: #fbfdfc;
  box-shadow: 0 26px 90px rgb(20 54 46 / 28%);
}

.billing-consent-dialog::backdrop {
  background: rgb(15 35 30 / 58%);
  backdrop-filter: blur(4px);
}

.billing-consent-panel {
  position: relative;
  padding: 30px;
  background:
    radial-gradient(circle at 4% 0%, rgb(216 244 234 / 75%), transparent 38%),
    #fbfdfc;
}

.billing-dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid #dce8e3;
  border-radius: 50%;
  color: #60736d;
  background: rgb(255 255 255 / 80%);
  font: inherit;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.billing-dialog-close:hover,
.billing-dialog-close:focus-visible {
  border-color: #9ccbbd;
  outline: none;
  background: #fff;
}

.billing-consent-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-right: 38px;
}

.billing-consent-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #2aa181, #19735f);
  box-shadow: 0 8px 18px rgb(33 139 111 / 22%);
}

.billing-consent-heading .eyebrow {
  margin: 1px 0 4px;
  color: #568078;
  font-size: 10px;
}

.billing-consent-heading h2 {
  margin: 0;
  color: #183f35;
  font-size: 24px;
  letter-spacing: -0.045em;
}

.billing-consent-heading > div > p:last-child {
  margin: 6px 0 0;
  color: #60736d;
  font-size: 13px;
  font-weight: 650;
}

.billing-consent-price-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding: 16px 18px;
  border: 1px solid #cfe5dc;
  border-radius: 16px;
  background: linear-gradient(135deg, #edf9f4, #f8fcfa);
}

.billing-consent-price-card span {
  color: #58736b;
  font-size: 12px;
  font-weight: 750;
}

.billing-consent-price-card strong {
  color: #176650;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.billing-consent-benefits {
  display: grid;
  gap: 10px;
  margin: 19px 0;
  padding: 0;
  list-style: none;
}

.billing-consent-benefits li {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0;
  color: #425c55;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.billing-consent-benefits li span {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #1f8065;
  background: #ddf3ea;
  font-size: 12px;
  font-weight: 900;
}

.billing-consent-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid #dce7e3;
  border-radius: 14px;
  color: #526761;
  background: #fff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.6;
  cursor: pointer;
}

.billing-consent-check input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: #208065;
}

.billing-consent-check a {
  color: #176e59;
  font-weight: 850;
}

.billing-consent-submit {
  width: 100%;
  min-height: 52px;
  margin: 0;
}

.billing-consent-security {
  margin: 12px 0 0;
  color: #7a8985;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.5;
  text-align: center;
}

.billing-consent-panel > .form-status:empty {
  display: none;
}

.billing-consent-panel > .form-status {
  margin: 12px 0 0;
}

@media (max-width: 599px) {
  .billing-consent-dialog {
    width: min(100% - 16px, 520px);
    max-height: calc(100dvh - 16px);
    border-radius: 22px;
  }

  .billing-consent-panel {
    padding: 24px 18px 20px;
  }

  .billing-dialog-close {
    top: 12px;
    right: 12px;
  }

  .billing-consent-heading {
    gap: 11px;
  }

  .billing-consent-icon {
    width: 39px;
    height: 39px;
    border-radius: 12px;
  }

  .billing-consent-heading h2 {
    font-size: 21px;
  }

  .billing-consent-price-card {
    margin-top: 20px;
    padding: 14px;
  }
}

/* Public purchase, refund, privacy, and seller-information page. */
.settings-menu-icon--policy {
  color: #276178;
  background: #e4f3f7;
}

.purchase-info-page-shell {
  --page-content-max-width: 820px;
}

.purchase-info-header {
  margin-bottom: 30px;
}

.purchase-info-hero {
  padding: clamp(23px, 4vw, 36px);
  border: 1px solid #d6e7e4;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgb(239 250 247 / 98%), rgb(255 255 255 / 96%) 62%),
    #fff;
  box-shadow: 0 12px 30px rgb(33 81 70 / 7%);
}

.purchase-info-hero .eyebrow,
.policy-section-heading .eyebrow {
  margin: 0 0 7px;
  color: #3c7669;
}

.purchase-info-hero h1 {
  margin: 0;
  color: #183e35;
  font-size: clamp(28px, 5vw, 39px);
  letter-spacing: -0.06em;
}

.purchase-info-hero > p:not(.eyebrow):not(.policy-effective-date) {
  max-width: 590px;
  margin: 13px 0 0;
  color: #4d635f;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
}

.policy-effective-date {
  display: inline-flex;
  margin: 18px 0 0;
  padding: 5px 9px;
  border-radius: 999px;
  color: #467269;
  background: #e7f4ef;
  font-size: 11px;
  font-weight: 800;
}

.policy-setup-notice {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 11px;
  margin-top: 16px;
  padding: 15px 16px;
  border: 1px solid #efdcae;
  border-radius: 16px;
  color: #6a5525;
  background: #fffaf0;
}

.policy-setup-notice > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #8a681c;
  background: #ffedbd;
  font-size: 17px;
  font-weight: 900;
}

.policy-setup-notice strong {
  display: block;
  color: #614b1e;
  font-size: 13px;
}

.policy-setup-notice p {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.policy-anchor-nav {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 18px 0 4px;
}

.policy-anchor-nav a {
  display: inline-flex;
  min-height: 32px;
  padding: 0 11px;
  align-items: center;
  border: 1px solid #dce6e4;
  border-radius: 999px;
  color: #38675d;
  background: rgb(255 255 255 / 78%);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.policy-anchor-nav a:hover,
.policy-anchor-nav a:focus-visible {
  outline: none;
  border-color: #9dcfc0;
  color: #1e5e4d;
  background: #edf8f4;
}

.policy-section {
  scroll-margin-top: 88px;
  margin-top: 25px;
  padding: clamp(20px, 3.5vw, 30px);
  border: 1px solid #e0e7ed;
  border-radius: 20px;
  background: rgb(255 255 255 / 90%);
  box-shadow: 0 9px 24px rgb(34 56 86 / 4%);
}

.policy-section-heading {
  margin-bottom: 18px;
}

.policy-section-heading h2 {
  margin: 0;
  color: #27384e;
  font-size: clamp(20px, 3.5vw, 25px);
  letter-spacing: -0.045em;
}

.policy-product-grid,
.policy-rule-grid,
.policy-privacy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.policy-product-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid #dfe9e6;
  border-radius: 16px;
  background: #f9fcfb;
}

.policy-product-card--featured {
  border-color: #b6dacc;
  background: #f0faf6;
}

.policy-product-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.policy-product-heading p {
  margin: 0 0 4px;
  color: #55776e;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.policy-product-heading h3,
.policy-rule-grid h3,
.policy-privacy-grid h3,
.policy-support-card h3 {
  margin: 0;
  color: #294238;
  font-size: 15px;
  letter-spacing: -0.035em;
}

.policy-product-heading strong {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 8px;
  color: #245b4d;
  background: #e2f3ec;
  font-size: 12px;
}

.policy-product-card > p,
.policy-rule-grid p,
.policy-privacy-grid p,
.policy-support-card p {
  margin: 11px 0 0;
  color: #5e6d78;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.65;
}

.policy-fact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

.policy-fact-list > div {
  padding: 12px 13px;
  border-radius: 13px;
  background: #f5f8fa;
}

.policy-fact-list dt {
  color: #647682;
  font-size: 10px;
  font-weight: 850;
}

.policy-fact-list dd {
  margin: 5px 0 0;
  color: #354a5b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.48;
}

.policy-fact-list dd a {
  color: #20705b;
  font-weight: 850;
}

.policy-detail-note {
  margin: 14px 0 0;
  color: #62727f;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.65;
}

.policy-detail-note a {
  color: #20705b;
  font-weight: 850;
}

.policy-step-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  counter-reset: policy-step;
  list-style: none;
}

.policy-step-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
  counter-increment: policy-step;
}

.policy-step-list li::before {
  display: grid;
  width: 26px;
  height: 26px;
  grid-row: span 2;
  place-items: center;
  border-radius: 50%;
  color: #27735f;
  background: #e3f5ee;
  content: counter(policy-step);
  font-size: 11px;
  font-weight: 900;
}

.policy-step-list strong {
  color: #34485d;
  font-size: 13px;
}

.policy-step-list span {
  grid-column: 2;
  margin-top: 2px;
  color: #63727e;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.policy-callout {
  margin-top: 16px;
  padding: 14px 15px;
  border: 1px solid #c7e1d7;
  border-radius: 15px;
  color: #3d645a;
  background: #eff9f5;
}

.policy-callout--muted {
  border-color: #dbe3ea;
  color: #53687b;
  background: #f5f8fb;
}

.policy-callout strong {
  color: #2c5e51;
  font-size: 13px;
}

.policy-callout--muted strong {
  color: #41596e;
}

.policy-callout p {
  margin: 5px 0 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.62;
}

.policy-rule-grid article,
.policy-privacy-grid article {
  min-width: 0;
  padding: 15px;
  border: 1px solid #e4eaf0;
  border-radius: 15px;
  background: #fbfcfd;
}

.policy-security-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.policy-security-list > div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid #e4eaf0;
  border-radius: 13px;
  background: #fafcfd;
}

.policy-security-list > div > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  background: #eaf5f1;
  font-size: 15px;
}

.policy-security-list p {
  margin: 0;
  color: #61717f;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.policy-security-list strong {
  color: #304c5d;
}

.policy-bullet-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  color: #556777;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  list-style: none;
}

.policy-bullet-list li {
  position: relative;
  padding-left: 17px;
}

.policy-bullet-list li::before {
  position: absolute;
  top: 0.6em;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #439a80;
  content: "";
}

.policy-section--seller {
  border-color: #d4e3df;
  background: linear-gradient(140deg, rgb(246 252 249 / 98%), rgb(255 255 255 / 95%));
}

.seller-information-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #dce6e3;
  border-radius: 15px;
  background: #dce6e3;
}

.seller-information-list > div {
  min-width: 0;
  padding: 13px;
  background: #fff;
}

.seller-information-list dt {
  color: #607773;
  font-size: 10px;
  font-weight: 850;
}

.seller-information-list dd {
  margin: 5px 0 0;
  color: #314b48;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.seller-information-required dd {
  color: #85672a;
}

.seller-lookup-link {
  margin: 12px 1px 0;
}

.seller-lookup-link a {
  color: #28725f;
  font-size: 12px;
  font-weight: 850;
}

.policy-support-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #d5e6e0;
  border-radius: 15px;
  background: rgb(255 255 255 / 76%);
}

.commerce-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 14px 2px 0;
  border-top: 1px solid #dce6e3;
  color: #61716f;
}

.commerce-footer p {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.5;
}

.commerce-footer strong {
  color: #405b56;
}

.commerce-footer a {
  flex: 0 0 auto;
  color: #28725f;
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

.commerce-footer a:hover,
.commerce-footer a:focus-visible {
  text-decoration: underline;
}

.commerce-footer--full {
  margin-top: 24px;
  padding-bottom: 4px;
}

/* This is the shared, deliberately compact business footer. It uses two fixed
   lines so the required seller details stay legible on narrow phones. */
.commerce-footer.commerce-footer--site {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 14px;
  padding: 8px 0 0;
  flex: 0 0 auto;
}

.commerce-footer--site p {
  margin: 0;
  font-size: clamp(7px, 2.25vw, 11px);
  line-height: 1.25;
  white-space: nowrap;
}

.commerce-footer--site p + p {
  margin-top: 2px;
}

.commerce-footer--site a {
  display: inline;
  font-size: inherit;
  line-height: inherit;
  white-space: inherit;
}

/* Keep the three short task screens focused on their primary action at every width. */
body.quick-entry-page,
body.review-page-body,
body.settings-index-page {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body.quick-entry-page .compact-page,
body.review-page-body .review-page,
body.settings-index-page .settings-page {
  display: flex;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
}

body.quick-entry-page .compact-page,
body.settings-index-page .settings-page {
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

:is(.quick-entry-page, .review-page-body, .settings-index-page) .app-header {
  position: relative;
  top: auto;
  flex: 0 0 auto;
  margin-top: 0;
  margin-bottom: 10px;
}

body.quick-entry-page .expense-intro,
body.review-page-body .review-intro,
body.settings-index-page .settings-heading {
  flex: 0 0 auto;
}

body.quick-entry-page .expense-intro {
  margin-bottom: 10px;
}

body.quick-entry-page .expense-form-card {
  flex: 0 0 auto;
  min-height: 0;
  padding: 14px;
}

body.quick-entry-page .field-group {
  margin-bottom: 10px;
}

body.quick-entry-page .expense-form-card input,
body.quick-entry-page .expense-form-card .app-control-trigger,
body.quick-entry-page .primary-button {
  min-height: 46px;
  height: 46px;
}

body.quick-entry-page .expense-suggestions-panel:not([hidden]) {
  max-height: min(168px, 29dvh);
  margin: 6px 0 0;
  overflow: hidden;
}

body.quick-entry-page .expense-description-suggestions {
  max-height: min(120px, 21dvh);
}

body.quick-entry-page .commerce-footer--site,
body.review-page-body .commerce-footer--site,
body.settings-index-page .commerce-footer--site {
  width: 100%;
  max-width: var(--page-content-max-width, 100%);
  flex: 0 0 auto;
  margin-top: auto;
  padding: 10px 2px 0;
}

body.quick-entry-page .commerce-footer--site {
  margin-inline: auto;
}

body.review-page-body .review-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.settings-index-page .settings-heading {
  margin: 0 2px 8px;
}

body.settings-index-page .settings-menu-list {
  flex: 0 0 auto;
}

body.settings-index-page .settings-menu-row {
  min-height: 48px;
  padding-top: 5px;
  padding-bottom: 5px;
}

/* Keep every individual setting visible without turning the settings page
   into a scrolling list on short displays. */
@media (max-height: 720px) {
  body.settings-index-page .settings-menu-row {
    min-height: 40px;
    grid-template-columns: 30px minmax(0, 1fr) auto 8px;
    gap: 8px;
    padding-top: 3px;
    padding-bottom: 3px;
  }

  body.settings-index-page .settings-menu-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 15px;
  }
}

@media (max-height: 650px) {
  body.quick-entry-page .expense-intro .intro-copy,
  body.settings-index-page .settings-menu-copy > span {
    display: none;
  }

  body.quick-entry-page .expense-intro .eyebrow {
    margin-bottom: 3px;
  }

  body.quick-entry-page .expense-intro h1 {
    font-size: clamp(20px, 4.2vw, 24px);
  }

  body.settings-index-page .settings-menu-row {
    min-height: 36px;
    grid-template-columns: 28px minmax(0, 1fr) auto 8px;
    gap: 7px;
    padding-top: 2px;
    padding-bottom: 2px;
  }

  body.settings-index-page .settings-menu-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 14px;
  }
}

@media (max-height: 420px) {
  body.quick-entry-page .expense-intro .eyebrow,
  body.settings-index-page .settings-heading {
    display: none;
  }

  body.quick-entry-page .expense-intro {
    margin-bottom: 6px;
  }

  body.quick-entry-page .expense-form-card {
    padding: 10px 12px;
  }

  body.quick-entry-page .field-group {
    margin-bottom: 6px;
  }

  body.quick-entry-page .expense-form-card input,
  body.quick-entry-page .expense-form-card .app-control-trigger,
  body.quick-entry-page .primary-button {
    min-height: 40px;
    height: 40px;
  }

  body.settings-index-page .app-header {
    margin-bottom: 6px;
    padding-block: 6px;
  }

  body.settings-index-page .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 11px;
  }

  body.settings-index-page .settings-menu-row {
    min-height: 26px;
    grid-template-columns: 24px minmax(0, 1fr) auto 7px;
    gap: 6px;
    padding-top: 2px;
    padding-bottom: 2px;
  }

  body.settings-index-page .settings-menu-icon {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    font-size: 12px;
  }

  body.settings-index-page .settings-menu-copy strong,
  body.settings-index-page .settings-menu-value {
    font-size: 11px;
  }

  body.quick-entry-page .commerce-footer--site,
  body.review-page-body .commerce-footer--site,
  body.settings-index-page .commerce-footer--site {
    padding-top: 6px;
  }

}

.plans-policy-summary {
  margin: 14px 0 0;
  color: #596b73;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
}

.plans-policy-summary a {
  color: #24735f;
  font-weight: 850;
}

@media (max-width: 599px) {
  .purchase-info-header {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
  }

  .purchase-info-header .brand {
    gap: 7px;
    font-size: 16px;
  }

  .purchase-info-header .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 11px;
  }

  .purchase-info-header .app-nav {
    position: static;
    width: auto;
    padding: 3px;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    border-radius: 11px;
    box-shadow: none;
    transform: none;
    visibility: visible;
    opacity: 1;
  }

  .purchase-info-header .nav-link {
    min-height: 34px;
    padding: 4px 7px;
    flex: 0 0 auto;
    font-size: 10px;
  }

  .purchase-info-header .nav-link-icon {
    font-size: 12px;
  }

  .purchase-info-hero,
  .policy-section {
    border-radius: 18px;
  }

  .purchase-info-hero {
    padding: 21px 18px;
  }

  .purchase-info-hero h1 {
    font-size: 27px;
  }

  .purchase-info-hero > p:not(.eyebrow):not(.policy-effective-date) {
    font-size: 13px;
  }

  .policy-setup-notice {
    padding: 13px;
  }

  .policy-anchor-nav {
    gap: 6px;
  }

  .policy-anchor-nav a {
    min-height: 30px;
    padding: 0 9px;
    font-size: 10px;
  }

  .policy-section {
    margin-top: 17px;
    padding: 18px 15px;
  }

  .policy-section-heading {
    margin-bottom: 14px;
  }

  .policy-section-heading h2 {
    font-size: 20px;
  }

  .policy-product-grid,
  .policy-rule-grid,
  .policy-privacy-grid,
  .policy-fact-list,
  .seller-information-list {
    grid-template-columns: 1fr;
  }

  .policy-product-card,
  .policy-rule-grid article,
  .policy-privacy-grid article {
    padding: 14px;
  }

  .policy-fact-list {
    gap: 6px;
  }

  .commerce-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-height: 380px) {
  body.quick-entry-page .compact-page {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  body.quick-entry-page .expense-intro {
    display: none;
  }

  body.quick-entry-page .expense-form-card {
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  body.settings-index-page .settings-page {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  body.settings-index-page .settings-menu-row {
    min-height: 24px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
}

@media (max-height: 340px) {
  body.quick-entry-page .commerce-footer--site {
    padding-top: 4px;
  }

  body.settings-index-page .settings-menu-row {
    min-height: 20px;
    grid-template-columns: 18px minmax(0, 1fr) auto 6px;
    gap: 5px;
  }

  body.settings-index-page .settings-menu-icon {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    font-size: 10px;
  }

  body.settings-index-page .settings-menu-copy strong,
  body.settings-index-page .settings-menu-value {
    font-size: 10px;
  }
}

@media (min-width: 600px) and (max-width: 840px) {
  body.quick-entry-page .commerce-footer--site {
    padding-right: 72px;
  }
}

/* Settings: downloadable user records stay separate from service recovery. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.backup-sections {
  display: grid;
  gap: 18px;
}

.backup-section {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border, #dce4df);
  border-radius: 14px;
}

.backup-section h3,
.backup-section p,
.backup-restore-copy p {
  margin: 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.backup-note {
  color: var(--muted, #66736b);
  font-size: 13px;
}

.backup-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #eff5f0;
  color: #31563b;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.backup-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  padding: 2px 2px 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.backup-actions > button {
  min-width: 118px;
  flex: 1 0 118px;
}

.backup-section button {
  min-height: 38px;
  padding: 7px 10px;
  border: 1.5px solid #8fb7a6;
  border-radius: 10px;
  background: #eef8f3;
  box-shadow: 0 2px 7px rgb(28 92 72 / 12%);
  color: #155b49;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.backup-section button:hover:not(:disabled),
.backup-section button:focus-visible {
  border-color: #3d8a72;
  background: #dff2e9;
  box-shadow: 0 4px 12px rgb(28 92 72 / 18%);
  outline: none;
  transform: translateY(-1px);
}

.backup-section .primary-button {
  border-color: #176c58;
  background: #176c58;
  color: #fff;
}

.backup-section .primary-button:hover:not(:disabled),
.backup-section .primary-button:focus-visible {
  border-color: #0f5948;
  background: #0f5948;
  color: #fff;
}

.backup-section button:disabled {
  opacity: 0.5;
  box-shadow: none;
  cursor: not-allowed;
}

.backup-sections .csv-import-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  padding: 2px 2px 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.backup-sections .csv-import-actions button {
  width: auto;
  min-width: 118px;
  flex: 1 0 118px;
}

.backup-restore-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: inherit;
  font-size: inherit;
}

.backup-restore-picker select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 7px 34px 7px 10px;
  border: 1.5px solid #8fb7a6;
  border-radius: 10px;
  outline: none;
  color: #203f36;
  background-color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.backup-restore-picker button {
  min-width: 118px;
}

.backup-restore-picker select:focus-visible {
  border-color: #176c58;
  box-shadow: 0 0 0 3px rgb(23 108 88 / 14%);
}

.backup-restore-picker select:disabled {
  color: #748078;
  background: #f2f5f3;
  cursor: not-allowed;
}

.backup-dialog-status {
  flex: 0 0 auto;
  margin: 0 18px 18px;
  border: 1px solid #176c58;
  color: #fff;
  background: #155b49;
  box-shadow: 0 8px 22px rgb(14 61 49 / 24%);
}

.backup-restore-shell {
  max-height: 85dvh;
  overflow-y: auto;
}

.backup-restore-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.backup-restore-copy h2 { margin: 0; }
.backup-confirm-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.6;
}
.backup-confirm-label input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 4px 0 0;
  padding: 0;
  flex: 0 0 18px;
}
.backup-confirm-label span { min-width: 0; }
#backup-restore-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.backup-password-shell { max-height: 85dvh; overflow-y: auto; }
.backup-password-field { display: grid; gap: 7px; font-weight: 700; }
.backup-password-field input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cddbd2;
  border-radius: 10px;
  font: inherit;
}
.backup-recovery-link {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: #286856;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 480px) {
  .backup-section { padding: 12px; }
  .backup-dialog-status { margin: 0 14px 14px; }
}

/* Pasted card messages retain their line breaks and leave the save action reachable. */
body.quick-entry-page .compact-page {
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

body.quick-entry-page #quick-entry-text {
  display: block;
  min-height: 46px;
  max-height: 146px;
  padding: 10px 14px;
  overflow-y: auto;
  font-size: 16px;
  line-height: 24px;
  resize: none;
}

body.quick-entry-page #quick-entry-text[aria-invalid="true"] {
  border-color: var(--danger);
}

.card-message-hint {
  margin: 6px 0 0;
  line-height: 1.5;
}

.card-message-preview {
  min-width: 0;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #b7d9cd;
  border-radius: 12px;
  color: #245c4c;
  background: #edf7f1;
  overflow-wrap: anywhere;
}

.card-message-preview[hidden] {
  display: none;
}

.card-message-preview strong {
  display: block;
  font-size: 14px;
  line-height: 1.5;
}

.card-message-preview p {
  margin: 3px 0 0;
  color: #496d60;
  font-size: 12px;
  line-height: 1.5;
}

.quick-expense-dialog-panel {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  border-radius: inherit;
}

.quick-expense-form textarea[name="text"] {
  min-height: 68px;
  max-height: 140px;
  padding: 10px 11px;
  overflow-y: auto;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 650;
  line-height: 24px;
  resize: none;
}

.quick-expense-form textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.quick-expense-form .card-message-hint,
.quick-expense-form .card-message-preview {
  margin-top: 0;
}
