/* Our Family: app styles, built only from the design tokens in tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-grouped);
  color: var(--label);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--coral); }
:focus-visible { outline: var(--stroke-focus) solid var(--coral); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---- type ---- */
.large-title { font-family: var(--font-rounded); font-weight: 800; font-size: 34px; line-height: 41px; }
.title-1 { font-family: var(--font-rounded); font-weight: 800; font-size: 28px; line-height: 34px; }
.title-2 { font-family: var(--font-rounded); font-weight: 700; font-size: 22px; line-height: 28px; }
.title-3 { font-family: var(--font-rounded); font-weight: 700; font-size: 20px; line-height: 25px; }
.headline { font-weight: 600; font-size: 17px; line-height: 22px; }
.subhead { font-size: 15px; line-height: 20px; }
.footnote { font-size: 13px; line-height: 18px; }
.secondary { color: var(--label-secondary); }
.points-hero { font-family: var(--font-rounded); font-weight: 800; font-size: 56px; line-height: 56px; font-variant-numeric: tabular-nums; }
.points-lg { font-family: var(--font-rounded); font-weight: 800; font-size: 28px; line-height: 32px; font-variant-numeric: tabular-nums; }
.center { text-align: center; }

/* ---- layout ---- */
.screen {
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + var(--space-12)) var(--space-4) calc(env(safe-area-inset-bottom) + 120px);
  display: flex; flex-direction: column; gap: var(--space-5);
  max-width: 720px; margin: 0 auto;
}
.screen.no-tabs { padding-bottom: calc(env(safe-area-inset-bottom) + var(--space-8)); }
.screen.centered { align-items: center; text-align: center; }
.stack { display: flex; flex-direction: column; gap: var(--space-2); }
.stack-lg { display: flex; flex-direction: column; gap: var(--space-4); }
.row { display: flex; align-items: center; gap: var(--space-3); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.grow { flex: 1 1 auto; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.spacer { flex: 1 1 auto; }

/* ---- surfaces ---- */
.card { background: var(--bg); border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow-sm); }
.hero { background: var(--cocoa); color: var(--on-cocoa); border-radius: var(--radius-lg); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.inset {
  background: var(--bg); border-radius: var(--radius-lg); overflow: hidden;
}
.inset > .cell + .cell { border-top: var(--stroke-hair) solid var(--separator); }
.inset > .cell + .cell { box-shadow: none; }
.cell {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--target-min); padding: var(--space-3) var(--space-4);
  background: none; border: 0; width: 100%; text-align: left; text-decoration: none; color: inherit;
}
button.cell, a.cell { cursor: pointer; }
.cell .chev { color: var(--label-tertiary); flex-shrink: 0; }
.section-title { font-family: var(--font-rounded); font-weight: 700; font-size: 20px; line-height: 25px; padding: 0 var(--space-1); }
.section-note { font-size: 13px; line-height: 18px; color: var(--label-secondary); padding: 0 var(--space-4); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-md); padding: 0 var(--space-5);
  border-radius: var(--radius-pill); border: 0; cursor: pointer;
  font-family: var(--font-rounded); font-weight: 800; font-size: 17px; text-decoration: none;
  transition: transform .12s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-lg { min-height: var(--control-lg); }
.btn-block { width: 100%; }
.btn-prominent { background: var(--coral); color: var(--on-coral); }
.btn-tinted { background: var(--coral-tint); color: var(--coral); }
.btn-gray { background: var(--fill); color: var(--label); }
.btn-plain { background: none; color: var(--coral); font-weight: 700; }
.btn-danger { background: none; color: var(--danger); font-weight: 700; }
.icon-btn {
  width: var(--target-min); height: var(--target-min); border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer;
  background: var(--fill); color: var(--label);
}

/* ---- avatars ---- */
.avatar {
  --c: var(--coral);
  width: var(--avatar-md); height: var(--avatar-md); border-radius: var(--radius-pill);
  background: var(--c); color: #fff; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-rounded); font-weight: 800; font-size: 18px; line-height: 1;
  border: 0; padding: 0;
}
.avatar.sm { width: var(--avatar-sm); height: var(--avatar-sm); font-size: 12px; }
.avatar.lg { width: var(--avatar-lg); height: var(--avatar-lg); font-size: 30px; }
.avatar.xl { width: 88px; height: 88px; font-size: 36px; }
.avatar.ring { box-shadow: 0 0 0 4px var(--bg-grouped), 0 0 0 7px var(--coral); }
.avatar.off { background: var(--fill); color: var(--label-secondary); }
/* Member colors. White text passes on every light-theme fill; dark theme uses on-* ink. */
.c-coral { --c: var(--coral); color: var(--on-coral); }
.c-leaf { --c: var(--leaf); color: var(--on-leaf); }
.c-sky { --c: var(--sky); color: var(--on-sky); }
.c-grape { --c: var(--grape); color: var(--on-grape); }
.c-berry { --c: var(--berry); color: var(--on-berry); }
.c-sun { --c: var(--sun); color: var(--on-sun); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { border: 2px solid var(--bg); }
.avatar-stack .avatar + .avatar { margin-left: -8px; }

/* ---- profile picker ---- */
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); width: 100%; }
.profile {
  background: var(--bg); border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: var(--space-6) var(--space-3); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  transition: transform .12s ease;
}
.profile:active { transform: scale(.97); }
.profile .name { font-family: var(--font-rounded); font-weight: 800; font-size: 20px; line-height: 25px; }

/* ---- PIN pad ---- */
.pin-dots { display: flex; gap: 20px; justify-content: center; min-height: 18px; }
.pin-dots span { width: 18px; height: 18px; border-radius: var(--radius-pill); border: var(--stroke-bold) solid var(--label-secondary); }
.pin-dots span.on { background: var(--label); border-color: var(--label); }
.pin-dots.shake { animation: shake .35s ease; }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 80px); gap: var(--space-4) var(--space-6); justify-content: center; }
.key {
  width: 80px; height: 80px; border-radius: var(--radius-pill); border: 0; cursor: pointer;
  background: var(--bg); box-shadow: var(--shadow-sm);
  font-family: var(--font-rounded); font-weight: 800; font-size: 30px;
  transition: transform .08s ease, background .08s ease;
}
.key:active { transform: scale(.94); background: var(--fill); }
.key.ghost { background: none; box-shadow: none; color: var(--label-secondary); display: inline-flex; align-items: center; justify-content: center; }

/* ---- forms ---- */
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field > label, .field > .label { font-weight: 600; font-size: 15px; line-height: 20px; }
.field .hint { font-size: 13px; line-height: 18px; color: var(--label-secondary); }
.input {
  width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-radius: var(--radius-md);
  background: var(--bg-tertiary); font-size: 17px; color: var(--label);
}
.input::placeholder { color: var(--label-tertiary); }
.input:focus-visible { outline: var(--stroke-focus) solid var(--coral); outline-offset: 0; }
.segmented { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; background: var(--fill); border-radius: var(--radius-pill); padding: 3px; }
.segmented button {
  min-height: 38px; border: 0; border-radius: var(--radius-pill); background: none; cursor: pointer;
  font-family: var(--font-rounded); font-weight: 700; font-size: 15px; color: var(--label-secondary);
}
.segmented button[aria-pressed="true"] { background: var(--bg); color: var(--label); box-shadow: var(--shadow-sm); }
.swatches { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.swatch {
  width: var(--target-min); height: var(--target-min); border-radius: var(--radius-pill); border: 0; cursor: pointer;
  background: var(--c); display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg-elevated), 0 0 0 6px var(--label); }
.swatch:disabled { opacity: .25; cursor: not-allowed; }
.error-text { color: var(--danger); font-size: 15px; line-height: 20px; min-height: 20px; }

/* ---- section tiles (home) ---- */
.tile {
  border-radius: var(--radius-lg); padding: var(--space-4); min-height: 104px;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-2);
  text-decoration: none; border: 0; text-align: left;
}
.tile .tile-name { font-family: var(--font-rounded); font-weight: 800; font-size: 20px; line-height: 25px; }
.tile.live { cursor: pointer; }
.tile.soon { background: var(--bg); color: var(--label-secondary); }
.tile.soon .tile-name { color: var(--label); }
.t-sky { background: var(--sky-tint); color: var(--sky); }
.t-leaf { background: var(--leaf-tint); color: var(--leaf); }
.t-sun { background: var(--sun-tint); color: var(--sun-ink); }
.t-grape { background: var(--grape-tint); color: var(--grape); }
.t-coral { background: var(--coral-tint); color: var(--coral); }
.pill {
  display: inline-flex; align-items: center; gap: var(--space-1); align-self: flex-start;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-family: var(--font-rounded); font-weight: 700; font-size: 13px; line-height: 16px;
}

/* ---- tab bar (glass, controls layer only) ---- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + var(--space-4));
  width: min(420px, calc(100% - 2 * var(--space-4)));
  height: 64px; border-radius: var(--radius-pill);
  background: var(--glass); border: var(--stroke-hair) solid var(--glass-edge); box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(var(--blur-glass)) saturate(180%); backdrop-filter: blur(var(--blur-glass)) saturate(180%);
  display: flex; align-items: center; justify-content: space-around; padding: 0 var(--space-2); z-index: 10;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 72px; min-height: var(--target-min); justify-content: center;
  text-decoration: none; color: var(--label-secondary); font-family: var(--font-rounded); font-weight: 700; font-size: 12px; line-height: 14px;
}
.tabbar a[aria-current="page"] { color: var(--coral); }
@media (prefers-reduced-transparency: reduce) { .tabbar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* ---- sheet + toast ---- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; animation: fade .2s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: calc(100dvh - 40px); overflow-y: auto;
  max-width: 560px; margin: 0 auto;
  background: var(--bg-elevated); border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-lg);
  padding: var(--space-2) var(--space-4) calc(env(safe-area-inset-bottom) + var(--space-6));
  display: flex; flex-direction: column; gap: var(--space-5); animation: rise .25s ease;
}
.sheet .grabber { align-self: center; width: 40px; height: 5px; border-radius: var(--radius-pill); background: var(--fill); }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.sheet-head > :last-child { justify-self: end; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + var(--space-4)); z-index: 30;
  background: var(--cocoa); color: var(--on-cocoa); border-radius: var(--radius-pill); padding: var(--space-3) var(--space-5);
  font-family: var(--font-rounded); font-weight: 700; font-size: 15px; box-shadow: var(--shadow-md); animation: rise .2s ease;
  max-width: calc(100% - 32px);
}

/* ---- passport stamps (home) ---- */
.stamps { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.stamp {
  width: 44px; height: 44px; border-radius: var(--radius-pill); border: 2px dashed currentColor;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-rounded); font-weight: 800; font-size: 13px;
}

.empty { padding: var(--space-6) var(--space-4); text-align: center; color: var(--label-secondary); display: flex; flex-direction: column; gap: var(--space-2); align-items: center; }

@media (min-width: 700px) {
  .profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---- trips ---- */
.stat { background: var(--bg); border-radius: var(--radius-md); padding: var(--space-3); display: flex; flex-direction: column; }
.trip-card { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); text-decoration: none; color: inherit; }
.trip-card-icon { width: 64px; height: 64px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.segmented-links a {
  min-height: 38px; border-radius: var(--radius-pill); display: flex; align-items: center; justify-content: center; text-decoration: none;
  font-family: var(--font-rounded); font-weight: 700; font-size: 15px; color: var(--label-secondary);
}
.segmented-links a.on { background: var(--bg); color: var(--label); box-shadow: var(--shadow-sm); }
.input-sm { min-height: 44px; font-size: 16px; }
select.input { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input[type="date"].input { min-width: 0; padding: 0 10px; }
.place-row { background: var(--bg-tertiary); border-radius: var(--radius-md); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.place-row .input { background: var(--bg); }
.place-row .icon-btn { background: var(--bg); }
.combo { position: relative; }
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5;
  background: var(--bg-elevated); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); overflow: hidden;
}
.suggestion {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); width: 100%; min-height: var(--target-min);
  padding: var(--space-2) 14px; border: 0; background: none; cursor: pointer; text-align: left;
}
.suggestion + .suggestion { border-top: var(--stroke-hair) solid var(--separator); }
.suggestion[aria-selected="true"], .suggestion:hover { background: var(--coral-tint); }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: var(--space-3); }
.member-pick { border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; }
.member-pick-avatar { position: relative; display: inline-flex; }
.member-pick.on .avatar { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--coral); }
.member-pick-check {
  position: absolute; top: -4px; right: -4px; width: 24px; height: 24px; border-radius: var(--radius-pill);
  background: var(--coral); color: var(--on-coral); display: inline-flex; align-items: center; justify-content: center;
}
.member-pick-name { font-family: var(--font-rounded); font-weight: 700; font-size: 15px; }
.member-pick:not(.on) .member-pick-name { color: var(--label-secondary); }
.sheet .member-pick.on .avatar { box-shadow: 0 0 0 3px var(--bg-elevated), 0 0 0 6px var(--coral); }

/* ---- map ---- */
.chips { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--space-4)); padding: 2px var(--space-4); }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 40px; padding: 0 14px; border: 0; cursor: pointer;
  border-radius: var(--radius-pill); background: var(--bg); color: var(--label);
  font-family: var(--font-rounded); font-weight: 700; font-size: 15px;
}
.chip:has(.avatar) { padding-left: 6px; }
.chip[aria-pressed="true"] { background: var(--coral); color: var(--on-coral); }
.map-frame {
  position: relative; height: clamp(320px, 58dvh, 620px); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--sky-tint); box-shadow: var(--shadow-sm);
}
.map-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.map-svg:active { cursor: grabbing; }
.map-land { fill: var(--bg); stroke: var(--separator); stroke-width: .7px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.map-land.visited { fill: var(--sky); stroke: var(--bg); }
.map-land.wish { fill: var(--sun); }
.map-land.selected { stroke: var(--coral); stroke-width: 2.5px; }
.map-marker.visited circle { fill: var(--sky); stroke: var(--bg); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.map-marker.wish path { fill: var(--sun); stroke: var(--sun-ink); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.map-marker.selected circle, .map-marker.selected path { stroke: var(--coral); stroke-width: 2.5px; }
.map-controls {
  position: absolute; right: var(--space-3); top: var(--space-3); display: flex; flex-direction: column; border-radius: var(--radius-pill);
  background: var(--glass); border: var(--stroke-hair) solid var(--glass-edge); box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(var(--blur-glass)); backdrop-filter: blur(var(--blur-glass));
}
.map-controls button { width: var(--target-min); height: var(--target-min); border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--label); }
.map-legend {
  position: absolute; left: var(--space-3); bottom: var(--space-3); display: flex; gap: var(--space-3); padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--glass); border: var(--stroke-hair) solid var(--glass-edge);
  -webkit-backdrop-filter: blur(var(--blur-glass)); backdrop-filter: blur(var(--blur-glass));
  font-family: var(--font-rounded); font-weight: 700; font-size: 13px;
}
.legend-dot { width: 12px; height: 12px; border-radius: var(--radius-pill); background: var(--sky); }
.legend-star { color: var(--sun-ink); display: inline-flex; }
.legend-star svg { fill: var(--sun); }
.map-trip {
  display: flex; align-items: center; gap: var(--space-3); padding: 10px 12px; min-height: var(--target-min);
  background: var(--bg-tertiary); border-radius: var(--radius-md); text-decoration: none; color: inherit;
}
@media (prefers-reduced-transparency: reduce) { .map-controls, .map-legend { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* ---- one trip ---- */
.place-chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 36px; padding: 0 12px;
  border-radius: var(--radius-pill); background: var(--sky-tint); color: var(--sky);
  font-family: var(--font-rounded); font-weight: 700; font-size: 15px;
}
.place-chip .secondary { color: var(--sky); opacity: .8; font-weight: 600; }
.composer-prompt { display: flex; align-items: center; gap: var(--space-3); border: 0; cursor: pointer; text-align: left; padding: var(--space-3) var(--space-4); }
.composer-camera { width: var(--target-min); height: var(--target-min); border-radius: var(--radius-pill); background: var(--sky-tint); color: var(--sky); display: inline-flex; align-items: center; justify-content: center; }
.post { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3); }
.post > header { padding: var(--space-1) var(--space-1) 0; }
.post-author { font-family: var(--font-rounded); font-weight: 800; font-size: 17px; line-height: 22px; }
.post-text { padding: 0 var(--space-1); font-size: 17px; line-height: 26px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: var(--readable-width); }
.post-media { display: grid; gap: 6px; }
.post-media.one { grid-template-columns: 1fr; }
.post-media.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-media.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile-media {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; cursor: pointer; overflow: hidden;
  border-radius: var(--radius-sm); background: var(--bg-tertiary); color: var(--label-secondary);
}
.post-media.one .tile-media { aspect-ratio: 4 / 3; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-none { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.video-badge, .pending-badge {
  position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px;
  border-radius: var(--radius-pill); background: rgba(20, 12, 6, .62); color: #fff;
  font-family: var(--font-rounded); font-weight: 700; font-size: 12px;
}
.video-badge svg { fill: currentColor; }
.more-badge {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(20, 12, 6, .45); color: #fff;
  font-family: var(--font-rounded); font-weight: 800; font-size: 22px;
}
.tile-media.pending { cursor: default; }
.tile-media.pending img { opacity: .55; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.photo-grid .tile-media { border-radius: var(--radius-xs); }
@media (min-width: 600px) { .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.textarea { min-height: 140px; padding: 12px 14px; line-height: 24px; resize: vertical; }
.picked { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.picked:empty { display: none; }
.picked-item { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-tertiary); color: var(--label-secondary); }
.picked-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picked-remove {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: var(--radius-pill); border: 0; cursor: pointer;
  background: rgba(20, 12, 6, .62); color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.picked-remove::after { content: ""; position: absolute; inset: -8px; }

.hearts { display: inline-flex; gap: 2px; color: var(--separator); }
.hearts .on { color: var(--berry); }
.hearts svg, .heart-picker svg { fill: currentColor; stroke: none; }
.heart-picker { display: flex; gap: var(--space-1); }
.heart-picker button {
  width: var(--target-kid); height: var(--target-kid); border: 0; border-radius: var(--radius-pill); cursor: pointer;
  background: none; color: var(--fill); display: inline-flex; align-items: center; justify-content: center; transition: transform .15s ease;
}
.heart-picker button.on { color: var(--berry); }
.heart-picker button:active { transform: scale(1.15); }
.favorites { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-3); margin: 0; }
.favorites dt { font-size: 15px; line-height: 22px; color: var(--label-secondary); }
.favorites dd { margin: 0; font-size: 17px; line-height: 22px; }

/* ---- uploads ---- */
.upload-pill {
  position: fixed; z-index: 15; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + var(--space-4) + 64px + var(--space-3));
  width: min(420px, calc(100% - 2 * var(--space-4)));
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
  min-height: 56px; border-radius: var(--radius-lg); background: var(--cocoa); color: var(--on-cocoa); box-shadow: var(--shadow-md);
}
.upload-title { font-family: var(--font-rounded); font-weight: 800; font-size: 15px; }
.upload-ring {
  width: 28px; height: 28px; border-radius: var(--radius-pill); flex-shrink: 0;
  background: conic-gradient(var(--sun) var(--p, 0%), rgba(255, 255, 255, .18) 0);
  -webkit-mask: radial-gradient(circle, transparent 8px, #000 9px); mask: radial-gradient(circle, transparent 8px, #000 9px);
}
.upload-pill .icon-btn { background: rgba(255, 255, 255, .14); color: var(--on-cocoa); }

/* ---- photo viewer ---- */
body.no-scroll { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 40; background: #0d0907; color: #fff; display: flex; flex-direction: column; animation: fade .15s ease; }
.viewer-top, .viewer-bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.viewer-top { padding-top: calc(env(safe-area-inset-top) + var(--space-3)); }
.viewer-bottom { padding-bottom: calc(env(safe-area-inset-bottom) + var(--space-3)); flex-wrap: wrap; }
.viewer-count { font-family: var(--font-rounded); font-weight: 700; font-size: 15px; }
.viewer-close, .viewer-nav {
  width: var(--target-min); height: var(--target-min); border-radius: var(--radius-pill); border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.viewer-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; touch-action: pan-y pinch-zoom; }
.viewer-stage img, .viewer-stage video { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.viewer-nav.prev { left: var(--space-3); }
.viewer-nav.next { right: var(--space-3); }
.viewer-caption { display: flex; align-items: center; gap: var(--space-2); }
.viewer-caption .footnote { color: rgba(255, 255, 255, .75); }
.viewer-btn { background: rgba(255, 255, 255, .14); color: #fff; min-height: var(--target-min); font-size: 15px; }
.viewer-none { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; padding: var(--space-6); color: rgba(255, 255, 255, .8); }
@media (hover: none) { .viewer-nav { display: none; } }

/* ---- passport ---- */
.pp-pager {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 0;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); outline-offset: 4px;
}
.pp-pager::-webkit-scrollbar { display: none; }
.pp-page {
  flex: 0 0 100%; scroll-snap-align: start; box-sizing: border-box; height: clamp(460px, 62dvh, 580px); overflow-y: auto;
  padding: var(--space-5) var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); position: relative;
  /* paper: warm, with fine guilloche lines */
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--sun-ink) 7%, transparent) 0 1px, transparent 1px 10px),
    repeating-radial-gradient(circle at 90% 8%, color-mix(in srgb, var(--sky) 8%, transparent) 0 1px, transparent 1px 8px);
}
.pp-page + .pp-page { border-left: 2px dashed var(--separator); }
.pp-cover {
  background: var(--cocoa); background-image: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--sun) 16%, transparent), transparent 60%);
  color: var(--sun); align-items: center; justify-content: center; text-align: center; gap: var(--space-3);
}
.pp-cover-family { font-family: var(--font-rounded); font-weight: 800; font-size: 20px; color: var(--on-cocoa); }
.pp-cover-globe { margin: var(--space-4) 0; }
.pp-cover-title { font-family: var(--font-rounded); font-weight: 800; font-size: 40px; line-height: 44px; letter-spacing: .12em; text-transform: uppercase; }
.pp-cover-name { font-family: var(--font-rounded); font-weight: 700; font-size: 22px; color: var(--on-cocoa); }
.pp-cover-hint { color: color-mix(in srgb, var(--on-cocoa) 75%, transparent); margin-top: var(--space-6); }
.pp-eyebrow { font-family: var(--font-rounded); font-weight: 800; font-size: 13px; color: var(--sun-ink); }
.pp-eyebrow-icon { color: var(--sun-ink); display: inline-flex; }
.pp-id-main { display: flex; gap: var(--space-4); align-items: flex-start; }
.pp-photo {
  width: 104px; height: 128px; flex-shrink: 0; border-radius: var(--radius-sm); background: var(--c); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-rounded); font-weight: 800; font-size: 52px; box-shadow: inset 0 0 0 3px color-mix(in srgb, #fff 35%, transparent);
}
.pp-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); margin: 0; flex: 1; min-width: 0; }
.pp-field { display: flex; flex-direction: column; min-width: 0; }
.pp-field.wide { grid-column: span 2; }
.pp-field dt { font-size: 11px; line-height: 14px; color: var(--label-secondary); }
.pp-field dd { margin: 0; font-family: var(--font-rounded); font-weight: 800; font-size: 17px; line-height: 22px; overflow-wrap: anywhere; }
.pp-field dd.big { font-size: 30px; line-height: 34px; font-variant-numeric: tabular-nums; }
.pp-continents { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-continent {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: var(--radius-pill);
  font-family: var(--font-rounded); font-weight: 700; font-size: 13px; color: var(--label-secondary); background: var(--fill);
}
.pp-continent.on { background: var(--leaf-tint); color: var(--leaf); }
.pp-mrz {
  margin-top: auto; padding-top: var(--space-3); border-top: 1px dashed var(--separator); overflow: hidden; white-space: nowrap;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 18px; letter-spacing: .08em; color: var(--label-secondary);
}
.pp-page-label { align-self: center; font-family: var(--font-rounded); font-weight: 700; font-size: 13px; color: var(--label-secondary); }
.pp-stamp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 140px; gap: var(--space-2); flex: 1; align-items: center; justify-items: center; }

.pp-stamp {
  --ink: var(--sky);
  position: relative; display: inline-flex; align-items: center; justify-content: center; border: 0; padding: 0; cursor: pointer;
  background: none; color: var(--ink); opacity: .9; mix-blend-mode: multiply;
  width: 132px; height: 120px; transition: transform .2s ease;
}
:root[data-theme="dark"] .pp-stamp { mix-blend-mode: normal; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pp-stamp { mix-blend-mode: normal; } }
.pp-stamp.large { width: 200px; height: 180px; cursor: default; }
.pp-stamp.large .pp-stamp-name { font-size: 22px; }
.pp-stamp.large .pp-stamp-date { font-size: 15px; }
.pp-stamp-body { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; padding: 6px; }
.pp-stamp-top, .pp-stamp-date { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; font-size: 12px; letter-spacing: .04em; }
.pp-stamp-name { font-family: var(--font-rounded); font-weight: 800; font-size: 16px; line-height: 18px; letter-spacing: .05em; }
.pp-stamp-name.long { font-size: 13px; line-height: 15px; letter-spacing: .02em; }
.pp-stamp-name.xlong { font-size: 11px; line-height: 13px; }
.pp-stamp-city { font-family: var(--font-rounded); font-weight: 700; font-size: 11px; line-height: 13px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-stamp.circle { border-radius: 50%; width: 124px; height: 124px; border: 3px solid var(--ink); box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 6px var(--ink); }
.pp-stamp.circle.large { width: 180px; height: 180px; }
.pp-stamp.rect { border: 3px solid var(--ink); border-radius: var(--radius-xs); height: auto; min-height: 92px; }
.pp-stamp.rect .pp-stamp-date { border-top: 2px solid var(--ink); padding-top: 2px; margin-top: 2px; }
.pp-stamp.oval { border-radius: 50%; border: 3px solid var(--ink); width: 150px; height: 96px; }
.pp-stamp.oval.large { width: 220px; height: 140px; }
.pp-stamp.dashed { border: 3px dashed var(--ink); border-radius: var(--radius-md); height: auto; min-height: 88px; }
.pp-stamp.hex .pp-hex { position: absolute; inset: 0; background: var(--ink); clip-path: polygon(25% 3%, 75% 3%, 99% 50%, 75% 97%, 25% 97%, 1% 50%); }
.pp-stamp.hex .pp-hex::after { content: ""; position: absolute; inset: 3px; background: var(--bg); clip-path: polygon(25% 3%, 75% 3%, 99% 50%, 75% 97%, 25% 97%, 1% 50%); }
.pp-stamp:hover:not(.large) { transform: scale(1.04); }
.ink-sky { --ink: var(--sky); }
.ink-berry { --ink: var(--berry); }
.ink-leaf { --ink: var(--leaf); }
.ink-grape { --ink: var(--grape); }
.ink-coral { --ink: var(--coral); }
.ink-sun-ink { --ink: var(--sun-ink); }
.pp-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4); text-align: center; color: var(--label-secondary); padding: 0 var(--space-4); }
.pp-ghost-stamp {
  width: 120px; height: 120px; border-radius: 50%; border: 3px dashed var(--separator); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-rounded); font-weight: 800; font-size: 40px; color: var(--separator); transform: rotate(-8deg);
}
.pp-wish-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.pp-wish { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); min-height: var(--target-min); border-radius: var(--radius-md); background: var(--bg-tertiary); }
.pp-wish-star { color: var(--sun-ink); display: inline-flex; }
.pp-wish-star svg { fill: var(--sun); }
.pp-wish .icon-btn { width: 36px; height: 36px; background: var(--bg); }
.pp-dots { display: flex; gap: 6px; align-items: center; }
.pp-dots span { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--fill); transition: width .2s ease, background .2s ease; }
.pp-dots span.on { width: 22px; background: var(--coral); }
.chips a.chip { text-decoration: none; }

/* ---- points ---- */
.tile-note { font-weight: 700; }
.points-card { gap: var(--space-3); }
.points-card .points-hero { color: var(--on-cocoa); }
.points-star { color: var(--sun); display: inline-flex; margin-bottom: 6px; }
.points-star svg { fill: var(--sun); stroke: var(--sun); }
.points-week { background: color-mix(in srgb, var(--on-cocoa) 14%, transparent); color: var(--on-cocoa); }
.streak-dots { display: flex; gap: 6px; }
.streak-dots span { flex: 1; height: 8px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--on-cocoa) 18%, transparent); }
.streak-dots span.on { background: var(--sun); }
.points-card .row svg { flex-shrink: 0; }
.card-link { text-decoration: none; color: inherit; display: block; border-radius: var(--radius-lg); }
.btn-kid {
  min-height: var(--target-kid); background: var(--leaf); color: var(--on-leaf); box-shadow: var(--shadow-md); font-size: 19px;
}
.btn-yes { background: var(--leaf-tint); color: var(--leaf); }
.celebrate {
  align-self: flex-start; padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill);
  background: var(--sun-tint); color: var(--sun-ink); font-family: var(--font-rounded); font-weight: 800; font-size: 17px;
  animation: pop .3s ease;
}
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }
.entries { list-style: none; margin: 0; padding: 0; background: var(--bg); border-radius: var(--radius-lg); overflow: hidden; }
.entry { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); min-height: var(--target-min); }
.entry + .entry { border-top: var(--stroke-hair) solid var(--separator); }
.entry-icon { width: 32px; height: 32px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.entry.up .entry-icon { background: var(--sun-tint); color: var(--sun-ink); }
.entry.down .entry-icon { background: var(--fill); color: var(--label-secondary); }
.entry.cash .entry-icon { background: var(--leaf-tint); color: var(--leaf); }
.entry.off .entry-icon, .entry.pending .entry-icon { background: var(--fill); color: var(--label-secondary); }
.entry-points { font-family: var(--font-rounded); font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.entry.up .entry-points { color: var(--sun-ink); }
.entry.down .entry-points, .entry.cash .entry-points { color: var(--label); }
.entry.off .entry-points { color: var(--label-secondary); text-decoration: line-through; }
.entry-note { font-size: 15px; line-height: 20px; color: var(--label); font-style: italic; }
.entry .icon-btn { width: 36px; height: 36px; }
.mini-points { display: flex; flex-direction: column; gap: var(--space-1); text-decoration: none; color: inherit; }
.mini-points .points-lg { color: var(--sun-ink); }
.pending-card { display: flex; flex-direction: column; gap: var(--space-3); }
.reason-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.reason-chip {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); padding: 0 6px 0 14px; border: 0; cursor: pointer;
  border-radius: var(--radius-pill); background: var(--bg-tertiary); color: var(--label); font-family: var(--font-rounded); font-weight: 700; font-size: 15px;
}
.reason-chip[aria-pressed="true"] { background: var(--coral-tint); box-shadow: inset 0 0 0 2px var(--coral); }
.reason-points {
  display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 30px; padding: 0 8px; border-radius: var(--radius-pill);
  background: var(--sun-tint); color: var(--sun-ink); font-family: var(--font-rounded); font-weight: 800; font-size: 14px;
}
.reason-chip .reason-points { background: var(--bg); }
.reason-points.neg { background: var(--fill); color: var(--label-secondary); }
.stepper { display: flex; align-items: center; gap: var(--space-3); }
.stepper-btn {
  width: var(--target-kid); height: var(--target-kid); border-radius: var(--radius-pill); border: 0; cursor: pointer; flex-shrink: 0;
  background: var(--fill); color: var(--label); display: inline-flex; align-items: center; justify-content: center;
}
.stepper-value {
  width: 100%; min-width: 0; height: var(--target-kid); border: 0; border-radius: var(--radius-md); background: var(--bg-tertiary); text-align: center;
  font-family: var(--font-rounded); font-weight: 800; font-size: 28px; font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.stepper-value::-webkit-inner-spin-button, .stepper-value::-webkit-outer-spin-button { -webkit-appearance: none; }
.cash-worth { font-family: var(--font-rounded); font-weight: 800; font-size: 28px; color: var(--leaf); text-align: center; }
.sentence { flex-wrap: wrap; gap: var(--space-2); font-size: 17px; }
.input-num { width: 84px; text-align: center; padding: 0 8px; }
.btn svg { flex-shrink: 0; }
.btn-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.btn-row .btn { padding: 0 var(--space-2); font-size: 15px; white-space: nowrap; gap: 6px; }
.sentence .input-num { width: 72px; }

/* ---- tab bar with five sections ---- */
.tabbar a { min-width: 0; flex: 1; }

/* ---- learning ---- */
.goal-card { display: flex; align-items: center; gap: var(--space-4); }
.goal-ring, .result-ring {
  --p: 0%; width: 76px; height: 76px; border-radius: var(--radius-pill); flex-shrink: 0; display: grid; place-items: center;
  background: conic-gradient(var(--grape) var(--p), color-mix(in srgb, var(--grape) 18%, transparent) 0);
}
.goal-ring span, .result-ring span {
  width: 60px; height: 60px; border-radius: var(--radius-pill); background: var(--bg); color: var(--label); display: grid; place-items: center;
  font-family: var(--font-rounded); font-weight: 800; font-size: 20px;
}
.result-ring { width: 150px; height: 150px; background: conic-gradient(var(--leaf) var(--p), var(--fill) 0); }
.result-ring span { width: 120px; height: 120px; font-size: 36px; }
.ex-card { display: flex; align-items: center; gap: var(--space-3); width: 100%; border: 0; cursor: pointer; text-align: left; padding: var(--space-3); min-height: 76px; }
.ex-card.done { opacity: .8; }
.ex-icon { width: 52px; height: 52px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ex-icon.small { width: 36px; height: 36px; border-radius: var(--radius-xs); }
.ex-title { font-family: var(--font-rounded); font-weight: 800; font-size: 18px; line-height: 23px; }
.ex-points {
  flex-shrink: 0; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--sun-tint); color: var(--sun-ink);
  font-family: var(--font-rounded); font-weight: 800; font-size: 16px;
}
.notice { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--grape); background: var(--grape-tint); box-shadow: none; }
.notice .grow { color: var(--label); }
.check-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--radius-md); cursor: zoom-in; background: var(--bg-tertiary); }
.subject-card { display: flex; flex-direction: column; gap: var(--space-3); }
.week-bars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; align-items: end; height: 80px; }
.week-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.week-bar .bar { width: 100%; max-width: 28px; border-radius: 6px 6px 3px 3px; background: var(--grape); }
.week-label { font-size: 10px; line-height: 12px; color: var(--label-secondary); white-space: nowrap; }
.given { text-decoration: line-through; color: var(--label-secondary); }
.cell[aria-pressed] .cell-tick { color: var(--coral); visibility: hidden; display: inline-flex; }
.cell[aria-pressed="true"] { background: var(--coral-tint); }
.cell[aria-pressed="true"] .cell-tick { visibility: visible; }
.q-editor .input-sm { background: var(--bg-tertiary); }
.switch-row { min-height: var(--target-min); font-size: 17px; cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: var(--radius-pill); background: var(--fill); position: relative; cursor: pointer; transition: background .2s ease; flex-shrink: 0; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: var(--radius-pill); background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s ease; }
.switch:checked { background: var(--leaf); }
.switch:checked::after { transform: translateX(20px); }

/* ---- the exercise player ---- */
.player { position: fixed; inset: 0; z-index: 18; background: var(--bg-grouped); overflow-y: auto; animation: fade .15s ease; }
.player-inner {
  min-height: 100%; max-width: 560px; margin: 0 auto; box-sizing: border-box; display: flex; flex-direction: column; gap: var(--space-5);
  padding: calc(env(safe-area-inset-top) + var(--space-4)) var(--space-4) calc(env(safe-area-inset-bottom) + var(--space-6));
}
.player-inner.center, .player-inner.result { align-items: center; justify-content: center; text-align: center; }
.player-top { display: flex; align-items: center; gap: var(--space-3); }
.player-progress { flex: 1; height: 12px; border-radius: var(--radius-pill); background: var(--fill); overflow: hidden; }
.player-progress span { display: block; height: 100%; background: var(--leaf); border-radius: var(--radius-pill); transition: width .3s ease; }
.player-count { font-family: var(--font-rounded); font-weight: 800; font-size: 15px; color: var(--label-secondary); min-width: 44px; text-align: right; }
.player-question { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4); min-height: 180px; text-align: center; }
.player-prompt { font-family: var(--font-rounded); font-weight: 800; font-size: 28px; line-height: 36px; overflow-wrap: anywhere; }
.player-prompt.math { font-size: 48px; line-height: 56px; font-variant-numeric: tabular-nums; }
.hear { min-height: var(--target-min); font-size: 15px; }
.hear-big {
  width: 150px; height: 150px; border-radius: var(--radius-pill); border: 0; cursor: pointer; background: var(--grape-tint); color: var(--grape);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-family: var(--font-rounded); font-weight: 800; font-size: 18px;
}
.answers { display: grid; gap: var(--space-3); }
.answers.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.answers.row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.answer-btn {
  min-height: 76px; padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-lg); cursor: pointer;
  background: var(--bg); box-shadow: var(--shadow-sm); color: var(--label);
  font-family: var(--font-rounded); font-weight: 800; font-size: 26px; line-height: 30px; overflow-wrap: anywhere; transition: transform .1s ease;
}
.answers.two .answer-btn { font-size: 20px; line-height: 26px; }
.answer-btn:active { transform: scale(.96); }
.answer-btn.right { background: var(--leaf); color: var(--on-leaf); animation: pop .3s ease; }
.answer-btn.wrong { background: var(--danger); color: #fff; }
.answer-btn:disabled { cursor: default; }
.player-input {
  width: 100%; min-height: 72px; border: 0; border-radius: var(--radius-lg); background: var(--bg); box-shadow: var(--shadow-sm); text-align: center;
  font-family: var(--font-rounded); font-weight: 800; font-size: 32px; color: var(--label);
}
.player-input.right { box-shadow: inset 0 0 0 3px var(--leaf); }
.player-input.wrong { box-shadow: inset 0 0 0 3px var(--danger); }
.player-feedback { min-height: 64px; display: flex; flex-direction: column; gap: var(--space-3); text-align: center; }
.fb-right { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); color: var(--leaf); font-family: var(--font-rounded); font-weight: 800; font-size: 26px; animation: pop .3s ease; }
.fb-wrong { font-size: 19px; line-height: 26px; }
.fb-wrong strong { font-family: var(--font-rounded); font-size: 24px; }
.result-points { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-5); border-radius: var(--radius-pill); background: var(--sun-tint); color: var(--sun-ink); font-family: var(--font-rounded); font-weight: 800; font-size: 26px; }
.result-points svg { fill: var(--sun); stroke: var(--sun-ink); }
.result-icon { width: 96px; height: 96px; border-radius: var(--radius-pill); background: var(--leaf-tint); color: var(--leaf); display: grid; place-items: center; }
.pop { animation: pop .35s ease; }
.spin svg { animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player-instructions { font-size: 19px; line-height: 28px; white-space: pre-wrap; }
.task-photo img { width: 100%; border-radius: var(--radius-md); }
.grade-select { width: 110px; flex-shrink: 0; }

/* ---- chores ---- */
.goal-ring.leaf { background: conic-gradient(var(--leaf) var(--p), color-mix(in srgb, var(--leaf) 18%, transparent) 0); }
.chore-card { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2); transition: opacity .3s ease; }
.chore-card.done { opacity: .72; }
.chore-card.just-done { animation: pop .35s ease; }
.chore-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-3); border: 0; background: none; padding: var(--space-1); text-align: left; cursor: pointer; color: inherit; border-radius: var(--radius-md); }
.chore-main:disabled { cursor: default; }
.chore-pic {
  width: 60px; height: 60px; flex-shrink: 0; border-radius: var(--radius-md); background: var(--leaf-tint); color: var(--leaf);
  display: inline-flex; align-items: center; justify-content: center;
}
.chore-pic.big { width: 104px; height: 104px; border-radius: var(--radius-lg); }
.chore-pic.small { width: 36px; height: 36px; border-radius: var(--radius-xs); }
.chore-check, .chore-open {
  width: var(--target-kid); height: var(--target-kid); flex-shrink: 0; border-radius: var(--radius-pill); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-rounded); font-weight: 800; font-size: 17px;
}
.chore-check { border: 3px solid var(--leaf); background: var(--bg); color: var(--leaf); }
.chore-check:active { transform: scale(.94); background: var(--leaf-tint); }
.chore-open { border: 0; background: var(--sun-tint); color: var(--sun-ink); }
.chore-state { width: var(--target-kid); height: var(--target-kid); flex-shrink: 0; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center; }
.chore-state.ok { background: var(--leaf); color: var(--on-leaf); }
.chore-state.wait { background: var(--fill); color: var(--label-secondary); }
.step {
  display: flex; align-items: center; gap: var(--space-3); min-height: var(--target-kid); padding: 0 var(--space-3); border: 0; cursor: pointer;
  border-radius: var(--radius-md); background: var(--bg-tertiary); color: var(--label); font-size: 18px; text-align: left;
}
.step-box { width: 32px; height: 32px; border-radius: var(--radius-xs); border: 2.5px solid var(--leaf); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step.on { background: var(--leaf-tint); }
.step.on .step-box { background: var(--leaf); color: var(--on-leaf); }
.step.on span:last-child { text-decoration: line-through; color: var(--label-secondary); }
.mini-chores { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.mini-chores li { display: flex; align-items: center; gap: var(--space-2); min-height: 32px; font-size: 15px; }
.mini-chores li.done span.grow, .mini-chores li.approved span.grow { color: var(--label-secondary); }
.mini-pic { width: 28px; height: 28px; border-radius: var(--radius-xs); background: var(--leaf-tint); color: var(--leaf); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mini-ok { color: var(--leaf); display: inline-flex; }
.pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: var(--space-2); }
.pic-choice { aspect-ratio: 1; border: 0; border-radius: var(--radius-md); background: var(--bg-tertiary); color: var(--label-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pic-choice[aria-checked="true"] { background: var(--leaf-tint); color: var(--leaf); box-shadow: inset 0 0 0 2px var(--leaf); }
.segmented { overflow-x: auto; }
.segmented button { padding: 0 10px; white-space: nowrap; }
.seg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.seg-grid button {
  min-height: var(--target-min); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-pill); cursor: pointer;
  background: var(--bg-tertiary); color: var(--label); font-family: var(--font-rounded); font-weight: 700; font-size: 15px;
}
.seg-grid button[aria-pressed="true"] { background: var(--coral-tint); color: var(--coral); box-shadow: inset 0 0 0 2px var(--coral); }
.seg-grid button:last-child:nth-child(odd) { grid-column: span 2; }
