/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=Outfit:wght@300;400;500;600&family=Nunito:wght@400;700;900&display=swap');

/* ── Design Tokens ── */
:root {
  --bg:           #F5F2ED;
  --white:        #FFFEF6;
  --card-bg:      #EAE4D9;
  --green-dark:   #B7D65B;
  --green-light:  #DAEABA;
  --green-text:   #6a8a2a;
  --red-dark:     #E66A57;
  --red-light:    #F1B4AB;
  --red-bg:       #F9DDD9;
  --ink:          #594A42;
  --muted:        #9a8f88;
  --border:       #e0ddd8;
  --radius:       30px;
  --font-main:    'DM Sans', system-ui, sans-serif;
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-logo:    'Nunito', system-ui, sans-serif;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { font-size: 16px; }

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Header ── */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  background: rgba(245, 242, 237, 0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.header-logo-img {
  height: 28px;
  width: auto;
  margin-top: .04rem;
  margin-left: 1.5rem;
}

.avatar-wrap {
  position: relative;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--white);
  border: 1.5px solid var(--border);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
}

.avatar-dropdown {
  display: none;
  position: absolute;
  top: 52px;
  left: 0;
  background: var(--white);
  border-radius: 10px;
  border: 1.5px solid var(--border);
  overflow: hidden;
  min-width: 220px;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.avatar-dropdown a {
  display: block;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  color: var(--ink);
  border-bottom: 1px solid var(--bg);
}

.avatar-dropdown a.active,
.avatar-dropdown .dropdown-plan.active {
  background: #634A42;
  color: #E3DCD1 !important;
}

.avatar-dropdown a:last-child {
  border-bottom: none;
}

.avatar-dropdown a:hover {
  opacity: 0.85;
}

.avatar-dropdown.open {
  display: block;
}

.header-date {
  font-size: 0.9rem;
  color: var(--ink);
  padding-top: 0.6rem;
  font-family: var(--font-main);
  letter-spacing: 0.15em;
}

/* ── Flash messages ── */
.flash {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  text-align: center;
}

.flash-notice { background: var(--green-light); color: var(--ink); }
.flash-alert  { background: var(--red-light); color: var(--ink); }

/* ── Dashboard ── */
.dashboard {
  padding: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.dashboard-header h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--ink);
  margin-left: 1.18rem;
}

.btn-new {
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  color: var(--ink);
  cursor: pointer;
}

.btn-new:hover {
  border-color: var(--green-dark);
  color: var(--green-dark);
}

/* ── Dashboard message ── */
.dashboard-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  gap: 1rem;
  background: var(--white);
  position: relative;
}

/* Gradient border using pseudo-element */
.dashboard-message::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 2px;
  background: linear-gradient(135deg, #E66A57, #F4A261, #F1B4AB);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.dashboard-message--behind {
  background: var(--white);
}

.dashboard-message--streak {
  background: var(--white);
}

.dashboard-message--streak::before {
  background: linear-gradient(135deg, #B7D65B, #DAEABA, #6a8a2a);
}

.dashboard-message--on_track {
  background: var(--white);
}

.dashboard-message--on_track::before {
  background: linear-gradient(135deg, #B7D65B, #DAEABA, #6a8a2a);
}

.dashboard-message--no_saves {
  background: var(--white);
}

.dashboard-message--no_saves::before {
  background: linear-gradient(135deg, var(--ink), var(--muted));
}

.dashboard-message-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dashboard-message-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}

.dashboard-message-sub {
  font-size: 0.85rem;
  color: var(--muted);
}

.dashboard-message-btn {
  background: var(--ink);
  color: var(--white);
  padding: 0.55rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.dashboard-message-btn:hover { opacity: 0.85; }

/* ── Plan cards ── */
.plan-cards {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.plan-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: block;
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.plan-card.on-track:hover {
  border-color: var(--green-dark);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
}

.plan-card.behind:hover {
  border-color: var(--red-dark);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
}

.plan-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.plan-card-top-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.plan-card-top-right {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  padding-right: 3.5rem;
}

.plan-card-name {
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 500;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.75rem;
}

.plan-card-currency {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.75rem;
}

.plan-card-total {
  font-family: var(--font-main);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.1em;
  -webkit-text-stroke: 1px var(--ink);
}

/* ── Dashboard day strip ── */
.plan-card-strip {
  display: flex;
  gap: 6px;
  align-items: center;
}

.strip-cell {
  width: calc((100% - 36px) / 7);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 1.5rem;
  font-weight: 500;
  text-align: center;
  font-family: var(--font-display);
  letter-spacing: 0.026em;
  flex-shrink: 0;
}

.strip-cell.completed       { background: var(--green-light); color: var(--green-text); }
.strip-cell.today           { background: var(--red-light); color: var(--red-dark); border: 5px solid var(--red-dark); }
.strip-cell.missed          { background: var(--red-light); color: var(--red-dark); }
.strip-cell.upcoming        { background: var(--white); color: var(--muted); border: 1.5px solid var(--border); }
.strip-cell.completed.current { background: var(--green-light); color: var(--green-text); border: 5px solid var(--green-dark); }
.strip-cell.current.missed  { background: var(--red-light); color: var(--red-dark); border: 5px solid var(--red-dark); }

/* ── Badges ── */
.badges-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
}

.badge-emoji { font-size: 1rem; }
.badge-label { font-size: 0.78rem; }

.dashboard-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}

.empty-state p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.btn-primary {
  display: inline-block;
  background: var(--green-dark);
  color: var(--white);
  border-radius: 10px;
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── Plan page ── */
.plan-page {
  position: relative;
  padding: 1.5rem 1.5rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.plan-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.plan-top-left {
  display: flex;
  align-items: center;
}

.plan-top-right {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding-right: 3.5rem;
}

.plan-top-centre {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
}

.plan-name-pill {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-family: var(--font-main);
}

.plan-name-pill:hover { border-color: var(--ink); }

.plan-currency-pill {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.75rem;
}

.plan-running-total {
  font-family: var(--font-main);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.1em;
  -webkit-text-stroke: 1px var(--ink);
}

.plan-start-date {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-main);
  letter-spacing: 0.05em;
}

.plan-suspended-date {
  font-size: 0.8rem;
  color: var(--red-dark);
  font-family: var(--font-main);
  letter-spacing: 0.05em;
}

.suspended-pill {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.75rem;
}

/* ── Plan dropdown ── */
.plan-name-wrap { position: relative; }

.plan-dropdown {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  background: var(--white);
  border-radius: 10px;
  border: 1.5px solid var(--border);
  overflow: hidden;
  min-width: 180px;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.plan-dropdown.open { display: block; }

.plan-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-family: var(--font-main);
  color: var(--ink);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid var(--bg);
}

.plan-dropdown-item:last-child { border-bottom: none; }
.plan-dropdown-item:hover { background: var(--bg); }

.delete-item { color: var(--red-dark); }
.delete-item:hover { background: var(--red-light); }

.undo-item { color: var(--muted); }
.undo-item:hover { background: var(--bg); color: var(--ink); }

/* ── Day header ── */
.plan-day-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--card-bg);
  border-radius: 16px 16px 0 0;
  padding: 0.75rem 1.5rem;
}

.day-header-centre {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.day-label {
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.day-number,
.day-target {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.2rem 0.6rem;
}

.day-arrow {
  font-size: 0.9rem;
  color: var(--ink);
}

/* ── Main card ── */
.main-card {
  background: var(--white);
  border-radius: 0;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  position: relative;
  border: 2px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}

.main-card.saved { background: var(--green-dark); }
.main-card.invalid { border-color: var(--red-dark); }

.card-amount {
  width: 100%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.amount-input {
  font-family: var(--font-main);
  font-size: 8rem;
  font-weight: 300;
  color: var(--green-dark);
  border: none;
  outline: none;
  text-align: center;
  width: 100%;
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
  -webkit-text-stroke: 5px var(--green-dark);
  letter-spacing: 0.026em;
}

.amount-input::-webkit-outer-spin-button,
.amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.amount-input.invalid {
  color: var(--red-dark);
  -webkit-text-stroke: 5px var(--red-dark);
}

.saved-amount {
  font-family: var(--font-main);
  font-size: 8rem;
  font-weight: 300;
  color: var(--green-light);
  text-align: center;
  width: 100%;
  -webkit-text-stroke: 5px var(--green-light);
  letter-spacing: 0.026em;
}

/* ── Save button ── */
.save-btn-wrap { margin-top: 0; }

.save-btn {
  width: 100%;
  padding: 1.1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--green-light);
  color: var(--green-dark);
  font-family: var(--font-main);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  border: none;
  cursor: pointer;
  display: block;
  text-align: center;
  -webkit-text-stroke: 3px var(--green-dark);
  transition: background 0.2s;
}

.save-btn .cross { display: none; }
.save-btn .tick  { display: block; }

.save-btn.invalid {
  background: var(--red-light);
  color: var(--red-dark);
  -webkit-text-stroke: 3px var(--red-dark);
  cursor: not-allowed;
}

.save-btn.invalid .cross { display: block; }
.save-btn.invalid .tick  { display: none; }

.saved-btn {
  width: 100%;
  padding: 1.1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--green-light);
  color: var(--green-dark);
  font-family: var(--font-main);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-align: center;
  -webkit-text-stroke: 3px var(--green-dark);
}

.future-btn {
  width: 100%;
  padding: 1.1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--border);
  color: var(--muted);
  font-family: var(--font-main);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-align: center;
  cursor: default;
}

/* ── Plan day strip ── */
.day-strip-wrap {
  margin-top: 0.75rem;
  padding: 0 0.25rem;
}

.day-strip {
  display: flex;
  gap: 6px;
  align-items: center;
}

.day-strip-cell {
  flex: 1;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 1.5rem;
  font-weight: 500;
  text-align: center;
  font-family: var(--font-display);
  letter-spacing: 0.026em;
  min-width: 0;
  cursor: pointer;
}

a.day-strip-cell {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-strip-cell.completed         { background: var(--green-light); color: var(--green-text); }
.day-strip-cell.today             { background: var(--red-light); color: var(--red-dark); border: 5px solid var(--red-dark); }
.day-strip-cell.missed            { background: var(--red-light); color: var(--red-dark); }
.day-strip-cell.upcoming          { background: var(--white); color: var(--muted); border: 1.5px solid var(--border); }
.day-strip-cell.completed.current { background: var(--green-light); color: var(--green-text); border: 5px solid var(--green-dark); }
.day-strip-cell.missed.current    { background: var(--red-light); color: var(--red-dark); border: 5px solid var(--red-dark); }

/* ── Stats panel ── */
.stats-panel {
  background: var(--white);
  border-radius: var(--radius);
  padding: 0.5rem 1.5rem;
  margin-top: 1rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--bg);
}

.stat-row:last-child { border-bottom: none; }

.stat-label {
  font-size: 1rem;
  color: var(--ink);
  font-family: var(--font-main);
}

.stat-value {
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  border-radius: 8px;
  letter-spacing: 0.1em;
}

.stat-value.green { background: var(--green-light); color: var(--green-text); }
.stat-value.red   { background: var(--red-light); color: var(--red-dark); }

/* ── Catch up bar ── */
.catch-up-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F9DDD9;
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-top: 1rem;
  gap: 1rem;
}

.catch-up-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.catch-up-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.catch-up-sub {
  font-size: 0.85rem;
  color: var(--ink);
  opacity: 0.7;
}

.catch-up-btn {
  background: var(--red-dark);
  color: var(--white);
  border: none;
  border-radius: 12px;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.catch-up-btn:hover { opacity: 0.88; }

/* ── Year grid ── */
.year-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 1rem;
  padding: 1.25rem;
  background: var(--white);
  border-radius: var(--radius);
}

.grid-cell {
  width: calc((100% - 4px * 24) / 25);
  aspect-ratio: 1;
  border-radius: 4px;
}

.grid-cell.completed { background: var(--green-light); }
.grid-cell.today     { background: var(--red-light); border: 3px solid var(--red-dark); }
.grid-cell.missed    { background: var(--red-light); }
.grid-cell.upcoming  { background: var(--bg); }

a.grid-cell {
  text-decoration: none;
  display: block;
  transition: opacity 0.15s;
}

a.grid-cell:hover { opacity: 0.75; }

/* ── Year grid overlay button ── */
.year-grid-wrap {
  position: relative;
}

.year-grid-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,254,246,0.7);
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 0.2s;
}

.year-grid-wrap:hover .year-grid-overlay {
  opacity: 1;
}

.year-grid-btn {
  background: var(--ink);
  color: var(--white);
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.year-grid-btn:hover { opacity: 0.9; }

/* ── Forms ── */
.form-page {
  padding: 2rem 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.form-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem;
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.form-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.form-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.form-field { margin-bottom: 1.5rem; }

.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-field input[type="text"],
.form-field input[type="date"],
.form-field input[type="email"],
.form-field input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}

.form-field input[type="text"]:focus,
.form-field input[type="date"]:focus,
.form-field input[type="email"]:focus,
.form-field input[type="password"]:focus {
  border-color: var(--green-dark);
}

.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23594A42' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  transition: border-color 0.15s;
}

.form-select:focus { border-color: var(--green-dark); }

.mode-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.mode-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.mode-option input[type="radio"] {
  margin-top: 0.2rem;
  accent-color: var(--green-dark);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.mode-option:has(input:checked) {
  border-color: var(--green-dark);
  background: var(--green-light);
}

.mode-option-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mode-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.mode-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.form-submit {
  width: 100%;
  padding: 1rem;
  background: var(--green-dark);
  color: var(--white);
  border: none;
  border-radius: 14px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: opacity 0.15s;
}

.form-submit:hover { opacity: 0.88; }

.form-errors {
  background: #F9DDD9;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--red-dark);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.form-errors-icon {
  color: var(--red-dark);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.form-back {
  display: block;
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.form-back:hover { color: var(--ink); }

/* ── Dropdown divider ── */
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.dropdown-plan {
  font-size: 0.85rem !important;
  color: var(--muted) !important;
  padding-left: 1.5rem !important;
}

.dropdown-plan:hover { color: var(--ink) !important; }

.dropdown-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.dropdown-status-dot.on-track { background: var(--green-dark); }
.dropdown-status-dot.behind   { background: var(--red-dark); }

/* ── Onboarding ── */
.onboarding-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.onboarding-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  max-width: 520px;
  width: 100%;
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  text-align: center;
}

.onboarding-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.onboarding-body {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.onboarding-body strong {
  color: var(--ink);
  font-weight: 600;
}

.onboarding-note {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
  text-align: left;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg);
  border-radius: 14px;
  padding: 1rem 1.25rem;
}

.onboarding-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-dark);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-text {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.4;
}

.onboarding-btn {
  width: 100%;
  padding: 1rem;
  background: var(--green-dark);
  color: var(--white);
  border: none;
  border-radius: 14px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: opacity 0.15s;
}

.onboarding-btn:hover { opacity: 0.88; }

/* ── Auth pages ── */
.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  cursor: pointer;
}

.remember-me input[type="checkbox"] {
  accent-color: var(--green-dark);
  width: 16px;
  height: 16px;
}

.forgot-link {
  color: var(--muted);
  font-size: 0.875rem;
}

.forgot-link:hover { color: var(--ink); }

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-footer a { color: var(--green-text); font-weight: 600; }
.auth-footer a:hover { color: var(--green-dark); }

/* ── Toast notifications ── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-main);
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  z-index: 999;
  white-space: nowrap;
  animation: toast-in 0.3s ease, toast-out 0.3s ease 3s forwards;
}

.toast-notice { background: var(--green-dark); color: var(--white); }
.toast-alert  { background: var(--red-dark); color: var(--white); }

.toast-icon {
  font-size: 1rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-message { color: var(--white); }

.toast-milestone {
  background: var(--ink);
  color: var(--white);
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 1rem 1.5rem;
}

.toast-milestone-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.toast-milestone-label { font-weight: 600; font-size: 0.95rem; }
.toast-milestone-desc  { font-size: 0.8rem; opacity: 0.7; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(1rem); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(1rem); }
}

/* ── Custom tooltip ── */
.custom-tooltip {
  position: fixed;
  background: var(--ink);
  color: var(--white);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-family: var(--font-main);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 999;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.custom-tooltip::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.custom-tooltip.visible { opacity: 1; }

/* ── Save animation ── */
.save-animation {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  overflow: hidden;
  visibility: hidden;
}

.save-animation.playing {
  visibility: visible;
  pointer-events: all;
}

.wave {
  position: absolute;
  bottom: -100%;
  left: -10%;
  width: 120%;
  height: 100%;
  background: var(--green-dark);
  border-radius: 40% 40% 0 0;
  transition: bottom 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.save-animation.playing .wave { bottom: -10%; }

.animation-content {
  position: absolute;
  bottom: -20%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: bottom 1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}

.save-animation.playing .animation-content { bottom: 5%; }

.piggy-bank {
  width: 200px;
  height: auto;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s,
              opacity 0.5s ease 0.5s;
  position: relative;
  z-index: 1;
}

.save-animation.playing .piggy-bank {
  transform: translateY(0);
  opacity: 1;
}

.coin {
  position: absolute;
  width: 60px;
  height: auto;
  top: -80px;
  left: 50%;
  transform: translateX(-35%);
  opacity: 0;
  z-index: -1;
  transition: top 0.5s ease 1.2s, opacity 0.3s ease 1.2s;
}

.save-animation.playing .coin { top: 10px; opacity: 1; }

.confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.confetti-piece {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  animation: confetti-fall 1.5s ease forwards;
}

@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── Admin ── */
.admin-page {
  padding: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1.5px solid var(--border);
  text-align: center;
}

.admin-stat-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--green-text);
  margin-bottom: 0.25rem;
}

.admin-stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1.5px solid var(--border);
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.admin-section-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.admin-table { width: 100%; }

.admin-table-header {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0.5rem 0;
  border-bottom: 1.5px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.admin-table-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--bg);
  font-size: 0.9rem;
  align-items: center;
}

.admin-table-row:last-child { border-bottom: none; }

.admin-table.users .admin-table-header,
.admin-table.users .admin-table-row {
  grid-template-columns: 1fr 2fr 1fr 0.5fr 1fr;
}

.invite-code-text {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.status-available { color: var(--green-text); font-weight: 500; }
.status-used      { color: var(--muted); }

.admin-item {
  color: var(--muted);
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.admin-item:hover {
  color: var(--ink) !important;
  background: var(--bg) !important;
}

.plan-back-link {
  padding: 2rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.plan-back-link a:hover {
  color: var(--ink);
}

/* ── Trophy counters (dashboard) ── */
.dashboard-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.trophy-counter {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--white);
  border: 1.5px solid var(--border);
}

.trophy-counter--bronze { border-color: #CD7F32; color: #CD7F32; }
.trophy-counter--silver { border-color: #A8A9AD; color: #A8A9AD; }
.trophy-counter--gold   { border-color: #FFD700; color: #B8860B; }

/* ── Milestone list (plan page) ── */
.milestone-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.milestone-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--white);
  border-radius: 12px;
  border: 1.5px solid var(--border);
}

.milestone-item--bronze { border-color: #CD7F32; }
.milestone-item--silver { border-color: #A8A9AD; }
.milestone-item--gold   { border-color: #FFD700; }

.milestone-trophy svg { flex-shrink: 0; }
.timeline-trophy svg { width: 20px; height: 20px; flex-shrink: 0; color: #FFD700; }

.milestone-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.milestone-label { font-size: 0.875rem; font-weight: 700; color: var(--ink); }
.milestone-desc  { font-size: 0.8rem; color: var(--muted); }

/* ── Dashboard header actions ── */
.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sort-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.sort-dropdown-wrap {
  position: relative;
}

.sort-dropdown-wrap #entries-filter-dropdown {
  left: 0;
  right: auto;
}

.sort-btn {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s;
  white-space: nowrap;
}

.sort-btn:hover { border-color: var(--green-dark); }

.sort-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 0.5rem;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  z-index: 50;
}

.sort-dropdown.open { display: block; }

.sort-option {
  display: block;
  padding: 0.6rem 0.875rem;
  font-size: 0.875rem;
  color: var(--ink);
  border-radius: 10px;
  transition: background 0.1s;
}

.sort-option:hover { background: var(--bg); }
.sort-option.active { font-weight: 600; color: var(--green-text); }

/* ── App footer ── */
.app-footer {
  text-align: center;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.app-footer a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
}

.app-footer a:hover { color: var(--ink); }

.app-footer span { color: var(--border); font-size: 0.8rem; }

.avatar-dropdown-user {
  padding: 0.5rem 0.75rem 0.25rem;
}

.avatar-dropdown-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

/* ── Inspiration cards ── */
.inspiration-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1.5px dashed var(--border);
  overflow: hidden;
  opacity: 0.7;
  margin-top: 2rem; /* matches plan card gap */
}

.inspiration-card-inner {
  filter: blur(0.5px); /* much more subtle */
}

.inspiration-card-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.inspiration-card-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.inspiration-strip {
  display: flex;
  gap: 0.5rem;
}

.inspiration-strip-cell {
  flex: 1;
  height: 60px;
  border-radius: 12px;
  background: var(--border);
}

.inspiration-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245,242,237,0.5);
}

.inspiration-btn {
  background: var(--ink);
  color: var(--white);
  padding: 0.65rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.inspiration-btn:hover { opacity: 0.85; }

/* ── Colour themes ── */
body.theme-default {
  --green-dark:  #B7D65B;
  --green-light: #DAEABA;
  --green-text:  #6a8a2a;
  --red-dark:    #E66A57;
  --red-light:   #F1B4AB;
}

body.theme-ocean {
  --green-dark:  #4ABFBF;
  --green-light: #B8EAEA;
  --green-text:  #1a7a7a;
  --red-dark:    #4A90BF;
  --red-light:   #B8D4EA;
}

body.theme-sunset {
  --green-dark:  #F4A261;
  --green-light: #FDDCB8;
  --green-text:  #c45e1a;
  --red-dark:    #9B59B6;
  --red-light:   #D9B8EA;
}

body.theme-mono {
  --green-dark:  #594A42;
  --green-light: #D5CFC8;
  --green-text:  #2c2c2c;
  --red-dark:    #888888;
  --red-light:   #DDDDDD;
}

/* ── Star pin button ── */
.star-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: color 0.15s;
  margin-left: 0.25rem;
}

.star-btn:hover { color: #FFD700; }

.star-btn.starred { 
  color: #FFFADB;
}

@keyframes star-pop {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(90deg); }
}

.star-btn.star-animating {
  animation: star-pop 0.25s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
  color: #FFD700;
}

/* ── Theme picker ── */
.theme-picker {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
}

.theme-option input[type="radio"] { display: none; }

/* ── Theme picker ── */
.theme-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.theme-option {
  cursor: pointer;
}

.theme-option input[type="radio"] { display: none; }

.theme-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 0.875rem 1rem;
  transition: border-color 0.15s, background 0.15s;
}

.theme-option--selected .theme-card {
  border-color: var(--ink);
  background: var(--white);
}

.theme-swatch {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-check {
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.theme-card-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.theme-card-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.theme-card-desc {
  font-size: 0.75rem;
  color: var(--muted);
}

.theme-swatch--default { background: linear-gradient(135deg, #B7D65B 50%, #E66A57 50%); }
.theme-swatch--ocean   { background: linear-gradient(135deg, #4ABFBF 50%, #4A90BF 50%); }
.theme-swatch--sunset  { background: linear-gradient(135deg, #F4A261 50%, #9B59B6 50%); }
.theme-swatch--mono    { background: linear-gradient(135deg, #594A42 50%, #888888 50%); }

.pinned-section {
  margin-bottom: 1.5rem;
}

.pinned-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #FFD700;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── More options toggle ── */
.more-options-toggle {
  margin-bottom: 1rem;
}

.more-options-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.more-options-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.more-options {
  padding: 0;
  margin-bottom: 1rem;
  background: none;
  border: none;
  border-radius: 0;
}

.form-field input[type="number"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}

.form-field input[type="number"]:focus {
  border-color: var(--green-dark);
}

/* ── Settings plan management ── */
.settings-plans {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.settings-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--bg);
  border-radius: 12px;
  border: 1.5px solid var(--border);
  gap: 1rem;
}

.settings-plan-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.settings-plan-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.settings-plan-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.settings-delete-btn {
  background: none;
  border: 1.5px solid var(--red-dark);
  color: var(--red-dark);
  padding: 0.4rem 0.875rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font-main);
}

.settings-delete-btn:hover {
  background: var(--red-dark);
  color: var(--white);
}

/* ── Profile page ── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.profile-meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.profile-trophies {
  display: flex;
  gap: 1.5rem;
  margin: 1.25rem 0;
}

.profile-trophy-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.profile-trophy-item svg {
  width: 32px;
  height: 32px;
}

.profile-trophy-count {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}

.profile-trophy-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Progress bars ── */
.profile-progress { margin-top: 1.5rem; }

.profile-progress-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.progress-item { margin-bottom: 1rem; }

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* ── Stats ── */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
}

.profile-stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}

.profile-stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Milestone timeline ── */
.milestone-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 12px;
  border: 1.5px solid var(--border);
}

.timeline-trophy svg { width: 20px; height: 20px; flex-shrink: 0; }

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.timeline-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.timeline-plan {
  font-size: 0.78rem;
  color: var(--muted);
}

.timeline-date {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Notification badge ── */
.avatar {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--red-dark);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  font-family: var(--font-main);
}

/* ── Notifications ── */
.notification-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.notification-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  transition: background 0.15s;
  text-decoration: none;
}

.notification-item.unread {
  background: var(--white);
  border-color: var(--green-dark);
}

.notification-item.read {
  background: var(--bg);
}

.notification-item:hover { opacity: 0.85; }

.notification-item-left {
  width: 10px;
  flex-shrink: 0;
}

.notification-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-dark);
}

.notification-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.notification-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.notification-date {
  font-size: 0.78rem;
  color: var(--muted);
}

.notification-item-arrow {
  font-size: 1.2rem;
  color: var(--muted);
}

.notification-show-date {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.notification-show-body {
  margin: 1.5rem 0;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--ink);
}

.notification-show-link {
  display: inline-block;
  color: var(--green-text);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  text-decoration: underline;
}

.notification-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--bg);
  border-radius: 12px;
  border: 1.5px solid var(--border);
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.notification-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  color: var(--ink);
  border-bottom: 1px solid var(--bg);
}

.notification-nav-badge {
  background: var(--red-dark);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-family: var(--font-main);
}

/* ── Feedback card ── */
.feedback-card {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 800;
  padding: 0 1rem 1rem;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.feedback-card.visible {
  transform: translateY(0);
}

.feedback-card-inner {
  background: var(--white);
  border-radius: 24px 24px 16px 16px;
  padding: 1.5rem;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.12);
  border: 1.5px solid var(--border);
  text-align: center;
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.feedback-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
}

.feedback-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.feedback-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.feedback-faces {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.feedback-face {
  background: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 1.75rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feedback-face:hover {
  border-color: var(--green-dark);
  transform: scale(1.1);
}

.feedback-face.selected {
  border-color: var(--green-dark);
  background: var(--green-light);
  transform: scale(1.1);
}

.feedback-comment-wrap {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feedback-comment {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  resize: none;
  transition: border-color 0.15s;
}

.feedback-comment:focus { border-color: var(--green-dark); }

.feedback-submit {
  background: var(--green-dark);
  color: var(--white);
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.feedback-submit:hover { opacity: 0.88; }

.feedback-thankyou {
  font-size: 1rem;
  font-weight: 600;
  color: var(--green-text);
  padding: 0.5rem 0;
}

/* ── Admin feedback ── */
.feedback-admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.feedback-admin-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: var(--bg);
  border-radius: 12px;
  border: 1.5px solid var(--border);
}

.feedback-admin-rating {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.feedback-admin-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.feedback-admin-user {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.feedback-admin-comment {
  font-size: 0.8rem;
  color: var(--muted);
}

.feedback-admin-date {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.feedback-face svg {
  width: 28px;
  height: 28px;
  pointer-events: none;
}

.day-strip-cell.completed.overpaid {
  background: #FFFADB;
  color: var(--green-text);
  border: 1.5px solid var(--green-dark);
}

.day-strip-cell.completed.current.overpaid {
  background: #FFFADB;
  color: var(--green-text);
  border: 5px solid var(--green-dark);
}

.strip-cell.completed.overpaid {
  background: #FFFADB;
  color: var(--green-text);
  border: 1.5px solid var(--green-dark);
}

.strip-cell.completed.current.overpaid {
  background: #FFFADB;
  color: var(--green-text);
  border: 5px solid var(--green-dark);
}

.grid-cell.overpaid { background: #FFFADB; }

/* ── Entries page ── */
.form-back-wrap {
  text-align: center;
  padding: 1rem 0 0;
  max-width: 700px;
  margin: 0 auto;
}

.entries-month-details {
  margin-bottom: 0.5rem;
}

.entries-month-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border-radius: 10px;
  margin-bottom: 0.35rem;
  width: 100%;
}

.entries-month-total {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink);
  margin-left: auto;
}

.entries-month-header::-webkit-details-marker { display: none; }

.entries-month-header::after {
  content: '';
}

.entries-list {
  display: flex;
  flex-direction: column;
}

.entries-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.875rem;
  border-radius: 10px;
  margin-bottom: 0.35rem;
  gap: 1rem;
}

.entries-row--saved    { background: var(--green-light); }
.entries-row--overpaid { background: #FFFADB; }
.entries-row--missed   { background: var(--red-bg); }
.entries-row--missed .entries-day-date,
.entries-row--missed .entries-day-number {
  color: var(--red-dark);
}
.entries-row--today    { background: var(--white); border: 1.5px solid var(--red-dark); }
.entries-row--upcoming { background: var(--bg); }

.entries-row-date {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 55px;
  flex-shrink: 0;
}

.entries-row-day {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 55px;
  flex-shrink: 0;
}

.entries-day-date {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.entries-day-number {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.entries-row-amounts {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
  padding-right: 1rem;
}

.entries-target {
  font-size: 1rem;
  color: var(--muted);
}

.entries-saved {
  font-size: 1rem;
  font-weight: 600;
  color: var(--green-text);
}

.entries-saved--overpaid { color: #B8860B; }

.entries-row-status { flex-shrink: 0; }

.entries-status-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.entries-status-icon svg { color: var(--white); }

.entries-status-icon--saved    { background: var(--green-dark); }
.entries-status-icon--overpaid { background: #FFD700; }
.entries-status-icon--overpaid svg { color: var(--ink); }
.entries-status-icon--missed   { background: var(--red-light); }
.entries-status-icon--missed svg { color: var(--red-dark); }
.entries-status-icon--today    { background: var(--red-dark); }
.entries-status-icon--upcoming { background: var(--border); }
.entries-status-icon--upcoming svg { color: var(--muted); }

.sort-dropdown-wrap #entries-filter-dropdown {
  left: 0;
  right: auto;
}

/* ── Notable days ── */
.notable-days {
  position: relative;
  padding: 1.5rem 1.5rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.notable-days-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  text-align: center;
}

.notable-days-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notable-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  gap: 0.5rem;
}

.notable-day-row--missed   { background: var(--red-bg); }
.notable-day-row--overpaid { background: #FFFADB; }

.notable-day-date-col {
  width: 70px;
  flex-shrink: 0;
}

.notable-day-number-col {
  width: 55px;
  flex-shrink: 0;
}

.notable-day-date {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.notable-day-number {
  font-size: 0.875rem;
  color: var(--muted);
}

.notable-day-amount {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  justify-content: flex-end;
  padding-right: 0.5rem;
}

.notable-amount--missed {
  font-size: 1rem;
  font-weight: 600;
  color: var(--red-dark);
}

.notable-amount--overpaid {
  font-size: 1rem;
  font-weight: 600;
  color: #B8860B;
}

.notable-save-btn {
  color: var(--red-dark);
  display: flex;
  align-items: center;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.notable-save-btn:hover { opacity: 0.7; }

.button_to {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
}

.notable-save-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--red-dark);
  display: flex;
  align-items: center;
}

.notable-overpaid-icon {
  color: var(--green-dark);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ── Overpayment overlay ── */
.overpayment-overlay {
  position: fixed;
  inset: 0;
  background: rgba(89, 74, 66, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 1.5rem;
}

.overpayment-overlay-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.overpayment-overlay-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.overpayment-overlay-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.overpayment-overlay-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.overpayment-option {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}

.overpayment-option:hover {
  border-color: var(--ink);
  background: var(--white);
}

.overpayment-option--b {
  border-color: #FFFADB;
  background: #FFFADB;
}

.overpayment-option--b:hover {
  border-color: #FFD700;
}

.overpayment-option-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.overpayment-option-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.notable-day-row--pre_saved { background: #D4E8F5; }

.notable-amount--pre-saved {
  font-size: 1rem;
  font-weight: 600;
  color: #2980B9;
}

.entries-status-icon--pre-saved { background: #2980B9; }
.entries-status-icon--pre-saved svg { color: var(--white); }

.grid-cell.pre_saved { background: #D4E8F5; }

/* ── Mobile responsive ── */
@media (max-width: 600px) {
  .plan-card-name {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 480px) {
  .header { padding: 0.75rem 1rem; }
  .dashboard { padding: 1rem; }
  .plan-card { padding: 1rem; }

  .plan-card-total {
    font-size: 2rem;
    -webkit-text-stroke: 0.5px var(--ink);
  }

  .strip-cell { font-size: 0.85rem; }

  .strip-cell.today,
  .strip-cell.current {
    border-width: 2px !important;
  }

  .day-strip-cell.today             { border: 2px solid var(--red-dark) !important; }
  .day-strip-cell.completed.current { border: 2px solid var(--green-dark) !important; }
  .day-strip-cell.missed.current    { border: 2px solid var(--red-dark) !important; }
  .day-strip-cell.completed.overpaid         { border: 2px solid var(--green-dark) !important; }
  .day-strip-cell.completed.current.overpaid { border: 2px solid var(--green-dark) !important; }
  .strip-cell.completed.overpaid             { border: 2px solid var(--green-dark) !important; }
  .strip-cell.completed.current.overpaid     { border: 2px solid var(--green-dark) !important; }

  .plan-page { padding: 1.5rem 1rem 2rem; }
  .plan-top-centre { display: none; }

  .plan-running-total {
    font-size: 1.8rem;
    -webkit-text-stroke: 0.5px var(--ink);
  }

  .amount-input {
    font-size: 5rem;
    -webkit-text-stroke: 3px var(--green-dark);
  }

  .saved-amount {
    font-size: 5rem;
    -webkit-text-stroke: 3px var(--green-light);
  }

  .save-btn, .saved-btn, .future-btn {
    font-size: 1.5rem;
    padding: 0.85rem;
  }

  .day-strip-cell { font-size: 0.85rem; }
  .stat-label, .stat-value { font-size: 0.875rem; }
  .form-card { padding: 1.5rem; }
  .form-title { font-size: 1.5rem; }
  .onboarding-card { padding: 2rem 1.5rem; }
  .onboarding-title { font-size: 1.5rem; }
  .badges-panel { gap: 0.35rem; }
  .badge { padding: 0.3rem 0.65rem; }
  .badge-label { font-size: 0.72rem; }
}