/* White, black, and one accent (the orange of the lesson sheets). */
:root {
  --bg: #ffffff; --ink: #0b0b0c; --muted: #5d6067; --line: #e6e6e8; --soft: #f6f6f7;
  --accent: #e8590c; --accent-soft: #fff1e8;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
a { color: var(--ink); }
button { font: inherit; cursor: pointer; }
.btn { display: inline-block; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; border-radius: 999px;
  padding: .55em 1.3em; font-weight: 600; text-decoration: none; }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.ghost { background: none; color: var(--ink); }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; }

/* header */
.top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
.brand i { font-style: normal; color: var(--accent); }
.enrol { border: 1.5px solid var(--accent); background: var(--accent); color: #fff; border-radius: 999px;
  padding: .4em 1.1em; font-weight: 600; }
.enrol.done { background: none; color: var(--ink); border-color: var(--line); cursor: default; }

/* ---------- home: minimal ---------- */
.home { max-width: 980px; margin: 0 auto; padding: 0 24px 96px; }
.hero { padding: 16vh 0 72px; }
.kicker { font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 22px; }
.hero h1 { font-size: clamp(44px, 7.4vw, 92px); line-height: 1.02; letter-spacing: -.045em; font-weight: 800; margin: 0 0 26px; }
.hl { position: relative; display: inline-block; z-index: 0; }
.scribble { position: absolute; left: -3%; width: 106%; bottom: -.02em; height: .62em; z-index: -1; overflow: visible; }
.mark { fill: none; stroke: var(--accent); stroke-width: 22; stroke-linecap: round; opacity: .32;
  stroke-dasharray: 420; stroke-dashoffset: 420; animation: mark .9s cubic-bezier(.6, .1, .3, 1) .35s forwards; }
.mark.two { stroke-width: 9; opacity: .5; animation-delay: .95s; animation-duration: .7s; }
@keyframes mark { to { stroke-dashoffset: 0; } }
.hero .sub { font-size: 21px; color: var(--muted); max-width: 620px; margin: 0 0 34px; text-wrap: balance; }
.cta { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; }
.cta .btn { font-size: 18px; padding: .75em 1.7em; }
.quiet { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1.5px solid var(--line); }
.quiet:hover { border-color: var(--accent); }
/* the two levels (2026-11-03): /start/ asks which one ("Start solving"); every problem has the switch at the top */
.home.start { padding-top: clamp(40px, 12vh, 140px); } /* .home.start: the phones' .home padding comes later */
.start h1 { font-size: clamp(34px, 5.4vw, 56px); line-height: 1.05; letter-spacing: -.035em; font-weight: 800; margin: 0 0 30px; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); grid-auto-rows: 1fr; gap: 10px; max-width: 960px; } /* equal tiles, full names */
.lvcard { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; min-height: 64px; box-sizing: border-box; border: 1.5px solid var(--line);
  border-radius: 12px; color: var(--ink); text-decoration: none; background: var(--bg); transition: border-color .15s, background .15s; }
.lvcard:hover { border-color: var(--accent); background: var(--accent-soft); }
.lvcard b { font-size: 16px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; }
.lvcard small { color: var(--accent); font-size: 13px; font-weight: 700; white-space: nowrap; }
.lvcard small:empty { display: none; }
.start .disclaimer { max-width: 960px; margin: 22px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.start .disclaimer b { color: var(--ink); }
.start .hint { color: var(--muted); font-size: 14px; margin: 20px 0 0; }
.levels { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 18px; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); }
.seg a { padding: .28em 1em; border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg a:hover { color: var(--ink); }
.seg a[aria-current] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.levels small { color: var(--muted); font-size: 13px; }
@media (max-width: 600px) { .pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lvcard { padding: 10px 12px; min-height: 60px; } .lvcard b { font-size: 15px; } }
.proof { color: var(--muted); font-size: 16px; margin: 26px 0 0; }
.proof b { color: var(--ink); font-size: 18px; }
@media (max-width: 600px) { /* a phone: "2.3k+ learners · Name joined", then "110+ discussions" on its own line */
  .proof [data-talk]:not([hidden]) { display: block; margin-top: 2px; }
  .proof [data-talk] .dot { display: none; }
}
[data-ticker] b { color: var(--accent); display: inline-block; transition: opacity .35s, transform .35s; }
[data-ticker] b.fade { opacity: 0; transform: translateY(-4px); }
.attended { color: var(--muted); font-size: 15px; margin-top: 4px; min-height: 1.6em; }
.attended b { color: var(--ink); }
.modules { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.modules a { display: flex; align-items: baseline; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; font-size: 19px; font-weight: 600; }
.modules a:hover { color: var(--accent); }
.modules .n { font-size: 13px; color: var(--accent); font-weight: 700; letter-spacing: .06em; min-width: 22px; }
.modules small { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 14px; }

/* ---------- cohort (problem pages) ---------- */
.wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
.side { border-right: 1px solid var(--line); padding: 16px 12px; height: calc(100vh - 57px); overflow: auto;
  position: sticky; top: 57px; font-size: 15px; }
.side details { margin-bottom: 6px; }
.side summary { cursor: pointer; padding: 6px 8px 6px 22px; border-radius: 8px; list-style: none; position: relative; }
.side summary::-webkit-details-marker { display: none; }
.side summary::before { content: "▸"; position: absolute; left: 6px; color: var(--muted); }
.side details[open] > summary::before { content: "▾"; }
.side summary small { display: block; color: var(--muted); font-size: 13px; }
.side ol { list-style: none; margin: 2px 0 8px; padding: 0 0 0 10px; }
.side li a { display: block; padding: 5px 8px; border-radius: 8px; text-decoration: none; }
.side li a:hover { background: var(--soft); }
.side li a[aria-current] { background: var(--accent-soft); color: var(--ink); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent); }
.num { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 4px; }
main.cohort { padding: 32px 44px 80px; min-width: 0; }
.crumb { color: var(--accent); margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
main.cohort h1 { font-size: 34px; line-height: 1.2; letter-spacing: -.02em; margin: 6px 0 20px; }
.statement { border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: 12px; padding: 20px 24px;
  overflow-x: auto; }
.statement p { margin: 0 0 .6em; }
.statement .src { margin: 14px 0 0; text-align: right; font-size: 12.5px; color: var(--muted); } /* the problem's source */
.statement.locked { user-select: none; -webkit-user-select: none; }
.opts { list-style: none; padding: 0; margin: .5em 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 28px; }
.opt { font-weight: 700; margin-right: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.actions button { border: 1.5px solid var(--ink); background: none; color: var(--ink); border-radius: 999px;
  padding: .45em 1.2em; font-weight: 600; }
.actions button[aria-expanded="true"] { background: var(--ink); color: #fff; }
.panel { margin-top: 18px; border-top: 1.5px solid var(--ink); padding-top: 14px; }
.panel h2 { font-size: 22px; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.panel h2::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.panel h3 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 18px 0 6px; }
.panel h3:first-of-type { margin-top: 4px; }
.panel p { margin: 0 0 .8em; max-width: 720px; }
.video { position: relative; aspect-ratio: 16 / 9; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 12px; }
.soon { color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 44px; padding-top: 18px;
  border-top: 1px solid var(--line); font-size: 15px; }
.pager a { text-decoration: none; font-weight: 600; }
.pager a:hover { color: var(--accent); }

/* discussion (community.js, Cloudflare): Srijit's solution pinned, then everyone's posts and replies */
.discuss [hidden], .recent[hidden] { display: none !important; }
.discuss { margin-top: 36px; border-top: 1.5px solid var(--ink); padding-top: 16px; display: grid; gap: 18px; }
.discuss > h2 { font-size: 22px; margin: 0; display: flex; align-items: center; gap: 10px; }
.discuss > h2::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.discuss .soon, .discuss .muted { color: var(--muted); }
.discuss .muted { font-size: 14px; }
.btn.small { font-size: 15px; padding: .4em 1.1em; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; font-size: 14px; }
.join { border: 1px dashed var(--line); border-radius: 12px; padding: 18px 20px; display: grid; gap: 12px; justify-items: start; }
.join p { margin: 0; }
.post { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; min-width: 0; }
.post header, .comment .meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: 15px; }
.post time, .comment time { color: var(--muted); font-size: 13px; }
.post .body, .comment .body { overflow-x: auto; overflow-wrap: anywhere; }
.post .body p, .comment .body p { margin: .5em 0; }
.post.pinned { border-left: 3px solid var(--accent); }
.post.pinned h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 10px 0 2px; }
.tag { font-size: 12px; font-weight: 700; color: var(--accent); background: #fff; border: 1px solid var(--accent); border-radius: 999px; padding: 0 8px; }
.kind { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 8px; background: var(--soft); }
.kind.question { background: #eef3ff; color: #2849a8; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.tools button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 2px 10px; font-size: 13px; color: var(--ink); }
.tools button:hover { border-color: var(--ink); }
.tools button:disabled { opacity: .5; cursor: default; }
.tools .up.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.comments { display: grid; gap: 4px; margin-top: 10px; }
.comments:empty { display: none; }
.comment { border-left: 2px solid var(--line); padding: 4px 0 4px 12px; font-size: 15px; }
.is-hidden { opacity: .6; }
.hidden-note { margin: 6px 0 0; font-size: 13px; color: var(--accent); }
.compose, .reply, .editing { display: grid; gap: 8px; }
.reply { margin-top: 8px; }
.compose textarea, .reply textarea, .editing textarea { width: 100%; font: inherit; font-size: 16px; padding: .6em .8em; border: 1.5px solid var(--line);
  border-radius: 10px; resize: vertical; color: var(--ink); background: #fff; }
.compose textarea:focus, .reply textarea:focus, .editing textarea:focus { outline: none; border-color: var(--ink); }
.compose .row, .reply .row, .editing .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.reply .row, .editing .row { justify-content: flex-end; }
.kinds { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 15px; }
.kinds input { accent-color: var(--accent); }
.sortbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.sortbar button { border: 1px solid var(--line); background: #fff; padding: 2px 12px; font-size: 14px; }
.sortbar button:first-child { border-radius: 999px 0 0 999px; }
.sortbar button:last-child { border-radius: 0 999px 999px 0; border-left: 0; }
.sortbar button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.posts { display: grid; gap: 12px; }
.history { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 6px; font-size: 14px; color: var(--muted); }
.history .ver { margin-top: 6px; }
.side .cnt { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700; text-align: center; margin-left: 4px; }

/* solution cards, votes, the love button */
.post.solcard .body { position: relative; }
.post.solcard:not(.open) .body { max-height: 6.2em; overflow: hidden; }
.post.solcard:not(.open) .body.fits::after { display: none; }
.post.solcard[data-card] { cursor: pointer; }
.post.solcard[data-card]:hover { border-color: #c9c9cd; }
.post.solcard.open { cursor: default; }
.sumline { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.sumline .open-hint { color: var(--accent); font-weight: 600; }
.solve .owner label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.post.solcard:not(.open) .body::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3em;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff); }
.post .more.linkish { display: inline-block; margin: 4px 0 2px; color: var(--accent); font-weight: 600; text-decoration: none; font-size: 15px; }
.votes { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.votes button { border: 0 !important; border-radius: 0 !important; background: none; padding: 2px 9px; font-size: 12px; color: var(--muted); }
.votes button:hover:not(:disabled) { color: var(--ink); background: var(--soft); }
.votes .score { font-size: 13px; min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.votes .up.on { color: var(--accent); background: var(--accent-soft); }
.votes .down.on { color: #2849a8; background: #eef3ff; }
.actions .love { margin-left: auto; border-color: var(--line); color: var(--muted); }
.actions .love:hover { border-color: #d6336c; color: #d6336c; }
.actions .love.on { border-color: #d6336c; background: #fff0f5; color: #d6336c; }

/* people, claps, grades, the bell, profiles */
a.who { font-weight: 700; text-decoration: none; color: var(--ink); }
.who-pic { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; align-self: center; margin-right: -2px; }
a.li { display: inline-flex; align-items: center; margin-left: 4px; vertical-align: -2px; opacity: .9; }
a.li:hover { opacity: 1; }
a.li.big svg { width: 22px; height: 22px; }
.li-form { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 10px; font-size: 14px; }
.li-form label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; }
.li-form input { font: inherit; font-size: 16px; padding: .4em .7em; border: 1.5px solid var(--line); border-radius: 10px; width: min(340px, 100%); }
.li-form .muted { flex-basis: 100%; color: var(--muted); font-size: 13px; }
a.who:hover { color: var(--accent); }
.lvl { font-size: 11px; font-weight: 600; color: #5b4bb7; background: #f1eefe; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.lvl.big { font-size: 14px; padding: 3px 12px; }
.tools .clap { font-size: 13px; }
.tools .clap.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.tools .clap small { font-weight: 400; color: var(--muted); }
.tools .clap.pop { transform: scale(1.12); transition: transform .12s; }
.tools .gradebtn { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.grade { margin: 8px 0 0; font-size: 15px; }
.feedback { margin-top: 8px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; padding: 8px 14px; }
.feedback .muted { margin: 0 0 4px; font-size: 13px; }
.grading { display: grid; gap: 8px; margin: 10px 0; padding: 12px; border: 1.5px dashed var(--accent); border-radius: 12px; }
.grading select { font: inherit; padding: 4px 8px; border-radius: 8px; border: 1.5px solid var(--line); margin-left: 6px; }
.grading textarea { width: 100%; font: inherit; font-size: 15px; padding: .5em .7em; border: 1.5px solid var(--line); border-radius: 10px; }
.grading .row { display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.post.lit { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 4px var(--accent); }
.md h1, .md h2, .md h3 { font-size: 17px; margin: .6em 0 .3em; }
.md ul, .md ol { padding-left: 1.4em; margin: .4em 0; }
.md pre { background: var(--soft); padding: 8px 10px; border-radius: 8px; overflow-x: auto; }
.md code { background: var(--soft); padding: 0 4px; border-radius: 4px; font-size: .92em; }
.md blockquote { margin: .5em 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.md table { border-collapse: collapse; } .md td, .md th { border: 1px solid var(--line); padding: 4px 8px; }
.solve .hint { margin: 0; color: var(--ink); max-width: 720px; }
.solve .mine-note { margin: 0; color: var(--ok, #237a47); font-size: 14px; font-weight: 600; }
.bell { position: relative; margin-right: 10px; } /* Roadmap (.rmbtn) pushes the group right: Roadmap · bell · name */
.bellbtn { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; width: 40px; height: 36px; font-size: 16px; position: relative; }
.bellbtn .dot { position: absolute; top: -6px; right: -6px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 4px; }
.notes { position: absolute; right: 0; top: 44px; width: min(360px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .12); z-index: 6; padding: 6px; }
.notes a { display: grid; gap: 2px; padding: 9px 10px; border-radius: 10px; text-decoration: none; font-size: 14px; }
.notes a:hover { background: var(--soft); }
.notes a.new { background: var(--accent-soft); }
.notes time { color: var(--muted); font-size: 12px; }
.notes .muted { padding: 10px; margin: 0; font-size: 14px; color: var(--muted); }
.profile .who-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.profile .who-head h1 { margin: 0; }
/* statement tables and bullet lists (from LaTeX tabular / itemize, 2026-11-14); a wide table scrolls on a phone */
.statement .tbl { overflow-x: auto; margin: 10px 0; }
.statement .tbl table { border-collapse: collapse; }
.statement .tbl td { padding: 4px 10px; text-align: center; white-space: nowrap; }
.statement .tbl td.tb-bar { border-right: 1px solid var(--ink); }
.statement .tbl tr.tb-top td { border-top: 1px solid var(--ink); }
.statement ul.items { margin: 8px 0; padding-left: 1.4em; }
.profile .who-head .avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; align-self: center; border: 1px solid var(--line); }
.profile .who-head p { flex-basis: 100%; margin: 0; }
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 24px 0 12px; }
.stats-row div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; }
.stats-row b { font-size: 26px; font-variant-numeric: tabular-nums; }
.stats-row span { color: var(--muted); font-size: 13px; }
.karma-bar { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.karma-bar i { display: block; height: 100%; background: #5b4bb7; border-radius: 999px; }
.profile .small { font-size: 13px; margin: 6px 0 0; }
.profile h2 { font-size: 20px; margin: 32px 0 10px; }
.solved { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.scard { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-decoration: none; }
.scard:hover { border-color: var(--ink); }
.scard .mod { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.scard .when, .scard .nums { font-size: 13px; color: var(--muted); }
.lb li .lvl { margin-left: 8px; }
@media (max-width: 640px) { .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* "Your solution": the writing box under the problem */
.solve { margin-top: 28px; display: grid; gap: 10px; }
.solve h2 { font-size: 20px; margin: 0; }
.solve .write { display: grid; gap: 8px; }
.solve textarea { width: 100%; font: inherit; font-size: 16px; line-height: 1.55; padding: .7em .9em; border: 1.5px solid var(--line);
  border-radius: 12px; resize: vertical; color: var(--ink); background: #fff; }
.solve textarea:focus { outline: none; border-color: var(--ink); }
.solve .muted { color: var(--muted); font-size: 14px; margin: 0; }
.solve .preview { border-left: 3px solid var(--line); padding: 2px 0 2px 14px; overflow-x: auto; }
.solve .preview:empty { display: none; }
.solve .preview p { margin: 0 0 .6em; }
.solve .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.discuss[hidden], .solve[hidden], .comments[hidden] { display: none !important; }

/* home: the latest posts; and the leaderboard page */
.recent { margin-top: 8px; }
.home-links { margin: 0 0 26px; } /* Leaderboard → · About Teacher →, just above "Latest in the discussion" */
.recent h2 { font-size: 22px; margin: 0 0 8px; }
.recent ul { list-style: none; padding: 0; margin: 0; border-top: 1.5px solid var(--ink); }
.recent li a { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; min-width: 0; }
.recent li a:hover .what b:last-child { color: var(--accent); }
.recent .snip { color: var(--muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent time { color: var(--muted); font-size: 13px; }
.lb-page { max-width: 820px; margin: 0 auto; padding: 48px 24px 96px; }
.lb-page h1 { font-size: 40px; letter-spacing: -.03em; margin: 0 0 6px; }
.lb-page > p { color: var(--muted); margin: 0 0 28px; }
.lb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.lb-grid h2 { font-size: 18px; margin: 0 0 8px; }
.lb { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.lb li { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: nowrap; min-width: 0; }
/* one row per person, always (2026-11-08): the name and the level shrink with "…", the 👏 never wraps */
.lb .who { flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lb li .lvl { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lb .rank, .lb .up, .lb li > a:not(.who) { flex: none; }
.lb .up { white-space: nowrap; }
.lb .rank { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 22px; }
.lb .up { margin-left: auto; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .lb-grid { grid-template-columns: minmax(0, 1fr); } .lb-page { padding: 32px 16px 64px; } }

.prose h2 { font-size: 20px; margin: 28px 0 8px; }
.prose p, .prose li { max-width: 680px; color: var(--ink); }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 6px 0; }
.fine { margin-top: 48px; font-size: 14px; }
.fine a { color: var(--muted); }

/* modal + toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 9px 18px; border-radius: 999px; font-size: 15px; z-index: 9; }
.modal { position: fixed; inset: 0; z-index: 5; background: rgba(11, 11, 12, .5); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.card { background: #fff; border-radius: 20px; padding: 28px; width: min(440px, 100%); }
.card h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.02em; }
.card .why { color: var(--muted); margin-top: 0; font-size: 15px; }
.card label { display: block; margin: 12px 0; font-size: 15px; font-weight: 600; }
.card input { display: block; width: 100%; margin-top: 4px; font: inherit; font-weight: 400; padding: .6em .8em;
  border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); }
.card input:focus { outline: none; border-color: var(--ink); }
.card .row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.card .msg { color: var(--accent); font-size: 15px; min-height: 1em; margin: 0; }
.card [hidden] { display: none; }
.card .gbtn { margin: 18px 0 6px; min-height: 44px; }
.card .alt { margin: 10px 0 0; }
.card .linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  .mark { animation: none; stroke-dashoffset: 0; }
}
@media (max-width: 900px) {
  .hero { padding: 72px 0 56px; }
  .modules { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .wrap { display: flex; flex-direction: column; }
  .side { order: 2; position: static; height: auto; border-right: 0; border-top: 1.5px solid var(--ink); padding: 12px 16px; }
  main.cohort { padding: 22px 16px 60px; }
  main.cohort h1 { font-size: 26px; }
  .opts { grid-template-columns: minmax(0, 1fr); }
  .home { padding: 0 16px 60px; }
}
@media (max-width: 520px) {
  .top { padding: 10px 16px; }
}

/* phones (checked at 390 px) */
.modules small { white-space: nowrap; }
@media (max-width: 600px) {
  .top { gap: 8px; }
  .brand { font-size: 15px; line-height: 1.25; }
  .enrol { padding: .35em .9em; font-size: 15px; }
  .bell { margin-right: 0; }
  .bellbtn { width: 36px; height: 34px; font-size: 15px; }
  .notes { position: fixed; left: 12px; right: 12px; top: calc(60px + env(safe-area-inset-top, 0px)); width: auto; max-height: 70vh; }
  main.cohort h1 { font-size: 24px; margin-bottom: 14px; }
  .statement { padding: 14px 16px; border-radius: 10px; }
  .actions { gap: 8px; }
  .actions button { padding: .4em .95em; font-size: 15px; }
  .actions .love { padding: .4em .8em; }
  .post { padding: 12px 14px; }
  .discuss > h2 { font-size: 20px; }
  .solve textarea, .reply textarea, .editing textarea { font-size: 16px; } /* 16px keeps iPhones from zooming in */
  .side::before { content: "All problems"; display: block; font-size: 13px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--accent); margin: 4px 0 10px; }
  .pager { font-size: 14px; }
  .lb-page h1 { font-size: 32px; }
  .stats-row b { font-size: 22px; }
}

.brand .nw { white-space: nowrap; } /* on a phone: "Mathematics for" / "Machine Learning" */

/* the notice across the top (build_site.py NOTICE) */
.notice { background: var(--accent-soft); color: var(--ink); border-bottom: 1px solid var(--accent);
  padding: 10px max(16px, env(safe-area-inset-left, 0px)); text-align: center; font-size: 14px; font-weight: 600; line-height: 1.4; }

/* the Solve box: one line with a "Copy prompt" button (the prompt for the learner's own AI) */
.hint .copy { display: inline-block; border: 1.5px solid var(--ink); background: var(--bg); color: var(--ink); border-radius: 999px;
  padding: 0 10px; font: inherit; font-size: 13px; font-weight: 600; line-height: 1.6; cursor: pointer; white-space: nowrap; vertical-align: baseline; }
.hint .copy:hover { background: var(--ink); color: var(--bg); }

/* the headline: "Machine Learning" and "Quant Finance" take turns word by word (each pair in one grid cell, so nothing jumps) */
/* cohort.js toggles .alt on the same clock as "<name> joined." (every 2.6 s) */
.swap { display: inline-grid; }
.swap > span { grid-area: 1 / 1; transition: opacity .35s ease, transform .35s ease; }
.swap > span + span, .swap.alt > span:first-child { opacity: 0; transform: translateY(.18em); }
.swap.alt > span:first-child { transform: translateY(-.18em); }
.swap.alt > span + span { opacity: 1; transform: none; }
.hero .narrow { display: none; } /* the phone's word-by-word version */
@media (max-width: 600px) { .hero .wide { display: none; } .hero .narrow { display: inline; } }
@media (prefers-reduced-motion: reduce) { .swap > span { transform: none !important; } } /* fade only */
.sub .nw, .proof .nw { white-space: nowrap; }

/* "Keep practising" (build_site.py more(); path.js orders the groups for a signed-in learner) and "Next for you" */
.more { margin-top: 34px; display: flex; flex-direction: column; gap: 16px; }
.more h2 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; order: -3; }
.more .why { margin: -6px 0 0; color: var(--muted); font-size: 15px; order: -2; }
.group h3 { font-size: 15px; margin: 0 0 8px; }
.group.first h3::after { content: " · for you"; color: var(--accent); font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.pcard { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  text-decoration: none; background: var(--bg); min-width: 0; }
.pcard:hover { border-color: var(--ink); }
.pcard b { font-size: 15px; line-height: 1.35; }
.pcard .meta { color: var(--muted); font-size: 13px; }
.pcard .tag { font-size: 12px; font-weight: 600; color: var(--muted); }
.pcard.done { background: var(--soft); }
.pcard.done b { color: var(--muted); }
.home-path { margin: 0 0 28px; }
.home-path h2 { font-size: 22px; margin: 0 0 10px; }
.dots { color: var(--accent); font-size: 10px; letter-spacing: 1px; white-space: nowrap; vertical-align: 1px; }
.actions .stuck { border-color: var(--line); color: var(--muted); }
.actions .stuck:hover { border-color: var(--ink); color: var(--ink); }
.actions .stuck.on { border-color: var(--ink); color: var(--ink); }
@media (max-width: 600px) { .actions .stuck { padding: .4em .8em; } }

/* the Roadmap button and page (build_site.py roadmap_page): nothing to click; a glow runs down the lines, over and over */
/* the ☰ menu in the header: Dashboard, Roadmap, Books (cohort.js opens and closes it) */
.menu { position: relative; margin-left: auto; }
.menu, .msgbtn, .bell, .enrol { flex-shrink: 0; } /* nothing in the header gets squeezed */
.menubtn { border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 10px;
  width: 38px; height: 34px; font-size: 17px; line-height: 1; padding: 0; }
.menubtn:hover, .menubtn[aria-expanded="true"] { border-color: var(--ink); }
.menulist { position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(11, 11, 12, .12); padding: 6px; display: flex; flex-direction: column; z-index: 5; }
.menulist[hidden] { display: none; } /* closed on phones (a PC shows the links below) */
.menulist a[hidden] { display: none !important; } /* Blog, until a post is published (Srijit always sees it) */
.menulist a { padding: 9px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.menulist a:hover { background: var(--soft); color: var(--accent); }
@media (min-width: 901px) { /* a PC: the links sit in the header; below 900 px (phones, tablets) it's ☰ · 💬 · 🔔 */
  .menubtn { display: none; }
  .menu .menulist { display: flex !important; position: static; flex-direction: row; gap: 2px; min-width: 0; padding: 0;
    border: 0; box-shadow: none; background: none; }
  .menulist a { padding: .4em .7em; }
  .menulist a:hover { background: none; }
}
.roadmap { max-width: 948px; margin: 0 auto; padding: 48px 24px 80px; } /* the graph's own width, 900 */
.roadmap h1 { font-size: clamp(34px, 6vw, 56px); letter-spacing: -.035em; margin: 0 0 10px; }
.roadmap .sub { color: var(--muted); margin: 0 0 22px; text-wrap: pretty; }
.roadmap .legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 28px 0 0; }
.roadmap .chip { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid rgba(11, 11, 12, .12); }
.rm { pointer-events: none; user-select: none; }
.rm svg { display: block; width: 100%; height: auto; }
.rm.narrow { display: none; }
@media (max-width: 600px) { .rm.wide { display: none; } .rm.narrow { display: block; } }
.rm .base { fill: none; stroke: #d9d9de; stroke-width: 1.6; }
.rm .pulse { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 18 400;
  stroke-dashoffset: 18; opacity: 0; animation: rm-pulse 10s linear infinite; }
@keyframes rm-pulse { 0% { stroke-dashoffset: 18; opacity: 1; } 12% { stroke-dashoffset: -100; opacity: 1; } 12.1%, 100% { stroke-dashoffset: -100; opacity: 0; } }
.rm .node { stroke: var(--ink); stroke-width: 1.5; }
.rm text { fill: var(--ink); font-weight: 600; text-anchor: middle; font-family: inherit; }
.rm .halo { fill: none; stroke: var(--accent); stroke-width: 6; opacity: 0; transform-box: fill-box; transform-origin: center;
  animation: rm-glow 10s ease-out infinite; }
@keyframes rm-glow { 0% { opacity: .7; transform: scale(1); } 8% { opacity: 0; transform: scale(1.12, 1.35); } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .rm .pulse, .rm .halo { animation: none; opacity: 0; } }
@media (max-width: 600px) { .roadmap { padding: 32px 16px 60px; } }

/* /books/ (build_site.py books_page): compact, one line per book or course, topics flowing in columns */
.books { max-width: 1100px; margin: 0 auto; padding: 36px 24px 64px; }
.books h1 { font-size: clamp(30px, 5vw, 44px); letter-spacing: -.03em; margin: 0 0 4px; }
.books .sub { color: var(--muted); margin: 0 0 18px; }
.books h2 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  margin: 22px 0 8px; padding-bottom: 6px; border-bottom: 1.5px solid var(--ink); }
.shelves { columns: 3 300px; column-gap: 32px; }
.shelf { break-inside: avoid; margin: 0 0 14px; }
.shelf h3 { font-size: 15px; margin: 0 0 4px; color: var(--accent); }
.shelf ul { list-style: none; padding: 0; margin: 0; }
.shelf li { font-size: 14.5px; line-height: 1.45; padding: 3px 0; color: var(--muted); }
.shelf li b { font-weight: 600; color: var(--ink); }
.shelf li i { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); border: 1px solid currentColor; border-radius: 999px; padding: 0 6px; margin-left: 4px; white-space: nowrap; }
@media (max-width: 600px) { .books { padding: 26px 16px 48px; } }

/* 💬 messages (community.js startChat): a learner and Srijit, like WhatsApp; the 💬 link sits beside the bell */
.msgbtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 34px; margin-right: 6px;
  border: 1.5px solid var(--line); border-radius: 10px; text-decoration: none; font-size: 16px; }
.msgbtn:hover { border-color: var(--ink); }
/* the YouTube channel (2026-11-12), in the page itself, no script: ☰ · YouTube · 💬 · 🔔 signed in, ☰ · YouTube · Enroll for a new visitor */
.ytbtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 34px; margin-right: 6px; flex-shrink: 0;
  border: 1.5px solid var(--line); border-radius: 10px; text-decoration: none; }
.ytbtn:hover { border-color: var(--ink); }

.msgbtn { position: relative; }
.msgbtn .dot { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.chat { max-width: 720px; }
.chat-head { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.chat-head h1 { margin: 0; flex: 1; font-size: 26px; }
.chat-head .linkish { font-size: 20px; text-decoration: none; }
.msgs { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; padding: 12px; background: var(--soft);
  border: 1px solid var(--line); border-radius: 14px; }
.bub { max-width: 82%; padding: 8px 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); align-self: flex-start; }
.bub.me { align-self: flex-end; background: var(--accent-soft); border-color: rgba(232, 89, 12, .3); }
.bub .txt p { margin: 0 0 4px; } .bub .txt p:last-child { margin: 0; }
.bub .txt { overflow-wrap: anywhere; }
.bub time { display: block; font-size: 11px; color: var(--muted); text-align: right; margin-top: 2px; }
.bub [data-medit] { display: block; margin-left: auto; font-size: 11px; color: var(--muted); }
.bub textarea { width: 100%; min-width: min(240px, 70vw); font: inherit; }
.bub .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.say { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.say textarea { flex: 1; resize: none; font: inherit; font-size: 16px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 12px; min-height: 42px; }
.say textarea:focus { outline: none; border-color: var(--ink); }
.inbox { list-style: none; padding: 0; margin: 0; border-top: 1.5px solid var(--ink); }
.inbox a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); text-decoration: none; }
.inbox a:hover b { color: var(--accent); }
.inbox .cnt { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 12px; text-align: center; vertical-align: 2px; }
.inbox time { color: var(--muted); font-size: 13px; grid-column: 2; grid-row: 1; }
.inbox .snip { grid-column: 1 / -1; color: var(--muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 12px 0 0; }
.foot.links { gap: 8px; margin: 16px 0 4px; } /* the dashboard: three matching buttons */
.foot.links .btn { font-size: 14px; padding: .45em 1.1em; }
@media (max-width: 600px) { .msgbtn, .ytbtn { width: 36px; height: 34px; font-size: 15px; margin-right: 4px; } .msgs { max-height: 58vh; } }

/* Srijit's handwriting -> text in the Solve box (2026-11-13), only for him: Image / Text, the pages, the live grade */
.owner-ai { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; font-size: 14px; }
.owner-ai .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--soft); }
.owner-ai .seg button { border: 0; background: none; padding: 5px 16px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.owner-ai .seg button.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.pages-panel .pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 4px 0 12px; }
.pages-panel .page { border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.pages-panel .page.bad { border-color: #dc2626; }
.pages-panel .page img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--soft); display: block; }
.pages-panel .cap { padding: 6px 8px 0; font-size: 13px; display: grid; gap: 2px; }
.pages-panel .chip { font-size: 12px; color: #16a34a; } .pages-panel .page.bad .chip { color: #dc2626; font-weight: 600; }
.pages-panel .tools { display: flex; gap: 4px; padding: 6px 8px 8px; }
.pages-panel .tools button { flex: 1; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 3px 0; font-size: 13px; }
.pages-panel .tools button:disabled { opacity: .35; }
.pages-panel .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pages-panel .ai-status { margin: 10px 0 0; font-size: 14px; }
.btn.small.ghost { background: var(--bg); color: var(--ink); }
.grade-live { margin-top: 16px; border: 1.5px solid var(--accent); border-radius: 12px; padding: 14px 16px; background: var(--accent-soft); }
.grade-live .kicker { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.grade-live .typing { color: var(--muted); }
form.write[hidden], .pages-panel[hidden], .grade-live[hidden] { display: none !important; }
.pick-h { margin: 36px 0 14px; font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
/* Notes (2026-11-22): a topic's notes in place of the problem */
.tnotes { max-width: 760px; line-height: 1.65; font-size: 16.5px; }
.tnotes h1 { font-size: 34px; letter-spacing: -.02em; margin: 6px 0 14px; }
.tnotes h2 { font-size: 22px; margin: 34px 0 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.tnotes h3 { font-size: 17px; margin: 22px 0 8px; }
.tnotes p { margin: 10px 0; }
.tnotes ul { margin: 8px 0 12px; padding-left: 22px; }
.tnotes li { margin: 5px 0; }
.tnotes .dm { margin: 14px 0; overflow-x: auto; }
.tnotes .tbl { overflow-x: auto; margin: 12px 0; }
.tnotes table { border-collapse: collapse; font-size: 15px; }
.tnotes th, .tnotes td { border-bottom: 1px solid var(--line); padding: 7px 12px; text-align: left; vertical-align: top; }
.tnotes th { font-weight: 700; }
img.fig { display: block; max-width: 100%; height: auto; margin: 12px 0; background: #fff; } /* problem figures (data/figures) */
pre.code { background: var(--soft, #f6f6f6); padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 14px; line-height: 1.45; } /* program code in statements */
.tnotes code { font-size: .92em; background: var(--soft); padding: 1px 5px; border-radius: 4px; }
.blank { display: inline-block; width: 3.5em; border-bottom: 1.5px solid currentColor; margin: 0 .15em; vertical-align: -.15em; } /* fill-in blanks */
