/* Yem's School v3: design tokens (written by the orchestrator; agents extend below the marked line). */
:root {
  /* Brand: purple, like her notebooks. Bright, clean, not babyish. */
  --brand: #6a4cff;
  --brand-ink: #4a2fd9;
  --brand-soft: #efeaff;
  --accent: #ffb020;
  --accent-soft: #fff4dc;

  /* Subjects */
  --maths: #2f6bff;      --maths-soft: #e7efff;
  --english: #e8467c;    --english-soft: #ffe8f0;
  --science: #13a26b;    --science-soft: #e1f7ee;

  /* Feedback */
  --good: #16a34a;       --good-soft: #e3f8ea;
  --bad: #e5484d;        --bad-soft: #ffeceb;
  --info: #0ea5e9;       --info-soft: #e0f4fd;

  /* Surfaces and text */
  --bg: #f6f4ff;
  --card: #ffffff;
  --ink: #1d1b2f;
  --ink-2: #4b4867;
  --ink-3: #807d99;
  --line: #e4e1f2;

  /* Shape and depth */
  --r-s: 10px; --r-m: 16px; --r-l: 24px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(29, 27, 47, .06), 0 2px 8px rgba(29, 27, 47, .06);
  --shadow-2: 0 4px 14px rgba(29, 27, 47, .10), 0 12px 32px rgba(29, 27, 47, .08);

  /* Type: system fonts only (works offline on any tablet) */
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --fs-0: 15px; --fs-1: 17px; --fs-2: 19px; --fs-3: 23px; --fs-4: 30px; --fs-5: 40px;

  --gap: 16px;
  --tap: 48px;           /* minimum touch target */
  --maxw: 860px;          /* reading column */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--fs-2)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: var(--fs-4); font-weight: 800; }
h2 { font-size: var(--fs-3); font-weight: 750; }
h3 { font-size: var(--fs-2); font-weight: 700; }
p { margin: 0 0 .7em; }
img, svg { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 22px; border: 0; border-radius: var(--r-pill);
  background: var(--brand); color: #fff; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 0 var(--brand-ink); transition: transform .08s ease, filter .15s ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.secondary { background: var(--card); color: var(--brand-ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: none; }
.btn.good { background: var(--good); box-shadow: 0 2px 0 #0f7a36; }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: var(--fs-1); }

.card { background: var(--card); border-radius: var(--r-l); box-shadow: var(--shadow-1); padding: 20px 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: var(--r-pill);
  font-size: var(--fs-0); font-weight: 700; background: var(--brand-soft); color: var(--brand-ink);
}
.chip.maths { background: var(--maths-soft); color: var(--maths); }
.chip.english { background: var(--english-soft); color: var(--english); }
.chip.science { background: var(--science-soft); color: var(--science); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 20px 16px 80px; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-2); font-weight: 600; animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* Confetti burst (ui.confetti) */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 2px;
  animation: confetti-fall 1.6s cubic-bezier(.2,.6,.4,1) forwards;
}
@keyframes confetti-fall { to { transform: translateY(105vh) rotate(540deg); opacity: .9; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== Shell styles (shell agent writes below this line) ===== */

/* ---------- Base ---------- */
:root { --subj: var(--brand); --subj-soft: var(--brand-soft); --subj-deep: var(--brand-ink); }
.subject-maths { --subj: var(--maths); --subj-soft: var(--maths-soft); --subj-deep: #1c4fd6; }
.subject-english { --subj: var(--english); --subj-soft: var(--english-soft); --subj-deep: #c52c63; }
.subject-science { --subj: var(--science); --subj-soft: var(--science-soft); --subj-deep: #0b7d52; }

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 100% -10%, #e2d9ff 0%, rgba(226, 217, 255, 0) 70%),
    radial-gradient(760px 420px at -10% 30%, #ffe3ee 0%, rgba(255, 227, 238, 0) 66%),
    var(--bg);
}
.app { min-height: 100vh; }
.screen { animation: rise .4s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.small { font-size: var(--fs-0); }
.small-note { margin-top: 28px; font-size: var(--fs-0); }
.skel {
  height: 110px; margin-bottom: 16px; border-radius: var(--r-l);
  background: linear-gradient(90deg, #fff 0%, #efeaff 50%, #fff 100%); background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.skel:nth-child(2) { height: 150px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.btn.danger { background: var(--bad); box-shadow: 0 2px 0 #b3282d; }
.btn.start { min-width: 170px; font-size: var(--fs-2); }

.topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.brand { display: flex; align-items: center; gap: 10px; font: 800 var(--fs-1)/1 var(--font-display); }
.brand-mark {
  display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 13px;
  background: linear-gradient(145deg, #8f70ff, #4a2fd9); color: #fff; font: 800 20px/1 var(--font-display);
  box-shadow: 0 3px 0 #3a22b8;
}
.brand-mark.big {
  width: 88px; height: 88px; margin: 0 auto 18px; border-radius: 28px; font-size: 46px;
  box-shadow: 0 6px 0 #3a22b8, var(--shadow-2);
}
.md ul { margin: 0 0 .6em; padding-left: 1.25em; }
.md li { margin: .15em 0; }
.md p:last-child { margin-bottom: 0; }

.message-card { max-width: 560px; margin: 28px auto; text-align: left; }
.message-card h2 { font-size: var(--fs-3); }
.message-card .btn { margin-top: 12px; }
.login .message-card, .pin-screen .message-card { text-align: center; }

/* ---------- Login ---------- */
.login { max-width: 760px; margin: 0 auto; padding: 36px 18px 56px; text-align: center; }
.login-title { margin: 0 0 28px; font-size: clamp(32px, 6vw, 46px); }
.profiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; }
.profile {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  min-height: 48px; padding: 26px 14px 22px; border: 0; border-radius: var(--r-l);
  background: var(--card); box-shadow: var(--shadow-1); cursor: pointer;
  color: var(--ink); font: 700 var(--fs-2)/1.2 var(--font);
  animation: rise .45s ease both; animation-delay: calc(var(--i, 0) * 80ms);
  transition: transform .15s ease, box-shadow .15s ease;
}
.profile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.profile:active { transform: scale(.97); }
.avatar {
  display: grid; place-items: center; width: 112px; height: 112px; border-radius: 50%;
  color: #fff; font: 800 40px/1 var(--font-display); letter-spacing: .02em;
  box-shadow: 0 10px 22px rgba(29, 27, 47, .18), inset 0 -4px 0 rgba(0, 0, 0, .12);
}
.avatar.big { width: 88px; height: 88px; margin: 0 auto; font-size: 32px; }
.tone-brand { background: linear-gradient(145deg, #8f70ff, #5336e8); }
.tone-maths { background: linear-gradient(145deg, #5b95ff, #2358e6); }
.tone-english { background: linear-gradient(145deg, #ff79a6, #dd3c74); }
.tone-science { background: linear-gradient(145deg, #3fd4a0, #0f9060); }
.tone-accent { background: linear-gradient(145deg, #ffd25c, #f5961a); color: var(--ink); }

.pin-screen { max-width: 460px; }
.back-row { display: flex; justify-content: flex-start; }
.pin-screen h2 { margin: 14px 0 4px; font-size: var(--fs-4); }
.dots { display: flex; justify-content: center; gap: 18px; margin: 26px 0 6px; }
.dot {
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: inset 0 0 0 3px #c8c1e6; transition: background .15s ease, transform .15s ease;
}
.dot.on { background: var(--brand); box-shadow: none; transform: scale(1.1); }
.dots.shake { animation: shake .42s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); } 80% { transform: translateX(6px); }
}
.pin-error { min-height: 1.6em; margin: 8px 0 12px; color: var(--bad); font-weight: 700; }
.pin-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.pin-field {
  width: 170px; min-height: var(--tap); padding: 8px 14px; border: 2px solid var(--line);
  border-radius: var(--r-pill); background: #fff; text-align: center; letter-spacing: .35em;
  font: 700 var(--fs-3)/1 var(--font);
}
.pin-field:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.pin-go { min-width: 120px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 360px; margin: 26px auto 0; }
.pad-key {
  min-height: 70px; border: 0; border-radius: var(--r-l); background: #fff; color: var(--ink);
  box-shadow: var(--shadow-1), inset 0 -4px 0 #e5e0f6; cursor: pointer;
  font: 700 30px/1 var(--font-display); -webkit-tap-highlight-color: transparent;
}
.pad-key:active { transform: translateY(2px); box-shadow: var(--shadow-1); }
.pad-del { font-size: 26px; color: var(--ink-2); }

/* ---------- Today ---------- */
.today .hello { margin: 12px 0 18px; }
.date { margin: 0 0 4px; color: var(--ink-2); font-weight: 700; }
.hello h1 { margin: 0; font-size: var(--fs-4); }
.msg {
  margin: 0 0 18px; padding: 16px 20px; border-radius: var(--r-l);
  background: var(--accent-soft); box-shadow: inset 6px 0 0 var(--accent);
}
.msg p:last-child { margin-bottom: 0; }
.break {
  display: flex; align-items: center; gap: 16px; margin: 0 0 18px; padding: 18px 20px;
  border-radius: var(--r-l); background: var(--info-soft); color: #074d6e;
}
.break-ico {
  flex: none; display: grid; place-items: center; width: 58px; height: 58px;
  border-radius: 50%; background: var(--info); color: #fff;
}
.break-text { margin: 0; font-size: var(--fs-2); }
.countdown { font-size: var(--fs-3); font-weight: 800; font-variant-numeric: tabular-nums; }
.plan-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 26px 0 12px; }
.plan-head h2 { margin: 0; }
.lessons { display: grid; gap: 16px; }

.lcard {
  position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 18px; align-items: start;
  padding: 18px 20px 18px 24px; border-radius: var(--r-l); background: var(--card);
  box-shadow: var(--shadow-1); overflow: hidden;
  animation: rise .5s ease both; animation-delay: calc(var(--i, 0) * 90ms);
}
.lcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--subj); }
.lcard-emoji {
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px;
  background: var(--subj-soft); font-size: 30px; line-height: 1;
}
.lcard-emoji.sm { width: 52px; height: 52px; border-radius: 16px; font-size: 24px; flex: none; }
.lcard-body { min-width: 0; }
.lcard-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lcard-top .pill { margin-left: auto; }
.lcard-title { margin: 10px 0 4px; font-size: var(--fs-3); line-height: 1.2; }
.lcard-sub { margin: 0 0 14px; color: var(--ink-2); font-size: var(--fs-1); }
.lcard-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.lcard-foot .btn { margin-left: auto; }
.mins { color: var(--ink-3); font-size: var(--fs-0); font-weight: 700; }
.score { color: var(--ink-2); font-weight: 800; }
.next-tag { color: var(--subj-deep); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--r-pill);
  font-size: var(--fs-0); font-weight: 700; white-space: nowrap;
}
.pill.todo { background: #efedf7; color: var(--ink-2); }
.pill.doing { background: var(--accent-soft); color: #8a4f00; }
.pill.done { background: var(--good-soft); color: #14723a; }
.lcard.is-done .lcard-title { color: var(--ink-2); }

.lcard.featured {
  grid-template-columns: 84px 1fr; padding: 24px 24px 22px 26px; color: #fff; box-shadow: var(--shadow-2);
  background: linear-gradient(135deg, var(--subj) 0%, var(--subj-deep) 100%);
}
.lcard.featured::before { display: none; }
.lcard.featured .lcard-emoji { width: 84px; height: 84px; border-radius: 26px; font-size: 40px; background: rgba(255, 255, 255, .22); }
.lcard.featured .next-tag { color: #fff; opacity: .92; }
.lcard.featured .chip, .lcard.featured .pill { background: rgba(255, 255, 255, .22); color: #fff; }
.lcard.featured .lcard-title { color: #fff; font-size: var(--fs-4); }
.lcard.featured .lcard-sub, .lcard.featured .mins, .lcard.featured .score { color: rgba(255, 255, 255, .92); }
.lcard.featured .btn { background: #fff; color: var(--subj-deep); box-shadow: 0 4px 0 rgba(0, 0, 0, .18); }
.lcard.featured .btn:disabled { opacity: .6; }

.celebrate {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 18px; margin-top: 24px; padding: 22px 24px;
  border-radius: var(--r-l); background: linear-gradient(135deg, #fff7dc, #ffe0a0); box-shadow: var(--shadow-1);
}
.celebrate-text { flex: 1 1 240px; }
.celebrate-text h2 { margin: 0 0 4px; }
.celebrate-text p { margin: 0; color: var(--ink-2); }
.check-ico {
  flex: none; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%;
  background: var(--good); color: #fff;
}

/* ---------- Day done ---------- */
.hero {
  margin: 14px 0 18px; padding: 28px 26px; border-radius: var(--r-l); color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, #9274ff 100%); box-shadow: var(--shadow-2);
}
.hero h1 { margin: 12px 0 6px; color: #fff; font-size: var(--fs-5); }
.hero p { margin: 0 0 4px; font-size: var(--fs-2); }
.hero .check-ico { width: 60px; height: 60px; background: rgba(255, 255, 255, .22); }
.sumlist { margin-bottom: 18px; }
.sumlist h2 { margin: 0 0 6px; font-size: var(--fs-3); }
.sumrow { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.sumrow + .sumrow { border-top: 1px solid var(--line); }
.sumrow-body { display: grid; flex: 1; justify-items: start; gap: 6px; min-width: 0; }
.sumrow h3 { margin: 0; font-size: var(--fs-2); }
.score-pill {
  flex: none; padding: 6px 14px; border-radius: var(--r-pill); white-space: nowrap;
  background: var(--accent-soft); color: #8a4f00; font-weight: 800;
}
.score-pill.good { background: var(--good-soft); color: #14723a; }
.feedback { margin-bottom: 18px; }
.feedback h2 { margin: 0 0 12px; font-size: var(--fs-3); }
.feedback textarea {
  display: block; width: 100%; min-height: 110px; padding: 14px 16px; resize: vertical;
  border: 2px solid var(--line); border-radius: var(--r-m); background: #fff; font-size: var(--fs-2);
}
.feedback textarea:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.feedback .btn { margin-top: 12px; }
.thanks { margin: 0; padding: 16px 18px; border-radius: var(--r-m); background: var(--good-soft); color: #14723a; font-weight: 700; }
.see-you { margin-top: 28px; text-align: center; }
.see-you h2 { margin: 0; color: var(--ink-2); }

/* ---------- Parent ---------- */
.wrap.parent { max-width: 980px; }
.p-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 12px 0 20px; }
.p-head h1 { margin: 0; font-size: var(--fs-4); }
.p-head p { margin: 0; }
.date-field {
  min-height: var(--tap); padding: 8px 14px; border: 2px solid var(--line); border-radius: var(--r-s);
  background: #fff; color: var(--ink); font-size: var(--fs-1); font-weight: 700;
}
.date-field:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.alerts { margin-bottom: 20px; padding: 18px 20px; border: 2px solid #ffc4c1; border-radius: var(--r-l); background: var(--bad-soft); }
.alerts h2 { margin: 0 0 10px; font-size: var(--fs-2); color: #b3282d; }
.alert-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.alert-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px;
  padding: 12px 14px; border-radius: var(--r-m); background: #fff;
}
.alert-row p { margin: 0; }
.alert-text { font-weight: 700; }
.summary-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { display: grid; padding: 14px 16px; border-radius: var(--r-m); background: var(--card); box-shadow: var(--shadow-1); }
.stat-n { font: 800 var(--fs-3)/1.2 var(--font-display); }
.stat-l { font-size: var(--fs-0); }
.pcards { display: grid; gap: 16px; margin-bottom: 18px; }
.pcard { padding: 18px 20px; border-radius: var(--r-l); background: var(--card); box-shadow: var(--shadow-1); border-top: 6px solid var(--subj); }
.pcard-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.pcard h3 { margin: 10px 0 12px; font-size: var(--fs-3); }
.pstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 0 0 12px; }
.pstats > div { padding: 10px 12px; border-radius: var(--r-m); background: #f7f5ff; }
.pstats dt { font-size: var(--fs-0); font-weight: 700; color: var(--ink-3); }
.pstats dd { margin: 2px 0 0; font-size: var(--fs-2); font-weight: 800; }
.mood { font-size: 26px; line-height: 1.1; }
.pcomment {
  margin: 0 0 12px; padding: 10px 14px; border-left: 4px solid var(--subj);
  border-radius: 0 var(--r-s) var(--r-s) 0; background: var(--subj-soft); font-style: italic;
}
.pq { margin-top: 6px; }
.pq summary {
  display: flex; align-items: center; min-height: var(--tap); cursor: pointer;
  color: var(--brand-ink); font-weight: 800;
}
.qwrap { overflow-x: auto; }
.qtable { width: 100%; border-collapse: collapse; font-size: var(--fs-0); }
.qtable th, .qtable td { padding: 10px 8px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.qtable th { color: var(--ink-3); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.att { margin: 0 0 4px; }
.mark { margin-right: 4px; font-weight: 900; }
.att.ok .mark { color: var(--good); }
.att.no .mark { color: var(--bad); }
.help { margin: 0 0 6px; padding: 8px 10px; border-radius: var(--r-s); background: #f7f5ff; }
.help-kind { font-weight: 800; color: var(--brand-ink); }
.help-said { margin: 2px 0; }
.help-reply { margin: 0; }
.help-reply p { margin: 0; }
.fb { margin-bottom: 18px; }
.fb h2 { margin: 0 0 8px; font-size: var(--fs-3); }
.fb-list { margin: 0; padding: 0; list-style: none; }
.fb-item { padding: 12px 0; border-top: 1px solid var(--line); }
.fb-item p { margin: 0 0 4px; }

/* ---------- Size breaks ---------- */
@media (min-width: 900px) {
  .hello h1 { font-size: 46px; }
  .lcard { grid-template-columns: 76px 1fr; }
  .lcard-emoji { width: 76px; height: 76px; font-size: 36px; }
}
@media (min-width: 641px) {
  .login { padding-top: 9vh; }
}
@media (max-width: 640px) {
  .wrap { padding: 14px 16px 60px; }
  .hello h1 { font-size: var(--fs-4); }
  .lcard { grid-template-columns: 56px 1fr; gap: 14px; padding: 16px 16px 16px 20px; }
  .lcard-emoji { width: 56px; height: 56px; border-radius: 18px; font-size: 26px; }
  .lcard.featured { grid-template-columns: 64px 1fr; padding: 20px 18px 18px 20px; }
  .lcard.featured .lcard-emoji { width: 64px; height: 64px; border-radius: 20px; font-size: 30px; }
  .lcard.featured .lcard-title { font-size: var(--fs-3); }
  .lcard-foot .btn.start { width: 100%; margin-left: 0; }
  .profiles { grid-template-columns: 1fr; gap: 12px; }
  .profile { flex-direction: row; justify-content: flex-start; gap: 18px; padding: 12px 18px 12px 12px; text-align: left; }
  .avatar { width: 76px; height: 76px; font-size: 30px; }
  .pad-key { min-height: 64px; }
  .qtable thead { display: none; }
  .qtable, .qtable tbody, .qtable tr, .qtable td { display: block; width: 100%; }
  .qtable tr { padding: 10px 0; border-top: 1px solid var(--line); }
  .qtable td { padding: 3px 0; border: 0; }
  .qtable td::before {
    content: attr(data-label); display: block; color: var(--ink-3);
    font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  }
}

/* ===== Overarching plan (19 Oct): Today's timetable bits and the My plan screen ===== */
:root { --biology: #13a26b; --chemistry: #0b8ec9; --physics: #e8710a; }
.s-maths { --sc: var(--maths); } .s-english { --sc: var(--english); } .s-science, .s-biology { --sc: var(--biology); }
.s-chemistry { --sc: var(--chemistry); } .s-physics { --sc: var(--physics); }

.after-lessons { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }
.al { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-radius: var(--r-pill); background: var(--card); box-shadow: var(--shadow-1); font-size: var(--fs-1); }
.al-time { font-weight: 700; color: var(--ink-2); }

.next-day { margin-top: 22px; padding: 18px 20px; border-radius: var(--r-l); background: var(--card); box-shadow: var(--shadow-1); }
.next-day h2 { font-size: var(--fs-2); margin-bottom: 10px; }
.nd-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.nd { display: grid; grid-template-columns: 52px 92px 1fr; gap: 10px; align-items: baseline; padding: 8px 12px; border-left: 5px solid var(--sc); border-radius: 10px; background: var(--bg); }
.nd-time { font-weight: 700; color: var(--ink-3); }
.nd-subj { font-weight: 750; color: var(--sc); }
.nd-level { color: var(--ink-3); font-weight: 600; }
@media (max-width: 520px) { .nd { grid-template-columns: 46px 1fr; } .nd-title { grid-column: 2; } }

.plan-hello h1 { margin: 6px 0 4px; }
.plan-tabs { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 6px; padding: 5px; margin: 14px 0; border-radius: 22px; background: var(--card); box-shadow: var(--shadow-1); }
.plan-tab { min-height: 44px; padding: 8px 14px; border: 0; border-radius: var(--r-pill); background: transparent; font-weight: 700; color: var(--ink-2); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.plan-tab.on { background: var(--brand); color: #fff; }
@media (max-width: 540px) {
  .plan-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; border-radius: 18px; }
  .plan-tab { width: 100%; text-align: center; padding: 8px 10px; font-size: 15px; }
}
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.week-title { text-align: center; }
.week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
@media (max-width: 480px) {
  .week-grid { grid-template-columns: 1fr; }
}
.wrap.plan { max-width: 1120px; }
.pday { background: var(--card); border-radius: var(--r-m); box-shadow: var(--shadow-1); padding: 12px; border-top: 5px solid var(--line); }
.pday.is-today { border-top-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow-2); }
.pday.is-tomorrow { border-top-color: var(--accent); }
.pday.is-past { opacity: .62; }
.pday.off { background: var(--bg); }
.pd-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 8px; }
.pd-day { font-weight: 800; }
.pd-date { color: var(--ink-3); font-size: var(--fs-0); }
.pd-tag { margin-left: auto; padding: 1px 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 800; }
.pd-tag.today { background: var(--brand); color: #fff; }
.pd-tag.tomorrow { background: var(--accent-soft); color: #8a5a00; }
.pd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.pe { display: grid; grid-template-columns: 44px 1fr; gap: 6px; font-size: 15px; line-height: 1.3; }
.pe-time { color: var(--ink-3); font-weight: 700; font-size: 13px; padding-top: 2px; }
.pe-lesson .pe-main { display: grid; padding: 6px 8px; border-radius: 10px; background: color-mix(in srgb, var(--sc) 9%, white); border-left: 4px solid var(--sc); }
.pe-subj { font-size: 12px; font-weight: 800; color: var(--sc); text-transform: uppercase; letter-spacing: .03em; }
.pe-title { font-weight: 700; }
.pe-level { font-size: 13px; color: var(--ink-2); }
.pe-lunch .pe-label, .pe-review .pe-label { color: var(--ink-2); font-style: italic; }
.plan-times { margin-top: 14px; font-size: var(--fs-0); }

.routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.route { background: var(--card); border-radius: var(--r-l); box-shadow: var(--shadow-1); padding: 16px 18px; border-top: 6px solid var(--sc); }
.route h2 { font-size: var(--fs-2); }
.route-list { list-style: none; margin: 0; padding: 0; }
.rt { position: relative; display: grid; grid-template-columns: 22px 1fr auto; gap: 2px 8px; padding: 8px 0 8px; border-bottom: 1px dashed var(--line); }
.rt-dot { grid-row: span 2; width: 14px; height: 14px; margin-top: 5px; border-radius: 50%; border: 3px solid var(--sc); background: var(--card); }
.rt-done .rt-dot { background: var(--sc); }
.rt-now .rt-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.rt-title { font-weight: 700; }
.rt-meta { grid-column: 2; font-size: 14px; color: var(--ink-3); }
.rt-badge { grid-row: 1; grid-column: 3; align-self: start; padding: 1px 10px; border-radius: var(--r-pill); background: var(--accent); font-size: 12px; font-weight: 800; }
.rt-done .rt-title { color: var(--ink-3); }

.rt-now .rt-title { color: var(--ink); }
.rt-now { background: var(--accent-soft); border-radius: 10px; padding-left: 6px; padding-right: 6px; }

/* Parent: time away from the app (level-1 supervision) */
.focus-card { margin-top: 16px; }
.focus-list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: var(--fs-1); }
.fe-away { color: var(--bad); } .fe-fullscreen_exit { color: #8a5a00; } .fe-idle { color: var(--ink-3); }

/* New subjects (20 Oct): colours for chips, Today cards and the plan. */
:root { --geography: #0f9d8a; --history: #b5651d; --french: #3b5bdb; --re: #8e44ad; --pshe: #d6336c; --computing: #495057; }
.s-geography { --sc: var(--geography); } .s-history { --sc: var(--history); } .s-french { --sc: var(--french); }
.s-re { --sc: var(--re); } .s-pshe { --sc: var(--pshe); } .s-computing { --sc: var(--computing); }
.chip.geography { background: #e0f5f2; color: var(--geography); } .chip.history { background: #f8ece0; color: var(--history); }
.chip.french { background: #e5eafc; color: var(--french); } .chip.re { background: #f2e7f7; color: var(--re); }
.chip.pshe { background: #fbe4ec; color: var(--pshe); } .chip.computing { background: #eceef0; color: var(--computing); }
.subject-geography { --subj: var(--geography); --subj-soft: #e0f5f2; --subj-deep: #0a7366; }
.subject-history { --subj: var(--history); --subj-soft: #f8ece0; --subj-deep: #8a4a12; }
.subject-french { --subj: var(--french); --subj-soft: #e5eafc; --subj-deep: #2a44b0; }
.subject-re { --subj: var(--re); --subj-soft: #f2e7f7; --subj-deep: #6c3483; }
.subject-pshe { --subj: var(--pshe); --subj-soft: #fbe4ec; --subj-deep: #a61e4d; }
.subject-computing { --subj: var(--computing); --subj-soft: #eceef0; --subj-deep: #343a40; }

/* Anti-rushing (Today): the rule card, "another go" pill, Master it badge in the plan */
.rule { background: var(--brand-soft); border-radius: var(--r-m); padding: 12px 18px; margin: 0 0 var(--gap); }
.rule p { margin: 0; }
.pill.another { background: var(--accent-soft); color: #8a5a00; }

/* Standalone kiosk status bar & parent unlock modal */
.kiosk-bar { margin: 4px 0 8px; }
.kiosk-pill { display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; background: var(--card); border: 1.5px solid var(--line); }
.kiosk-pill.locked { background: #fff8e6; border-color: #f2b134; color: #5c4200; }
.kiosk-pill.unlocked { background: #ebf9f1; border-color: #13a26b; color: #0b5e3e; }
.kiosk-msg { flex: 1; line-height: 1.3; }
.kiosk-parent-btn { border: 1.5px solid currentColor; background: transparent; color: inherit; border-radius: var(--r-pill); padding: 2px 10px; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.kiosk-parent-btn:hover { opacity: .8; }
.kiosk-modal-backdrop { position: fixed; inset: 0; background: rgba(20, 22, 30, .48); display: grid; place-items: center; z-index: 9999; padding: 16px; }
.kiosk-modal { max-width: 420px; width: 100%; padding: 20px; display: grid; gap: 12px; }
.kiosk-modal h3 { margin: 0; }
.kiosk-modal-row { display: flex; gap: 10px; flex-wrap: wrap; }
.kiosk-pin-input, .kiosk-mins-select { flex: 1; min-height: 42px; padding: 6px 12px; border: 2px solid var(--line); border-radius: 10px; font: inherit; }
.install-card { display: grid; gap: 8px; justify-items: start; margin: 8px 0; padding: 14px 16px; }
.install-card h2 { margin: 0; font-size: 18px; }
.install-card p { margin: 0; }
.kiosk-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.telemetry-card { margin-top: 16px; }

/* Bonus levels, teaser ribbons, and My notes (21 Oct) */
.bonus-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.bonus-chip { border-radius: var(--r-pill); padding: 4px 12px; font-size: 13.5px; font-weight: 700; border: 1.5px solid var(--line); background: #fff; cursor: pointer; }
.bonus-chip.bc-locked { opacity: .6; cursor: default; background: var(--bg); }
.bonus-chip.bc-ready { background: #fff8e1; border-color: #f2b134; color: #6e4700; box-shadow: 0 2px 0 #f2b134; }
.bonus-chip.bc-done { background: #ebf9f1; border-color: #13a26b; color: #0b5e3e; }
.teaser-card-note { margin: 4px 0; font-size: 14px; font-weight: 700; color: #6e4700; background: #fff8e1; display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); }
.teaser-ribbon { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; margin-bottom: 14px; border-radius: var(--r-m); background: linear-gradient(90deg, #fff8e1, #fffdf5); border: 2px solid #f2b134; }
.teaser-ribbon-tag { font-weight: 800; color: #7a4f00; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.teaser-ribbon-text { font-weight: 700; color: var(--ink); font-size: var(--fs-2); }
.bonus-unlock-card { margin: 14px 0; padding: 18px 20px; border: 2.5px solid #f2b134; background: linear-gradient(135deg, #fffdf5, #fff5d6); text-align: left; }
.bonus-unlock-badge { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); background: #f2b134; color: #2b2100; font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.bonus-unlock-card h3 { margin: 2px 0 6px; font-size: var(--fs-3); }
.bonus-unlock-hook { margin: 0 0 12px; color: var(--ink-2); font-size: var(--fs-1); }
.bonus-unlock-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bonus-head { margin-bottom: 16px; }
.bonus-head-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.bonus-kind-pill { background: #fff8e1; color: #7a4f00; font-weight: 800; }
.bonus-complete-card { margin-top: 16px; border: 2.5px solid var(--good); background: #f4fbf7; }
.cliffhanger-box { margin: 10px 0 14px; padding: 12px 16px; border-radius: var(--r-m); background: #fff8e1; border-left: 5px solid #f2b134; }
.cliff-label { font-size: 13px; font-weight: 800; text-transform: uppercase; color: #7a4f00; margin-bottom: 4px; }
.cliff-text { font-size: var(--fs-2); font-weight: 750; }
.nb-notes-input { width: 100%; margin-top: 12px; padding: 10px 14px; border-radius: var(--r-m); border: 2px solid #c9bcff; background: #fff; font: inherit; font-size: var(--fs-1); resize: vertical; }
.notes-grid { display: grid; gap: 14px; }
.note-card { border-top: 5px solid var(--subj, var(--brand)); }
.note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.note-head h3 { margin: 0; }
.note-items { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 4px; }
.note-text { margin: 8px 0 0; padding: 10px 14px; background: var(--bg); border-radius: var(--r-s); white-space: pre-wrap; }
.pe-master { color: var(--brand-ink); font-weight: 700; }

/* ---- Today as a queue (25 Oct 2026): clock, sessions, XP, chunks, up next -------------------------------- */
.clock-card { margin: 14px 0 10px; padding: 16px 20px; border-radius: var(--r-l); background: var(--card); box-shadow: var(--shadow-1); }
.clock-card h2 { margin: 0 0 4px; font-size: var(--fs-3); }
.clock-card p { margin: 0; color: var(--ink-2); }
.clock-card.cc-session { background: var(--brand-soft); border: 2px solid var(--brand); }
.clock-card.cc-break { background: var(--good-soft); border: 2px solid var(--good); }
.clock-card .countdown { font-variant-numeric: tabular-nums; }
.day-strip { display: flex; align-items: center; gap: 4px; margin: 6px 0 14px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.day-strip::-webkit-scrollbar { display: none; }
.ds-session { flex: 1 1 0; display: inline-flex; flex-direction: column; align-items: center; min-width: 48px; padding: 6px 4px; border-radius: var(--r-m); background: var(--card); border: 2px solid var(--line); }
.ds-session b { font-size: var(--fs-2); line-height: 1.1; }
.ds-session small { color: var(--ink-3); font-size: 12px; }
.ds-session.now { border-color: var(--brand); background: var(--brand-soft); }
.ds-session.past { opacity: .55; }
.ds-break { flex: 0 0 auto; color: var(--ink-3); font-size: 15px; padding: 0; }
.ds-break.long { font-size: 16px; }
.ds-break.now { color: var(--good); font-weight: 800; }
.xp { margin: 0 0 16px; padding: 12px 18px; border-radius: var(--r-l); background: var(--card); box-shadow: var(--shadow-1); }
.xp-top { display: flex; justify-content: space-between; align-items: baseline; }
.xp-track { height: 14px; border-radius: var(--r-pill); background: var(--accent-soft); margin: 8px 0 6px; overflow: hidden; }
.xp-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width .4s; }
.chunk-dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.chunk-dots .cd { flex: 1 1 24px; max-width: 34px; min-width: 18px; height: 10px; border-radius: var(--r-pill); background: var(--line); }
.chunk-dots .cd.done { background: var(--good); }
.chunk-dots .cd.cur { background: var(--brand); }
.chunk-dots .cd.check { outline: 2px dashed var(--ink-3); outline-offset: 1px; }
.bonus-row, .up-next, .done-today { margin-top: 18px; padding: 16px 20px; border-radius: var(--r-l); background: var(--card); box-shadow: var(--shadow-1); }
.bonus-row h2, .up-next h2, .done-today h2 { font-size: var(--fs-2); margin: 0 0 8px; }
.un-list { list-style: none; margin: 6px 0; padding: 0; }
.un { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.un:last-child { border-bottom: 0; }
.un-subj { font-weight: 800; min-width: 92px; }
.un-title { flex: 1 1 200px; }
.un-mins { font-size: 14px; }
.done-today ul { margin: 0; padding-left: 4px; list-style: none; }
.done-today li { padding: 3px 0; color: var(--good); }
.done-today li strong { color: var(--ink); }
@media (max-width: 480px) {
  .topline { gap: 8px; }
  .lcard, .lcard.featured { grid-template-columns: 1fr; gap: 10px; padding: 18px 16px; }
  .lcard-emoji, .lcard.featured .lcard-emoji { width: 48px; height: 48px; border-radius: 14px; font-size: 24px; }
  .next-day .btn { width: 100%; }
}
/* Lesson player: the checkpoint between parts and the next step after a lesson */
.checkpoint { text-align: center; padding: 26px 22px; }
.checkpoint h2 { margin: 6px 0; }
.checkpoint .cp-xp { display: inline-block; margin: 6px 0 14px; padding: 4px 14px; border-radius: var(--r-pill); background: var(--accent-soft); font-weight: 800; }
.next-step { margin: 16px 0; padding: 16px 18px; border-radius: var(--r-l); background: var(--brand-soft); border: 2px solid var(--brand); text-align: left; }
.next-step h3 { margin: 0 0 6px; }
.next-step .auto { color: var(--ink-2); font-size: 15px; }
.lcard.featured .chunk-dots .cd { background: rgba(255, 255, 255, .35); }
.lcard.featured .chunk-dots .cd.done { background: #7ef0a8; }
.lcard.featured .chunk-dots .cd.cur { background: #fff; }
.lcard.featured .chunk-dots .cd.check { outline-color: rgba(255, 255, 255, .7); }

/* School bar: the left pane of the desktop app (screens/hub.js) */
.hub { padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; min-height: 100vh; background: #f4f1ff; }
.hub-brand { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.hub-when { margin: 0; font-weight: 700; color: #4b3fb5; }
.hub-xp { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.hub-xp-bar { height: 8px; border-radius: 6px; background: #e3ddff; overflow: hidden; }
.hub-xp-bar i { display: block; height: 100%; background: #6a4cff; }
.hub-now { background: #fff; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.hub-now h2 { margin: 0; font-size: 1.15rem; }
.hub-kicker { font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #6a4cff; margin: 0; }
.hub-parts, .hub-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: #555; }
.hub-steps { list-style: none; padding-left: 0; }
.hub-parts li.done, .hub-steps li.done { color: #1f8a4c; }
.hub-parts li.current { font-weight: 800; color: #222; }
.hub-go { width: 100%; }
.hub-next ul { margin: 6px 0 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: #666; }
.hub-today { margin-top: auto; }
