/* ============================================
   Ripple – Responsive Prototype
   Design: https://www.figma.com/design/df0RZTfVpi9Zf10llJCffT/Ripple-Responsive-Design?node-id=3149-5153
   Breakpoints: mobile (default), tablet 768px, desktop 1024px
   ============================================ */

/* Cross-document view transitions (Chrome 126+): smoother page changes */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: vt-fade-out 0.2s ease-out both;
}
::view-transition-new(root) {
  animation: vt-fade-in 0.25s ease-out both;
}
@keyframes vt-fade-out {
  to { opacity: 0; }
}
@keyframes vt-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

:root {
  /* Colors – dashboard */
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-primary: #4C56B6;
  --color-primary-hover: #3d46a0;
  --color-primary-light: #e8eaf5;
  --color-border: #e2e8f0;
  --color-accent: #4C56B6;
  --color-icon: #202437;
  --color-logo: #8DA2FF;
  --logo-outer: #AABEFF;
  --logo-mid: #8C9CE3;
  --logo-inner: #5B67C7;

  /* Typography */
  --font-sans: "Inter", system-ui, sans-serif;
  --font-logo: "Sora", var(--font-sans);
  --font-heading: "Sora", var(--font-sans);
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Mobile spacing: related content 20px, differing content 25px */
  --space-related: 20px;
  --space-between: 25px;

  /* Layout */
  --container-padding: 1rem;
  --header-height: 3.5rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
  --breakpoint-transition: 0.4s ease-in-out;
  /* Primary CTAs: same height for <button> and <span class="btn"> (avoids body line-height blow-up) */
  --btn-height: 2.5rem;
  /* Transactions: filter tabs (All / Round-ups / Contributions) align with search field row */
  --transaction-search-row-height: 2.75rem;
}

/* Reduce motion when user prefers it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}
@media (min-width: 768px) {
  body {
    font-size: 20px;
  }
}
@media (min-width: 1024px) {
  body {
    font-size: 22px;
  }
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: white;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: var(--space-4);
}

/* ----- Container ----- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  min-height: var(--btn-height);
  text-decoration: none;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
}
.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--color-text);
}
.btn-ghost:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-hover);
}
.btn-lg {
  padding: var(--space-2) var(--space-6);
  font-size: 16px;
  min-height: var(--btn-height);
  line-height: 1.25;
}
.btn-outline {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary-light);
}
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: 16px;
  min-height: var(--btn-height);
  line-height: 1.25;
}

/* ============================================
   DASHBOARD (mobile app)
   ============================================ */
body.dashboard {
  background: var(--color-bg);
  padding-bottom: 5.5rem;
  transition: padding-bottom var(--breakpoint-transition);
}

/* Goals page: sticky footer at bottom of viewport when content is short */
body.goals-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.goals-page .dashboard-main {
  flex: 1;
}

/* Goal detail pages: sticky footer at bottom of viewport when content is short */
body.goal-detail-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.goal-detail-page .dashboard-main {
  flex: 1;
}

.dashboard-main {
  padding-top: var(--space-4);
  padding-bottom: var(--space-8);
}

.dashboard-content {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
  transition: max-width var(--breakpoint-transition), padding-left var(--breakpoint-transition), padding-right var(--breakpoint-transition);
}

/* App header – same dimensions used for goal-detail-header across pages */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
}
.app-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  background: var(--color-border);
}

.app-header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--container-padding);
  max-width: 480px;
  margin: 0 auto;
  transition: max-width var(--breakpoint-transition), padding-left var(--breakpoint-transition), padding-right var(--breakpoint-transition);
}

.logo-app {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}
.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}
.logo-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.logo-text {
  font-family: var(--font-logo);
  color: var(--color-logo);
  font-size: 20px;
}
.logo-app:hover .logo-text {
  color: var(--color-primary-hover);
}

/* Welcome */
.welcome {
  margin-bottom: var(--space-6);
}
.welcome-title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-heading);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.welcome-title-icon {
  font-size: 1.1em;
  line-height: 1;
  color: inherit;
}
.welcome-subtitle {
  margin: 0;
  font-size: var(--text-base);
  color: var(--color-text-muted);
}

/* Home: hero wraps headline + quick stats */
body.dashboard.home-page .welcome.home-hero {
  margin-bottom: 0;
}
.home-page .home-hero-text {
  margin-bottom: var(--space-6);
}
@media (max-width: 767px) {
  body.dashboard.home-page .home-hero-text {
    margin-bottom: var(--space-between);
  }
}

/* Cards */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.card-label {
  margin: 0 0 var(--space-1);
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text-muted);
}

/* Total Savings card */
.savings-source {
  margin: 0 0 var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text-muted);
}
.savings-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.savings-card-top .card-label {
  color: #202437;
}
.savings-card-top .savings-amount {
  margin: 0;
  flex-shrink: 0;
}
.savings-amount {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.savings-actions {
  display: flex;
  gap: var(--space-3);
}
.savings-actions .btn {
  flex: 1;
}

/* Savings Growth card */
.growth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.growth-filters {
  display: flex;
  gap: var(--space-1);
}
/* Savings growth: short labels (6M, 1Y) on small screens, full text on desktop */
.growth-filters .filter-btn-long {
  display: none;
}
.growth-filters .filter-btn-short {
  display: inline;
}
@media (min-width: 1024px) {
  .growth-filters .filter-btn-short {
    display: none;
  }
  .growth-filters .filter-btn-long {
    display: inline;
  }
}
.filter-btn {
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.2s;
}
.filter-btn[aria-selected="false"] {
  color: var(--color-text-muted);
  font-weight: 400;
}
.filter-btn:hover {
  color: var(--color-primary);
}
.filter-btn[aria-selected="true"] {
  color: var(--color-primary);
  font-weight: 700;
  background: transparent;
}

.chart-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto;
  gap: 0 0.5rem;
  width: 100%;
  min-width: 0;
  align-items: start;
}
.chart-y-labels {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  /* Match plot area height so tick labels align with SVG grid (120px mobile, 290px desktop) */
  height: 120px;
  min-height: 120px;
  max-height: 120px;
  min-width: 2.75rem;
  align-self: start;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--color-text-muted);
  text-align: right;
}
/* Match SVG horizontal grid / axis ticks: plot y 0,24,48,72,96,120 in viewBox y with minY=-8 height=143 */
.chart-y-labels span {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  line-height: 1;
}
.chart-y-labels span:nth-child(1) {
  top: calc(8 / 143 * 100%);
} /* 500 @ y=0 */
.chart-y-labels span:nth-child(2) {
  top: calc(32 / 143 * 100%);
} /* 400 @ y=24 */
.chart-y-labels span:nth-child(3) {
  top: calc(56 / 143 * 100%);
} /* 300 @ y=48 */
.chart-y-labels span:nth-child(4) {
  top: calc(80 / 143 * 100%);
} /* 200 @ y=72 */
.chart-y-labels span:nth-child(5) {
  top: calc(104 / 143 * 100%);
} /* 100 @ y=96 */
.chart-y-labels span:nth-child(6) {
  top: calc(128 / 143 * 100%);
} /* 0 @ y=120 */
@media (min-width: 1024px) {
  .chart-y-labels {
    font-size: 18px;
    height: 290px;
    min-height: 290px;
    max-height: 290px;
  }
}
/* Shared column: SVG + month row use identical width so label % matches axis notches */
.chart-plot-stack {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}
.chart-responsive {
  min-width: 0;
  width: 100%;
  flex-shrink: 0;
  aspect-ratio: 280 / 120;
  min-height: 120px;
  height: 120px;
  max-height: 120px;
}
.chart-months {
  min-width: 0;
  width: 100%;
  flex-shrink: 0;
  position: relative;
}
.chart-svg {
  width: 100%;
  height: 100%;
  display: block;
  vertical-align: middle;
}
/* Savings growth grid: small dashes with slight spacing */
.chart-grid line {
  stroke-dasharray: 2 3;
}
.chart-months {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--color-text-muted);
  padding-top: 2px;
  min-height: 1.35em;
}
/* Month labels: center on SVG x (0–280) via inline left % from script.js */
.chart-months span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}
@media (min-width: 1024px) {
  .chart-months {
    font-size: 18px;
  }
}

/* Savings Growth: mirror Y-axis column + gap as right inset so plot, Y numbers, and month labels align evenly to card edges */
body.dashboard .growth-card .chart-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  --growth-chart-y-axis-col: 3rem;
  --growth-chart-plot-gap: 0.5rem;
  --growth-chart-side-inset: calc(var(--growth-chart-y-axis-col) + var(--growth-chart-plot-gap));
}
body.dashboard .growth-card .chart-y-labels {
  width: var(--growth-chart-y-axis-col);
  min-width: var(--growth-chart-y-axis-col);
  max-width: var(--growth-chart-y-axis-col);
  box-sizing: border-box;
}
body.dashboard .growth-card .chart-plot-stack {
  /* Nudge plot + months together so inset matches perceived space (Y-axis column reads wider) */
  margin-left: -0.4rem;
  margin-right: calc(var(--growth-chart-side-inset) - 0.4rem);
  box-sizing: border-box;
}
body.dashboard .growth-card .chart-responsive,
body.dashboard .growth-card .chart-months {
  margin-left: 0;
  margin-right: 0;
}

/* Savings Growth mobile: hide 500, 300, 100 — 400 / 200 / 0 keep same absolute positions */
@media (max-width: 767px) {
  body.dashboard .growth-card .chart-y-labels span:nth-child(1),
  body.dashboard .growth-card .chart-y-labels span:nth-child(3),
  body.dashboard .growth-card .chart-y-labels span:nth-child(5) {
    display: none;
  }
}

/* Sections */
.section-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.section-heading-row .link-view-all {
  margin-top: 0;
}
.section-heading {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 400;
  color: var(--color-text);
}

.goals-section,
.courses-section {
  margin-bottom: var(--space-10);
}

/* Match gap between Savings Growth and Goals in Progress to gap above Courses */
.growth-card + .goals-section {
  margin-top: var(--space-10);
}

/* Goal cards */
.goal-card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}
.goal-card-link {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: var(--radius-lg);
}
.goal-card .goal-menu-wrap {
  position: relative;
  z-index: 2;
}
.goal-card .add-money-trigger,
.goal-card .goal-actions {
  position: relative;
  z-index: 1;
}
.goal-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.goal-icon {
  width: 28px;
  height: 28px;
  font-size: 28px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-icon);
  flex-shrink: 0;
}
.goal-name {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text);
}
.goal-name--link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.goal-name--link:hover {
  color: var(--color-primary);
}
.goal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
}
.goal-meta .goal-amount {
  color: #585858;
}
.goal-pct {
  font-weight: 600;
  color: var(--color-primary);
}
.progress-bar {
  height: 10px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: var(--space-2);
}
@media (min-width: 768px) {
  .progress-bar {
    height: 14px;
  }
}
.progress-fill {
  display: block;
  height: 100%;
  background: var(--color-primary);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.goal-message {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text-muted);
}

/* ----- Goals page ----- */
.goals-page .goals-hero {
  margin-bottom: var(--space-6);
}
.goals-title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text);
}
.goals-subtitle {
  margin: 0 0 var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text-muted);
}
.btn-new-goal {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  justify-content: center;
}
.btn-new-goal-plus {
  font-size: 1.125rem;
}
@media (min-width: 768px) {
  .btn-new-goal {
    width: auto;
  }
}
@media (min-width: 1024px) {
  .goals-page .goals-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
  }
  .goals-hero-text {
    margin-bottom: 0;
  }
  .goals-hero-text .goals-subtitle {
    margin-bottom: 0;
  }
  .btn-new-goal {
    flex-shrink: 0;
    margin-left: auto;
  }
  .btn-new-goal-plus {
    width: 17px;
    height: 17px;
    font-size: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

.goals-page .savings-card {
  margin-bottom: var(--space-6);
}
.goals-page .savings-card .savings-card-top {
  margin-bottom: 0;
}
.goals-page .savings-card .savings-actions {
  display: none;
}

.goals-list {
  margin-bottom: var(--space-8);
}
.goal-card--full .goal-header--with-menu {
  margin-bottom: var(--space-1);
}
.goal-menu-wrap {
  position: relative;
  flex-shrink: 0;
}
.goal-menu-btn {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  color: var(--color-text-muted);
}
.goal-menu-btn:hover {
  color: var(--color-text);
}
.goal-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-1);
  min-width: 12rem;
  padding: 0 20px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 100;
  list-style: none;
}
.goal-menu.is-open {
  display: block;
}
.goal-menu[hidden] {
  display: none !important;
}
.goal-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: 12px 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text);
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.goal-menu-item:last-child {
  border-bottom: none;
}
.goal-menu-item .ph {
  font-size: 1.25rem;
  color: var(--color-icon);
  flex-shrink: 0;
}
.goal-menu-item:hover {
  background: rgba(0, 0, 0, 0.04);
}
.goal-menu-item--danger {
  color: #dc2626;
}
.goal-menu-item--danger .ph {
  color: #dc2626;
}
.goal-date {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: #585858;
}
.goal-date .ph {
  font-size: 1.125rem;
  color: #585858;
}
.goal-card--full .goal-message {
  margin-bottom: var(--space-3);
}
/* Goals page: tighter full cards (header closer, lower height) */
.goals-page .goal-card--full {
  padding: var(--space-4);
}
.goals-page .goal-card--full .goal-header--with-menu {
  margin-bottom: var(--space-1);
}
.goals-page .goal-card--full .goal-date {
  margin-bottom: var(--space-1);
}
.goals-page .goal-card--full .goal-meta {
  margin-bottom: var(--space-1);
}
.goals-page .goal-card--full .progress-bar {
  margin-bottom: var(--space-1);
}
.goals-page .goal-card--full .goal-message {
  margin-bottom: var(--space-2);
}
.goal-actions {
  display: flex;
  gap: var(--space-3);
}
.goal-actions .btn {
  flex: 1;
}

/* Badges */
.badges-section {
  margin-bottom: calc(var(--space-4) - 12px);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-6);
}
.badges-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.badges-section-header .section-heading {
  margin: 0;
}
.badges-section-header .link-view-all {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: underline;
}
.badges-section .badges-list--cards {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: var(--space-2);
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0;
}
.badges-section .badges-list--cards .badge-card {
  flex-shrink: 0;
}
@media (max-width: 767px) {
  .badges-section .badges-list--cards {
    justify-content: center;
    align-items: flex-start;
    gap: 1.5rem;
    overflow: visible;
    flex-wrap: nowrap;
  }
  /* Mobile: three badges = 1st, 2nd (center, larger), 4th (next locked, right); sizes -25%; labels 18px max */
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(3) {
    display: none;
  }
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(n+5) {
    display: none;
  }
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(1),
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(4) {
    margin-top: 6px;
  }
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(1) .badge-card,
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(4) .badge-card {
    opacity: 0.9;
    transform: scale(0.9);
    min-width: 84px;
    min-height: 96px;
    padding: 0.6rem 0.525rem;
  }
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(1) .badge-card .badge-card-icon,
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(4) .badge-card .badge-card-icon {
    width: 2.625rem;
    height: 2.625rem;
    font-size: 1.5rem;
  }
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(4) .badge-card .badge-card-lock {
    width: 2.625rem;
    height: 2.625rem;
    font-size: 1.5rem;
  }
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(2) {
    gap: 1rem;
  }
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(2) .badge-card {
    transform: scale(1.08);
    min-width: 96px;
    min-height: 108px;
    padding: 0.75rem 0.675rem;
  }
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(2) .badge-card .badge-card-icon {
    width: 3rem;
    height: 3rem;
    font-size: 1.6875rem;
  }
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(1) .badge-card-label,
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(4) .badge-card-label,
  .badges-section .badges-list--cards .badge-card-wrap:nth-child(2) .badge-card-label {
    font-size: 14px;
    max-width: 96px;
  }
}
@media (min-width: 768px) {
  .badges-section .badges-list--cards {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
  }
  /* Tablet + desktop: same badge dimensions */
  .badges-section .badges-list--cards .badge-card {
    width: 84px;
    min-width: 84px;
    min-height: 96px;
    padding: 0.6rem 0.525rem;
    box-sizing: border-box;
  }
  .badges-section .badges-list--cards .badge-card .badge-card-icon {
    width: 2.625rem;
    height: 2.625rem;
    font-size: 1.5rem;
  }
  .badges-section .badges-list--cards .badge-card--locked .badge-card-lock {
    width: 2.625rem;
    height: 2.625rem;
    font-size: 1.5rem;
  }
  .badges-section .badges-list--cards .badge-card-label {
    font-size: 14px;
    max-width: 96px;
  }
}
.badges-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  justify-content: flex-start;
}
.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  min-width: 4.5rem;
  font-size: var(--text-base);
  color: var(--color-text);
  text-align: center;
}
.badge-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(235, 253, 255, 0.8);
  border: 2px solid #39C2C9;
  color: #39C2C9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.badge-item--locked .badge-icon {
  background: var(--color-border);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}
.badge-label {
  max-width: 90px;
  line-height: 1.2;
  text-align: center;
}

/* ----- Goal detail / Transactions: on mobile hide top nav; on desktop show it above page header ----- */
.goal-detail-page .app-header,
.transactions-page .app-header {
  display: none;
}
@media (min-width: 1024px) {
  .goal-detail-page .app-header,
  .transactions-page .app-header {
    display: block;
  }
}

.goal-detail-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  width: 100vw;
  margin-left: calc(50% - 50vw);
  box-sizing: border-box;
}
.goal-detail-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  background: var(--color-border);
}
.goal-detail-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 var(--container-padding);
  max-width: 480px;
  margin: 0 auto;
  box-sizing: border-box;
  transition: max-width var(--breakpoint-transition), padding-left var(--breakpoint-transition), padding-right var(--breakpoint-transition);
}
.goal-detail-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  margin-right: auto;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius);
}
.goal-detail-back:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.goal-detail-back .ph {
  font-size: 1.5rem;
}
.goal-detail-title {
  position: absolute;
  left: 0;
  right: 0;
  margin: 0;
  pointer-events: none;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
}
.goal-detail-menu-wrap {
  flex-shrink: 0;
}
.goal-detail-menu {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
}
.goal-detail-header-spacer {
  width: 2.5rem;
  flex-shrink: 0;
}

/* Transactions: H1 in sticky bar, aligned with back (same row as original title) */
.transactions-page .goal-detail-header-inner .transactions-header-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  pointer-events: none;
  text-align: center;
  font-weight: 500;
}

.transactions-content {
  padding-top: var(--space-4);
}
.transactions-content .transaction-filters {
  margin-bottom: var(--space-3);
}
.transactions-content .goal-detail-search {
  margin-bottom: var(--space-4);
}

.goal-detail-content {
  padding-top: 0;
}
.goal-progress-section {
  text-align: center;
  margin-bottom: 0;
}

.goal-detail-hero {
  padding: var(--space-4) 0 2rem;
  margin-bottom: var(--space-4);
}
.goal-progress-arc-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 250px;
  margin: 0 auto;
}
.goal-progress-arc {
  width: 250px;
  height: auto;
  aspect-ratio: 250 / 160;
  display: block;
  flex-shrink: 0;
}
.goal-progress-arc-bg {
  stroke: #e5e7eb;
  stroke-width: 12;
}
.goal-progress-arc-fill {
  stroke: #5c69cf;
  stroke-width: 12;
}
/* Percentage, label, and amount sit inside the arc bowl (above the semicircle) — default large arc */
.goal-progress-center {
  margin-top: -75px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

/* Japan Trip (goal-detail): compact semicircle per Stack Overflow CC BY-SA 4.0 — https://stackoverflow.com/a/34828370 */
.goal-progress-arc-wrap--semicircle {
  --goal-progress-pct: 34;
  display: block;
  max-width: 100%;
}
.goal-progress-arc-wrap--semicircle .goal-progress-arc {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 10 / 8;
  margin: 0 auto;
}
.goal-progress-arc-wrap--semicircle .goal-progress-arc-bg {
  stroke: #e8f6fd;
  stroke-width: 0.78;
}
.goal-progress-arc-wrap--semicircle .goal-progress-arc-fill {
  stroke: #5c69cf;
  stroke-width: 0.8;
  stroke-dasharray: var(--goal-progress-pct) 100;
}
@media (prefers-reduced-motion: no-preference) {
  .goal-progress-arc-wrap--semicircle .goal-progress-arc-fill {
    animation: goal-progress-arc-draw 1.35s linear forwards;
  }
  @keyframes goal-progress-arc-draw {
    from {
      stroke-dasharray: 0 100;
    }
    to {
      stroke-dasharray: var(--goal-progress-pct) 100;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .goal-progress-arc-wrap--semicircle .goal-progress-arc-fill {
    animation: none;
  }
}
.goal-progress-arc-wrap--semicircle .goal-progress-center {
  position: absolute;
  left: 50%;
  bottom: 22%;
  transform: translateX(-50%);
  margin-top: 0;
  width: 90%;
  pointer-events: none;
  gap: 0.375rem;
}
.goal-progress-pct {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}
.goal-progress-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.goal-progress-amount {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1;
}
.goal-progress-savings {
  margin: 1.5rem 0 var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  text-align: center;
}
.goal-progress-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  margin-bottom: var(--space-4);
}
.goal-progress-actions .btn {
  flex: 1;
  max-width: 10rem;
}
.goal-target-date-wrap {
  position: relative;
  margin-bottom: 0;
  padding-top: calc((var(--space-6) + var(--space-8)) / 2);
}
.goal-target-date-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
@media (max-width: 767px) {
  .goal-target-date-input {
    width: 100%;
    height: 100%;
    inset: 0;
    pointer-events: auto;
    z-index: 1;
    cursor: pointer;
  }
  .goal-target-date-input::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
  }
}
.goal-target-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-4) var(--space-4);
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: #fff;
  font-size: var(--text-base);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  position: relative;
  z-index: 0;
}
.goal-target-date:hover {
  border-color: var(--color-border);
  background: var(--color-surface);
}
.goal-target-label {
  color: var(--color-text);
  font-weight: 500;
}
.goal-target-value {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: #888;
}
.goal-target-value .ph {
  font-size: 1.125rem;
  color: #888;
}
@media (max-width: 767px) {
  .goal-target-date-wrap {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
  }
}
@media (min-width: 768px) {
  .goal-target-date-wrap {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
  }
  .goal-detail-badges {
    margin-top: 0;
  }
  .goal-target-date {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
  }
  .goal-target-date:hover {
    background: transparent;
  }
  .goal-target-date-input {
    width: 0;
    height: 0;
    pointer-events: none;
  }
  .goal-target-date-btn {
    cursor: default;
  }
  .goal-target-value {
    color: var(--color-text);
  }
  .goal-target-value .ph {
    color: var(--color-icon);
  }
}

/* Goal detail (Japan) – Figma design for tablet (768px+) and desktop (1024px+) */
@media (min-width: 768px) {
  .goal-detail-page .goal-detail-header-inner {
    min-height: 3.125rem;
    padding-top: 0.66rem;
    padding-bottom: 0.66rem;
    align-items: center;
  }
  .goal-detail-page .goal-detail-back {
    width: 30px;
    height: 30px;
  }
  .goal-detail-page .goal-detail-back .ph {
    font-size: 1.5rem;
  }
  .goal-detail-page .goal-detail-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 500;
    line-height: 22px;
    color: #202437;
  }
  .goal-detail-page .goal-detail-menu {
    width: 30px;
    height: 30px;
  }
  .goal-detail-page .goal-detail-hero {
    padding: 0 0 1.25rem;
  }
  .goal-detail-page .goal-progress-arc-wrap:not(.goal-progress-arc-wrap--semicircle) {
    width: 317px;
    margin-left: auto;
    margin-right: auto;
  }
  .goal-detail-page .goal-progress-arc-wrap--semicircle {
    width: min(317px, 100%);
    margin-left: auto;
    margin-right: auto;
  }
  .goal-detail-page .goal-progress-arc-wrap:not(.goal-progress-arc-wrap--semicircle) .goal-progress-arc {
    width: 317px;
    height: auto;
    aspect-ratio: 250 / 160;
  }
  .goal-detail-page .goal-progress-arc-wrap--semicircle .goal-progress-arc {
    width: 100%;
    max-width: 240px;
    aspect-ratio: 10 / 8;
  }
  .goal-detail-page .goal-progress-arc-wrap:not(.goal-progress-arc-wrap--semicircle) .goal-progress-center {
    margin-top: -5rem;
    gap: 0.15rem;
  }
  .goal-detail-page .goal-progress-arc-wrap--semicircle .goal-progress-center {
    margin-top: 0;
    bottom: 20%;
    gap: 0.375rem;
  }
  .goal-detail-page .goal-progress-pct {
    font-family: var(--font-sans);
    font-size: 40px;
    font-weight: 600;
    line-height: 1;
    color: #202437;
  }
  .goal-detail-page .goal-progress-label {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 400;
    color: #585858;
  }
  .goal-detail-page .goal-progress-amount {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 600;
    color: #202437;
  }
  .goal-detail-page .goal-progress-savings {
    margin: 0.5rem 0 1.25rem;
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 400;
    color: #202437;
  }
}

@media (min-width: 1024px) {
  .goal-detail-page .goal-progress-arc-wrap:not(.goal-progress-arc-wrap--semicircle) {
    width: 317px;
  }
  .goal-detail-page .goal-progress-arc-wrap--semicircle {
    width: min(317px, 100%);
  }
  .goal-detail-page .goal-progress-arc-wrap:not(.goal-progress-arc-wrap--semicircle) .goal-progress-arc {
    width: 317px;
    height: auto;
    aspect-ratio: 250 / 160;
  }
  .goal-detail-page .goal-progress-arc-wrap--semicircle .goal-progress-arc {
    max-width: 260px;
  }
  .goal-detail-page .goal-progress-arc-wrap:not(.goal-progress-arc-wrap--semicircle) .goal-progress-center {
    margin-top: -5rem;
  }
  .goal-detail-page .goal-progress-arc-wrap--semicircle .goal-progress-center {
    margin-top: 0;
    bottom: 20%;
    gap: 0.375rem;
  }
  /* Desktop: nudge target date down slightly (between the header stroke and section stroke) */
  .goal-detail-page .goal-target-date {
    position: relative;
    top: 4px;
  }
}

.goal-detail-badges {
  margin-bottom: var(--space-8);
  margin-top: var(--space-8);
  position: relative;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}
.goal-detail-page .goal-detail-badges {
  background: transparent;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  box-shadow: none;
}
@media (max-width: 767px) {
  .goal-detail-badges {
    border-top: none;
    margin-top: var(--space-4);
  }
}
.goal-detail-badges-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.goal-detail-badges-header .section-heading {
  margin: 0;
}
.goal-detail-badges-header .link-view-all {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.goal-detail-badges-expanded {
  display: none;
  margin-top: 0;
  padding-top: var(--space-4);
}
.goal-detail-badges--expanded .goal-detail-badges-expanded {
  display: block;
}
.goal-detail-badges-list--expanded {
  flex-wrap: wrap;
  justify-content: flex-start;
  overflow-x: visible;
  margin-bottom: 0;
}
.goal-detail-badges-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: var(--space-2);
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-4);
}
@media (max-width: 767px) {
  .goal-detail-badges-list {
    justify-content: center;
    align-items: flex-start;
    gap: 1.5rem;
    overflow-x: visible;
  }
  /* Mobile: three badges = 1st, 2nd (center, larger), 4th (next locked, right); sizes -25%; labels 18px max */
  .goal-detail-badges-list .badge-card-wrap:nth-child(3) {
    display: none;
  }
  .goal-detail-badges-list .badge-card-wrap:nth-child(n+5) {
    display: none;
  }
  .goal-detail-badges-list .badge-card-wrap:nth-child(1),
  .goal-detail-badges-list .badge-card-wrap:nth-child(4) {
    margin-top: 0;
    /* Keep left/right badges symmetric even if labels differ in length */
    flex: 0 0 96px;
    width: 96px;
  }
  .goal-detail-badges-list .badge-card-wrap:nth-child(4) {
    transform: translateY(-4px);
  }
  .goal-detail-badges-list .badge-card-wrap:nth-child(2) {
    flex: 0 0 96px;
    width: 96px;
  }
  .goal-detail-badges-list .badge-card-wrap:nth-child(1) .badge-card,
  .goal-detail-badges-list .badge-card-wrap:nth-child(4) .badge-card {
    opacity: 0.9;
    transform: scale(0.9);
    min-width: 84px;
    min-height: 96px;
    padding: 0.6rem 0.525rem;
  }
  .goal-detail-badges-list .badge-card-wrap:nth-child(1) .badge-card .badge-card-icon,
  .goal-detail-badges-list .badge-card-wrap:nth-child(4) .badge-card .badge-card-icon,
  .goal-detail-badges-list .badge-card-wrap:nth-child(1) .badge-card .badge-card-lock,
  .goal-detail-badges-list .badge-card-wrap:nth-child(4) .badge-card .badge-card-lock {
    width: 2.625rem;
    height: 2.625rem;
    font-size: 1.5rem;
  }
  .goal-detail-badges-list .badge-card-wrap:nth-child(2) {
    gap: 1rem;
  }
  .goal-detail-badges-list .badge-card-wrap:nth-child(2) .badge-card {
    transform: scale(1.08);
    min-width: 96px;
    min-height: 108px;
    padding: 0.75rem 0.675rem;
  }
  .goal-detail-badges-list .badge-card-wrap:nth-child(2) .badge-card .badge-card-icon,
  .goal-detail-badges-list .badge-card-wrap:nth-child(2) .badge-card .badge-card-lock {
    width: 3rem;
    height: 3rem;
    font-size: 1.6875rem;
  }
  .goal-detail-badges-list .badge-card-wrap:nth-child(1) .badge-card-label,
  .goal-detail-badges-list .badge-card-wrap:nth-child(4) .badge-card-label,
  .goal-detail-badges-list .badge-card-wrap:nth-child(2) .badge-card-label {
    font-size: 14px;
    max-width: 96px;
  }
}
.goal-detail-badges-list .badge-card {
  flex-shrink: 0;
}
.badge-card--tablet-up {
  display: none;
}
.badge-card--desktop-only {
  display: none;
}
.goal-detail-badges-list .badge-card-wrap:has(.badge-card--tablet-up),
.goal-detail-badges-list .badge-card-wrap:has(.badge-card--desktop-only) {
  display: none;
}
.badges-section .badges-list--cards .badge-card-wrap:has(.badge-card--desktop-only) {
  display: none;
}
/* Goal detail pages: tablet + desktop same badge size; mobile uses three-badge layout (767px block) */
@media (min-width: 768px) {
  .goal-detail-page .goal-detail-badges-list .badge-card:not(.badge-card--featured) {
    opacity: 1;
    transform: none;
  }
  .goal-detail-page .goal-detail-badges-list .badge-card,
  .goal-detail-page .goal-detail-badges-list .badge-card--featured {
    width: 84px;
    min-width: 84px;
    min-height: 96px;
    padding: 0.6rem 0.525rem;
    box-sizing: border-box;
  }
  .goal-detail-page .goal-detail-badges-list .badge-card .badge-card-icon,
  .goal-detail-page .goal-detail-badges-list .badge-card--featured .badge-card-icon {
    width: 2.625rem;
    height: 2.625rem;
    font-size: 1.5rem;
  }
  .goal-detail-page .goal-detail-badges-list .badge-card-label,
  .goal-detail-page .goal-detail-badges-list .badge-card--featured .badge-card-label {
    font-size: 14px;
    max-width: 96px;
    text-align: center;
  }
  .goal-detail-page .goal-detail-badges-list .badge-card--locked .badge-card-lock {
    width: 2.625rem;
    height: 2.625rem;
    font-size: 1.5rem;
  }
  .goal-detail-page .goal-detail-badges-list .badge-card-wrap {
    align-items: center;
    justify-content: flex-start;
  }
}
@media (min-width: 768px) {
  .goal-detail-badges-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }
  .goal-detail-badges-list .badge-card {
    width: 84px;
    min-width: 84px;
    border-width: 2px;
  }
  .badge-card--tablet-up {
    display: flex;
  }
  .goal-detail-badges-list .badge-card-wrap:has(.badge-card--tablet-up) {
    display: flex;
  }
}
@media (min-width: 1024px) {
  .badge-card--desktop-only {
    display: flex;
  }
  .goal-detail-badges-list .badge-card-wrap:has(.badge-card--desktop-only) {
    display: flex;
  }
  .badges-section .badges-list--cards .badge-card-wrap:has(.badge-card--desktop-only) {
    display: flex;
  }
}
.badge-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.badge-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.45rem;
  min-width: 64px;
  min-height: 72px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

/* Earned badges: hexagonal shape, thick border, 3D + glossy */
.badge-card:not(.badge-card--locked) {
  border-radius: 0;
  background: transparent;
  border: none;
  /* Flat-top hexagon */
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  box-shadow: 4px 5px 14px rgba(0, 0, 0, 0.18);
}
/* Thick border (outer hexagon) – darker, with 3D bevel on bottom-right */
.badge-card:not(.badge-card--locked)::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, transparent 40%, transparent 60%, rgba(0, 0, 0, 0.2) 100%), #34b5bc;
  z-index: 0;
  pointer-events: none;
}
/* Inner fill (teal) + glossy highlight top-left */
.badge-card:not(.badge-card--locked)::after {
  content: "";
  position: absolute;
  inset: 6%;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.25) 22%, transparent 48%, rgba(0, 0, 0, 0.06) 100%), #ABEAED;
  z-index: 1;
  pointer-events: none;
}
/* Circle = border color (teal) */
.badge-card-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid #34b5bc;
  color: #228a8e;
  background: rgba(57, 194, 201, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.badge-card-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text);
  text-align: center;
  line-height: 1.2;
  max-width: 72px;
}
/* Featured “Building Momentum” — teal / blue */
.badge-card--featured:not(.badge-card--featured-safety) {
  box-shadow: 5px 7px 20px rgba(20, 100, 120, 0.22), 0 0 0 1px rgba(42, 139, 168, 0.28);
}
.badge-card--featured:not(.badge-card--featured-safety)::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, transparent 38%, transparent 62%, rgba(0, 0, 0, 0.18) 100%), #1d7a94;
}
.badge-card--featured:not(.badge-card--featured-safety)::after {
  inset: 6%;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.32) 24%, transparent 50%, rgba(0, 0, 0, 0.05) 100%), #c8eaf2;
}
.badge-card--featured:not(.badge-card--featured-safety) .badge-card-icon {
  border-color: #156b82;
  background: rgba(52, 181, 188, 0.32);
  color: #0d5668;
}
.badge-card-wrap:has(.badge-card--featured:not(.badge-card--featured-safety)) .badge-card-label {
  font-weight: 600;
}

/* Featured “safety” — steel / silver */
.badge-card--featured.badge-card--featured-safety {
  box-shadow: 5px 7px 20px rgba(30, 50, 70, 0.18), 0 0 0 1px rgba(90, 120, 150, 0.2);
}
.badge-card--featured.badge-card--featured-safety::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, transparent 40%, transparent 60%, rgba(0, 0, 0, 0.22) 100%), #3d5568;
}
.badge-card--featured.badge-card--featured-safety::after {
  inset: 6%;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.52) 0%, rgba(255, 255, 255, 0.22) 25%, transparent 50%, rgba(0, 0, 0, 0.05) 100%), #d8e4ed;
}
.badge-card--featured.badge-card--featured-safety .badge-card-icon {
  border-color: #2c4254;
  background: rgba(61, 85, 104, 0.2);
  color: #1e3244;
}
.badge-card-wrap:has(.badge-card--featured-safety) .badge-card-label {
  font-weight: 600;
}

/* Tier: sapphire */
.badge-card--sapphire:not(.badge-card--locked)::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 40%, transparent 60%, rgba(0, 0, 0, 0.22) 100%), #2658a0;
}
.badge-card--sapphire:not(.badge-card--locked)::after {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.22) 22%, transparent 48%, rgba(0, 0, 0, 0.06) 100%), #b0cff5;
}
.badge-card--sapphire .badge-card-icon {
  border-color: #2658a0;
  background: rgba(38, 88, 160, 0.18);
  color: #153a72;
}

/* Tier: forest */
.badge-card--forest:not(.badge-card--locked)::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 40%, transparent 60%, rgba(0, 0, 0, 0.2) 100%), #1d7a5c;
}
.badge-card--forest:not(.badge-card--locked)::after {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.24) 22%, transparent 48%, rgba(0, 0, 0, 0.05) 100%), #a8e8d4;
}
.badge-card--forest .badge-card-icon {
  border-color: #1d7a5c;
  background: rgba(29, 122, 92, 0.18);
  color: #0f523d;
}

/* Tier: indigo */
.badge-card--indigo:not(.badge-card--locked)::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 40%, transparent 60%, rgba(0, 0, 0, 0.22) 100%), #3f4d8f;
}
.badge-card--indigo:not(.badge-card--locked)::after {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.22) 22%, transparent 48%, rgba(0, 0, 0, 0.06) 100%), #c5cbf0;
}
.badge-card--indigo .badge-card-icon {
  border-color: #3f4d8f;
  background: rgba(63, 77, 143, 0.18);
  color: #283066;
}

/* Locked badges: flat grey, no gloss */
.badge-card--locked {
  border-radius: 0;
  background: transparent;
  border: none;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.1);
}
.badge-card--locked::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: #b8b5b5;
  z-index: 0;
  pointer-events: none;
}
.badge-card--locked::after {
  content: "";
  position: absolute;
  inset: 6%;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: #E8E6E6;
  z-index: 1;
  pointer-events: none;
}
.badge-card--locked .badge-card-icon {
  display: none;
}
.badge-card-wrap:has(.badge-card--locked) .badge-card-label {
  color: #b8b5b5;
}
.badge-card-lock {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  color: #888;
  font-size: 1.5rem;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.badge-card-lock.ph {
  font-size: 1.5rem;
}

@media (min-width: 1024px) {
  /* Desktop: make locked badge shadow match earned badges (so spacing feels consistent) */
  .badges-section .badge-card--locked {
    box-shadow: 4px 5px 14px rgba(0, 0, 0, 0.18);
  }
  .goal-detail-page .goal-detail-badges-list .badge-card--locked {
    box-shadow: 4px 5px 14px rgba(0, 0, 0, 0.18);
  }
  /* Slightly more space between consecutive locked badges in the horizontal strip */
  .badges-section .badges-list--cards .badge-card-wrap:has(.badge-card--locked) + .badge-card-wrap:has(.badge-card--locked),
  .goal-detail-page .goal-detail-badges-list .badge-card-wrap:has(.badge-card--locked) + .badge-card-wrap:has(.badge-card--locked) {
    margin-left: 0.5rem;
  }
}

@media (max-width: 767px) {
  .goal-detail-badges-list .badge-card {
    min-width: 56px;
    min-height: 64px;
    padding: 0.4rem 0.35rem;
  }
  .goal-detail-badges-list .badge-card .badge-card-icon {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1rem;
  }
  .goal-detail-badges-list .badge-card-label {
    font-size: 0.625rem;
    max-width: 64px;
  }
}
.badge-next-wrap {
  margin-top: 0;
}
.goals-page .badges-section .badge-next-wrap {
  margin-top: var(--space-4);
}
.badge-next-bar {
  height: 10px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: var(--space-2);
}
@media (min-width: 768px) {
  .badge-next-bar {
    height: 14px;
  }
}
/* ----- Savings Growth card: DESKTOP (Figma node 3149-6619) ----- */
@media (min-width: 1024px) {
  body.dashboard .growth-card {
    padding: 25px;
    border-radius: 20px;
    border: 1px solid #d8dde5;
    box-shadow: 0 7px 15px rgba(118, 117, 117, 0.05);
    display: flex;
    flex-direction: column;
    gap: 30.5px;
    align-items: flex-end;
  }
  body.dashboard .growth-card .growth-header {
    width: 100%;
    margin-bottom: 0;
  }
  body.dashboard .growth-card .growth-header .card-label {
    font-family: var(--font-sans);
    font-size: 20px;
    font-weight: 500;
    color: var(--color-text);
  }
  body.dashboard .growth-card .growth-filters .filter-btn {
    font-size: var(--text-base);
    font-weight: 500;
  }
  body.dashboard .growth-card .growth-filters .filter-btn[aria-selected="true"] {
    font-weight: 600;
    color: #404993;
  }
  body.dashboard .growth-card .chart-y-labels,
  body.dashboard .growth-card .chart-months {
    font-size: var(--text-base);
    font-weight: 500;
    color: #202437;
  }
}
.badge-next-fill {
  display: block;
  height: 100%;
  background: #34b5bc;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.badge-next-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.badge-next-label,
.badge-next-name,
.badge-next-pct {
  margin: 0;
}

.goal-detail-transactions .section-heading {
  margin-bottom: var(--space-3);
}
.goal-detail-transactions .transaction-filters {
  margin-bottom: var(--space-3);
}
.goal-detail-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-sizing: border-box;
  min-height: var(--transaction-search-row-height);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.goal-detail-search .ph {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.goal-detail-search-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.25;
  border: none;
  background: none;
  color: var(--color-text);
}
.goal-detail-search-input::placeholder {
  color: var(--color-text-muted);
}
.goal-detail-search-input:focus {
  outline: none;
}
.goal-detail-transactions .link-view-all {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: var(--space-4) auto 0;
  text-align: center;
}

.link-view-all {
  display: inline-block;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: underline;
  margin-top: var(--space-2);
}
.link-view-all:hover {
  color: var(--color-primary-hover);
}

/* Course cards */
.course-card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}
.course-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.course-card .course-header,
.course-card .course-progress-row,
.course-card .progress-bar,
.course-card .course-footer {
  position: relative;
  z-index: 0;
  pointer-events: none;
}
.course-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.course-icon-wrap {
  display: flex;
  align-items: center;
  font-size: 20px;
  line-height: 1.2;
  min-height: 1.2em;
  flex-shrink: 0;
}
.course-icon {
  width: 28px;
  height: 28px;
  font-size: 28px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-icon);
}
.course-title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text);
}
.course-desc {
  margin: 0;
  margin-top: var(--space-1);
  margin-left: calc(-1 * (28px + var(--space-3)));
  width: calc(100% + 28px + var(--space-3));
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  text-align: left;
}
.course-progress-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-1);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text-muted);
}
.course-progress-pct {
  font-weight: 600;
  color: var(--color-text);
}
.course-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-4);
}
.course-duration {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text-muted);
}

/* ----- Mobile: consistent spacing (20px related, 25px differing) ----- */
@media (max-width: 767px) {
  body.dashboard .dashboard-main {
    padding-top: var(--space-between);
    padding-bottom: var(--space-between);
  }
  body.dashboard .welcome {
    margin-bottom: var(--space-between);
  }
  body.dashboard .card {
    margin-bottom: var(--space-between);
  }
  body.dashboard .savings-card-top {
    margin-bottom: var(--space-related);
  }
  body.dashboard .growth-header {
    margin-bottom: var(--space-related);
  }
  /* Savings Growth card mobile – Figma node 3149-5161 */
  body.dashboard .growth-card {
    padding: 19px 24px;
    border-radius: 20px;
    border: 1px solid #d8dce5;
    box-shadow: 0 7px 15px rgba(118, 117, 117, 0.05);
    display: flex;
    flex-direction: column;
    gap: 22px;
  }
  body.dashboard .growth-card .growth-header {
    margin-bottom: 0;
  }
  body.dashboard .growth-card .growth-header .card-label {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 500;
    color: #202437;
  }
  body.dashboard .growth-card .growth-filters .filter-btn {
    font-size: 18px;
    font-weight: 500;
    color: #585858;
  }
  body.dashboard .growth-card .growth-filters .filter-btn[aria-selected="true"] {
    font-weight: 600;
    color: #404993;
  }
  body.dashboard .growth-card .chart-y-labels,
  body.dashboard .growth-card .chart-months {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 500;
    color: #202437;
  }
  body.dashboard .section-heading-row {
    margin-bottom: var(--space-related);
  }
  body.dashboard .goals-section,
  body.dashboard .courses-section {
    margin-bottom: var(--space-between);
  }
  body.dashboard .growth-card + .goals-section {
    margin-top: var(--space-between);
  }
  body.dashboard .goal-card {
    margin-bottom: var(--space-related);
  }
  body.dashboard .goal-header {
    margin-bottom: var(--space-related);
  }
  body.dashboard .goal-meta {
    margin-bottom: var(--space-related);
  }
  body.dashboard .progress-bar {
    margin-bottom: var(--space-related);
  }
  body.dashboard .goal-message {
    margin-top: var(--space-related);
  }
  body.dashboard .course-card {
    margin-bottom: var(--space-related);
  }
  body.dashboard .course-header {
    margin-bottom: var(--space-3);
  }
  body.dashboard .course-footer {
    margin-top: var(--space-2);
  }
  body.dashboard .course-progress-row {
    margin-bottom: var(--space-2);
  }
  body.dashboard .course-card .progress-bar {
    margin-bottom: var(--space-2);
  }
  .goals-page .goals-hero {
    margin-bottom: var(--space-between);
  }
  .goals-page .goals-subtitle {
    margin-bottom: var(--space-related);
  }
  .goals-page .goals-list {
    margin-bottom: var(--space-between);
  }
  .learn-page .learn-hero {
    margin-bottom: var(--space-between);
  }
  .learn-page .learn-subtitle {
    margin-bottom: var(--space-related);
  }
  .learn-page .courses-section {
    margin-bottom: var(--space-between);
  }
  .activity-page .activity-hero {
    margin-bottom: var(--space-between);
  }
  .activity-page .activity-subtitle {
    margin-bottom: var(--space-related);
  }
  body.dashboard .badges-section {
    padding-top: var(--space-between);
    margin-bottom: var(--space-between);
  }
  body.dashboard .badges-section-header {
    margin-bottom: var(--space-related);
  }
  body.dashboard .badges-section .badges-list--cards {
    margin-top: var(--space-related);
  }
  /* Goal detail (Japan) mobile – Figma node 3391-5438 */
  .goal-detail-page .goal-detail-header-inner {
    min-height: 3.125rem;
    height: auto;
    padding: 0.66rem 1.25rem;
    align-items: center;
  }
  .goal-detail-page .goal-detail-back {
    width: 30px;
    height: 30px;
  }
  .goal-detail-page .goal-detail-back .ph {
    font-size: 1.5rem;
  }
  .goal-detail-page .goal-detail-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 500;
    line-height: 22px;
    color: var(--color-text);
  }
  .goal-detail-page .goal-detail-menu {
    width: 30px;
    height: 30px;
  }
  .goal-detail-page .goal-detail-content {
    padding-top: 0;
  }
  .goal-detail-page .goal-detail-hero {
    padding: 0 0 1.25rem;
    margin-bottom: 0;
  }
  .goal-detail-page .goal-progress-arc-wrap:not(.goal-progress-arc-wrap--semicircle) {
    width: min(280px, calc(100vw - 2.5rem));
    max-width: 317px;
  }
  .goal-detail-page .goal-progress-arc-wrap--semicircle {
    width: min(280px, calc(100vw - 2.5rem));
    max-width: 317px;
  }
  .goal-detail-page .goal-progress-arc-wrap:not(.goal-progress-arc-wrap--semicircle) .goal-progress-arc {
    width: 100%;
    height: auto;
    aspect-ratio: 250 / 160;
  }
  .goal-detail-page .goal-progress-arc-wrap--semicircle .goal-progress-arc {
    max-width: 200px;
    aspect-ratio: 10 / 8;
  }
  .goal-detail-page .goal-progress-arc-wrap:not(.goal-progress-arc-wrap--semicircle) .goal-progress-center {
    margin-top: -4.4rem;
    gap: 0.15rem;
  }
  .goal-detail-page .goal-progress-arc-wrap--semicircle .goal-progress-center {
    margin-top: 0;
    bottom: 22%;
    gap: 0.375rem;
  }
  .goal-detail-page .goal-progress-pct {
    font-family: var(--font-sans);
    font-size: 40px;
    font-weight: 600;
    line-height: 1;
    color: #202437;
  }
  .goal-detail-page .goal-progress-label {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 400;
    color: #585858;
  }
  /* Japan Trip semicircle: smaller type inside arc on mobile */
  .goal-detail-page .goal-progress-arc-wrap--semicircle .goal-progress-pct {
    font-size: 1.75rem;
  }
  .goal-detail-page .goal-progress-arc-wrap--semicircle .goal-progress-label {
    font-size: 0.8125rem;
  }
  .goal-detail-page .goal-progress-amount {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 600;
    color: #202437;
  }
  .goal-detail-page .goal-progress-savings {
    margin: 0.5rem 0 1.25rem;
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 400;
    color: #202437;
  }
  .goal-detail-page .goal-progress-actions {
    gap: var(--space-2);
    margin-bottom: var(--space-between);
  }
  .goal-detail-page .goal-progress-actions .btn {
    max-width: none;
    padding: var(--space-2) var(--space-4);
  }
  .goal-detail-page .goal-target-date-wrap {
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
    margin-top: 0;
  }
  .goal-detail-page .goal-target-date {
    padding: var(--space-3) var(--space-4);
  }
  .goal-detail-page .goal-progress-section {
    margin-bottom: var(--space-between);
  }
  .goal-detail-page .goal-detail-badges {
    margin-top: 0;
    margin-bottom: var(--space-between);
  }
  .goal-detail-page .goal-detail-badges-header {
    margin-bottom: var(--space-related);
  }
  .goal-detail-page .badge-next-wrap {
    margin-top: var(--space-related);
  }
  /* Goal detail badges – same background as rest of page; stroke to separate from above/below */
  .goal-detail-page .goal-detail-badges {
    background: transparent;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    box-shadow: none;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
  .goal-detail-page .goal-detail-badges-header .section-heading {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 400;
    color: #202437;
  }
  .goal-detail-page .goal-detail-badges-header .link-view-all {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-primary);
  }
  .goal-detail-page .goal-detail-badges-list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    overflow-x: hidden;
  }
  .goal-detail-page .goal-detail-badges {
    overflow: hidden;
  }
  .goal-detail-page .goal-detail-badges-list .badge-card {
    width: 64px;
    min-width: 64px;
    min-height: 72px;
    padding: 0.5rem 0.45rem;
  }
  .goal-detail-page .goal-detail-badges-list .badge-card:not(.badge-card--locked) {
    box-shadow: 1px 4px 10px 2px rgba(57, 194, 201, 0.25);
  }
  .goal-detail-page .goal-detail-badges-list .badge-card:not(.badge-card--sapphire):not(.badge-card--forest):not(.badge-card--indigo):not(.badge-card--featured) .badge-card-icon {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1rem;
    border-color: #34b5bc;
    color: #228a8e;
    background: rgba(57, 194, 201, 0.2);
  }
  .goal-detail-page .goal-detail-badges-list .badge-card--sapphire .badge-card-icon,
  .goal-detail-page .goal-detail-badges-list .badge-card--forest .badge-card-icon,
  .goal-detail-page .goal-detail-badges-list .badge-card--indigo .badge-card-icon,
  .goal-detail-page .goal-detail-badges-list .badge-card--featured:not(.badge-card--featured-safety) .badge-card-icon,
  .goal-detail-page .goal-detail-badges-list .badge-card--featured-safety .badge-card-icon {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1rem;
  }
  .goal-detail-page .goal-detail-badges-list .badge-card--locked .badge-card-lock {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1rem;
    color: #888888;
  }
  .goal-detail-page .goal-detail-badges-list .badge-card-label {
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--color-text);
    letter-spacing: -0.02em;
    max-width: 64px;
  }
  .goal-detail-page .goal-detail-badges-list .badge-card:not(.badge-card--featured) {
    opacity: 1;
    transform: none;
  }
  .goal-detail-page .goal-detail-badges-list .badge-card--featured {
    min-width: 64px;
    padding: 0.5rem 0.45rem;
    border-width: 2px;
  }
  .goal-detail-page .goal-detail-badges-list .badge-card--featured .badge-card-icon {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1rem;
  }
  .goal-detail-page .goal-detail-badges-list .badge-card--featured .badge-card-label {
    font-size: 0.6875rem;
  }
  .goal-detail-page .badge-next-wrap {
    background: #fff;
    border-radius: 10px;
    box-shadow: none;
    padding: 1rem 1.25rem;
    min-height: 77px;
    box-sizing: border-box;
  }
  .goal-detail-page .badge-next-bar {
    height: 14px;
    background: #f0f0f0;
    border-radius: 90px;
    margin-bottom: 0.65rem;
  }
  .goal-detail-page .badge-next-fill {
    background: #34b5bc;
    border-radius: 90px;
  }
  .goal-detail-page .badge-next-label,
  .goal-detail-page .badge-next-name,
  .goal-detail-page .badge-next-pct {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 400;
    color: #585858;
    letter-spacing: -0.48px;
  }
  /* Goals page badges section: same progress bar card as goal-detail */
  .goals-page .badges-section .badge-next-wrap {
    background: #fff;
    border-radius: 10px;
    box-shadow: none;
    padding: 1rem 1.25rem;
    min-height: 77px;
    box-sizing: border-box;
    margin-top: var(--space-related);
  }
  .goals-page .badges-section .badge-next-bar {
    height: 14px;
    background: #f0f0f0;
    border-radius: 90px;
    margin-bottom: 0.65rem;
  }
  .goals-page .badges-section .badge-next-fill {
    background: #34b5bc;
    border-radius: 90px;
  }
  .goals-page .badges-section .badge-next-label,
  .goals-page .badges-section .badge-next-name,
  .goals-page .badges-section .badge-next-pct {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 400;
    color: #585858;
    letter-spacing: -0.48px;
  }
  .goal-detail-page .goal-detail-transactions {
    margin-top: var(--space-between);
  }
  .goal-detail-page .goal-detail-transactions .section-heading {
    margin-bottom: var(--space-related);
  }
  .course-module-page .course-module-back {
    margin-bottom: var(--space-between);
  }
  .course-module-page .course-module-header {
    margin-bottom: var(--space-between);
  }
  .course-module-page .course-module-content .course-module-lesson-title {
    margin-bottom: var(--space-related);
  }
  .course-module-page .course-module-text {
    margin-bottom: var(--space-related);
  }
  .course-module-page .course-module-heading {
    margin-top: var(--space-between);
    margin-bottom: var(--space-related);
  }
  .course-module-page .course-module-list {
    margin-bottom: var(--space-between);
  }
  .course-module-page .course-module-list li {
    margin-bottom: var(--space-related);
  }
  .course-module-page .course-module-actions {
    margin-top: var(--space-between);
    padding-top: var(--space-between);
  }
  .activity-page .expenses-card {
    margin-bottom: var(--space-between);
  }
  /* Mobile expenses card – Figma node 3408-5519 */
  .activity-page .expenses-card {
    padding: 20px;
    border-radius: 20px;
    border: 1px solid #d8dde5;
    box-shadow: 0 7px 15px rgba(118, 117, 117, 0.05);
  }
  .activity-page .expenses-card .growth-header {
    margin-bottom: 12px;
  }
  .activity-page .expenses-card .growth-header .card-label {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 500;
    color: #202437;
  }
  .activity-page .expenses-card .growth-filters .filter-btn {
    font-size: 18px;
    font-weight: 500;
    color: #585858;
  }
  .activity-page .expenses-card .growth-filters .filter-btn[aria-selected="true"] {
    font-weight: 600;
    color: #404993;
  }
  .activity-page .expenses-card .donut-chart-total {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 500;
    color: #202437;
  }
  .activity-page .expenses-card .donut-chart-amount {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 700;
    color: #202437;
  }
  .activity-page .expenses-card .expenses-legend {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 500;
  }
  .activity-page .expenses-card .expenses-legend-label {
    color: var(--color-text);
    font-weight: 500;
  }
  .activity-page .expenses-card .expenses-legend-pct {
    color: var(--color-text-muted);
    font-weight: 500;
  }
  .activity-page .expenses-card .expenses-legend-dot {
    width: 18px;
    height: 18px;
  }
  .activity-page .expenses-card .expenses-chart-row {
    gap: 30px;
    margin-top: 0;
  }
  .activity-page .expenses-card .expenses-legend {
    gap: 10px min(14px, 3.5vw);
    margin-bottom: 0;
    padding-inline: 0;
  }
  .activity-page .expenses-card .expenses-legend-item {
    gap: 8px;
  }
  .activity-page .transaction-list,
  .goal-detail-page .transaction-list,
  .transactions-page .transaction-list {
    gap: var(--space-related);
  }
  .transactions-page .transactions-content {
    padding-top: var(--space-between);
  }
  .transactions-page .transaction-filters,
  .goal-detail-page .goal-detail-transactions .transaction-filters {
    margin-bottom: var(--space-related);
  }
}

/* Activity expenses: narrow phones — drop % to keep legend inside card; ultra-narrow — one column */
@media (max-width: 420px) {
  .activity-page .expenses-card .expenses-legend-pct {
    display: none;
  }
}
@media (max-width: 340px) {
  .activity-page .expenses-card .expenses-legend {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
}

/* ----- Activity page ----- */
.activity-page .activity-hero {
  margin-bottom: var(--space-6);
}
.activity-title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text);
}
.activity-subtitle {
  margin: 0 0 var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text-muted);
}
.activity-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: var(--space-6);
}
.activity-stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.activity-stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.activity-stat-value {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}
.activity-stat-change {
  font-size: var(--text-sm);
  font-weight: 500;
}
.activity-stat-change--up {
  color: #059669;
}
/* Home: three mini-cards — equal width (1fr × 3) and equal height (row stretches to tallest card) */
.home-quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
  justify-items: stretch;
  margin-bottom: var(--space-6);
}
.home-quick-stats .activity-stat-card {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  align-self: stretch;
  align-items: flex-start;
  text-align: left;
  justify-content: flex-start;
}
.home-quick-stats .activity-stat-label {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.home-quick-stats .activity-stat-value {
  max-width: 100%;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
/* Mobile / tablet: short header; desktop: full label */
.home-quick-stats .activity-stat-card--goals-pct .activity-stat-label--goals-long {
  display: none;
}
.home-quick-stats .activity-stat-card--goals-pct .activity-stat-label--goals-short {
  display: block;
  font-size: var(--text-sm);
  line-height: 1.35;
  color: var(--color-text-muted);
}
@media (min-width: 1024px) {
  .home-quick-stats .activity-stat-card--goals-pct .activity-stat-label--goals-short {
    display: none;
  }
  .home-quick-stats .activity-stat-card--goals-pct .activity-stat-label--goals-long {
    display: block;
    font-size: var(--text-sm);
    line-height: 1.35;
    max-width: 100%;
    text-align: left;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
}

/* Mobile: slightly smaller mini-cards */
@media (max-width: 767px) {
  .home-quick-stats {
    gap: 16px;
  }
  .home-quick-stats .activity-stat-card {
    padding: 0.85rem;
    gap: 0.15rem;
  }
  .home-quick-stats .activity-stat-change {
    font-size: calc(var(--text-sm) * 0.85);
  }
}

.activity-page .expenses-card {
  margin-bottom: var(--space-6);
}
.expenses-card .growth-header .card-label {
  color: #202437;
  font-family: var(--font-sans);
  font-weight: 500;
}
.activity-page .expenses-card {
  border-radius: 20px;
}
.growth-card .growth-header .card-label {
  color: #202437;
}
.expenses-chart-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
  margin-top: var(--space-5);
  min-height: 220px;
}
/* Mobile / tablet: center donut; tight vertical rhythm (no min-height slack around legend) */
@media (max-width: 1023px) {
  .expenses-card .expenses-chart-row {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 30px;
    margin-top: var(--space-1);
    min-height: 0;
  }
  .expenses-card .donut-chart-wrap {
    margin-left: 0;
    margin-right: 0;
    min-height: 0;
  }
  .expenses-card .expenses-legend {
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 0;
    gap: var(--space-2) min(1rem, 3vw);
    align-content: start;
    width: 100%;
    max-width: 100%;
    flex: 0 1 auto;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
  }
  .expenses-card .expenses-legend-item {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .expenses-card .expenses-legend-label {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
  }
  .expenses-card .expenses-legend-pct {
    flex-shrink: 0;
  }
  /* Top-spender “!” badge: desktop only — too cramped in stacked legend */
  .activity-page .expenses-card .expenses-legend-top-icon {
    display: none;
  }
}
.expenses-card .donut-chart-wrap {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.expenses-legend {
  list-style: none;
  margin: 0;
  margin-left: var(--space-10);
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  flex: 1 1 240px;
  min-width: 200px;
  align-content: center;
}
.expenses-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.expenses-legend-label {
  color: var(--color-text);
}
.expenses-legend-pct {
  display: inline-block;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.expenses-legend-top-icon {
  --expenses-top-accent: #ddb82e; /* gold: matches stroke + !, slightly brighter than #c9a227 */
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 9999px;
  box-sizing: border-box;
  background: #f9fafb;
  border: 1px solid var(--expenses-top-accent);
  cursor: help;
  flex-shrink: 0;
}
.expenses-legend-top-icon .ph {
  font-size: 12px;
}
.expenses-legend-top-bang {
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  color: var(--expenses-top-accent);
}
.expenses-legend-top-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  color: #202437;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  padding: 8px 10px;
  border-radius: 10px;
  white-space: nowrap;
  z-index: 30;
}
.expenses-legend-top-icon:hover .expenses-legend-top-tooltip,
.expenses-legend-top-icon:focus .expenses-legend-top-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.expenses-legend-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  /*
   * Equal “gutter” outside donut vs outside legend: flex+space-between + flex:1 legend
   * left a wide empty band on the right; split leftover space with 1fr | donut | legend | 1fr.
   */
  .activity-page .expenses-card .expenses-chart-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr);
    column-gap: 20px;
    align-items: center;
    justify-content: stretch;
  }
  .activity-page .expenses-card .donut-chart-wrap {
    grid-column: 2;
    justify-self: end;
    min-height: 220px;
  }
  .activity-page .expenses-card .expenses-legend {
    grid-column: 3;
    /* Extra space after column-gap; 1fr side gutters stay matched */
    margin-left: 36px;
    flex: none;
    min-width: 0;
    justify-self: start;
    gap: 22px 3.25rem;
  }
}
.donut-chart-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  flex-shrink: 0;
}
.expenses-card .donut-chart {
  width: 200px;
  height: 200px;
}
.donut-chart {
  width: 160px;
  height: 160px;
}
.donut-chart svg {
  width: 100%;
  height: 100%;
}
.donut-chart-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.donut-chart-total {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.donut-chart-amount {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
}
.transactions-section {
  margin-bottom: var(--space-6);
}
.transaction-filters {
  display: flex;
  align-items: stretch;
  gap: 0;
  box-sizing: border-box;
  min-height: var(--transaction-search-row-height);
  margin-bottom: var(--space-4);
  padding: var(--space-1);
  background: #e9e9e9;
  border-radius: 9999px;
  width: 100%;
  max-width: 100%;
}
.transaction-filters .filter-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 var(--space-4);
  font-size: var(--text-base);
  line-height: 1.25;
  font-weight: 400;
  color: #666666;
  background: transparent;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, font-weight 0.2s;
}
.transaction-filters .filter-btn:hover {
  color: #555;
}
.transaction-filters .filter-btn[aria-selected="true"] {
  color: #333333;
  font-weight: 500;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.transaction-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.transaction-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}
.transaction-card:last-child {
  border-bottom: none;
}
.transaction-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.transaction-detail {
  flex: 1;
  min-width: 0;
}
.transaction-name {
  font-weight: 600;
  color: var(--color-text);
}
.transaction-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.transaction-date,
.transaction-purchase {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.transaction-date .ph {
  font-size: 1rem;
  color: var(--color-text-muted);
}
.transaction-amount-row .ph {
  font-size: 1rem;
  color: #059669;
  display: inline-block;
  transform: rotate(45deg);
}
.transaction-amount-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.transaction-right {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
}
.transaction-amount {
  font-weight: 600;
  color: var(--color-text);
}
.transaction-type {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.transaction-card--hidden {
  display: none !important;
}

/* Activity / Goal detail / Transactions: mobile activity card (white card, rounded, light blue icon) */
.activity-page .transaction-card,
.goal-detail-page .transaction-card,
.transactions-page .transaction-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  border-bottom: none;
  box-shadow: var(--shadow);
}
.activity-page .transaction-icon,
.goal-detail-page .transaction-icon,
.transactions-page .transaction-icon {
  background: #DDE6F9;
  color: #5F70B3;
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
}
.activity-page .transaction-name,
.goal-detail-page .transaction-name,
.transactions-page .transaction-name {
  font-weight: 700;
}

/* Activity / Goal detail: desktop (larger card padding and icon) */
@media (min-width: 1024px) {
  .activity-page .transaction-list,
  .goal-detail-page .transaction-list,
  .transactions-page .transaction-list {
    gap: var(--space-4);
  }
  .activity-page .transaction-card,
  .goal-detail-page .transaction-card,
  .transactions-page .transaction-card {
    padding: var(--space-4) var(--space-6);
  }
  .activity-page .transaction-icon,
  .goal-detail-page .transaction-icon,
  .transactions-page .transaction-icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  .activity-page .transaction-name,
  .goal-detail-page .transaction-name,
  .transactions-page .transaction-name {
    font-size: 1.125rem;
  }
}

/* ----- Learn page ----- */
.learn-page .learn-hero {
  margin-bottom: var(--space-6);
}
.learn-title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text);
}
.learn-subtitle {
  margin: 0 0 var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text-muted);
}
.learn-page .courses-section {
  margin-bottom: var(--space-8);
}

/* ----- Course module (lesson) page ----- */
.course-module-page .learn-hero {
  display: none;
}
.course-module-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
}
.course-module-back:hover {
  color: var(--color-primary);
}
.course-module-back .ph {
  font-size: 1.25rem;
}
.course-module-header {
  margin-bottom: var(--space-6);
}
.course-module-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-3);
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 1.5rem;
}
.course-module-title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text);
}
.course-module-desc {
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
  color: var(--color-text-muted);
}
.course-module-meta {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.course-module-content.card {
  padding: var(--space-6);
}
.course-module-lesson-title {
  margin: 0 0 var(--space-4);
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
}
.course-module-text {
  margin: 0 0 var(--space-4);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
}
.course-module-heading {
  margin: var(--space-6) 0 var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}
.course-module-list {
  margin: 0 0 var(--space-6);
  padding-left: 1.25rem;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
}
.course-module-list li {
  margin-bottom: var(--space-2);
}
.course-module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}
.course-module-actions .btn {
  text-decoration: none;
}

/* ----- App footer (two-tier, Acorns-style) ----- */
.app-footer {
  position: relative;
  background: #fff;
  padding: var(--space-10) var(--container-padding) var(--space-8);
  margin-top: var(--space-10);
}
.app-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  background: var(--color-border);
}
.app-footer-inner {
  max-width: 480px;
  margin: 0 auto;
}
.app-footer-top {
  margin-bottom: var(--space-12);
}
.app-footer-contact-heading {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--space-3);
}
.app-footer-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.25;
  min-height: var(--btn-height);
  box-sizing: border-box;
  background: #4C56B6;
  border-color: #4C56B6;
  color: #fff;
}
.app-footer-contact-btn:hover {
  background: #3d46a0;
  border-color: #3d46a0;
  color: #fff;
}
.app-footer-columns {
  display: grid;
  grid-template-columns: auto auto;
  gap: var(--space-6) var(--space-16);
  margin-top: var(--space-8);
  justify-content: start;
}
.app-footer-col-heading {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-text);
  margin: 0 0 var(--space-3);
  text-transform: uppercase;
}
.app-footer-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.app-footer-col-list li {
  margin-bottom: var(--space-2);
}
.app-footer-col-list a {
  font-size: var(--text-base);
  color: var(--color-text);
  text-decoration: none;
}
.app-footer-col-list a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}
.app-footer-bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: flex-start;
}
.app-footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}
.app-footer-legal a {
  color: var(--color-text);
  text-decoration: none;
}
.app-footer-legal a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}
.app-footer-social {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}
.app-footer-social a {
  color: #4C56B6;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.app-footer-social a:hover {
  color: #3d46a0;
}
.app-footer-social .ph {
  font-size: 1.5rem;
}

@media (min-width: 768px) {
  .app-footer-inner {
    max-width: 720px;
  }
  .app-footer-top {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-10);
    align-items: start;
  }
  .app-footer-columns {
    margin-top: 0;
    margin-left: auto;
    grid-template-columns: auto auto;
    gap: 100px;
    justify-content: end;
  }
  .app-footer-col:last-child {
    text-align: right;
  }
  .app-footer-col:last-child .app-footer-col-list {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }
  .app-footer-bottom {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
  }
  .app-footer-legal {
    order: 1;
    flex: 1;
    justify-content: center;
    min-width: 200px;
  }
  .app-footer-social {
    order: 2;
  }
}

@media (min-width: 1024px) {
  .app-footer {
    padding-left: 0;
    padding-right: 0;
    margin-top: var(--space-12);
  }
  .app-footer-inner {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
  }
  .app-footer-top {
    gap: 3rem;
    margin-bottom: var(--space-16);
  }
  .app-footer-columns {
    gap: 8rem;
  }
}

/* Bottom nav – liquid glass, floating slightly off bottom */
.bottom-nav {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 4rem;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1.75rem;
  padding: var(--space-2) var(--space-2);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 40;
  transition: transform var(--breakpoint-transition);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
  flex: 1;
  max-width: 5rem;
}
.bottom-nav-item .bottom-nav-icon:not(.bottom-nav-icon--fill) {
  color: var(--color-icon);
}
.bottom-nav-item .bottom-nav-icon--fill {
  display: none;
}
.bottom-nav-item:hover {
  color: var(--color-primary);
}
.bottom-nav-item:hover .bottom-nav-icon:not(.bottom-nav-icon--fill) {
  color: var(--color-primary);
}
.bottom-nav-item--active {
  color: var(--color-primary);
  font-weight: 700;
}
.bottom-nav-item--active .bottom-nav-icon:not(.bottom-nav-icon--fill) {
  display: none;
}
.bottom-nav-item--active .bottom-nav-icon--fill {
  display: inline-block !important;
  color: var(--color-primary);
}
.bottom-nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25em;
  height: 1.25em;
}
.bottom-nav-icon-wrap .bottom-nav-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.bottom-nav-icon {
  font-size: 1.25rem;
}

/* Desktop nav & header actions (hidden on mobile) */
.desktop-nav,
.header-actions {
  display: none;
}
.desktop-nav {
  align-items: center;
  gap: 100px;
}
.desktop-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-icon);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.desktop-nav-item .desktop-nav-icon {
  color: var(--color-icon);
}
/* Only active item shows fill icon; others use single outline icon */
.desktop-nav-item .desktop-nav-icon--fill {
  display: none;
}
.desktop-nav-item:hover {
  color: var(--color-primary);
}
.desktop-nav-item:hover .desktop-nav-icon {
  color: var(--color-primary);
}
/* Active: primary color, fill icon, thick underline at bottom of header */
.desktop-nav-item--active {
  position: relative;
  color: var(--color-primary);
  font-weight: 600;
  border-bottom-color: transparent;
}
.desktop-nav-item--active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-primary);
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}
.desktop-nav-item--active .desktop-nav-icon:not(.desktop-nav-icon--fill) {
  display: none;
}
.desktop-nav-item--active .desktop-nav-icon--fill {
  display: inline-block !important;
  color: var(--color-primary);
}
.desktop-nav-icon {
  font-size: 1.125rem;
}
.header-actions {
  align-items: center;
  gap: 35px;
}
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--color-icon);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.icon-btn .ph {
  font-size: 1.25rem;
}
.icon-btn:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
a.icon-btn {
  text-decoration: none;
}
.icon-btn--active {
  color: var(--color-primary);
}
.icon-btn--with-alert {
  position: relative;
}
.nav-alert-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-surface, #fff);
}

/* ----- Notifications page ----- */
.notifications-page .notifications-hero {
  margin-bottom: var(--space-6);
}
.notifications-title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
}
.notifications-subtitle {
  margin: 0 0 0;
  font-size: var(--text-base);
  color: var(--color-text-muted);
}
.notification-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.notification-item--unread .notification-unread-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-top: 0.4rem;
  border-radius: 50%;
  background: var(--color-primary);
}
.notification-item:not(.notification-item--unread) .notification-unread-dot {
  display: none;
}
.notification-dot-space {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-top: 0.4rem;
  border-radius: 50%;
}
.notification-body {
  flex: 1;
  min-width: 0;
}
.notification-title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}
.notification-text {
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.4;
}
.notification-time {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ----- Dashboard: TABLET breakpoint (768px – 1023px) ----- */
@media (min-width: 768px) and (max-width: 1023px) {
  .dashboard-content {
    max-width: 600px;
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
  .app-header-inner,
  .goal-detail-header-inner {
    max-width: 600px;
    margin: 0 auto;
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
  /* Savings Growth: same weights/colors as mobile + desktop (tablet had base .filter-btn / muted chart) */
  body.dashboard .growth-card .growth-header .card-label {
    font-family: var(--font-sans);
    font-weight: 500;
    color: #202437;
  }
  body.dashboard .growth-card .growth-filters .filter-btn {
    font-weight: 500;
    color: #585858;
  }
  body.dashboard .growth-card .growth-filters .filter-btn[aria-selected="true"] {
    font-weight: 600;
    color: #404993;
  }
  body.dashboard .growth-card .chart-y-labels,
  body.dashboard .growth-card .chart-months {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: 500;
    color: #202437;
  }
}

/* ----- Dashboard: DESKTOP breakpoint (1024px+) ----- */
@media (min-width: 1024px) {
  body.dashboard {
    padding-bottom: 0;
    padding-left: 50px;
    padding-right: 50px;
  }

  /* Top nav: full viewport width, same liquid glass effect as bottom nav */
  .app-header {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    box-sizing: border-box;
    background: var(--color-surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  }
  .app-header::after {
    background: transparent;
  }

  .app-header-inner,
  .goal-detail-header-inner {
    max-width: 100%;
    padding-left: 50px;
    padding-right: 50px;
  }
  .app-header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo desktop-nav actions";
    gap: var(--space-8);
    align-items: center;
  }
  .logo-app {
    grid-area: logo;
  }
  .app-header .nav-toggle {
    display: none;
  }
  .desktop-nav {
    display: flex;
    justify-content: center;
    align-items: stretch;
    height: 100%;
    grid-area: desktop-nav;
  }
  .desktop-nav-item {
    align-self: stretch;
  }
  .header-actions {
    display: flex;
    grid-area: actions;
  }
  /* Desktop: nav and header icons 25×25px */
  .desktop-nav-item .desktop-nav-icon,
  .desktop-nav-item .desktop-nav-icon--fill {
    width: 25px;
    height: 25px;
    font-size: 25px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: width var(--breakpoint-transition), height var(--breakpoint-transition), font-size var(--breakpoint-transition);
  }
  .header-actions {
    gap: 35px;
    transition: gap var(--breakpoint-transition);
  }
  .icon-btn {
    width: 25px;
    height: 25px;
    transition: width var(--breakpoint-transition), height var(--breakpoint-transition);
  }
  .icon-btn .ph {
    font-size: 25px;
    transition: font-size var(--breakpoint-transition);
  }
  #main-nav.main-nav--overlay {
    display: none;
  }

  .dashboard-content {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
  }

  /* Home page: hero starts right under header stroke */
  body.home-page .dashboard-main {
    padding-top: 0;
  }

  /* Home page hero: glow top-right; bottom fades to page bg so it meets main content seamlessly */
  body.home-page .home-hero {
    background:
      linear-gradient(
        to bottom,
        transparent 0%,
        transparent 52%,
        var(--color-bg) 88%,
        var(--color-bg) 100%
      ),
      radial-gradient(
        ellipse 140% 155% at 108% 4%,
        rgba(135, 186, 220, 0.4) 0%,
        rgba(176, 205, 232, 0.22) 32%,
        rgba(210, 228, 245, 0.09) 58%,
        rgba(250, 252, 255, 0.5) 78%,
        var(--color-bg) 96%
      ),
      var(--color-bg);
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
    box-sizing: border-box;
    padding-top: 3.75rem;
    padding-bottom: 0;
    padding-left: max(50px, calc(50vw - 450px));
    padding-right: max(50px, calc(50vw - 450px));
    margin-bottom: 0;
  }
  /* Same vertical rhythm as before: subtitle → cards = former padding-bottom + section margin */
  body.home-page .home-hero .home-hero-text {
    margin-bottom: 0;
  }
  body.home-page .home-hero .home-quick-stats {
    margin-top: calc(3.75rem + var(--space-between));
  }
  body.home-page .home-hero .welcome-title,
  body.home-page .home-hero .welcome-title-icon {
    color: #202437;
  }
  body.home-page .home-hero .welcome-subtitle {
    color: #4a5568;
  }

  /* Card spacing on desktop: 30px */
  .card {
    margin-bottom: 30px;
  }
  .goal-card {
    margin-bottom: 30px;
  }
  .course-card {
    margin-bottom: 30px;
  }
  .activity-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
  }
  body.home-page .home-quick-stats {
    gap: 30px;
  }
  .transaction-list {
    gap: 30px;
  }
  .activity-page .transaction-list,
  .goal-detail-page .transaction-list,
  .transactions-page .transaction-list {
    gap: 30px;
  }

  /* Chart: desktop plot height (matches .chart-y-labels 290px); months stay same width as SVG */
  .chart-responsive {
    aspect-ratio: auto;
    height: 290px;
    max-height: 290px;
    min-height: 290px;
  }

  .section-heading-row {
    justify-content: space-between;
  }

  .bottom-nav {
    display: none;
  }
}

/* ----- Header (marketing / legacy) ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo:hover {
  color: var(--color-primary);
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--color-text);
}
.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.nav-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}
.nav-toggle[aria-expanded="true"] .hamburger::before {
  transform: translateY(0) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .hamburger::after {
  transform: translateY(0) rotate(-45deg);
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, background 0.2s ease;
}
.hamburger {
  position: relative;
}
.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
}
.hamburger::before {
  transform: translateY(-6px);
}
.hamburger::after {
  transform: translateY(6px);
}

.main-nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-surface);
  padding: var(--space-8);
  overflow-y: auto;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s ease, visibility 0.3s ease;
}
.main-nav.is-open {
  transform: translateX(0);
  visibility: visible;
}

/* Hamburger drawer: slides in from right only (~75vw, max 300px); see .nav-overlay-backdrop */
.nav-overlay-backdrop {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: rgba(32, 36, 55, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}
.nav-overlay-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Overrides generic .main-nav full-bleed (higher specificity + later source order) */
.main-nav.main-nav--overlay {
  left: auto;
  right: 0;
  width: min(75vw, 300px);
  max-width: 100%;
  top: var(--header-height);
  bottom: 0;
  background: var(--color-surface);
  padding: var(--space-8);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s ease, visibility 0.3s ease;
}
.main-nav.main-nav--overlay.is-open {
  transform: translateX(0);
  visibility: visible;
}
.main-nav--overlay .nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav--overlay .nav-list li {
  border-bottom: 1px solid var(--color-border);
}
.main-nav--overlay .nav-list a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
}
.main-nav--overlay .nav-list a .ph {
  font-size: 1.25rem;
  color: var(--color-icon);
  flex-shrink: 0;
}
/* Hamburger slide-in drawer: hover = icon + label color only (beats .nav-list a:hover background) */
.main-nav--overlay .nav-list a:hover {
  color: var(--color-primary);
  background: transparent;
}
.main-nav--overlay .nav-list a:hover .ph {
  color: var(--color-primary);
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list li {
  border-bottom: 1px solid var(--color-border);
}
.nav-list a {
  display: block;
  padding: var(--space-4);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
}
.nav-list a:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.nav-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}
.nav-actions .btn {
  width: 100%;
  justify-content: center;
}

/* ----- Hero (mobile) ----- */
.hero {
  padding: var(--space-10) 0 var(--space-16);
  background: linear-gradient(180deg, var(--color-primary-light) 0%, var(--color-bg) 60%);
}

.hero-title {
  margin: 0 0 var(--space-4);
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.hero-lead {
  margin: 0 0 var(--space-8);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 36ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-10);
}

.hero-visual {
  max-width: 280px;
  margin: 0 auto;
}

.ripple-mockup {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ----- Sections ----- */
.section {
  padding: var(--space-16) 0;
}

.section-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-lead {
  margin: 0 0 var(--space-10);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 50ch;
}

/* ----- Feature grid (mobile: stack) ----- */
.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.feature-card {
  padding: var(--space-6);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}
.feature-card h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
  font-weight: 600;
}
.feature-card p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.feature-icon {
  font-size: 2rem;
  margin-bottom: var(--space-3);
}

/* ----- How it works ----- */
.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.step {
  position: relative;
  padding-left: 3.5rem;
  padding-bottom: var(--space-10);
}
.step:last-child {
  padding-bottom: 0;
}
.step-num {
  position: absolute;
  left: 0;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: white;
  font-weight: 700;
  font-size: var(--text-sm);
  border-radius: 50%;
}
.step h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-lg);
  font-weight: 600;
}
.step p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ----- Pricing (mobile: stack) ----- */
.pricing-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.pricing-card {
  position: relative;
  padding: var(--space-8);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.pricing-card-featured {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-lg);
}
.badge {
  position: absolute;
  top: -0.75rem;
  left: var(--space-4);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--color-primary);
  color: white;
  border-radius: 999px;
}
.pricing-card h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xl);
  font-weight: 700;
}
.price {
  margin: 0 0 var(--space-1);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
}
.price .amount {
  font-size: var(--text-3xl);
}
.price-desc {
  margin: 0 0 var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.price-features {
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.price-features li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}
.price-features li:last-child {
  border-bottom: none;
}
.pricing-card .btn {
  width: 100%;
}

/* ----- CTA ----- */
.cta {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: white;
}

.cta .section-title,
.cta .section-lead {
  color: inherit;
  opacity: 0.95;
}

.cta-inner {
  text-align: center;
}

.cta-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 400px;
  margin: 0 auto;
}
.cta-form input {
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.15);
  color: white;
}
.cta-form input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}
.cta-form input:focus {
  outline: none;
  border-color: white;
  background: rgba(255, 255, 255, 0.2);
}
.cta-form .btn-primary {
  background: white;
  color: var(--color-primary);
  border-color: white;
}
.cta-form .btn-primary:hover {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-bg);
}

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

/* ----- Footer ----- */
.site-footer {
  padding: var(--space-12) 0 var(--space-8);
  background: var(--color-text);
  color: rgba(255, 255, 255, 0.8);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  text-align: center;
}

.footer-brand .logo {
  color: white;
}
.footer-brand .logo:hover {
  color: var(--color-primary-light);
}
.footer-tagline {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  opacity: 0.8;
}

.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
}
.footer-nav a {
  color: inherit;
  text-decoration: none;
  font-size: var(--text-sm);
}
.footer-nav a:hover {
  color: white;
}

.footer-copy {
  margin: 0;
  font-size: var(--text-xs);
  opacity: 0.6;
}

/* ============================================
   TABLET: 768px and up (marketing site only; dashboard keeps bottom nav)
   ============================================ */
@media (min-width: 768px) {
  :root {
    --container-padding: 1.5rem;
    --header-height: 4rem;
  }

  .site-header .nav-toggle {
    display: none;
  }

  .site-header .main-nav {
    position: static;
    transform: none;
    visibility: visible;
    display: flex;
    align-items: center;
    gap: var(--space-8);
    padding: 0;
    overflow: visible;
    background: transparent;
  }

  .site-header .nav-list {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    border: none;
  }
  .site-header .nav-list li {
    border: none;
  }
  .site-header .nav-list a {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
  }
  .site-header .nav-list a:hover {
    background: var(--color-primary-light);
  }

  .site-header .nav-actions {
    flex-direction: row;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }
  .site-header .nav-actions .btn {
    width: auto;
  }

  .hero-title {
    font-size: var(--text-4xl);
  }
  .hero-lead {
    font-size: var(--text-xl);
  }
  .hero-visual {
    max-width: 420px;
  }

  .section-title {
    font-size: var(--text-3xl);
  }

  .feature-grid {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-8);
  }
  .feature-card {
    flex: 1 1 200px;
    min-width: 0;
  }

  .steps-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
  }
  .step {
    padding-left: 0;
    padding-bottom: 0;
    text-align: center;
  }
  .step-num {
    position: static;
    margin: 0 auto var(--space-4);
  }

  .pricing-cards {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-6);
  }
  .pricing-card {
    flex: 1 1 220px;
    max-width: 280px;
  }

  .cta-form {
    flex-direction: row;
    max-width: 480px;
  }
  .cta-form input {
    flex: 1;
    min-width: 0;
  }

  .footer-inner {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    text-align: left;
  }
  .footer-nav ul {
    justify-content: flex-start;
  }
}

/* ============================================
   DESKTOP: 1024px and up
   ============================================ */
@media (min-width: 1024px) {
  :root {
    --container-padding: 2rem;
  }

  .hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "title visual"
      "lead visual"
      "actions visual";
    align-items: center;
    gap: var(--space-8);
  }
  .hero-title {
    grid-area: title;
    font-size: var(--text-5xl);
  }
  .hero-lead {
    grid-area: lead;
    margin-bottom: var(--space-6);
  }
  .hero-actions {
    grid-area: actions;
    margin-bottom: 0;
  }
  .hero-visual {
    grid-area: visual;
    max-width: 100%;
    margin: 0;
  }
  .ripple-mockup {
    aspect-ratio: 4/3;
  }

  .section-title {
    font-size: var(--text-4xl);
  }

  .feature-grid {
    gap: var(--space-10);
  }
  .feature-card {
    flex: 1 1 0;
  }

  .pricing-cards {
    gap: var(--space-8);
  }
  .pricing-card {
    flex: 1 1 0;
    max-width: none;
  }
}

/* Add money popup – only visible when opened via Add money button */
.add-money-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.add-money-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.add-money-overlay.is-open.is-closing {
  opacity: 0;
  transition-duration: 0.35s;
}

.add-money-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  background: var(--color-surface, #fff);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.35s ease-out, visibility 0.35s ease;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.add-money-sheet.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.add-money-sheet.is-open.is-closing {
  opacity: 0;
}

.add-money-sheet-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  flex-shrink: 0;
}
.add-money-back,
.add-money-close {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.5rem;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--color-text, #1f2937);
  cursor: pointer;
  line-height: 1;
}
.add-money-sheet-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}
.add-money-sheet-content {
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.add-money-panels {
  display: flex;
  width: 400%;
  flex: 1;
  min-height: 0;
  transition: transform 0.3s ease;
}
.add-money-sheet[data-step="0"] .add-money-panels {
  transform: translateX(0);
}
.add-money-sheet[data-step="1"] .add-money-panels {
  transform: translateX(-25%);
}
.add-money-sheet[data-step="2"] .add-money-panels {
  transform: translateX(-50%);
}
.add-money-sheet[data-step="3"] .add-money-panels {
  transform: translateX(-75%);
}
.add-money-panel {
  flex: 0 0 25%;
  width: 25%;
  min-height: 0;
  overflow-y: auto;
}
.add-money-panel[data-step="2"] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.add-money-panel[data-step="2"] .add-money-sheet-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding-bottom: 0;
}
.add-money-panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.add-money-panel-cta {
  flex-shrink: 0;
  padding-top: 2rem;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
}
.add-money-sheet-body {
  padding: 1.25rem 1.5rem calc(1.25rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  min-height: 0;
}
.add-money-heading {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text, #1f2937);
}
.add-money-subheading {
  margin: 1rem 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted, #6b7280);
}
.add-money-subheading:first-of-type {
  margin-top: 0;
}
.add-money-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 20px;
  background: var(--color-muted, #f3f4f6);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  color: var(--color-text, #1f2937);
}
.add-money-option:last-of-type {
  margin-bottom: 0;
}
.add-money-option-text {
  flex: 1;
  min-width: 0;
}
.add-money-option .ph-caret-right {
  flex-shrink: 0;
  font-size: 1.125rem;
  color: var(--color-text-muted, #6b7280);
}
.add-money-option-name {
  display: block;
  font-weight: 500;
}
.add-money-option-meta {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-muted, #6b7280);
}
.add-money-option--new {
  flex-wrap: nowrap;
  margin-top: 2rem;
  margin-bottom: 2rem;
}
.add-money-option--new .ph-plus {
  font-size: 1.25rem;
}

/* Desktop: centered modal, slightly larger */
@media (min-width: 1024px) {
  .add-money-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    border-radius: var(--radius-lg);
    max-width: 34rem;
    width: calc(100% - 2rem);
    max-height: 90vh;
  }
  .add-money-sheet.is-open {
    transform: translate(-50%, -50%) scale(1);
  }
  .add-money-sheet-header {
    padding: 1.5rem 1.75rem;
  }
  .add-money-back,
  .add-money-close {
    left: 1.75rem;
  }
  .add-money-sheet-body {
    padding: 1.5rem 1.75rem calc(1.5rem + env(safe-area-inset-bottom));
  }
}

/* Enter Amount panel content (inside add-money sheet) */
.enter-amount-body {
  padding: 1.25rem 1.5rem calc(1.25rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.enter-amount-display {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text, #1f2937);
  letter-spacing: -0.02em;
}

.enter-amount-quick {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.enter-amount-quick-btn {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-primary);
  background: var(--color-primary-light, #e8eaf5);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.enter-amount-quick-btn:hover {
  background: var(--color-primary);
  color: #fff;
}

.enter-amount-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  width: 100%;
  max-width: 16rem;
}
.enter-amount-key {
  padding: 1rem;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--color-text, #1f2937);
  background: var(--color-muted, #f3f4f6);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.enter-amount-key:hover {
  background: var(--color-border, #e5e7eb);
}
.enter-amount-backspace {
  font-size: 1.25rem;
  color: var(--color-text-muted, #6b7280);
}

@media (min-width: 1024px) {
  .add-money-sheet .enter-amount-body {
    padding: 1.5rem 1.75rem calc(1.5rem + env(safe-area-inset-bottom));
  }
}

/* Confirm Transfer panel content (inside add-money sheet) */
.confirm-transfer-body {
  padding: 1.25rem 1.5rem 0;
  overflow-y: auto;
}

.confirm-transfer-row {
  margin-bottom: 1.25rem;
}
.confirm-transfer-row:last-of-type {
  margin-bottom: 0;
}
.confirm-transfer-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted, #6b7280);
  margin-bottom: 0.35rem;
}
.confirm-transfer-amount {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text, #1f2937);
  letter-spacing: -0.02em;
}

.confirm-transfer-account-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--color-muted, #f3f4f6);
  border-radius: var(--radius);
  margin-top: 0.35rem;
}
.confirm-transfer-account-name {
  display: block;
  font-weight: 500;
  color: var(--color-text, #1f2937);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.confirm-transfer-account-meta {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-muted, #6b7280);
}
.confirm-transfer-account-card .ph-caret-right {
  flex-shrink: 0;
  font-size: 1.125rem;
  color: var(--color-text-muted, #6b7280);
}

.confirm-transfer-frequency {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.confirm-transfer-frequency-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-primary);
  cursor: pointer;
}
.confirm-transfer-frequency-value:hover {
  text-decoration: underline;
}

@media (min-width: 1024px) {
  .add-money-sheet .confirm-transfer-body {
    padding: 1.5rem 1.75rem 0;
  }
}

/* Success panel (step 3) – centered in popup */
.add-money-panel[data-step="3"] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.add-money-success-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem calc(2rem + env(safe-area-inset-bottom));
  width: 100%;
  box-sizing: border-box;
}
.add-money-success-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: transparent;
  border: 3px solid #22c55e;
  color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}
.add-money-success-icon .ph-check {
  font-size: 2rem;
  font-weight: bold;
}
.add-money-success-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text, #1f2937);
}
.add-money-success-message {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text-muted, #6b7280);
}

/* Enter Amount / Confirm Transfer CTAs are in .add-money-panel-cta – same distance from bottom */

/* Edit Goal popup – same layout as Add money */
.edit-goal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.edit-goal-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.edit-goal-overlay.is-open.is-closing {
  opacity: 0;
  transition-duration: 0.35s;
}

.edit-goal-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  background: var(--color-surface, #fff);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.35s ease-out, visibility 0.35s ease;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.edit-goal-sheet.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.edit-goal-sheet.is-open.is-closing {
  opacity: 0;
}

.edit-goal-sheet-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  flex-shrink: 0;
}
.edit-goal-close {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.5rem;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--color-text, #1f2937);
  cursor: pointer;
  line-height: 1;
}
.edit-goal-sheet-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text, #1f2937);
}
.edit-goal-sheet-body {
  padding: 1.25rem 1.5rem calc(1.25rem + env(safe-area-inset-bottom));
  overflow-y: auto;
}

.edit-goal-field {
  display: block;
  margin-bottom: 20px;
}
.edit-goal-field:last-of-type {
  margin-bottom: 0;
}
.edit-goal-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted, #6b7280);
  margin-bottom: 0.35rem;
}
.edit-goal-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  width: 100%;
}
.edit-goal-label-row .edit-goal-label {
  margin-bottom: 0;
}
.edit-goal-info {
  width: 17px;
  height: 17px;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-text-muted, #6b7280);
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.edit-goal-info:hover {
  color: var(--color-text, #1f2937);
}
.edit-goal-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius);
  color: var(--color-text, #1f2937);
  background: var(--color-surface, #fff);
  box-sizing: border-box;
}
.edit-goal-input::placeholder {
  color: var(--color-text-muted, #6b7280);
}
.edit-goal-amount-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius);
  overflow: hidden;
}
.edit-goal-currency {
  padding: 0.75rem 1rem;
  background: #F7F7F7;
  color: var(--color-text, #1f2937);
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--color-border, #e5e7eb);
}
.edit-goal-amount-input {
  border: none;
  border-radius: 0;
  flex: 1;
  min-width: 0;
}
/* Round-up method: custom dropdown matching form style, list appears below */
.edit-goal-roundup-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.edit-goal-dropdown-field {
  position: relative;
  margin-top: 20px;
}
.edit-goal-custom-roundup-wrap {
  margin-top: 1rem;
}
.edit-goal-custom-roundup-wrap .edit-goal-label {
  margin-bottom: 0.35rem;
}
.edit-goal-dropdown {
  position: relative;
  margin-top: 0.35rem;
}
.edit-goal-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius);
  color: var(--color-text, #1f2937);
  background: var(--color-surface, #fff);
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}
.edit-goal-dropdown-trigger:hover {
  border-color: var(--color-border, #e5e7eb);
}
.edit-goal-dropdown-trigger:focus {
  border-color: var(--color-primary, #2563eb);
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.edit-goal-dropdown-value {
  flex: 1;
  min-width: 0;
}
.edit-goal-dropdown-chevron {
  flex-shrink: 0;
  font-size: 1rem;
  color: var(--color-text-muted, #6b7280);
  transition: transform 0.2s ease;
}
.edit-goal-dropdown.is-open .edit-goal-dropdown-chevron {
  transform: rotate(180deg);
}
.edit-goal-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  margin-top: 2px;
  padding: 0;
  list-style: none;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius);
  background: var(--color-surface, #fff);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-height: 12rem;
  overflow-y: auto;
  z-index: 2;
  display: none;
}
.edit-goal-dropdown.is-open .edit-goal-dropdown-list {
  display: block;
}
.edit-goal-dropdown-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--color-text, #1f2937);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}
.edit-goal-dropdown-option:hover {
  background: var(--color-muted, #f3f4f6);
}
.edit-goal-dropdown-option:not(:last-child) {
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.edit-goal-dropdown-check {
  flex-shrink: 0;
  font-size: 1.125rem;
  color: var(--color-primary, #2563eb);
  visibility: hidden;
}
.edit-goal-dropdown-option[aria-selected="true"] .edit-goal-dropdown-check {
  visibility: visible;
}
.edit-goal-card-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.35rem;
  background: transparent;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  color: var(--color-text, #1f2937);
}
.edit-goal-card-name {
  display: block;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.edit-goal-card-meta {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-muted, #6b7280);
}
.edit-goal-card-trigger .ph-caret-right {
  flex-shrink: 0;
  font-size: 1.125rem;
  color: var(--color-text-muted, #6b7280);
}
.edit-goal-pause {
  display: block;
  width: fit-content;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
  border: none;
  background: none;
  font-size: 1rem;
  color: #b85454;
  text-decoration: underline;
  cursor: pointer;
}
.edit-goal-pause:hover {
  color: #9a4545;
}
.edit-goal-done {
  margin-top: 0 !important;
  margin-bottom: 2rem !important;
}

@media (min-width: 1024px) {
  .edit-goal-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    border-radius: var(--radius-lg);
    max-width: 34rem;
    width: calc(100% - 2rem);
    max-height: 90vh;
  }
  .edit-goal-sheet.is-open {
    transform: translate(-50%, -50%) scale(1);
  }
  .edit-goal-sheet-header {
    padding: 1.5rem 1.75rem;
  }
  .edit-goal-close {
    left: 1.75rem;
  }
  .edit-goal-sheet-body {
    padding: 1.5rem 1.75rem calc(1.5rem + env(safe-area-inset-bottom));
  }
}

/* Goal detail header menu (dropdown from three-dot) */
.goal-detail-menu-wrap {
  position: relative;
}
.goal-detail-header-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  min-width: 12rem;
}
