/* ==========================================================================
   Fairewel · main.css
   Single entry point
   Order: brand tokens → typography → core layout/components → toast
   ========================================================================== */

@import "./brand.css";
@import "./typography.css";
@import "./cards.css";
@import "./toast.css";




*, *::before, *::after {
  box-sizing: border-box;
}

/* HTML / Body -------------------------------------------------------------- */
html {
  height: 100%;
  background: var(--color-bg, #ffffff);
  scroll-padding-top: 50px;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
}
.page,
.dashboard,
main {
  position: relative;
  z-index: 1;
}




/* Single source of truth for body styling */
body {
  min-height: 100dvh;
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--color-text, #0f172a);
  background: var(--color-bg, #ffffff);
}


/* Links -------------------------------------------------------------------- */
a {
  color: var(--color-link);
  text-decoration: none;
  transition: var(--transition-color);
}
a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}
a:visited {
  color: var(--color-link-visited);
}
.back-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
}
.back-link:hover {
  text-decoration: underline;
}



/* Header (site nav)
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: transparent;      /* ✅ kill the full width bar */
  border-bottom: none;          /* ✅ */
  padding: 10px 0;              /* gives the pill breathing room */
}

/* The pill */
.site-header-inner {
  margin-inline: auto;
  height: var(--header-height);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);

  padding: 0 32px;
  border-radius: var(--radius-xxl);

background: var(--color-surface, #FAFAFA); /* ✅ light theme surface */
opacity: 0.97;                             /* ✅ slight translucency */


  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-md);                    /* ✅ feels “app-like” */
}

.site-header.is-scrolled .site-header-inner {
  box-shadow:
    0 14px 40px rgba(15, 23, 42, 0.14),
    0 4px 10px rgba(15, 23, 42, 0.06);
}

@media (max-width: 640px) {
  .site-header {
    top: 8px;
  }

  .site-header-inner {
    max-width: calc(100% + 16px);
    padding: 0 16px;
    border-radius: var(--radius-xxl);
  }
}


.header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

@media (max-width: 480px) {
  .header-meta {
    gap: 1.5rem; /* tighten icon spacing on mobile */
  }

}
.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  border: none;
  background: transparent;
  text-decoration: none;
  font-size: 0.85rem;
  line-height: 1;
}
.header-icon-img {
  display: block;
  width: 22px;
  height: 22px;
}
.header-icon:hover, .header-icon:focus-visible {
  border-color: color-mix(in srgb, var(--border, #e5e7eb) 75%, transparent);
  outline: none;
}

.header-icon:a {
  color: var(--fw-blue);
  text-decoration: none;
  transition: var(--transition-color);
}

/* Basic rule so visited header links don't change look */
.header-meta a:visited {
  color: inherit;
}
/* Page shell
   -------------------------------------------------------------------------- */
.page {
  width: 100%;
  min-height: 100vh;
  padding-block: var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  color: var(--color-text, #0f172a);
  position: relative;
  z-index: var(--z-base);
}
.page--onboarding {
  padding-top: var(--space-0);
}


.page--onboarding .container--onboarding,
.dashboard > .container {
  margin-top: 10px; /* ✅ small consistent gap under the pill */
}
/* Ensure content clears the sticky header pill */
.dashboard,
.page--onboarding {
  padding-top: 14px; /* small buffer under header */
}

.page,
.dashboard {
  position: relative;
  z-index: 1;
}

.page-main {
  flex: 1;
  display: flex;
  align-items: center; /* vertical centering */
  justify-content: center; /* horizontal centering for hero block */
}
@media (max-width: 640px) {
  .page-main {
    align-items: flex-start;
    padding-top: var(--space-8);
  }
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-note {
  margin-top: 0.75rem;
  color: var(--muted, #6b7280);
}
/* Brand + hero block (landing, signup)
   -------------------------------------------------------------------------- */
.brand {
  display: block;
  margin: 0 auto var(--space-4);
}
.brand img, .brand svg {
  display: block;
  margin: 0 auto;
  max-width: 280px;
  height: 80px;
}
/* Small logo in header */
.brand--small img {
  height: 28px;
  width: auto;
  display: block;
}
.site-header .brand {
  margin: 0;
}


/* Containers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--layout-max-width);
  margin-inline: auto;
  padding-inline: var(--layout-page-padding);
}
.container--auth {
  max-width: 640px;          /* narrative + card column */
}

.container--narrow {
  max-width: var(--layout-narrow);
  margin-inline: auto;
}

.container--wide {
  max-width: var(--layout-wide);
  margin-inline: auto;
}

.container--onboarding {
  max-width: 1056px; /* intentional exception */
}

/* Simple hero layout on marketing / signup pages */
.hero {
  max-width: var(--layout-narrow);
  margin: 0 auto;
  margin-inline: auto;
  flex-direction: column;
  align-items: center;
  text-align: center;
    display: grid;
  justify-items: center;
  row-gap: var(--space-6);
}
.hero h1 {
  margin: 0 0 var(--space-3);
}
.hero .lead {
  color: var(--fw-muted-on-dark);
/*  max-width: 56ch; */
  margin-inline: auto;
}
/* Confirm page hero tweaks */
.hero--confirm {
  max-width: var(--layout-narrow);
  margin-inline: auto;
  text-align: center;
}
.confirm-heading {
  margin: var(--space-4) 0 var(--space-3);
}
.confirm-lead {
  color: var(--fw-muted-on-dark); /* same as landing lead */
}

/* Dashboard
   -------------------------------------------------------------------------- */
.dashboard {
  max-width: 1056px; /* intentional exception */
  margin: 0;
  padding: 0; /* reset page padding */
}
/* Put the vertical spacing on the container inside dashboard */
.dashboard > .container {
  padding-top: var(--space-6);     /* tune */
  padding-bottom: var(--space-8);  /* tune */
}
.dashboard-section {
  margin-bottom: var(--space-xl, 2rem); /* spacing below */
  padding-top: var(--space-lg, 1.5rem); /* optional breathing room above */
}
.dashboard-section:first-of-type {
  margin-top: 0; /* ensures top section sits where it belongs */
}
/* -------------------------------------------
   Dashboard meta row (top status)
------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

/* Bump to two columns on larger screens */
@media (min-width: 900px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* Optionally make overview span full width */
  #overview-card {
    grid-column: 1 / -1;
  }
}

.dashboard-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;

  margin: 0 auto;

  padding: 6px 16px 14px; /* <-- breathing room above journey */
}
.dashboard-hint {
  color: var(--muted, #6b7280);
  font-size: var(--text-xs);
  text-align: center;
}
/* Recent transactions list */
.overview-recent {
  margin-top: 1rem;
}

.overview-subhead {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.recent-tx-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-tx-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  font-size: 0.9rem;
}

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

.recent-tx-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.recent-tx-list .muted {
  color: var(--text-muted);
}
.recent-tx-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.recent-tx-row:hover {
  opacity: 0.9;
}

.recent-tx-title {
  font-weight: 600;
}



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

/* --- Safety Net Reserves --- */
.protection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.protection-panel {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--muted-bg, #eaf1fb);
  border: 1px solid rgba(0,0,0,0.06);
}

.protection-panel h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.protection-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
}

.reserves-list {
  display: grid;
}

.reserve {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.55);
}



/* Reserve fund: put title above value */
.reserve-row{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.reserve-title{
  font-weight: 600;
}

.reserve-meta{
  font-weight: var(--weight-regular);
  font-size: var(--text-sm); 
}

/* Collapse to 2 columns */
@media (max-width: 980px) {
  .protection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Collapse to 1 column */
@media (max-width: 640px) {
  .protection-grid {
    grid-template-columns: 1fr;
  }
}

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

.reserve {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--muted-bg, #eaf1fb);
}

.reserve-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.reserve-title { margin: 0; font-size: 0.95rem; }
.reserve-meta { opacity: 0.75; font-size: 0.9rem; }

/* --- Protection basics row --- */
.protection-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.protection-panel {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--muted-bg, #eaf1fb);
  border: 1px solid rgba(0,0,0,0.06);
}

.protection-panel h3 { margin: 0 0 10px; font-size: 1rem; }

.protection-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
}

.protection-actions { margin-top: 10px; }

/* Mobile: swipe */
.protection-swipe-hint { display: none; opacity: 0.75; margin: 8px 0 0; }

@media (max-width: 780px) {
  .reserves-grid {
    grid-template-columns: 1fr;
  }

  .protection-swipe-hint { display: block; }

  .protection-row {
    grid-auto-flow: column;
    grid-auto-columns: 88%;
    grid-template-columns: unset;

    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;

    padding-inline: 16px;
    margin-inline: -16px;
    padding-bottom: 10px;
    gap: 12px;
  }

  .protection-panel { scroll-snap-align: start; }

  .protection-row::-webkit-scrollbar { display: none; }
  .protection-row { scrollbar-width: none; }
}

/* Left: last sign-in */
.last-signin-banner {
  font-size: 0.8rem;
  color: var(--color-text-soft);
  margin: 0;
  text-align: left;
}

.summary-inline-link {
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.onboarding-start-link {
  color: #2563eb; /* brand blue */
  font-weight: 600;
  text-decoration: none;
  margin-left: 0.35rem;
}
.onboarding-start-link:hover {
  text-decoration: underline;
}

.lead-prompt {
  text-align: center;
  font-size: 1.15rem; /* comfortably larger, still calm */
  line-height: 1.4;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
  color: var(--fw-blue-600, #2563eb);
  /* or try #3b82f6 if you want softer: var(--fw-blue-500) */
  font-weight: 500; /* gentle emphasis without shouting */
}

/* Summary strip just under header */
.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.summary-item {
  padding: 0.85rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #ffffff);
}
.summary-item {
  position: relative;
}
.summary-action {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--link);
  text-decoration: none;
}
.summary-action:hover, .summary-action:focus {
  text-decoration: underline;
}
.summary-item h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
  color: var(--muted, #6b7280);
}
.summary-item p {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Summary strip: color the Reality (right) number */
.sum-target { color: inherit; }
.sum-dot { opacity: 0.55; padding: 0 2px; }
.sum-actual { font-weight: 700; }
.sum-actual.is-under {
  color: var(--fw-teal-500, var(--color-jar-secondary, #14b8a6));
}
.sum-actual.is-over {
  color: var(--fw-coral-400, var(--color-jar-warning, #fb7185));
}
.summary-item small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--muted, #6b7280);
}
.summary-count{
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--muted-bg, #eaf2ff);
  color: var(--text-muted, #334155);
}

/* Simple checklist styling */
.checklist {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
}
.checklist li + li {
  margin-top: 0.4rem;
}

/* Onboarding -------------------------------------------------------------------------- */
.lead--onboarding {
  color: var(--color-text-soft);
}

/* Right: onboarding status */
.onboarding-status {
  font-size: 0.8rem;
  font-weight: var(--weight-semibold);
  color: var(--color-text-soft);
  margin: 0;
  text-align: right;
}

.onboarding-status a {
  color: var(--color-text-soft);
  text-decoration: none;
}
.onboarding-status a:hover {
  color: var(--fw-text);
  text-decoration: underline;
}
/* Anchor offset for sticky header */
.onboarding-section {
  scroll-margin-top: 50px; /* adjust to your sticky bar height + breathing room */
}
.onboarding-section + .onboarding-section {
  margin-top: 32px;
}

/* Optional: colour-code states */
.onboarding-status--ok {
  color: #3BEA7B; /* calm green */
}
.onboarding-status--soon {
  color: #FDC52D; /* amber */
}
.onboarding-status--due {
  color: #E95D49; /* soft red, still calm */
}

.checkup-header h2 {
  font-size: 1.6rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem 0;
}
/* Inside-panel subheads (reduce bigness) */
.checkup-subtitle {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 12px 0 8px;
}
.checkup-help {
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(15, 23, 42, 0.72);
  margin: 0;
}
.checkup-summary {
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.8);
  margin-bottom: 0.75rem;
}
.checkup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
}
.checkup-note {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.6);
}

.checkup-meta {
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.6);
  margin-bottom: 0.75rem;
}

/* Setup Journey + Rail
   -------------------------------------------------------------------------- */

/* Onboarding layout */
.onboarding-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}
.onboarding-intro {
  margin-top: 0;
  margin-bottom: 20px;
}

.onboarding-intro .heading-xl {
  margin: 0 0 10px;
}



/* Main column */
.onboarding-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Right rail (sticky container) */
.onboarding-rail {
  position: sticky;
  top: calc(var(--header-height) + 36px); /* stays below sticky header */
  align-self: start;                      /* important inside grid */
  z-index: 2;
}

.setup-journey {
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px 0;
}

.setup-journey-list {
  list-style: none;
  margin: 0;
  padding: 0;

  display: flex;
  gap: 10px 14px;
  align-items: center;
}

/* Layout variants */
.setup-journey--inline .setup-journey-list {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

.setup-journey--rail .setup-journey-list {
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.setup-journey-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* Pill button */
.setup-journey-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;

  padding: 7px 16px 7px 12px;
  border-radius: 999px;

  /* Light theme surfaces */
  background: var(--fw-card-bg, #f8fafc);
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: rgba(15, 23, 42, 0.82);

  transition:
    background 160ms ease,
    color 160ms ease,
    opacity 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

/* Ensure visited links don't shift colour */
.setup-journey-link:link,
.setup-journey-link:visited {
  color: rgba(15, 23, 42, 0.82);
}

.setup-journey-link:hover,
.setup-journey-link:focus-visible {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.18);
  outline: none;
  text-decoration: none;
  box-shadow: 0 1px 10px rgba(15, 23, 42, 0.06);
}

.setup-journey-icon {
  display: inline-block;
  width: 1.1em;
  text-align: center;
  opacity: 0.75;
}

/* Separator (if you still use it in inline mode) */
.setup-journey-sep {
  color: rgba(15, 23, 42, 0.30);
  opacity: 1;
}

/* Rail content */
.setup-journey--rail {
  padding: 14px;
  border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.85);

  

  
    border-color: rgba(37, 99, 235, 0.35);

  backdrop-filter: blur(10px);
}

/* Rail title */
.setup-journey-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fw-text-on-dark, #0f172a);
}

/* Hide your chevron separators in vertical mode */
.setup-journey--rail .setup-journey-sep {
  display: none;
}

/* Make links look like compact “items” */
.setup-journey--rail .setup-journey-link {
  width: 100%;
  justify-content: flex-start;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--fw-card-bg, #f8fafc);

  color: rgba(255, 255, 255, 0.92);
}

/* Completed / Next states (matches your JS classes) */
.setup-journey--rail .setup-journey-link.is-complete {
  opacity: 0.7;
}

.setup-journey--rail .setup-journey-link.is-next {
  border-color: rgba(255, 255, 255, 0.35);
  background: var(--fw-card-bg, #f8fafc);

}

/* States */
.setup-journey-link.is-complete:link,
.setup-journey-link.is-complete:visited {
  color: var(--fw-success);
  border-color: rgba(110, 231, 183, 0.45);
}
.setup-journey-link.is-complete .setup-journey-icon {
  color: var(--fw-success);
  opacity: 1;
}

.setup-journey-link.is-next:link,
.setup-journey-link.is-next:visited {
  color: var(--fw-focus);
}
.setup-journey-link.is-next {
  background: var(--fw-card-bg, #f8fafc);
  border-color: rgba(255, 255, 255, 0.40);
  font-weight: 700;
  padding-right: 16px;
}
.setup-journey-link.is-next .setup-journey-icon {
  color: var(--fw-focus);
  opacity: 1;
}
.setup-journey-link.is-next:hover,
.setup-journey-link.is-next:focus-visible {
  background: var(--fw-card-bg, #f8fafc);
  border-color: rgba(255, 255, 255, 0.46);
}

.setup-journey-link:not(.is-complete):not(.is-next):link,
.setup-journey-link:not(.is-complete):not(.is-next):visited {
  color: var(--fw-next);
  border-color: rgba(253, 197, 45, 0.55);
}
.setup-journey-link:not(.is-complete):not(.is-next) .setup-journey-icon {
  color: var(--fw-next);
  opacity: 0.9;
}

/* Locked: muted but readable (still amber/green/white underneath) */
.setup-journey-link.is-locked {
  opacity: 0.78;
}
.setup-journey--rail .setup-journey-link.is-active {
  outline: 2px solid rgba(255, 255, 255, 0.35);
}

/* Responsive: stack and move journey below (or hide) */
@media (max-width: 960px) {
  .onboarding-layout {
    grid-template-columns: 1fr;
  }

  .onboarding-rail {
    order: 2;
  }

  .setup-journey--rail {
    position: static; /* no sticky when stacked */
    top: auto;
  }
  .onboarding-rail {
    position: static; /* no sticky on mobile */
    margin-top: var(--space-6);
  }

  .setup-journey--rail {
    text-align: center;
  }
}

/* Optional: hide rail on small screens entirely */
@media (max-width: 680px) {
  .onboarding-rail {
    display: none;
  }
}

/* Mobile */
@media (max-width: 640px) {
  /* Use a 2-col grid so 7 items become 3 rows of 2 + 1 final row */
  .setup-journey-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    justify-items: center;
    align-items: center;
  }

  /* Make sure the li doesn't add extra spacing in grid mode */
  .setup-journey-item {
    width: 100%;
    justify-content: center;
  }

  /* Keep pills looking good in a fixed grid */
  .setup-journey-link {
    width: 100%;
    justify-content: center;
  }

  /* Last item (Giving) spans both columns -> centered solo row */
  .setup-journey-item:last-child {
    grid-column: 1 / -1;
    width: 70%; /* tweak: 60–80% depending on your taste */
    justify-self: center;
  }
}

/* Onboarding Pages */
/* Income summary: 4 across on desktop, stacked on mobile */
.income-summary .summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
  margin-bottom: 12px; /* breathing room above the note */
}


.income-summary .summary-item {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
	min-height: 92px;
	text-align: center;
}

.income-summary .summary-item small {
  display: block;
  color: var(--muted, rgba(15, 23, 42, 0.65));
  margin-bottom: 6px;
	font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.income-summary .summary-item strong {
  display: block;
  font-size: 1.6rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
	margin-top: 2px;

}

.income-summary .summary-item--highlight {
  border-color: rgba(37, 99, 235, 0.35);
}

/* Switch to 2 across sooner (most laptops / iPad landscape / smaller desktops) */
@media (max-width: 900px) {
  .income-summary .summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Highlight spans full width in 2-col mode */
  /*.income-summary .summary-item--highlight {
    grid-column: 1 / -1;
  }*/
}

/* Phone: stack */
@media (max-width: 520px) {
  .income-summary .summary-row {
    grid-template-columns: 1fr;
  }

  .income-summary .summary-item strong {
    font-size: 1.45rem;
  }
}
/* Income list (clean rows, no bullets) */
.income-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem 0;
  display: grid;
  gap: 10px;
}

.income-item {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  padding: 18px 14px;
}

.income-item__top {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 16px;
  align-items: baseline;
}
.income-item__left {
  min-width: 0; /* prevents overflow issues with long labels */
}
.income-item__right {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px; /* space between amount and delete */
}
.income-item__amount {
  white-space: nowrap;
}
.income-item__label {
  font-weight: 600;
  letter-spacing: -0.01em;
	  line-height: 1.25;
  margin: 0;
}

.income-item__meta {
  margin-top: 8px;
  font-size: 0.9rem;
  color: rgba(15, 23, 42, 0.7);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.income-item__meta .dot {
  opacity: 0.5;
}

/* Branded edit button (quiet, secondary) */
.income-item__actions {
  display: flex;
  align-items: center;
	  justify-content: space-between;
  gap: 10px;
	width: 100%;
}
.income-item-actions__left {
  display: inline-flex;
  gap: 10px;
}

.income-item__edit {
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.income-item__edit:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.55);
}

.income-item__edit:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
}
/* Delete: text-only (quiet) */
.income-item__delete {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0 0 0 0;
  margin: 0;

  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.35);
  cursor: pointer;
  line-height: 1;
}

.income-item__delete:hover {
  color: rgba(185, 28, 28, 0.95);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.income-item__delete:focus-visible {
  outline: 2px solid rgba(239, 68, 68, 0.45);
  outline-offset: 2px;
}
.income-item--add {
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  background: rgba(37, 99, 235, 0.04);
  border: 1px dashed rgba(37, 99, 235, 0.25);
}
.income-item--add:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.35);
}

.income-item--add:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}
/* Panels */
.income-panels {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.panel {
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
}

/* The clickable header */
.panel-summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* ✅ was space-between */
  gap: 16px;
  user-select: none;
  text-align: left;
}
/* Remove native disclosure marker completely */
.panel-summary::marker {
  content: "";
}
.panel-summary::-webkit-details-marker {
  display: none;
}
/* Left chevron: fixed gutter so titles align perfectly */
.panel-chevron {
  width: 44px;                 /* ✅ fixed column */
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 2.2rem;
  line-height: 1;
  color: rgb(37, 99, 235);
  transition: transform 0.18s ease, opacity 0.18s ease;
  opacity: 0.9;
}

.panel-chevron::before {
  content: "▸";
}

.panel[open] > .panel-summary .panel-chevron {
  transform: rotate(90deg);
  opacity: 1;
}



/* Title stack */
.panel-summary-text {
  display: grid;
  gap: 4px;
  align-items: start;
  min-width: 0;               /* ✅ allows subtitle ellipsis to work */
}

/* Title + subtitle */
.panel-title {
  font-size: 1.05rem;     /* smaller than section title */
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-subtitle {
  color: rgba(15,23,42,0.60);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Panel body padding */
.panel > *:not(summary) {
  padding: 0 16px 16px 16px;
}

/* Optional: hover polish */
.panel-summary:hover .panel-chevron {
  opacity: 1;
}
.panel:not([open]) .panel-chevron {
  color: rgba(37, 99, 235, 0.75);
}
.panel[open] {
  background: rgba(37, 99, 235, 0.03);
  border-color: rgba(37, 99, 235, 0.35);
}


.checkup-divider {
  margin: 0.75rem 0;
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
}
/* --- budgets ---*/
.budget-style {
  margin-top: 0.75rem;
  border: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}
.budget-style-note {
  color: rgba(15, 23, 42, 0.6);
  font-size: 0.8rem;
}
.needs-style {
  margin-top: 0.75rem;
  border: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}
.needs-style-note {
  color: rgba(15, 23, 42, 0.6);
  font-size: 0.8rem;
}
/* -------------------------------------------
   Housing units (tabs)
------------------------------------------- */
.housing-units { margin: 12px 0 18px; }
.housing-units-row { display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.housing-units-tabs { display:flex; gap:8px; flex-wrap:wrap; }
.housing-tab {
  border: 1px solid;
  border-color: var(--fw-blue-300, rgba(37,99,235,0.35));
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  display: inline-flex; 
  align-items: center; 
  gap: 8px;
}


/* Highlight selected tab */
.housing-tab[aria-selected="true"]{
  background: var(--color-bg);
  border-color: var(--brand-blue, #2563eb);
  color: var(--brand-blue, #2563eb);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}
.housing-tab-actions { 
  display: inline-flex; 
  gap: 6px; 
  margin-left: 6px; 
  opacity: .25; 
  transition: opacity 120ms ease; 
} 
.housing-tab:hover .housing-tab-actions, .housing-tab[aria-selected="true"] .housing-tab-actions { 
  opacity: 1; 
} 
.housing-tab-action { 
  border: 0; 
  background: transparent; 
  padding: 0 2px; 
  cursor: pointer; 
  font-size: 0.8rem; 
  line-height: 1; 
  color: inherit; 
  opacity: 0.75; 
    justify-content: center;
  align-items: center;
  display: inline-flex;
  transition: color 120ms ease, opacity 120ms ease;
} 
.housing-tab-action:hover { 
  opacity: 1; 
  color: var(--fw-blue-600);
} 
.housing-tab-delete:hover { 
  color: #dc2626; 
}
/* Optional: subtle hover */
.housing-tab:hover{
  background: rgba(255,255,255,0.6);
}
.housing-tab-action:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* SVG sizing safety */
.icon {
  display: block;
}


/* -------------------------------------------
   Wants (mirrors Needs pattern)
------------------------------------------- */

.wants-style {
  margin-top: 14px;
  padding: 14px 14px 10px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}

.wants-style legend {
  font-weight: 600;
  margin-bottom: 10px;
}

.wants-style label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 10px;
  cursor: pointer;
}

.wants-style label:hover {
  background: rgba(255,255,255,0.06);
}

.wants-style input[type="radio"] {
  transform: translateY(1px);
}

.wants-style-note {
  opacity: 0.85;
  font-size: 0.95em;
}




.macro-budgets {
  margin-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  padding-top: 0.75rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}
.macro-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.macro-row span:last-child {
  font-weight: 500;
}
.macro-needs {
  margin-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  padding-top: 0.75rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}
.needs-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.needs-row span:last-child {
  font-weight: 500;
}
.summary-ratio-list {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0.5rem 0 0.25rem;
}
.summary-ratio-list li {
  margin: 0.15rem 0;
}

.h2-meta {
  font-weight: 600;
  color: var(--muted);
  margin-left: 0.4rem;
  font-size: 0.95em;
}

.spending-layout {
  position: relative; /* so tooltip can be absolutely positioned inside */
  display: flex;
  gap: 1.25rem;
  align-items: center;
}
.spending-donut {
  width: 96px;
  aspect-ratio: 1;
  border-radius: 999px;
  background: var(--muted-bg, #e5edf8); /* fallback */
  position: relative;
  flex-shrink: 0;
}
/* donut hole */
.spending-donut::after {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: inherit;
  background: var(--card-bg, #f5f7fb); /* match card background */
}


.spending-tooltip {
  position: absolute;
  min-width: 140px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.96); /* dark slate */
  color: #fff;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -150%);
  transition: opacity 120ms ease-out;
  white-space: nowrap;
  z-index: 5;
}
.spending-tooltip[data-visible="true"] {
  opacity: 1;
}

/* Buttons
   -------------------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-decoration: none;
  cursor: pointer;
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-bg), box-shadow var(--transition-normal);
}
.button:hover {
  background: var(--color-accent-hover);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: var(--shadow-none);
}
/* Secondary button (outline / ghost) */
.button--secondary {
  background: var(--color-secondary-bg);
  color: var(--color-secondary-text);
  border-color: var(--color-secondary-border);
  box-shadow: var(--shadow-none);
}
.button--secondary:hover {
  background: var(--color-secondary-hover-bg);
}
/* Compact primary button — matches edit pill size */
.button--compact {
  padding: 6px 12px;
  font-size: 0.85rem;
  line-height: 1;
  border-radius: 999px;
}
/* Quiet / muted action button (Back, Cancel, Edit-like actions) */
.button-quiet {
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
  color: rgb(37, 99, 235);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.button-quiet:hover {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.55);
}

.button-quiet:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  outline-offset: 2px;
}
/* Header icon button (used in income items) */
/* Quick transaction header button */
.header-icon--tx {
  color: var(--fw-blue-500); /* brand blue */
  border-radius: 999px;
  padding: 0;              /* tight by default */
  transition: background 0.15s ease, transform 0.15s ease;
  background: transparent;
}

.header-icon--tx:hover {
  background: rgba(37, 99, 235, 0.08);
}

.header-icon--tx:active {
  transform: scale(0.96);
}

/* Icon sizing */
.header-icon--tx .icon-plus {
  display: block;
  width: 24px;
  height: 24px;
}

/* Open state → becomes “×” */
.header-icon--tx.is-open .icon-plus {
  transform: rotate(45deg);
}

/* Smooth rotation */
.icon-plus {
  transition: transform 0.18s ease;
}

/* Mobile tightening */
@media (max-width: 640px) {
  .header-icon--tx {
        width: 32px;
    height: 32px;
  }

  .header-icon--tx .icon-plus {
    width: 16px;
    height: 16px;
  }
}

.header-icon--primary {
  color: var(--color-accent);
}
.header-icon--primary {
  background: rgba(37, 99, 235, 0.08);
  border-width: 1px var(--fw-blue-600);
  border-radius: 999px;
  padding: 6px;
}

.header-icon--primary:hover {
  color: var(--color-accent-hover);
}

.icon-plus-circle {
  display: block;
}


/* Text-only button style */
.button--link {
  background: transparent;
  border: none;
  padding-inline: 0;
  padding-block: 0;
  box-shadow: none;
  color: var(--color-link);
}
.button--link:hover {
  background: transparent;
  text-decoration: underline;
}

/* Contextual button tweaks */
@media (min-width: 640px) {
  .form--inline .button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .signup-box .button {
    white-space: nowrap;
  }
}
/* Forms
   -------------------------------------------------------------------------- */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
/* Reusable “email + button” inline form (used on index) */
.form--inline {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .form--inline {
    flex-direction: row;
    align-items: center;
  }
  .form--inline .field {
    flex: 1;
  }
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: left;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
fieldset {
  border: none;
  margin: 0;
  padding: 0;
  min-inline-size: 0; /* fixes flex/grid overflow */
}

legend {
  padding: 0;
}

.field label {
  font-size: var(--text-sm);
  text-align: left;
}
.form-field label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--fw-card-border);
  background: #ffffff;
  font: inherit;
  color: var(--fw-text-on-card);
  transition:
    border-color var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-normal);
}
.field input::placeholder, .field textarea::placeholder {
  color: var(--fw-text-soft-on-card);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-outline);
}
.input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.6); /* slate-400-ish */
  font-size: 0.95rem;
  background: #ffffff;
}
.input:focus {
  outline: none;
  border-color: var(--fw-blue, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}
.range-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 6px;
}

.range-field input[type="range"] {
  appearance: none;
  height: 6px;
  background: var(--fw-blue-300);
  border-radius: 999px;
  outline: none;
}

.range-field input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 22px;
  border-radius: 4px;
  background: var(--fw-neutral-200);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.range-field input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 22px;
  border-radius: 4px;
  background: var(--fw-neutral-200);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  border: none;
}

.range-value {
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
  text-align: right;
  opacity: 0.85;
}
.range-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
}

.range-step {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  justify-content: center;
  border: none;
  background: rgba(255,255,255,0.85);
  color: #2b3a67;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.range-step:focus-visible {
  outline: 2px solid #4f6bdc;
  outline-offset: 2px;
}

.range-step:active {
  transform: scale(0.96);
}

.field-help {
  font-size: var(--text-xs);
  color: var(--color-text-soft);
}
.form-help {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--muted, #6b7280);
  line-height: 1.4;
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.form-actions__left {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.form-row label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
  text-align: left;
}
.form-row input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border, #e5e7eb);
  font-size: 1rem;
}
.form-hint {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted, #6b7280);
}

/* Form layouts & components ------------------------------------------------ */
.checkup-grid label, .checkup-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}
.checkup-form {
  display: grid;
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
}
/* Transaction form spacing */
.transaction-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/*.form-row {
  display: flex;
  gap: 1rem;
}*/
@media (max-width: 640px) {
  .form-row {
    flex-direction: column;
  }
}
.transaction-form .hint {
  color: var(--muted, #6b7280);
  font-size: var(--text-xs);
  margin-top: -0.5rem;
}
.budget-style legend {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.budget-style label {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
/* Strategy inputs layout */
.strategy-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.strategy-inputs label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  text-align: left;
}
.strategy-inputs input[type="number"] {
  padding: 0.4rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border, #e5e7eb);
  font-size: 0.95rem;
}
.checklist input[type="checkbox"] {
  margin-right: 0.4rem;
}
.signup-box form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
/* Layout tweak for wider screens: email + button inline */
@media (min-width: 640px) {
  .signup-box form {
    flex-direction: row;
    align-items: center;
  }
  .signup-box .field {
    flex: 1;
    margin: 0;
  }
  .signup-box-actions {
    flex-direction: row;
    align-items: stretch;
  }
}
/* Signup box (landing / email capture)
   -------------------------------------------------------------------------- */
.signup-box {
  margin-top: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  background: var(--fw-card-bg);
  border: 1px solid var(--fw-card-border);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
  max-width: 480px;
  margin-inline: auto;
  color: var(--fw-text-on-card);
}
.signup-box-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: stretch;
}
.signup-box .text-muted, .signup-box .body-sm.text-muted {
  color: var(--fw-text-soft-on-card);
}
/* Footer
   -------------------------------------------------------------------------- */
footer.site-footer {
  margin-top: auto;
  padding: var(--space-4) 0;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--fw-muted-on-dark);
}
/* Utility classes
   -------------------------------------------------------------------------- */
.text-center {
  text-align: center;
}
.text-muted {
  color: var(--color-text-soft);
}
.stack-md {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.stack-lg {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
