:root {
  --navy: #07182e;
  --navy2: #0d2d50;
  --blue: #2668e8;
  --gold: #e8b83d;
  --cream: #f6f2e9;
  --paper: #fff;
  --ink: #142238;
  --muted: #66758a;
  --line: #dde5ee;
  --green: #1f9a63;
  --greenBg: #e8f7ef;
  --yellowBg: #fff3cf;
  --red: #b33e48;
  --redBg: #fdebed;
  --purple: #7753c8;
  --shadow: 0 18px 55px rgba(7, 24, 46, 0.12);
  --soft: 0 8px 24px rgba(7, 24, 46, 0.08);
  --r: 24px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 22px 60px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  background: rgba(246, 242, 233, 0.94);
  border-bottom: 1px solid rgba(11, 31, 58, 0.08);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
}
.logo {
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), #ffdf78);
  display: grid; place-items: center;
  color: var(--navy); font-weight: 900; font-size: 19px;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar small { color: var(--muted); }
.spacer { flex: 1; }

.btn {
  border: 0; border-radius: 14px; padding: 11px 16px;
  font-weight: 800; background: #e7edf4; color: var(--ink);
}
.btn:hover { filter: brightness(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.gold { background: var(--gold); color: #11223a; }
.btn.green { background: var(--green); color: #fff; }
.btn.red { background: var(--red); color: #fff; }
.btn.ghost { background: #fff; border: 1px solid var(--line); }
.btn.small { padding: 7px 11px; border-radius: 10px; font-size: 13px; }
.btn.huge { padding: 20px 30px; font-size: 21px; border-radius: 20px; }

.card {
  background: var(--paper);
  border: 1px solid rgba(7, 24, 46, 0.07);
  border-radius: var(--r);
  box-shadow: var(--soft);
  padding: 20px;
}
.kicker {
  text-transform: uppercase; letter-spacing: 0.13em;
  font-size: 11px; font-weight: 900; color: #718097;
}
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 5px 10px;
  background: #edf2f7; color: #43536a; font-size: 12px; font-weight: 800;
}
.tag.ai { background: #e7efff; color: #2356a5; }
.tag.parent { background: #f0ebff; color: #6040ac; }
.tag.green { background: var(--greenBg); color: #167047; }
.tag.gold { background: #fff0c8; color: #7b5600; }
.tag.red { background: var(--redBg); color: #97353d; }

.hero {
  background: linear-gradient(135deg, #0a2442, #154a78 72%, #1d5f90);
  color: #fff; border-radius: 30px; padding: 26px 28px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero h2 { font-size: 30px; line-height: 1.1; margin: 6px 0 8px; }
.hero p { color: #d8e8f5; margin: 0; }
.hero .stats { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.hero .stat {
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.13);
  padding: 12px 16px; border-radius: 16px;
}
.hero .stat b { display: block; font-size: 21px; }
.hero .stat small { color: #cbddeb; }

.grid { display: grid; gap: 14px; margin-top: 18px; }
.grid.two { grid-template-columns: 1.35fr 0.65fr; align-items: start; }

.mission {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 14px; align-items: center;
  border: 1px solid var(--line); border-radius: 18px;
  padding: 14px; background: #fff; margin-bottom: 10px;
}
.mission.done { background: #f2fbf6; border-color: #cbebd9; }
.mission .ico {
  width: 52px; height: 52px; border-radius: 16px;
  background: #edf3fb; display: grid; place-items: center; font-size: 25px;
}
.mission h4 { margin: 0 0 4px; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.mission p { margin: 0; color: var(--muted); font-size: 13px; }
.mission .actions { display: flex; gap: 8px; align-items: center; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 800; color: #4a5a70; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; background: #fff;
}
.row { display: flex; gap: 9px; flex-wrap: wrap; }
.choice {
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 13px;
  background: #fff; font-weight: 800; font-size: 13px;
}
.choice.sel { background: #e9f1ff; border-color: #abc7f7; color: #2055aa; }

.notice {
  border-radius: 16px; padding: 14px 16px; font-size: 14px;
  background: #eef3f9; border: 1px solid var(--line);
}
.notice.green { background: var(--greenBg); border-color: #b9e2cd; }
.notice.gold { background: var(--yellowBg); border-color: #edd891; }
.notice.red { background: var(--redBg); border-color: #edbec3; }

.muted { color: var(--muted); font-size: 13px; }
ol.steps, ul.steps { margin: 8px 0 0; padding-left: 22px; }
ol.steps li, ul.steps li { margin-bottom: 7px; line-height: 1.45; }

/* ---------- Kid-facing lesson stage ---------- */

.stage {
  position: fixed; inset: 0; z-index: 60;
  background: radial-gradient(circle at 50% 0%, #123a63, #07182e 70%);
  color: #fff; display: none; flex-direction: column;
}
.stage.open { display: flex; }

.stage-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 24px; border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.stage-head h3 { margin: 0; font-size: 17px; }
.stage-head small { color: #a9c3da; }

.stage-body {
  flex: 1; display: grid; grid-template-columns: 1fr 340px;
  min-height: 0;
}
.stage.solo .stage-body { grid-template-columns: 1fr; }
.stage.solo .parent-rail { display: none; }

.display {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px 40px; text-align: center; min-height: 0; overflow: auto;
}
.display .label { color: #9fc0dc; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; font-size: 12px; }
.display .big {
  font-size: clamp(42px, 9vw, 120px); font-weight: 900; line-height: 1.05;
  letter-spacing: 0.02em; margin: 18px 0 0;
}
.display .sentence { font-size: clamp(28px, 4.4vw, 54px); font-weight: 800; line-height: 1.35; max-width: 20ch; }
.display .passage {
  font-size: clamp(22px, 2.6vw, 34px); font-weight: 650; line-height: 1.7;
  max-width: 30ch; text-align: left;
}
.display .words { display: flex; flex-wrap: wrap; gap: 14px 26px; justify-content: center; }
.display .words span {
  font-size: clamp(30px, 5vw, 64px); font-weight: 900;
  background: rgba(255, 255, 255, 0.08); border-radius: 18px; padding: 8px 22px;
}
.display .note { margin-top: 20px; color: var(--gold); font-weight: 800; font-size: 18px; }
.display .idle { color: #8fb0cc; font-size: 20px; font-weight: 700; }

.mic-strip {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 18px 24px 26px;
}
.orb {
  width: 84px; height: 84px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: grid; place-items: center; font-size: 34px;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.orb.listening { border-color: #6fe0a8; box-shadow: 0 0 0 10px rgba(111, 224, 168, 0.12); }
.orb.talking { border-color: var(--gold); box-shadow: 0 0 0 14px rgba(232, 184, 61, 0.14); }
.state-text { font-size: 18px; font-weight: 800; color: #cfe3f4; min-width: 12ch; }

.parent-rail {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  display: flex; flex-direction: column; min-height: 0;
  background: rgba(3, 12, 24, 0.35);
}
.parent-rail header { padding: 14px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.parent-rail .log { flex: 1; overflow: auto; padding: 14px 18px; display: grid; gap: 10px; align-content: start; }
.segments { display: grid; gap: 3px; margin-top: 8px; }
.seg { font-size: 12.5px; color: #cfe0ef; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); }
.seg small { color: #8fb0cc; margin-left: 4px; }
.seg.done { color: #7fe3b0; }
.seg.skipped { color: #f2c46d; text-decoration: line-through; }
.line { font-size: 13.5px; line-height: 1.5; }
.line b { color: var(--gold); }
.line.student b { color: #7fe3b0; }
.line.student { color: #dff0ff; }
.line.tutor { color: #cfe0ef; }
.obs {
  font-size: 12.5px; padding: 8px 11px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.07);
}
.obs.mastered { border-left: 3px solid #6fe0a8; }
.obs.partial { border-left: 3px solid var(--gold); }
.obs.struggled { border-left: 3px solid #ef8f9a; }
.alert {
  background: #fff3cf; color: #6b4a00; border-radius: 14px;
  padding: 12px 14px; font-weight: 800; font-size: 14px;
}

/* ---------- Camera snapshot overlay ---------- */

.camera {
  position: absolute; inset: 0; z-index: 5; display: none; place-items: center;
  background: rgba(7, 24, 46, 0.82); padding: 24px;
}
.camera.open { display: grid; }
.camera-box { text-align: center; width: min(92vw, 720px); }
.camera-prompt { font-size: clamp(26px, 4vw, 44px); font-weight: 900; color: var(--gold); margin-bottom: 16px; }
.camera-frame {
  position: relative; border-radius: 24px; overflow: hidden; background: #000;
  border: 4px solid rgba(255, 255, 255, 0.25); aspect-ratio: 16 / 9;
}
.camera-frame video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.camera-count {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: clamp(80px, 18vw, 180px); font-weight: 900; color: #fff;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6); pointer-events: none;
}
.line.system { color: #9fc0dc; font-style: italic; display: flex; align-items: center; gap: 8px; }
.line .snap { width: 64px; height: 40px; object-fit: cover; border-radius: 6px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 13.5px; color: var(--ink); }
.check input { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; }

.report-list { margin: 6px 0 0; padding-left: 20px; }
.report-list li { margin-bottom: 5px; }

/* ---------- Child switcher ---------- */

.kids { display: flex; gap: 4px; margin-left: 10px; background: #e7edf4; border-radius: 999px; padding: 3px; }
.kid { border: 0; border-radius: 999px; padding: 6px 12px; background: transparent; font-weight: 800; font-size: 13px; color: #43536a; }
.kid.on { background: var(--navy); color: #fff; }

.settingsbtn {
  background: var(--navy); color: #fff; border-radius: 14px; padding: 10px 14px;
  font-size: 15px; display: inline-flex; align-items: center; gap: 6px; margin-left: 6px;
  box-shadow: 0 6px 18px rgba(7, 24, 46, 0.18);
}
.settingsbtn.active { outline: 3px solid var(--gold); }
.settingsbtn span { font-size: 13.5px; font-weight: 800; }
@media (max-width: 900px) { .settingsbtn span { display: none; } }

.trialtag { margin-left: 10px; }
.tag.red { background: var(--redBg); color: #97353d; }

/* ---------- Top nav ---------- */

.nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.nav .btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.on { background: var(--navy); color: #fff; }
.grid.two.equal { grid-template-columns: 1fr 1fr; }

/* ---------- Day navigation ---------- */

.daynav {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.daynav-label { display: grid; min-width: 220px; }
.daynav-label b { font-size: 17px; }
.daynav-label small { color: var(--muted); font-size: 12px; }
.daynav select { max-width: 320px; }

/* ---------- Today ---------- */

.next-card {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  background: linear-gradient(135deg, #eef4ff, #f6f9ff); border: 1px solid #d5e2f7;
  border-radius: 18px; padding: 14px;
}
.next-card .bigico { font-size: 40px; text-align: center; }
.next-card h3 { margin: 0 0 3px; font-size: 18px; }
.next-card p { margin: 0; color: var(--muted); font-size: 13px; }

.progressbar { height: 8px; border-radius: 999px; background: #e7edf4; overflow: hidden; }
.progressbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #6fe0a8); transition: width 0.3s ease; }

.mission.done .ico { background: #dff3e7; }
.checkbtn {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line);
  background: #fff; font-weight: 900; font-size: 17px; color: var(--muted);
}
.checkbtn.on { background: var(--green); border-color: var(--green); color: #fff; }
.feedback { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.prep {
  display: inline-block; padding: 6px 10px; border-radius: 10px;
  background: #f1f5f9; font-size: 12.5px; font-weight: 700; color: #3b4a60;
}

.energy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.energy-option {
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 8px;
  background: #fff; text-align: left; display: grid; gap: 2px;
}
.energy-option b { font-size: 13px; }
.energy-option small { color: var(--muted); font-size: 11.5px; }
.energy-option.sel.green { background: var(--greenBg); border-color: #9fd8ba; }
.energy-option.sel.yellow { background: var(--yellowBg); border-color: #e7cf7a; }
.energy-option.sel.red { background: var(--redBg); border-color: #e7a9b0; }

.quickrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.quick { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fafbfd; }
.quick h4 { margin: 0 0 4px; font-size: 14px; }
.quick p { margin: 0 0 10px; color: var(--muted); font-size: 12px; }

/* ---------- Timeline ---------- */

.timeline { margin-top: 12px; display: grid; }
.tlrow { display: grid; grid-template-columns: 74px 22px 1fr; gap: 8px; align-items: start; min-height: 52px; }
.tltime { font-size: 12px; font-weight: 800; color: var(--muted); padding-top: 3px; }
.tlrail { position: relative; display: flex; justify-content: center; height: 100%; }
.tlrail .dot { width: 12px; height: 12px; border-radius: 50%; background: #c6d3e2; margin-top: 4px; z-index: 1; }
.tlrail .line { position: absolute; top: 16px; bottom: -4px; width: 2px; background: #e3eaf2; }
.tlbody b { display: block; font-size: 14px; }
.tlbody small { color: var(--muted); font-size: 12px; display: block; line-height: 1.35; }
.tlrow.now .dot { background: var(--blue); box-shadow: 0 0 0 5px rgba(38, 104, 232, 0.16); }
.tlrow.now .tlbody b { color: var(--blue); }

.tlrow.lesson { cursor: pointer; }
.tlrow.lesson:hover .tlbody b { color: var(--blue); }
.tlrow.nap .dot { background: #7753c8; }
.tlrow.anchor .dot { background: var(--gold); }
.tlrow.team .dot, .tlrow.soccer .dot { background: var(--green); }
.tlrow.meal .tlbody b, .tlrow.free .tlbody b { color: var(--muted); font-weight: 700; }
.tlmin { font-size: 11px; font-weight: 800; color: var(--muted); margin-left: 6px; }
.tlpin { font-size: 11px; margin-left: 4px; }
.wakerow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.wakerow input[type="time"] { padding: 7px 10px; font-size: 13px; }
.choice.small { padding: 6px 10px; font-size: 13px; }
.plannote {
  margin-top: 10px; padding: 8px 11px; border-radius: 10px; font-size: 12.5px;
  background: var(--yellowBg); color: #6b4a00; border: 1px solid #edd891;
}
.anchorrow { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #edf0f4; font-size: 13px; }
.anchorrow:last-child { border-bottom: 0; }
.soccergrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0 8px; }

/* ---------- This week ---------- */

.weekgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.daycard {
  border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: #fff; cursor: pointer;
}
.daycard:hover { border-color: #abc7f7; }
.daycard.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(38, 104, 232, 0.12); }
.daycard h3 { margin: 2px 0 12px; font-size: 16px; }
.mini-task { padding: 8px 9px; border-radius: 11px; background: #f4f7fa; margin-bottom: 7px; font-size: 12px; }
.mini-task.done { background: #eaf7ef; text-decoration: line-through; color: #4c6c5a; }
.mini-task.soccer { background: #fff6dc; }

/* ---------- Weekly prep ---------- */

.materialrow {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #edf0f4;
}
.materialrow:last-child { border-bottom: 0; }
.shopping { display: grid; gap: 7px; }
.shopitem { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); padding: 10px 12px; border-radius: 13px; }
.shopitem.done { text-decoration: line-through; opacity: 0.55; }
.shopitem input { width: 18px; height: 18px; }
.empty { padding: 26px; border: 1px dashed #bac7d4; border-radius: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.resrow { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }

.prep-lesson { padding: 10px 0; border-bottom: 1px solid #edf0f4; font-size: 13.5px; }
.prep-lesson:last-child { border-bottom: 0; }
.prep-lesson .prep { font-size: 12px; }
.prepdays { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.prepday { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: #fff; }
.prepday h4 { font-size: 16px; }

/* ---------- Soccer ---------- */

.soccer-hero { background: linear-gradient(135deg, #0b3d2e, #14795a 72%, #1f9a63); }
.socblock {
  display: grid; grid-template-columns: 58px 1fr; gap: 12px; align-items: start;
  padding: 12px 0; border-bottom: 1px solid #edf0f4;
}
.socblock:last-of-type { border-bottom: 0; }
.socmin {
  width: 58px; height: 58px; border-radius: 16px; background: #e8f7ef; color: #167047;
  display: grid; place-items: center; font-weight: 900; font-size: 20px; line-height: 1;
}
.socmin small { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; }
.socblock p { margin: 4px 0 6px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.socblock .cue { font-size: 13px; font-weight: 800; color: #2356a5; background: #e7efff; display: inline-block; padding: 4px 9px; border-radius: 8px; }
.phases { display: grid; gap: 8px; }
.phase { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.phase.current { border-color: #9fd8ba; background: #f6fcf8; }
.phase summary { cursor: pointer; display: flex; gap: 10px; align-items: center; font-size: 14px; list-style: none; }
.phase summary::-webkit-details-marker { display: none; }
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.principle { border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.principle h4 { margin: 0 0 6px; font-size: 14px; }
.principle p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.logrow { padding: 8px 0; border-bottom: 1px solid #edf0f4; font-size: 13px; }
.logrow:last-child { border-bottom: 0; }
input.inline { border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; background: #fff; min-width: 0; }

/* ---------- Progress ---------- */

.badgegrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.badge {
  background: #fff; border: 1px solid rgba(7, 24, 46, 0.07); border-radius: 20px;
  padding: 18px; text-align: center; position: relative; box-shadow: var(--soft);
}
.badge.locked { filter: grayscale(1); opacity: 0.48; }
.badge .bico { font-size: 42px; }
.badge h4 { margin: 7px 0 3px; }
.badge p { margin: 0; color: var(--muted); font-size: 12px; }
.badge .unlock {
  position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 900;
  color: #147047; background: var(--greenBg); padding: 4px 7px; border-radius: 999px;
}
.coachgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.coach { background: #fff; border: 1px solid rgba(7, 24, 46, 0.07); border-radius: 20px; padding: 16px; box-shadow: var(--soft); }
.coach h4 { margin: 6px 0; }
.coach p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.coach.up { border-left: 4px solid var(--blue); }
.coach.down { border-left: 4px solid var(--gold); }
.coach.right { border-left: 4px solid var(--green); }

/* ---------- Portfolio ---------- */

.portfolio-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.portfolio-item { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; }
.portfolio-item img { width: 100%; aspect-ratio: 1.25 / 1; object-fit: cover; display: block; background: #eef2f5; }
.portfolio-item .cap { padding: 12px; }
.portfolio-item h4 { margin: 6px 0 2px; font-size: 15px; }

/* ---------- Resources ---------- */

.resourcegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.resource { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: #fff; }
.resource h4 { margin: 6px 0 4px; }
.resource p { color: var(--muted); font-size: 12.5px; min-height: 36px; line-height: 1.45; margin: 0 0 8px; }
.qrmini { width: 62px; height: 62px; border: 1px solid var(--line); border-radius: 9px; image-rendering: pixelated; flex-shrink: 0; }

.meter { height: 14px; border-radius: 999px; background: #e7edf4; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: #c6d3e2; transition: width 0.08s linear; }
.meter span.weak { background: var(--gold); }
.meter span.good { background: var(--green); }

.levelcard { padding: 12px 0; border-bottom: 1px solid #edf0f4; }
.levelcard:last-child { border-bottom: 0; }
.levelform { margin-top: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 14px; }

/* ---------- Settings ---------- */

.stabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.stab {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 14px;
  font-weight: 800; font-size: 13.5px; color: #43536a;
}
.stab.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.timegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

/* ---------- First-run setup ---------- */

.setup-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.setup-steps span {
  font-size: 11.5px; font-weight: 800; padding: 5px 9px; border-radius: 999px;
  background: #edf2f7; color: #6a7a90;
}
.setup-steps span.on { background: var(--navy); color: #fff; }
.setup-steps span.done { background: var(--greenBg); color: #167047; }
.setup-step h3 { margin: 0 0 10px; }
textarea { font: inherit; resize: vertical; }

/* ---------- Tutor mode ---------- */

.modegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modecard {
  text-align: left; border: 2px solid var(--line); border-radius: 16px; padding: 14px; background: #fff;
  display: grid; gap: 6px; font: inherit; cursor: pointer;
}
.modecard b { font-size: 15px; }
.modecard span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.modecard.sel { border-color: var(--blue); background: #eef4ff; }
.tutor-hero { background: linear-gradient(135deg, #2a1a5e, #4b2fa8 72%, #7753c8); }
.homework-card { border: 2px solid #f0d38a; background: #fffaf0; }
.pathrow { font-size: 13.5px; margin-top: 8px; }

/* ---------- Modal ---------- */

.modal {
  position: fixed; inset: 0; z-index: 70; display: none; place-items: center;
  background: rgba(7, 24, 46, 0.55); padding: 20px;
}
.modal.open { display: grid; }
.modalbox {
  background: #fff; border-radius: 22px; padding: 20px; width: 100%; max-width: 520px;
  box-shadow: var(--shadow); max-height: 92vh; overflow: auto;
}
.modalbox img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 16px; background: #eef2f5; margin-top: 12px; }

/* ---------- RJ mode: kid-facing mission board ---------- */

.rjmode {
  position: fixed; inset: 0; z-index: 65; display: none; overflow: auto;
  background: radial-gradient(circle at 20% 0%, #164a7a, #07182e 70%); color: #fff; padding: 28px 34px 48px;
}
.rjmode.open { display: block; }
.rjtop { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rjtop h1 { margin: 0; font-size: 34px; flex: 1; }
.rjstars { font-size: 24px; font-weight: 900; color: var(--gold); }
#rjSubtitle { color: #c8dbea; font-size: 17px; margin: 8px 0 22px; }
.missionboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rjmission {
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px; padding: 22px; text-align: center; display: grid; gap: 8px; align-content: start;
}
.rjmission.done { background: rgba(111, 224, 168, 0.16); border-color: rgba(111, 224, 168, 0.5); }
.rjmission .ico { font-size: 52px; }
.rjmission h3 { margin: 0; font-size: 22px; }
.rjmission p { margin: 0 0 8px; color: #c8dbea; font-size: 15px; line-height: 1.4; }
.rjcelebrate { margin-top: 26px; text-align: center; font-size: 24px; font-weight: 900; color: var(--gold); }

/* ---------- Big screen: larger everything for a TV ---------- */

body.bigscreen { font-size: 19px; }
body.bigscreen .wrap { max-width: 1500px; }
body.bigscreen .btn { padding: 14px 20px; font-size: 1em; }
body.bigscreen .btn.small { padding: 10px 14px; font-size: 0.85em; }
body.bigscreen .mission h4 { font-size: 20px; }
body.bigscreen .mission p, body.bigscreen .muted, body.bigscreen .notice { font-size: 16px; }
body.bigscreen .hero h2 { font-size: 40px; }
body.bigscreen .hero .stat b { font-size: 28px; }
body.bigscreen .rjmission h3 { font-size: 30px; }
body.bigscreen .rjmission p { font-size: 20px; }

@media print {
  .topbar, .daynav, .stage, .rjmode, .modal, .btn { display: none !important; }
}

@media (max-width: 1100px) {
  .prepdays, .principles { grid-template-columns: repeat(2, 1fr); }
  .badgegrid, .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
  .resourcegrid, .coachgrid, .missionboard { grid-template-columns: repeat(2, 1fr); }
  .weekgrid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .grid.two, .grid.two.equal { grid-template-columns: 1fr; }
  .stage-body { grid-template-columns: 1fr; }
  .parent-rail { display: none; }
  .quickrow, .weekgrid, .missionboard, .resourcegrid, .coachgrid, .prepdays { grid-template-columns: 1fr; }
  .next-card { grid-template-columns: 56px 1fr; }
  .next-card .tag { grid-column: 2; justify-self: start; }
}
