:root {
  --ink: #101113;
  --ink-soft: #6B6B70;
  --ink-faint: #A3A2A0;
  --paper: #FAFAF9;
  --paper-raised: #FFFFFF;
  --line: #EBEAE6;
  --accent: #00B87C;
  --accent-soft: #E3F7EE;
  --danger: #E5484D;
  --danger-soft: #FCE6E6;
  --display: 'Space Grotesk', -apple-system, sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: var(--sans);
  cursor: pointer;
}

h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.01em; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

/* ---- Top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.3rem 0.4rem;
}
.topbar .who {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 500;
}
.topbar .mode-chip {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.28rem 0.65rem;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
}
.switch-link {
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-decoration: none;
  border: none;
  background: none;
  padding: 0;
}

/* ---- Greeting bar (kid view) ---- */
.greeting-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.2rem 1.3rem 0.6rem;
  gap: 0.75rem;
}
.greeting-hey { font-size: 0.85rem; color: var(--ink-soft); }
.greeting-name { font-family: var(--display); font-size: 1.3rem; font-weight: 500; }
.greeting-side { display: flex; align-items: center; gap: 0.6rem; }

.accent-picker { display: flex; gap: 0.5rem; padding: 0 1.3rem 1rem; }
.accent-dot {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
}
.accent-dot.selected { border-color: var(--ink); }

/* ---- Hero balance ---- */
.hero {
  padding: 0.6rem 1.3rem 1.6rem;
}
.hero .label { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.25rem; }
.hero .amount {
  font-family: var(--display);
  font-size: 3.2rem;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.hero .amount.negative { color: var(--danger); }
.hero .sub-row {
  display: flex;
  gap: 1.4rem;
  margin-top: 0.9rem;
}
.hero .sub-stat .sub-label { font-size: 0.76rem; color: var(--ink-faint); }
.hero .sub-stat .sub-amount { font-family: var(--display); font-size: 1.05rem; margin-top: 0.1rem; }
.hero .sub-stat .sub-amount.debt { color: var(--danger); }

/* ---- Room headers (kid view) ---- */
.room-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.3rem 0.6rem;
}
.room-header:first-child { padding-top: 0.2rem; }
.room-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.room-header-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

/* ---- Section headers ---- */
.section-title {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0 1.3rem;
  margin: 0.2rem 0 0.7rem;
  color: var(--ink-soft);
}

/* ---- Chore list ---- */
.chore-list { padding: 0 1.3rem; display: flex; flex-direction: column; }
.chore-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
.chore-card:last-child { border-bottom: none; }
.chore-card .title { font-weight: 500; font-size: 0.97rem; }
.chore-card .value { font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.15rem; }
.chore-card button {
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1.05rem;
  font-size: 0.84rem;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
  margin-left: 0.8rem;
}
.chore-card button:disabled {
  background: none;
  color: var(--ink-faint);
  border: 1px solid var(--line);
}
.chore-card.waiting .title { color: var(--ink-soft); }

/* ---- Empty state ---- */
.empty {
  padding: 2.2rem 1.3rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-align: center;
}

/* ---- Goals placeholder ---- */
.coming-soon {
  margin: 2.5rem 1.3rem;
  text-align: center;
  color: var(--ink-soft);
  padding: 2.2rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 18px;
}
.coming-soon h3 { font-size: 1.1rem; margin-bottom: 0.4rem; color: var(--ink); font-weight: 500; }
.coming-soon p { font-size: 0.88rem; margin: 0; line-height: 1.5; }

/* ---- Bottom tab bar (kid view) ---- */
/* sticky, not just margin-top:auto, so it stays on screen once the tab's
   content is taller than the viewport (e.g. a long chore list) instead of
   only reaching the bottom when content happens to be short enough. */
.tabbar {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  display: flex;
  border-top: 1px solid var(--line);
  background: var(--paper-raised);
  z-index: 10;
}
.tabbar button {
  flex: 1;
  border: none;
  background: none;
  padding: 0.85rem 0 calc(0.6rem + env(safe-area-inset-bottom));
  font-size: 0.78rem;
  color: var(--ink-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.tabbar button .dot {
  width: 5px; height: 5px; border-radius: 50%; background: transparent;
}
.tabbar button.active { color: var(--ink); font-weight: 500; }
.tabbar button.active .dot { background: var(--accent); }

/* ---- Collapsible room sections (parent Chores tab) ---- */
.room-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.85rem 1.3rem;
  border: none;
  border-bottom: 1px solid var(--line);
  background: none;
  font-family: var(--sans);
  text-align: left;
}
.room-toggle-label {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
}
.room-toggle-count {
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-weight: 400;
  margin-left: 0.3rem;
}
.room-toggle-chevron {
  color: var(--ink-faint);
  font-size: 1.1rem;
  transition: transform 0.15s ease;
}
.room-toggle-chevron.open { transform: rotate(90deg); }
.room-toggle-content .kid-row:last-child { border-bottom: 1px solid var(--line); }

/* ---- Parent view top tabs ---- */
.toptabs {
  display: flex;
  gap: 1.4rem;
  padding: 0 1.3rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.toptabs button {
  border: none;
  background: none;
  padding: 0 0 0.7rem;
  font-size: 0.92rem;
  color: var(--ink-faint);
  border-bottom: 2px solid transparent;
}
.toptabs button.active {
  color: var(--ink);
  font-weight: 500;
  border-bottom-color: var(--ink);
}
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  margin-left: 0.3rem;
  vertical-align: text-top;
}

/* ---- Review card (parent) ---- */
.review-kid-group + .review-kid-group {
  border-top: 1px solid var(--line);
}
.review-kid-header {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 500;
  padding: 1.1rem 1.3rem 0.3rem;
  color: var(--ink);
}
.review-kid-count {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink-faint);
  margin-left: 0.1rem;
}
.review-card {
  padding: 1.1rem 1.3rem;
  border-bottom: 1px solid var(--line);
}
.review-card .kid-name { font-size: 0.78rem; color: var(--accent); font-weight: 500; }
.review-card .chore-title { font-family: var(--display); font-size: 1.2rem; font-weight: 500; margin: 0.2rem 0 0.5rem; }
.review-card .chore-value { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.8rem; }
.keep-assigned-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}
.keep-assigned-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.stars { display: flex; gap: 0.3rem; margin-bottom: 0.9rem; }
.stars button {
  border: none;
  background: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--line);
  padding: 0;
}
.stars button.filled { color: var(--accent); }

.review-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.btn {
  border: none;
  border-radius: 20px;
  padding: 0.6rem 1.1rem;
  font-size: 0.86rem;
  font-weight: 500;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn:disabled { background: var(--line); color: var(--ink-faint); }

.custom-pct {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  font-size: 0.85rem;
}
.custom-pct input[type="number"] {
  width: 70px;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
}

.note-field {
  width: 100%;
  margin-top: 0.7rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: var(--sans);
  resize: none;
}

/* ---- Kids overview (parent) ---- */
.kid-row {
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--line);
}
.kid-row .kid-top { display: flex; justify-content: space-between; align-items: baseline; }
.kid-row .kid-top .name { font-family: var(--display); font-size: 1.1rem; font-weight: 500; }
.kid-row .kid-top .avail { font-size: 1rem; font-weight: 500; font-family: var(--display); }
.kid-row .kid-top .avail.negative { color: var(--danger); }
.kid-row .sub { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.15rem; }
.kid-row .sub.negative { color: var(--danger); font-weight: 500; }

/* ---- Per-kid chore assignment toggles (parent's Chores tab) — two per
   row, centered, wrapping to further rows for more kids. ---- */
.chore-assign-toggles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.kid-toggle {
  flex: 0 1 160px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-raised);
}
.kid-toggle-name {
  font-size: 0.82rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kid-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--line);
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}
.kid-toggle input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}
.kid-toggle input[type="checkbox"]:checked { background: var(--accent); }
.kid-toggle input[type="checkbox"]:checked::before { transform: translateX(16px); }
.kid-toggle input[type="checkbox"]:disabled { opacity: 0.6; cursor: default; }

.settle-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.settle-form input[type="number"] {
  width: 80px;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
}
.settle-form input[type="text"] {
  flex: 1;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
}
.advance-block {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--line);
}
.reset-block {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--line);
}
.btn-reset {
  background: none;
  border: 1px solid var(--danger);
  color: var(--danger);
  width: 100%;
}
.btn-reset:disabled {
  border-color: var(--line);
  color: var(--ink-faint);
  background: none;
}
.btn-danger-solid {
  background: var(--danger);
  color: #fff;
}
.btn-danger-solid:disabled {
  background: var(--line);
  color: var(--ink-faint);
}

/* ---- Manage kids (bottom of Kids tab): PIN / reset / delete a profile ---- */
.manage-kids-note {
  font-size: 0.8rem;
  color: var(--ink-soft);
  padding: 0 1.3rem 0.9rem;
  line-height: 1.4;
}
.manage-kid-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem 1.3rem;
  border-bottom: 1px solid var(--line);
}
.manage-kid-name {
  font-weight: 500;
  font-size: 0.92rem;
}
.manage-kid-pin {
  display: flex;
  gap: 0.5rem;
}
.manage-kid-pin input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: var(--sans);
}
.manage-kid-pin .btn {
  flex-shrink: 0;
  width: auto;
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
}
.manage-kid-actions {
  display: flex;
  gap: 0.5rem;
}
.manage-kid-actions .btn {
  flex: 1;
  width: auto;
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
}

/* ---- Stats tab (parent) ---- */
.stats-kid-card {
  padding: 1.3rem;
  border-bottom: 1px solid var(--line);
}
.stats-kid-name {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 1.3rem;
}
.stats-metric { margin-bottom: 2.2rem; }
.stats-metric:last-child { margin-bottom: 0; }
.stats-metric-label { font-size: 0.9rem; font-weight: 500; }
.stats-metric-sub { font-size: 0.76rem; color: var(--ink-faint); margin-top: 0.1rem; }

/* Gauge bar: gradient track + two markers (6-month above, 3-month below),
   same information shape as WHOOP's period-comparison widgets — a
   gradient scale with two small arrows pointing at each period's value —
   just in this app's own flat/minimal palette instead of a dark theme. */
.gauge-bar {
  position: relative;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--danger) 0%, #F0C24E 50%, var(--accent) 100%);
  margin: 2.1rem 0 1.9rem;
}
.gauge-marker {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
.gauge-marker-top { bottom: 100%; padding-bottom: 0.2rem; }
.gauge-marker-bottom { top: 100%; padding-top: 0.2rem; }
.gauge-marker-arrow { font-size: 0.65rem; line-height: 1; color: var(--ink-faint); }

.stats-delta {
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 0.5rem;
}
.stats-delta.positive { color: var(--accent); }
.stats-delta.negative { color: var(--danger); }

.stats-streak-row {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.8rem;
}
.stats-streak-stat {
  flex: 1;
  text-align: center;
  padding: 0.9rem 0.5rem;
  border-radius: 14px;
  background: var(--accent-soft);
}
.stats-streak-num {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--accent);
}
.stats-streak-label { font-size: 0.74rem; color: var(--ink-soft); margin-top: 0.1rem; }

.stats-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 54px;
  margin-top: 0.9rem;
}
.stats-bar {
  flex: 1;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  min-height: 3px;
}
.stats-avg-row {
  display: flex;
  gap: 1.4rem;
  margin-top: 0.7rem;
  font-size: 0.85rem;
}
.stats-avg-label {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-faint);
}

/* ---- Landing / switcher ---- */
.landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.4rem;
  gap: 1.8rem;
}
.landing h1 { font-size: 1.9rem; text-align: center; font-weight: 500; }
.brand-lockup { display: flex; align-items: center; justify-content: center; gap: 0.65rem; }
.brand-lockup h1 { margin: 0; }
.brand-mark { height: 34px; width: auto; display: block; }
.brand-mark-sm { height: 20px; width: auto; display: block; flex-shrink: 0; }
.brand-lockup-sm { gap: 0.5rem; }
.brand-wordmark-sm { font-family: var(--display); font-size: 1.05rem; font-weight: 500; }
.brand-hero { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
.brand-mark-hero { height: 128px; width: auto; display: block; }
.brand-mark-hero-xl { height: 256px; width: auto; display: block; }

/* ---- Parent topbar: multiple trailing actions (Switch + Log out) ---- */
.topbar-actions { display: flex; align-items: center; gap: 0.9rem; }

/* ---- Remembered-parent-email readout on the quick login screen ---- */
.remembered-email {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  background: var(--paper-raised);
}
.kid-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.9rem; }
.kid-tile {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.6rem 1rem;
  text-align: center;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 500;
  position: relative;
  flex: 0 1 calc(50% - 0.45rem);
}
.kid-tile .avatar-dot {
  width: 10px; height: 10px; border-radius: 50%;
  margin: 0 auto 0.7rem;
}
.parent-btn {
  border: 1px solid var(--ink);
  background: none;
  border-radius: 20px;
  padding: 0.75rem;
  font-size: 0.92rem;
  color: var(--ink);
}

/* ---- Goal templates ---- */
.template-tiers { padding: 0 1.3rem; }
.template-tier { margin-bottom: 1.1rem; }
.template-tier-label { font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.template-tier-caption { font-size: 0.78rem; color: var(--ink-soft); margin: 0.15rem 0 0.55rem; line-height: 1.4; }
.template-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.template-chip {
  border: 1px solid var(--line);
  background: var(--paper-raised);
  border-radius: 20px;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  color: var(--ink);
  font-family: var(--sans);
}
.template-chip:active { background: var(--accent-soft); border-color: var(--accent); }

/* ---- Goals ---- */
.goal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.2rem;
  padding: 0 1.3rem;
}
.goal-card { text-align: center; }
.goal-img-wrap {
  position: relative;
  width: 100%;
  max-width: 140px;
  aspect-ratio: 1;
  margin: 0 auto;
}
.goal-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line); stroke-width: 6; }
.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.goal-img-inner {
  position: absolute;
  inset: 11px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.goal-img-placeholder { font-size: 2rem; }
.goal-title { font-weight: 500; font-size: 0.88rem; margin: 0.6rem 0 0.1rem; }
.goal-amt { font-size: 0.78rem; color: var(--ink-soft); }
.goal-amt .of { color: var(--ink-faint); }
.goal-achieved { font-size: 0.82rem; color: var(--accent); font-weight: 500; margin-top: 0.4rem; }
.goal-remove {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.74rem;
  color: var(--ink-faint);
  text-decoration: none;
}

/* ---- Badge reveal ---- */
.badge-reveal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 17, 19, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 1.5rem;
}
.badge-reveal-overlay.visible { opacity: 1; }
.badge-reveal-card {
  background: var(--paper-raised);
  border-radius: 24px;
  padding: 2.2rem 1.8rem 1.8rem;
  max-width: 320px;
  width: 100%;
  text-align: center;
  position: relative;
  transform: scale(0.7) translateY(10px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.badge-reveal-overlay.visible .badge-reveal-card { transform: scale(1) translateY(0); }
.badge-reveal-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0.02em;
  margin-bottom: 0.9rem;
}
.badge-reveal-medallion {
  position: relative;
  display: inline-block;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.18));
}
.badge-reveal-name { font-family: var(--display); font-size: 1.3rem; font-weight: 500; margin: 1rem 0 0.4rem; }
.badge-reveal-desc { font-size: 0.86rem; color: var(--ink-soft); margin-bottom: 1.4rem; line-height: 1.45; }
.badge-reveal-confetti {
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  pointer-events: none;
}
.confetti-piece {
  position: absolute;
  top: 0; left: 0;
  width: 7px; height: 7px;
  border-radius: 2px;
  opacity: 0;
  animation: confetti-burst 0.7s ease-out forwards;
}
@keyframes confetti-burst {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(340deg); }
}

/* ---- Badges tab ---- */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 1.1rem;
  padding: 0 1.3rem;
}
.badge-cell { text-align: center; }
.badge-cell-name { font-size: 0.78rem; font-weight: 500; margin-top: 0.5rem; }
.badge-cell-name.locked { color: var(--ink-faint); }
.badge-cell-desc { font-size: 0.7rem; color: var(--ink-faint); margin-top: 0.1rem; line-height: 1.3; }
.badge-cell-date { font-size: 0.68rem; color: var(--accent); margin-top: 0.15rem; }

/* ---- Home: hero accent wrapper ---- */
.hero.hero-accent {
  background: var(--accent-soft);
  margin: 0 1.3rem 1.6rem;
  border-radius: 20px;
  padding: 1.1rem 1.3rem 1.3rem;
}

/* ---- Section row (title + trailing link, e.g. "See all") ---- */
.section-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 1.3rem;
  margin: 0.2rem 0 0.7rem;
}
.see-all-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

/* ---- Home: "Saving for…" goal strip ---- */
.goal-strip {
  display: flex;
  gap: 0.8rem;
  padding: 0 1.3rem 0.4rem;
  overflow-x: auto;
}
.goal-strip-card {
  flex-shrink: 0;
  width: 128px;
  border-radius: 16px;
  padding: 0.9rem;
}
.goal-strip-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  overflow: hidden;
}
.goal-strip-icon img { width: 100%; height: 100%; object-fit: cover; }
.goal-strip-title {
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.goal-strip-bar-track {
  height: 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.08);
  margin-top: 0.6rem;
  overflow: hidden;
}
.goal-strip-bar-fill { height: 100%; border-radius: 4px; }
.goal-strip-pct { font-size: 0.78rem; font-weight: 500; margin-top: 0.35rem; }

/* ---- Home: recent activity list ---- */
.activity-list { padding: 0 1.3rem; display: flex; flex-direction: column; }
.activity-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.activity-row:last-child { border-bottom: none; }
.activity-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.activity-text { flex: 1; min-width: 0; }
.activity-label { font-size: 0.9rem; font-weight: 500; }
.activity-date { font-size: 0.76rem; color: var(--ink-faint); margin-top: 0.1rem; }
.activity-amount { font-family: var(--display); font-size: 0.95rem; font-weight: 500; flex-shrink: 0; }
.activity-amount.positive { color: var(--accent); }
.activity-amount.negative { color: var(--danger); }

/* ---- Chores: stats row above the room lists ---- */
.chore-stats {
  display: flex;
  gap: 0.8rem;
  padding: 0.2rem 1.3rem 1.2rem;
}
.chore-stat {
  flex: 1;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
}
.chore-stat-label { font-size: 0.76rem; color: var(--ink-faint); }
.chore-stat-amount { font-family: var(--display); font-size: 1.15rem; margin-top: 0.2rem; }
.chore-hint { text-align: center; color: var(--ink-faint); font-size: 0.82rem; padding: 1.2rem 1.3rem 1.6rem; }

/* ---- Chores: row (replaces old chore-card layout) ---- */
.chore-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.chore-list .chore-row:last-child { border-bottom: none; }
.chore-row.done { cursor: default; }
.chore-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #fff;
}
.chore-row.done .chore-checkbox { background: var(--accent); border-color: var(--accent); }
.chore-row-text { flex: 1; min-width: 0; }
.chore-row-title { font-weight: 500; font-size: 0.95rem; }
.chore-row.done .chore-row-title { color: var(--ink-soft); }
.chore-row-value { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.15rem; }

/* ---- Sent-back chore: needs another look before it can be resubmitted --- */
.chore-row.sent-back {
  margin: 0 -1.3rem;
  padding: 0.85rem 1.3rem;
  border-radius: 10px;
  animation: sent-back-pulse 1.8s ease-in-out infinite;
}
.sent-back-bell {
  display: inline-block;
  margin-right: 0.3rem;
  animation: sent-back-bell-ring 1.8s ease-in-out infinite;
}
@keyframes sent-back-pulse {
  0%, 100% { background-color: transparent; }
  50% { background-color: var(--danger-soft); }
}
@keyframes sent-back-bell-ring {
  0%, 100% { transform: rotate(0deg); }
  10% { transform: rotate(-12deg); }
  20% { transform: rotate(10deg); }
  30% { transform: rotate(-8deg); }
  40% { transform: rotate(4deg); }
  50%, 100% { transform: rotate(0deg); }
}

.daily-pie {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.daily-pie::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--paper);
}
.daily-pie-num {
  position: relative;
  z-index: 1;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink);
}

/* ---- Goals: lifetime banner + flat list layout ---- */
.goals-lifetime {
  padding: 0.9rem 1.3rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.goal-flat-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0 1.3rem 1.4rem;
}
.goal-flat-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem;
}
.goal-flat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  overflow: hidden;
}
.goal-flat-icon img { width: 100%; height: 100%; object-fit: cover; }
.goal-flat-main { flex: 1; min-width: 0; }
.goal-flat-title { font-weight: 500; font-size: 0.92rem; }
.goal-flat-amt { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.15rem; }
.goal-flat-amt .of { color: var(--ink-faint); }
.goal-flat-bar-track {
  height: 6px;
  border-radius: 4px;
  background: var(--line);
  margin-top: 0.5rem;
  overflow: hidden;
}
.goal-flat-bar-fill { height: 100%; border-radius: 4px; background: var(--accent); }
.goal-flat-bar-fill.done { background: var(--accent); }
.goal-flat-pct { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.35rem; }
.goal-flat-action { flex-shrink: 0; margin-left: auto; }

/* ---- Confetti rain (chore completion) ---- */
.confetti-rain-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}
.confetti-rain-piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  opacity: 0.9;
  animation: confetti-fall var(--fall-duration) ease-in var(--fall-delay) forwards;
}
@keyframes confetti-fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0.9; }
  100% { transform: translate(var(--drift), 100vh) rotate(var(--rotate-end)); opacity: 0; }
}

@media (min-width: 481px) {
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
