:root {
  --ink: #1d1b3a;
  --ink-soft: #5d5a7a;
  --paper: #fffaf2;
  --card: #ffffff;
  --line: #ece3d3;
  --coral: #ff6b57;
  --coral-dark: #e85441;
  --sun: #ffc23d;
  --teal: #16b3a2;
  --sky: #4c7dff;
  --grape: #8b5cf6;
  --danger: #e5484d;
  --radius: 20px;
  --shadow: 0 1px 0 #1d1b3a0d, 0 14px 34px -14px #1d1b3a33;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Nunito", ui-rounded, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 8%, #ffe3d6 0, transparent 26rem),
    radial-gradient(circle at 92% 18%, #dff4f1 0, transparent 24rem),
    radial-gradient(#1d1b3a12 1.2px, transparent 1.2px);
  background-size: auto, auto, 22px 22px;
}

h1, h2, h3, .brand, .eyebrow, button, .button { font-family: "Fredoka", "Nunito", system-ui, sans-serif; }
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.05; margin: .3rem 0 1rem; letter-spacing: -.01em; }
h2 { font-size: 1.55rem; margin: 0; }
h3 { font-size: 1.15rem; margin: 0 0 .6rem; }
p { margin: 0; }
.muted { color: var(--ink-soft); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--coral); }
.eyebrow.light, .light { color: #fff; }

main { max-width: 1040px; margin: 0 auto; padding: 0 20px 80px; }
[hidden] { display: none !important; }

/* ---------- Controls ---------- */
label { display: grid; gap: .3rem; font-weight: 700; font-size: .9rem; color: var(--ink-soft); }
input, select {
  font: inherit; font-size: 1rem; color: var(--ink);
  padding: .75rem .9rem; border: 2px solid var(--line); border-radius: 14px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px #4c7dff22; }

button, .button {
  font: inherit; font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .75rem 1.2rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .12s, background .15s, box-shadow .15s;
}
button:active, .button:active { transform: translateY(1px) scale(.98); }
button:focus-visible, .button:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
button:disabled { opacity: .6; cursor: progress; }
.primary { background: var(--coral); color: #fff; box-shadow: 0 6px 0 var(--coral-dark); }
.primary:hover { background: var(--coral-dark); }
.secondary { background: #fff; color: var(--ink); border-color: var(--ink); }
.secondary:hover { background: #fff3e6; }
.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.ghost:hover { background: #fff; }
.danger { background: var(--danger); color: #fff; }
.danger:hover { background: #c9373c; }
.sun { background: var(--sun); color: var(--ink); box-shadow: 0 6px 0 #d99a12; }
.sun:hover { background: #ffcf5c; }
.link { background: none; border: 0; padding: .2rem 0; color: var(--sky); font-family: "Nunito", sans-serif; font-weight: 700; }
.small { padding: .45rem .9rem; font-size: .9rem; }
.big { padding: 1rem 2rem; font-size: 1.25rem; }
.row { display: flex; gap: .7rem; flex-wrap: wrap; }

.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }

/* ---------- Top bar ---------- */
.topbar { max-width: 1040px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-size: 1.35rem; font-weight: 600; }
.brand b { color: var(--coral); font-weight: 700; }
.brand-mark { width: 42px; height: 42px; transform: rotate(-6deg); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.lang-pick {
  display: inline-flex; flex-direction: row; align-items: center; gap: .35rem; padding: 0 .3rem 0 .75rem;
  border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
}
.lang-pick svg { width: 18px; height: 18px; flex: none; }
.lang-pick select { border: 0; padding: .45rem .5rem .45rem .2rem; background: transparent; font-weight: 700; font-size: .95rem; cursor: pointer; }
.lang-pick select:focus { box-shadow: none; }
.lang-pick:focus-within { border-color: var(--sky); box-shadow: 0 0 0 4px #4c7dff22; }
[dir="rtl"] .brand-mark { transform: rotate(6deg); }
/* Greetings, banners and Andrew's English keep their own direction on right-to-left pages. */
.bubble, .auth-card::before, .launch-bubbles span, .banner, .tray button { direction: ltr; unicode-bidi: isolate; }
.caption, .word-card, .notebook .word, .fix span { unicode-bidi: plaintext; }
[dir="rtl"] .lesson::before { left: auto; right: 0; border-radius: 6px 0 0 6px; }
[dir="rtl"] .summary { border-left: 0; border-right: 5px solid var(--sun); border-radius: 14px 0 0 14px; }
[dir="rtl"] .grammar { border-left: 0; border-right: 4px solid var(--grape); padding: 4px 16px 4px 0; }

/* ---------- Auth hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding-top: 30px; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 34rem; }
.underline { background: linear-gradient(transparent 62%, #ffc23d99 62%); }
.bubbles { position: relative; height: 210px; margin-top: 18px; }
.bubble {
  position: absolute; padding: .5rem 1rem; border-radius: 18px; font-family: "Fredoka", sans-serif; font-weight: 600;
  color: #fff; box-shadow: var(--shadow); animation: float 6s ease-in-out infinite;
}
.bubble::after { content: ""; position: absolute; bottom: -7px; left: 18px; border: 8px solid transparent; border-top-color: inherit; border-bottom: 0; }
.b1 { left: 0; top: 10px; background: var(--coral); border-color: var(--coral); font-size: 1.5rem; }
.b2 { left: 34%; top: 0; background: var(--sun); border-color: var(--sun); color: var(--ink); animation-delay: -1s; }
.b3 { left: 62%; top: 30px; background: var(--teal); border-color: var(--teal); animation-delay: -2s; }
.b4 { left: 12%; top: 95px; background: var(--grape); border-color: var(--grape); animation-delay: -3s; }
.b5 { left: 44%; top: 82px; background: var(--sky); border-color: var(--sky); font-size: 1.2rem; animation-delay: -4s; }
.b6 { left: 78%; top: 110px; background: var(--ink); border-color: var(--ink); animation-delay: -1.5s; }
.b7 { left: 2%; top: 165px; background: #fff; border-color: #fff; color: var(--ink); animation-delay: -2.5s; }
.b8 { left: 32%; top: 160px; background: var(--teal); border-color: var(--teal); animation-delay: -3.5s; }
.b9 { left: 60%; top: 170px; background: var(--coral); border-color: var(--coral); animation-delay: -.5s; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-1.5deg); } }

.auth-card { display: grid; gap: 14px; position: relative; }
.auth-card::before {
  content: "Hi!"; position: absolute; top: -22px; right: 24px; background: var(--sun); padding: .2rem .8rem; border-radius: 14px;
  font-family: "Fredoka", sans-serif; font-weight: 700; transform: rotate(6deg); box-shadow: var(--shadow);
}
.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--ink); }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--coral); }
.subform { display: grid; gap: 12px; padding-top: 12px; border-top: 2px dashed var(--line); }

/* ---------- Home ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 34px 0 14px; }
.students { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.student {
  display: flex; align-items: center; justify-content: flex-start; min-width: 0; gap: .75rem; padding: 14px; text-align: left;
  background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  font-family: "Nunito", sans-serif;
}
.student:hover { border-color: var(--ink-soft); }
.student[aria-pressed="true"] { border-color: var(--ink); background: #fff3e6; box-shadow: 0 6px 0 var(--ink); }
.student .face { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: "Fredoka", sans-serif; font-size: 1.3rem; }
.student b { display: block; font-size: 1.05rem; }
.student small { color: var(--ink-soft); }
.student.add { justify-content: center; border-style: dashed; color: var(--ink-soft); box-shadow: none; font-family: "Fredoka", sans-serif; }
.profile { margin-top: 14px; display: grid; gap: 18px; }
.profile-basics { align-items: end; }
.profile-basics .grow { flex: 1 1 200px; }
.profile input[type="number"] { width: 6rem; }
textarea { font: inherit; font-size: 1rem; color: var(--ink); padding: .75rem .9rem; border: 2px solid var(--line); border-radius: 14px; resize: vertical; }
textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px #4c7dff22; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
legend { font-weight: 700; font-size: .9rem; color: var(--ink-soft); margin-bottom: 8px; padding: 0; }
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-pick button {
  font-family: "Nunito", sans-serif; font-weight: 700; font-size: .95rem; padding: .45rem .9rem;
  background: #fff; color: var(--ink); border: 2px solid var(--line); box-shadow: none;
}
.chips-pick button:hover { border-color: var(--ink-soft); }
.chips-pick button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.student .likes { display: block; font-size: .8rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student > span:last-child { min-width: 0; }

.launch {
  position: relative; overflow: hidden; margin-top: 26px; padding: 32px; border: 0; color: #fff;
  background: linear-gradient(120deg, #2b2a5c 0%, #4c3fa8 55%, #6d4fd8 100%);
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end;
}
.launch h2 { font-size: 2rem; margin: .2rem 0 .5rem; }
.launch p { color: #e4e0ff; max-width: 32rem; }
.launch-actions { display: grid; gap: 14px; justify-items: stretch; position: relative; z-index: 1; }
.launch-actions label { color: #e4e0ff; }
.launch-actions select { border-color: transparent; }
.launch-bubbles span {
  position: absolute; padding: .3rem .8rem; border-radius: 14px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: .9rem;
  background: #ffffff1f; color: #fff; border: 1px solid #ffffff33;
}
/* In the gap between the text and the start button, never behind the controls. */
.launch-bubbles span:nth-child(1) { top: 22px; right: 250px; transform: rotate(5deg); }
.launch-bubbles span:nth-child(2) { top: 70px; right: 330px; transform: rotate(-6deg); }
.launch-bubbles span:nth-child(3) { top: 118px; right: 245px; transform: rotate(3deg); }
@media (max-width: 1000px) { .launch-bubbles { display: none; } }

.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.lesson {
  position: relative; display: grid; gap: .55rem; text-align: left; padding: 20px 20px 18px 26px;
  background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  font-family: "Nunito", sans-serif; font-weight: 400;
}
.lesson::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 6px; border-radius: 0 6px 6px 0; background: var(--accent, var(--teal)); }
button.lesson:hover { border-color: var(--ink-soft); transform: translateY(-2px); }
.lesson time { font-size: .85rem; color: var(--ink-soft); font-weight: 700; }
.lesson h3 { font-size: 1.2rem; margin: 0; }
.lesson .retry { justify-self: start; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font-size: .8rem; font-weight: 800; padding: .15rem .6rem; border-radius: 999px; background: #f3eee4; color: var(--ink-soft); }
.chip.level { background: #e7f8f5; color: #0d7c70; }
.status { font-size: .8rem; font-weight: 800; padding: .15rem .6rem; border-radius: 999px; justify-self: start; }
.status.processing { background: #fff4d6; color: #8a5a00; }
.status.failed, .status.empty, .status.live { background: #ffe9e6; color: #b2382a; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 34px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--ink-soft); }
.empty-state b { display: block; font-family: "Fredoka", sans-serif; font-size: 1.2rem; color: var(--ink); }

.usage { margin-top: 30px; padding: 18px 24px; }
.usage summary { cursor: pointer; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.1rem; }
.usage table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.usage th, .usage td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--line); }
.usage td:not(:first-child), .usage th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.usage tfoot td { font-weight: 800; border-bottom: 0; }

/* ---------- Portals ---------- */
body:not([data-layout="subject"]) .pro-only, body[data-layout="subject"] .kids-only,
body:not([data-portal="pro"]) .it-only, body:not([data-portal="maths"]) .maths-only,
body:not([data-portal="sci"]) .sci-only,
body:not([data-portal="kids"]) .kidsportal-only, body[data-portal] .home-only,
body:not([data-portal="maths"]):not([data-portal="sci"]) .study-only { display: none; }

.landing { padding-top: 10px; }
.landing-head { text-align: center; max-width: 780px; margin: 0 auto 34px; }
.landing-head .lead { margin: 0 auto; }
.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.path {
  display: grid; align-content: start; gap: 8px; padding-bottom: 20px; overflow: hidden; text-decoration: none; color: var(--ink);
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
.path > :not(img) { margin: 0 20px; }
.path img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; background: #e9e3d8; }
.path h2 { font-size: 1.3rem; }
.path p { color: var(--ink-soft); font-size: .95rem; }
.path > .path-tag { margin-top: 14px; justify-self: start; padding: .2rem .7rem; border-radius: 999px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: .85rem; color: #fff; background: var(--coral); }
.path.pro .path-tag { background: var(--sky); }
.path > .path-cta { margin-top: 6px; font-family: "Fredoka", sans-serif; font-weight: 600; color: var(--coral); }
.path.pro .path-cta { color: var(--sky); }
a.path:hover { transform: translateY(-4px); border-color: var(--ink-soft); }
.path.soon { border-style: dashed; box-shadow: none; background: #fffdf8; padding-top: 22px; }
.path.soon .path-tag { background: #b9b2a5; }
.path.soon .path-cta { color: var(--ink-soft); }
.path-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-family: "Fredoka", sans-serif; font-size: 2rem; color: #fff; background: linear-gradient(135deg, #8b5cf6, #4c7dff); }

.teacher-tag { display: inline-block; margin-top: 2px; padding: .05rem .45rem; border-radius: 6px; white-space: nowrap; font-size: .72rem; font-weight: 700; color: #fff; background: #ff6b57; }
.teacher-tag.pro { background: #2563eb; }
.teacher-tag.maths { background: #7c3aed; }
.teacher-tag.sci { background: #0d9488; }
.all-teachers { font-weight: 700; color: var(--ink); }

/* ---------- Teacher chooser on the lesson panel ---------- */
.teacher-choice { grid-column: 1 / -1; position: relative; z-index: 1; padding-top: 18px; border-top: 1px solid #ffffff26; }
.teacher-choice-label { display: block; margin-bottom: 10px; color: #e4e0ff; font-weight: 700; font-size: .9rem; }
.teacher-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.teacher-option {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-align: start; justify-content: flex-start;
  background: #ffffff14; color: #fff; border: 2px solid #ffffff26; border-radius: 12px; box-shadow: none; font-family: inherit;
}
.teacher-option img { flex: none; width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: top; background: #ffffff33; }
.teacher-option b { display: block; font-size: 1rem; }
.teacher-option small { display: block; font-size: .78rem; font-weight: 600; opacity: .8; }
.teacher-option:hover { background: #ffffff24; }
.teacher-option[aria-pressed="true"] { border-color: #fff; background: #ffffff2e; box-shadow: 0 0 0 3px #ffffff33; }
body[data-layout="subject"] .teacher-option { border-width: 1px; border-radius: 10px; }
body[data-layout="subject"] .teacher-option[aria-pressed="true"] { border-color: var(--accent-light); box-shadow: 0 0 0 3px var(--accent-glow); }
body[data-layout="subject"] .teacher-choice-label { color: #cbd5e1; }
.lesson .teacher-tag { justify-self: start; }
@media (max-width: 820px) { .teacher-options { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Teacher picker in the new-learner form ---------- */
.track-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.track-option {
  display: grid; align-content: start; justify-items: start; gap: 6px; padding: 0 0 12px; overflow: hidden; text-align: start;
  background: #fff; color: var(--ink); border: 2px solid var(--line); border-radius: 14px; box-shadow: none;
  font-family: inherit; font-weight: 600; font-size: .95rem;
}
.track-option > :not(img) { margin: 0 12px; }
.track-option img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: #e9e3d8; }
.track-option b { font-size: .95rem; line-height: 1.25; }
.track-tag { margin-top: 4px; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; color: #fff; background: var(--coral); }
.track-option.kids .track-tag { background: #ff6b57; }
.track-option.pro .track-tag { background: #2563eb; }
.track-option.maths .track-tag { background: #7c3aed; }
.track-option.sci .track-tag { background: #0d9488; }
.track-option:hover { border-color: var(--ink-soft); }
.track-option[aria-pressed="true"] { border-color: var(--coral); box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 25%, transparent); }
.track-pick small { display: block; }
@media (max-width: 640px) { .track-options { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Classes (prepaid balance) ---------- */
.classes { margin-top: 26px; display: grid; grid-template-columns: auto 1fr; gap: 8px 32px; align-items: center; }
.classes-balance { display: grid; justify-items: start; padding-right: 32px; border-right: 2px dashed var(--line); }
.classes-balance b { font-family: "Fredoka", sans-serif; font-size: 3.6rem; line-height: 1; color: var(--coral); }
.classes-balance span { font-weight: 800; }
.classes-buy { display: grid; gap: 12px; }
.packs { display: flex; gap: 12px; flex-wrap: wrap; }
.pack { display: grid; justify-items: start; gap: 2px; padding: .8rem 1.2rem; border-radius: 18px; text-align: start; }
.pack small { font-family: "Nunito", sans-serif; font-weight: 800; font-size: .8rem; opacity: .85; }
.history { grid-column: 1 / -1; margin-top: 6px; }
.history summary { cursor: pointer; font-weight: 800; color: var(--ink-soft); }
.ledger { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.ledger li { display: flex; justify-content: space-between; gap: 12px; padding: .45rem .7rem; border-radius: 10px; background: #faf6ee; }
.ledger .plus { color: #0d7c70; font-weight: 800; }
.ledger .minus { color: var(--ink-soft); font-weight: 800; }
.launch .launch-half { margin-top: .5rem; font-weight: 800; color: #ffd98a; }
[dir="rtl"] .classes-balance { padding-right: 0; padding-left: 32px; border-right: 0; border-left: 2px dashed var(--line); }
@media (max-width: 640px) {
  .classes { grid-template-columns: 1fr; }
  .classes-balance { border-right: 0; padding-right: 0; border-bottom: 2px dashed var(--line); padding-bottom: 12px; }
}

/* ---------- Half-time break ---------- */
.break { text-align: center; padding: 48px 24px 40px; display: grid; justify-items: center; gap: 14px; }
.break h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); color: #fff; }
.break .eyebrow { color: var(--holo); letter-spacing: .25em; }
.break-text { color: #c9d3ff; max-width: 32rem; }
.break-timer { font-family: "Fredoka", sans-serif; font-size: clamp(4rem, 14vw, 7rem); line-height: 1; color: #fff; text-shadow: 0 0 30px #4cc9ff99; font-variant-numeric: tabular-nums; }
.break-actions { justify-content: center; align-items: center; }
.light-link { color: var(--holo); }
.light-ghost { color: #fff; border-color: #7ce7ff66; }
.light-ghost:hover { background: #ffffff14; }

/* ---------- Call ---------- */
#call { max-width: 900px; margin: 10px auto 0; }
.call-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.live-pill { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .9rem; border-radius: 999px; background: #fff; border: 2px solid var(--line); font-weight: 800; }
.live-dot { width: .65rem; height: .65rem; background: var(--danger); border-radius: 50%; box-shadow: 0 0 0 4px #e5484d33; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px #e5484d00; } }
.call-student { font-family: "Fredoka", sans-serif; font-size: 1.3rem; font-weight: 600; flex: 1; }
.timer { font-family: "Fredoka", sans-serif; font-size: 1.3rem; font-variant-numeric: tabular-nums; background: var(--ink); color: #fff; padding: .25rem .9rem; border-radius: 12px; }
.video-stage {
  position: relative; aspect-ratio: 16 / 9; background: var(--ink); border-radius: 28px; overflow: hidden;
  box-shadow: 0 0 0 6px #fff, 0 0 0 8px var(--line), 0 30px 60px -20px #1d1b3a66;
}
.video-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tap-to-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.caption {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(90%, 680px); margin: 0;
  padding: .6rem 1rem; border-radius: 16px; background: #1d1b3acc; color: #fff; text-align: center;
  font-family: "Fredoka", sans-serif; font-size: 1.25rem; line-height: 1.35; backdrop-filter: blur(4px);
}
.caption.student { background: #16b3a2d9; }
.video-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: #fff; background: radial-gradient(circle, #3a3780, var(--ink)); font-family: "Fredoka", sans-serif; font-size: 1.3rem; }
.typing { display: inline-flex; gap: 6px; padding: 12px 16px; border-radius: 18px; background: #fff; }
.typing i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-soft); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.call-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.call-actions p { flex: 1 1 260px; }

/* ---------- Mission control (sci-fi lesson screen) ---------- */
.mission {
  --holo: #7ce7ff;
  position: relative; max-width: 980px; margin: 0 auto; padding: 18px 18px 22px; border-radius: 28px; overflow: hidden;
  background: radial-gradient(ellipse at 50% -10%, #2a2f78 0%, #121436 45%, #07081c 100%); color: #e8ecff;
  box-shadow: 0 30px 80px -30px #07081ccc;
}
.mission > *:not(.starfield) { position: relative; z-index: 1; }
.starfield {
  position: absolute; inset: -50%; pointer-events: none; opacity: .7;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 120px 80px, #cfe9ff, transparent),
    radial-gradient(1px 1px at 60px 160px, #fff, transparent), radial-gradient(1.5px 1.5px at 170px 120px, #ffe6b0, transparent),
    radial-gradient(1px 1px at 90px 10px, #fff, transparent);
  background-size: 200px 200px; animation: stars 90s linear infinite;
}
@keyframes stars { to { transform: translate(200px, 100px); } }
.mission .call-head { flex-wrap: wrap; }
.mission .live-pill { background: #ff3b5c22; border-color: #ff3b5c66; color: #ffd6dd; letter-spacing: .08em; font-size: .85rem; }
.mission .call-student { color: #fff; }
.hud-stat, .mission .timer {
  font-family: "Fredoka", sans-serif; font-size: 1.1rem; padding: .25rem .8rem; border-radius: 12px;
  background: #7ce7ff14; border: 1px solid #7ce7ff55; color: var(--holo);
}
.hud-stat b { color: #fff; display: inline-block; }
.hud-stat b.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.6); color: #ffc23d; } }

.holo { background: #05061a; box-shadow: 0 0 0 2px #7ce7ff66, 0 0 40px #4cc9ff44, 0 0 120px #8b5cf633; }
.holo video { animation: camera 26s ease-in-out infinite alternate; transition: scale .35s ease; filter: saturate(1.06) contrast(1.04); }
.holo.punch video { scale: 1.09; }
@keyframes camera {
  0% { transform: scale(1.02) translate(0, 0); }
  50% { transform: scale(1.07) translate(-1.2%, .8%); }
  100% { transform: scale(1.04) translate(1%, -.6%); }
}
.scanlines { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(transparent 0 3px, #7ce7ff0c 3px 4px); }
.scanlines::after {
  content: ""; position: absolute; left: 0; right: 0; height: 22%;
  background: linear-gradient(transparent, #7ce7ff14, transparent); animation: sweep 7s linear infinite;
}
@keyframes sweep { from { top: -25%; } to { top: 105%; } }
.corner { position: absolute; width: 34px; height: 34px; border: 3px solid var(--holo); filter: drop-shadow(0 0 6px var(--holo)); pointer-events: none; }
.corner.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.corner.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.corner.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.corner.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.hud-label { position: absolute; top: 20px; left: 56px; font-size: .72rem; letter-spacing: .2em; font-weight: 800; color: var(--holo); text-shadow: 0 0 8px var(--holo); }

.voice-bars { position: absolute; left: 22px; bottom: 22px; display: flex; gap: 4px; align-items: end; height: 30px; }
.voice-bars i { width: 5px; height: 6px; border-radius: 3px; background: var(--holo); box-shadow: 0 0 8px var(--holo); transition: height .2s; }
.voice-bars.speaking i { animation: eq .5s ease-in-out infinite alternate; }
.voice-bars.speaking i:nth-child(2) { animation-delay: -.2s; }
.voice-bars.speaking i:nth-child(3) { animation-delay: -.35s; }
.voice-bars.speaking i:nth-child(4) { animation-delay: -.1s; }
.voice-bars.speaking i:nth-child(5) { animation-delay: -.4s; }
@keyframes eq { from { height: 6px; } to { height: 28px; } }
.you-talk { position: absolute; right: 22px; bottom: 22px; padding: .3rem .8rem; border-radius: 999px; background: #16b3a2e6; color: #fff; font-weight: 800; font-size: .85rem; animation: pulse-green 1.2s infinite; }
@keyframes pulse-green { 50% { box-shadow: 0 0 0 8px #16b3a200; } 0% { box-shadow: 0 0 0 0 #16b3a299; } }

.word-card {
  position: absolute; top: 22px; right: 22px; width: min(44%, 310px); padding: 16px 18px 18px; text-align: center;
  border-radius: 20px; border: 1px solid #7ce7ffaa; color: #fff;
  background: linear-gradient(160deg, #0e1a3ae6, #2a1b5ee6); box-shadow: 0 0 30px #4cc9ff66, inset 0 0 30px #7ce7ff22;
  animation: card-in .6s cubic-bezier(.2, 1.4, .4, 1);
}
.word-card small { display: block; letter-spacing: .25em; font-weight: 800; color: var(--holo); font-size: .72rem; }
.wc-emoji { display: block; font-size: 2.4rem; line-height: 1.2; margin-top: 4px; }
.word-card b { display: block; font-family: "Fredoka", sans-serif; font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.1; text-shadow: 0 0 18px #7ce7ffaa; }
.wc-tr { display: block; color: #ffc23d; font-weight: 800; margin-top: 4px; }
.word-card p { margin-top: 6px; color: #c9d3ff; font-style: italic; font-size: .95rem; }
.word-card.leaving { animation: card-out .6s ease-in forwards; }
.wc-code {
  margin: 8px 0 0; padding: .6rem .8rem; border-radius: 10px; border: 1px solid #7ce7ff55; background: #05061a;
  color: #a5f3c4; font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; font-size: 1rem;
  white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; direction: ltr;
}
.word-card.code { width: min(56%, 420px); }
@keyframes card-in { from { opacity: 0; transform: translateY(-30px) scale(.6) rotate(-6deg); } }
@keyframes card-out { to { opacity: 0; transform: translateY(260px) scale(.3); } }

.banner {
  position: absolute; left: -10%; right: -10%; top: 38%; padding: .3rem 0; text-align: center; pointer-events: none;
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: clamp(2.2rem, 7vw, 4.4rem); color: #fff;
  background: linear-gradient(90deg, transparent, #ff6b57e6 20%, #8b5cf6e6 80%, transparent);
  text-shadow: 0 4px 0 #1d1b3a66; transform: rotate(-4deg);
}
.banner.go { animation: banner 1.9s cubic-bezier(.2, .9, .3, 1) forwards; }
@keyframes banner {
  0% { opacity: 0; transform: rotate(-4deg) translateX(-60%) scale(.8); }
  20%, 75% { opacity: 1; transform: rotate(-4deg) translateX(0) scale(1); }
  100% { opacity: 0; transform: rotate(-4deg) translateX(60%) scale(1.05); }
}
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fx i { position: absolute; left: 50%; top: 45%; width: 10px; height: 14px; border-radius: 2px; animation: confetti 1.5s cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes confetti { to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }

.word-tray { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.tray-label { font-size: .72rem; letter-spacing: .2em; font-weight: 800; color: var(--holo); }
.tray { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.tray-empty { color: #8f97c9; font-size: .9rem; }
.tray button {
  padding: .35rem .8rem; font-size: .95rem; border-radius: 12px; color: #fff; background: #7ce7ff14;
  border: 1px solid #7ce7ff66; box-shadow: 0 0 12px #4cc9ff33; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1);
}
.tray button:hover { background: #7ce7ff2a; }
@keyframes pop { from { transform: scale(0); } }
.mission .call-actions p { color: #c9d3ff; }
@media (max-width: 640px) {
  .mission { padding: 12px; border-radius: 20px; }
  .hud-label { display: none; }
  .word-card { left: 8%; right: 8%; width: auto; top: 10px; padding: 10px 12px; }
  .wc-emoji { font-size: 1.6rem; }
}

/* ---------- Notebook ---------- */
.notes-bar { display: flex; justify-content: space-between; margin: 10px 0 18px; }
.notebook {
  position: relative; background: #fff; border-radius: 6px 24px 24px 6px; padding: 40px 44px 44px 84px;
  box-shadow: var(--shadow), -6px 0 0 #f1e6d4;
  background-image: linear-gradient(90deg, transparent 62px, #ff6b5744 62px, #ff6b5744 64px, transparent 64px),
                    repeating-linear-gradient(transparent 0 31px, #4c7dff1a 31px 32px);
}
.notebook::before { /* binder holes */
  content: ""; position: absolute; left: 22px; top: 40px; bottom: 40px; width: 16px;
  background: radial-gradient(circle, var(--paper) 7px, transparent 8px) 0 0 / 16px 90px repeat-y;
}
.notes-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: start; margin-bottom: 22px; }
.notes-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: .2rem 0 .3rem; }
.level-badge { background: var(--sun); padding: .6rem 1rem; border-radius: 16px; transform: rotate(3deg); font-family: "Fredoka", sans-serif; font-weight: 700; text-align: center; box-shadow: var(--shadow); }
.level-badge small { display: block; font-family: "Nunito", sans-serif; font-weight: 700; font-size: .75rem; }
.summary { font-size: 1.1rem; background: #fff8e8; border-left: 5px solid var(--sun); padding: 14px 18px; border-radius: 0 14px 14px 0; }
.notes-section { margin-top: 30px; }
.notes-section h2 { display: flex; align-items: center; gap: .55rem; font-size: 1.35rem; margin-bottom: 12px; }
.notes-section h2 .dot { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); transform: rotate(45deg); }
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.word { border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; background: #fff; }
.word b { font-family: "Fredoka", sans-serif; font-size: 1.2rem; font-weight: 600; }
.word .tr { color: var(--teal); font-weight: 800; }
.word .type { font-size: .75rem; color: var(--ink-soft); font-weight: 700; margin-left: .3rem; }
.word p { margin-top: .3rem; color: var(--ink-soft); font-style: italic; }
.grammar { border-left: 4px solid var(--grape); padding: 4px 0 4px 16px; margin-bottom: 14px; }
.grammar ul { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--ink-soft); }
.fix { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.fix .said { text-decoration: line-through; text-decoration-color: var(--danger); color: var(--ink-soft); background: #fff1ef; padding: .45rem .8rem; border-radius: 12px; }
.fix .correct { background: #e9faf6; color: #0d7c70; padding: .45rem .8rem; border-radius: 12px; font-weight: 800; }
.fix .tip { grid-column: 1 / -1; font-size: .9rem; color: var(--ink-soft); margin-top: -4px; }
.notes-code { margin-bottom: 14px; }
.notes-code pre {
  margin: 0 0 6px; padding: .8rem 1rem; border-radius: 12px; background: #14152e; color: #a5f3c4; direction: ltr; text-align: left;
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; font-size: .95rem; white-space: pre-wrap; overflow-wrap: anywhere;
}
.notes-code p { color: var(--ink-soft); }
.notes-list { margin: 0; padding-left: 1.2rem; }
.notes-list li { margin-bottom: .35rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.transcript { margin-top: 30px; }
.transcript summary { cursor: pointer; font-weight: 800; color: var(--ink-soft); }
.transcript pre { white-space: pre-wrap; font-family: inherit; font-size: .9rem; color: var(--ink-soft); }

/* ---------- Messages ---------- */
#msg {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); margin: 0; max-width: calc(100% - 32px);
  background: var(--ink); color: #fff; padding: .7rem 1.2rem; border-radius: 14px; font-weight: 700; box-shadow: var(--shadow);
}
#msg:empty { display: none; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 10px; padding-top: 0; }
  .bubbles { height: 150px; }
  .b7, .b8, .b9 { display: none; }
  .launch { grid-template-columns: 1fr; padding: 26px; }
  .launch-bubbles { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .notebook { padding: 28px 18px 28px 46px; background-image: linear-gradient(90deg, transparent 32px, #ff6b5744 32px, #ff6b5744 34px, transparent 34px), repeating-linear-gradient(transparent 0 31px, #4c7dff1a 31px 32px); }
  .notebook::before { left: 8px; }
  .fix { grid-template-columns: 1fr; }
  .fix > span:nth-child(2) { display: none; }
}

@media print {
  body { background: #fff; }
  .topbar, #landing, #home, #call, #break, #auth, .notes-bar, #msg, .transcript { display: none !important; }
  main { padding: 0; }
  .notebook { box-shadow: none; padding: 0 0 0 20px; background-image: none; }
  .notebook::before { display: none; }
  .word, .fix, .grammar { break-inside: avoid; }
}

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

/* =====================================================================
   Subject portals (IT, maths, physics & chemistry): a sober, professional look.
   Everything below applies only while body[data-layout="subject"]; each portal sets its accent.
   ===================================================================== */
body[data-layout="subject"] {
  --ink: #0f172a;
  --ink-soft: #475569;
  --paper: #f8fafc;
  --line: #e2e8f0;
  --coral: #2563eb;
  --coral-dark: #1d4ed8;
  --sun: #2563eb;
  --teal: #0d9488;
  --sky: #2563eb;
  --grape: #6366f1;
  --radius: 12px;
  --shadow: 0 1px 2px #0f172a0f, 0 8px 24px -12px #0f172a26;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;
  --accent-glow: #2563eb26;
  --accent-light: #60a5fa;
  --accent-lighter: #93c5fd;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  background-color: var(--paper);
  background-image:
    linear-gradient(#0f172a08 1px, transparent 1px),
    linear-gradient(90deg, #0f172a08 1px, transparent 1px);
  background-size: 40px 40px;
}
body[data-layout="subject"] :is(h1, h2, h3, button, .button, .brand, .eyebrow, .student b, .student .face, .lesson h3,
  .classes-balance b, .call-student, .path-cta, .level-badge, .launch h2, .break h2, .caption,
  .word-card b, .video-loading, .student.add, .word b, .grammar h3, .notes-head h1) {
  font-family: "Inter", system-ui, sans-serif;
  letter-spacing: -0.01em;
}
body[data-layout="subject"] :is(pre, code, .wc-code, .hud-label, .timer, .hud-stat, .break-timer, .tray-label,
  .word-card small, .tray button, .terminal) {
  font-family: var(--mono);
  letter-spacing: 0;
}
body[data-layout="subject"] h1 { font-size: clamp(2.2rem, 4.4vw, 3.3rem); font-weight: 700; line-height: 1.08; }
body[data-layout="subject"] h2 { font-weight: 650; }
body[data-layout="subject"] .eyebrow { color: var(--coral); letter-spacing: .14em; font-weight: 600; font-size: .75rem; }
body[data-layout="subject"] .underline { background: none; color: var(--coral); }
body[data-layout="subject"] .brand-mark { transform: none; }

/* Controls: flat, rectangular, quiet. */
body[data-layout="subject"] :is(button, .button) { border-radius: 8px; font-weight: 600; font-size: .95rem; padding: .7rem 1.1rem; }
body[data-layout="subject"] .primary,
body[data-layout="subject"] .sun { background: var(--coral); color: #fff; box-shadow: 0 1px 2px var(--accent-glow); }
body[data-layout="subject"] .primary:hover,
body[data-layout="subject"] .sun:hover { background: var(--coral-dark); }
body[data-layout="subject"] .secondary { border: 1px solid #cbd5e1; color: var(--ink); background: #fff; }
body[data-layout="subject"] .secondary:hover { background: #f1f5f9; }
body[data-layout="subject"] .ghost { border: 1px solid var(--line); }
body[data-layout="subject"] .link { padding: .2rem 0; }
body[data-layout="subject"] .big { padding: .85rem 1.6rem; font-size: 1rem; }
body[data-layout="subject"] :is(input, select, textarea) { border-radius: 8px; border-width: 1px; font-family: "Inter", system-ui, sans-serif; }
body[data-layout="subject"] .lang-pick { border-width: 1px; border-radius: 8px; }
body[data-layout="subject"] .card { border-width: 1px; border-radius: var(--radius); }
body[data-layout="subject"] .chips-pick button { border-width: 1px; border-radius: 6px; font-family: "Inter", system-ui, sans-serif; font-weight: 500; font-size: .9rem; padding: .45rem .8rem; }
body[data-layout="subject"] .chips-pick button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--coral); color: var(--coral-dark); }
body[data-layout="subject"] .check input { accent-color: var(--coral); }

/* Intro: terminal instead of bubbles, no sticker. */
body[data-layout="subject"] .auth-card::before { content: none; }
body[data-layout="subject"] .hero { align-items: start; padding-top: 40px; }
.terminal { margin-top: 28px; border-radius: 12px; overflow: hidden; background: #0b1220; box-shadow: 0 20px 40px -20px #0f172a80; border: 1px solid #1e293b; direction: ltr; text-align: left; }
.terminal-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #111a2e; border-bottom: 1px solid #1e293b; }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #334155; }
.terminal-bar i:first-child { background: #f87171; }
.terminal-bar i:nth-child(2) { background: #fbbf24; }
.terminal-bar i:nth-child(3) { background: #34d399; }
.terminal-bar span { margin-left: 10px; color: #64748b; font-size: .78rem; }
.terminal pre { margin: 0; padding: 18px 20px 20px; color: #e2e8f0; font-size: .88rem; line-height: 1.75; white-space: pre-wrap; }
.t-prompt { color: var(--accent-light); }
.t-dim { color: #64748b; }
.t-key { color: #c4b5fd; }
.t-ok { color: #34d399; }
.t-cursor { color: var(--accent-light); animation: blink-cursor 1s steps(1) infinite; }
@keyframes blink-cursor { 50% { opacity: 0; } }

/* Home */
body[data-layout="subject"] .student { border-width: 1px; border-radius: 10px; box-shadow: none; }
body[data-layout="subject"] .student[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--coral); box-shadow: 0 0 0 3px var(--accent-glow); }
body[data-layout="subject"] .student .face { border-radius: 8px; font-weight: 600; font-size: 1.1rem; }
body[data-layout="subject"] .student.add { border-style: dashed; }
body[data-layout="subject"] .classes-balance b { color: var(--ink); font-weight: 700; font-size: 3rem; }
body[data-layout="subject"] .classes-balance { border-right-style: solid; border-right-width: 1px; }
body[data-layout="subject"] .pack { border-radius: 8px; }
body[data-layout="subject"] .ledger li { background: #f8fafc; border: 1px solid var(--line); }
body[data-layout="subject"] .launch { background: #0f172a; border-radius: var(--radius); }
body[data-layout="subject"] .launch h2 { font-size: 1.7rem; }
body[data-layout="subject"] .launch p { color: #94a3b8; }
body[data-layout="subject"] .launch .launch-half { color: var(--accent-lighter); }
body[data-layout="subject"] .launch-actions label { color: #94a3b8; }
body[data-layout="subject"] .launch-bubbles { display: none; }
body[data-layout="subject"] .lesson { border-width: 1px; border-radius: 10px; }
body[data-layout="subject"] button.lesson:hover { transform: none; border-color: var(--coral); }
body[data-layout="subject"] .lesson::before { width: 3px; border-radius: 0; top: 0; bottom: 0; }
body[data-layout="subject"] .chip { border-radius: 6px; background: #f1f5f9; font-weight: 600; }
body[data-layout="subject"] .chip.level { background: var(--accent-soft); color: var(--coral-dark); }
body[data-layout="subject"] .empty-state { border-width: 1px; border-radius: 10px; }

/* Session screen: a calm console. */
body[data-layout="subject"] .mission { background: #0b1220; border: 1px solid #1e293b; border-radius: 14px; box-shadow: 0 30px 60px -30px #0f172acc; }
body[data-layout="subject"] .starfield,
body[data-layout="subject"] .scanlines,
body[data-layout="subject"] .fx { display: none; }
body[data-layout="subject"] .holo { border-radius: 10px; box-shadow: 0 0 0 1px #1e293b; }
body[data-layout="subject"] .holo video { animation: none; }
body[data-layout="subject"] .holo.punch video { scale: 1; }
body[data-layout="subject"] .corner { width: 18px; height: 18px; border-width: 2px; border-color: #334155; filter: none; }
body[data-layout="subject"] .hud-label { top: 16px; left: 16px; padding: .25rem .55rem; border-radius: 6px; background: #0b1220d9; color: #cbd5e1; text-shadow: none; letter-spacing: .12em; font-weight: 600; }
body[data-layout="subject"] .corner.tl { display: none; }
body[data-layout="subject"] .live-pill { background: #0f172a; border: 1px solid #1e293b; color: #e2e8f0; border-radius: 6px; font-size: .8rem; }
body[data-layout="subject"] .hud-stat.points { display: none; } /* no points for professionals */
body[data-layout="subject"] :is(.hud-stat, .mission .timer) { background: #0f172a; border-color: #1e293b; color: #cbd5e1; border-radius: 6px; }
body[data-layout="subject"] .voice-bars i { background: var(--accent-light); box-shadow: none; }
body[data-layout="subject"] .you-talk { background: #0d9488; border-radius: 6px; animation: none; }
body[data-layout="subject"] .caption { background: #0f172ae6; border-radius: 8px; font-size: 1.05rem; font-weight: 500; backdrop-filter: none; }
body[data-layout="subject"] .caption.student { background: #0f766ee6; }
body[data-layout="subject"] .word-card {
  top: 16px; right: 16px; text-align: left; border-radius: 10px; border: 1px solid #1e293b; border-left: 3px solid var(--accent-light);
  background: #0f172af2; box-shadow: 0 12px 30px -12px #000c; animation: panel-in .35s ease-out;
}
body[data-layout="subject"] .word-card.code { border-left-color: #34d399; }
body[data-layout="subject"] .word-card small { color: var(--accent-light); letter-spacing: .14em; font-weight: 600; }
body[data-layout="subject"] .word-card.code small { color: #34d399; }
body[data-layout="subject"] .word-card b { font-size: 1.5rem; font-weight: 700; text-shadow: none; margin-top: 4px; }
body[data-layout="subject"] .wc-emoji { display: none; }
body[data-layout="subject"] .wc-tr { color: #cbd5e1; font-weight: 500; margin-top: 6px; }
body[data-layout="subject"] .word-card p { color: #94a3b8; font-style: normal; font-family: var(--mono); font-size: .8rem; }
body[data-layout="subject"] .wc-code { background: #020617; border-color: #1e293b; }
body[data-layout="subject"] .word-card.leaving { animation: panel-out .3s ease-in forwards; }
@keyframes panel-in { from { opacity: 0; transform: translateX(16px); } }
@keyframes panel-out { to { opacity: 0; transform: translateX(16px); } }
body[data-layout="subject"] .banner {
  left: 50%; right: auto; top: auto; bottom: 74px; transform: translateX(-50%); padding: .45rem 1rem; border-radius: 8px;
  font-size: .95rem; font-weight: 600; background: #0f766e; text-shadow: none; white-space: nowrap;
}
body[data-layout="subject"] .banner.go { animation: toast 1.9s ease forwards; }
@keyframes toast { 0% { opacity: 0; } 12%, 80% { opacity: 1; } 100% { opacity: 0; } }
body[data-layout="subject"] .tray-label { color: #94a3b8; letter-spacing: .12em; }
body[data-layout="subject"] .tray-empty { color: #64748b; }
body[data-layout="subject"] .tray button { border-radius: 6px; background: #0f172a; border-color: #1e293b; box-shadow: none; color: #e2e8f0; font-size: .85rem; animation: none; }
body[data-layout="subject"] .mission .call-actions p { color: #94a3b8; }
body[data-layout="subject"] .video-loading { background: #0b1220; font-size: 1rem; font-weight: 500; }
body[data-layout="subject"] .typing { background: #1e293b; border-radius: 8px; }
body[data-layout="subject"] .typing i { background: #94a3b8; }
body[data-layout="subject"] .break h2 { color: #f8fafc; }
body[data-layout="subject"] .break .eyebrow { color: var(--accent-light); }
body[data-layout="subject"] .break-timer { color: #f8fafc; text-shadow: none; font-weight: 600; }
body[data-layout="subject"] .light-link { color: var(--accent-lighter); }

/* Notes: a clean study document, no school notebook. */
body[data-layout="subject"] .notebook {
  padding: 44px 52px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; box-shadow: var(--shadow); background-image: none;
}
body[data-layout="subject"] .notebook::before { content: none; }
body[data-layout="subject"] .level-badge { transform: none; background: var(--accent-soft); color: var(--coral-dark); border-radius: 8px; box-shadow: none; border: 1px solid var(--accent-border); }
body[data-layout="subject"] .summary { background: #f8fafc; border-left-color: var(--coral); border-radius: 0 8px 8px 0; }
body[data-layout="subject"] .notes-section h2 { font-size: 1.15rem; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
body[data-layout="subject"] .notes-section h2 .dot { width: 8px; height: 8px; border-radius: 2px; transform: none; }
body[data-layout="subject"] .word { border-width: 1px; border-radius: 8px; }
body[data-layout="subject"] .word b { font-size: 1.05rem; font-weight: 700; }
body[data-layout="subject"] .word .explain { color: var(--ink); font-style: normal; margin-top: .35rem; }
body[data-layout="subject"] .word p { font-style: normal; }
body[data-layout="subject"] .notes-code pre { background: #0b1220; color: #e2e8f0; border-radius: 8px; border: 1px solid #1e293b; }
body[data-layout="subject"] .fix .said { border-radius: 6px; }
body[data-layout="subject"] .fix .correct { border-radius: 6px; font-weight: 600; }
@media (max-width: 820px) {
  body[data-layout="subject"] .notebook { padding: 24px 18px; }
}


/* Accents per subject portal (IT keeps the blue defaults). */
body[data-portal="maths"] {
  --coral: #7c3aed; --coral-dark: #6d28d9; --sun: #7c3aed; --sky: #7c3aed;
  --accent-soft: #f5f3ff; --accent-border: #ddd6fe; --accent-glow: #7c3aed26; --accent-light: #a78bfa; --accent-lighter: #c4b5fd;
}
body[data-portal="sci"] {
  --coral: #0d9488; --coral-dark: #0f766e; --sun: #0d9488; --sky: #0d9488;
  --accent-soft: #f0fdfa; --accent-border: #99f6e4; --accent-glow: #0d948826; --accent-light: #2dd4bf; --accent-lighter: #5eead4;
}
.path.maths .path-tag { background: #7c3aed; }
.path.maths .path-cta { color: #7c3aed; }
.path.sci .path-tag { background: #0d9488; }
.path.sci .path-cta { color: #0d9488; }

/* Maths and science: a board instead of the IT terminal, and formula cards. */
.board {
  margin-top: 28px; padding: 22px 26px 24px; border-radius: 12px; background-color: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow); direction: ltr; text-align: left;
  background-image: linear-gradient(#0f172a0a 1px, transparent 1px), linear-gradient(90deg, #0f172a0a 1px, transparent 1px);
  background-size: 24px 24px;
}
.board-label { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--coral); }
.board p { margin: .4rem 0 0; font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", Georgia, serif; font-size: 1.4rem; color: var(--ink); }
.board mark { background: var(--accent-soft); color: var(--coral-dark); padding: 0 .35rem; border-radius: 4px; }
.board .board-dim { color: var(--ink-soft); font-size: 1.1rem; }
.word-card.formula { width: min(56%, 420px); }
body[data-layout="subject"] .word-card.formula { border-left-color: var(--accent-light); }
body[data-layout="subject"] .word-card.formula small { color: var(--accent-light); }
.word-card.formula .wc-code { font-family: "Cambria Math", "STIX Two Math", Georgia, serif; font-size: 1.4rem; color: #f8fafc; }
.notes-code.formula pre { font-family: "Cambria Math", "STIX Two Math", Georgia, serif; font-size: 1.2rem; }
.worked { margin-bottom: 14px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.worked h3 { font-size: 1rem; margin-bottom: .4rem; }
.worked ol { margin: 0 0 .4rem; padding-left: 1.3rem; color: var(--ink-soft); font-family: "Cambria Math", "STIX Two Math", Georgia, serif; }
.worked .answer { font-weight: 700; color: var(--coral-dark); }


/* ---------- Account chip and phone top bar ---------- */
.who { font-size: .85rem; font-weight: 600; color: var(--ink-soft); max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .brand { font-size: 1.15rem; }
  .brand-mark { width: 34px; height: 34px; }
  .topbar-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
  .topbar-actions :is(.small, .button) { padding: .4rem .7rem; font-size: .85rem; }
  body[data-layout="subject"] .topbar-actions :is(.small, .button) { padding: .4rem .7rem; font-size: .85rem; }
  .lang-pick select { max-width: 8.5rem; font-size: .85rem; }
  .who { display: none; }
}

/* ---------- Lessons need classes ---------- */
#start:disabled { opacity: .45; cursor: not-allowed; }
.start-hint { color: #ffd98a; font-weight: 700; max-width: 14rem; }

/* ---------- Blackboard next to the teacher (maths, physics & chemistry) ---------- */
body:is([data-portal="maths"], [data-portal="sci"]) #call {
  max-width: 1240px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 16px; align-items: stretch;
}
body:is([data-portal="maths"], [data-portal="sci"]) #call > :is(.call-head, .word-tray, .call-actions) { grid-column: 1 / -1; }
.lesson-board {
  contain: size; min-height: 0; overflow-y: auto; border-radius: 10px; padding: 0 18px 18px;
  background: radial-gradient(ellipse at 30% 20%, #2c3e35 0%, #1c2a23 60%, #16211b 100%);
  box-shadow: inset 0 0 0 6px #6b4a2b, inset 0 0 0 8px #3f2a17, inset 0 0 40px #0008;
  direction: ltr; text-align: left;
}
.board-head { position: sticky; top: 8px; z-index: 1; margin: 8px -10px 10px; padding: 8px 10px 8px; background: #1f2e26; border-bottom: 1px solid #ffffff1a; }
.board-head span { font-family: var(--mono); font-size: .72rem; letter-spacing: .2em; color: #a7c4b5; }
.board-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.board-lines li { animation: chalk-in .45s ease-out; }
@keyframes chalk-in { from { opacity: 0; transform: translateY(6px); } }
.board-say .board-main { font-family: "Kalam", "Comic Sans MS", cursive; font-weight: 400; font-size: 1.12rem; line-height: 1.45; color: #eef3ee; }
.board-you .board-main { font-family: "Kalam", cursive; font-weight: 400; font-size: 1rem; color: #93c5fd; }
.board-formula { padding: 8px 12px; border-left: 3px solid #fde68a; background: #ffffff0a; border-radius: 4px; }
.board-formula .board-main { display: block; font-family: "Cambria Math", "STIX Two Math", Georgia, serif; font-size: 1.55rem; color: #fde68a; }
.board-concept .board-main { font-family: "Kalam", cursive; font-weight: 700; font-size: 1.2rem; color: #a7f3d0; }
.board-concept .board-main::before { content: "★ "; }
.board-detail { display: block; margin-top: 2px; font-family: "Kalam", cursive; font-size: .98rem; color: #c9d6cf; }
@media (max-width: 820px) {
  body:is([data-portal="maths"], [data-portal="sci"]) #call { display: block; }
  .lesson-board { contain: none; height: 46vh; margin-top: 14px; }
}


/* =====================================================================
   LAKADEMY landing page: navy and gold, serif headings, ivory paper.
   Applies only on the landing page (no portal chosen).
   ===================================================================== */
body:not([data-portal]) {
  --ink: #111827; --ink-soft: #4b5563; --line: #e7e2d6; --navy: #0f1b3d; --gold: #c9a227; --gold-light: #f2d27a;
  background: #faf7f0; font-family: "Inter", system-ui, sans-serif;
}
body:not([data-portal]) :is(h1, h2, h3, .brand) { font-family: "Fraunces", Georgia, serif; letter-spacing: -0.01em; }
body:not([data-portal]) :is(button, .button, .eyebrow, .path-tag, .path-cta, .lang-pick select) { font-family: "Inter", system-ui, sans-serif; }
body:not([data-portal]) .brand { font-weight: 600; font-size: 1.4rem; letter-spacing: .06em; }
body:not([data-portal]) .brand b { color: #a16207; font-weight: 700; }
body:not([data-portal]) .brand-mark { transform: none; }
body:not([data-portal]) :is(.lang-pick, .ghost) { border-width: 1px; border-radius: 8px; }
body:not([data-portal]) .ghost { font-weight: 600; }

.academy-hero {
  position: relative; overflow: hidden; margin-top: 10px; padding: 72px 56px 64px; border-radius: 18px; color: #f8f5ec; text-align: center;
  background:
    radial-gradient(ellipse at 50% -20%, #c9a22755 0%, transparent 55%),
    linear-gradient(#ffffff08 1px, transparent 1px) 0 0 / 100% 36px,
    linear-gradient(160deg, #13224b 0%, #0f1b3d 55%, #0a1330 100%);
  box-shadow: 0 30px 60px -30px #0f1b3dcc;
}
.academy-hero::before, .academy-hero::after {
  content: ""; position: absolute; left: 50%; width: 120px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); transform: translateX(-50%);
}
.academy-hero::before { top: 34px; }
.academy-hero::after { bottom: 30px; }
.academy-hero .eyebrow { color: var(--gold-light); letter-spacing: .28em; font-size: .72rem; font-weight: 600; }
.academy-hero h1 { margin: 18px auto 18px; max-width: 20ch; font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 600; line-height: 1.04; color: #fff; }
.academy-hero h1 em { font-style: italic; color: var(--gold-light); font-weight: 500; }
.academy-hero .lead { margin: 0 auto; max-width: 40rem; color: #cfd6e6; font-size: 1.12rem; }
.academy-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.academy-gold { background: linear-gradient(180deg, #e3bd4c, #c9a227); color: #1b1404; border-radius: 8px; font-weight: 700; box-shadow: 0 8px 20px -8px #c9a227aa; }
.academy-gold:hover { background: #e3bd4c; }
.academy-ghost { border: 1px solid #ffffff4d; color: #fff; border-radius: 8px; font-weight: 600; }
.academy-ghost:hover { background: #ffffff14; }

.academy-stats {
  list-style: none; margin: -26px auto 0; padding: 18px 10px; max-width: 920px; position: relative; display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px -18px #0f1b3d55;
}
.academy-stats li { display: grid; justify-items: center; gap: 2px; padding: 4px 10px; text-align: center; border-left: 1px solid var(--line); }
.academy-stats li:first-child { border-left: 0; }
.academy-stats b { font-family: "Fraunces", Georgia, serif; font-size: 1.7rem; font-weight: 600; color: var(--navy); }
.academy-stats span { font-size: .85rem; color: var(--ink-soft); }

.academy-section-head { margin: 64px auto 26px; text-align: center; max-width: 40rem; scroll-margin-top: 20px; }
.academy-section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 600; color: var(--navy); }
.academy-section-head h2::after { content: ""; display: block; width: 56px; height: 2px; margin: 14px auto 0; background: var(--gold); }
.academy-section-head p { margin-top: 12px; color: var(--ink-soft); }

body:not([data-portal]) .path { border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px #0f1b3d0d, 0 12px 28px -18px #0f1b3d40; }
body:not([data-portal]) .path h2 { font-family: "Fraunces", Georgia, serif; font-size: 1.3rem; font-weight: 600; color: var(--navy); }
body:not([data-portal]) .path > .path-tag { background: none; color: #a16207; padding: 0; border-radius: 0; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; }
body:not([data-portal]) .path > .path-cta { color: var(--navy); font-weight: 600; font-size: .95rem; }
body:not([data-portal]) a.path:hover { transform: translateY(-3px); border-color: var(--gold); }
body:not([data-portal]) .path img { filter: saturate(.92); }
body:not([data-portal]) .path.soon { background: transparent; border-style: dashed; }
body:not([data-portal]) .path-icon { border-radius: 50%; background: var(--navy); color: var(--gold-light); font-family: "Fraunces", Georgia, serif; }

.academy-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.academy-steps li { padding: 26px 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.numeral { display: block; font-family: "Fraunces", Georgia, serif; font-size: 2.4rem; font-weight: 600; line-height: 1; color: var(--gold); }
.academy-steps h3 { margin: 12px 0 8px; font-size: 1.2rem; font-weight: 600; color: var(--navy); }
.academy-steps p { color: var(--ink-soft); font-size: .95rem; }

.academy-prices { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.price { min-width: 220px; padding: 26px 30px; display: grid; justify-items: center; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.price b { font-family: "Fraunces", Georgia, serif; font-size: 2.6rem; font-weight: 600; color: var(--navy); line-height: 1.1; }
.price span { color: var(--ink-soft); font-weight: 600; }
.price.best { border: 1px solid var(--gold); box-shadow: 0 0 0 3px #c9a22726; }
.price small { color: #a16207; font-weight: 700; }

.academy-footer { margin: 70px 0 0; padding-top: 22px; border-top: 1px solid var(--line); text-align: center; color: var(--ink-soft); font-size: .9rem; font-family: "Fraunces", Georgia, serif; }

@media (max-width: 820px) {
  .academy-hero { padding: 54px 22px 50px; }
  .academy-stats { grid-template-columns: repeat(2, 1fr); margin-top: 16px; gap: 10px 0; }
  .academy-stats li:nth-child(3) { border-left: 0; }
  .academy-steps { grid-template-columns: 1fr; }
}


/* =====================================================================
   Birretes: ratings from 0 to 5 graduation caps, for lessons, courses and teachers.
   ===================================================================== */
.birretes { position: relative; display: inline-flex; vertical-align: middle; line-height: 0; }
.birretes .caps { display: inline-flex; gap: 2px; white-space: nowrap; }
.birretes svg { width: 1.2em; height: 1.2em; flex: none; fill: currentColor; }
.birretes .tassel, .cheer .tassel { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.birretes .off { color: #c9cfdc; }
.birretes .on { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: #d4a017; }
.birretes.edit { gap: 2px; align-items: center; line-height: 1; }
.birretes.edit button { padding: 3px; border: 0; background: none; box-shadow: none; color: #c9cfdc; border-radius: 8px; }
.birretes.edit button svg { width: 32px; height: 32px; }
.birretes.edit button.lit { color: #d4a017; }
.birretes.edit:hover button:not(.zero) { color: #e8bd3a; }
.birretes.edit button:not(.zero):hover ~ button { color: #c9cfdc; }
.birretes.edit .zero { width: 30px; height: 30px; margin-right: 4px; padding: 0; border: 2px solid #c9cfdc; border-radius: 50%; font-size: .85rem; font-weight: 800; color: #8a90a2; }
.birretes.edit .zero[aria-pressed="true"] { border-color: var(--danger); color: var(--danger); }
[data-rating-track] { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--ink-soft); }
[data-rating-track] b { color: var(--ink); }
.path-rating { margin: 2px 0 4px; }
.opt-rating { margin-top: 3px; font-size: .72rem; color: #fff; gap: 4px; }
.opt-rating b { color: #fff; }
.opt-rating .birretes .off { color: #ffffff45; }
.lesson .birretes { justify-self: start; font-size: .9rem; }

.rate-last { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; background: #fffbea; border-color: #ecd27a; }
.rate-ask { font-weight: 800; }
.rate-last #rateLater { margin-left: auto; font-size: 1.1rem; }
.notes-rate { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; padding: 10px 16px; border-radius: 14px; background: #fffbea; border: 1px solid #ecd27a; font-weight: 700; }
.notes-rate #shareLesson { margin-left: auto; }
.link.quiet { color: var(--ink-soft); font-family: "Inter", system-ui, sans-serif; font-weight: 600; font-size: .85rem; }
.community-link { background: #0f1b3d; color: #f2d27a; border-radius: 8px; }
.community-link:hover { background: #1b2a57; }
@media print { .notes-rate { display: none; } }

/* ---------- Landing: the community teaser ---------- */
.social-teaser { list-style: none; margin: 0 0 26px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.social-teaser li { padding: 26px 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-align: center; }
.teaser-icon { font-size: 2.2rem; line-height: 1; }
.social-teaser h3 { margin: 12px 0 6px; font-size: 1.2rem; font-weight: 600; color: var(--navy); }
.social-teaser p { color: var(--ink-soft); font-size: .95rem; }

/* =====================================================================
   LAKADEMY community: feed, posts, comments, profiles. Academy look (navy and gold).
   ===================================================================== */
.community { --navy: #0f1b3d; --gold: #c9a227; --gold-light: #f2d27a; }
.community-hero, .profile-hero, .join-card {
  color: #f8f5ec; border-radius: 18px;
  background:
    radial-gradient(ellipse at 80% -30%, #c9a22755 0%, transparent 55%),
    linear-gradient(160deg, #13224b 0%, #0f1b3d 55%, #0a1330 100%);
  box-shadow: 0 30px 60px -34px #0f1b3dcc;
}
.community-hero { margin-top: 10px; padding: 38px 40px 32px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.community-hero .eyebrow, .profile-hero .eyebrow { color: var(--gold-light); letter-spacing: .24em; font-size: .72rem; }
.community-hero h1 { margin: .4rem 0 .6rem; color: #fff; font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 600; }
.community-hero .lead { max-width: 36rem; color: #cfd6e6; }
.act-as { min-width: 210px; color: var(--gold-light); }
.act-as select { background: #ffffff14; color: #fff; border: 1px solid #ffffff4d; border-radius: 8px; }
.act-as option { color: #111827; }
.community :is(input, select, textarea) { border-width: 1px; border-radius: 8px; font-family: "Inter", system-ui, sans-serif; }
.community :is(input, select, textarea):focus { border-color: var(--gold); box-shadow: 0 0 0 3px #c9a22733; }
.community textarea { width: 100%; }
.community :is(input, select) { min-width: 0; max-width: 100%; }
.community-main, .community-grid > *, .post > *, .comments > *, .comment-list li > div { min-width: 0; }
a:has(> .avatar-dot) { text-decoration: none; }

.community-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; margin-top: 24px; align-items: start; }
.composer, .post, .side-card, .course-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px #0f1b3d0d, 0 12px 28px -22px #0f1b3d40; }
.composer { padding: 18px; display: grid; gap: 14px; scroll-margin-top: 16px; }
.composer-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.composer-tabs button, .feeling-pick button { padding: .45rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: #faf7f0; color: var(--ink); font-size: .9rem; }
.composer-tabs button[aria-pressed="true"], .feeling-pick button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--gold-light); }
.composer-part { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.composer-part .grow { flex: 1 1 190px; }
.mark-pair { display: flex; align-items: center; gap: 6px; }
.mark-pair input { width: 6.5rem; }
.mark-pair > span { font-size: 1.4rem; color: var(--ink-soft); }
.feeling-pick { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.badge-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-pick > button { padding: 0; border: 2px solid transparent; border-radius: 14px; background: none; }
.badge-pick > button[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 3px #c9a22733; }
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.composer-foot small { flex: 1 1 260px; }

.feed { display: grid; gap: 16px; margin-top: 18px; }
.more-feed { display: flex; margin: 18px auto 0; }
.post { padding: 18px 20px; display: grid; gap: 12px; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-who { flex: 1; display: grid; line-height: 1.3; }
.post-who a, .comment-list a { color: var(--navy); text-decoration: none; }
.post-who small { color: var(--ink-soft); font-size: .82rem; }
.post-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.avatar-dot { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-family: "Fraunces", Georgia, serif; font-size: 1.2rem; font-weight: 600; }
.avatar-dot.small { width: 32px; height: 32px; font-size: .95rem; }
.avatar-dot.big { width: 92px; height: 92px; font-size: 2.6rem; box-shadow: 0 0 0 4px var(--gold); }

.mark-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 18px 22px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #13224b, #0f1b3d); }
.mark-big { font-family: "Fraunces", Georgia, serif; font-size: 3rem; font-weight: 600; line-height: 1; color: var(--gold-light); }
.mark-big small { font-size: 1.2rem; color: #cfd6e6; }
.mark-what { display: grid; }
.mark-what b { font-size: 1.15rem; }
.mark-what span { color: #cfd6e6; font-size: .92rem; }
.mark-verdict { font-family: "Fraunces", Georgia, serif; font-style: italic; font-size: 1.1rem; color: var(--gold-light); }
.mark-card.keepGoing .mark-big { color: #fff; }

.badge-card { display: inline-flex; align-items: center; gap: 14px; padding: 12px 20px 12px 12px; border: 1px solid #ecd27a; border-radius: 12px; background: linear-gradient(135deg, #fff8e1, #fdf0bf); text-align: start; color: var(--ink); }
.badge-card .medal { flex: none; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; font-size: 1.7rem; background: var(--navy); box-shadow: 0 0 0 3px var(--gold); }
.badge-card b { display: block; font-family: "Fraunces", Georgia, serif; font-size: 1.12rem; font-weight: 600; color: var(--navy); }
.badge-card small { color: #7a5d0a; font-weight: 600; }

.lesson-post { display: grid; gap: 8px; padding: 16px 18px; border-radius: 12px; background: #faf7f0; border-left: 4px solid #ff6b57; }
.lesson-post.pro { border-left-color: #2563eb; }
.lesson-post.maths { border-left-color: #7c3aed; }
.lesson-post.sci { border-left-color: #0d9488; }
.lesson-post h3 { margin: 0; font-family: "Fraunces", Georgia, serif; font-size: 1.25rem; font-weight: 600; color: var(--navy); }
.feeling { font-size: .9rem; font-weight: 700; color: #a16207; }
.lesson-post-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lesson-post-meta small { color: var(--ink-soft); }

.post-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
.post-actions button { gap: .4rem; padding: .4rem .8rem; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); font-family: "Inter", system-ui, sans-serif; font-size: .9rem; font-weight: 600; }
.post-actions button:hover { background: #faf7f0; }
.post-actions b { color: var(--ink); }
.cheer svg { width: 1.35em; height: 1.35em; fill: currentColor; }
.cheer[aria-pressed="true"] { color: #a16207; background: #fdf2c4; }
.cheer.pop svg { animation: cap-toss .6s ease-out; }
@keyframes cap-toss { 45% { transform: translateY(-12px) rotate(-20deg); } }

.share-sheet { display: grid; gap: 10px; padding: 14px; border-radius: 10px; background: #faf7f0; }
.share-note { font-size: .85rem; color: var(--ink-soft); }
.share-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn { padding: .5rem 1rem; border: 0; border-radius: 8px; color: #fff; font-family: "Inter", system-ui, sans-serif; font-size: .9rem; font-weight: 600; text-decoration: none; }
.share-btn.linkedin { background: #0a66c2; }
.share-btn.facebook { background: #1877f2; }
.share-btn.x { background: #111; }
.share-btn.whatsapp { background: #25d366; color: #05361b; }
.share-btn.instagram { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af, #515bd4); }
.share-btn.copy { background: #fff; color: var(--ink); border: 1px solid var(--line); }

.comments { display: grid; gap: 10px; }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.comment-list li { display: flex; align-items: flex-start; gap: 10px; }
.comment-list li > div { flex: 1; padding: 8px 12px; border-radius: 10px; background: #faf7f0; overflow-wrap: anywhere; }
.comment-list small { color: var(--ink-soft); }
.comment-form { display: flex; gap: 8px; }
.comment-form input { flex: 1; min-width: 0; padding: .55rem .8rem; }

.community-side { position: sticky; top: 16px; display: grid; gap: 16px; }
.side-card { padding: 18px; }
.side-card h3, .community-h2, .course-card h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; color: var(--navy); }
.side-card h3 { margin: 0 0 4px; }
.side-card > p { margin-bottom: 12px; font-size: .88rem; }
.academy-outline { border: 1px solid var(--navy); border-radius: 8px; background: #fff; color: var(--navy); }
.academy-outline:hover { background: #faf7f0; }
.rating-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rating-list li { display: flex; align-items: center; gap: 10px; }
.rating-list img { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: top; }
.rating-list li > span { display: grid; gap: 2px; font-size: .9rem; }

.back-link { display: inline-block; margin: 14px 0; color: var(--navy); font-weight: 600; text-decoration: none; }
.profile-hero { display: flex; align-items: center; gap: 24px; padding: 30px; }
.profile-hero h1 { margin: .2rem 0 .7rem; color: #fff; font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 600; }
.profile-stats { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; flex-wrap: wrap; }
.profile-stats li { color: #cfd6e6; font-size: .9rem; }
.profile-stats b { display: block; font-family: "Fraunces", Georgia, serif; font-size: 1.6rem; font-weight: 600; color: var(--gold-light); }
.share-courses { margin: 18px 0 4px; }
.share-courses input { accent-color: var(--gold); }
.only-you { font-size: .88rem; }
.community-h2 { margin: 28px 0 12px; font-size: 1.5rem; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.course-card { display: flex; gap: 14px; padding: 16px; }
.course-card img { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: top; }
.course-card > div { flex: 1; display: grid; gap: 4px; }
.course-card h3 { margin: 0; font-size: 1.1rem; }
.course-tag { font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #a16207; }
.course-card p { font-size: .88rem; }
.course-bar { height: 6px; border-radius: 99px; overflow: hidden; background: #eee7d8; }
.course-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.course-card small { color: var(--ink-soft); }
.course-card small.done { color: #a16207; font-weight: 700; }
.badge-row { display: flex; gap: 4px; font-size: 1.3rem; }

.public-post { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; margin-top: 20px; align-items: start; }
.join-card { display: grid; gap: 12px; padding: 24px; }
.join-card h2 { color: #fff; font-family: "Fraunces", Georgia, serif; font-weight: 600; }
.join-card p { color: #cfd6e6; }

@media (max-width: 820px) {
  .social-teaser { grid-template-columns: 1fr; }
  .community-grid, .public-post { grid-template-columns: minmax(0, 1fr); }
  .community-side { position: static; }
  .community-hero { padding: 28px 20px; }
  .act-as { width: 100%; }
  .mark-card { grid-template-columns: auto 1fr; }
  .mark-verdict { grid-column: 1 / -1; }
  .profile-hero { padding: 22px; gap: 16px; }
  .avatar-dot.big { width: 68px; height: 68px; font-size: 2rem; }
  .notes-rate #shareLesson { margin-left: 0; }
}


/* ---------- Lesson notebook: compact list ---------- */
.notebook-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.notebook-tools input { flex: 1 1 220px; min-width: 0; padding: .55rem .9rem; }
.lesson-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.lesson-filters button { padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: .85rem; gap: .35rem; }
.lesson-filters button b { color: var(--ink-soft); font-weight: 700; }
.lesson-filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.lesson-filters button[aria-pressed="true"] b { color: #ffffffb3; }
.lessons { display: grid; grid-template-columns: 1fr; gap: 0; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.lessons > .empty-state { margin: 0; border: 0; }
.lesson-month { margin: 0; padding: 10px 18px 6px; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); background: #faf6ee; border-bottom: 1px solid var(--line); }
.lesson-row {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 16px; text-align: start;
  background: #fff; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none;
  font-family: "Nunito", sans-serif; font-weight: 400; font-size: 1rem; border-left: 4px solid #ff6b57;
}
.lesson-row.pro { border-left-color: #2563eb; }
.lesson-row.maths { border-left-color: #7c3aed; }
.lesson-row.sci { border-left-color: #0d9488; }
.lesson-row:last-child { border-bottom: 0; }
button.lesson-row:hover { background: #fdfaf4; transform: none; }
button.lesson-row:active { transform: none; }
.lesson-row time { flex: none; width: 42px; display: grid; justify-items: center; line-height: 1.05; color: var(--ink-soft); }
.lesson-row time b { font-size: 1.35rem; color: var(--ink); }
.lesson-row time small { font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.lesson-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.lesson-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lesson-title .teacher-tag { flex: none; margin: 0; }
.lesson-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.02rem; }
.lesson-row .chips { gap: .3rem; }
.lesson-row .chip { font-size: .74rem; padding: .05rem .5rem; }
.lesson-row .birretes { flex: none; font-size: .85rem; }
.lesson-row .status { justify-self: start; }
.lesson-open { flex: none; font-size: 1.5rem; color: var(--ink-soft); line-height: 1; }
.lessons-more { display: flex; margin: 12px auto 0; }
body[data-layout="subject"] .lessons { border-width: 1px; border-radius: 10px; }
body[data-layout="subject"] .lesson-row { font-family: "Inter", system-ui, sans-serif; }
body[data-layout="subject"] .lesson-month { background: #f8fafc; }
body[data-layout="subject"] button.lesson-row:hover { background: var(--accent-soft); }
@media (max-width: 620px) {
  .lesson-row { flex-wrap: wrap; gap: 6px 12px; }
  .lesson-main { flex-basis: calc(100% - 60px); }
  .lesson-row .birretes { margin-left: 54px; }
  .lesson-open { display: none; }
}


/* ---------- Progress & predictions ---------- */
.progress-entry { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 16px 20px; }
.progress-entry > div { flex: 1; }
.progress-entry h3 { margin: 0 0 2px; }
.progress-entry p { font-size: .92rem; }
.progress-icon { font-size: 2rem; }
.progress-head { margin: 10px 0 18px; }
.progress-head h1 { margin: .2rem 0 .4rem; }
.progress-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.assess-card, .curve-card, .marks-card, .history-card { display: grid; gap: 12px; }
.assess-card h2, .curve-card h2, .marks-card h2, .history-card h2 { font-size: 1.3rem; }
.assess-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.assess-form .wide { grid-column: 1 / -1; }
.assess-form :is(input, select), .mark-form :is(input, select) { min-width: 0; width: 100%; }
.assess-card .primary { justify-self: start; }
.curve-svg { width: 100%; height: auto; display: block; }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-axis { font-size: 11px; fill: var(--ink-soft); font-family: inherit; }
.c-bar { fill: #e9e3f7; }
.c-mark-line { fill: none; stroke: #d4a017; stroke-width: 2.5; }
.c-mark { fill: #d4a017; stroke: #fff; stroke-width: 2; }
.c-pred-line { fill: none; stroke: #1e3a8a; stroke-width: 2; stroke-dasharray: 6 5; }
.c-pred { fill: #1e3a8a; stroke: #fff; stroke-width: 2; }
.curve-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-soft); }
.curve-legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 3px; }
.lg-bar::before { background: #e9e3f7; }
.lg-mark::before { background: #d4a017; border-radius: 50% !important; }
.lg-pred::before { background: #1e3a8a; transform: rotate(45deg) scale(.8); }
.curve-empty { padding: 30px 0; text-align: center; }

#assessResult:not(:empty) { margin-bottom: 18px; scroll-margin-top: 16px; }
.assessing { display: flex; align-items: center; gap: 12px; padding: 22px; border: 2px dashed var(--line); border-radius: var(--radius); font-weight: 700; color: var(--ink-soft); }
.assess-result { display: grid; gap: 16px; padding: 24px; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.assess-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.score { display: grid; gap: 6px; align-content: start; padding: 16px; border-radius: 14px; background: linear-gradient(160deg, #13224b, #0f1b3d); color: #fff; }
.score-label { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #f2d27a; }
.score b { font-size: 2.6rem; line-height: 1; font-family: "Fraunces", Georgia, serif; font-weight: 600; }
.score b small { font-size: 1rem; color: #cfd6e6; }
.score > small { color: #cfd6e6; }
.score .birretes { font-size: 1.3rem; }
.score .birretes .off { color: #ffffff38; }
.coverage-bar { height: 10px; border-radius: 99px; background: #ffffff26; overflow: hidden; margin-top: 8px; }
.coverage-bar i { display: block; height: 100%; background: linear-gradient(90deg, #c9a227, #f2d27a); }
.confidence { justify-self: start; margin-top: 6px; padding: .1rem .6rem; border-radius: 99px; font-size: .78rem; font-weight: 700; background: #ffffff1f; }
.confidence.low { background: #f59e0b33; color: #fde68a; }
.confidence.high { background: #10b98133; color: #a7f3d0; }
.assess-summary { font-size: 1.08rem; font-weight: 600; }
.assess-block h3 { margin: 0 0 6px; font-size: 1.05rem; }
.assess-block ul, .assess-block ol { margin: 0; padding-left: 1.2rem; display: grid; gap: 4px; }
.assess-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.topic-list { list-style: none; padding: 0 !important; display: flex !important; flex-wrap: wrap; gap: 8px !important; }
.topic-list li { display: inline-flex; align-items: center; gap: 8px; padding: .3rem .7rem; border-radius: 10px; border: 1px solid var(--line); font-weight: 600; font-size: .9rem; }
.topic-list small { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.topic-list .mastered { background: #ecfdf5; border-color: #a7f3d0; } .topic-list .mastered small { color: #047857; }
.topic-list .progressing { background: #eff6ff; border-color: #bfdbfe; } .topic-list .progressing small { color: #1d4ed8; }
.topic-list .weak { background: #fff7ed; border-color: #fed7aa; } .topic-list .weak small { color: #c2410c; }
.topic-list .not_seen { background: #f8fafc; border-style: dashed; } .topic-list .not_seen small { color: #64748b; }
.gap-list { list-style: none; padding: 0 !important; }
.gap-list li { padding-left: 14px; border-left: 4px solid #cbd5e1; }
.gap-list li.high { border-left-color: #e5484d; }
.gap-list li.medium { border-left-color: #f59e0b; }
.assess-meta { font-size: .82rem; color: var(--ink-soft); }

.mark-list, .assess-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mark-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.m-date { flex: none; width: 6.5rem; font-size: .82rem; color: var(--ink-soft); font-weight: 700; }
.m-what { flex: 1; min-width: 0; display: grid; }
.m-what small { color: var(--ink-soft); }
.m-mark { font-weight: 800; font-size: 1.2rem; }
.m-mark small { font-size: .8rem; color: var(--ink-soft); }
.marks-card h3 { margin: 6px 0 0; font-size: 1rem; }
.mark-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.mark-form .grow { flex: 1 1 160px; }
.marks-card > .secondary { justify-self: start; }
.assess-history button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: start; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; color: var(--ink); box-shadow: none; font-weight: 400; font-family: inherit;
}
.assess-history button:hover { border-color: var(--ink-soft); }
.assess-history button > span:first-child { flex: 1; display: grid; min-width: 0; }
.assess-history small { color: var(--ink-soft); font-size: .8rem; }
.hist-num { font-weight: 800; }
.hist-mark { font-weight: 800; font-size: 1.15rem; min-width: 3.4rem; text-align: end; }
body[data-layout="subject"] .assess-result { border-width: 1px; border-radius: 12px; }
@media (max-width: 820px) {
  .progress-grid, .assess-two, .assess-scores, .assess-form { grid-template-columns: minmax(0, 1fr); }
  .progress-entry { flex-wrap: wrap; }
}

/* Landing: four feature cards */
.social-teaser { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .social-teaser { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .social-teaser { grid-template-columns: 1fr; } }

.lesson-sort { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.lesson-sort select { padding: .45rem .7rem; font-size: .9rem; }


/* ---------- Blackboard: typeset formulas and drawings ---------- */
.board-formula .katex { color: #fde68a; font-size: 1.35em; }
.board-formula .katex-display { margin: .2em 0; text-align: start; }
.board-formula .katex-display > .katex { text-align: start; }
.board-diagram figure { margin: 4px 0; padding: 10px; border: 1px dashed #ffffff40; border-radius: 8px; }
.board-diagram img { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; }
.board-diagram figcaption { margin-top: 6px; text-align: center; font-family: "Kalam", cursive; color: #c9d6cf; }
.formula-tex { overflow-x: auto; padding: 6px 0; }
.formula-tex .katex-display { margin: 0; text-align: start; }

/* ---------- End-of-lesson check ---------- */
.check-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.check-scores > div { display: grid; gap: 4px; padding: 14px; border-radius: 12px; background: #f0fdfa; border: 1px solid #99f6e4; }
.check-scores span { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #0f766e; }
.check-scores b { font-size: 2rem; line-height: 1; }
.check-scores b small { font-size: .9rem; color: var(--ink-soft); }
.check-change { font-weight: 700; margin-bottom: 10px; }
.check-questions { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.check-questions li { display: flex; gap: 10px; align-items: flex-start; }
.check-questions li > span:last-child { display: grid; }
.check-questions small { color: var(--ink-soft); }
.q-mark { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; color: #fff; background: #94a3b8; }
.check-questions .right .q-mark { background: #10b981; }
.check-questions .partly .q-mark { background: #f59e0b; }
.check-questions .wrong .q-mark { background: #e5484d; }
.check-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.check-list h3 { margin: 0 0 4px; font-size: 1rem; }
.check-list ul { margin: 0; padding-left: 1.1rem; }
.check-list.improved h3 { color: #047857; }
.check-list.work h3 { color: #c2410c; }
.chip.check { background: #ccfbf1; color: #0f766e; }
.c-check-line { fill: none; stroke: #0d9488; stroke-width: 2; }
.c-check { fill: #0d9488; stroke: #fff; stroke-width: 1.5; }
.lg-check::before { background: #0d9488; }
@media (max-width: 820px) { .check-scores, .check-cols { grid-template-columns: 1fr; } }

/* The board is the lesson's page: taller and wider than the video, like a book next to the teacher. */
body:is([data-portal="maths"], [data-portal="sci"]) #call { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
body:is([data-portal="maths"], [data-portal="sci"]) #call > .video-stage { align-self: start; }
body:is([data-portal="maths"], [data-portal="sci"]) .lesson-board { contain: none; height: min(74vh, 720px); }
.board-head { z-index: 5; }
.board-lines { position: relative; z-index: 0; }


/* ---------- Subscription and on-demand classes ---------- */
.sub-box > div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; }
.sub-offer { background: #fffbea; border: 1px solid #ecd27a; }
.sub-offer > span { flex: 1 1 240px; display: grid; }
.sub-offer small, .sub-active small { color: var(--ink-soft); }
.sub-active { background: #ecfdf5; border: 1px solid #a7f3d0; }
.sub-active > b { color: #047857; }
.sub-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.price.sub { text-decoration: none; color: inherit; border: 1px solid #0f1b3d; }
.price.sub small { color: #0f1b3d; }
.od-subscribe { display: grid; gap: 8px; justify-items: start; color: #f2d27a; font-weight: 600; }
.od-grid { display: grid; gap: 28px; margin-top: 24px; }
.od-teacher > header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.od-teacher > header img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: top; box-shadow: 0 0 0 3px var(--gold); }
.od-teacher h2 { font-family: "Fraunces", Georgia, serif; font-weight: 600; color: var(--navy); }
.od-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.od-card { display: grid; gap: 6px; align-content: start; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); text-decoration: none; box-shadow: 0 1px 2px #0f1b3d0d, 0 12px 28px -22px #0f1b3d40; transition: transform .15s, border-color .15s; }
.od-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.od-card h3 { margin: 0; font-family: "Fraunces", Georgia, serif; font-weight: 600; color: var(--navy); font-size: 1.08rem; }
.od-card p { font-size: .88rem; color: var(--ink-soft); }
.od-level { justify-self: start; padding: .1rem .5rem; border-radius: 6px; background: #faf7f0; font-size: .75rem; font-weight: 700; color: #a16207; }
.od-meta { margin-top: auto; font-size: .85rem; font-weight: 700; color: var(--navy); }
.od-card.locked { opacity: .92; }
.od-title { margin: 6px 0 2px; font-family: "Fraunces", Georgia, serif; color: var(--navy); font-size: clamp(1.8rem, 4vw, 2.4rem); }
.od-locked { margin-top: 18px; padding: 24px; border-radius: 14px; background: #fff; border: 1px solid var(--line); display: grid; gap: 12px; justify-items: start; }
.od-stage { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; margin-top: 16px; align-items: start; }
.od-left { display: grid; gap: 10px; }
#odVideo { width: 100%; border-radius: 14px; background: #000; aspect-ratio: 16 / 9; }
.od-caption { min-height: 3em; padding: 10px 14px; border-radius: 10px; background: #0f1b3d; color: #f8f5ec; font-size: 1rem; }
.od-caption:empty { display: none; }
.od-novideo { padding: 14px; border-radius: 10px; background: #fffbea; border: 1px solid #ecd27a; }
.od-left h3 { margin: 6px 0 0; font-family: "Fraunces", Georgia, serif; color: var(--navy); }
.od-chapters { margin: 0; padding-left: 1.4rem; display: grid; gap: 2px; }
.od-chapters button { padding: .2rem .4rem; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; font-size: .9rem; text-align: start; box-shadow: none; }
.od-chapters button:hover { background: #faf7f0; }
.od-chapters button.current { background: #fdf2c4; font-weight: 700; }
.od-board { height: min(72vh, 680px); }
.od-item, .od-step { margin-bottom: 12px; animation: chalk-in .45s ease-out; }
.od-step p { font-family: "Kalam", cursive; color: #eef3ee; font-size: 1.05rem; line-height: 1.45; margin-top: 6px; }
.od-figure { margin: 0; padding: 10px; border: 1px dashed #ffffff40; border-radius: 8px; }
.od-figure img { display: block; width: 100%; height: auto; }
.od-figure figcaption { margin-top: 6px; text-align: center; font-family: "Kalam", cursive; color: #c9d6cf; }
.od-code { padding: 8px 12px; border-left: 3px solid #7dd3fc; background: #0b1220aa; border-radius: 4px; }
.od-code pre { margin: 0; overflow-x: auto; font-family: var(--mono, "JetBrains Mono", monospace); font-size: .85rem; color: #e2e8f0; white-space: pre; }
.od-word { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; padding: 8px 12px; border-left: 3px solid #a7f3d0; background: #ffffff0a; border-radius: 4px; }
.od-emoji { grid-row: span 2; font-size: 1.8rem; }
.od-word b { font-family: "Kalam", cursive; font-size: 1.25rem; color: #fde68a; }
.od-word span:last-child { font-family: "Kalam", cursive; color: #c9d6cf; }
.od-board .board-formula, .od-board .board-concept { display: grid; }
@media (max-width: 1000px) { .od-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .od-stage { grid-template-columns: minmax(0, 1fr); }
  .od-cards { grid-template-columns: minmax(0, 1fr); }
  .od-board { height: 60vh; }
}
.od-board { padding: 0 24px 18px; overflow-x: hidden; }
.od-board .board-lines, .od-item { min-width: 0; max-width: 100%; }
.od-board .board-formula { overflow-x: auto; }
.od-board .board-formula .katex { font-size: 1.15em; }
.od-board .katex-display { margin: .2em 0; text-align: start; }
