/* Suken eBook: phone-first styles. Colours follow the printed books. */
:root {
  --blue: #1b1fd6; --blue-d: #1216a0; --lav: #eef0ff; --lav2: #dfe3ff;
  --teal: #1ba1c5; --teal-l: #e3f5fa; --orange: #ff8000; --orange-l: #fff1e0; --sun: #ffcd3c; --sun-l: #fff6d8;
  --purple: #800080; --purple-l: #f6e9f6; --green: #14823c; --green-l: #e4f5ea; --red: #cc0000; --red-l: #fde8e8;
  --ink: #1d1d35; --muted: #5a5a78; --line: #dcdcec; --bg: #f6f7fb; --card: #ffffff;
  --gold: #d6a300; --silver: #8c91a0; --bronze: #b06e32;
  --r: 14px; --shadow: 0 1px 2px rgba(20,20,60,.06), 0 4px 14px rgba(20,20,60,.06);
  --font: 'Nunito', 'Kantumruy Pro', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.5; }
body.km { font-family: 'Kantumruy Pro', 'Nunito', system-ui, sans-serif; line-height: 1.7; }
button { font: inherit; cursor: pointer; }
a { color: var(--blue); }
img.fig { max-width: 100%; height: auto; display: block; margin: 8px auto; }
.figwrap img.fig { width: auto; max-height: 260px; }
.ava-inline { height: 34px; vertical-align: middle; }
mjx-container { font-size: 108%; }
mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; }
.qdone { color: var(--green); } .qopen { color: var(--muted); }
.btn.arm { background: var(--red); }
.go.soon { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* ---------- top bar ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--blue); color: #fff; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 10px; box-shadow: 0 2px 8px rgba(0,0,60,.18); }
.top .back { background: none; border: 0; color: #fff; font-size: 24px; line-height: 1; padding: 4px 8px 4px 0; }
.top .t { flex: 1; min-width: 0; }
.top .t b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .t small { opacity: .85; font-size: 12.5px; }
.xpchip { background: rgba(255,255,255,.16); border-radius: 99px; padding: 3px 10px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.lang { background: #fff; color: var(--blue); border: 0; border-radius: 99px; padding: 3px 10px; font-weight: 800; font-size: 13px; }
.bar { height: 5px; background: rgba(255,255,255,.25); border-radius: 9px; overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; background: var(--sun); border-radius: 9px; }

main { max-width: 760px; margin: 0 auto; padding-block: 14px 120px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--blue); }
h1 { font-size: 24px; margin: 6px 0 4px; line-height: 1.25; }
h2 { font-size: 19px; margin: 22px 0 10px; color: var(--blue); }
h3 { font-size: 17px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- home ---------- */
.hero { background: var(--blue); background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, transparent 1px 22px), repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 1px, transparent 1px 22px); color: #fff; border-bottom: 5px solid var(--orange); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.hero .kyu { font-weight: 800; letter-spacing: .3px; opacity: .9; font-size: 14px; }
.hero h1 { color: #fff; font-size: 26px; margin: 2px 0 6px; }
.hero .stats { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.stat { background: rgba(255,255,255,.15); border-radius: 12px; padding: 8px 12px; min-width: 84px; }
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 12.5px; opacity: .9; }
.chor { display: flex; gap: 6px; margin: 14px 0 0; flex-wrap: wrap; }
.chor span { background: #fff; color: var(--blue); border-radius: 10px; padding: 4px 9px; font-size: 13px; font-weight: 700; }
.chor span .kh { font-family: 'Kantumruy Pro'; }
.tiles { display: grid; grid-template-columns: 1fr; gap: 10px; }
.tile { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow);
  border: 1px solid var(--line); text-decoration: none; color: var(--ink); text-align: left; width: 100%; }
.tile .num { width: 44px; height: 44px; border-radius: 12px; background: var(--lav); color: var(--blue); display: grid; place-items: center; font-weight: 800; flex: none; font-size: 15px; }
.tile .body { flex: 1; min-width: 0; }
.tile .body b { display: block; line-height: 1.3; }
.tile .body small { color: var(--muted); font-size: 13.5px; }
.tile .go { color: var(--blue); font-weight: 800; font-size: 20px; }
.tile.locked { opacity: .55; }
.tile.locked .go { color: var(--muted); font-size: 14px; }
.tile .ring { width: 38px; height: 38px; flex: none; }
.tile.mock .num { background: var(--purple-l); color: var(--purple); }
.tile.drill .num { background: var(--teal-l); color: var(--teal); }
.seg { display: flex; background: var(--lav); border-radius: 12px; padding: 4px; gap: 4px; margin: 16px 0 10px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 8px 4px; font-weight: 800; color: var(--blue); font-size: 14.5px; }
.seg button.on { background: #fff; box-shadow: var(--shadow); }

/* ---------- lesson home ---------- */
.lesson-hero { background: var(--card); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); border-top: 6px solid var(--blue); }
.lesson-hero .lnum { color: var(--purple); font-weight: 800; font-size: 14px; letter-spacing: .5px; }
.strip { background: var(--lav); border-left: 4px solid var(--blue); border-radius: 10px; padding: 10px 12px; margin: 12px 0; font-size: 15px; }
.strip b.lab { color: var(--blue); }
.path { position: relative; margin: 14px 0; }
.stop { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 12px;
  margin-bottom: 9px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); width: 100%; text-align: left; }
.stop .dot { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--lav2); display: grid; place-items: center; flex: none; font-weight: 800; font-size: 13px; color: var(--blue); background: #fff; }
.stop.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.stop.next .dot { border-color: var(--orange); color: var(--orange); }
.stop .body { flex: 1; min-width: 0; }
.stop .body b { display: block; line-height: 1.3; font-size: 15.5px; }
.tag5 { display: inline-block; font-size: 12px; font-weight: 800; border-radius: 6px; padding: 1px 7px; margin-top: 3px; }
.tag5 .kh { font-family: 'Kantumruy Pro'; font-weight: 700; }
.t-chol { background: var(--lav); color: var(--blue); } .t-chong { background: var(--orange-l); color: #b35a00; }
.t-cham { background: var(--teal-l); color: #0b7390; } .t-chenh { background: var(--purple-l); color: var(--purple); } .t-cheh { background: var(--sun-l); color: #8a6a00; }

/* ---------- blocks ---------- */
.blk { background: var(--card); border-radius: var(--r); padding: 14px; margin: 14px 0; box-shadow: var(--shadow); border: 1px solid var(--line); }
.blk > .head { display: flex; align-items: center; gap: 8px; margin: -14px -14px 12px; padding: 9px 14px; border-radius: var(--r) var(--r) 0 0; font-weight: 800; font-size: 14px; letter-spacing: .3px; }
.head .pill { margin-left: auto; font-size: 12px; font-weight: 800; background: rgba(255,255,255,.25); border-radius: 99px; padding: 1px 8px; }
.h-blue { background: var(--blue); color: #fff; } .h-teal { background: var(--teal); color: #fff; } .h-orange { background: var(--orange); color: #fff; }
.h-purple { background: var(--purple); color: #fff; } .h-green { background: var(--green); color: #fff; } .h-red { background: var(--red); color: #fff; }
.h-dark { background: #3b2a26; color: #fff; } .h-gold { background: var(--gold); color: #fff; }
.secttl { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 6px; }
.secttl .n { background: var(--teal); color: #fff; font-weight: 800; border-radius: 8px; padding: 2px 9px; font-size: 15px; }
.secttl h2 { margin: 0; }

/* speech */
.say { display: flex; gap: 10px; align-items: flex-end; margin: 10px 0; }
.say.R { flex-direction: row-reverse; }
.say .ava { width: 54px; height: 54px; flex: none; }
.say .ava img { width: 100%; height: 100%; object-fit: contain; }
.bub { position: relative; background: var(--lav); border-radius: 16px; padding: 9px 12px; font-size: 15.5px; max-width: 100%; }
.say.L .bub { border-bottom-left-radius: 4px; } .say.R .bub { border-bottom-right-radius: 4px; }
.bub .nm { display: block; font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 1px; }
.who-Dara .bub { background: #e3f4fa; } .who-Sophea .bub { background: #f1edfd; } .who-Bopha .bub { background: #fde9ef; }
.who-Kiri .bub { background: #fff3cf; } .who-Tokay .bub { background: #e5f6ea; }
.work { display: block; background: #fff; border: 1.5px solid var(--lav2); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.note { display: block; color: var(--green); font-size: 14px; margin-top: 6px; }
.box { display: inline-block; width: 2.4em; height: 1.4em; border: 1.5px solid var(--ink); vertical-align: middle; border-radius: 3px; }
.tool { display: inline-block; background: var(--orange-l); color: #b35a00; border: 1px solid #ffcf9a; font-size: 12px; font-weight: 800; border-radius: 6px; padding: 0 6px; margin: 0 2px; }
.skill { font-style: italic; color: var(--muted); font-size: 14px; }
.center { text-align: center; }
table.tab { border-collapse: collapse; margin: 8px auto; font-size: 15px; }
table.tab td { border: 1px solid var(--line); padding: 5px 9px; text-align: center; }
table.tab tr:first-child td { background: var(--lav); font-weight: 700; }
.mp { display: block; }

/* example */
.ex-q { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.row { border-top: 1px dashed var(--line); padding-top: 6px; }
.row .workcol { margin: 2px 0 6px 64px; }
.say.R + .workcol, .row.R .workcol { margin: 2px 64px 6px 0; }
.ans { margin-top: 10px; background: var(--red-l); border-radius: 10px; padding: 8px 12px; font-weight: 700; }
.ans .lab { color: var(--red); margin-right: 6px; }

/* buttons */
.btn { border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 800; background: var(--blue); color: #fff; font-size: 15.5px; }
.btn.ghost { background: var(--lav); color: var(--blue); }
.btn.ok { background: var(--green); } .btn.no { background: #8a8aa6; }
.btn.orange { background: var(--orange); } .btn.small { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: default; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn.block { width: 100%; }

/* quiz items */
.item { border-top: 1px solid var(--line); padding: 12px 0 10px; }
.item:first-of-type { border-top: 0; padding-top: 2px; }
.item .qn { display: inline-block; min-width: 26px; color: var(--blue); font-weight: 800; }
.item .q { display: inline; }
.inrow { display: flex; gap: 8px; margin-top: 9px; align-items: stretch; }
.mathin { flex: 1; min-height: 44px; border: 2px solid var(--lav2); border-radius: 11px; padding: 8px 11px; font-size: 18px; background: #fff; display: flex; align-items: center;
  font-family: 'Nunito', sans-serif; font-weight: 700; overflow-x: auto; white-space: nowrap; cursor: text; }
.mathin.focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,31,214,.12); }
.mathin .ph { color: #a0a0bc; font-weight: 600; font-size: 15px; }
.mathin .caret { display: inline-block; width: 2px; height: 1.1em; background: var(--blue); animation: blink 1s steps(1) infinite; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }
.fb { margin-top: 8px; border-radius: 10px; padding: 8px 11px; font-size: 15px; }
.fb.ok { background: var(--green-l); color: #0c5a28; }
.fb.no { background: var(--red-l); color: #8a0000; }
.fb.show { background: var(--sun-l); color: #4a3a00; }
.fb .key { font-weight: 800; }
.mark { float: right; font-weight: 800; }
.mark.ok { color: var(--green); } .mark.no { color: var(--red); }
.star { color: var(--gold); }
.gold { border-left: 4px solid var(--gold); padding-left: 10px; }

/* memory card */
.card { background: var(--sun-l); border: 2px solid var(--orange); border-radius: 16px; overflow: hidden; margin: 14px 0; box-shadow: var(--shadow); }
.card .ch { display: flex; align-items: center; gap: 10px; padding: 10px 14px 4px; }
.card .ch img { width: 46px; height: 46px; }
.card .ch b { color: #a14c00; font-size: 17px; }
.card .lbl { font-size: 11.5px; font-weight: 800; letter-spacing: .6px; color: #b35a00; padding: 0 14px; text-transform: uppercase; }
.card .rules { padding: 4px 14px 10px; }
.card .rule { display: flex; gap: 8px; margin: 6px 0; }
.card .rule:before { content: ''; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); margin-top: 8px; }
.card .hooks { background: #e8f6fa; border-top: 2px dashed var(--orange); padding: 10px 14px 12px; }
.card .hooks .lbl { color: #0b7390; padding: 0 0 4px; }
.link { display: inline-flex; align-items: center; gap: 4px; background: var(--teal); color: #fff; font-size: 11.5px; font-weight: 800; border-radius: 6px; padding: 1px 7px; margin-right: 6px; letter-spacing: .3px; }
.hook { margin: 8px 0; }
.sayline { margin-top: 10px; background: #fff; border-radius: 10px; padding: 8px 10px; color: var(--purple); font-weight: 700; }
.covered .rules .rule span, .covered .hook .ht { filter: blur(6px); user-select: none; }
.more { background: #fff8e6; border: 1.5px solid var(--sun); border-radius: 14px; padding: 12px 14px; margin: 14px 0; display: flex; gap: 10px; }
.more img { width: 44px; height: 44px; flex: none; }
.more b { color: #8a6a00; }

/* trap */
.trap .wrong { background: var(--red-l); border-radius: 12px; padding: 10px 12px; }
.trap .right { background: var(--green-l); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.trap .why { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* story */
.panels { display: grid; grid-template-columns: 1fr; gap: 6px; }
.storyfig { background: #fff; border-radius: 12px; border: 1px solid var(--line); margin-top: 10px; padding: 6px; }

/* big picture */
.bp-core { text-align: center; background: var(--blue); color: #fff; border-radius: 14px; padding: 12px; font-weight: 800; }
.bp-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.bp-item { border: 2px solid var(--lav2); border-radius: 14px; padding: 10px 12px; background: #fbfbff; }
.bp-item .tt { display: flex; align-items: center; gap: 8px; color: var(--blue); font-weight: 800; }
.bp-item .tt .tg { margin-left: auto; background: var(--orange); color: #fff; font-size: 12px; border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.score { display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; margin: 6px 0 2px; }
.score i { display: block; aspect-ratio: 1; border-radius: 4px; background: #e6e6ee; font-style: normal; font-size: 9.5px; text-align: center; line-height: 1.9; color: #777; }
.score i.on { background: var(--orange); color: #fff; font-weight: 800; }
.score2 { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; }
.score2 i { font-style: normal; font-size: 10px; text-align: center; padding: 3px 0; border-radius: 4px; background: #e6e6ee; color: #777; }
.score2 i.on { background: var(--purple); color: #fff; }
.links { display: grid; grid-template-columns: 1fr; gap: 6px; }
.links div { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.links .a { background: var(--lav); border-radius: 8px; padding: 3px 8px; flex: 1; }
.links .b { background: var(--purple-l); border-radius: 8px; padding: 3px 8px; flex: 1; }

/* blanks */
.blank { display: inline-block; min-width: 3.2em; border-bottom: 2px solid var(--orange); margin: 0 3px; vertical-align: baseline; }
.blank input { width: 5em; border: 0; background: var(--orange-l); border-radius: 6px 6px 0 0; font: inherit; font-weight: 800; padding: 1px 4px; text-align: center; color: var(--ink); }
.blank.ok input { background: var(--green-l); color: var(--green); }
.blank.no input { background: var(--red-l); color: var(--red); }
.stage { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; font-weight: 800; color: var(--purple); }
.stage .sn { background: var(--purple); color: #fff; border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; font-size: 13px; }
.step { animation: up .25s ease; }
@keyframes up { from { transform: translateY(6px); } to { transform: none; } }

/* match */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.match .col { display: flex; flex-direction: column; gap: 6px; }
.match button { border: 2px solid var(--lav2); background: #fff; border-radius: 10px; padding: 7px 8px; text-align: left; min-height: 42px; }
.match button.sel { border-color: var(--blue); background: var(--lav); }
.match button.paired { border-color: var(--teal); }
.match button .pn { float: right; background: var(--teal); color: #fff; border-radius: 6px; font-size: 12px; padding: 0 6px; font-weight: 800; }

/* problems */
.prob .tags { font-size: 13px; color: var(--muted); font-weight: 700; }
.coach { background: var(--orange-l); border-left: 5px solid var(--orange); border-radius: 12px; padding: 10px 12px; margin: 14px 0; }
.coach b.lab { color: #b35a00; }
.cheat { display: grid; grid-template-columns: 1fr; gap: 8px; }
.cheat .cp { border: 1.5px solid var(--lav2); border-radius: 12px; padding: 9px 11px; }
.cheat .cp b { color: var(--blue); display: block; margin-bottom: 3px; }

/* page nav */
.pagenav { display: flex; gap: 10px; margin-top: 22px; }
.pagenav .btn { flex: 1; }

/* mock & drill */
.timer { font-variant-numeric: tabular-nums; font-weight: 800; background: rgba(255,255,255,.18); border-radius: 99px; padding: 3px 10px; }
.timer.low { background: var(--red); }
.qgrid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin: 10px 0; }
.qgrid button { border: 0; border-radius: 8px; background: #e8e8f2; font-weight: 800; font-size: 13px; padding: 7px 0; }
.qgrid button.has { background: var(--lav2); color: var(--blue); }
.qgrid button.cur { outline: 3px solid var(--orange); }
.qgrid button.ok { background: var(--green); color: #fff; } .qgrid button.no { background: var(--red); color: #fff; }
.big { font-size: 40px; font-weight: 800; line-height: 1.1; }
.result { text-align: center; }
.medal { display: inline-grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; color: #fff; font-weight: 800; margin: 8px; box-shadow: var(--shadow); }
.medal.gold { background: var(--gold); } .medal.silver { background: var(--silver); } .medal.bronze { background: var(--bronze); } .medal.pass { background: var(--teal); } .medal.try { background: #9a9ab4; }
.secres { display: flex; gap: 10px; justify-content: center; margin: 10px 0; }
.secres div { background: var(--card); border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow); min-width: 120px; }
.secres .p { font-weight: 800; }
.secres .y { color: var(--green); } .secres .n { color: var(--red); }
.dq { font-size: 26px; text-align: center; padding: 26px 8px 18px; }
.stars { font-size: 30px; letter-spacing: 4px; }

/* keypad */
.keypad { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #e9eaf3; border-top: 1px solid #cfd0e0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 18px rgba(0,0,40,.12); }
.keypad .rowk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-width: 560px; margin: 0 auto 6px; }
.keypad button { border: 0; border-radius: 10px; background: #fff; font-size: 19px; font-weight: 700; padding: 10px 0; box-shadow: 0 1px 0 #c7c8d8; font-family: 'Nunito', sans-serif; }
.keypad button.op { background: #f3f3fb; color: var(--blue); }
.keypad button.go { background: var(--blue); color: #fff; }
.keypad button.del { background: #f3f3fb; }
.keypad .hint { text-align: center; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; background: #1d1d35; color: #fff; border-radius: 99px; padding: 9px 18px; font-weight: 800; z-index: 60; box-shadow: var(--shadow); }
.xpfly { color: var(--sun); }

@media (min-width: 640px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .bp-grid { grid-template-columns: 1fr 1fr; }
  .panels { grid-template-columns: 1fr 1fr; }
  .cheat { grid-template-columns: 1fr 1fr; }
  .links { grid-template-columns: 1fr 1fr; }
}
.work { overflow-x: auto; max-width: 100%; }
.nb { white-space: nowrap; }
/* every button sets its own text colour: phones in dark mode otherwise give white text on white keys */
button { color: var(--ink); }
.keypad button { color: var(--ink); }
.keypad button.op { color: var(--blue); }
.keypad button.go { color: #fff; }
.match button, .qgrid button { color: var(--ink); }
.qgrid button.has { color: var(--blue); }
.qgrid button.ok, .qgrid button.no { color: #fff; }
.seg button { color: var(--blue); }
.blank input { color: var(--ink); }
/* Khmer: lines break only between words (the words are marked in the content) */
.kw { white-space: nowrap; }
.head .ht, .stage > span:last-child { min-width: 0; }
/* full book (2026-10-26): highlights, boxes and inline arrows from the LaTeX, Explore cards */
.hl { background: #FFDEAA; border-radius: 3px; padding: 0 2px; }
.boxed { display: inline-block; border: 1.5px solid var(--ink); padding: 0 5px; min-width: 1.2em; text-align: center; line-height: 1.3; }
img.fig.inl { display: inline-block; height: 1.1em; width: auto; margin: 0 4px; vertical-align: middle; }
.stop.sub { margin-left: 26px; padding: 8px 12px; border-style: dashed; }
.stop.sub .dot { width: 26px; height: 26px; border-width: 2px; color: var(--teal); border-color: var(--teal-l); }
.blk.explore .simbody { min-height: 40px; }
.figwrap { text-align: center; }
/* long formulas on a phone: shrink to the width of their box instead of pushing the page sideways */
mjx-container[jax="SVG"] { max-width: 100%; }
mjx-container[jax="SVG"] > svg { max-width: 100%; height: auto; }
.nb mjx-container[jax="SVG"] { max-width: calc(100% - 0.9em); }
mjx-container[jax="SVG"][display="true"] { overflow-x: auto; overflow-y: hidden; }
@media (max-width: 430px) {
  .say .ava { width: 42px; height: 42px; }
  .say { gap: 7px; }
}
/* MathJax's hidden copy for screen readers keeps the formula's full width: keep it tiny so it cannot widen the page */
mjx-assistive-mml { max-width: 1px !important; overflow: hidden !important; }
/* wide tables scroll inside their own box on a phone */
.tabwrap { max-width: 100%; overflow-x: auto; }
@media (max-width: 430px) { table.tab td { padding: 4px 6px; font-size: 14px; } }

/* ---------- accounts, coach dashboard, assigned work (platform 2026-10-26; only seen with a server) ---------- */
.form .field { display: block; margin: 0 0 12px; }
.form .field > span { display: block; font-weight: 800; font-size: 14.5px; margin-bottom: 4px; color: var(--ink); }
.form input, .form select, .form textarea { width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: #fff; border: 2px solid var(--lav2); border-radius: 11px; padding: 10px 12px; min-height: 46px; }
.form textarea { min-height: 150px; line-height: 1.5; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,31,214,.12); }
.form input.pinbox { font-size: 26px; letter-spacing: 12px; text-align: center; font-weight: 800; font-family: 'Nunito', sans-serif; }
.form .field[hidden] { display: none; }
.msg { border-radius: 10px; padding: 9px 12px; font-size: 15px; margin: 8px 0; }
.msg.err { background: var(--red-l); color: #8a0000; }
.msg.ok { background: var(--green-l); color: #0c5a28; }
.msg.warn { background: var(--sun-l); color: #5a4500; }
.signhero { margin-bottom: 4px; }
.acct { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; font-weight: 800; font-size: 15px; }
.acct a { text-decoration: none; }
div > .acct + .btn { margin-top: 6px; }
div > .btn.block + .btn.block { margin-top: 8px; }
.pend { background: var(--sun-l); color: #6a5200; border-radius: 99px; padding: 1px 9px; font-size: 13px; }
.late { color: var(--red) !important; font-weight: 800; }
.assigned .arow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.assigned .arow:first-of-type { border-top: 0; }
.assigned .arow .tick { width: 30px; height: 30px; border-radius: 50%; background: var(--orange-l); color: #b35a00; display: grid; place-items: center; font-weight: 800; flex: none; }
.assigned .arow.done .tick { background: var(--green); color: #fff; }
.assigned .arow .body { flex: 1; min-width: 0; }
.assigned .arow .body b { display: block; line-height: 1.3; font-size: 15.5px; }
.assigned .arow .body small { color: var(--muted); font-size: 13.5px; }
.assigned .arow .go { color: var(--blue); font-weight: 800; font-size: 20px; }
.assigned .arow.done b { color: var(--muted); }
.sumrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 12px; }
.sumrow div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; box-shadow: var(--shadow); }
.sumrow b { display: block; font-size: 20px; color: var(--blue); }
.sumrow span { font-size: 12.5px; color: var(--muted); }
.scard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 11px 13px; margin-bottom: 9px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.scard .sh { display: flex; align-items: center; gap: 8px; }
.scard .sh b { flex: 1; min-width: 0; font-size: 16px; }
.scard .xp { font-weight: 800; color: var(--blue); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip { display: inline-block; font-size: 12.5px; font-weight: 700; border-radius: 99px; padding: 1px 8px; background: var(--lav); color: var(--blue); white-space: nowrap; }
.chip.m-gold { background: var(--gold); color: #fff; } .chip.m-silver { background: var(--silver); color: #fff; } .chip.m-bronze { background: var(--bronze); color: #fff; }
.chip.m-pass { background: var(--teal); color: #fff; } .chip.m-none { background: #ececf4; color: var(--muted); }
.chip.lockc { background: var(--red-l); color: var(--red); }
.chip.yes { background: var(--green-l); color: #0c5a28; } .chip.no { background: #f0f0f6; color: var(--muted); }
.who { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.witem { border-top: 1px solid var(--line); padding: 9px 0; }
.witem:first-of-type { border-top: 0; }
.witem .wl { display: flex; flex-direction: column; gap: 1px; }
.witem .wq { margin-top: 6px; background: #fafaff; border-radius: 8px; padding: 6px 9px; }
.witem .key { font-weight: 800; }
.wbar { height: 7px; border-radius: 9px; background: #ececf4; overflow: hidden; margin-top: 6px; }
.wbar i { display: block; height: 100%; background: var(--red); border-radius: 9px; }
.wbar.ok i { background: var(--green); }
.linkbox input { margin: 8px 0; width: 100%; font-size: 13px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .5px; }
.ctools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin: 2px 0 6px; }
.staff .xpchip { display: none; }
.blk > .head .pill { white-space: nowrap; }
/* login slips: one per student, cut along the dashed lines */
.slips { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
.slip { background: #fff; border: 2px dashed #9a9ab4; border-radius: 12px; padding: 12px 14px; break-inside: avoid; page-break-inside: avoid; }
.slip .sl-h { font-weight: 800; color: var(--blue); font-size: 14px; }
.slip .sl-c { font-size: 13px; color: var(--muted); }
.slip .sl-n { font-size: 19px; font-weight: 800; margin: 4px 0 6px; }
.slip .sl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding: 5px 0; }
.slip .sl-row span { font-size: 13px; color: var(--muted); }
.slip .sl-row b { font-size: 22px; }
.slip .sl-u { font-size: 13px; font-weight: 700; word-break: break-all; margin-top: 4px; }
.slip .sl-i { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
@media (min-width: 640px) { .slips { grid-template-columns: 1fr 1fr; } .sumrow { grid-template-columns: repeat(4, 1fr); } }
@media print {
  @page { margin: 10mm; }
  body { background: #fff; }
  body::before, .top, .msg, .btn, .toast, .keypad { display: none !important; }
  main { padding: 0; max-width: none; }
  .slips { grid-template-columns: 1fr 1fr; gap: 6mm; }
}
/* teach view: projector-friendly, everything larger (coaches only) */
body.teach main { max-width: 1180px; zoom: 1.35; }
body.teach .top .t b { font-size: 19px; }
@media (max-width: 700px) { body.teach main { zoom: 1.15; } }

/* ---------- roles brief 2026-10-26: fees, receipts, parent slips, school overview, personal bests, portfolio ---------- */
.seg.small button { font-size: 13.5px; padding: 6px 4px; }
.chip.paid { background: var(--green-l); color: #0c5a28; } .chip.unpaid { background: var(--sun-l); color: #6a5200; }
.chip.tg { background: #e3f1fb; color: #0b5c8a; }
.chip.st-tutor { background: var(--blue); color: #fff; } .chip.st-teacher { background: var(--teal-l); color: #0b6a84; } .chip.st-manager { background: var(--purple-l); color: var(--purple); } .chip.st-admin { background: #ececf4; color: var(--muted); }
.witem.voided { opacity: .62; } .witem.voided b { text-decoration: line-through; }
.payrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; } .payrow .wl { flex: 1; min-width: 150px; } .payrow > div:last-child { flex-basis: 100%; }
.payform { background: #fafaff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 6px; }
.admintools { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.form.inline { display: flex; gap: 8px; align-items: flex-end; flex: 1; min-width: 220px; } .form.inline .field { flex: 1; margin: 0; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 12px; font-size: 15px; } .check input { width: 22px; height: 22px; min-height: 0; flex: none; margin-top: 2px; }
/* receipt */
.receipt { background: #fff; border: 2px solid var(--lav2); border-radius: 14px; padding: 16px; margin-top: 12px; position: relative; overflow: hidden; }
.receipt .rc-h { display: flex; gap: 10px; align-items: center; border-bottom: 3px solid var(--blue); padding-bottom: 8px; }
.receipt .rc-h img { width: 40px; height: 40px; } .receipt .rc-h b { display: block; color: var(--blue); font-size: 18px; } .receipt .rc-h small { color: var(--muted); font-size: 12.5px; }
.receipt .rc-t { text-align: center; font-weight: 800; letter-spacing: 1px; margin: 10px 0 6px; font-size: 17px; }
.receipt .rc-row { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 7px 0; }
.receipt .rc-row > span { color: var(--muted); font-size: 13px; flex: none; max-width: 45%; } .receipt .rc-row > b { text-align: right; }
.receipt .rc-amt { font-size: 22px; color: var(--green); }
.receipt .rc-f { text-align: center; margin-top: 12px; font-weight: 800; } .receipt .rc-f small { font-weight: 400; color: var(--muted); }
.receipt .rc-void { position: absolute; top: 42%; left: -10%; right: -10%; transform: rotate(-14deg); text-align: center; font-size: 34px; font-weight: 900; color: rgba(204,0,0,.55); border: 4px solid rgba(204,0,0,.45); background: rgba(255,255,255,.6); }
.receipt .rc-void small { display: block; font-size: 13px; font-weight: 700; }
/* parent slips */
.pslip .ps-b { display: flex; gap: 12px; align-items: center; margin: 4px 0; }
.pslip .qr { flex: none; width: 128px; height: 128px; } .pslip .qr svg { display: block; width: 128px; height: 128px; }
.pslip .ps-r { min-width: 0; flex: 1; } .pslip .ps-code { display: block; font-size: 24px; letter-spacing: 2px; margin: 2px 0 4px; }
/* personal bests */
.spark { flex: none; vertical-align: middle; margin-left: 6px; }
.tile .spark { margin-right: 4px; }
.medals { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.medal.honour { background: linear-gradient(135deg, #6b2fbf, #b0369a); color: #fff; }
.pb { margin: 10px auto 2px; max-width: 420px; background: var(--lav); border-radius: 12px; padding: 9px 12px; font-size: 15px; position: relative; }
.pb.new { background: linear-gradient(135deg, #fff1c2, #ffd76a); color: #5a3d00; display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: center; align-items: baseline; }
.pb.new b { font-size: 18px; flex-basis: 100%; } .pb .pbn { font-size: 22px; font-weight: 900; } .pb .gain { background: var(--green); color: #fff; border-radius: 99px; padding: 0 9px; font-weight: 800; }
.pb.first { background: var(--teal-l); } .pb.same { background: var(--green-l); }
.pb.anim { animation: pbpop .7s cubic-bezier(.2,1.6,.4,1) both; }
.pb .spk { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); top: 50%; left: 50%; opacity: 0; }
.pb.anim .spk { animation: spark 1s ease-out .2s both; } .pb.anim .spk.s2 { background: var(--blue); animation-delay: .3s; --dx: -80px; } .pb.anim .spk.s3 { background: var(--green); animation-delay: .4s; --dx: 70px; --dy: 30px; }
@keyframes pbpop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes spark { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(var(--dx, 60px), var(--dy, -40px)) scale(.3); } }
@media (prefers-reduced-motion: reduce) { .pb.anim, .pb.anim .spk { animation: none; } }
.goal { color: #6a3d00; font-weight: 700; }
.pbline { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; background: #fafaff; border-radius: 10px; padding: 6px 10px; margin: 6px 0; }
.pbline.center { justify-content: center; }
.journey .medalrow, .sclass .medalrow { margin: 4px 0 6px; }
.medalrow { display: flex; flex-wrap: wrap; gap: 6px; }
.medalrow .md { border-radius: 99px; padding: 2px 10px; font-size: 14px; background: #f0f0f6; white-space: nowrap; }
.md.m-gold { background: #fff3c4; } .md.m-silver { background: #eceef3; } .md.m-bronze { background: #f6e3d2; } .md.m-honour { background: #efe3fb; }
.jbest { margin: 4px 0; }
/* rating card */
.stars5 { display: flex; gap: 6px; margin: 4px 0 8px; }
.stars5 .star { font-size: 30px; line-height: 1; background: none; border: 0; color: #c9c9d9; padding: 4px; min-width: 44px; min-height: 44px; }
.stars5 .star.on { color: var(--gold); }
.ratecm { width: 100%; font: inherit; font-size: 15px; border: 2px solid var(--lav2); border-radius: 10px; padding: 8px; margin-bottom: 8px; }
/* coach portfolio */
.pf { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 0 0 12px; margin: 10px 0; overflow: hidden; }
.pf > *:not(.pf-band) { margin-left: 14px; margin-right: 14px; }
.pf-band { display: flex; align-items: center; gap: 8px; background: var(--blue); color: #fff; padding: 8px 14px; } .pf-band img { width: 26px; height: 26px; background: #fff; border-radius: 6px; }
.pf-band span { margin-left: auto; font-size: 13px; opacity: .9; }
.pf-id { display: flex; gap: 12px; align-items: center; margin-top: 12px; } .pf-id h2 { margin: 0 0 2px; font-size: 21px; }
.pf-photo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; border: 3px solid var(--lav2); }
.pf-initial { display: grid; place-items: center; font-size: 34px; font-weight: 900; color: var(--blue); background: var(--lav); }
.pf-cert { display: inline-block; margin-top: 4px; background: #fff3c4; color: #5a3d00; border-radius: 99px; padding: 2px 10px; font-size: 13px; font-weight: 800; }
.pf-bio { font-size: 15.5px; }
.pf-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pf-tiles > div { background: var(--lav); border-radius: 12px; padding: 9px 10px; }
.pf-tiles b { display: block; font-size: 24px; color: var(--blue); line-height: 1.2; } .pf-tiles b i { font-style: normal; color: var(--gold); font-size: 15px; }
.pf-tiles span { display: block; font-weight: 800; font-size: 13px; } .pf-tiles small { color: var(--muted); font-size: 12px; }
.pf-mock { margin-top: 10px; font-size: 13.5px; background: #fafaff; border: 1px dashed var(--lav2); border-radius: 10px; padding: 7px 10px; }
.pf-com { margin-top: 10px; } .pf-com blockquote { margin: 6px 0; background: #fafaff; border-left: 4px solid var(--orange); border-radius: 8px; padding: 6px 10px; }
.pf-com blockquote small { display: block; color: var(--muted); font-size: 12px; }
table.stats { border-collapse: collapse; font-size: 13.5px; min-width: 640px; } table.stats th, table.stats td { border-bottom: 1px solid var(--line); padding: 6px 7px; text-align: left; vertical-align: top; }
table.stats th { cursor: pointer; background: var(--lav); white-space: nowrap; } table.stats th.on { background: var(--lav2); }
@media (min-width: 640px) { .pf-tiles { grid-template-columns: repeat(4, 1fr); } }
@media print {
  .noprint { display: none !important; }
  .pf { box-shadow: none; border: 0; } .receipt { border: 0; }
  .pf-band, .pf-tiles > div, .pf-cert, .pb { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
a.btn { display: inline-block; text-decoration: none; }

/* ---------- staff roles 2026-10-26: owner / office / head badges, activity log, Excel import, fees in Feynman SMC ---------- */
.chip.st-owner { background: var(--orange); color: #fff; } .chip.st-office { background: var(--orange-l); color: #9a4d00; } .chip.st-head { background: var(--purple); color: #fff; }
.chip.smc { background: #ececf4; color: var(--muted); font-size: 11.5px; } .chip.dup { background: var(--sun-l); color: #6a5200; }
.schoolh { margin: 14px 2px 4px; font-size: 16px; color: var(--blue); }
.witem.act { display: flex; gap: 10px; align-items: flex-start; } .witem.act .wl { flex: 1; min-width: 0; } .witem.act b { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.act-i { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--lav); display: grid; place-items: center; font-size: 15px; }
.witem.act .mono { font-size: 11.5px; opacity: .75; }
.pagenav .muted { align-self: center; }
.improw { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); } .improw:first-of-type { border-top: 0; }
.improw .imn { width: 26px; flex: none; color: var(--muted); font-size: 12.5px; text-align: right; } .improw .imb { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.improw.skip .imb b { color: var(--muted); }
.smcnote .btn { margin-top: 8px; } .feeplace { margin-top: 10px; }
.stools .stslot { flex-basis: 100%; } .stools .stslot:empty { display: none; }
.actfilter { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; align-items: end; } .actfilter .field { margin: 0 0 8px; min-width: 0; } .actfilter .field input, .actfilter .field select { min-width: 0; width: 100%; } .actfilter > .btn { grid-column: 1 / -1; }

/* ---------- student join brief 2026-10-27: class QR, trial and lock, term codes, verification, overview ---------- */
.chip.s-trial { background: var(--teal-l); color: #0b6a84; } .chip.s-paid { background: var(--green-l); color: #0c5a28; } .chip.s-grace { background: var(--sun-l); color: #6a5200; }
.chip.s-locked { background: var(--red-l); color: var(--red); } .chip.s-free { background: var(--purple-l); color: var(--purple); } .chip.s-new { background: var(--orange-l); color: #9a4d00; }
.chip.flag { background: var(--red-l); color: #8a0000; font-weight: 700; }
.termbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-size: 15px; background: var(--teal-l); color: #0b4f63; }
.termbar.grace { background: var(--sun-l); color: #5a4500; } .termbar a { font-weight: 800; margin-left: auto; }
.lockcard { text-align: center; } .lockcard .lk { font-size: 46px; line-height: 1.1; } .lockcard h2 { margin: 6px 0; }
.tile.tlock { opacity: .7; } .tile.tlock .go { font-size: 18px; }
.unamebox { text-align: center; background: var(--lav); border: 3px dashed var(--blue); border-radius: 16px; padding: 14px; margin: 10px 0; }
.unamebox b { display: block; font-size: 34px; letter-spacing: 1px; color: var(--blue); word-break: break-all; user-select: all; margin: 6px 0; }
.joinbox { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.joinbox .qr { flex: none; background: #fff; padding: 6px; border-radius: 10px; line-height: 0; } .joinbox .qr svg { width: 140px; height: 140px; }
.joinbox .jr { flex: 1; min-width: 180px; } .joinbox .jcode { font-size: 26px; letter-spacing: 3px; display: block; margin: 2px 0; }
.counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; } .counts button { border: 0; cursor: pointer; font: inherit; }
.counts .chip { font-size: 13.5px; padding: 4px 11px; } .counts .chip.on { outline: 3px solid var(--blue); }
.ovtab { border-collapse: collapse; font-size: 13.5px; width: 100%; } .ovtab th, .ovtab td { border-bottom: 1px solid var(--line); padding: 5px 6px; text-align: right; } .ovtab th:first-child, .ovtab td:first-child { text-align: left; }
.tsheet { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; margin-bottom: 6mm; }
.tcard { border: 2px dashed #8a8aa8; border-radius: 10px; padding: 3mm 4mm; display: flex; gap: 3mm; align-items: center; height: 50mm; box-sizing: border-box; background: #fff; overflow: hidden; }
.tcard .qr { flex: none; line-height: 0; } .tcard .qr svg { width: 30mm; height: 30mm; }
.tcard .tc { min-width: 0; } .tcard .tc-h { color: var(--blue); font-weight: 900; font-size: 15px; } .tcard .tc-l { font-size: 12px; color: var(--muted); }
.tcard .tc-m { font-weight: 800; font-size: 14px; margin-top: 2px; } .tcard .tc-c { font-size: 21px; letter-spacing: 2px; font-weight: 900; margin: 3px 0; white-space: nowrap; } .tcard .tc-o { font-size: 11.5px; }
@media screen and (max-width: 640px) { .tsheet { grid-template-columns: 1fr; } }
@media print {
  .tsheet { break-after: page; page-break-after: always; margin: 0; }
  .tcard { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* new version notice (app.js checkUpdate) */
.newver { position: fixed; left: 12px; right: 12px; bottom: 16px; z-index: 70; display: flex; align-items: center; gap: 12px; justify-content: space-between; background: #1d1d35; color: #fff; border-radius: 16px; padding: 10px 12px 10px 16px; box-shadow: var(--shadow); font-weight: 700; max-width: 560px; margin: 0 auto; }
.newver button { background: #ffb020; color: #1d1d35; border: 0; border-radius: 99px; padding: 8px 16px; font: inherit; font-weight: 800; cursor: pointer; white-space: nowrap; }
@media print { .newver { display: none !important; } }

/* Levels (Pre-2nd Kyu, 27 Oct 2026): level chip, Levels page, start-page level choice, the lines table, Pre-2 blocks */
.hero .lvchip { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 99px; background: rgba(255,255,255,.22); color: #fff; font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.tile.level.cur { outline: 2px solid var(--blue); }
.lvseg { flex-wrap: wrap; }
.lvseg button { min-height: 40px; }
.tab.lines { width: 100%; }
.tab.lines th, .tab.lines td { text-align: center; padding: 4px 6px; }
.tab.lines th:first-child { text-align: left; white-space: nowrap; }
.tab.lines td small { opacity: .6; font-size: 11px; }
.more.hint { background: #fff8e6; }
.proof { border: 1.5px solid #8f93f0; border-radius: 10px; padding: 8px 10px; margin: 6px 0; background: var(--card); }
.tmtab { color: #7a1fa2; letter-spacing: .3px; }

/* 8th Kyu: the book's empty writing box in a question (\wbox); the answer itself goes in the field below */
.wbox { display: inline-block; width: 2.6em; height: 1.25em; border: 1.5px solid #9a9ab8; border-radius: 5px; vertical-align: -.25em; margin: 0 .2em; background: var(--card); }
.tbox { border: 1.5px solid var(--ink); border-radius: 10px; padding: 6px 10px; margin: 6px 0; background: var(--card); }

/* The Levels page as the Suken pathway (CEO 27–28 Oct 2026: academic, simple and elegant): stages, grade seals, the Gold line */
.lvintro { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px 16px; margin-bottom: 12px; text-align: center;
  box-shadow: 0 1px 2px rgba(20,20,60,.05); }
.lvintro h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; color: #14175e; letter-spacing: .2px; font-family: Georgia, 'Noto Serif', 'Times New Roman', serif; }
body.km .lvintro h1 { font-family: 'Kantumruy Pro', var(--font); font-size: 23px; }
.lvintro h1::after { content: ""; display: block; width: 44px; height: 2px; margin: 9px auto 0; background: #c9a227; border-radius: 2px; }
.lvintro p { margin: 0; font-size: 14.5px; color: var(--muted); }
.lvprog .md { border-radius: 99px; padding: 2px 10px; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.lvpath { position: relative; padding-left: 0; }
.lvstage { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 22px 2px 10px; padding: 0 0 6px;
  border-bottom: 1.5px solid currentColor; }
.lvstage b { font-size: 13px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; }
body.km .lvstage b { font-size: 15px; letter-spacing: 0; }
.lvstage span { font-size: 12.5px; color: var(--muted); }
.lvstage.st1 { color: #c25400; } .lvstage.st2 { color: var(--blue); } .lvstage.st3 { color: #7a1a8a; }
.lvcard { position: relative; display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 12px 12px 12px; margin: 0 0 10px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.lvcard { align-items: center; }
.lvcard .seal { flex: none; width: 58px; height: 58px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2.5px solid currentColor; background: #fff; line-height: 1; }
.lvcard.st1 .seal { color: #d35d00; } .lvcard.st2 .seal { color: var(--blue); } .lvcard.st3 .seal { color: #800080; }
.lvcard .seal .gw { font-size: 10.5px; font-weight: 800; letter-spacing: .3px; white-space: nowrap; }
.lvcard .seal .gn { font-size: 24px; font-weight: 800; margin-top: 1px; }
body.km .lvcard .seal .gn { font-size: 22px; }
.lvcard .lvbody { flex: 1; min-width: 0; }
.lvcard .lvtop { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lvcard .lvtop b { font-size: 16.5px; }
.lvchipst { font-size: 12px; font-weight: 800; border-radius: 99px; padding: 2px 9px; white-space: nowrap; }
.lvchipst.cur { background: var(--blue); color: #fff; } .lvchipst.ok { background: var(--lav); color: var(--blue); }
.lvchipst.ask { background: #f0f0f6; color: var(--muted); white-space: normal; } .lvchipst.soon { background: #f0f0f6; color: var(--muted); }
.lvcard .lvgold { margin-top: 4px; font-size: 14px; color: #6b5300; font-weight: 700; }
.lvcard .lvprog { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 7px; font-size: 13.5px; font-weight: 700; }
.lvcard .go { align-self: center; color: var(--blue); font-weight: 800; font-size: 22px; }
.lvcard { box-shadow: 0 1px 2px rgba(20,20,60,.05); }
.lvcard.cur { border: 1.5px solid var(--blue); box-shadow: 0 0 0 4px var(--lav); }
.lvcard.locked:not(.cur) { opacity: .92; }
.lvcard.soon { border-style: dashed; box-shadow: none; background: transparent; }
.lvcard.soon .seal { filter: grayscale(1); opacity: .55; }
.lvcard.soon .lvtop b { color: var(--muted); }

/* Junior look (Grades 4–6, 8th Kyu first; CEO: "more fun and creativity"): warmer colours, the cast on the banner */
/* CEO 28 Oct: "the color seems too bright orange": a deeper, calmer burnt orange (white text reads better on it too) */
body.junior .top, body.junior::before { background: linear-gradient(90deg, #b5531d, #cf7a34); }
body.junior .hero { background-color: #c2621f; border-bottom-color: var(--blue); position: relative; overflow: hidden;
  background-image: radial-gradient(rgba(255,255,255,.14) 2px, transparent 2.5px), radial-gradient(rgba(255,255,255,.07) 2px, transparent 2.5px);
  background-size: 26px 26px, 26px 26px; background-position: 0 0, 13px 13px; padding-bottom: 76px; }
body.junior .hero .mascots { position: absolute; right: 10px; bottom: 0; display: flex; align-items: flex-end; gap: 2px; pointer-events: none; }
body.junior .hero .mascots img { height: 70px; width: auto; animation: jr-bob 3.2s ease-in-out infinite; }
body.junior .hero .mascots img:nth-child(2) { animation-delay: .4s; }
body.junior .hero .mascots img.tokay { height: 54px; margin-bottom: 4px; animation-delay: .8s; }
body.junior .tile .num { background: var(--sun-l); color: #b35400; border-radius: 50%; }
body.junior .tiles .tile:nth-child(3n+2) .num { background: var(--teal-l); color: #0d6f8c; }
body.junior .tiles .tile:nth-child(3n) .num { background: var(--purple-l); color: #800080; }
body.junior .blk { border-radius: 18px; }
body.junior button, body.junior .btn { border-radius: 14px; }
@keyframes jr-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { body.junior .hero .mascots img { animation: none; } }

/* Trial to Pay (2026-10-28): the 14-day path on the student's home, and the pay screen (#/pay) */
.trialpath .tdots { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin: 10px 0 12px; }
.trialpath .tdots i { height: 18px; border-radius: 6px; background: var(--line); font-style: normal; font-size: 11px; font-weight: 800; color: #fff; display: grid; place-items: center; }
.trialpath .tdots i.past { background: #9fd4b0; }
.trialpath .tdots i.task { box-shadow: inset 0 -3px 0 var(--orange); }
.trialpath .tdots i.now { background: var(--green); transform: scale(1.12); }
.trialpath .ttask { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); background: var(--green-l); border: 1.5px solid var(--green); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.trialpath .ttask .lab { font-size: 12px; font-weight: 800; color: var(--green); white-space: nowrap; }
.trialpath .ttask b { flex: 1; font-size: 15px; }
.trialpath .ttask .arr { font-size: 22px; font-weight: 800; color: var(--green); }
.trialpath .ttask.done { justify-content: center; font-weight: 800; }
.trialpath .tsteps { list-style: none; margin: 0; padding: 0; }
.trialpath .tsteps li { display: flex; align-items: baseline; gap: 8px; padding: 6px 2px; border-top: 1px solid var(--line); font-size: 14px; }
.trialpath .tsteps .dd { flex: none; width: 54px; font-size: 12px; font-weight: 800; color: var(--muted); }
.trialpath .tsteps .tx { flex: 1; }
.trialpath .tsteps .ck { flex: none; color: var(--green); font-weight: 800; }
.trialpath .tsteps li.done .tx { color: var(--muted); text-decoration: line-through; }
.trialpath .tsteps li.next .tx { font-weight: 800; }
.paystate .pline { font-size: 17px; font-weight: 800; }
.paystate .pkept { margin-top: 6px; font-size: 15px; }
.paystate .pkept .md { border-radius: 99px; padding: 1px 9px; font-weight: 700; }
.paystate .pprices { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 15px; }
.payway.soon { opacity: .8; }

/* ---------- Easy enrol 2026-10-28: share buttons, the parent link, the class poster (#/coach/c/<id>/qr) ---------- */
.joinbox > .btns, .joinbox > .parentbox, .joinbox > .form, .joinbox > p { flex-basis: 100%; }
.btn.tg { background: #229ed9; color: #fff; } .btn.fb { background: #1877f2; color: #fff; }
.parentbox { background: var(--lav); border-radius: 12px; padding: 10px 12px; } .parentbox .btns { margin-top: 6px; }
.poster { background: #fff; color: #14175e; border: 1.5px solid #c9cbe6; border-radius: 6px; padding: 28px 30px 22px; margin: 12px auto; max-width: 760px; text-align: center; box-shadow: var(--shadow); }
.poster .pz-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid #14175e; padding-bottom: 8px; font-size: 14px; letter-spacing: .3px; }
.poster .pz-brand { font-weight: 800; color: var(--blue); font-size: 17px; } .poster .pz-lv { color: #4a4d7a; }
.poster .pz-c { font-family: Georgia, 'Noto Serif', 'Times New Roman', serif; font-size: 44px; font-weight: 700; margin: 22px 0 4px; line-height: 1.15; overflow-wrap: anywhere; }
.poster .pz-s { margin: 0; font-size: 17px; color: #4a4d7a; }
.poster .pz-free { display: inline-block; margin: 16px 0 6px; padding: 6px 22px; border-radius: 99px; background: #fff4d6; color: #6a4a00; font-weight: 800; font-size: 19px; border: 1.5px solid #f0c75a; }
.poster .pz-qrs { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 18px 0 6px; }
.poster.one .pz-qrs { grid-template-columns: 1fr; max-width: 360px; margin-left: auto; margin-right: auto; }
.poster .pz-q { border: 1.5px solid #dcdcf0; border-radius: 14px; padding: 14px 10px; display: flex; flex-direction: column; gap: 3px; align-items: center; }
.poster .pz-qi { line-height: 0; width: 100%; } .poster .pz-qi svg { width: 100%; max-width: 250px; height: auto; }
.poster .pz-q b { font-size: 19px; margin-top: 6px; } .poster .pz-q > span { font-size: 15px; } .poster .pz-q .km { font-family: 'Kantumruy Pro', sans-serif; }
.poster .pz-code { margin-top: 14px; } .poster .pz-code .pz-cl { display: block; font-size: 14px; color: #4a4d7a; } .poster .pz-code b { font-size: 40px; letter-spacing: 6px; }
.poster .pz-url { margin: 4px 0 12px; font-size: 16px; font-weight: 700; color: var(--blue); word-break: break-all; }
.poster .pz-f { margin: 0; border-top: 1px solid #dcdcf0; padding-top: 8px; font-size: 12.5px; color: #6a6c90; }
@media (max-width: 560px) { .poster { padding: 18px 14px; } .poster .pz-qrs { grid-template-columns: 1fr; } .poster .pz-c { font-size: 32px; } .poster .pz-free { font-size: 15.5px; padding: 6px 14px; } }
@media print {
  .poster { box-shadow: none; border: 0; margin: 0 auto; max-width: none; padding: 0; }
  .poster .pz-free { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .poster:not(.one) .pz-qrs { grid-template-columns: 1fr 1fr; }
  /* fill the A4 sheet for the classroom wall */
  .poster .pz-c { font-size: 58px; margin-top: 34px; } .poster .pz-s { font-size: 20px; }
  .poster .pz-free { font-size: 24px; margin: 26px 0 10px; }
  .poster .pz-qrs { gap: 28px; margin: 26px 0 10px; } .poster .pz-q { padding: 20px 12px; }
  .poster .pz-qi svg { max-width: 310px; } .poster .pz-q b { font-size: 22px; } .poster .pz-q > span { font-size: 17px; }
  .poster .pz-code { margin-top: 24px; } .poster .pz-code b { font-size: 52px; } .poster .pz-url { font-size: 19px; margin-bottom: 26px; }
}

/* ---------- Coach helps 2026-10-28: Ask my coach, My questions, Questions, the trial board ---------- */
.askme { margin-top: 6px; text-align: right; } .askme .askform { text-align: left; margin-top: 6px; }
.asklink { border: 0; background: none; color: var(--blue); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; padding: 4px 2px; opacity: .85; }
.asklink:hover { opacity: 1; text-decoration: underline; }
.askform textarea, .ansform textarea { width: 100%; box-sizing: border-box; min-height: 74px; resize: vertical; font: inherit; }
.termbar.askbar { background: var(--lav); color: var(--blue-d); text-decoration: none; } .termbar.askbar b { margin-left: auto; }
a.asklinkbar { display: block; margin: 6px 2px; font-size: 14.5px; font-weight: 700; color: var(--blue); text-decoration: none; }
.qlist { margin-top: 8px; } .qcard { margin: 10px 0; } .qcard.open { border-left: 4px solid var(--sun, #ffb020); } .qcard.new { border-left: 4px solid var(--blue); }
.qcard .qh { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .qcard .qh .chip { margin-left: auto; } .qcard .qh .chip + .chip { margin-left: 0; }
.qcard .qb { margin: 8px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; } .qcard .qa { margin: 6px 0 0; padding: 8px 10px; background: var(--lav); border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.helpcards { display: grid; gap: 8px; margin-bottom: 6px; } .helpcard .num { font-size: 22px; } .helpcard.hot { outline: 3px solid var(--sun, #ffb020); }
@media (min-width: 640px) { .helpcards { grid-template-columns: 1fr 1fr; } }
.tboard { margin: 10px 0; } .tboard .tbh a { color: inherit; text-decoration: none; } .tboard .tbh b { font-size: 16.5px; }
.tboard .tbs { display: inline-block; margin: 6px 0 4px; padding: 3px 10px; border-radius: 99px; font-size: 13.5px; font-weight: 700; background: var(--teal-l); color: #0b6a84; }
.tboard .tbs.soon { background: var(--sun-l); color: #6a5200; } .tboard .tbs.grace { background: var(--sun-l); color: #6a5200; } .tboard .tbs.locked { background: var(--red-l); color: var(--red); }
.tboard .tbf { display: flex; flex-direction: column; gap: 2px; font-size: 14px; } .tboard .tbf small { color: var(--muted); }
.warnline { color: #8a4b00; } .tboard p { margin: 4px 0; }

/* ---------- the funnel 2026-10-28 (#/admin/funnel) ---------- */
.funnel .fstep { margin: 8px 0 12px; } .funnel .fl { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14.5px; }
.funnel .fl b { font-size: 20px; color: #14175e; } .funnel .fl small { font-size: 13px; color: var(--muted); font-weight: 600; }
.funnel .fbar { height: 12px; background: var(--lav); border-radius: 99px; overflow: hidden; margin-top: 4px; } .funnel .fbar i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.funnel .fstep:nth-child(3) .fbar i, .funnel .fstep:nth-child(4) .fbar i { background: var(--teal); } .funnel .fstep:nth-child(5) .fbar i { background: #1f9d55; }
.funnel .fsub { font-size: 12.5px; color: var(--muted); margin-top: 2px; text-align: right; }
.fseg { flex-wrap: wrap; } .fseg button { flex: 1 1 30%; }
.tablewrap { overflow-x: auto; margin: 8px 0; -webkit-overflow-scrolling: touch; }
table.ftab { border-collapse: collapse; width: 100%; font-size: 13.5px; min-width: 520px; } table.ftab th, table.ftab td { border-bottom: 1px solid var(--line); padding: 6px 6px; text-align: right; vertical-align: top; }
table.ftab th { background: var(--lav); white-space: nowrap; } table.ftab th:first-child, table.ftab td:first-child { text-align: left; overflow-wrap: anywhere; min-width: 120px; }
table.ftab small { display: block; color: var(--muted); font-size: 11.5px; } .fdefs { margin-top: 10px; line-height: 1.5; }
.askme .askhint { text-align: left; margin: 4px 0 0; color: #8a4b00; }
/* the Feynman Learn logo on the home page's top bar (tools/logo.py) */
.top .tlogo { height: 34px; width: auto; flex: none; display: block; }
/* Home on the top bar of every page (28 Oct 2026) */
.top .homebtn { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.16); color: #fff; margin-left: -4px; }
.top .homebtn:hover, .top .homebtn:focus-visible { background: rgba(255,255,255,.28); }

/* ---------- Class Launch 2026-10-28: the parent slips (8 on an A4 page, js/launch.js) and the office page ---------- */
.lsheets { margin-top: 10px; overflow-x: auto; }
.lsheet { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 70mm; width: 198mm; background: #fff; margin: 0 auto 10px; }
.lslip { border: 1px dashed #9aa0c8; padding: 2.4mm 3mm; box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; gap: 1mm; font-size: 8pt; line-height: 1.3; color: #14175e; }
.lslip > * { flex: none; }                      /* no line may shrink away when a slip is full */
.lslip .ls-top { display: flex; gap: 1.6mm; align-items: center; white-space: nowrap; overflow: hidden; } .lslip .ls-top img { width: 5.6mm; height: 5.6mm; flex: none; }
.lslip .ls-top b { font-size: 8.6pt; } .lslip .ls-top span { font-size: 6.8pt; color: #4a4d7a; overflow: hidden; text-overflow: ellipsis; }
.lslip .ls-cls { font-weight: 800; font-size: 8.5pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lslip .ls-mid { display: flex; gap: 2mm; align-items: flex-start; }
.lslip .ls-q { text-align: center; font-size: 6.5pt; flex: none; } .lslip .ls-q svg { width: 20mm; height: 20mm; display: block; }
.lslip .ls-how { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .6mm; font-size: 7.2pt; } .lslip .ls-how b { font-size: 8pt; }
.lslip .km { font-family: 'Kantumruy Pro', sans-serif; }
.lslip .ls-fill { margin-top: .6mm; font-size: 7.5pt; line-height: 1.6; }
.lslip .ls-free { font-size: 6.8pt; color: #3a3f8f; border-top: 1px solid #e2e4f4; padding-top: .8mm; }
.lslip .ls-tear { border-top: 1.2px dashed #14175e; padding-top: 1mm; font-size: 6.6pt; margin-top: auto; } .lslip .ls-tear b { font-size: 6.5pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.lslip .ls-line { margin-top: 1mm; } .lslip .ls-tear small { display: block; margin-top: .6mm; font-size: 6pt; color: #4a4d7a; }
@media screen and (max-width: 780px) { .lsheet { zoom: .47; } }
@media print {
  @page { size: A4; margin: 6mm; }
  .lsheets { overflow: visible; margin: 0; } .lsheet { zoom: 1; margin: 0; break-after: page; page-break-after: always; }
  .lslip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.lcode { border-top: 1px solid var(--line); padding: 8px 0; } .lcode.off { opacity: .6; } .lcode .btns { margin-top: 6px; } .lcode .field { margin: 6px 0 0; max-width: 240px; }
