:root {
  --bg1: #f7f8ff;
  --bg2: #eef9ff;
  --ink: #1f2440;
  --muted: rgba(31, 36, 64, 0.7);
  --card: rgba(255, 255, 255, 0.9);
  --stroke: rgba(31, 36, 64, 0.12);

  --shadow: 0 10px 30px rgba(31, 36, 64, 0.12);
  --shadow2: 0 8px 18px rgba(31, 36, 64, 0.10);

  --radius: 18px;
  --radius2: 14px;

  --accent1: #7c5cff;
  --accent2: #33c3ff;
  --accent3: #35d0a1;
  --gold: #ffc107;
  --danger: #ff5252;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  padding-bottom: 80px;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 20% 0%, var(--bg2), transparent 60%),
              radial-gradient(1200px 700px at 90% 10%, #fff1fb, transparent 55%),
              linear-gradient(180deg, var(--bg1), #ffffff);
  font-family: ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-tap-highlight-color: transparent;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 12px 22px;
  max-width: 1200px;
  margin: 0 auto;
}

.app-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-badge {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: white;
  font-weight: 900;
  box-shadow: var(--shadow2);
}

h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 2px 0 0 0;
  color: var(--muted);
  font-size: 13px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(31, 36, 64, 0.08);
  max-width: min(58vw, 560px);
  overflow-x: auto;
  scrollbar-width: none;
}

.person-picker::-webkit-scrollbar { display: none; }

.person-pill {
  flex: 0 0 auto;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.person-pill:hover {
  background: rgba(31, 36, 64, 0.06);
  color: var(--ink);
}

.person-pill:active { transform: translateY(1px); }

.person-pill:focus-visible {
  outline: 2px solid var(--pill, var(--accent1));
  outline-offset: 2px;
}

.person-pill.active {
  background: var(--pill, var(--accent1));
  color: #fff;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--pill, var(--accent1)) 40%, transparent);
}

/* Compact mode: initials-only circular chips for large families */
.person-picker.compact .person-pill {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.btn {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(31, 36, 64, 0.08);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0px);
}

.board {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 22px 24px 22px;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

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

.chart {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  padding: 16px 16px 10px 16px;
}

.chart-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.chart-hide-btn {
  opacity: 0.75;
}

.chart-peek {
  opacity: 0.6;
  border-style: dashed;
}

.chart h2 {
  margin: 0;
  font-size: 16px;
}

.chart-hint {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: var(--muted);
}

.progress {
  width: 110px;
  height: 10px;
  border-radius: 999px;
  background: rgba(31, 36, 64, 0.08);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent3), var(--accent2));
  border-radius: 999px;
  transition: width 180ms ease;
}

.items {
  list-style: none;
  padding: 8px 12px 14px 12px;
  margin: 0;
  display: grid;
  gap: 10px;
}

.item {
  position: relative;
}

.check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.card {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 12px 12px;
  border-radius: var(--radius2);
  border: 1px solid rgba(31, 36, 64, 0.12);
  background: var(--card);
  box-shadow: 0 8px 18px rgba(31, 36, 64, 0.06);
  cursor: pointer;
  user-select: none;
}

.card:hover {
  transform: translateY(-1px);
}

.icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.18), rgba(51, 195, 255, 0.18));
  border: 1px solid rgba(31, 36, 64, 0.08);
  font-size: 18px;
}

.text {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.15px;
}

.check:focus-visible + .card {
  outline: 3px solid rgba(124, 92, 255, 0.45);
  outline-offset: 2px;
}

.check:checked + .card {
  border-color: rgba(53, 208, 161, 0.55);
  background: rgba(242, 255, 250, 0.92);
}

.check:checked + .card .icon {
  background: linear-gradient(135deg, rgba(53, 208, 161, 0.25), rgba(51, 195, 255, 0.18));
}

.check:checked + .card .text {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(31, 36, 64, 0.22);
  color: rgba(31, 36, 64, 0.75);
}

.tabs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 22px 12px 22px;
  display: flex;
  gap: 8px;
}

/* Horizontally scrollable tab row (e.g. Settings categories) */
.tabs-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.tabs-scroll .tab { flex: 0 0 auto; }

.tab {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  padding: 10px 18px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 150ms ease;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.75);
}

.tab.active {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow2);
}

.app-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 22px 22px 22px;
}

.tiny {
  color: var(--muted);
  font-size: 12px;
}

/* ============ MOBILE NAV ============ */
.main-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--stroke);
  padding: 8px 0;
  z-index: 100;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: all 150ms ease;
}

.nav-btn.active {
  color: var(--accent1);
}

.nav-icon {
  font-size: 20px;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
}

/* ============ SECTIONS ============ */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 100px 16px; /* Bottom padding for nav bar */
}

.section.hidden {
  display: none;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.section-header h2 {
  margin: 0;
  font-size: 20px;
}

/* ============ STAR DISPLAY ============ */
.star-display {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 152, 0, 0.2));
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 20px;
}

.star-icon {
  font-size: 18px;
}

.star-count {
  font-weight: 800;
  font-size: 16px;
  color: #f57c00;
}

/* ============ CHORES ============ */
.chores-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chore-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius2);
  box-shadow: var(--shadow2);
}

.chore-card.completed {
  background: rgba(53, 208, 161, 0.1);
  border-color: rgba(53, 208, 161, 0.3);
}

.chore-card.saturday-chore {
  border-left: 4px solid var(--accent1);
}

.saturday-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: white;
  border-radius: 8px;
  vertical-align: middle;
  margin-left: 6px;
}

.chore-icon {
  font-size: 28px;
}

.chore-info {
  flex: 1;
}

.chore-name {
  font-weight: 700;
  font-size: 15px;
}

.chore-assignee {
  font-size: 13px;
  color: var(--muted);
}

.chore-next {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.7;
  margin-top: 2px;
}

.chore-check {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--stroke);
  background: white;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.chore-card.completed .chore-check {
  background: var(--accent3);
  border-color: var(--accent3);
  color: white;
}

/* ============ LAUNDRY ============ */
.laundry-today {
  padding: 20px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  border-radius: var(--radius);
  color: white;
  margin-bottom: 20px;
}

.laundry-today h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  opacity: 0.9;
}

.laundry-today-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.laundry-today-text {
  display: flex;
  align-items: center;
  gap: 12px;
}

.laundry-today-icon {
  font-size: 36px;
}

.laundry-today-desc {
  font-size: 22px;
  font-weight: 700;
}

.laundry-check {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: white;
}

.laundry-check.completed {
  background: white;
  color: var(--accent3);
}

.laundry-week {
  display: grid;
  gap: 8px;
}

.laundry-day {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius2);
}

.laundry-day.today {
  border-color: var(--accent1);
  background: rgba(124, 92, 255, 0.05);
}

.laundry-day-name {
  width: 80px;
  font-weight: 700;
  font-size: 13px;
}

.laundry-day-icon {
  font-size: 20px;
}

.laundry-day-desc {
  flex: 1;
  font-size: 14px;
}

/* ============ MEALS ============ */
.meal-section-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
#mealsSection > .section-header { flex-wrap: wrap; gap: 12px; }
#addMealBtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; font-size: 13px; font-weight: 700; font-family: inherit; background: var(--accent1); color: white; border-color: var(--accent1); box-shadow: 0 4px 12px color-mix(in srgb, var(--accent1) 18%, transparent); white-space: nowrap; }
#mealPlanSettingsForm { max-width: 640px; }
#mealPlanSettingsForm [hidden] { display: none !important; }
.meal-descriptor-fields { border: 0; padding: 0; margin: 20px 0; min-width: 0; }
.meal-descriptor-fields legend { font-size: 14px; font-weight: 750; }
.meal-descriptor-fields > .settings-hint { margin: 8px 0 18px; }
.meal-descriptor-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 12px; margin-bottom: 10px; }
.meal-descriptor-row label { font-size: 13px; font-weight: 650; }
.meal-descriptor-row .form-input { min-width: 0; }
@media (max-width: 400px) { .meal-descriptor-row { grid-template-columns: 82px minmax(0, 1fr); gap: 8px; } }

.meals-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  touch-action: pan-y pinch-zoom;
}

.meal-week-navigation { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 12px; padding: 12px; margin-bottom: 18px; background: var(--card); border: 1px solid var(--stroke); border-radius: 16px; }
.meal-week-arrow { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; }
.meal-week-arrow:disabled { opacity: .45; cursor: default; transform: none; }
.meal-week-summary { min-width: 0; text-align: center; }
#mealWeekRange { margin: 0; font-size: 14px; line-height: 1.5; font-weight: 750; }
#mealThisWeek { min-height: 32px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; color: var(--accent1); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
#mealThisWeek:disabled { color: var(--muted); cursor: default; }
#mealThisWeek:not(:disabled):hover { background: color-mix(in srgb, var(--accent1) 7%, white); }
.meal-week-navigation button:focus-visible { outline: 2px solid var(--accent1); outline-offset: 3px; }

.meal-day {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

.meal-day-header {
  width: 100%;
  border: 0;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  padding: 12px 16px;
  background: rgba(124, 92, 255, 0.08);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.meal-day-header:focus-visible { outline: 2px solid var(--accent1); outline-offset: -3px; }
.meal-day-header:hover { filter: brightness(0.97); }

.meal-category {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
  max-width: 60%;
}

.meal-day-header.today .meal-category {
  color: rgba(255, 255, 255, 0.86);
}

.meal-day-header.today {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: white;
}

.meal-items {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.02);
  border-radius: 10px;
}

.meal-type {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  width: 70px;
  text-transform: capitalize;
}

.meal-desc {
  flex: 1;
  font-size: 14px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.meal-recipe-link { border: 0; background: none; text-align: left; padding: 4px 0; color: var(--ink); font-family: inherit; cursor: pointer; }
.meal-recipe-link:hover { color: var(--accent1); }
.meal-recipe-link small { display: block; color: var(--accent1); font-size: 11px; margin-top: 4px; }
.meal-type, .meal-delete { flex-shrink: 0; }
#mealModal [hidden] { display: none !important; }
#mealModal .modal-content { max-width: 460px; }
.meal-source-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.meal-source-options legend { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.meal-source-options label { display: flex; align-items: center; gap: 7px; padding: 12px 10px; border: 1px solid var(--stroke); border-radius: 12px; font-size: 12px; cursor: pointer; }
.meal-source-options label:has(input:checked) { background: color-mix(in srgb, var(--accent1) 7%, white); border-color: var(--accent1); color: var(--accent1); }
.meal-source-options input, .meal-recipe-option input { accent-color: var(--accent1); margin: 0; flex-shrink: 0; }
.meal-recipe-results { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 3px; }
.meal-recipe-option { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--stroke); border-radius: 12px; cursor: pointer; }
.meal-recipe-option:has(input:checked) { border-color: var(--accent1); background: color-mix(in srgb, var(--accent1) 7%, white); }
.meal-recipe-option strong { display: block; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.meal-recipe-option small { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }
.meal-picker-hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.meal-recipe-pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 12px; }
.meal-form-error { padding: 12px; border-radius: 12px; background: #fff0ee; color: #b42318; font-size: 13px; line-height: 1.5; }
@media (max-width: 400px) { .meal-source-options { grid-template-columns: 1fr; } #mealModal { padding: 16px; } }

.meal-delete {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 82, 82, 0.1);
  color: var(--danger);
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}

.no-meals {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.meal-defaults-form {
  display: grid;
  gap: 12px;
}

.meal-default-row {
  margin-bottom: 0;
}

/* ============ STARS TOTALS ============ */
.star-totals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.star-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius2);
  box-shadow: var(--shadow2);
}

.star-card-name {
  font-weight: 700;
  font-size: 14px;
}

.star-card-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 24px;
  font-weight: 800;
  color: #f57c00;
}

.star-card-count .star-emoji {
  font-size: 20px;
}

/* ============ BONUS CHORES ============ */
.bonus-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.bonus-tab {
  padding: 8px 16px;
  border: 1px solid var(--stroke);
  background: var(--card);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.bonus-tab.active {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: white;
  border-color: transparent;
}

.bonus-chores-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bonus-chore-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius2);
}

.bonus-chore-card.unavailable {
  opacity: 0.5;
}

.bonus-chore-card.star-type {
  border-left: 4px solid var(--gold);
}

.bonus-chore-card.paid-type {
  border-left: 4px solid var(--accent3);
}

.bonus-chore-icon {
  font-size: 24px;
}

.bonus-chore-info {
  flex: 1;
}

.bonus-chore-name {
  font-weight: 700;
  font-size: 14px;
}

.bonus-chore-meta {
  font-size: 12px;
  color: var(--muted);
}

.bonus-chore-reward {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 14px;
}

.bonus-chore-card.star-type .bonus-chore-reward {
  background: rgba(255, 193, 7, 0.15);
  color: #f57c00;
}

.bonus-chore-card.paid-type .bonus-chore-reward {
  background: rgba(53, 208, 161, 0.15);
  color: #00897b;
}

.bonus-chore-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: white;
}

.bonus-chore-card.unavailable .bonus-chore-btn {
  background: var(--stroke);
  color: var(--muted);
  cursor: default;
}

/* ============ FAMILY SECTION ============ */
.family-totals {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.family-member-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
}

.family-member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  display: grid;
  place-items: center;
  font-size: 20px;
  color: white;
  font-weight: 700;
}

.family-member-info {
  flex: 1;
}

.family-member-name {
  font-weight: 700;
  font-size: 16px;
}

.family-member-stats {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}

.family-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}

.family-stat-icon {
  font-size: 14px;
}

.family-stat-value {
  font-weight: 700;
}

.family-stat.stars .family-stat-value {
  color: #f57c00;
}

.family-stat.money .family-stat-value {
  color: #00897b;
}

/* ============ MY STATS ============ */
.my-stats-card {
  padding: 20px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  border-radius: var(--radius);
  color: white;
  margin-bottom: 20px;
}

.my-stats-name {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.my-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.my-stat-item {
  text-align: center;
}

.my-stat-value {
  font-size: 32px;
  font-weight: 800;
}

.my-stat-label {
  font-size: 12px;
  opacity: 0.9;
}

.my-stats-pay-btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.2);
  color: white;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.history-section {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
}

.history-section h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

/* ============ ROTATION SETUP ============ */
.rotation-start-select {
  margin-top: 8px;
}

.rotation-start-select label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.rotation-start-select select {
  padding: 6px 10px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  font-size: 13px;
  width: 100%;
}

/* ============ USER SELECT LIST (for bonus chores) ============ */
.user-select-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-select-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 150ms ease;
}

.user-select-btn:hover {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.1), rgba(51, 195, 255, 0.1));
  border-color: var(--accent1);
}

.user-select-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
}

.user-select-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 150ms ease;
}

.user-select-checkbox:hover {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.1), rgba(51, 195, 255, 0.1));
  border-color: var(--accent1);
}

.user-select-checkbox:has(input:checked) {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.15), rgba(51, 195, 255, 0.15));
  border-color: var(--accent1);
}

.user-select-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent1);
}

.bonus-confirm-btn {
  margin-top: 12px;
  width: 100%;
}

/* ============ EXPANDABLE FAMILY CARDS ============ */
.family-member-card {
  cursor: pointer;
  transition: all 150ms ease;
}

.family-member-card.expanded {
  border-color: var(--accent1);
}

.family-member-actions {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke);
}

.family-member-card.expanded .family-member-actions {
  display: flex;
  gap: 10px;
}

.give-star-btn, .pay-btn, .add-money-btn, .reward-btn, .redeem-btn {
  flex: 1;
  padding: 10px;
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.reward-btn {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.redeem-btn {
  background: linear-gradient(135deg, #ec4899, #f472b6);
}

.redeem-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Reward progress on family card */
.reward-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.reward-progress-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--stroke);
}

.reward-progress-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reward-progress-placeholder {
  font-size: 22px;
}

.reward-progress-text {
  font-size: 13px;
  color: var(--text);
}

/* Reward image modal preview */
.reward-preview {
  width: 100%;
  height: 180px;
  border-radius: 12px;
  border: 1px dashed var(--stroke);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--bg);
}

.reward-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.reward-preview-placeholder {
  color: var(--muted, #888);
  font-size: 16px;
}

/* Star reward celebration popup */
.star-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  padding: 20px;
  animation: starPopupFade 0.25s ease;
}

.star-popup-card {
  background: var(--card);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  animation: starPopupPop 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.star-popup-burst {
  font-size: 56px;
  animation: starSpin 0.6s ease;
}

.star-popup-title {
  margin: 8px 0 4px;
  font-size: 18px;
}

.star-popup-count {
  font-weight: 700;
  color: #f59e0b;
  margin-bottom: 14px;
}

.star-popup-reward {
  margin: 0 auto 14px;
}

.star-popup-reward img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 12px;
  object-fit: contain;
}

.star-popup-reward.no-image {
  font-size: 44px;
  opacity: 0.8;
}

.star-popup-reward-label {
  font-size: 12px;
  color: var(--muted, #888);
  margin-bottom: 6px;
}

.star-popup-goal {
  font-size: 15px;
  margin-bottom: 18px;
}

.star-popup-goal.reached {
  color: #ec4899;
  font-weight: 700;
}

.star-popup-close {
  width: 100%;
}

@keyframes starPopupFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes starPopupPop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes starSpin {
  from { transform: rotate(-30deg) scale(0.5); }
  to { transform: rotate(0) scale(1); }
}

/* ============ ADMIN ============ */
.admin-tab-content {
  margin-top: 16px;
}

.admin-tab-content.hidden {
  display: none;
}

.admin-group-title {
  font-size: 15px;
  margin: 18px 0 8px;
  color: var(--text);
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
}

.admin-row-title {
  font-weight: 700;
  font-size: 15px;
}

.admin-row-meta {
  font-size: 12px;
  color: var(--muted, #888);
  margin-top: 2px;
}

.admin-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.settings-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--stroke);
  border-radius: var(--radius2, 14px);
  box-shadow: var(--shadow2);
  padding: 18px;
  margin-bottom: 14px;
}

.settings-card-title {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 10px;
}

.settings-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.settings-card-head .settings-card-title {
  margin-bottom: 0;
}

.settings-card-actions {
  margin-top: 14px;
}

.settings-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 10px;
}

.admin-add-member {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.laundry-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.laundry-edit-day {
  flex: 0 0 92px;
  font-weight: 700;
  font-size: 14px;
}

.laundry-edit-icon {
  flex: 0 0 56px;
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}

.laundry-edit-desc {
  flex: 1 1 auto;
  min-width: 0;
}

.admin-add-member .form-input {
  flex: 1;
}

.chart-item-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.chart-item-row .item-icon {
  width: 56px;
  flex-shrink: 0;
  text-align: center;
}

.chart-item-row .item-name {
  flex: 1;
}

.completed-toggle-row {
  display: flex;
  justify-content: center;
  margin: 4px 0 8px;
}

.item-users-btn {
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 64px;
}

.modal-hint {
  font-size: 12px;
  color: #888;
  margin: -8px 0 12px;
}

.give-star-btn {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.pay-btn {
  background: linear-gradient(135deg, var(--accent3), #2dd4bf);
}

.add-money-btn {
  background: linear-gradient(135deg, #10b981, #34d399);
}

/* ============ ACTIVITY LOG ============ */
.activity-log {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 16px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--stroke);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  font-size: 18px;
}

.activity-info {
  flex: 1;
}

.activity-text {
  font-size: 14px;
}

.activity-text strong {
  font-weight: 700;
}

.activity-date {
  font-size: 12px;
  color: var(--muted);
}

.star-history {
  padding: 16px;
  padding-bottom: 100px; /* Space for bottom nav */
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
}

.star-history h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

.star-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--stroke);
}

.star-history-item:last-child {
  border-bottom: none;
}

.star-history-icon {
  font-size: 18px;
}

.star-history-info {
  flex: 1;
}

.star-history-reason {
  font-size: 14px;
  font-weight: 600;
}

.star-history-date {
  font-size: 12px;
  color: var(--muted);
}

/* ============ MODALS ============ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin: 0 0 12px 0;
}

.home-screen-intro {
  color: var(--muted);
  margin: 0 0 16px 0;
  line-height: 1.45;
}

.home-screen-list {
  margin: 0 0 4px 0;
  padding-left: 22px;
  display: grid;
  gap: 10px;
}

.home-screen-list li {
  line-height: 1.45;
}

.modal-hint {
  margin: 0 0 16px 0;
  font-size: 13px;
  color: var(--muted);
}

.rotation-checkbox-group {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--stroke);
}

.rotation-checkbox-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.rotation-checkbox-group h4 {
  margin: 0 0 10px 0;
  font-size: 15px;
}

.rotation-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rotation-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: all 150ms ease;
}

.rotation-checkbox-label:has(input:checked) {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.15), rgba(51, 195, 255, 0.15));
  border-color: var(--accent1);
}

.rotation-checkbox-label input {
  display: none;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn {
  flex: 1;
}

/* ============ FORMS ============ */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent1);
}

.assign-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--stroke);
}

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

.assign-chore {
  flex: 1;
  font-weight: 600;
}

.assign-select {
  padding: 8px 12px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
}

/* ============ BUTTONS ============ */
.btn-small {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-icon {
  padding: 8px 12px;
  font-size: 18px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  cursor: pointer;
}

/* ============ MOBILE RESPONSIVE ============ */
@media (max-width: 600px) {
  .app-header {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
  }

  .app-title { flex: 1; min-width: 0; }
  .app-badge { flex-shrink: 0; }
  .header-right { display: contents; }
  
  .app-actions {
    order: 1;
    width: 100%;
    justify-content: space-between;
  }

  .person-picker { flex: 1; min-width: 0; max-width: none; }
  
  .board {
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }
  
  h1 {
    font-size: 20px;
  }
  
  .tabs {
    padding: 0 16px 12px 16px;
  }
  
  .tab {
    padding: 8px 14px;
    font-size: 13px;
  }
}

/* ============ SHOPPING LIST ============ */
.shopping-section-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.shopping-add {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.shopping-add .form-input {
  flex: 1;
  min-width: 0;
}

.shopping-add .btn {
  flex-shrink: 0;
  min-height: 44px;
  padding: 10px 18px;
  font-weight: 700;
  background: var(--accent1);
  color: white;
  border-color: var(--accent1);
}

.shopping-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shopping-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius2);
}

.shopping-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.shopping-check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: var(--accent1);
  cursor: pointer;
}

.shopping-name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  word-break: break-word;
}

.shopping-item.checked {
  opacity: 0.6;
}

.shopping-item.checked .shopping-name {
  text-decoration: line-through;
  color: var(--muted);
}

.shopping-delete {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.shopping-delete:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.shopping-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: var(--card);
  border: 1px dashed var(--stroke);
  border-radius: var(--radius2);
}

.meal-shopping-dialog { border: 0; border-radius: var(--radius); padding: 24px; width: min(540px, calc(100vw - 32px)); max-height: 85vh; overflow-y: auto; color: var(--text); }
.meal-shopping-dialog::backdrop { background: rgb(0 0 0 / 45%); }
.meal-shopping-dialog h3 { margin-top: 0; }
.meal-shopping-dates { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.meal-shopping-dates label { flex: 1; min-width: 130px; }
.meal-shopping-ingredient { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.meal-shopping-ingredient > span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.meal-shopping-ingredient small { display: block; color: var(--muted); margin-top: 3px; }
.meal-shopping-ingredient input { width: 20px; height: 20px; flex-shrink: 0; }
.meal-shopping-ingredient:has(input:checked) strong { color: var(--muted); text-decoration: line-through; }

.recurring-editor { padding: 18px 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; display: grid; gap: 12px; }
.recurring-editor > label { display: grid; gap: 6px; }
.recurring-frequency { display: flex; gap: 12px; }
.recurring-frequency label { flex: 1; min-width: 0; display: grid; gap: 6px; }
.recurring-editor .recurring-active { display: flex; align-items: center; gap: 8px; }
.recurring-active input { width: 18px; height: 18px; }
.recurring-history { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.recurring-history small { color: var(--muted); flex-shrink: 0; }
.meal-section-actions { flex-wrap: wrap; }

.shopping-purchased-label { color: var(--muted); margin-left: 8px; font-size: 0.75rem; }

.recurring-table-scroll { max-width: 100%; overflow-x: auto; margin: 16px 0; border: 1px solid var(--stroke); border-radius: var(--radius2); }
.recurring-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.recurring-table th, .recurring-table td { padding: 12px 16px; white-space: nowrap; border-bottom: 1px solid var(--stroke); vertical-align: middle; }
.recurring-table thead th { color: var(--muted); font-size: 12px; font-weight: 600; background: var(--card); }
.recurring-table tbody th { font-weight: 600; }
.recurring-table tbody tr:last-child > * { border-bottom: 0; }
.recurring-table tbody tr:hover { background: color-mix(in srgb, var(--accent1) 4%, transparent); }
.recurring-table-muted, .recurring-paused > th { color: var(--muted); }
.recurring-switch { position: relative; display: inline-flex; align-items: center; width: 38px; height: 24px; cursor: pointer; vertical-align: middle; }
.recurring-switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.recurring-switch span { width: 38px; height: 22px; border-radius: 20px; background: var(--muted); pointer-events: none; transition: background .15s; }
.recurring-switch span::after { content: ''; display: block; width: 16px; height: 16px; margin: 3px; border-radius: 50%; background: white; transition: transform .15s; }
.recurring-switch input:checked + span { background: var(--accent1); }
.recurring-switch input:checked + span::after { transform: translateX(16px); }
.recurring-switch input:focus-visible + span { outline: 2px solid var(--accent1); outline-offset: 3px; }
.recurring-switch input:disabled + span { opacity: .5; }

#adminShoppingTab .settings-card { min-width: 0; }

.main-nav[hidden], .main-nav .nav-btn[hidden] { display: none; }
.navigation-settings-list { padding: 0; margin: 16px 0; list-style: none; }
.navigation-settings-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--stroke); }
.navigation-settings-position { color: var(--muted); font-size: 12px; width: 18px; text-align: center; }
.navigation-settings-name { flex: 1; font-weight: 600; }
.navigation-settings-hidden .navigation-settings-name { color: var(--muted); }
.navigation-settings-show { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.navigation-settings-show input { width: 18px; height: 18px; accent-color: var(--accent1); }
 .navigation-settings-handle { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.navigation-settings-handle:hover { background: color-mix(in srgb, var(--accent1) 8%, transparent); color: var(--accent1); }
.navigation-settings-handle:focus-visible { outline: 2px solid var(--accent1); outline-offset: 2px; }
.navigation-settings-handle:disabled { cursor: default; opacity: .5; }
.navigation-settings-dragging { position: relative; z-index: 1; background: var(--card); border-radius: 10px; box-shadow: var(--shadow2); outline: 2px solid var(--accent1); }
.navigation-settings-dragging .navigation-settings-handle, .navigation-reordering { cursor: grabbing; }
.navigation-reordering { user-select: none; -webkit-user-select: none; }

#starDisplay[hidden], .goal-dialog [hidden] { display: none; }
#goalsSection .section-header { gap: 16px; flex-wrap: wrap; }
#goalsPersonSummary { margin-bottom: 0; }
.goals-list { padding: 0 0 24px; }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.goal-card { padding: 20px; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow2); min-width: 0; overflow-wrap: anywhere; }
.goal-card h3 { margin: 14px 0; font-size: 18px; line-height: 1.4; }
.goal-card-heading { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.goal-category { color: var(--accent1); background: color-mix(in srgb, var(--accent1) 9%, transparent); padding: 5px 10px; border-radius: 20px; }
.goal-complete-badge { color: var(--muted); }
.goal-date { color: var(--muted); font-size: 13px; }
.goal-overdue { color: var(--danger); }
.goal-reward { font-size: 14px; line-height: 1.5; }
.goal-reward > span { font-weight: 700; }
.goal-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.goal-empty { text-align: center; padding: 36px 20px; border: 1px dashed var(--stroke); border-radius: var(--radius); color: var(--muted); }
.goal-empty h3 { color: var(--ink); }
.goals-completed-heading { margin: 28px 0 16px; font-size: 16px; color: var(--muted); }
.goal-field { display: grid; gap: 6px; margin: 16px 0; font-size: 14px; font-weight: 600; }
.goal-field .settings-hint { font-weight: 400; }
.goal-rewards-toggle { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.goal-rewards-toggle input { width: 20px; height: 20px; accent-color: var(--accent1); }

.goal-category-control { position: relative; display: flex; }
.goal-category-control input { padding-right: 44px; }
.goal-category-toggle { position: absolute; right: 0; top: 0; bottom: 0; width: 44px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.goal-category-options { border: 1px solid var(--stroke); border-radius: 10px; background: white; max-height: 200px; overflow-y: auto; margin-top: 4px; padding: 4px; font-weight: 400; }
.goal-category-options [role=option] { padding: 12px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.goal-category-options [role=option]:hover, .goal-category-options [aria-selected=true] { background: color-mix(in srgb, var(--accent1) 12%, transparent); color: var(--accent1); }
.goal-category-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--stroke); }
.goal-category-name { display: grid; gap: 6px; flex: 1; min-width: 140px; }
.goal-category-usage { color: var(--muted); font-size: 12px; }
.goal-category-row-actions, .goal-category-add { display: flex; gap: 8px; }
.goal-category-add { margin-top: 20px; flex-wrap: wrap; }
.goal-category-add input { flex: 1; min-width: 140px; }

.record-active-control { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.admin-row-actions { flex-wrap: wrap; align-items: center; }

.admin-row { flex-wrap: wrap; }
.admin-row-main { flex: 1; min-width: 160px; overflow-wrap: anywhere; }
.admin-row-actions { max-width: 100%; }

#bucketListSection .section-header { gap: 16px; flex-wrap: wrap; padding: 24px 0 12px; }
#bucketListSection .section-header h2 { font-size: clamp(22px, 4vw, 30px); letter-spacing: -.6px; }
#bucketListSection .section-header .settings-hint { margin-bottom: 0; line-height: 1.6; }
#bucketListStatus { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 28px; }
.bucket-stat { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; background: rgba(255,255,255,.75); border: 1px solid var(--stroke); border-radius: 30px; font-size: 13px; }
.bucket-stat strong { color: var(--accent1); font-size: 17px; }
.bucket-list-items { padding-bottom: 32px; }
.bucket-section-heading { margin: 26px 0 16px; }
.bucket-section-heading h3 { margin: 0; font-size: 17px; }
.bucket-section-heading p { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.bucket-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 20px; }
.bucket-list-item { --bucket-tint: #f2eaff; --bucket-pop: #dcc8fc; --bucket-ink: #69429d; display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: linear-gradient(155deg, #fff 25%, var(--bucket-tint)); border: 1px solid color-mix(in srgb, var(--bucket-ink) 18%, white); border-radius: 22px; box-shadow: 0 5px 18px rgb(31 36 64 / 7%); transition: transform .18s, box-shadow .18s; }
.bucket-theme-1 { --bucket-tint: #fff2d9; --bucket-pop: #f9d994; --bucket-ink: #8e5914; }
.bucket-theme-2 { --bucket-tint: #ddf5ed; --bucket-pop: #a8e6d2; --bucket-ink: #246b58; }
.bucket-theme-3 { --bucket-tint: #e1efff; --bucket-pop: #b7d8fc; --bucket-ink: #326296; }
.bucket-theme-4 { --bucket-tint: #ffe8e4; --bucket-pop: #fac3bb; --bucket-ink: #9a4a44; }
.bucket-theme-5 { --bucket-tint: #fce7f2; --bucket-pop: #f4c0dc; --bucket-ink: #95456e; }
.bucket-card-art { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 100px; padding: 20px 24px; overflow: hidden; background: var(--bucket-tint); color: var(--bucket-ink); }
.bucket-card-art::before, .bucket-card-art::after { content: ''; position: absolute; border-radius: 50%; background: var(--bucket-pop); opacity: .5; pointer-events: none; }
.bucket-card-art::before { width: 150px; height: 150px; right: -30px; top: -80px; }
.bucket-card-art::after { width: 75px; height: 75px; left: -25px; bottom: -48px; }
.bucket-card-art svg { width: 62px; height: 56px; position: relative; z-index: 1; flex-shrink: 0; }
.bucket-card-stamp { position: relative; z-index: 1; padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--bucket-ink) 25%, transparent); background: rgb(255 255 255 / 50%); border-radius: 20px; font-size: 11px; font-weight: 700; }
.bucket-list-content { flex: 1; min-width: 0; padding: 22px 24px 16px; overflow-wrap: anywhere; }
.bucket-list-content h3 { margin: 0; font-size: 20px; line-height: 1.4; letter-spacing: -.3px; }
.bucket-list-description { white-space: pre-wrap; font-size: 14px; line-height: 1.65; color: var(--muted); margin: 10px 0 0; }
.bucket-list-date { font-size: 12px; line-height: 1.6; color: var(--bucket-ink); margin: 14px 0 0; font-weight: 600; }
.bucket-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 24px 22px; }
.bucket-complete-action { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 12px; background: white; border: 1px solid color-mix(in srgb, var(--bucket-ink) 35%, white); border-radius: 12px; color: var(--bucket-ink); font-size: 13px; font-weight: 700; cursor: pointer; }
.bucket-list-check { width: 18px; height: 18px; margin: 0; accent-color: var(--bucket-ink); cursor: pointer; }
.bucket-complete-action:has(input:focus-visible) { outline: 2px solid var(--bucket-ink); outline-offset: 3px; }
.bucket-complete-action:has(input:disabled) { opacity: .6; cursor: wait; }
.bucket-edit { background: transparent; border: 0; color: var(--bucket-ink); font: inherit; font-size: 12px; padding: 10px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.bucket-empty { text-align: center; background: linear-gradient(125deg, #f2eaff, #fff2d9 55%, #ddf5ed); padding: 44px 24px; border: 1px solid var(--stroke); border-radius: 24px; }
.bucket-empty > span { font-size: 48px; color: var(--accent1); }
.bucket-empty h3 { font-size: 23px; margin: 12px 0; }
.bucket-empty p { max-width: 420px; margin: 0 auto 24px; color: var(--muted); line-height: 1.7; }
.bucket-list-dialog [hidden] { display: none; }
.bucket-list-dialog textarea { resize: vertical; min-height: 90px; }
.bucket-celebration { position: fixed; inset: 0; z-index: 250; pointer-events: none; }
.bucket-celebration-message { position: absolute; bottom: max(100px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(440px, calc(100% - 32px)); padding: 24px 40px 24px 24px; background: linear-gradient(125deg, #fff8e6, #f4ecff); border: 1px solid #ddc9a0; border-radius: 22px; box-shadow: 0 12px 50px rgb(60 40 100 / 22%); text-align: center; pointer-events: auto; animation: bucket-celebration-in .35s ease-out; }
.bucket-celebration-star { font-size: 36px; color: #92601a; }
.bucket-celebration-message h3 { margin: 6px 0 10px; font-size: 22px; }
.bucket-celebration-message p { margin: 0 0 12px; font-weight: 600; overflow-wrap: anywhere; }
.bucket-celebration-message small { color: var(--muted); line-height: 1.6; }
.bucket-celebration-message button { position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; border: 0; background: transparent; font-size: 24px; color: var(--muted); cursor: pointer; border-radius: 50%; }
.bucket-confetti { position: absolute; inset: 0; overflow: hidden; }
.bucket-confetti i { position: absolute; left: var(--x); top: -24px; width: 9px; height: 15px; background: var(--confetti-color); border-radius: 2px; opacity: 0; animation: bucket-confetti-fall 2.8s var(--delay) ease-out forwards; }
@keyframes bucket-confetti-fall { 0% { opacity: 1; transform: translateY(-10px) rotate(0); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--drift), 95vh) rotate(var(--turn)); } }
@keyframes bucket-celebration-in { from { opacity: 0; transform: translate(-50%, 18px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (hover: hover) { .bucket-list-item:hover { transform: translateY(-3px); box-shadow: 0 9px 24px rgb(31 36 64 / 12%); } }
@media (prefers-reduced-motion: reduce) { .bucket-list-item { transition: none; } .bucket-list-item:hover { transform: none; } .bucket-confetti { display: none; } .bucket-celebration-message { animation: none; } }

#familyNameHeading { overflow-wrap: anywhere; }
.app-title > div:last-child { min-width: 0; }

/* Guided setup: the masks block the background while the highlighted UI stays usable. */
#welcomeTour[hidden], #welcomeTour [hidden] { display: none !important; }
.welcome-tour-mask { position: fixed; z-index: 1000; background: rgb(35 39 45 / 62%); touch-action: none; }
#welcomeTourHighlight { position: fixed; z-index: 1001; border: 2px solid white; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 3px rgb(47 111 237 / 60%); }
#welcomeTourArrow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1002; pointer-events: none; }
#welcomeTourCard { position: fixed; z-index: 1003; width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 20px; border-radius: 16px; background: white; color: #202938; box-shadow: 0 12px 44px rgb(0 0 0 / 24%); }
#welcomeTourCard:focus { outline: none; }
#welcomeTourCard h2 { margin: 6px 0 10px; font-size: 20px; }
#welcomeTourDescription { font-size: 14px; line-height: 1.6; margin: 0 0 18px; }
.welcome-tour-progress { margin: 0; color: #526382; font-size: 12px; font-weight: 700; }
.welcome-tour-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
#welcomeTourNext { margin-left: auto; }
#welcomeTourNext:disabled { opacity: .5; cursor: default; }
.welcome-tour-hint { margin: 12px 0 0; color: #637084; font-size: 12px; line-height: 1.5; }

/* A quiet accent for each area, shared by its navigation and settings tab. */
:root { --section-accent: #62538f; --section-wash: #f4f1fa; }
:is(#chartsSection, #adminChartsTab, [data-section="charts"], [data-admin-tab="charts"]) { --section-accent: #6550a0; --section-wash: #f3effa; }
:is(#choresSection, #adminChoresTab, [data-section="chores"], [data-admin-tab="chores"]) { --section-accent: #24715c; --section-wash: #edf7f2; }
:is(#laundrySection, #adminLaundryTab, [data-section="laundry"], [data-admin-tab="laundry"]) { --section-accent: #35678e; --section-wash: #edf5fc; }
:is(#mealsSection, #adminMealsTab, [data-section="meals"], [data-admin-tab="meals"]) { --section-accent: #925c2c; --section-wash: #fcf3e8; }
:is(#recipesSection, [data-section="recipes"]) { --section-accent: #945449; --section-wash: #faf0eb; }
:is(#shoppingSection, #adminShoppingTab, [data-section="shopping"], [data-admin-tab="shopping"]) { --section-accent: #26716d; --section-wash: #edf7f5; }
:is(#goalsSection, #adminGoalsTab, [data-section="goals"], [data-admin-tab="goals"]) { --section-accent: #6c5394; --section-wash: #f5f0fa; }
:is(#bucketListSection, [data-section="bucketList"]) { --section-accent: #80578c; --section-wash: #f8f0f8; }
:is(#familySection, #adminFamilyTab, [data-section="family"], [data-admin-tab="family"]) { --section-accent: #90536d; --section-wash: #fcf0f4; }
#adminSection { --section-accent: #526382; --section-wash: #f1f4f9; }

.main-nav .nav-btn { border-radius: 13px; margin: 0 2px; }
.main-nav .nav-icon { display: grid; place-items: center; width: 34px; height: 30px; border-radius: 10px; background: var(--section-wash); }
.main-nav .nav-btn.active { color: var(--section-accent); background: var(--section-wash); box-shadow: inset 0 -3px 0 var(--section-accent); }
.main-nav .nav-btn.active .nav-label { font-weight: 800; }
.main-nav .nav-btn:focus-visible { outline-color: var(--section-accent); }
.section .tab.active { background: var(--section-wash); color: var(--section-accent); border: 1px solid color-mix(in srgb, var(--section-accent) 30%, white); box-shadow: inset 0 -2px 0 var(--section-accent); }
.section:not(#bucketListSection) > .section-header h2 { border-inline-start: 4px solid var(--section-accent); padding-inline-start: 12px; }
.section > .section-header > .btn:not(.btn-secondary), #mealsSection #addMealBtn { background: var(--section-accent); border-color: var(--section-accent); color: white; }
.section .form-input:focus { border-color: var(--section-accent); outline-color: var(--section-accent); }
.section :is(button, input, select, textarea):focus-visible { outline-color: var(--section-accent); }

#chartsSection .chart { border-top: 3px solid color-mix(in srgb, var(--section-accent) 65%, white); background: rgb(255 255 255 / 80%); }
#chartsSection .chart-header { background: linear-gradient(110deg, var(--section-wash), rgb(255 255 255 / 50%)); padding-bottom: 16px; }
#chartsSection .icon { background: var(--section-wash); }
#choresSection .chore-card:not(.completed) { background: linear-gradient(100deg, white 65%, var(--section-wash)); }
#choresSection .chore-icon, #choresSection .bonus-chore-icon { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 13px; background: var(--section-wash); }
#choresSection .chore-info, #choresSection .bonus-chore-info { min-width: 0; overflow-wrap: anywhere; }
#choresSection .chore-card.saturday-chore { border-left-color: var(--section-accent); }
#choresSection .saturday-badge { background: var(--section-wash); color: var(--section-accent); border: 1px solid color-mix(in srgb, var(--section-accent) 30%, white); }
#choresSection .bonus-tab.active { background: var(--section-wash); color: var(--section-accent); border-color: var(--section-accent); }
#choresSection .bonus-chore-card:not(.unavailable) .bonus-chore-btn { background: var(--section-accent); }
#laundrySection .laundry-today { background: linear-gradient(110deg, var(--section-wash), #f8fbff); color: var(--ink); border: 1px solid #cfdfed; border-inline-start: 4px solid var(--section-accent); }
#laundrySection .laundry-today h3 { color: var(--section-accent); opacity: 1; }
#laundrySection .laundry-check { color: var(--section-accent); background: white; border-color: var(--section-accent); }
#laundrySection .laundry-check.completed { color: white; background: #26715b; border-color: #26715b; }
#laundrySection .laundry-day.today { background: var(--section-wash); border-color: var(--section-accent); }
#laundrySection .laundry-day-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; background: var(--section-wash); border-radius: 10px; }
#mealsSection .meal-week-navigation { background: linear-gradient(110deg, white, var(--section-wash)); border-color: #e9dac9; }
#mealsSection .meal-day-header { background: var(--section-wash); color: var(--ink); }
#mealsSection .meal-day-header.today { background: #f7e4ce; color: #70441e; box-shadow: inset 4px 0 0 var(--section-accent); }
#mealsSection .meal-day-header.today .meal-category { color: #70441e; }
#mealsSection .meal-type { color: var(--section-accent); }
#mealsSection .meal-recipe-link small { color: var(--section-accent); }
#recipesSection { --accent1: var(--section-accent); --recipe-tint: var(--section-wash); }
#recipesSection .recipe-card-placeholder { background: linear-gradient(130deg, var(--section-wash), #fffaf4); }
#shoppingSection .shopping-add { padding: 12px; background: var(--section-wash); border: 1px solid #d2e7e0; border-radius: 18px; }
#shoppingSection > .section-header { flex-wrap: wrap; gap: 12px; }
#shoppingSection .shopping-add .btn { background: var(--section-accent); border-color: var(--section-accent); }
#shoppingSection .shopping-check { accent-color: var(--section-accent); }
#shoppingSection .shopping-item:not(.checked) { border-inline-start: 3px solid #a7cfc2; }
#goalsSection .goal-card { border-top: 3px solid #c7b6df; background: linear-gradient(180deg, var(--section-wash), white 100px); }
#goalsSection .goal-category { background: #ebe2f4; color: var(--section-accent); }
#goalsSection .goal-card-actions > .btn:not(.btn-secondary) { background: var(--section-wash); border-color: #c7b6df; color: var(--section-accent); }
#familySection .family-member-card { background: linear-gradient(105deg, white 65%, var(--section-wash)); border-inline-start: 3px solid #d8afc0; }
#familySection .family-member-avatar { background: linear-gradient(130deg, var(--section-accent), #79527e); }
#adminSection .settings-card { background: linear-gradient(180deg, var(--section-wash), rgb(255 255 255 / 90%) 100px); border-top: 3px solid color-mix(in srgb, var(--section-accent) 35%, white); }
#adminSection .settings-card-title { color: var(--section-accent); }
@media (forced-colors: active) {
  .main-nav .nav-btn.active, .section .tab.active { border: 2px solid Highlight; }
}
