:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --ink: #1d2126;
  --ink-2: #5b6470;
  --ink-3: #8b939d;
  --line: #e2e0da;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --warn: #8a5a1c;
  --bad: #9b3232;
  --good: #2f6d3f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(29, 33, 38, .06), 0 4px 16px rgba(29, 33, 38, .05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171a;
    --surface: #1c2023;
    --surface-2: #23282c;
    --ink: #e9eaec;
    --ink-2: #a8b0b8;
    --ink-3: #7b838c;
    --line: #2e343a;
    --accent: #6ab5a0;
    --accent-ink: #10201c;
    --warn: #d8a860;
    --bad: #e08585;
    --good: #7fc094;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px 64px; }

/* ---- header ---- */
header.top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.top-in { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { font-weight: 650; letter-spacing: -.01em; text-decoration: none; color: var(--ink); font-size: 15px; }
.brand span { color: var(--ink-3); font-weight: 400; }
nav.main { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
nav.main a {
  padding: 6px 11px; border-radius: 7px; text-decoration: none;
  color: var(--ink-2); font-size: 14px; font-weight: 500;
}
nav.main a:hover { background: var(--surface-2); color: var(--ink); }
nav.main a.on { background: var(--accent); color: var(--accent-ink); }
.who { font-size: 13px; color: var(--ink-3); }

/* ---- type ---- */
h1 { font-size: 24px; letter-spacing: -.02em; margin: 26px 0 4px; }
h2 { font-size: 17px; letter-spacing: -.01em; margin: 26px 0 10px; }
h3 { font-size: 15px; margin: 18px 0 6px; }
.sub { color: var(--ink-2); font-size: 14px; margin: 0 0 18px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

/* ---- cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card h2, .card h3 { margin-top: 0; }
.grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } }

/* ---- agenda ---- */
ul.agenda { list-style: none; margin: 0; padding: 0; }
ul.agenda li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 8px 0; border-top: 1px solid var(--line);
}
ul.agenda li:first-child { border-top: 0; }
.time { flex: 0 0 82px; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-2); padding-top: 1px; }
.dot { flex: 0 0 8px; height: 8px; width: 8px; border-radius: 50%; margin-top: 7px; background: var(--accent); }
.it-title { font-weight: 500; font-size: 15px; }
.it-meta { font-size: 12.5px; color: var(--ink-3); }

.tag {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 20px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.tag.exam { color: var(--bad); border-color: currentColor; }
.tag.deadline { color: var(--warn); border-color: currentColor; }
.tag.ok { color: var(--good); border-color: currentColor; }

/* ---- week grid ---- */
.week { display: grid; gap: 10px; }
@media (min-width: 900px) { .week { grid-template-columns: repeat(7, 1fr); } }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 90px; }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.day h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.day h4 b { color: var(--ink); font-size: 14px; letter-spacing: 0; text-transform: none; }
.chip {
  display: block; font-size: 12.5px; padding: 5px 7px; border-radius: 6px;
  background: var(--surface-2); border-left: 3px solid var(--accent); margin-bottom: 5px;
  color: var(--ink);
}
.chip b { font-weight: 600; }
.chip .t { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---- forms ---- */
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: 9px 10px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.row { display: grid; gap: 10px; }
@media (min-width: 620px) {
  .row.two { grid-template-columns: 1fr 1fr; }
  .row.three { grid-template-columns: 1fr 1fr 1fr; }
}
.check { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-size: 14px; color: var(--ink-2); }
.check input { width: auto; }

button, .btn {
  display: inline-block; font: inherit; font-size: 14px; font-weight: 550;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button.ghost, .btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
button.danger, .btn.danger { background: transparent; color: var(--bad); border-color: currentColor; }
button.tiny, .btn.tiny { padding: 4px 9px; font-size: 12.5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: center; }

/* ---- notices ---- */
.notice {
  background: var(--surface); border: 1px solid var(--accent); border-left-width: 4px;
  padding: 10px 14px; border-radius: 8px; margin: 16px 0; font-size: 14px;
}
.notice.warn { border-color: var(--warn); }
.notice.bad { border-color: var(--bad); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
pre { background: var(--surface-2); border: 1px solid var(--line); padding: 12px; border-radius: 8px; overflow-x: auto; }
code.pw { font-size: 17px; letter-spacing: .06em; background: var(--surface-2); padding: 3px 8px; border-radius: 6px; }

/* ---- prose (study guides) ---- */
.prose { max-width: 70ch; }
.prose h1 { font-size: 22px; margin-top: 28px; }
.prose h2 { font-size: 18px; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.prose h3 { font-size: 15.5px; }
.prose p, .prose li { font-size: 15.5px; line-height: 1.65; }
.prose blockquote { border-left: 3px solid var(--line); margin: 16px 0; padding: 2px 0 2px 14px; color: var(--ink-2); }
.prose table { margin: 16px 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

.pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.pills a {
  font-size: 13px; padding: 5px 11px; border-radius: 20px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
}
.pills a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

details summary { cursor: pointer; font-size: 14px; font-weight: 550; color: var(--ink-2); padding: 6px 0; }
details[open] summary { margin-bottom: 8px; }

.empty { color: var(--ink-3); font-size: 14px; font-style: italic; }
footer.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 18px 0; color: var(--ink-3); font-size: 12.5px; }

/* ---- MYP tutor -------------------------------------------------------- */
.sechead{margin:26px 0 10px;font-size:15px}
.grid.units{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px}
.unit-card{display:block;text-decoration:none;color:inherit}
.unit-card:hover{border-color:#7b93ad}
.unit-top{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.muted-card{opacity:.82}
.crit-row{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}
.crit{display:inline-block;font-size:11px;font-weight:700;color:#fff;border-radius:5px;padding:4px 7px;letter-spacing:.02em}
.crit i{font-style:normal;font-weight:400;opacity:.93}
.cA{background:#2f6fb5}.cB{background:#a9631a}.cC{background:#7c3a99}.cD{background:#2f7a4f}
.bar{height:4px;border-radius:2px;background:rgba(127,127,127,.25);overflow:hidden;margin:9px 0 6px}
.bar i{display:block;height:100%;background:#4f6d8f;border-radius:2px}
.notice.warn{border-left:4px solid #a9631a}
ul.tight{margin:8px 0 0;padding-left:18px}
ul.tight li{margin:4px 0}

.card.teach ul{margin:6px 0 0;padding-left:19px}
.card.teach li{margin:7px 0}
.card.teach b{background:rgba(79,109,143,.16);padding:1px 4px;border-radius:3px}

.card.q{margin-top:12px}
.q-top{display:flex;gap:9px;align-items:baseline;flex-wrap:wrap}
.qn{font-variant-numeric:tabular-nums;font-weight:700;opacity:.55;min-width:1.4em}
.qt{font-size:15.5px}
ul.opts{list-style:none;margin:10px 0;padding:0;display:flex;flex-direction:column;gap:6px}
ul.opts li{border:1px solid rgba(127,127,127,.3);border-radius:8px;padding:9px 11px}
ul.opts li label{display:block;cursor:pointer}
ul.opts.done li.right{border-color:#2f7a4f;background:rgba(47,122,79,.12)}
ul.opts.done li.wrong{border-color:#a8341f;background:rgba(168,52,31,.12)}
.verdict{margin:8px 0 0;padding:9px 11px;border-radius:8px;background:rgba(127,127,127,.1)}
.verdict.ok{background:rgba(47,122,79,.14)}
.verdict.no{background:rgba(168,52,31,.13)}
.verdict span{opacity:.85}
.model{margin-top:10px;padding:11px 13px;border-radius:8px;border:1px dashed rgba(127,127,127,.4)}
.model h4{margin:0 0 5px;font-size:13px}
.model p{margin:0}
blockquote.answer{margin:8px 0;padding:9px 12px;border-left:3px solid rgba(127,127,127,.4);white-space:pre-wrap}
.markbox{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:10px;padding-top:10px;border-top:1px solid rgba(127,127,127,.22)}
.markbox label{font-size:13px;opacity:.75}
.markbox input[type=text]{flex:1;min-width:190px}
.foot-note{margin-top:22px;opacity:.75}

/* ---- revision plan ---------------------------------------------------- */
.focus{font-size:16px;margin:2px 0 14px;padding-left:12px;border-left:3px solid #4f6d8f}
.weeknav{margin:0 0 16px;align-items:center;gap:8px;flex-wrap:wrap}
.card.subj{margin-top:12px}
.subj-top{display:flex;align-items:baseline;gap:10px;margin-bottom:8px}
.subj-top h3{margin:0;font-size:16px}
.subj-top h3 a{text-decoration:none}
ul.tasks{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:9px}
ul.tasks li{display:flex;gap:10px;align-items:flex-start}
ul.tasks li.done .taskbody{opacity:.55}
ul.tasks li.done .taskbody > span{text-decoration:line-through;text-decoration-color:#2f7a4f}
.tickform{flex:none;margin:0}
.tick{flex:none;display:inline-flex;align-items:center;justify-content:center;
  width:22px;height:22px;margin-top:1px;padding:0;border-radius:5px;cursor:pointer;
  border:2px solid rgba(127,127,127,.5);background:transparent;font-size:13px;line-height:1;color:#fff}
.tick.on{background:#2f7a4f;border-color:#2f7a4f}
.taskbody{flex:1;min-width:0}
.cw{font-weight:600}
.tag.tough{background:rgba(169,99,26,.18);color:#a9631a}
.paperlinks{display:flex;gap:10px;flex-wrap:wrap;margin-top:4px;font-size:13px}
.scoreform{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin-top:6px}
.scoreform label{font-size:13px;opacity:.75}

.tallies{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:14px 0}
.card.tal{padding:12px 14px}
.tal .k{font-size:11px;letter-spacing:.07em;text-transform:uppercase;opacity:.7}
.tal .v{font-size:24px;font-weight:700;margin:4px 0 6px;font-variant-numeric:tabular-nums}
.tal .v span{font-size:14px;font-weight:400;opacity:.6}
.ragbar{display:flex;height:6px;border-radius:3px;overflow:hidden;background:rgba(127,127,127,.2);margin-bottom:5px}
.ragbar i{display:block;height:100%}
.ragbar .r{background:#a8341f}.ragbar .a{background:#c8901e}.ragbar .g{background:#2f7a4f}

table.rag{width:100%;border-collapse:collapse;font-size:14px}
table.rag th,table.rag td{padding:7px 9px;border-bottom:1px solid rgba(127,127,127,.22);text-align:left}
table.rag th{font-size:11px;letter-spacing:.06em;text-transform:uppercase;opacity:.7}
table.rag th:not(:first-child),table.rag td.ragcell{text-align:center;width:66px}
.topicname{min-width:15em}
.ragform{display:inline-flex;gap:3px;margin:0}
.ragform button{width:17px;height:17px;padding:0;border-radius:50%;cursor:pointer;
  border:2px solid rgba(127,127,127,.45);background:transparent}
.ragform .rag-r.on{background:#a8341f;border-color:#a8341f}
.ragform .rag-a.on{background:#c8901e;border-color:#c8901e}
.ragform .rag-g.on{background:#2f7a4f;border-color:#2f7a4f}
.ragform button:hover{border-color:#4f6d8f}
.ragdot{display:inline-block;width:11px;height:11px;border-radius:50%;margin-right:7px;vertical-align:-1px;
  border:2px solid rgba(127,127,127,.45)}
.ragdot.rag-r{background:#a8341f;border-color:#a8341f}
.ragdot.rag-a{background:#c8901e;border-color:#c8901e}
.ragdot.rag-g{background:#2f7a4f;border-color:#2f7a4f}
ul.topiclist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.card.warnbox{border-left:4px solid #a9631a}
td.num{font-variant-numeric:tabular-nums}

/* ---- Calendar: month and day views -------------------------------------- */
/* A month in the single-column phone layout would be thirty-five screens of scrolling, so the
   month grid stays seven-wide at every width and the cells go compact instead. */
.monthhead { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 0 0 4px; }
.monthhead span { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); text-align: center; }
.week.month { grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week.month .day { min-height: 58px; padding: 5px 4px; }
.week.month .day h4 { margin: 0 0 3px; }
.week.month .day h4 b { font-size: 12px; }
.week.month .day.out { opacity: .42; }
.week.month .chip { font-size: 10px; padding: 2px 4px; margin-top: 3px; line-height: 1.25; }
.week.month .chip .t { display: none; }
.week.month .empty { display: none; }
@media (min-width: 900px) {
  .week.month .day { min-height: 92px; }
  .week.month .chip .t { display: inline; }
}
.week.dayview { grid-template-columns: 1fr; }
.week.dayview .day { min-height: 0; }

/* ---- What's due ---------------------------------------------------------- */
.duegroup { padding: 12px 14px; margin-bottom: 10px; }
.duegroup.urgent { border-left: 4px solid var(--bad); }
.duegroup.soon { border-left: 4px solid var(--warn); }
.duehead { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.duelist { list-style: none; margin: 0; padding: 0; }
.duelist li { padding: 6px 0; border-top: 1px solid var(--line); }
.duelist li:first-child { border-top: 0; }
.duetitle { font-weight: 600; }
.who-chip {
  display: inline-block; font-size: 11px; padding: 1px 7px; margin-right: 6px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2);
}
.foot-note { margin-top: 14px; }

/* ---- Syllabus ------------------------------------------------------------ */
.syl { padding: 12px 14px; margin-bottom: 12px; }
.sylhead { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.sylhead h2 { margin: 0; font-size: 17px; }
ol.topics { margin: 0; padding-left: 22px; }
ol.topics li { padding: 3px 0; }

/* ---- Tutor: sections, sources, typed answers ------------------------------ */
.card.toc ol { margin: 4px 0 0; padding-left: 20px; }
.card.toc li { padding: 2px 0; }
.card.toc li .t { margin-left: 6px; }
h2.sec { margin: 26px 0 8px; font-size: 18px; }
.q .src { border-left: 3px solid var(--line); background: var(--surface-2, rgba(127,127,127,.07));
          padding: 8px 12px; margin: 0 0 10px; font-size: 14px; }
.q .src table { border-collapse: collapse; margin: 6px 0; }
.q .src td, .q .src th { border: 1px solid var(--line); padding: 3px 8px; text-align: left; }
.q .src svg { max-width: 100%; height: auto; }
.typedform { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.typedform input[type=text] { max-width: 220px; }
.devakbd { flex-basis: 100%; margin-top: 4px; }
.devakbd summary { cursor: pointer; font-size: .9em; opacity: .8; }
.devakbd .krow { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.devakbd .key { min-width: 0; width: 2.1em; padding: 5px 0; font-size: 1.1em; line-height: 1.2; background: transparent; color: inherit; border: 1px solid currentColor; border-radius: 6px; opacity: .9; }
.devakbd .key.sign { opacity: .75; }
.devakbd .key.wide { width: auto; padding: 5px 10px; font-size: .9em; }
.q .typed { margin: 8px 0 4px; }
.q .look { margin-top: 6px; }
.sylunit { padding: 8px 0; border-top: 1px solid var(--line); }
.sylunit:first-of-type { border-top: 0; }
.sylunit.past { opacity: .6; }
.sylunit-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.sylunit ul.topics { margin: 4px 0 0; padding-left: 20px; }
.card.glossary summary { cursor: pointer; }
.card.glossary dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0 4px; font-size: 14px; }
.card.glossary dt { font-weight: 600; }
.card.glossary dd { margin: 0; color: var(--ink-2); }
@media (max-width: 560px) { .card.glossary dl { grid-template-columns: 1fr; } .card.glossary dd { margin-bottom: 6px; } }
.kwline { margin: 8px 0 6px; font-size: 13px; }
.kwchip { display: inline-block; padding: 1px 8px; margin: 2px 3px 2px 0; border: 1px solid var(--line); border-radius: 999px; }
.kwchip.used { border-color: var(--good); color: var(--good); }
.kwchip.missing { border-style: dashed; color: var(--ink-3); }
.kwcount { margin-top: 4px; }

/* ---- Learn mode: modules and parts (the shape Vikram chose, 27-Sep) ------- */
.learn { --lv: #5b4a9b; --lv-soft: #efedf6; --lv-ink: #26203d; --lcard: #faf9fd;
         max-width: 860px; margin: 0 auto; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .learn { --lv: #b3a4ec; --lv-soft: #25213a; --lv-ink: #ece8fb; --lcard: #1b1829; } }
:root[data-theme="dark"] .learn { --lv: #b3a4ec; --lv-soft: #25213a; --lv-ink: #ece8fb; --lcard: #1b1829; }
.learn .eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--lv); font-weight: 700; margin: 18px 0 6px; }
.learn .lt { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-size: clamp(28px, 6vw, 42px); line-height: 1.1; margin: 0 0 8px; color: var(--lv-ink); }
.learn .lsub { color: var(--ink-2); font-size: 16px; margin: 0 0 8px; max-width: 62ch; }
.learn .squiggle { width: 100%; height: 18px; color: var(--lv); margin: 6px 0 14px; }
.learn .lmeta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 18px; }
.learn .markpill { display: inline-block; border: 1.5px solid var(--lv); color: var(--lv); background: var(--lv-soft); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.learn .lbtn { display: inline-block; background: var(--lv); color: #fff; border-radius: 999px; padding: 10px 18px; font-weight: 600; text-decoration: none; }
.learn .lbtn.soft { opacity: .75; }
.learn .lpill { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; text-decoration: none; color: var(--ink); background: var(--surface); }
.learn .mgrid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .learn .mgrid { grid-template-columns: 1fr 1fr; } }
.learn .mcard { display: block; background: var(--lcard); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; text-decoration: none; color: inherit; }
.learn .mcard:hover { border-color: var(--lv); }
.learn .mtop { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.learn .mletter { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--lv); color: #fff; font-family: Georgia, serif; font-size: 22px; }
.learn .mcount { color: var(--ink-2); font-size: 14px; }
.learn .mcard h2 { font-family: Georgia, "Iowan Old Style", serif; font-size: 21px; margin: 0 0 6px; color: var(--lv-ink); }
.learn .mcard p { margin: 0; color: var(--ink-2); font-size: 15px; }
.learn .mbar, .learn .lprog { height: 6px; border-radius: 3px; background: var(--lv-soft); overflow: hidden; margin: 12px 0 6px; }
.learn .mbar i, .learn .lprog i { display: block; height: 100%; background: var(--lv); }
.learn .mcard .mfoot { font-size: 13px; }
.learn .ltop { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.learn .ltitle { flex: 1; font-family: Georgia, serif; font-size: 18px; color: var(--lv-ink); min-width: 12ch; }
.learn .readfirst { background: var(--lcard); border: 1px solid var(--line); border-left: 4px solid var(--lv); border-radius: 16px; padding: 4px 22px 14px; margin: 16px 0 18px; }
.learn .readfirst .rf { margin: 10px 0; font-size: 16.5px; line-height: 1.55; }
.learn .readfirst .rf b { color: var(--lv); font-family: Georgia, serif; }
.learn .readfirst.again ul { margin: 6px 0 4px; padding-left: 20px; }
.learn .card.q { border-radius: 16px; padding: 16px 20px; background: var(--surface); }
.learn .card.q .qn { color: var(--lv); font-family: Georgia, serif; font-size: 18px; }
.learn .card.q .qt { font-size: 16.5px; }
.learn .card.q button[type=submit] { background: var(--lv); border-color: var(--lv); border-radius: 999px; }
.learn .lnav { display: flex; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.learn .lglossary { margin: 22px 0 8px; background: var(--lcard); border: 1px solid var(--line); border-radius: 16px; padding: 12px 18px; }
.learn .lglossary summary { cursor: pointer; font-weight: 600; }
.learn .lglossary dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; }
.learn .lglossary dd { margin: 0; color: var(--ink-2); }
@media (max-width: 560px) { .learn .lglossary dl { grid-template-columns: 1fr; } }
.learn .lfoot { margin-top: 18px; font-size: 14px; }
.learn .stages { display: flex; gap: 6px; list-style: none; padding: 0; margin: 14px 0 0; flex-wrap: wrap; }
.learn .stages li { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--ink-2); background: var(--surface); }
.learn .stages li b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--lv-soft); color: var(--lv); font-size: 11px; margin-right: 4px; }
.learn .stages li.on { border-color: var(--lv); color: var(--lv-ink); font-weight: 700; }
.learn .stages li.on b { background: var(--lv); color: #fff; }
.learn .stages li.done { opacity: .6; }
.learn .teachbox { padding: 8px 26px 18px; }
.learn .teachbox .rf { font-size: 18px; line-height: 1.6; margin: 14px 0; }
.learn details.readfirst summary { cursor: pointer; padding: 10px 0 6px; }

/* ---- Calm tutor: fewer things on screen (Vikram, 27-Sep: "too cluttered") --- */
header.top.focus .top-in { justify-content: space-between; }
header.top.focus .exit { color: var(--ink-2); text-decoration: none; font-size: 14px; }
.learn.calm { max-width: 640px; }
.learn.calm .lt { font-size: clamp(26px, 6vw, 36px); }
.learn.calm .lsub { margin-bottom: 18px; }
.learn .lbtn.big { display: block; text-align: center; font-size: 18px; padding: 14px 20px; margin: 4px 0 26px; }
.learn .mlist { list-style: none; margin: 0; padding: 0; }
.learn .mlist li a { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.learn .mlist li a.here .mname { font-weight: 700; }
.learn .mlist .mletter { width: 34px; height: 34px; font-size: 17px; border-radius: 8px; flex: none; }
.learn .mlist .mname { flex: 1; font-size: 17px; }
.learn .mlist .mstate { color: var(--ink-3); font-size: 14px; }
.learn.calm .ltop { justify-content: space-between; }
.learn.calm .markpill { font-size: 13px; padding: 4px 11px; }
.learn.calm .card.q { border: 0; box-shadow: none; background: var(--lcard); padding: 18px 18px; margin-bottom: 14px; }
.learn.calm .card.q .q-top { display: block; }
.learn.calm .card.q .qn { display: none; }
.learn.calm .card.q .qt { font-size: 18px; font-weight: 600; line-height: 1.4; }
.learn.calm .opts li label { display: block; padding: 12px 14px; font-size: 16px; }
.learn.calm .teachbox { border: 0; border-left: 4px solid var(--lv); border-radius: 12px; }
.learn.calm details.readfirst { border: 0; background: none; padding: 0; margin: 6px 0 14px; }
.learn.calm details.readfirst summary { color: var(--lv); font-size: 14px; }
.learn.calm .lfoot { font-size: 13px; color: var(--ink-3); margin-top: 22px; }
.learn.calm .lglossary { margin-top: 8px; }
.learn.calm .mcard { padding: 18px 20px; }
.learn.calm .mcard h2 { font-size: 20px; }
.learn.calm .ltitle { font-size: 16px; }
.learn.calm .card.q .q-top { display: flex; gap: 12px; align-items: baseline; }
.learn.calm .card.q .qn { display: inline; }
.learn.calm .readfirst { border: 1px solid var(--line); border-left: 4px solid var(--lv); border-radius: 16px; background: var(--lcard); padding: 4px 22px 14px; margin: 16px 0 18px; }
.learn.calm .opts li label { padding: 2px 0; }
.learn pre.codeblock, .q .src pre.codeblock { background: var(--surface-2, rgba(127,127,127,.08)); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; overflow-x: auto; white-space: pre; }
.learn code { font-size: .92em; background: var(--surface-2, rgba(127,127,127,.1)); padding: 1px 4px; border-radius: 4px; }
.learn .tryit { margin: 0 0 18px; }
.learn .tryit-code { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.45; border-radius: 12px; padding: 12px; }
.learn .tryit-view { width: 100%; height: 240px; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-top: 8px; }
.learn details.tryit { background: var(--lcard); border: 1px solid var(--line); border-radius: 16px; padding: 10px 18px; margin: 0 0 18px; }
.learn details.tryit summary { cursor: pointer; color: var(--lv); font-weight: 600; }
.learn details.tryit[open] summary { margin-bottom: 10px; }
.learn .tryit-view { height: 180px; }
.q .listen { margin: 0 0 12px; }
.q .listen audio { width: 100%; }
.q .listen details summary { cursor: pointer; color: var(--lv, var(--accent)); font-size: 14px; margin-top: 4px; }
.q .aimark { background: var(--lv-soft, rgba(91,74,155,.08)); border-radius: 12px; padding: 10px 14px; margin-top: 10px; }
.q .aimark .aiscore { margin: 0 0 4px; font-size: 17px; }
.q .aimark ul { margin: 0; padding-left: 20px; }

/* ---- Homework ------------------------------------------------------------ */
.hwlist li.hw { display: flex; gap: 10px; align-items: flex-start; }
.hwbody { flex: 1; min-width: 0; }
.hwtick { margin: 0; }
.tickbox {
  width: 26px; height: 26px; padding: 0; margin-top: 2px; border-radius: 6px;
  background: transparent; color: var(--good); border: 2px solid var(--ink-3);
  font-size: 16px; line-height: 1; font-weight: 700;
}
.tickbox.on { border-color: var(--good); }
.hw.done .duetitle, .hw.done .t { text-decoration: line-through; opacity: .65; }
.hw .it-meta b.bad { color: var(--bad); }
.hwedit summary { cursor: pointer; font-size: 12.5px; margin-top: 4px; }
.hwform { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; }
.hwform label { display: flex; flex-direction: column; font-size: 12.5px; gap: 2px; }
.hwform label.wide { flex: 1 1 220px; }
.hwdel { margin-top: 6px; }
details.card > summary { cursor: pointer; }
