/* Summer Quest 2026 — Style D: Rainbow Adventure */

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: #fffbf0;
  color: #1a1a1a;
  overflow-x: hidden;
  line-height: 1.5;
}
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
a  { color: inherit; text-decoration: none; }
input, textarea, select { font-family: inherit; }

/* ── Design tokens (Style D warm/cream) ─────────────────────────── */
:root {
  --space:   #7c3aed;
  --ocean:   #0d9488;
  --gold:    #d97706;
  --green:   #16a34a;
  --red:     #dc2626;

  --bg:      #fffbf0;
  --surface: #ffffff;
  --raised:  #fafaf9;
  --border:  #e7e5e4;
  --border2: #d6d3d1;

  --text:    #1a1a1a;
  --sub:     #44403c;
  --muted:   #78716c;
  --dim:     #a8a29e;
  --faint:   #f5f5f4;
}

.hidden { display: none !important; }

/* ── Screen shell ────────────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }
#screen-pin.active     { display: flex; min-height: 100vh; width: 100%; align-items: center; justify-content: center; padding: 1rem; }
#screen-welcome.active { display: flex; }
#screen-login.active   { display: flex; }

/* ================================================================
   WELCOME — public hero screen
   ================================================================ */
#screen-welcome {
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  background: #0f172a;
}
#screen-welcome canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.welcome-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 2rem 1.5rem;
}
.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  text-align: center;
  max-width: 440px;
  width: 100%;
}
.welcome-badge {
  font-size: 3.5rem;
  animation: welcome-bob 2.5s ease-in-out infinite;
}
@keyframes welcome-bob {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.welcome-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(2.8rem, 10vw, 4.5rem);
  color: #fff;
  line-height: 1.05;
  margin: 0;
}
.welcome-title span {
  background: linear-gradient(135deg, #a78bfa, #38bdf8, #4ade80);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.welcome-tagline {
  font-size: clamp(.88rem, 2.5vw, 1rem);
  font-weight: 700;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
}
.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  width: 100%;
  margin-top: .5rem;
}
.welcome-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 18px;
  font-size: 1.05rem;
  font-weight: 900;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  border: none;
  transition: transform .12s, box-shadow .12s;
}
.welcome-btn:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.welcome-btn:active { transform: translateY(0); }
.welcome-btn-primary {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,.5);
}
.welcome-btn-secondary {
  background: rgba(255,255,255,.08);
  color: #e2e8f0;
  border: 2px solid rgba(255,255,255,.18);
}
.welcome-btn-secondary:hover { background: rgba(255,255,255,.15); }
.welcome-parent-link {
  background: none;
  border: none;
  color: #64748b;
  font-size: .8rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  padding: .3rem .6rem;
  transition: color .12s;
  margin-top: .2rem;
}
.welcome-parent-link:hover { color: #94a3b8; }

/* no canvas on login screen */
#login-canvas { display: none; }

/* ================================================================
   LOGIN — Style D warm/cream (existing explorers)
   ================================================================ */
#screen-login {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #fffbf0;
  padding: 3rem 1.5rem;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}

/* subtle rainbow top stripe */
#screen-login::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg,#f87171,#fb923c,#fbbf24,#4ade80,#60a5fa,#a78bfa,#f472b6);
  background-size: 200% 100%;
  animation: rainbow-shift 4s linear infinite;
}

@keyframes rainbow-shift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.landing-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
}

.landing-logo {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 400;
  color: #1a1a1a;
  letter-spacing: 0.01em;
}

/* Login box */
.landing-overlay { display:flex; align-items:center; justify-content:center; width:100%; }
.landing-login-box {
  background: #fff;
  border: 3px solid #f5f5f5;
  border-radius: 28px;
  padding: 2rem 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  box-shadow: 0 8px 40px rgba(0,0,0,.10);
  width: 100%;
  max-width: 600px;
}
.login-box-header { display:flex; flex-direction:column; align-items:center; gap:.4rem; }
.login-box-title { font-size:1rem; font-weight:800; color:#78716c; margin:0; }
.login-box-divider { width:80%; height:2px; background:#f5f5f5; border-radius:2px; }

/* Kid name lookup */
.kid-lookup-wrap {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 420px;
}
.kid-name-input {
  flex: 1;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.7rem 1.1rem;
  border: 3px solid #e7e5e4;
  border-radius: 16px;
  outline: none;
  color: #1a1a1a;
  transition: border-color 0.15s;
  background: #fffbf0;
}
.kid-name-input:focus { border-color: #a78bfa; background: #fff; }
.kid-lookup-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0.7rem 1.2rem;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  white-space: nowrap;
}
.kid-lookup-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(124,58,237,.35); }
.kid-lookup-error {
  font-size: 0.82rem;
  font-weight: 700;
  color: #dc2626;
  text-align: center;
}
.explorer-cards.login-suggestions { max-height: 240px; overflow-y: auto; }

/* Pin screen — kid card preview (matches dashboard sidebar hero) */
.pin-kid-preview { width: 100%; display: flex; justify-content: center; margin-bottom: 0.25rem; }
.pin-kid-preview.hidden { display: none; }

.pin-hero-card {
  border-radius: 22px;
  padding: 18px 28px 16px;
  text-align: center;
  border: 3px solid;
  width: 100%;
}
.pin-hero-card.space  { background: #ede9fe; border-color: #c4b5fd; }
.pin-hero-card.ocean  { background: #ccfbf1; border-color: #5eead4; }
.pin-hero-card.forest { background: #dcfce7; border-color: #86efac; }
.pin-hero-card.fire   { background: #ffedd5; border-color: #fdba74; }

.pin-hero-avatar {
  font-size: 3.4rem;
  line-height: 1;
  margin-bottom: 8px;
  display: block;
  animation: dash-bounce 3.5s ease-in-out infinite;
}
.pin-hero-name {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  font-weight: 400;
  color: #1a1a1a;
  margin-bottom: 2px;
}
.pin-hero-grade {
  font-size: 0.68rem;
  font-weight: 700;
  color: #78716c;
  margin-bottom: 10px;
}
.pin-hero-xp-track {
  height: 10px;
  background: rgba(0,0,0,.08);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 5px;
  border: 1.5px solid rgba(0,0,0,.08);
}
.pin-hero-xp-fill {
  height: 10px;
  border-radius: 5px;
  transition: width .5s;
}
.pin-hero-card.space  .pin-hero-xp-fill { background: #7c3aed; }
.pin-hero-card.ocean  .pin-hero-xp-fill { background: #0d9488; }
.pin-hero-card.forest .pin-hero-xp-fill { background: #16a34a; }
.pin-hero-card.fire   .pin-hero-xp-fill { background: #ea580c; }
.pin-hero-xp-label { font-size: .62rem; font-weight: 700; color: #78716c; margin-bottom: 10px; }
.pin-hero-rank {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 14px;
  font-size: .75rem;
  font-weight: 800;
  font-family: 'Fredoka One', cursive;
  border: 2px solid;
}
.pin-hero-card.space  .pin-hero-rank { background: #fff; color: #7c3aed; border-color: #c4b5fd; }
.pin-hero-card.ocean  .pin-hero-rank { background: #fff; color: #0d9488; border-color: #5eead4; }
.pin-hero-card.forest .pin-hero-rank { background: #fff; color: #16a34a; border-color: #86efac; }
.pin-hero-card.fire   .pin-hero-rank { background: #fff; color: #ea580c; border-color: #fdba74; }

.school-countdown {
  font-size: 0.8rem;
  font-weight: 700;
  color: #b45309;
  background: #fef9c3;
  border: 2px solid #fde68a;
  padding: 0.3rem 1rem;
  border-radius: 99px;
}

.landing-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #78716c;
}

/* Explorer cards */
.explorer-cards {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.explorer-card {
  cursor: pointer;
  width: 190px;
  background: #fff;
  border: 3px solid #f5f5f5;
  border-top-width: 3px;
  border-radius: 22px;
  padding: 1.75rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
}
.explorer-card:hover { transform: translateY(-5px); box-shadow: 0 10px 28px rgba(0,0,0,.1); }
.explorer-card:focus-visible { outline: 3px solid #c4b5fd; outline-offset: 2px; }

.explorer-card.space { border-top-color: #a78bfa; border-top-width: 4px; }
.explorer-card.ocean { border-top-color: #5eead4; border-top-width: 4px; }
.explorer-card.forest { border-top-color: #4ade80; border-top-width: 4px; }
.explorer-card.fire   { border-top-color: #fb923c; border-top-width: 4px; }

.explorer-card.forest .explorer-card-name { color: #15803d; }
.explorer-card.fire   .explorer-card-name { color: #c2410c; }

.explorer-card-avatar { font-size: 3rem; animation: bounce 3s ease-in-out infinite; }
@keyframes bounce { 0%,100%{transform:translateY(0) rotate(-2deg)} 50%{transform:translateY(-7px) rotate(2deg)} }

.explorer-card-name   { font-family: 'Fredoka One', cursive; font-size: 1.15rem; font-weight: 400; color: #1a1a1a; }
.explorer-card.space .explorer-card-name { color: #6d28d9; }
.explorer-card.ocean .explorer-card-name { color: #0f766e; }
.explorer-card-grade  { font-size: 0.72rem; font-weight: 700; color: #a8a29e; }
.explorer-card-xp     {
  font-size: 0.73rem;
  font-weight: 800;
  color: #78716c;
  background: #fafaf9;
  border: 2px solid #e7e5e4;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
}
.explorer-card-streak { font-size: 0.8rem; font-weight: 700; color: #b45309; }

.parent-entry-btn {
  padding: 0.65rem 1.75rem;
  background: #fff;
  border: 2.5px solid #e7e5e4;
  border-radius: 14px;
  color: #78716c;
  font-size: 0.87rem;
  font-weight: 800;
  transition: background 0.15s, border-color 0.15s;
}
.parent-entry-btn:hover { background: #fafaf9; border-color: #d6d3d1; }

/* ── Login name-first form ── */
.login-name-form {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  max-width: 380px;
}
.login-name-input {
  flex: 1;
  padding: 0.85rem 1.1rem;
  border: 2.5px solid #e7e5e4;
  border-radius: 14px;
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
}
.login-name-input:focus { border-color: #a78bfa; }
.login-name-btn {
  padding: 0.85rem 1.4rem;
  background: #7c3aed;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-family: 'Fredoka One', cursive;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.login-name-btn:hover { background: #6d28d9; }
.login-name-error {
  color: #dc2626;
  font-size: 0.87rem;
  font-weight: 700;
  margin-top: 0.25rem;
  text-align: center;
}

/* ================================================================
   PIN SCREEN  — Style D warm/cream
   ================================================================ */
#screen-pin {
  background: #fffbf0;
}

.pin-wrap { width: 100%; max-width: 420px; }

.pin-card {
  background: #fff;
  border: 3px solid #f5f5f5;
  border-radius: 24px;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.pin-title-icon { font-size: 2.4rem; }
.pin-card h2    { font-family: 'Fredoka One', cursive; font-size: 1.3rem; font-weight: 400; color: #1a1a1a; }
.pin-sub        { font-size: 0.82rem; font-weight: 600; color: #a8a29e; }

.pin-dots { display: flex; gap: 0.65rem; }
.dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #f5f5f5;
  border: 2.5px solid #e7e5e4;
  transition: background 0.15s;
}
.dot.filled { background: #7c3aed; border-color: #7c3aed; }

.pin-error {
  color: #ef4444;
  font-size: 0.82rem;
  font-weight: 700;
  animation: shake 0.35s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-7px); }
  75%       { transform: translateX(7px); }
}

.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  width: 100%;
}
.pin-key {
  background: #fafaf9;
  border: 2px solid #e7e5e4;
  border-radius: 12px;
  padding: 0.9rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: #1a1a1a;
  transition: background 0.1s, border-color 0.1s;
}
.pin-key:hover  { background: #ede9fe; border-color: #c4b5fd; }
.pin-key:active, .pin-key.pressed { background: #ddd6fe; border-color: #a78bfa; transform: scale(.94); }
.pin-del, .pin-clr { font-size: 0.88rem; color: #a8a29e; }

.pin-back-link {
  color: #a8a29e;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  transition: color 0.15s;
}
.pin-back-link:hover { color: #78716c; }

/* ================================================================
   KID SCREEN
   ================================================================ */
#screen-kid { display: none; }
#screen-kid.active {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
  position: relative;
}

.kid-bg { display: none; }

/* ── Header ── */
.kid-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
}
.space-theme .kid-header { border-bottom-color: #1e3a5f; }
.ocean-theme .kid-header  { border-bottom-color: #134e4a; }
.kid-back {
  background: var(--raised);
  border-radius: 9px;
  padding: 0.38rem 0.8rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  transition: background 0.15s;
}
.kid-back:hover { background: var(--border2); }
.kid-header-center { flex: 1; }
.kid-header-name { display: block; font-size: 1.05rem; font-weight: 900; }
.kid-header-rank { display: block; font-size: 0.73rem; color: var(--muted); margin-top: 1px; }
.space-theme .kid-header-rank { color: #60a5fa; }
.ocean-theme  .kid-header-rank { color: #2dd4bf; }
.kid-header-xp {
  font-size: 0.88rem; font-weight: 800;
  color: #92400e;
  background: #fef9c3;
  border: 1px solid #fde68a;
  padding: 0.32rem 0.8rem;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Scrollable body ── */
.kid-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ── Hero ── */
.kid-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.kid-avatar             { font-size: 3.5rem; flex-shrink: 0; line-height: 1; }
.kid-hero-info          { flex: 1; }
.kid-hero-info h2       { font-size: 1.3rem; font-weight: 900; }
.kid-hero-info p        { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.55rem; }
.kid-xp-wrap            { height: 13px; background: var(--faint); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.kid-xp-bar             { height: 100%; border-radius: 99px; transition: width 0.6s ease; }
.space-theme .kid-xp-bar { background: linear-gradient(90deg, #2563eb, #7c3aed); }
.ocean-theme .kid-xp-bar { background: linear-gradient(90deg, #0d9488, #06b6d4); }
.kid-xp-label           { font-size: 0.72rem; color: var(--dim); margin-top: 0.3rem; font-weight: 600; }

.kid-streak   {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  min-width: 54px;
  text-align: center;
}
.streak-fire  { font-size: 2rem; line-height: 1; }
.streak-count { font-size: 0.7rem; font-weight: 800; color: var(--gold); margin-top: 2px; }

/* ── Mood bar ── */
.mood-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  flex-shrink: 0;
  background: var(--surface);
}
.mood-label   { font-size: 0.85rem; color: var(--sub); font-weight: 700; }
.mood-options { display: flex; gap: 0.5rem; }
.mood-btn     { font-size: 1.65rem; padding: 0.12rem 0.2rem; border-radius: 8px; transition: transform 0.1s; }
.mood-btn:hover  { transform: scale(1.25); }
.mood-btn.picked { transform: scale(1.35); outline: 3px solid var(--space); border-radius: 8px; }
.ocean-theme .mood-btn.picked { outline-color: var(--ocean); }

/* ── Panels ── */
.kid-panels { padding: 1rem; flex: 1; }
.kid-panel  { display: none; }
.kid-panel.active { display: block; }

/* ── Inbox ping ── */
.inbox-ping {
  position: absolute;
  bottom: 64px;
  right: 12px;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--sub);
  font-size: 0.77rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.inbox-ping:hover { background: var(--raised); }
.ping-dot { width: 7px; height: 7px; background: var(--gold); border-radius: 50%; }

/* ── Bottom nav — part of the flex column, NO position:fixed ── */
.kid-nav { display: none; }
#screen-kid.active .kid-nav {
  display: flex;
  background: var(--surface);
  border-top: 2px solid var(--border);
  flex-shrink: 0;
  padding: 0.2rem 0;
}
.knav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.6rem 0.25rem 0.45rem;
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--dim);
  transition: color 0.15s;
  border-radius: 0;
}
.knav-btn > :first-child { font-size: 1.5rem; }
.space-theme .knav-btn.active { color: var(--space); }
.ocean-theme .knav-btn.active { color: var(--ocean); }

/* ================================================================
   MISSIONS PANEL
   ================================================================ */
.missions-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.missions-title     { font-size: 1.15rem; font-weight: 900; }
.missions-date      { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.missions-done-badge {
  font-size: 0.8rem; font-weight: 800;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--raised);
  border: 1px solid var(--border2);
  color: var(--sub);
}
.space-theme .missions-done-badge { background: #1e3a5f; border-color: #2563eb; color: #93c5fd; }
.ocean-theme .missions-done-badge { background: #134e4a; border-color: #0d9488; color: #5eead4; }

.missions-prog-msg {
  font-size: 0.85rem; font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.daily-prog-wrap {
  height: 14px;
  background: var(--faint);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.daily-prog-fill { height: 100%; border-radius: 99px; transition: width 0.6s ease; }
.space-theme .daily-prog-fill { background: linear-gradient(90deg, #2563eb, #7c3aed, #ec4899); }
.ocean-theme .daily-prog-fill { background: linear-gradient(90deg, #0d9488, #14b8a6, #06b6d4); }

.mission-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 0.55rem;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
  user-select: none;
  min-height: 70px;
}
.mission-card:hover { background: var(--raised); transform: translateX(2px); }
.mission-card.done  { opacity: 0.5; }
.mission-card.done .mission-name { text-decoration: line-through; }

/* category left accent */
.space-theme .mission-card[data-cat="math"]    { border-left: 3px solid var(--space); }
.space-theme .mission-card[data-cat="coding"]  { border-left: 3px solid #a855f7; }
.space-theme .mission-card[data-cat="reading"] { border-left: 3px solid #06b6d4; }
.space-theme .mission-card[data-cat="outdoor"] { border-left: 3px solid var(--green); }
.space-theme .mission-card[data-cat="stem"]    { border-left: 3px solid var(--gold); }
.ocean-theme .mission-card[data-cat="reading"] { border-left: 3px solid var(--ocean); }
.ocean-theme .mission-card[data-cat="math"]    { border-left: 3px solid var(--space); }
.ocean-theme .mission-card[data-cat="art"]     { border-left: 3px solid #f43f5e; }
.ocean-theme .mission-card[data-cat="outdoor"] { border-left: 3px solid var(--green); }
.ocean-theme .mission-card[data-cat="stem"]    { border-left: 3px solid var(--gold); }

.mission-check {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2.5px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: all 0.15s;
}
.space-theme .mission-card.done .mission-check { background: var(--space); border-color: var(--space); color: #fff; }
.ocean-theme  .mission-card.done .mission-check { background: var(--ocean); border-color: var(--ocean); color: #fff; }

.mission-icon { font-size: 1.8rem; flex-shrink: 0; }
.mission-info { flex: 1; display: flex; flex-direction: column; }
.mission-time { font-size: 0.72rem; color: var(--dim); margin-top: 0.18rem; }
.mission-name { font-size: 0.97rem; font-weight: 800; color: var(--text); }
.mission-cat  {
  font-size: 0.6rem; font-weight: 700;
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  background: var(--faint);
  color: var(--muted);
  align-self: flex-start;
  margin-top: 0.13rem;
}
.mission-xp {
  font-size: 1.05rem; font-weight: 900;
  color: var(--gold);
  flex-shrink: 0;
  text-align: center;
  line-height: 1.2;
}
.mission-xp small { font-size: 0.58rem; color: var(--dim); display: block; font-weight: 700; }

/* ================================================================
   GOALS PANEL
   ================================================================ */
.goals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
@media (max-width: 480px) { .goals-grid { grid-template-columns: 1fr; } }

.goal-card {
  padding: 1rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.goal-card-icon { font-size: 1.7rem; }
.goal-card h4   { font-size: 0.9rem; font-weight: 800; line-height: 1.3; }
.goal-prog-label {
  display: flex; justify-content: space-between;
  font-size: 0.68rem; color: var(--dim);
}
.goal-prog-bar  { height: 4px; background: var(--faint); border-radius: 99px; overflow: hidden; }
.goal-prog-fill { height: 100%; border-radius: 99px; transition: width 0.5s ease; }
.space-theme .goal-prog-fill { background: var(--space); }
.ocean-theme .goal-prog-fill { background: var(--ocean); }
.goal-done-badge { font-size: 0.67rem; font-weight: 700; color: var(--gold); }

.rewards-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  margin-bottom: 0.65rem;
}
.rewards-xp-big   { font-size: 2rem; font-weight: 800; color: var(--gold); }
.rewards-xp-label { font-size: 0.73rem; color: var(--muted); margin-bottom: 0.35rem; }
.rewards-next     { font-size: 0.77rem; color: var(--muted); }

.reward-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 0.35rem;
}
.reward-item.locked { opacity: 0.4; }
.reward-emoji  { font-size: 1.35rem; }
.reward-info   { flex: 1; }
.reward-name   { font-size: 0.83rem; font-weight: 600; }
.reward-xp     { font-size: 0.68rem; color: var(--dim); }
.reward-status { font-size: 0.7rem; color: var(--muted); }

/* ================================================================
   BADGES PANEL
   ================================================================ */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
@media (max-width: 400px) { .badges-grid { grid-template-columns: repeat(2, 1fr); } }

.badge-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.32rem;
  padding: 0.9rem 0.4rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}
.badge-item.earned { border-color: var(--gold); }
.badge-item.locked { opacity: 0.3; filter: grayscale(1); }
.badge-icon  { font-size: 2rem; }
.badge-label { font-size: 0.7rem; font-weight: 800; }
.badge-desc  { font-size: 0.6rem; color: var(--dim); }

/* ================================================================
   WEEKLY PANEL
   ================================================================ */
.week-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.45rem;
  overflow: hidden;
}
.week-card-head {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  cursor: pointer; user-select: none;
}
.week-num    { font-size: 0.67rem; font-weight: 700; color: var(--dim); min-width: 42px; }
.week-focus  { flex: 1; font-size: 0.86rem; font-weight: 700; }
.week-dates  { font-size: 0.63rem; color: var(--dim); }
.week-toggle { font-size: 0.73rem; color: var(--dim); margin-left: 0.2rem; }
.week-body   { padding: 0 0.85rem 0.85rem; display: flex; flex-direction: column; gap: 0.6rem; }
.week-body.collapsed { display: none; }
.week-section h4 { font-size: 0.73rem; font-weight: 700; color: var(--muted); margin-bottom: 0.28rem; }
.week-section ul { display: flex; flex-direction: column; gap: 0.18rem; }
.week-section li {
  font-size: 0.77rem; color: var(--sub);
  padding-left: 0.7rem; position: relative;
}
.week-section li::before { content: '›'; position: absolute; left: 0; color: var(--dim); }
.week-checklist-item {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.77rem; color: var(--sub);
  cursor: pointer; padding: 0.13rem 0;
}
.week-checklist-item input { accent-color: var(--space); }
.week-checklist-item.done  { text-decoration: line-through; color: var(--dim); }

/* ================================================================
   BUCKET LIST PANEL
   ================================================================ */
.bucket-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.6rem;
}
.bucket-title { font-size: 0.92rem; font-weight: 800; }
.bucket-count { font-size: 0.73rem; color: var(--muted); }

.bucket-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 0.45rem;
  cursor: pointer;
  transition: background 0.12s;
}
.bucket-item:hover       { background: var(--raised); }
.bucket-item.done        { opacity: 0.48; }
.bucket-item.done .bucket-text { text-decoration: line-through; }
.bucket-check {
  width: 24px; height: 24px;
  border-radius: 7px;
  border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; flex-shrink: 0;
}
.bucket-item.done .bucket-check {
  background: var(--gold); border-color: var(--gold); color: var(--bg);
}
.bucket-text { font-size: 0.88rem; color: var(--sub); font-weight: 600; }

/* ================================================================
   PARENT COMMAND CENTER
   ================================================================ */
#screen-parent { background: var(--bg); min-height: 100vh; position: relative; }
#screen-parent::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,#f87171,#fb923c,#fbbf24,#4ade80,#60a5fa,#a78bfa,#f472b6);
  background-size: 200% 100%;
  animation: rainbow-shift 4s linear infinite;
  z-index: 30;
}

.parent-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 4px; z-index: 20;
}
.parent-logo         { font-family: 'Fredoka One', cursive; font-size: 1.05rem; font-weight: 400; color: #1a1a1a; }
.parent-header-right { display: flex; align-items: center; gap: 0.7rem; }
.parent-date         { font-size: 0.73rem; color: var(--dim); }
.parent-lock-btn {
  padding: 0.32rem 0.8rem;
  background: var(--raised);
  border: 1.5px solid var(--border2);
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 700;
  transition: background 0.15s;
}
.parent-lock-btn:hover { background: var(--border); color: var(--text); }

.parent-nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 54px; z-index: 15; }
.parent-nav-scroll {
  display: flex; gap: 0.18rem;
  overflow-x: auto; padding: 0.4rem 0.75rem;
  scrollbar-width: none;
}
.parent-nav-scroll::-webkit-scrollbar { display: none; }
.pnav-btn {
  padding: 0.38rem 0.82rem;
  border-radius: 9px;
  font-size: 0.75rem; font-weight: 700;
  color: var(--muted); white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.pnav-btn:hover  { background: var(--raised); color: var(--sub); }
.pnav-btn.active { background: #ede9fe; color: #6d28d9; }

.parent-main     { padding: 1.25rem; }
.psection        { display: none; }
.psection.active { display: block; }
.psection-title  { font-family: 'Fredoka One', cursive; font-size: 1.2rem; font-weight: 400; margin-bottom: 1rem; color: #1a1a1a; }

/* kid switcher tabs */
.kid-switcher { display: flex; gap: 0.38rem; margin-bottom: 0.8rem; }
.ksw-btn {
  padding: 0.37rem 0.95rem;
  border-radius: 7px;
  font-size: 0.79rem; font-weight: 700;
  border: 1px solid var(--border);
  color: var(--dim);
  background: var(--surface);
  transition: all 0.15s;
}
.ksw-btn:hover { background: var(--raised); color: var(--text); }
.ksw-btn.active.space { background: #ede9fe; border-color: #a78bfa; color: #6d28d9; }
.ksw-btn.active.ocean { background: #ccfbf1; border-color: #5eead4; color: #0f766e; }

/* Overview grid */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}
.ov-card {
  border-radius: 12px;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  display: flex; flex-direction: column; gap: 0.65rem;
}
.ov-card.space { border-top-color: var(--space); }
.ov-card.ocean { border-top-color: var(--ocean); }
.ov-header  { display: flex; align-items: center; gap: 0.7rem; }
.ov-avatar  { font-size: 1.65rem; }
.ov-name    { font-size: 0.93rem; font-weight: 800; }
.ov-grade   { font-size: 0.68rem; color: var(--dim); }
.ov-xp      { margin-left: auto; font-size: 0.93rem; font-weight: 800; color: var(--gold); }
.ov-prog-label { display: flex; justify-content: space-between; font-size: 0.68rem; color: var(--dim); margin-bottom: 0.18rem; }
.ov-prog-bar   { height: 4px; background: var(--faint); border-radius: 99px; overflow: hidden; }
.ov-prog-fill  { height: 100%; border-radius: 99px; }
.space .ov-prog-fill { background: var(--space); }
.ocean .ov-prog-fill { background: var(--ocean); }
.ov-meta  { display: flex; gap: 0.38rem; flex-wrap: wrap; }
.ov-badge {
  font-size: 0.68rem; padding: 0.15rem 0.5rem;
  border-radius: 4px; background: var(--faint); color: var(--muted);
}

/* Pending approvals box (overview + missions) */
.pa-box {
  background: #fffbeb;
  border: 2px solid #fde68a;
  border-radius: 14px;
  padding: 0.85rem 1rem;
}
.pa-title {
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  font-weight: 400;
  color: #92400e;
  margin-bottom: 0.65rem;
}
.pa-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: #fff;
  border: 2px solid #fde68a;
  border-radius: 11px;
  margin-bottom: 0.38rem;
}
.pa-row:last-child { margin-bottom: 0; }
.pa-avatar { font-size: 1.25rem; flex-shrink: 0; }
.pa-ico    { font-size: 1.5rem; flex-shrink: 0; }
.pa-info   { flex: 1; min-width: 0; }
.pa-name   { font-size: 0.87rem; font-weight: 800; color: #1a1a1a; }
.pa-meta   { font-size: 0.7rem; font-weight: 700; color: #a8a29e; margin-top: 1px; }
.pa-btns   { display: flex; gap: 5px; flex-shrink: 0; }
.pa-btn {
  padding: 6px 11px; border-radius: 9px;
  font-size: 0.78rem; font-weight: 800;
  cursor: pointer; transition: all 0.15s;
  border: 2px solid; font-family: 'Nunito', sans-serif;
}
.pa-btn.approve { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.pa-btn.approve:hover { background: #a7f3d0; }
.pa-btn.reject  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.pa-btn.reject:hover  { background: #fecaca; }

/* Approvals nav badge */
.pnav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; border-radius: 999px;
  background: #dc2626; color: #fff; font-size: .7rem; font-weight: 800;
  padding: 0 4px; margin-left: 3px; vertical-align: middle; line-height: 1;
}
.pnav-btn.has-pending { background: #fef9c3; border-color: #fde047 !important; color: #92400e; }
.pnav-btn.has-pending.active { background: #fef08a; color: #78350f; }

/* Approvals section */
.pa-row-lg { padding: .75rem 1rem; gap: .75rem; border-radius: 13px; margin-bottom: .5rem;
  background: #fff; border: 2px solid #fde68a; display: flex; align-items: center; }
.pa-kid-tag { font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 7px;
  flex-shrink: 0; white-space: nowrap; }
.pa-kid-tag.space  { background: #ede9fe; color: #6d28d9; }
.pa-kid-tag.ocean  { background: #ccfbf1; color: #0f766e; }
.pa-all-clear { text-align: center; padding: 3rem 1rem; }
.pa-all-clear-ico { font-size: 3rem; margin-bottom: .75rem; }
.pa-all-clear-msg { font-size: 1rem; font-weight: 700; color: var(--sub); }

/* Missions (parent) */
.p-mission-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.82rem;
  border-radius: 9px; background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 0.33rem;
}
.p-mission-row.done { opacity: 0.48; }
.p-mission-row label { display: flex; align-items: center; gap: 0.6rem; flex: 1; cursor: pointer; }
.p-mission-row label input { accent-color: var(--space); width: 14px; height: 14px; }
.p-mission-time { font-size: 0.67rem; color: var(--dim); min-width: 38px; }
.p-mission-name { font-size: 0.84rem; font-weight: 600; color: var(--sub); flex: 1; }
.p-mission-xp   { font-size: 0.72rem; font-weight: 700; color: var(--gold); }

/* Goals (parent) */
.p-goal-row {
  padding: 0.85rem; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 0.45rem;
  display: flex; flex-direction: column; gap: 0.42rem;
}
.p-goal-title    { font-size: 0.87rem; font-weight: 700; }
.p-goal-controls { display: flex; align-items: center; gap: 0.42rem; }
.adj-btn {
  width: 27px; height: 27px;
  border-radius: 6px;
  background: var(--raised); border: 1px solid var(--border2);
  color: var(--text); font-size: 0.92rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s;
}
.adj-btn:hover    { background: var(--border2); }
.adj-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.adj-count { font-size: 0.87rem; font-weight: 700; min-width: 28px; text-align: center; }
.adj-neg { color: #dc2626; }
.adj-pos { color: #16a34a; }

.p-xp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: 10px; padding: 0.85rem;
}
.p-xp-card.space { border-top-color: var(--space); }
.p-xp-card.ocean { border-top-color: var(--ocean); }
.p-xp-header  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.p-xp-name    { font-size: 0.83rem; font-weight: 700; }
.p-xp-big     { font-size: 1.4rem; font-weight: 800; color: var(--gold); }
.p-xp-adj     { display: flex; gap: 0.38rem; flex-wrap: wrap; }

/* Badges (parent) */
.p-badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.5rem; }
.p-badge-item {
  padding: 0.62rem 0.38rem; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 0.22rem; text-align: center;
}
.p-badge-item.earned { border-color: var(--gold); }
.p-badge-item.locked { opacity: 0.28; }
.p-badge-icon  { font-size: 1.45rem; }
.p-badge-label { font-size: 0.62rem; font-weight: 700; }

/* Tracker */
.sub-tabs { display: flex; gap: 0.33rem; margin-bottom: 0.65rem; flex-wrap: wrap; }
.sub-tab-btn {
  padding: 0.28rem 0.72rem; border-radius: 6px;
  font-size: 0.74rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--dim); transition: all 0.15s;
}
.sub-tab-btn.active { background: var(--raised); border-color: var(--border2); color: var(--text); }

.tracker-add-form { display: flex; gap: 0.45rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.tracker-input {
  flex: 1; padding: 0.5rem 0.7rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); font-size: 0.83rem; min-width: 0;
}
.tracker-input:focus { outline: none; border-color: var(--space); }
.tracker-date {
  padding: 0.5rem 0.55rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); font-size: 0.8rem;
}
.tracker-date:focus { outline: none; border-color: var(--space); }
.btn-add {
  padding: 0.5rem 0.95rem; background: var(--space);
  color: white; border-radius: 7px; font-size: 0.83rem; font-weight: 600;
  transition: opacity 0.15s;
}
.btn-add:hover { opacity: 0.88; }

.entry-row {
  display: flex; align-items: flex-start; gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 0.32rem;
}
.entry-text  { flex: 1; font-size: 0.82rem; color: var(--sub); }
.entry-date  { font-size: 0.63rem; color: var(--dim); margin-top: 0.18rem; }
.btn-del     { color: var(--dim); font-size: 0.78rem; padding: 0.13rem 0.28rem; border-radius: 4px; transition: color 0.15s; }
.btn-del:hover { color: var(--red); }

/* Resources */
.resource-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.82rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; margin-bottom: 0.32rem;
}
.res-info { flex: 1; }
.res-name { font-size: 0.83rem; font-weight: 600; }
.res-meta { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.13rem; }
.res-tag  {
  font-size: 0.63rem; padding: 0.08rem 0.38rem;
  background: var(--faint); border-radius: 4px; color: var(--muted);
}
.res-desc { font-size: 0.72rem; color: var(--sub); margin-top: 0.22rem; }
.res-link { font-size: 0.77rem; font-weight: 600; color: #7c3aed; transition: color 0.15s; white-space: nowrap; }
.res-link:hover { color: #6d28d9; }

/* Notes */
.notes-compose {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem; margin-bottom: 1rem;
}
.notes-compose h3 { font-size: 0.87rem; font-weight: 800; margin-bottom: 0.7rem; }
.notes-kid-pick   { display: flex; gap: 0.38rem; margin-bottom: 0.7rem; }
.notes-kid-btn {
  padding: 0.33rem 0.82rem; border-radius: 7px;
  font-size: 0.78rem; font-weight: 600;
  background: var(--raised); border: 1px solid var(--border2);
  color: var(--muted); transition: all 0.15s;
}
.notes-kid-btn:hover { color: var(--text); }
.notes-kid-btn.active.space { background: #ede9fe; border-color: #a78bfa; color: #6d28d9; }
.notes-kid-btn.active.ocean { background: #ccfbf1; border-color: #5eead4; color: #0f766e; }
.notes-textarea {
  width: 100%; padding: 0.6rem 0.8rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text); font-size: 0.83rem;
  min-height: 78px; resize: vertical; margin-bottom: 0.6rem;
}
.notes-textarea:focus { outline: none; border-color: var(--space); }
.notes-send-btn {
  padding: 0.5rem 1.2rem; background: var(--space);
  color: white; border-radius: 7px; font-size: 0.83rem; font-weight: 700;
  transition: opacity 0.15s;
}
.notes-send-btn:hover { opacity: 0.88; }

.note-history-item {
  display: flex; align-items: flex-start; gap: 0.55rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; margin-bottom: 0.38rem;
}
.note-for  { font-size: 1rem; }
.note-body { flex: 1; font-size: 0.82rem; color: var(--sub); }
.note-date { font-size: 0.63rem; color: var(--dim); margin-top: 0.18rem; }

/* Settings */
.settings-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.9rem; margin-bottom: 0.8rem;
}
.settings-group h3 { font-size: 0.83rem; font-weight: 800; margin-bottom: 0.7rem; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0; border-top: 1px solid var(--border);
}
.settings-row:first-of-type { border-top: none; }
.settings-label { font-size: 0.82rem; color: var(--muted); }
.settings-value { font-size: 0.78rem; color: var(--dim); }

/* Buttons */
.btn-primary {
  padding: 0.42rem 0.95rem; background: var(--space); color: white;
  border-radius: 7px; font-size: 0.8rem; font-weight: 600; transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.88; }
.btn-danger {
  padding: 0.42rem 0.95rem;
  background: #fee2e2; border: 1px solid #fca5a5;
  color: #991b1b; border-radius: 7px; font-size: 0.8rem; font-weight: 600;
  transition: background 0.15s;
}
.btn-danger:hover { background: #fecaca; color: #7f1d1d; }
.empty-msg { font-size: 0.8rem; color: var(--dim); text-align: center; padding: 1.5rem; }

/* ================================================================
   OVERLAYS
   ================================================================ */
#confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
.confetti-piece { position: absolute; top: -20px; animation: confettiFall linear forwards; }
@keyframes confettiFall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

/* Badge popup */
#badge-popup {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 1rem;
}
#badge-popup.hidden { display: none; }
.badge-popup-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem 1.5rem; text-align: center;
  max-width: 290px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
}
.badge-popup-icon  { font-size: 2.75rem; }
.badge-popup-title { font-size: 0.75rem; font-weight: 700; color: var(--gold); letter-spacing: 0.08em; text-transform: uppercase; }
.badge-popup-name  { font-size: 1.15rem; font-weight: 800; }
.badge-popup-desc  { font-size: 0.8rem; color: var(--muted); }
.badge-popup-close {
  padding: 0.55rem 1.6rem; background: var(--raised);
  border-radius: 7px; color: var(--text); font-size: 0.86rem; font-weight: 700;
  margin-top: 0.3rem; transition: background 0.15s;
}
.badge-popup-close:hover { background: var(--border2); }

/* Inbox popup */
#inbox-popup {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 1rem;
}
#inbox-popup.hidden { display: none; }
.inbox-popup-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.6rem 1.4rem;
  max-width: 310px; width: 100%;
  display: flex; flex-direction: column; gap: 0.7rem;
}
.inbox-popup-icon { font-size: 1.9rem; }
.inbox-popup-from { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--dim); }
.inbox-popup-text { font-size: 0.93rem; color: var(--text); line-height: 1.6; }
.inbox-popup-close {
  padding: 0.5rem 1.2rem; background: var(--raised);
  border-radius: 7px; color: var(--text); font-size: 0.83rem; font-weight: 700;
  align-self: flex-end; transition: background 0.15s;
}
.inbox-popup-close:hover { background: var(--border2); }

/* Load error */
#load-error { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 300; font-size: 0.95rem; color: var(--red); text-align: center; padding: 1.5rem; }
#load-error.hidden { display: none; }

/* ================================================================
   KID DASHBOARD  (Screen 3)
   ================================================================ */
#screen-kid.active { display:flex; flex-direction:column; height:100vh; min-height:0; overflow:hidden; background:#fffbf0; color:#1a1a1a; font-family:'Nunito',system-ui,sans-serif; }
@keyframes dash-bounce { 0%,100%{transform:translateY(0) rotate(-2deg)} 50%{transform:translateY(-7px) rotate(2deg)} }
@keyframes dash-pop    { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }
@keyframes dash-shake  { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }
.dash .rainbow-bar { height:4px; background:#e7e5e4; flex-shrink:0; }
.dash .top-header  { background:#fff; border-bottom:3px solid #f5f5f5; padding:12px 32px; display:flex; align-items:center; gap:14px; flex-shrink:0; }
.dash .th-back     { padding:7px 16px; border-radius:12px; font-size:.85rem; font-weight:800; color:#78716c; border:2.5px solid #e7e5e4; transition:all .15s; }
.dash .th-back:hover { border-color:#d6d3d1; color:#44403c; }
.dash .th-avatar   { font-size:2.4rem; line-height:1; animation:dash-bounce 3s ease-in-out infinite; }
.dash .th-name     { font-size:1.2rem; font-weight:400; font-family:'Fredoka One',cursive; color:#1a1a1a; }
.dash .th-rank     { font-size:.75rem; font-weight:700; margin-top:1px; }
.dash.space .th-rank { color:#7c3aed; }
.dash.ocean .th-rank { color:#0d9488; }
.dash .th-spacer   { flex:1; }
.dash .th-chip     { display:inline-flex; align-items:center; gap:5px; padding:7px 16px; border-radius:16px; font-size:.82rem; font-weight:800; border:2.5px solid; }
.dash .th-chip.streak { background:#fef3c7; border-color:#fde68a; color:#b45309; }
.dash .th-chip.xp     { background:#ede9fe; border-color:#c4b5fd; color:#6d28d9; }
.dash.ocean .th-chip.xp { background:#ccfbf1; border-color:#5eead4; color:#0f766e; }
.dash .th-parent-btn  { position:relative; padding:7px 16px; border-radius:12px; font-size:.85rem; font-weight:800; border:2.5px solid; transition:all .15s; }
.dash.space .th-parent-btn { color:#7c3aed; border-color:#e9d5ff; background:#fdf4ff; }
.dash.space .th-parent-btn:hover { background:#ede9fe; }
.dash.ocean .th-parent-btn { color:#0d9488; border-color:#99f6e4; background:#f0fdfa; }
.dash.ocean .th-parent-btn:hover { background:#ccfbf1; }
.dash .th-parent-btn.has-pending { border-color:#fde68a; background:#fffbeb; color:#b45309; animation:dash-pop .8s ease-in-out infinite; }
.dash .p-badge { position:absolute; top:-7px; right:-7px; width:20px; height:20px; background:#ef4444; color:#fff; border-radius:50%; font-size:.62rem; font-weight:900; display:none; align-items:center; justify-content:center; }
.dash .p-badge.visible { display:flex; }
.dash .main-layout { display:flex; flex:1; overflow:hidden; }
.dash .sidebar  { width:226px; flex-shrink:0; display:flex; flex-direction:column; padding:18px 12px; gap:4px; border-right:3px solid #f5f5f5; background:#fff; overflow-y:auto; }
.dash .sidebar::-webkit-scrollbar { display:none; }
/* Sign out pinned at bottom of sidebar */
.dash .sb-signout-btn { margin-top:auto; padding:9px 14px; border:2px solid #fee2e2; border-radius:12px; background:#fff; color:#dc2626; font-size:.82rem; font-weight:800; cursor:pointer; font-family:'Nunito',sans-serif; transition:background .15s; text-align:left; }
.dash .sb-signout-btn:hover { background:#fee2e2; }
.dash .sb-hero  { border-radius:22px; padding:18px 14px 20px; margin-bottom:12px; text-align:center; overflow:hidden; border:3px solid; }
.dash.space .sb-hero { background:#ede9fe; border-color:#c4b5fd; }
.dash.ocean .sb-hero { background:#ccfbf1; border-color:#5eead4; }
.dash .sb-avatar   { font-size:3.6rem; line-height:1; margin-bottom:8px; animation:dash-bounce 3.5s ease-in-out infinite; display:block; }
.dash .sb-kid-name { font-size:1rem; font-weight:400; font-family:'Fredoka One',cursive; color:#1a1a1a; margin-bottom:2px; }
.dash .sb-greeting { font-size:.68rem; color:#78716c; font-style:italic; line-height:1.4; margin-bottom:12px; }
.dash .sb-xp-track { height:10px; background:rgba(0,0,0,.08); border-radius:5px; overflow:hidden; margin-bottom:5px; border:1.5px solid rgba(0,0,0,.08); }
.dash .sb-xp-fill  { height:10px; border-radius:5px; transition:width .5s; }
.dash.space .sb-xp-fill { background:#7c3aed; }
.dash.ocean .sb-xp-fill { background:#0d9488; }
.dash .sb-xp-label { font-size:.65rem; font-weight:700; color:#78716c; }
.dash .rank-sticker { display:inline-flex; align-items:center; gap:5px; margin-top:12px; padding:6px 14px; border-radius:14px; font-size:.78rem; font-weight:800; font-family:'Fredoka One',cursive; border:2px solid; }
.dash.space .rank-sticker { background:#fff; color:#7c3aed; border-color:#c4b5fd; }
.dash.ocean .rank-sticker { background:#fff; color:#0d9488; border-color:#5eead4; }
.dash .sb-mood { padding:10px 12px; border-radius:16px; margin-bottom:6px; background:#fafaf9; border:2px solid #f5f5f5; }
.dash .sb-mood-label { font-size:.7rem; font-weight:800; color:#a8a29e; margin-bottom:7px; text-transform:uppercase; letter-spacing:.06em; }
.dash .sb-mood-emojis { display:flex; gap:6px; justify-content:center; }
.dash .mood-e { font-size:1.35rem; transition:transform .12s; border-radius:8px; padding:2px; }
.dash .mood-e:hover { transform:scale(1.3); }
.dash .mood-e.picked { transform:scale(1.35); outline:2.5px solid #fde68a; border-radius:8px; }
.dash .sb-nav-btn { display:flex; align-items:center; gap:10px; padding:11px 14px; border-radius:14px; font-size:.88rem; font-weight:800; color:#a8a29e; transition:all .15s; width:100%; text-align:left; border:2px solid transparent; }
.dash .sb-ico { font-size:1.2rem; width:22px; text-align:center; }
.dash .sb-nav-btn:hover { background:#fafaf9; color:#78716c; }
.dash.space .sb-nav-btn.on { background:#ede9fe; color:#6d28d9; border-color:#c4b5fd; }
.dash.ocean .sb-nav-btn.on { background:#ccfbf1; color:#0f766e; border-color:#5eead4; }
.dash .content-area { flex:1; overflow-y:auto; padding:24px 32px; display:flex; flex-direction:column; gap:20px; background:#fafaf9; }
.dash .content-area:has(#panel-codelab.active) { padding:0; overflow:hidden; }
.dash .content-area::-webkit-scrollbar { width:6px; }
.dash .content-area::-webkit-scrollbar-thumb { background:#e7e5e4; border-radius:3px; }
.dash .panel { display:none; flex-direction:column; gap:20px; }
.dash .panel.active { display:flex; }
.dash .fun-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.dash .fun-box { border-radius:20px; padding:18px 20px; text-align:center; border:3px solid; background:#fff; }
.dash .fun-box.purple { border-color:#e9d5ff; background:#fdf4ff; }
.dash .fun-box.orange { border-color:#fed7aa; background:#fff7ed; }
.dash .fun-box.green  { border-color:#bbf7d0; background:#f0fdf4; }
.dash .fun-box.blue   { border-color:#bfdbfe; background:#eff6ff; }
.dash .fun-num { font-size:2.2rem; font-weight:400; font-family:'Fredoka One',cursive; line-height:1; }
.dash .fun-box.purple .fun-num { color:#7c3aed; }
.dash .fun-box.orange .fun-num { color:#ea580c; }
.dash .fun-box.green  .fun-num { color:#16a34a; }
.dash .fun-box.blue   .fun-num { color:#2563eb; }
.dash.ocean .fun-box.purple .fun-num,.dash.ocean .fun-box.blue .fun-num { color:#0d9488; }
.dash .fun-lbl { font-size:.72rem; font-weight:800; color:#a8a29e; text-transform:uppercase; letter-spacing:.05em; margin-top:6px; }

/* ── Stats style picker (temp) ── */
.sv-picker { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.sv-label  { font-size:.72rem; font-weight:800; color:#a8a29e; text-transform:uppercase; letter-spacing:.06em; }
.sv-btn    { padding:5px 14px; border-radius:20px; font-size:.75rem; font-weight:800; font-family:'Nunito',sans-serif; border:2px solid #e7e5e4; background:#fff; color:#78716c; cursor:pointer; transition:all .15s; }
.sv-btn.active,.sv-btn:hover { background:#7c3aed; border-color:#7c3aed; color:#fff; }
.dash.ocean .sv-btn.active,.dash.ocean .sv-btn:hover { background:#0d9488; border-color:#0d9488; }

/* ── Variant B — Dark RPG power board ── */
.fun-stats[data-sv="B"] { display:flex; flex-direction:column; gap:0; background:linear-gradient(160deg,#1e1b4b,#2d1b69); border-radius:20px; overflow:hidden; }
.fun-stats[data-sv="B"] .fun-box { display:flex; flex-direction:row; align-items:center; gap:14px; background:transparent; border:none; border-left:4px solid transparent; border-bottom:1px solid rgba(255,255,255,.08); padding:14px 20px; border-radius:0; text-align:left; }
.fun-stats[data-sv="B"] .fun-box:last-child { border-bottom:none; }
.fun-stats[data-sv="B"] [data-stat="xp"]     { border-left-color:#a78bfa; }
.fun-stats[data-sv="B"] [data-stat="done"]   { border-left-color:#4ade80; }
.fun-stats[data-sv="B"] [data-stat="streak"] { border-left-color:#fb923c; }
.fun-stats[data-sv="B"] [data-stat="badges"] { border-left-color:#60a5fa; }
.fun-stats[data-sv="B"] .fun-lbl { flex:1; color:rgba(255,255,255,.6); font-size:.75rem; margin-top:0; letter-spacing:.08em; }
.fun-stats[data-sv="B"] .fun-num { color:#fff; font-size:1.6rem; min-width:56px; text-align:right; line-height:1; }
.fun-stats[data-sv="B"] [data-stat="xp"]     .fun-num { color:#c4b5fd; }
.fun-stats[data-sv="B"] [data-stat="done"]   .fun-num { color:#86efac; }
.fun-stats[data-sv="B"] [data-stat="streak"] .fun-num { color:#fdba74; }
.fun-stats[data-sv="B"] [data-stat="badges"] .fun-num { color:#93c5fd; }

/* ── Variant C — Vibe gradient tiles ── */
.fun-stats[data-sv="C"] { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.fun-stats[data-sv="C"] .fun-box { border:none; border-radius:24px; padding:20px 10px 16px; }
.fun-stats[data-sv="C"] [data-stat="xp"]     { background:linear-gradient(145deg,#7c3aed,#a855f7); }
.fun-stats[data-sv="C"] [data-stat="done"]   { background:linear-gradient(145deg,#059669,#10b981); }
.fun-stats[data-sv="C"] [data-stat="streak"] { background:linear-gradient(145deg,#ea580c,#f97316); }
.fun-stats[data-sv="C"] [data-stat="badges"] { background:linear-gradient(145deg,#2563eb,#3b82f6); }
.fun-stats[data-sv="C"] .fun-box::before { display:block; font-size:2rem; margin-bottom:4px; line-height:1; }
.fun-stats[data-sv="C"] [data-stat="xp"]::before     { content:"\26A1"; }
.fun-stats[data-sv="C"] [data-stat="done"]::before   { content:"\1F3AF"; }
.fun-stats[data-sv="C"] [data-stat="streak"]::before { content:"\1F525"; }
.fun-stats[data-sv="C"] [data-stat="badges"]::before { content:"\1F3C6"; }
.fun-stats[data-sv="C"] .fun-num { color:#fff; font-size:2rem; text-shadow:0 2px 8px rgba(0,0,0,.2); }
.fun-stats[data-sv="C"] .fun-lbl { color:rgba(255,255,255,.85); margin-top:6px; font-size:.68rem; }
.dash .prog-card  { background:#fff; border-radius:20px; padding:20px 24px; border:3px solid #f5f5f5; display:flex; align-items:center; gap:24px; }
.dash .prog-left  { flex:1; }
.dash .prog-head  { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.dash .prog-title { font-size:1rem; font-weight:900; color:#1a1a1a; }
.dash .prog-msg   { font-size:.85rem; font-weight:800; }
.dash.space .prog-msg { color:#7c3aed; }
.dash.ocean .prog-msg { color:#0d9488; }
.dash .prog-track { height:16px; background:#f5f5f5; border-radius:8px; overflow:hidden; border:2px solid #e7e5e4; margin-bottom:8px; }
.dash .prog-fill  { height:16px; border-radius:8px; transition:width .5s; min-width:4px; }
.dash.space .prog-fill { background:#7c3aed; }
.dash.ocean .prog-fill { background:#0d9488; }
.dash .prog-sub { font-size:.8rem; font-weight:700; color:#a8a29e; }
.dash .prog-ring { flex-shrink:0; position:relative; width:84px; height:84px; }
.dash .prog-ring svg { width:84px; height:84px; transform:rotate(-90deg); }
.dash .ring-bg   { fill:none; stroke:#f5f5f5; stroke-width:8; }
.dash .ring-fill { fill:none; stroke-width:8; stroke-linecap:round; transition:stroke-dashoffset .5s; }
.dash.space .ring-fill { stroke:#7c3aed; }
.dash.ocean .ring-fill { stroke:#0d9488; }
.dash .ring-text { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; line-height:1; }
.dash .ring-num  { font-size:1.3rem; font-weight:400; font-family:'Fredoka One',cursive; color:#1a1a1a; }
.dash .ring-of   { font-size:.55rem; font-weight:800; color:#a8a29e; text-transform:uppercase; letter-spacing:.08em; margin-top:3px; }
.dash .sec-head  { display:flex; align-items:center; justify-content:space-between; }
.dash .sec-title { font-size:.85rem; font-weight:900; font-family:'Fredoka One',cursive; color:#44403c; text-transform:uppercase; letter-spacing:.07em; }
.dash .sec-sub   { font-size:.78rem; font-weight:700; color:#a8a29e; }
.dash .quest-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.dash .quest-card { background:#fff; border-radius:18px; padding:14px 18px; display:flex; align-items:center; gap:12px; cursor:pointer; transition:transform .15s,box-shadow .15s; border:3px solid #f5f5f5; user-select:none; }
.dash .quest-card:hover { transform:translateY(-3px); box-shadow:0 8px 24px rgba(0,0,0,.07); border-color:#e9d5ff; }
.dash.ocean .quest-card:hover { border-color:#99f6e4; }
.dash .quest-card.pending { border-color:#fde68a; background:#fffbeb; position:relative; }
.dash .quest-card.pending .quest-chk { background:#f59e0b; border-color:#f59e0b; animation:dash-pop .8s ease-in-out infinite; }
.dash .quest-card.pending::after { content:'⏳ tap to undo'; position:absolute; top:6px; right:8px; font-size:.6rem; font-weight:800; color:#b45309; background:#fef3c7; border-radius:6px; padding:1px 6px; pointer-events:none; }
.dash .quest-card.done { opacity:.42; cursor:default; }
.dash .quest-card.done .quest-name { text-decoration:line-through; color:#a8a29e; }
.dash .quest-chk { width:30px; height:30px; border-radius:10px; border:3px solid #e7e5e4; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:.9rem; font-weight:900; color:#fff; transition:all .2s; }
.dash .quest-card.done .quest-chk { background:#16a34a; border-color:#16a34a; }
.dash .quest-ico  { font-size:2rem; width:36px; text-align:center; flex-shrink:0; }
.dash .quest-info { flex:1; min-width:0; }
.dash .quest-name { font-size:.93rem; font-weight:700; color:#1a1a1a; margin-bottom:4px; }
.dash .quest-meta { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.dash .quest-time { display:inline-flex; align-items:center; background:#f5f5f5; color:#78716c; padding:2px 9px; border-radius:7px; font-size:.7rem; font-weight:700; }
.dash .cat-pill   { font-size:.65rem; font-weight:800; padding:2px 9px; border-radius:8px; text-transform:uppercase; letter-spacing:.03em; }
.cat-math    { background:#f3e8ff; color:#7c3aed; }
.cat-coding  { background:#dbeafe; color:#1d4ed8; }
.cat-reading { background:#d1fae5; color:#059669; }
.cat-outdoor { background:#dcfce7; color:#15803d; }
.cat-stem    { background:#ffedd5; color:#c2410c; }
.cat-art     { background:#fce7f3; color:#be185d; }
.dash .quest-xp { font-size:.9rem; font-weight:900; flex-shrink:0; padding:5px 12px; border-radius:12px; background:#fef9c3; color:#92400e; border:2px solid #fde68a; white-space:nowrap; }
.dash .done-banner { background:#fff; border-radius:24px; padding:36px; text-align:center; border:3px solid #fde68a; display:none; }
.dash .done-banner.visible { display:block; }
.dash .done-banner .big-e { font-size:4rem; margin-bottom:12px; animation:dash-pop 1s ease-in-out infinite; }
.dash .done-banner h3 { font-size:1.8rem; font-weight:400; font-family:'Fredoka One',cursive; color:#7c3aed; margin-bottom:6px; }
.dash .done-banner p  { font-size:.9rem; color:#78716c; font-weight:600; }
.dash .week-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.dash .wk-card { background:#fff; border-radius:18px; padding:16px 18px; border:3px solid #f5f5f5; transition:box-shadow .15s; display:flex; flex-direction:column; gap:5px; }
.dash .wk-card:hover { box-shadow:0 4px 16px rgba(0,0,0,.07); }
.dash.space .wk-card.current { border-color:#c4b5fd; background:#fdf4ff; }
.dash.ocean .wk-card.current { border-color:#5eead4; background:#f0fdfa; }
.dash .wk-card.past { opacity:.55; }
.dash .wk-top  { display:flex; align-items:center; justify-content:space-between; margin-bottom:2px; }
.dash .wk-num  { font-size:.6rem; font-weight:900; padding:3px 10px; border-radius:8px; text-transform:uppercase; letter-spacing:.07em; }
.dash.space .wk-num { background:#ede9fe; color:#6d28d9; border:1.5px solid #c4b5fd; }
.dash.ocean .wk-num { background:#ccfbf1; color:#0f766e; border:1.5px solid #5eead4; }
.dash .wk-num.current { background:#fef9c3; color:#b45309; border-color:#fde68a; }
.dash .wk-focus     { font-size:.92rem; font-family:'Fredoka One',cursive; color:#1a1a1a; line-height:1.2; }
.dash .wk-theme-tag { font-size:.68rem; color:#a8a29e; font-weight:600; font-style:italic; line-height:1.3; }
.dash .wk-dates     { font-size:.65rem; font-weight:800; color:#d6d3d1; margin-left:auto; }
.dash .wk-card-body { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:10px; padding-top:12px; border-top:2px solid #f5f5f5; }
.dash .wk-card-body .wk-checklist { grid-column:1/-1; border-top:none; padding-top:0; }
.dash .wk-sec-lbl   { font-size:.65rem; font-weight:900; text-transform:uppercase; letter-spacing:.09em; color:#a8a29e; margin-bottom:8px; }
.dash .wk-items     { display:flex; flex-direction:column; gap:6px; }
.dash .wk-item      { font-size:.82rem; color:#44403c; font-weight:600; padding-left:14px; position:relative; line-height:1.4; }
.dash.space .wk-item::before { content:'\203A'; position:absolute; left:0; color:#c4b5fd; font-weight:900; }
.dash.ocean .wk-item::before { content:'\203A'; position:absolute; left:0; color:#5eead4; font-weight:900; }
.dash .wk-check-items { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.dash .wk-check-chip { background:#fafaf9; border:2px solid #e7e5e4; border-radius:11px; padding:6px 14px; font-size:.78rem; font-weight:700; color:#44403c; cursor:pointer; transition:all .15s; user-select:none; }
.dash.space .wk-check-chip:hover { border-color:#c4b5fd; background:#fdf4ff; }
.dash.ocean .wk-check-chip:hover { border-color:#5eead4; background:#f0fdfa; }
.dash .wk-check-chip.checked { background:#d1fae5; border-color:#6ee7b7; color:#065f46; }
.dash .wk-check-chip.checked::before { content:'\2713 '; }
.dash .goals-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.dash .goal-card  { background:#fff; border-radius:18px; padding:18px 16px 14px; display:flex; flex-direction:column; gap:8px; border:3px solid #f5f5f5; transition:transform .15s,box-shadow .15s; }
.dash .goal-card:hover { transform:translateY(-3px); box-shadow:0 8px 24px rgba(0,0,0,.07); }
.dash .goal-ico  { font-size:2.2rem; line-height:1; }
.dash .goal-name { font-size:.85rem; font-weight:800; color:#1a1a1a; line-height:1.3; }
.dash .goal-frac { font-size:.75rem; font-weight:800; color:#a8a29e; }
.dash .goal-bar  { height:8px; background:#f5f5f5; border-radius:4px; overflow:hidden; border:1.5px solid #e7e5e4; margin-top:2px; }
.dash .goal-fill { height:8px; border-radius:4px; }
.dash.space .goal-fill { background:#7c3aed; }
.dash.ocean .goal-fill { background:#0d9488; }
.dash .rewards-card  { background:#fff; border-radius:18px; padding:20px 24px; border:3px solid #f5f5f5; }
.dash .rewards-title { font-size:.9rem; font-weight:900; color:#1a1a1a; margin-bottom:12px; }
.dash .reward-row { display:flex; align-items:center; gap:12px; padding:9px 0; border-top:2px solid #f5f5f5; }
.dash .reward-row:first-child { border-top:none; padding-top:0; }
.dash .reward-ico  { font-size:1.5rem; width:30px; text-align:center; flex-shrink:0; }
.dash .reward-name { flex:1; font-size:.82rem; font-weight:700; color:#1a1a1a; }
.dash .reward-xp   { font-size:.75rem; font-weight:800; padding:3px 10px; border-radius:8px; border:1.5px solid; }
.dash.space .reward-xp { color:#7c3aed; background:#ede9fe; border-color:#c4b5fd; }
.dash.ocean .reward-xp { color:#0d9488; background:#ccfbf1; border-color:#5eead4; }
.dash .reward-row.locked { opacity:.35; }
.dash .reward-row.unlocked .reward-name::before { content:'\2705 '; }
.dash .badges-grid { display:grid; grid-template-columns:repeat(6,1fr); gap:10px; }
.dash .badge-card  { background:#fff; border-radius:16px; padding:14px 10px; display:flex; flex-direction:column; align-items:center; gap:5px; text-align:center; border:3px solid #f5f5f5; transition:transform .15s; }
.dash .badge-card.earned { border-color:#fde68a; background:#fefce8; box-shadow:0 4px 14px rgba(245,158,11,.15); }
.dash .badge-card.earned:hover { transform:scale(1.05); }
.dash .badge-card.locked { opacity:.28; filter:grayscale(1); }
.dash .badge-ico  { font-size:2.2rem; line-height:1; }
.dash .badge-name { font-size:.68rem; font-weight:900; color:#1a1a1a; line-height:1.3; }
.dash .badge-hint { font-size:.58rem; color:#a8a29e; line-height:1.3; }
.dash .bucket-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; }
.dash .bucket-item { background:#fff; display:flex; align-items:center; gap:10px; padding:13px 16px; border-radius:14px; cursor:pointer; transition:all .15s; border:3px solid #f5f5f5; }
.dash .bucket-item:hover { border-color:#e9d5ff; box-shadow:0 4px 12px rgba(0,0,0,.06); }
.dash.ocean .bucket-item:hover { border-color:#99f6e4; }
.dash .bucket-item.done { opacity:.38; }
.dash .bucket-chk { width:26px; height:26px; border-radius:8px; border:3px solid #e7e5e4; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:.85rem; font-weight:900; color:#fff; transition:all .2s; }
.dash .bucket-item.done .bucket-chk { background:#f59e0b; border-color:#f59e0b; }
.dash .bucket-text { font-size:.82rem; font-weight:700; color:#1a1a1a; }
.dash .bucket-item.done .bucket-text { text-decoration:line-through; color:#a8a29e; }

/* Code Lab */
.dash .codelab-panel { display:flex; flex-direction:column; height:calc(100vh - 70px); padding:0 !important; }
.dash .codelab-header { display:flex; align-items:center; gap:10px; padding:14px 18px 10px; flex-shrink:0; }
.dash .codelab-title { font-family:'Fredoka One',cursive; font-size:1.15rem; color:#1a1a1a; flex:1; }
.dash .codelab-newtab { font-size:.75rem; font-weight:700; color:#7c3aed; text-decoration:none; white-space:nowrap; }
.dash .codelab-newtab:hover { color:#6d28d9; text-decoration:underline; }
.dash .codelab-launcher { display:flex; flex-wrap:wrap; gap:6px; padding:0 18px 10px; flex-shrink:0; }
.cl-site-btn { padding:6px 11px; border-radius:9px; font-size:.72rem; font-weight:800;
  background:#f5f5f4; border:2px solid #e7e5e4; color:#44403c; cursor:pointer;
  transition:all .15s; font-family:'Nunito',sans-serif; white-space:nowrap; }
.cl-site-btn:hover { background:#ede9fe; border-color:#c4b5fd; color:#6d28d9; }
.cl-site-btn.active { background:#ede9fe; border-color:#a78bfa; color:#6d28d9; }
.cl-site-ext { border-style:dashed; }
.cl-ext-link { color:#7c3aed; font-weight:700; }
.dash .codelab-frame-wrap { flex:1; position:relative; margin:0 18px 18px; border-radius:14px; overflow:hidden;
  border:2px solid #e7e5e4; min-height:0; }
.dash .codelab-iframe { width:100%; height:100%; border:none; display:block; background:#fff; }
.dash .codelab-placeholder { position:absolute; inset:0; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:12px; background:#fafaf9; }
.dash .codelab-ph-ico { font-size:2.5rem; }
.dash .codelab-ph-msg { font-size:.9rem; font-weight:700; color:#78716c; text-align:center; line-height:1.5; }

/* Python Quest */
.dash .pylearn-panel { flex-direction:column; height:calc(100vh - 70px); padding:0 !important; }
.dash .pyl-layout { display:flex; height:100%; min-height:0; }

.dash .pyl-sidebar { width:210px; flex-shrink:0; border-right:2px solid #e7e5e4; overflow-y:auto;
  display:flex; flex-direction:column; gap:0; padding:14px 10px; background:#fafaf9; }
.dash .pyl-progress-wrap { margin-bottom:12px; padding:0 4px; }
.dash .pyl-prog-label { font-family:'Fredoka One',cursive; font-size:1rem; color:#1a1a1a; margin-bottom:6px; }

/* Language picker */
.dash .pyl-lang-picker { display:flex; flex-direction:row; gap:0; padding:0; border-bottom:2px solid #e7e5e4; margin-bottom:10px; }
.dash .pyl-lang-btn { flex:1; display:flex; align-items:center; justify-content:center; gap:4px; padding:8px 2px; font-size:.72rem; font-weight:800; color:#78716c; border:none; border-bottom:3px solid transparent; background:transparent; transition:all .15s; cursor:pointer; white-space:nowrap; overflow:hidden; }
.dash .pyl-lang-btn:hover { color:#44403c; background:#f5f5f5; }
.dash .pyl-lang-btn.active { color:#1a1a1a; border-bottom-color:currentColor; background:#fff; font-weight:900; }
.dash .pyl-prog-bar { height:8px; background:#e7e5e4; border-radius:99px; overflow:hidden; margin-bottom:4px; }
.dash .pyl-prog-fill { height:100%; background:linear-gradient(90deg,#7c3aed,#a78bfa); border-radius:99px; transition:width .4s ease; }
.dash .pyl-prog-sub { font-size:.68rem; font-weight:700; color:#78716c; }

.dash .pyl-lesson-list { display:flex; flex-direction:column; gap:4px; }
.pyl-lesson-btn { display:flex; align-items:center; gap:7px; padding:8px 10px; border-radius:11px;
  border:2px solid transparent; background:none; cursor:pointer; width:100%; text-align:left;
  transition:all .15s; font-family:'Nunito',sans-serif; }
.pyl-lesson-btn:hover { background:#ede9fe; }
.pyl-lesson-btn.active { background:#ede9fe; border-color:#c4b5fd; }
.pyl-lesson-btn.done { opacity:.7; }
.pyl-lesson-btn.done.active { opacity:1; }
.pyl-lesson-num { width:20px; height:20px; border-radius:6px; background:#e7e5e4; color:#44403c;
  font-size:.67rem; font-weight:900; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.pyl-lesson-btn.done .pyl-lesson-num { background:#d1fae5; color:#065f46; }
.pyl-lesson-btn.active .pyl-lesson-num { background:#7c3aed; color:#fff; }
.pyl-lesson-ico { font-size:1rem; flex-shrink:0; }
.pyl-lesson-name { font-size:.78rem; font-weight:700; color:#1a1a1a; flex:1; line-height:1.2; }
.pyl-done-chip { font-size:.6rem; font-weight:900; background:#d1fae5; color:#065f46;
  padding:2px 5px; border-radius:5px; white-space:nowrap; }

.dash .pyl-main { width:460px; flex-shrink:0; overflow-y:auto; padding:16px 18px; border-right:2px solid #e7e5e4; }

/* Trinket pane → Local editor pane */
.dash .pyl-trinket-pane { flex:1; display:flex; flex-direction:column; min-width:0; background:#1e1e2e; }
.dash .pyl-trinket-header { display:flex; align-items:center; gap:6px; padding:8px 12px; border-bottom:2px solid #313244; flex-shrink:0; background:#181825; }
.dash .pyl-trinket-label { font-family:'Fredoka One',cursive; font-size:.92rem; color:#cdd6f4; flex:1; }
.pyl-run-btn { background:#a6e3a1; color:#1e1e2e; border:none; padding:5px 14px; border-radius:7px; font-weight:900; font-size:.82rem; cursor:pointer; font-family:'Nunito',sans-serif; letter-spacing:.02em; }
.pyl-run-btn:hover { background:#94e2d5; }
.pyl-reset-progress-btn { margin:10px 4px 4px; width:calc(100% - 8px); padding:7px 10px; border:none; border-radius:8px;
  background:#fee2e2; color:#dc2626; font-size:.75rem; font-weight:800; cursor:pointer; font-family:'Nunito',sans-serif; }
.pyl-reset-progress-btn:hover { background:#fecaca; }

/* Tier section headers */
.dash .pyl-tier-header { display:flex; align-items:center; gap:5px; padding:8px 6px 4px; margin-top:4px; }
.dash .pyl-tier-icon { font-size:.8rem; }
.dash .pyl-tier-label { font-size:.72rem; font-weight:900; text-transform:uppercase; letter-spacing:.07em; color:#78716c; flex:1; }
.dash .pyl-tier-count { font-size:.68rem; font-weight:700; color:#a8a29e; }
.dash .pyl-tier-lock { font-size:.8rem; }
.dash .pyl-tier-coming { font-size:.65rem; font-weight:700; background:#fef3c7; color:#d97706; padding:2px 6px; border-radius:6px; }
/* Locked tier placeholder */
.dash .pyl-tier-locked { margin:2px 4px 8px; padding:8px 10px; border-radius:10px; background:#f5f5f4; border:1.5px dashed #d6d3d1; font-size:.71rem; color:#a8a29e; font-weight:600; text-align:center; line-height:1.4; }

.pyl-reset-btn { background:#313244; color:#a6adc8; border:none; padding:5px 10px; border-radius:7px; font-weight:700; font-size:.8rem; cursor:pointer; font-family:'Nunito',sans-serif; }
.pyl-reset-btn:hover { background:#45475a; color:#cdd6f4; }
.pyl-code-editor { flex:1; width:100%; border:none; resize:none; font-family:'Courier New',Consolas,monospace; font-size:.84rem; line-height:1.55; padding:12px 14px; background:#1e1e2e; color:#cdd6f4; outline:none; tab-size:4; min-height:0; box-sizing:border-box; }
.pyl-code-editor::placeholder { color:#6c7086; }
.pyl-output-wrap { flex-shrink:0; height:140px; display:flex; flex-direction:column; border-top:2px solid #313244; }
.pyl-output-header { padding:5px 14px 3px; font-size:.7rem; font-weight:800; color:#a6adc8; background:#181825; border-bottom:1px solid #313244; flex-shrink:0; letter-spacing:.05em; text-transform:uppercase; }
.dash .pyl-html-preview { flex:1; background:#fff; border:none; width:100%; }
.pyl-output-wrap:has(.pyl-html-preview[style*="block"]) { height:200px; }
.pyl-output { margin:0; padding:8px 14px; overflow-y:auto; flex:1; font-family:'Courier New',Consolas,monospace; font-size:.82rem; background:#11111b; color:#a6e3a1; white-space:pre-wrap; word-break:break-all; }

/* ================================================================
   ONBOARDING WIZARD
================================================================ */
#screen-onboarding { background: linear-gradient(135deg, #f0f4ff 0%, #fef9f0 100%); }
.ob-wrap { display:flex; align-items:center; justify-content:center; min-height:100vh; padding:1.5rem; }
.ob-card { background:#fff; border-radius:28px; padding:2rem 2rem 1.75rem; max-width:560px; width:100%;
  box-shadow:0 12px 50px rgba(0,0,0,.12); display:flex; flex-direction:column; align-items:center; gap:1rem; }

/* Progress dots */
.ob-progress { display:flex; gap:8px; margin-bottom:.25rem; }
.ob-dot { width:10px; height:10px; border-radius:50%; background:#e7e5e4; transition:all .25s; }
.ob-dot.done   { background:#a78bfa; }
.ob-dot.active { background:#7c3aed; transform:scale(1.3); }

/* Title / sub */
.ob-avatar { font-size:3.5rem; line-height:1; }
.ob-title  { font-family:'Fredoka One',cursive; font-size:1.55rem; color:#1a1a1a; margin:0; text-align:center; }
.ob-sub    { font-size:.88rem; color:#78716c; text-align:center; margin:0; line-height:1.5; }

/* Grade selector */
.ob-grade-row   { display:flex; align-items:center; gap:.75rem; }
.ob-grade-label { font-size:.9rem; font-weight:700; color:#44403c; }
.ob-grade-select { border:2px solid #e9d5ff; border-radius:10px; padding:6px 12px; font-size:.9rem; font-weight:700; font-family:'Nunito',sans-serif; color:#7c3aed; background:#faf5ff; outline:none; cursor:pointer; }

/* Interest chips */
.ob-chips { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; width:100%; }
.ob-chip  { display:flex; align-items:center; gap:5px; padding:7px 13px; border-radius:50px;
  border:2px solid #e7e5e4; background:#fafaf9; font-size:.8rem; font-weight:700; color:#44403c;
  cursor:pointer; transition:all .15s; }
.ob-chip:hover { border-color:#c4b5fd; background:#ede9fe; }
.ob-chip.sel   { border-color:#7c3aed; background:#ede9fe; color:#5b21b6; }
.ob-chip-ico   { font-size:1rem; }
.ob-chip-lbl   { white-space:nowrap; }

/* Goals grid */
.ob-goals-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; width:100%; }
.ob-goal-card  { display:flex; flex-direction:column; align-items:center; gap:4px; padding:10px 8px;
  border:2px solid #e7e5e4; border-radius:14px; background:#fafaf9; cursor:pointer; transition:all .15s; text-align:center; }
.ob-goal-card:hover { border-color:#c4b5fd; background:#ede9fe; }
.ob-goal-card.sel   { border-color:#7c3aed; background:#ede9fe; }
.ob-goal-ico   { font-size:1.5rem; }
.ob-goal-lbl   { font-size:.75rem; font-weight:700; color:#44403c; line-height:1.3; }
.ob-goal-match { font-size:.62rem; color:#7c3aed; font-weight:800; background:#f3e8ff; border-radius:5px; padding:1px 5px; }

/* Summary */
.ob-summary    { width:100%; background:#f8f7ff; border-radius:14px; padding:.9rem 1rem; display:flex; flex-direction:column; gap:.5rem; }
.ob-sum-row    { display:flex; gap:.6rem; align-items:flex-start; font-size:.83rem; }
.ob-sum-label  { font-weight:900; color:#7c3aed; min-width:80px; flex-shrink:0; }
.ob-sum-val    { color:#44403c; font-weight:600; line-height:1.4; }

/* Buttons */
.ob-next-btn  { background:linear-gradient(135deg,#7c3aed,#6d28d9); color:#fff; border:none; border-radius:50px;
  padding:.75rem 2.2rem; font-size:1rem; font-weight:900; font-family:'Nunito',sans-serif;
  cursor:pointer; transition:transform .1s, box-shadow .1s; box-shadow:0 4px 14px rgba(124,58,237,.35); margin-top:.25rem; }
.ob-next-btn:hover:not(:disabled) { transform:translateY(-2px); box-shadow:0 7px 20px rgba(124,58,237,.4); }
.ob-next-btn:disabled { opacity:.4; cursor:not-allowed; transform:none; box-shadow:none; }
.ob-launch-btn { background:linear-gradient(135deg,#0d9488,#0f766e); box-shadow:0 4px 14px rgba(13,148,136,.35); }
.ob-launch-btn:hover { box-shadow:0 7px 20px rgba(13,148,136,.4); }

/* Empty state */
.ob-empty { text-align:center; color:#a8a29e; font-size:.88rem; font-weight:700; padding:2rem; width:100%; }

/* ── Goals panel additions ─── */
.dash .goal-btns     { display:flex; gap:5px; margin-top:4px; }
.dash .goal-inc-btn  { border:2px solid #e9d5ff; border-radius:8px; background:#faf5ff; color:#7c3aed;
  font-size:.78rem; font-weight:800; padding:2px 10px; cursor:pointer; transition:background .12s; }
.dash .goal-inc-btn:hover  { background:#ede9fe; }
.dash .goal-inc-btn.goal-dec { border-color:#fde8d8; color:#c2410c; background:#fff7ed; }
.dash .goal-inc-btn.goal-dec:hover { background:#fde8d8; }
.dash .goal-setup-btn { margin-top:.5rem; width:100%; padding:8px; border:2px dashed #e9d5ff; border-radius:12px;
  background:#faf5ff; color:#7c3aed; font-size:.8rem; font-weight:800; cursor:pointer; transition:background .12s; }
.dash .goal-setup-btn:hover { background:#ede9fe; }

/* ── Book catalog ─── */
.dash .books-filter  { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.dash .bf-chip { border:2px solid #e7e5e4; border-radius:50px; background:#fafaf9;
  padding:4px 12px; font-size:.75rem; font-weight:800; color:#78716c; cursor:pointer; transition:all .12s; }
.dash .bf-chip:hover { border-color:#c4b5fd; background:#ede9fe; }
.dash .bf-chip.sel   { border-color:#7c3aed; background:#ede9fe; color:#5b21b6; }

.dash .books-grid  { display:flex; flex-direction:column; gap:10px; }
.dash .book-card   { display:flex; gap:12px; align-items:flex-start; background:#fff; border:2px solid #f5f5f5;
  border-radius:16px; padding:14px 16px; transition:border-color .15s; }
.dash .book-card:hover   { border-color:#e9d5ff; }
.dash .book-card.read    { opacity:.55; }
.dash .book-ico    { font-size:2.2rem; flex-shrink:0; width:38px; text-align:center; }
.dash .book-info   { flex:1; min-width:0; }
.dash .book-title  { font-size:.92rem; font-weight:800; color:#1a1a1a; margin-bottom:2px; }
.dash .book-author { font-size:.75rem; font-weight:700; color:#a8a29e; margin-bottom:4px; }
.dash .book-blurb  { font-size:.8rem; color:#78716c; line-height:1.45; }
.dash .book-match  { font-size:.7rem; font-weight:800; color:#7c3aed; background:#f3e8ff; border-radius:6px; padding:1px 6px; display:inline-block; margin-top:4px; }
.dash .book-read-btn { flex-shrink:0; align-self:center; border:2px solid #e9d5ff; border-radius:10px;
  background:#faf5ff; color:#7c3aed; font-size:.75rem; font-weight:800; padding:5px 10px; cursor:pointer; white-space:nowrap; transition:all .12s; }
.dash .book-read-btn:hover { background:#ede9fe; }
.dash .book-read-btn.done  { background:#dcfce7; border-color:#86efac; color:#16a34a; }

/* ── STEM Lab ─── */
.dash .stem-grid  { display:flex; flex-direction:column; gap:10px; }
.dash .stem-card  { display:flex; gap:12px; align-items:flex-start; background:#fff; border:2px solid #f5f5f5;
  border-radius:16px; padding:14px 16px; transition:border-color .15s; }
.dash .stem-card:hover  { border-color:#a7f3d0; }
.dash .stem-card.done   { opacity:.55; }
.dash .stem-ico   { font-size:2.2rem; flex-shrink:0; width:38px; text-align:center; }
.dash .stem-info  { flex:1; min-width:0; }
.dash .stem-title { font-size:.92rem; font-weight:800; color:#1a1a1a; margin-bottom:4px; }
.dash .stem-meta  { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:4px; }
.dash .stem-time  { font-size:.72rem; font-weight:700; background:#f5f5f5; color:#78716c; padding:2px 8px; border-radius:6px; }
.dash .stem-diff  { font-size:.68rem; font-weight:800; padding:2px 8px; border-radius:6px; }
.dash .stem-match { font-size:.85rem; }
.dash .stem-blurb { font-size:.8rem; color:#78716c; line-height:1.45; }
.dash .stem-done-btn { flex-shrink:0; align-self:center; border:2px solid #a7f3d0; border-radius:10px;
  background:#f0fdf4; color:#16a34a; font-size:.75rem; font-weight:800; padding:5px 10px; cursor:pointer; white-space:nowrap; transition:all .12s; }
.dash .stem-done-btn:hover { background:#dcfce7; }
.dash .stem-done-btn.done  { background:#dcfce7; border-color:#4ade80; }
.pyl-output.pyl-output-error { color:#f38ba8; }
.dash .pyl-lesson-content { display:flex; flex-direction:column; gap:18px; max-width:680px; }
.dash .pyl-lesson-top { display:flex; align-items:center; gap:14px; }
.dash .pyl-lesson-badge { font-size:2.2rem; }
.dash .pyl-lesson-title { font-family:'Fredoka One',cursive; font-size:1.4rem; color:#1a1a1a; }
.dash .pyl-topic-chip { display:inline-block; background:#f3e8ff; border:1.5px solid #ddd6fe; color:#6d28d9;
  border-radius:7px; padding:2px 10px; font-size:.75rem; margin-top:3px; }
.dash .pyl-topic-chip code { font-family:'Courier New',monospace; font-weight:700; }
.dash .pyl-done-badge { margin-left:auto; background:#d1fae5; color:#065f46; border:1.5px solid #6ee7b7;
  border-radius:9px; padding:5px 12px; font-size:.78rem; font-weight:800; white-space:nowrap; }
.dash .pyl-intro { font-size:.9rem; font-weight:600; color:#1a1a1a; line-height:1.65; background:#fffbeb;
  border-left:4px solid #fbbf24; border-radius:0 10px 10px 0; padding:12px 16px; }
.dash .pyl-intro code { background:#fde68a; padding:1px 5px; border-radius:4px; font-family:'Courier New',monospace; font-weight:700; }
.dash .pyl-intro em { color:#7c3aed; font-style:normal; font-weight:800; }

.dash .pyl-code-section { background:#1e1b4b; border-radius:14px; overflow:hidden; }
.dash .pyl-code-label { font-size:.72rem; font-weight:800; color:#a5b4fc; padding:10px 16px 0; }
.dash .pyl-code { margin:0; padding:12px 16px 10px; overflow-x:auto; }
.dash .pyl-code code { font-family:'Courier New',monospace; font-size:.88rem; color:#e0e7ff; line-height:1.6; white-space:pre; }
/* Language-specific code block accent */
.dash .pyl-code-js  code { color:#fde68a; }
.dash .pyl-code-html code { color:#fdba74; }
.dash .pyl-try-btn { display:inline-block; margin:0 16px 14px; padding:7px 16px; border-radius:9px;
  background:#7c3aed; color:#fff; font-size:.78rem; font-weight:800; cursor:pointer;
  transition:background .15s; font-family:'Nunito',sans-serif; border:none; }
.dash .pyl-try-btn:hover { background:#6d28d9; }
.dash .pyl-try-btn.loaded { background:#16a34a; }

.dash .pyl-quiz-section { background:#fff; border:2px solid #e7e5e4; border-radius:14px; padding:16px; }
.dash .pyl-quiz-label { font-size:.72rem; font-weight:800; color:#78716c; text-transform:uppercase;
  letter-spacing:.04em; margin-bottom:8px; }
.dash .pyl-quiz-counter { font-size:.72rem; font-weight:700; color:#7c3aed; background:#ede9fe; padding:2px 8px; border-radius:10px; margin-left:4px; text-transform:none; letter-spacing:0; }
.dash .pyl-quiz-q { font-size:.92rem; font-weight:800; color:#1a1a1a; margin-bottom:12px; line-height:1.45; }
.dash .pyl-quiz-q code { background:#f3e8ff; padding:1px 5px; border-radius:4px; font-family:'Courier New',monospace; }
.dash .pyl-quiz-opts { display:flex; flex-direction:column; gap:7px; }
.pyl-opt-btn { display:flex; align-items:center; gap:10px; padding:10px 14px; border-radius:10px;
  border:2px solid #e7e5e4; background:#fafaf9; cursor:pointer; text-align:left;
  font-size:.84rem; font-weight:700; color:#1a1a1a; transition:all .15s; font-family:'Nunito',sans-serif; }
.pyl-opt-btn:hover:not(:disabled) { border-color:#c4b5fd; background:#f5f3ff; }
.pyl-opt-btn:disabled { cursor:default; }
.pyl-opt-btn.correct { background:#d1fae5; border-color:#6ee7b7; color:#065f46; }
.pyl-opt-btn.wrong   { background:#fee2e2; border-color:#fca5a5; color:#991b1b; }
.pyl-opt-letter { width:24px; height:24px; border-radius:7px; background:#e7e5e4; color:#44403c;
  font-size:.72rem; font-weight:900; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.pyl-opt-btn.correct .pyl-opt-letter { background:#6ee7b7; color:#065f46; }
.pyl-opt-btn.wrong   .pyl-opt-letter { background:#fca5a5; color:#991b1b; }
.dash .pyl-quiz-feedback { margin-top:10px; padding:10px 14px; border-radius:10px; font-size:.84rem; font-weight:700; line-height:1.4; }
.dash .pyl-quiz-feedback.correct { background:#d1fae5; color:#065f46; border:1.5px solid #6ee7b7; }
.dash .pyl-quiz-feedback.wrong   { background:#fff7ed; color:#92400e; border:1.5px solid #fde68a; }
.dash .pyl-next-btn { padding:11px 22px; border-radius:12px; background:#7c3aed; color:#fff;
  border:none; font-size:.9rem; font-weight:800; cursor:pointer; transition:all .15s;
  font-family:'Nunito',sans-serif; align-self:flex-start; }
.dash .pyl-next-btn:hover { background:#6d28d9; transform:translateY(-1px); }

.dash .content-area:has(#panel-pylearn.active) { padding:0; overflow:hidden; }
.parent-overlay { position:fixed; inset:0; background:rgba(0,0,0,.3); z-index:9998; opacity:0; pointer-events:none; transition:opacity .25s; }
.parent-overlay.open { opacity:1; pointer-events:all; }
.parent-panel  { position:fixed; top:0; right:0; height:100%; width:420px; background:#fff; z-index:9999; transform:translateX(100%); transition:transform .3s ease; box-shadow:-8px 0 48px rgba(0,0,0,.14); display:flex; flex-direction:column; overflow:hidden; }
.parent-panel.open { transform:translateX(0); }
.pp-header { padding:20px 24px 16px; border-bottom:3px solid #f5f5f5; display:flex; align-items:center; gap:12px; flex-shrink:0; }
.pp-title  { flex:1; font-size:1.1rem; font-family:'Fredoka One',cursive; color:#1a1a1a; }
.pp-close  { padding:6px 12px; border-radius:10px; font-size:.8rem; font-weight:800; color:#a8a29e; border:2px solid #e7e5e4; transition:all .15s; }
.pp-close:hover { background:#fafaf9; }
.pp-body   { flex:1; overflow-y:auto; padding:20px 24px; display:flex; flex-direction:column; gap:14px; }
.pp-pin-section { background:#fafaf9; border-radius:18px; padding:22px; text-align:center; border:2px solid #f5f5f5; }
.pp-pin-ico     { font-size:2.8rem; display:block; margin-bottom:10px; }
.pp-pin-title   { font-size:1rem; font-family:'Fredoka One',cursive; color:#1a1a1a; margin-bottom:4px; }
.pp-pin-sub     { font-size:.78rem; color:#a8a29e; font-weight:600; margin-bottom:16px; }
.pp-pin-input   { width:100%; text-align:center; font-size:2rem; letter-spacing:.5em; padding:10px; border:3px solid #e7e5e4; border-radius:14px; outline:none; background:#fff; transition:border-color .15s; font-family:'Nunito',sans-serif; }
.pp-pin-input.error { border-color:#ef4444; animation:dash-shake .3s ease; }
.pp-pin-err    { font-size:.78rem; color:#ef4444; font-weight:700; margin-top:6px; min-height:1.1em; text-align:center; }
.pp-unlock-btn { width:100%; margin-top:12px; padding:11px; border-radius:13px; font-size:.9rem; font-weight:800; cursor:pointer; border:2.5px solid; transition:all .15s; font-family:'Nunito',sans-serif; }
.dash.space .pp-unlock-btn { background:#ede9fe; color:#6d28d9; border-color:#c4b5fd; }
.dash.space .pp-unlock-btn:hover { background:#ddd6fe; }
.dash.ocean .pp-unlock-btn { background:#ccfbf1; color:#0f766e; border-color:#5eead4; }
.dash.ocean .pp-unlock-btn:hover { background:#99f6e4; }
.pp-section-lbl { font-size:.72rem; font-weight:900; text-transform:uppercase; letter-spacing:.08em; color:#a8a29e; }
.pp-empty   { text-align:center; padding:24px; font-size:.88rem; color:#a8a29e; font-weight:700; background:#fafaf9; border-radius:16px; border:2px dashed #e7e5e4; }
.pp-quest-row { background:#fff; border-radius:16px; padding:14px 16px; border:3px solid #fde68a; display:flex; align-items:center; gap:10px; }
.pp-q-ico  { font-size:1.7rem; flex-shrink:0; }
.pp-q-info { flex:1; min-width:0; }
.pp-q-name { font-size:.88rem; font-weight:800; color:#1a1a1a; margin-bottom:2px; }
.pp-q-meta { font-size:.72rem; color:#a8a29e; font-weight:700; }
.pp-q-xp   { font-size:.78rem; font-weight:900; background:#fef9c3; color:#92400e; padding:3px 9px; border-radius:8px; border:1.5px solid #fde68a; flex-shrink:0; }
.pp-q-btns { display:flex; gap:5px; flex-shrink:0; }
.pp-q-btn  { padding:7px 12px; border-radius:10px; font-size:.78rem; font-weight:800; cursor:pointer; transition:all .15s; border:2px solid; font-family:'Nunito',sans-serif; }
.pp-q-btn.approve { background:#d1fae5; color:#065f46; border-color:#6ee7b7; }
.pp-q-btn.approve:hover { background:#a7f3d0; }
.pp-q-btn.reject  { background:#fee2e2; color:#991b1b; border-color:#fca5a5; }
.pp-q-btn.reject:hover  { background:#fecaca; }
.pp-lock-btn { margin:0 24px 20px; padding:11px; border-radius:13px; font-size:.85rem; font-weight:800; cursor:pointer; border:2.5px solid #e7e5e4; color:#78716c; background:#fafaf9; transition:all .15s; text-align:center; flex-shrink:0; font-family:'Nunito',sans-serif; }
.pp-lock-btn:hover { background:#f5f5f5; }

/* ================================================================
   LANDING � bottom row (Add Kid + Parent Center)
   ================================================================ */
.landing-bottom-row { display:flex; flex-wrap:wrap; gap:8px; width:100%; justify-content:center; padding:0 4px; margin-top:2px; }
.add-kid-btn {
  flex:1; min-width:130px; max-width:160px; padding:.6rem .8rem;
  border:2px dashed #c4b5fd; border-radius:14px;
  background:#faf5ff; color:#7c3aed;
  font-size:.82rem; font-weight:800; font-family:'Nunito',sans-serif;
  cursor:pointer; transition:all .15s; text-align:center;
}
.add-kid-btn:hover { background:#ede9fe; border-style:solid; }
.add-kid-btn.add-kid-parent {
  border-color:#a5b4fc; background:#eef2ff; color:#3730a3;
}
.add-kid-btn.add-kid-parent:hover { background:#e0e7ff; border-style:solid; }
.welcome-back-btn {
  background: none;
  border: 2px solid #e9d5ff;
  border-radius: 14px;
  color: #7c3aed;
  font-size: .82rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  padding: .55rem 1rem;
  cursor: pointer;
  transition: all .15s;
}
.welcome-back-btn:hover { background: #faf5ff; }
.parent-entry-btn {
  flex:1; min-width:130px; max-width:160px; padding:.6rem .8rem;
  border:2px solid #e9d5ff; border-radius:14px;
  background:#fff; color:#6b21a8;
  font-size:.82rem; font-weight:800; font-family:'Nunito',sans-serif;
  cursor:pointer; transition:all .15s;
}
.parent-entry-btn:hover { background:#f5f3ff; }

/* ================================================================
   SIGNUP WIZARD
   ================================================================ */
#screen-signup { background:linear-gradient(145deg,#f0e7ff 0%,#e0f2fe 100%); }

.su-field-group { width:100%; margin-bottom:1.1rem; }
.su-label { display:block; font-size:.82rem; font-weight:800; color:#6b21a8; margin-bottom:.4rem; }
.su-input {
  width:100%; box-sizing:border-box;
  padding:.7rem 1rem; border:2px solid #e9d5ff; border-radius:14px;
  font-size:1rem; font-weight:700; font-family:'Nunito',sans-serif;
  background:#fff; color:#1a1a1a; outline:none; transition:border-color .15s;
}
.su-input:focus { border-color:#7c3aed; }

.su-grade-pills { display:flex; gap:8px; flex-wrap:wrap; }
.su-grade-pill {
  flex:1; min-width:70px; padding:.5rem; border:2px solid #e9d5ff;
  border-radius:12px; background:#fff; color:#7c3aed;
  font-size:.85rem; font-weight:800; font-family:'Nunito',sans-serif; cursor:pointer; transition:all .15s;
}
.su-grade-pill:hover { background:#f5f3ff; }
.su-grade-pill.sel   { background:#ede9fe; border-color:#7c3aed; }

.su-avatar-grid {
  display:grid; grid-template-columns:repeat(5,1fr); gap:8px;
  width:100%; margin-bottom:1.2rem;
}
.su-avatar-opt {
  font-size:1.8rem; padding:.4rem .2rem; border:3px solid transparent;
  border-radius:14px; background:#f5f3ff; cursor:pointer; transition:all .15s;
  text-align:center; line-height:1;
}
.su-avatar-opt:hover { background:#ede9fe; }
.su-avatar-opt.sel   { border-color:#7c3aed; background:#ede9fe; transform:scale(1.12); }

.su-section-label { font-size:.9rem; font-weight:800; color:#6b21a8; margin:0 0 .6rem; width:100%; text-align:left; }

.su-theme-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; width:100%; margin-bottom:1.2rem; }
.su-theme-opt {
  display:flex; flex-direction:column; align-items:center; gap:4px;
  padding:.7rem .5rem; border:3px solid transparent; border-radius:16px;
  background:var(--th-bg); cursor:pointer; transition:all .15s;
}
.su-theme-opt:hover  { opacity:.85; }
.su-theme-opt.sel    { border-color:var(--th-acc); box-shadow:0 0 0 2px var(--th-acc); }
.su-th-ico  { font-size:1.8rem; }
.su-th-lbl  { font-size:.72rem; font-weight:800; color:#fff; }

.su-pin-preview {
  font-size:2.2rem; letter-spacing:.5rem; color:#7c3aed;
  padding:.4rem; margin-bottom:.8rem; text-align:center;
}
.su-pin-grid { margin:0 auto .5rem; }
.su-pin-hint { font-size:.82rem; font-weight:700; min-height:1.2rem; }

.su-profile-preview {
  width:100%; border:2px solid var(--th-acc,#7c3aed); border-radius:16px;
  background:#fff; padding:.8rem 1.1rem; margin:1rem 0;
}
.su-pp-row { display:flex; justify-content:space-between; font-size:.88rem; font-weight:700;
  color:#374151; padding:.3rem 0; border-bottom:1px solid #f5f5f5; }
.su-pp-row:last-child { border-bottom:none; }
.su-pp-lbl { color:#9ca3af; font-weight:700; }

.pin-back-link {
  background:none; border:none; color:#a8a29e;
  font-size:.8rem; font-weight:800; font-family:'Nunito',sans-serif;
  cursor:pointer; padding:.3rem .5rem; transition:color .12s;
}
.pin-back-link:hover { color:#7c3aed; }

/* -- Parent path choice --------------------------------------- */
.su-path-grid { display:flex; flex-direction:column; gap:10px; width:100%; }
.su-path-card {
  display:flex; flex-direction:column; align-items:flex-start; gap:4px;
  padding:1rem 1.1rem; border:2px solid #e9d5ff; border-radius:18px;
  background:#faf5ff; cursor:pointer; text-align:left;
  transition:all .15s; font-family:'Nunito',sans-serif;
}
.su-path-card:hover { background:#ede9fe; border-color:#7c3aed; transform:translateY(-1px); }
.su-path-ico { font-size:1.8rem; margin-bottom:2px; }
.su-path-card strong { font-size:.95rem; font-weight:900; color:#1a1a1a; }
.su-path-card span   { font-size:.8rem; font-weight:700; color:#78716c; }

/* -- Invite code display --------------------------------------- */
.su-invite-code-box {
  display:flex; flex-direction:column; align-items:center; gap:4px;
  background:linear-gradient(135deg,#6d28d9,#4f46e5);
  border-radius:20px; padding:1.2rem 2rem; cursor:pointer;
  width:100%; margin:.5rem 0; transition:opacity .12s;
}
.su-invite-code-box:hover { opacity:.9; }
.su-invite-code {
  font-family:'Fredoka One',cursive; font-size:2.8rem;
  color:#fff; letter-spacing:.2rem;
}
.su-invite-copy-hint { font-size:.75rem; font-weight:700; color:#c4b5fd; }
.su-invite-instructions {
  background:#f5f3ff; border:2px solid #e9d5ff; border-radius:14px;
  padding:.8rem 1rem; width:100%; text-align:left;
}
.su-invite-instructions p  { font-size:.85rem; font-weight:700; color:#1a1a1a; margin:0 0 .4rem; }
.su-invite-instructions ol { margin:0; padding-left:1.2rem; }
.su-invite-instructions li { font-size:.82rem; font-weight:700; color:#374151; line-height:1.8; }

/* -- Code input (claim flow) ----------------------------------- */
.su-code-input {
  text-align:center; font-size:1.6rem; font-family:'Fredoka One',cursive;
  letter-spacing:.3rem; padding:.8rem;
}

/* -- Parent account signup link on PIN screen -- */
.pa-signup-link {
  display: block;
  background: none;
  border: none;
  color: #7c3aed;
  font-size: .82rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  padding: .5rem .6rem;
  margin-top: .3rem;
  transition: color .12s;
  width: 100%;
  text-align: center;
}
.pa-signup-link:hover { color: #5b21b6; }

/* -- Parent dashboard: no-kids onboarding state -- */
.pa-no-kids {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 2rem 1rem;
  text-align: center;
}
.pa-no-kids-hero { font-size: 4rem; line-height: 1; }
.pa-no-kids-title { font-size: 1.3rem; font-weight: 900; color: #1a1a1a; margin: 0; }
.pa-no-kids-sub   { font-size: .9rem; font-weight: 700; color: #78716c; margin: 0 0 .5rem; }
.pa-no-kids-paths { max-width: 420px; width: 100%; }

/* ── Parent inline add-kid panel (inside overview) ── */
#parent-add-inline {
  display: flex;
  justify-content: center;
  padding: 1.5rem;
}
.parent-add-card {
  background: #fff;
  border-radius: 28px;
  padding: 2rem 2rem 1.75rem;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 12px 50px rgba(0,0,0,.12);
}
