:root {
  --bg: #f4f5f7; --panel: #ffffff; --ink: #1f2933; --muted: #616e7c; --line: #dde2e7;
  --brand: #0369a1; --brand-2: #075985; --brand-soft: #e0f2fe;
  --good: #1f7a4d; --good-soft: #e8f4ee; --bad: #b42318; --bad-soft: #fbeceb; --warn: #b45309; --warn-soft: #fdf3e6;
  --locked: #b6bdcc; --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 1px rgba(16,24,40,.03);
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100vh; }
a { color: var(--brand); }
button { font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: 10px 16px; background: var(--brand); color: #fff; font-weight: 600; }
button:hover { filter: brightness(1.07); }
button:disabled { opacity: .45; cursor: default; filter: none; }
button.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
button.ghost.danger { color: var(--bad); border-color: var(--bad); }
button.ghost.danger:hover { background: var(--bad-soft); }
button.soft { background: var(--brand-soft); color: var(--brand); }
button.good { background: var(--good); }
button.small { padding: 6px 10px; font-size: 13px; }
input, textarea { font: inherit; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; background: #fff; color: var(--ink); }
textarea { min-height: 120px; resize: vertical; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: #1f2933; color: #fff; border-bottom: 2px solid var(--brand); }
.topbar .logo { font-weight: 600; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.topbar .logo span.dot { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: inline-grid; place-items: center; font-size: 14px; }
.topbar nav { display: flex; gap: 4px; margin-left: 12px; }
.topbar nav a { color: #c9d3ee; text-decoration: none; padding: 7px 12px; border-radius: 8px; font-size: 14px; }
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.topbar .spacer { flex: 1; }
.topbar .me { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.topbar .me svg { width: 34px; height: 34px; }
.topbar .badge { background: var(--warn); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 12px; margin-left: 4px; }

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; }
.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.scroll { overflow: auto; }  /* tables that may be wider or taller than their box scroll inside it */
.scroll thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
h1 { font-size: 26px; margin: 0 0 6px; } h2 { font-size: 20px; margin: 0 0 12px; } h3 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--brand-soft); color: var(--brand); }
.pill.good { background: var(--good-soft); color: var(--good); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.grey { background: #eef0f5; color: var(--muted); }

/* login */
.login { max-width: 640px; margin: 60px auto; text-align: center; }
.avatars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.avatars button { background: #f3f5fa; border: 2px solid transparent; padding: 8px; border-radius: 14px; }
.avatars button.sel { border-color: var(--brand); background: var(--brand-soft); }
.avatars svg { width: 100%; height: auto; }

/* course map */
.hero { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: stretch; }
.progressbar { height: 10px; background: #e7eaf3; border-radius: 99px; overflow: hidden; }
.progressbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 99px; transition: width .5s; }
.course-intro { margin-top: 20px; }
.course-intro summary { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.course-intro summary::-webkit-details-marker { display: none; }
.course-intro summary::before { content: "▸"; color: var(--muted, #64748b); transition: transform .15s; }
.course-intro[open] summary::before { transform: rotate(90deg); }
.course-intro summary h2 { margin: 0; font-size: 20px; }
.course-intro .ci-overview { margin: 14px 0 4px; font-size: 15.5px; line-height: 1.55; max-width: 75ch; }
.course-intro .ci-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
.course-intro h3 { margin: 14px 0 6px; font-size: 15px; }
.course-intro ul { margin: 0; padding-left: 20px; line-height: 1.5; }
.course-intro li { margin: 0 0 6px; }
.course-intro .ci-learn li b { display: block; }
.course-intro .ci-learn li span { font-size: 13.5px; color: var(--muted, #64748b); }
.course-intro .ci-meta { margin: 12px 0 0; font-size: 13px; }
@media (max-width: 760px) { .course-intro .ci-cols { grid-template-columns: 1fr; } }
.module { margin-top: 26px; }
.module h2 { display: flex; align-items: center; gap: 10px; }
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.topic { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border: 2px solid transparent; cursor: pointer; position: relative; transition: transform .15s; }
.topic:hover { transform: translateY(-2px); border-color: var(--brand-soft); }
.topic.locked { cursor: not-allowed; opacity: .55; }
.topic.locked:hover { transform: none; }
.topic .num { font-size: 12px; color: var(--muted); font-weight: 700; }
.topic h3 { margin: 4px 0 10px; }
.topic .meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin-top: 10px; }
.mastery { display: flex; gap: 3px; }
.mastery i { width: 14px; height: 6px; border-radius: 3px; background: #e3e7f0; }
.mastery i.on { background: var(--good); }
.final-card { margin-top: 26px; display: flex; align-items: center; gap: 18px; background: linear-gradient(120deg, #0f1b3d, #1f3a8a); color: #fff; border-radius: var(--radius); padding: 22px; }
.final-card .big { font-size: 42px; }

/* recommendations */
.recs { display: grid; gap: 10px; }
.rec { border-left: 4px solid var(--brand); background: #f8faff; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.rec b { display: block; margin-bottom: 2px; }
.rec.revisit, .rec.misconception { border-color: var(--bad); background: #fff8f8; }
.rec.review, .rec.decay, .rec.calibration { border-color: var(--warn); background: #fffaf2; }
.rec.next, .rec.final { border-color: var(--good); background: #f5fcf7; }
.rec .links a { display: inline-block; margin: 4px 8px 0 0; font-size: 13px; }

/* lesson player */
.player { display: grid; grid-template-columns: 250px 1fr; gap: 20px; }
.outline { position: sticky; top: 76px; align-self: start; }
.outline ol { list-style: none; padding: 0; margin: 10px 0 0; }
.outline li { padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.outline li:hover { background: #f0f3fa; }
.outline li.cur { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.outline li .tick { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); display: inline-grid; place-items: center; font-size: 11px; flex: none; }
.outline li.seen .tick { background: var(--good); border-color: var(--good); color: #fff; }
.stage { display: grid; gap: 16px; }
.tutorbar { display: flex; gap: 14px; align-items: flex-start; }
.tutorbar .tutor-avatar { flex: none; width: 96px; height: 96px; }
.bubble { position: relative; background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); flex: 1; font-size: 15px; line-height: 1.45; }
.bubble:before { content: ""; position: absolute; left: -9px; top: 26px; border: 9px solid transparent; border-right-color: #fff; border-left: 0; }
.bubble .controls { display: flex; gap: 8px; margin-top: 8px; }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card .body { font-size: 16px; line-height: 1.6; }
.card .body ul, .card .body ol { padding-left: 22px; }
.keypoints { margin-top: 14px; background: #f3fbfa; border: 1px solid #c9ece9; border-radius: 12px; padding: 12px 16px; }
.keypoints h4 { margin: 0 0 6px; color: var(--brand-2); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.keypoints ul { margin: 0; padding-left: 18px; }
.nav-row { display: flex; justify-content: space-between; align-items: center; }

/* interactions */
.interaction { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 16px; }
.interaction .prompt { font-weight: 500; margin-bottom: 10px; }
/* every learner action starts with a bold "Task:" so it's clear something needs doing */
.task-tag { font-weight: 700; color: var(--brand); margin-right: 2px; }
.reveal { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.flip { perspective: 800px; height: 130px; cursor: pointer; }
.flip .in { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.flip.open .in { transform: rotateY(180deg); }
.flip .f, .flip .b { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 12px; display: grid; place-items: center; text-align: center; padding: 12px; }
.flip .f { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; }
.flip .f .ic { font-size: 30px; display: block; }
.flip .b { background: #fff; border: 2px solid var(--brand-soft); transform: rotateY(180deg); font-size: 14px; }
.sort-pool, .bucket { min-height: 56px; border-radius: 12px; padding: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.sort-pool { background: #f3f5fa; margin-bottom: 10px; }
.buckets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bucket { border: 2px dashed var(--line); min-height: 110px; flex-direction: column; }
.bucket.over { border-color: var(--brand); background: var(--brand-soft); }
.bucket h5 { margin: 0 0 4px; font-size: 13px; color: var(--muted); width: 100%; }
.bucket .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: grab; user-select: none; }
.chip.sel { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.chip.ok { border-color: var(--good); background: var(--good-soft); }
.chip.no { border-color: var(--bad); background: var(--bad-soft); }
.orderlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.orderlist li { background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; cursor: grab; }
.orderlist li .n { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: none; }
.orderlist li .mv { margin-left: auto; display: flex; gap: 4px; }
.orderlist li .mv button { padding: 2px 8px; background: #eef1f8; color: var(--ink); }
.orderlist li.ok { border-color: var(--good); background: var(--good-soft); }
.orderlist li.no { border-color: var(--bad); background: var(--bad-soft); }
.orderlist li.dragging { opacity: .4; }
.feedback { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.feedback.good { background: var(--good-soft); color: #11632f; } .feedback.bad { background: var(--bad-soft); color: #8f1d1d; }
.scene-wrap { position: relative; height: 380px; border-radius: 12px; overflow: hidden; background: radial-gradient(circle at 50% 30%, #23335f, #0b1430); }
.scene-wrap > canvas { display: block; width: 100% !important; height: 100% !important; }
.scene-hud { position: absolute; left: 12px; top: 12px; right: 12px; display: flex; justify-content: space-between; gap: 10px; pointer-events: none; }
.scene-hud .tag { background: rgba(10, 18, 40, .78); color: #fff; padding: 8px 12px; border-radius: 10px; font-size: 13px; max-width: 70%; pointer-events: auto; }
.scene-hud .count { background: rgba(10, 18, 40, .78); color: #7ff5c8; padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.scene-ctl { position: absolute; left: 12px; right: 12px; bottom: 12px; background: rgba(10, 18, 40, .78); color: #fff; padding: 10px 14px; border-radius: 10px; display: flex; gap: 12px; align-items: center; font-size: 13px; }
.scene-ctl input[type=range] { flex: 1; padding: 0; }
.scene-wrap.scene-big { height: 540px; }
.scene-big .scene-hud { align-items: flex-start; }
.scene-tasks.collapsed div { display: none; }
.scene-tasks b { cursor: pointer; }
.scene-wrap:fullscreen { height: 100vh; border-radius: 0; }
.scene-hud .hud-right { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; max-width: 34%; }
.scene-tasks { background: rgba(10, 18, 40, .82); color: #dfe7ff; padding: 8px 12px; border-radius: 10px; font-size: 12px; line-height: 1.6; pointer-events: auto; }
.scene-tasks b { color: #7ff5c8; display: block; margin-bottom: 2px; }
.scene-tasks .done { color: #7ff5c8; }
.scene-tools { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 6px; z-index: 3; }
.scene-tools button { background: rgba(10, 18, 40, .8); color: #fff; padding: 6px 10px; font-size: 15px; }
.scene-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.scene-label { position: absolute; left: 0; top: 0; background: rgba(10, 18, 40, .82); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 8px; white-space: nowrap; border: 1px solid rgba(255,255,255,.15); text-align: center; }
.scene-label.small { font-size: 11px; padding: 3px 6px; }
.scene-label.flowtag { background: rgba(255,255,255,.9); color: #0f1b3d; }
.scene-label.ok { background: #16a34a; }
.scene-panel { position: absolute; left: 12px; right: 110px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 2; }
.scene-panel .ctl { background: rgba(10, 18, 40, .82); color: #fff; padding: 6px 10px; border-radius: 10px; display: flex; gap: 8px; align-items: center; font-size: 12px; flex-wrap: wrap; }
.scene-panel .ctl input[type=range] { width: 120px; padding: 0; border: 0; background: transparent; }
.scene-panel .ctl b { min-width: 54px; }
.sbtn { background: rgba(255,255,255,.12); color: #fff; padding: 5px 10px; font-size: 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.2); }
.sbtn.on { background: var(--brand); border-color: var(--brand); }
.sbtn.wrong { background: #7f1d1d; border-color: #dc2626; text-decoration: line-through; }
.hbar { display: inline-block; width: 80px; height: 8px; background: rgba(255,255,255,.15); border-radius: 4px; overflow: hidden; vertical-align: middle; }
.hbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb703, #ff3b1f); }
.status { font-size: 16px; }
.scene-fallback { color: #fff; display: grid; place-items: center; height: 100%; text-align: center; padding: 20px; }
.research { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.research button { background: #f6f8fc; color: var(--ink); border: 1.5px solid var(--line); text-align: left; display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; }
.research button.done { border-color: var(--good); background: var(--good-soft); }
.research-editor { margin-top: 12px; }
.check { margin-top: 18px; background: #f8f9ff; border-radius: 12px; padding: 14px; }
.check h4 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--ink); }

/* tests */
.quiz { max-width: 760px; margin: 0 auto; }
.quiz .q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--muted); font-size: 14px; }
.quiz .stem { font-size: 19px; font-weight: 600; margin: 6px 0 16px; line-height: 1.4; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; gap: 12px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; font-size: 15px; text-align: left; color: var(--ink); font-weight: 500; }
.opt:hover { border-color: #b8c6ec; }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.ok { border-color: var(--good); background: var(--good-soft); }
.opt.no { border-color: var(--bad); background: var(--bad-soft); }
.opt .key { width: 28px; height: 28px; border-radius: 8px; background: #eef1f8; display: grid; place-items: center; font-weight: 700; flex: none; }
.confidence { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.dots { display: flex; gap: 4px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #dfe3ee; }
.dots i.ok { background: var(--good); } .dots i.no { background: var(--bad); } .dots i.cur { background: var(--brand); }
.result-hero { text-align: center; padding: 30px; }
.result-hero .score { font-size: 64px; font-weight: 800; }
.result-list { display: grid; gap: 8px; margin-top: 16px; }
.result-list .ri { border-radius: 10px; padding: 10px 12px; background: #f8f9fc; font-size: 14px; border-left: 4px solid var(--good); }
.result-list .ri.no { border-color: var(--bad); }

/* progress page */
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 220px 1fr 60px; gap: 10px; align-items: center; font-size: 14px; }
.bar .track { height: 12px; background: #eceff6; border-radius: 99px; overflow: hidden; }
.bar .track i { display: block; height: 100%; border-radius: 99px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.kpi .v { font-size: 28px; font-weight: 800; }
.kpi .l { font-size: 13px; color: var(--muted); }

/* certificate */
.cert { max-width: 820px; margin: 0 auto; background: #fffdf7; border: 10px double #c8a64a; padding: 50px; text-align: center; border-radius: 6px; }
.cert h1 { font-family: Georgia, serif; font-size: 36px; }
.cert .name { font-family: Georgia, serif; font-size: 34px; margin: 20px 0; color: #1f3a8a; }

/* avatar animation */
.tutor-svg .mouth { transform-origin: 50px 66px; transition: transform .08s; }
.tutor-svg.talking .mouth { animation: talk .22s infinite alternate; }
@keyframes talk { from { transform: scaleY(.3); } to { transform: scaleY(1.2); } }
.tutor-svg .eyes { animation: blink 4.5s infinite; transform-origin: 50px 46px; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
svg.tutor-svg { animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
/* tutor portrait: a clean circle with a thin ring; a soft teal pulse around it while he's speaking */
.tutor-photo { display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #e8f2f5;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px #c9dde4, 0 2px 8px rgba(16, 24, 40, .12); transition: box-shadow .25s; }
.tutor-photo img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.tutor-photo.talking { animation: tutorTalk 1.1s ease-in-out infinite; }
@keyframes tutorTalk { 0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #0369a1, 0 0 0 4px rgba(3, 105, 161, .25), 0 2px 8px rgba(16, 24, 40, .12); }
  50% { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #0369a1, 0 0 0 9px rgba(3, 105, 161, 0), 0 2px 8px rgba(16, 24, 40, .12); } }
@media (prefers-reduced-motion: reduce) { .tutor-photo.talking { animation: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #0369a1; } }
.cc-av .tutor-photo { width: 38px; height: 38px; }

/* ===================== sci-fi entry (login + gate) ===================== */
body.sf-mode { background: #040714; overflow: hidden; }
body.sf-mode main { padding: 0; max-width: none; }
.sf { --c1: #3ff0ff; --c2: #ff3fd2; --c3: #7c5cff; --ink2: #cfe9ff; position: fixed; inset: 0; overflow: auto; color: var(--ink2);
  font-family: Rajdhani, "Segoe UI", system-ui, sans-serif; background: radial-gradient(ellipse at 50% 120%, #1a1f5c 0%, #070b24 45%, #040714 75%); }
.sf-stars { position: fixed; inset: 0; width: 100%; height: 100%; }
.sf-grid { position: fixed; left: -50%; right: -50%; bottom: -10%; height: 55%; transform: perspective(500px) rotateX(62deg); transform-origin: bottom;
  background-image: linear-gradient(rgba(63,240,255,.28) 1px, transparent 1px), linear-gradient(90deg, rgba(63,240,255,.28) 1px, transparent 1px);
  background-size: 60px 60px; mask-image: linear-gradient(to top, #000 10%, transparent 85%); -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 85%);
  animation: sfgrid 3s linear infinite; pointer-events: none; }
@keyframes sfgrid { to { background-position: 0 60px, 0 0; } }
.sf-vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.6)); }
.sf-wrap { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 28px 20px 40px; min-height: 100%; display: flex; flex-direction: column; }
.sf-head { text-align: center; margin-bottom: 22px; }
.sf-brand { display: inline-flex; align-items: center; gap: 14px; }
.sf-logo { width: 46px; height: 46px; display: grid; place-items: center; font-family: Orbitron, sans-serif; font-weight: 900; font-size: 24px; color: #04121a;
  background: linear-gradient(135deg, var(--c1), var(--c3)); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); box-shadow: 0 0 24px var(--c1); }
.sf-title { font-family: Orbitron, sans-serif; font-weight: 700; font-size: clamp(28px, 5vw, 46px); letter-spacing: 3px; color: #fff;
  text-shadow: 0 0 12px rgba(63,240,255,.7), 0 0 34px rgba(124,92,255,.5); }
.sf-title b { color: var(--c1); font-weight: 900; }
.sf-sub { margin-top: 6px; font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: #8fb3d9; }
.sf-sub i { color: var(--c2); font-style: normal; margin: 0 6px; }
.sf-main { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 22px; align-items: center; flex: 1; }
.sf-panel { position: relative; background: linear-gradient(160deg, rgba(20,32,80,.55), rgba(8,12,34,.75)); border: 1px solid rgba(63,240,255,.35);
  padding: 20px; backdrop-filter: blur(6px); clip-path: polygon(0 14px, 14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
  box-shadow: inset 0 0 30px rgba(63,240,255,.08); }
.sf-panel::before { content: ""; position: absolute; top: 0; left: 14px; right: 30%; height: 2px; background: linear-gradient(90deg, var(--c1), transparent); }
.sf-label { font-family: Orbitron, sans-serif; font-size: 12px; letter-spacing: 4px; color: var(--c1); margin-bottom: 12px; }
.sf-label.center { text-align: center; }
.sf-tutorrow { display: flex; gap: 12px; align-items: flex-start; }
.sf-holo { flex: none; width: 84px; height: 84px; filter: drop-shadow(0 0 10px rgba(63,240,255,.8)) saturate(.9) hue-rotate(-10deg); position: relative; animation: sfflicker 5s infinite; }
.sf-console { flex: 1; font-size: 16px; line-height: 1.4; min-height: 92px; color: #e4f6ff; }
.sf-type::after { content: "▌"; color: var(--c1); animation: sfblink 1s steps(1) infinite; }
@keyframes sfblink { 50% { opacity: 0; } }
@keyframes sfflicker { 0%, 96%, 100% { opacity: 1; } 97% { opacity: .55; } 98% { opacity: 1; } 99% { opacity: .7; } }
.sf-mini { margin-top: 8px; background: transparent; border: 1px solid rgba(63,240,255,.5); color: var(--c1); padding: 4px 10px; font-size: 12px; border-radius: 3px; font-family: Orbitron, sans-serif; letter-spacing: 1px; }
.sf-mini:hover { background: rgba(63,240,255,.12); }
.sf-stats { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sf-stats li { border: 1px solid rgba(63,240,255,.25); padding: 8px; text-align: center; background: rgba(63,240,255,.05); }
.sf-stats b { display: block; font-family: Orbitron, sans-serif; font-size: 22px; color: #fff; text-shadow: 0 0 10px var(--c1); }
.sf-stats span { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: #8fb3d9; }
/* avatar pod */
.sf-stage { display: flex; align-items: center; justify-content: center; gap: 10px; }
.sf-arrow { background: transparent; color: var(--c1); border: 1px solid rgba(63,240,255,.5); width: 44px; height: 64px; font-size: 34px; line-height: 1; padding: 0;
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 30% 100%, 0 50%); transition: .2s; }
#sfNext { clip-path: polygon(0 0, 70% 0, 100% 50%, 70% 100%, 0 100%); }
.sf-arrow:hover { background: rgba(63,240,255,.18); box-shadow: 0 0 18px var(--c1); }
.sf-pod { position: relative; width: min(320px, 64vw); aspect-ratio: 1 / 1.08; display: grid; place-items: center; }
.sf-ring { position: absolute; border-radius: 50%; border: 2px solid transparent; }
.sf-ring.r1 { inset: 4%; border-top-color: var(--c1); border-bottom-color: var(--c1); animation: sfspin 8s linear infinite; box-shadow: 0 0 20px rgba(63,240,255,.25); }
.sf-ring.r2 { inset: 11%; border-left-color: var(--c2); border-right-color: var(--c2); animation: sfspin 12s linear infinite reverse; opacity: .8; }
.sf-ring.r3 { inset: 18%; border: 1px dashed rgba(124,92,255,.7); animation: sfspin 30s linear infinite; }
@keyframes sfspin { to { transform: rotate(360deg); } }
.sf-avatar { position: relative; width: 58%; z-index: 2; filter: drop-shadow(0 0 16px rgba(63,240,255,.75)); animation: sffloat 4s ease-in-out infinite; }
.sf-avatar svg { width: 100%; height: auto; display: block; }
.sf-avatar svg > circle:first-child, .sf-thumbs svg > circle:first-child { fill: rgba(63,240,255,.10); stroke: rgba(63,240,255,.6); stroke-width: 1.5; }
.sf-avatar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; mix-blend-mode: overlay;
  background: repeating-linear-gradient(0deg, rgba(63,240,255,.35) 0 2px, transparent 2px 5px); animation: sfscan 2.5s linear infinite; }
@keyframes sfscan { to { background-position: 0 40px; } }
@keyframes sffloat { 0%, 100% { transform: translateY(-4px); } 50% { transform: translateY(6px); } }
.sf-avatar.warp { animation: sfwarp .5s ease-out, sffloat 4s ease-in-out .5s infinite; }
@keyframes sfwarp { 0% { opacity: 0; transform: scale(.6) skewX(12deg); filter: drop-shadow(0 0 40px var(--c2)) hue-rotate(90deg); } 60% { opacity: 1; transform: scale(1.06); } 100% { transform: none; } }
.sf-beam { position: absolute; bottom: 8%; width: 46%; height: 50%; background: linear-gradient(to top, rgba(63,240,255,.35), transparent); clip-path: polygon(15% 100%, 85% 100%, 100% 0, 0 0); filter: blur(2px); }
.sf-base { position: absolute; bottom: 4%; width: 56%; height: 9%; border-radius: 50%; background: radial-gradient(ellipse, rgba(63,240,255,.9), rgba(63,240,255,.15) 55%, transparent 70%); box-shadow: 0 0 30px var(--c1); }
.sf-role { text-align: center; margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.sf-role small { font-family: Orbitron, sans-serif; font-size: 10px; letter-spacing: 3px; color: #6f86c9; }
.sf-role span { font-family: Orbitron, sans-serif; font-size: 20px; font-weight: 700; color: #fff; letter-spacing: 1px; text-shadow: 0 0 12px var(--c2); }
.sf-thumbs { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.sf-thumbs button { width: 46px; height: 46px; padding: 3px; background: rgba(10,18,50,.7); border: 1px solid rgba(63,240,255,.25); border-radius: 50%; opacity: .55; transition: .2s; }
.sf-thumbs button svg { width: 100%; height: 100%; }
.sf-thumbs button:hover { opacity: .9; }
.sf-thumbs button.sel { opacity: 1; border-color: var(--c1); box-shadow: 0 0 14px var(--c1); transform: scale(1.12); }
/* identify */
.sf-field { display: flex; align-items: center; gap: 8px; border: 1px solid rgba(63,240,255,.55); background: rgba(2,6,20,.7); padding: 4px 12px; box-shadow: inset 0 0 14px rgba(63,240,255,.12); }
.sf-field span { color: var(--c1); font-family: Orbitron, sans-serif; font-size: 18px; }
.sf-field input { border: 0; background: transparent; color: #fff; font-family: Rajdhani, sans-serif; font-size: 20px; padding: 10px 0; outline: none; }
.sf-field input::placeholder { color: #4f6a96; }
.sf-field:focus-within { border-color: var(--c2); box-shadow: 0 0 18px rgba(255,63,210,.35), inset 0 0 14px rgba(255,63,210,.12); }
.sf-hint { font-size: 14px; color: #8fb3d9; margin: 10px 0 16px; }
.sf-launch { width: 100%; padding: 16px; font-family: Orbitron, sans-serif; font-size: 16px; letter-spacing: 3px; color: #04121a; border-radius: 0;
  background: linear-gradient(90deg, var(--c1), #7cf7ff 50%, var(--c3)); box-shadow: 0 0 22px rgba(63,240,255,.6); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); transition: .2s; }
.sf-launch:hover { box-shadow: 0 0 36px rgba(63,240,255,.9); filter: brightness(1.1); }
.sf-launch span { display: inline-block; transition: transform .2s; }
.sf-launch:hover span { transform: translateX(5px); }
.sf-err { color: #ff7ab6; min-height: 22px; margin-top: 8px; font-size: 15px; }
.sf-sys { font-size: 12px; letter-spacing: 1px; color: #6f86c9; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.sf-dot { width: 8px; height: 8px; border-radius: 50%; background: #2bff9e; box-shadow: 0 0 8px #2bff9e; display: inline-block; animation: sfblink 1.6s steps(1) infinite; }
.sf.launching .sf-wrap { animation: sflaunch .7s ease-in forwards; }
@keyframes sflaunch { to { opacity: 0; transform: scale(1.15); filter: blur(6px); } }
/* gate page variant */
.sf-gate { max-width: 460px; margin: auto; text-align: center; }
.sf-gate .sf-field input { text-align: center; letter-spacing: 4px; text-transform: uppercase; font-family: Orbitron, sans-serif; font-size: 18px; }
/* toned-down pass: softer glow, calmer motion */
.sf { --c2: #7c8cff; background: radial-gradient(ellipse at 50% 120%, #17204a 0%, #0a1030 45%, #070b1f 75%); }
.sf-grid { opacity: .45; animation-duration: 8s; }
.sf-title { text-shadow: 0 0 8px rgba(63,240,255,.35); letter-spacing: 2px; }
.sf-logo { box-shadow: 0 0 10px rgba(63,240,255,.45); }
.sf-sub { letter-spacing: 1px; text-transform: none; font-size: 16px; }
.sf-panel { box-shadow: none; border-color: rgba(63,240,255,.22); }
.sf-label { letter-spacing: 2px; }
.sf-holo { animation: none; filter: drop-shadow(0 0 6px rgba(63,240,255,.45)); }
.sf-ring.r1 { animation-duration: 20s; box-shadow: none; border-top-color: rgba(63,240,255,.7); border-bottom-color: rgba(63,240,255,.7); }
.sf-ring.r2 { animation-duration: 30s; opacity: .45; }
.sf-ring.r3 { display: none; }
.sf-avatar { filter: drop-shadow(0 0 8px rgba(63,240,255,.4)); animation-duration: 6s; }
.sf-avatar::after { display: none; }
.sf-avatar.warp { animation: sffade .35s ease-out, sffloat 6s ease-in-out .35s infinite; }
@keyframes sffade { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.sf-beam { opacity: .5; }
.sf-base { box-shadow: 0 0 14px rgba(63,240,255,.5); opacity: .8; }
.sf-thumbs button.sel { box-shadow: 0 0 8px rgba(63,240,255,.6); }
.sf-arrow:hover { box-shadow: none; }
.sf-launch { background: #3fd8e8; box-shadow: none; letter-spacing: 2px; }
.sf-launch:hover { box-shadow: 0 0 14px rgba(63,240,255,.5); }
.sf-field:focus-within { border-color: #7fe9f5; box-shadow: none; }
.sf.launching .sf-wrap { animation: sffadeout .5s ease-in forwards; }
@keyframes sffadeout { to { opacity: 0; } }
@media (max-width: 980px) {
  .sf-main { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; width: 100%; }
  .sf-select { order: 1; } .sf-id { order: 2; } .sf-guide { order: 3; }
  body.sf-mode { overflow: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .sf *, .sf-grid { animation: none !important; }
}

/* ===================== corporate entrance (login + gate) ===================== */
body.lp-mode { background: #e8eaee; }
body.lp-mode main { padding: 0; max-width: none; }
.lp { --pink: #e6007e; --pink2: #ff4fa6; --char: #2f343b; --grey: #5d6470; --line2: #d5d9e0;
  position: relative; min-height: 100vh; overflow: hidden; font-family: Poppins, "Segoe UI", system-ui, sans-serif; color: var(--char);
  background: linear-gradient(160deg, #f4f5f7 0%, #e6e8ec 55%, #d9dce2 100%); }
.lp-splash { position: absolute; border-radius: 50%; opacity: .55; pointer-events: none; }
.lp-splash.s1 { width: 340px; height: 340px; left: -120px; top: -110px; background: radial-gradient(circle at 40% 40%, #ff4fa6, transparent 68%); }
.lp-splash.s2 { width: 300px; height: 300px; right: -90px; top: 18%; background: radial-gradient(circle at 50% 50%, #00b8d9, transparent 66%); opacity: .4; }
.lp-splash.s3 { width: 260px; height: 260px; left: 8%; bottom: -120px; background: radial-gradient(circle at 50% 50%, #ffc21a, transparent 66%); opacity: .45; }
.lp-splash.s4 { width: 220px; height: 220px; right: 14%; bottom: -80px; background: radial-gradient(circle at 50% 50%, #7b5cff, transparent 66%); opacity: .35; }
.lp-wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 36px 20px 40px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.lp-head { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 30px; text-align: left; }
.lp-logo { width: 92px; height: 92px; filter: drop-shadow(0 6px 14px rgba(47,52,59,.18)); }
.lp-word { margin: 0; font-weight: 800; font-size: clamp(34px, 5.5vw, 56px); letter-spacing: -1px; line-height: 1.05;
  background: linear-gradient(90deg, var(--pink) 0%, var(--pink2) 55%, var(--pink) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; position: relative; }
.lp-word::after { content: ""; display: block; height: 5px; width: 130px; margin-top: 6px; border-radius: 3px;
  background: linear-gradient(90deg, #00b8d9 0 25%, #ffc21a 25% 50%, #7b5cff 50% 75%, #2ecc71 75%); }
.lp-sub { color: var(--grey); font-size: 15px; margin-top: 8px; }
.lp-head { margin-bottom: 6px; }
.lp-hero { position: relative; height: 190px; margin: 0 auto 18px; width: 100%; max-width: 980px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.lp-hero canvas { display: block; width: 100% !important; height: 100% !important; }
.lp-hero { margin-bottom: 4px !important; }
@media (max-width: 980px) { .lp-hero { height: 130px; } }
.lp-hero-cap { margin: 0 auto 22px; max-width: 980px; text-align: center; font-size: 12.5px; color: var(--grey); pointer-events: none; }
.lp-hero-cap b { color: var(--char); }
.lp-key { margin-left: 10px; display: inline-flex; gap: 6px; align-items: center; }
.lp-key i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.lp-main { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 20px; align-items: stretch; }
.lp-card { background: #fff; border: 1px solid var(--line2); border-radius: 16px; padding: 22px; box-shadow: 0 10px 30px rgba(47,52,59,.08); position: relative; }
.lp-card::before { content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--pink); }
.lp-guide::before { background: #00b8d9; } .lp-id::before { background: #ffc21a; }
.lp-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--grey); margin-bottom: 14px; }
.lp-label.center { text-align: center; }
.lp-tutorrow { display: flex; gap: 14px; align-items: flex-start; }
.lp-tutor { flex: none; width: 80px; height: 80px; }
.lp-type { font-size: 15px; line-height: 1.55; min-height: 96px; }
.lp-type::after { content: "|"; color: var(--pink); margin-left: 1px; animation: lpblink 1s steps(1) infinite; }
@keyframes lpblink { 50% { opacity: 0; } }
.lp-mini { margin-top: 8px; background: #f1f3f6; color: var(--char); border: 1px solid var(--line2); padding: 6px 12px; font-size: 13px; font-weight: 500; }
.lp-mini:hover { border-color: var(--pink); color: var(--pink); }
.lp-stage { display: flex; align-items: center; justify-content: center; gap: 12px; }
.lp-arrow { width: 42px; height: 42px; border-radius: 50%; padding: 0; font-size: 26px; line-height: 1; background: #f1f3f6; color: var(--char); border: 1px solid var(--line2); }
.lp-arrow:hover { background: var(--pink); color: #fff; border-color: var(--pink); }
.lp-pod { position: relative; width: min(230px, 56vw); aspect-ratio: 1; display: grid; place-items: center; }
.lp-ring { position: absolute; inset: 0; border-radius: 50%; padding: 6px;
  background: conic-gradient(from 0deg, #e6007e, #ff4fa6, #ffc21a, #2ecc71, #00b8d9, #7b5cff, #e6007e);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  animation: lpspin 18s linear infinite; }
@keyframes lpspin { to { transform: rotate(360deg); } }
.lp-avatar { width: 82%; }
.lp-avatar svg { width: 100%; height: auto; display: block; }
.lp-avatar.warp { animation: lppop .3s ease-out; }
@keyframes lppop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.lp-thumbs { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-top: 18px; max-width: 360px; margin-left: auto; margin-right: auto; }
.lp-thumbs button { min-width: 0; width: 100%; height: auto; aspect-ratio: 1; padding: 2px; border-radius: 50%; background: #fff; border: 2px solid var(--line2); opacity: .75; }
.lp-thumbs button svg { width: 100%; height: 100%; }
.lp-thumbs button:hover { opacity: 1; }
.lp-thumbs button.sel { opacity: 1; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(230,0,126,.15); }
.lp-input { font-size: 17px; padding: 13px 14px; border: 1.5px solid var(--line2); border-radius: 10px; }
.lp-input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(230,0,126,.12); }
.lp-code { letter-spacing: 3px; text-transform: uppercase; font-weight: 600; }
.lp-hint { font-size: 13px; color: var(--grey); margin: 10px 0 16px; }
.lp-go { width: 100%; padding: 14px; font-size: 16px; font-weight: 600; border-radius: 10px; background: var(--pink); color: #fff; box-shadow: 0 8px 20px rgba(230,0,126,.25); }
.lp-go:hover { background: #c9006e; }
.lp-go span { display: inline-block; transition: transform .2s; } .lp-go:hover span { transform: translateX(4px); }
.lp-err { color: #c0174d; min-height: 20px; margin-top: 8px; font-size: 14px; }
.lp-sys { font-size: 12px; color: var(--grey); }
.lp.launching .lp-wrap { animation: lpfade .5s ease-in forwards; }
@keyframes lpfade { to { opacity: 0; transform: translateY(-8px); } }
.lp-gate { max-width: 440px; margin: 0 auto; text-align: center; }
.lp-gate .lp-input { text-align: center; letter-spacing: 3px; text-transform: uppercase; font-weight: 600; }
@media (max-width: 980px) {
  .lp-main { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
  .lp-select { order: 1; } .lp-id { order: 2; } .lp-guide { order: 3; }
  .lp-head { flex-direction: column; text-align: center; } .lp-word::after { margin: 6px auto 0; }
}
@media (prefers-reduced-motion: reduce) { .lp * { animation: none !important; } }

/* ===================== neutral professional entrance (overrides) ===================== */
body.lp-mode { background: #f4f5f7 radial-gradient(#d5dbe1 1px, transparent 1.2px) 0 0 / 24px 24px; }
.lp { min-height: 100dvh; }
.lp { --pink: #0369a1; --pink2: #0369a1; --char: #1f2933; --grey: #616e7c; --line2: #dde2e7;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  background-color: #f4f5f7;
  background-image: radial-gradient(#d5dbe1 1px, transparent 1.2px), linear-gradient(180deg, #f8f9fa 0%, #eef0f3 100%);
  background-size: 24px 24px, 100% 100%; }
.lp-splash { display: none; }
.lp-head { gap: 16px; }
.lp-logo { width: 64px; height: 64px; filter: none; }
.lp-word { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: #1f2933;
  font-weight: 600; font-size: clamp(30px, 4.6vw, 44px); letter-spacing: -0.5px; }
.lp-word span { color: #0369a1; }
.lp-word::after { height: 2px; width: 56px; margin-top: 8px; background: #0369a1; border-radius: 1px; }
.lp-sub { font-size: 14px; color: #616e7c; }
.lp-hero-cap { font-family: "IBM Plex Mono", Consolas, monospace; font-size: 12px; letter-spacing: .2px; }
.lp-card { border-radius: 10px; border-color: #dde2e7; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.lp-card::before { display: none; }
.lp-label { font-size: 12px; font-weight: 600; letter-spacing: 1.2px; color: #616e7c; }
.lp-type { font-size: 14.5px; color: #323f4b; }
.lp-type::after { color: #0369a1; }
.lp-mini { background: #fff; border-radius: 6px; font-size: 12.5px; }
.lp-mini:hover { border-color: #0369a1; color: #0369a1; }
.lp-arrow { background: #fff; width: 38px; height: 38px; font-size: 22px; color: #3e4c59; }
.lp-arrow:hover { background: #1f2933; color: #fff; border-color: #1f2933; }
.lp-ring { padding: 0; animation-duration: 40s;
  background: conic-gradient(#0369a1 0 14%, #cbd2d9 14% 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); }
.lp-avatar { width: 80%; }
.lp-thumbs button { border-width: 1.5px; opacity: .8; }
.lp-thumbs button.sel { border-color: #0369a1; box-shadow: 0 0 0 2px rgba(3,105,161,.15); }
.lp-input { border-radius: 8px; font-size: 16px; }
.lp-input:focus { border-color: #0369a1; box-shadow: 0 0 0 3px rgba(3,105,161,.12); }
.lp-code, .lp-gate .lp-input { font-family: "IBM Plex Mono", Consolas, monospace; letter-spacing: 2px; }
.lp-go { background: #1f2933; border-radius: 8px; box-shadow: none; font-weight: 500; letter-spacing: .2px; }
.lp-go:hover { background: #0369a1; }
.lp-err { color: #b42318; }
.lp-hint, .lp-sys { color: #616e7c; }
.topbar .logo-img { background: #fff; }

/* ===================== app-wide refinement ===================== */
button { border-radius: 8px; font-weight: 500; }
.panel, .topic, .card, .kpi { border: 1px solid var(--line); }
.topbar nav a { color: #cbd2d9; }
.topic { padding: 18px; }
.topic:hover { border-color: #b9c3cc; transform: none; box-shadow: 0 2px 8px rgba(16,24,40,.06); }
.topic h3 { font-weight: 600; }
.module h2 { font-weight: 600; font-size: 18px; color: var(--ink); }
.module h2 .mnum { font-family: "IBM Plex Mono", Consolas, monospace; font-size: 12px; color: var(--brand); border: 1px solid var(--brand); border-radius: 4px; padding: 2px 6px; }
.final-card { background: #1f2933; border: 1px solid #1f2933; border-left: 4px solid var(--brand); }
.flip .f { background: #1f2933; } .flip .f .ic { opacity: .9; }
.flip .b { border-color: var(--line); }
.keypoints { background: #f6f9fa; border: 1px solid #d5e3e8; border-left: 3px solid var(--brand); border-radius: 8px; }
.keypoints h4 { color: var(--brand); }
.rec { border-radius: 6px; }
.outline li { font-size: 13.5px; }
.outline li.sect { cursor: default; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 12px 10px 4px; }
.outline li.sect:hover { background: none; }
/* topic overview + recap */
.tov { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.tov h1 { font-size: 24px; font-weight: 600; }
.tov .crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.outcomes { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.outcomes li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start; font-size: 15px; line-height: 1.45; }
.outcomes li b { font-family: "IBM Plex Mono", Consolas, monospace; font-size: 12px; color: var(--brand); border: 1px solid #b7d6df; background: #f2f8fa; border-radius: 4px; text-align: center; padding: 3px 0; }
.contents { list-style: none; padding: 0; margin: 0; }
.contents li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.contents li:last-child { border-bottom: 0; }
.contents .tag { font-size: 11px; color: var(--muted); font-family: "IBM Plex Mono", Consolas, monospace; white-space: nowrap; }
.assess { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.assess div { border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: center; }
.assess b { display: block; font-size: 20px; font-weight: 600; }
.assess span { font-size: 12px; color: var(--muted); }
/* key learning points: the instructions on the left, Glenn thinking (with a thought bubble) top right */
.recap-head { display: grid; grid-template-columns: 1fr 230px; gap: 18px; align-items: center; margin-bottom: 14px; }
.rh-line { margin: 2px 0; font-size: 15.5px; color: #334e68; }
.rh-think { position: relative; display: flex; flex-direction: column; align-items: flex-end; }
.rh-think img { width: 150px; height: auto; margin-right: 6px; user-select: none; }
.think-bubble { position: relative; align-self: stretch; background: #eef7fa; border: 2px solid #9fd3e3; color: #12475a; border-radius: 18px;
  padding: 9px 12px; font-size: 13.5px; font-weight: 500; line-height: 1.35; margin-bottom: 14px; text-align: center; }
.think-bubble::before, .think-bubble::after { content: ""; position: absolute; border-radius: 50%; background: #eef7fa; border: 2px solid #9fd3e3; }
.think-bubble::before { width: 14px; height: 14px; bottom: -13px; right: 92px; }   /* thought dots leading down to his head */
.think-bubble::after { width: 8px; height: 8px; bottom: -24px; right: 84px; }
@media (max-width: 720px) {
  .recap-head { grid-template-columns: 1fr; }
  .rh-think { flex-direction: row-reverse; align-items: center; gap: 10px; order: -1; }
  .rh-think img { width: 96px; margin: 0; }
  .think-bubble { margin: 0; flex: 1; align-self: center; }
  .think-bubble::before { bottom: auto; right: auto; left: -13px; top: 30%; } .think-bubble::after { bottom: auto; right: auto; left: -24px; top: 22%; }   /* dots lead to his head */
}
.recap-group { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.recap-group h4 { margin: 0 0 8px; font-size: 14px; display: flex; justify-content: space-between; gap: 10px; }
.recap-group h4 a { font-size: 12px; font-weight: 500; }
.recap-group label { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; padding: 4px 0; cursor: pointer; }
.recap-group input { width: auto; margin-top: 3px; accent-color: var(--brand); }
.kp-link { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--muted); }
@media (max-width: 860px) { .tov { grid-template-columns: 1fr; } .assess { grid-template-columns: 1fr 1fr 1fr; } }

/* ===================== tutor: allocation + catalogue ===================== */
.sel { font: inherit; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); margin-left: 6px; max-width: 320px; }
.create-code { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8f9fa; margin-bottom: 14px; }
.create-code input#lbl { max-width: 260px; }
.course-ticks { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; margin: 4px 0; }
.course-ticks label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.course-ticks input { width: auto; accent-color: var(--brand); }
.editrow td { background: #f8f9fa; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 14px; }
.cat-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.cat-card h3 { margin: 6px 0 2px; font-weight: 600; }

/* ===================== my courses ===================== */
.course-chip { font-size: 12.5px; color: #cbd2d9; border: 1px solid #3e4c59; border-radius: 4px; padding: 3px 8px; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-chip:empty { display: none; }
.courses-head { margin: 6px 0 20px; }
.courses-head h1 { font-weight: 600; font-size: 26px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.course-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.course-card:hover { border-color: #b9c3cc; }
.course-card h2 { font-size: 19px; font-weight: 600; margin: 4px 0 0; }
.course-card p { margin: 4px 0; color: #3e4c59; font-size: 14.5px; line-height: 1.5; flex: 1; }
.cc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cc-sector { font-family: "IBM Plex Mono", Consolas, monospace; font-size: 11.5px; color: var(--brand); text-transform: uppercase; letter-spacing: .8px; }
.cc-qual { font-size: 13px; color: var(--muted); }
.cc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin: 4px 0 6px; }
.course-card button { align-self: flex-start; margin-top: 10px; }
@media (max-width: 860px) { .course-chip { display: none; } }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #0f1b3d; color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 50; box-shadow: var(--shadow); animation: rise .3s; }

@media (max-width: 860px) {
  .hero, .player { grid-template-columns: 1fr; }
  .outline { position: static; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .bar { grid-template-columns: 120px 1fr 44px; }
  .topbar nav { display: none; }
}
.topbar .logo-img { width: 30px; height: 30px; background: #fff; border-radius: 8px; padding: 2px; }

/* ---- owner security link (tutor dashboard) */
.sec-link { display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 18px; border-radius: 10px;
  border: 1.5px solid #1f2933; background: #1f2933; color: #fff; text-decoration: none; box-shadow: 0 2px 8px rgba(16,24,40,.12); }
.sec-link:hover { filter: brightness(1.12); text-decoration: none; }
.sec-link .sec-ico { font-size: 22px; }
.sec-link b { display: block; font-size: 15px; } .sec-link small { display: block; opacity: .75; font-size: 12.5px; }
.sec-link .sec-state { margin-left: auto; font-weight: 700; font-size: 13px; padding: 5px 10px; border-radius: 6px; background: #1f7a4d; white-space: nowrap; }
.sec-link.risk-elevated .sec-state { background: #b45309; }
.sec-link.risk-high { border-color: #b42318; } .sec-link.risk-high .sec-state { background: #b42318; animation: secpulse 1.6s ease-in-out infinite; }
@keyframes secpulse { 50% { opacity: .65; } }
a.btnlike { display: inline-block; padding: 7px 12px; border-radius: 8px; border: 1.5px solid var(--brand); color: var(--brand); background: #fff;
  font-size: 13.5px; font-weight: 600; text-decoration: none; }
a.btnlike:hover { background: var(--brand-soft); text-decoration: none; }
.enrol { display: flex; align-items: center; gap: 8px; }

/* ---- staff content view */
.preview-bar { background: #0369a1; color: #fff; font-size: 13px; text-align: center; padding: 7px 16px; letter-spacing: .01em; }
.qbank h2 { margin: 2px 0 4px; font-weight: 600; }
.qb-kicker { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #0369a1; }
.qb-topic { margin: 22px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); font-weight: 600; }
.qb-q { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 10px 0; background: #fff; }
.qb-n { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.qb-stem { font-weight: 600; margin-bottom: 8px; }
.qb-opts { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
ol.qb-opts { padding-left: 20px; list-style: decimal; }
.qb-opts li { padding: 6px 10px; border-radius: 6px; background: #f5f7fa; font-size: 14px; }
.qb-opts li.ok { background: var(--good-soft); color: #11632f; font-weight: 600; }
.qb-opts li b { display: inline-block; width: 18px; color: var(--muted); }
.qb-explain { font-size: 13.5px; margin-top: 8px; color: #3e4c59; }
.qb-note { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---- classrooms */
.rooms { display: grid; grid-template-columns: 290px 1fr; gap: 18px; align-items: start; }
.rt { border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; padding: 12px; position: sticky; top: 70px; max-height: calc(100vh - 100px); overflow: auto; }
.rt-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.rt-tools { display: flex; gap: 6px; margin-bottom: 10px; }
.rt-folder { --d: 0; }
.rt-frow, .rt-room { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.rt-kids { padding-left: 14px; border-left: 1px dashed #d9e2ec; margin-left: 10px; }
.rt-frow:hover, .rt-room:hover { background: #eef2f6; }
.rt-room.sel { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.rt-room.arch { opacity: .55; }
.rt-caret { width: 12px; color: #7b8794; font-size: 11px; }
.rt-fname { font-weight: 600; color: #334e68; }
.rt-ico { color: #0369a1; font-size: 12px; }
.rt-name, .rt-fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-count { font-size: 11.5px; color: #7b8794; background: #eef1f4; border-radius: 999px; padding: 1px 7px; }
.rt-count:empty { display: none; }
.rt-acts { display: none; gap: 2px; }
.rt-frow:hover .rt-acts { display: inline-flex; }
.rt-a { font: inherit; font-size: 13px; line-height: 1; padding: 3px 6px; border-radius: 5px; border: 0; background: transparent; color: #52606d; cursor: pointer; }
.rt-a:hover { background: #dde5ec; color: #102a43; }
.rt-empty { font-size: 12.5px; color: #9aa5b1; padding: 4px 8px; }
.rt-group { margin-bottom: 4px; }
.rt-grow { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.rt-grow:hover { background: #eef2f6; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.seg button { flex: 1; font: inherit; font-size: 12.5px; padding: 6px 8px; border: 0; background: #fff; color: #52606d; cursor: pointer; border-radius: 0; }
.seg button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
/* people & access grouped by organisation */
tr.grp-row td { background: #f3f6f9; border-top: 2px solid #d9e2ec; padding: 9px 10px; cursor: pointer; font-size: 14px; }
tr.grp-row:hover td { background: #eaf0f5; }
tr.grp-row button { margin-left: 10px; }
.grp-caret { display: inline-block; width: 16px; color: #7b8794; font-size: 11px; }
.grp-sum { margin-left: 10px; font-size: 12.5px; color: var(--muted); }
/* organisations tab */
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.org-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fff; }
.oc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 6px; }
.oc-head h3 { margin: 0; font-weight: 600; }
.oc-sec { padding: 7px 0; border-bottom: 1px dashed #e4e9ee; font-size: 13.5px; }
.oc-lbl { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #0369a1; margin-bottom: 4px; }
.rd-empty { padding: 30px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
.rd-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; background: #fff; }
.rd-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rd-side { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.rd-kicker { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #0369a1; }
.rd-title { margin: 4px 0 6px; font-weight: 600; }
.rd-card h4 { margin: 20px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #52606d; }
.rd-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rd-table td, .rd-table th { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.rd-table th { font-size: 11.5px; color: var(--muted); text-transform: none; letter-spacing: 0; background: #f8f9fc; white-space: nowrap; }
.issue { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; padding: 10px; background: #f8fafc; border-radius: 10px; }
.chip-x { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: #eef2f6; font-size: 13px; }
.chip-x button { border: 0; background: none; cursor: pointer; color: #7b8794; font-size: 14px; padding: 0 2px; }
.mini { width: 90px; height: 7px; border-radius: 4px; background: #e4e7eb; overflow: hidden; }
.mini i { display: block; height: 100%; }
.tiny-tick { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; margin-left: 6px; white-space: nowrap; }
.tiny-tick input { width: auto; margin: 0; accent-color: #0369a1; }
.pg-box { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.pg-list { display: grid; gap: 8px; margin-top: 12px; }
.pg { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.pg-mods { margin: 10px 0; padding-left: 22px; }
.pg-mods li { padding: 5px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
@media (max-width: 900px) { .rooms { grid-template-columns: 1fr; } .rt { position: static; max-height: none; } }

/* ---- learner: programmes on My courses */
.prog-head { margin: 26px 0 10px; display: flex; align-items: baseline; gap: 10px; }
.prog-head h2 { margin: 0; font-size: 19px; font-weight: 600; }
.course-card.locked { opacity: .62; }
.course-card .mod-n { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #0369a1; }

/* ---- focused re-teach after a failed final */
.reteach { display: grid; gap: 14px; max-width: 860px; margin: 0 auto; }
.rt-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.rt-step { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: #f1f4f7; color: #7b8794; font-size: 14px; font-weight: 500; }
.rt-step span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #dde3ea; font-size: 12px; font-weight: 700; }
.rt-step.on { background: #e6f1f4; color: #0369a1; } .rt-step.on span { background: #0369a1; color: #fff; }
.rt-step.done { background: var(--good-soft); color: var(--good); } .rt-step.done span { background: var(--good); color: #fff; }
.rt-topic h3 { font-weight: 600; }
.rt-lbl { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #7b8794; margin: 14px 0 6px; }
.rt-los { background: #fbfcfd; border: 1px solid var(--line); border-radius: 8px; padding: 2px 12px 10px; margin-top: 10px; }
.rt-lo { font-size: 14px; padding: 3px 0; color: #334e68; }
.rt-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; color: inherit; text-decoration: none; }
.rt-card:hover { border-color: #0369a1; text-decoration: none; }
.rt-card em { margin-left: auto; font-style: normal; font-size: 12.5px; font-weight: 600; color: #0369a1; }
.rt-card.seen { background: var(--good-soft); border-color: #cde7d8; } .rt-card.seen em { color: var(--good); }
.rt-back { display: inline-block; font-size: 13.5px; font-weight: 600; margin-bottom: 10px; }

/* ---- 3D scenes: dials, coach, chart, checks, clearer text */
.scene-wrap.scene-tall { height: 640px; }
.scene-hud .tag { font-size: 14px; line-height: 1.45; max-width: 58%; }
.has-coach .scene-hud .tag { margin-left: 330px; max-width: calc(100% - 640px); }
.scene-label { font-size: 12.5px; }
.scene-panel .ctl.dial-ctl { padding: 4px 8px 6px; }
.dial { display: flex; flex-direction: column; align-items: center; cursor: grab; outline: none; user-select: none; touch-action: none; }
.dial.grab { cursor: grabbing; }
.dial:focus-visible { box-shadow: 0 0 0 2px #7ff5c8; border-radius: 10px; }
.dl-track { fill: none; stroke: rgba(255,255,255,.18); stroke-width: 7; stroke-linecap: round; }
.dl-zone { fill: none; stroke-width: 7; opacity: .85; }
.dl-ticks line { stroke: rgba(255,255,255,.55); stroke-width: 1.2; }
.dl-needle line { stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.dl-needle circle { fill: #1f2933; stroke: #fff; stroke-width: 2; }
.dl-actual { fill: #ff6b5a; }
.dl-val { fill: #fff; font: 600 14px "IBM Plex Mono", monospace; }
.dl-label { font-size: 12px; font-weight: 600; margin-top: -4px; }
.dl-zone-name { font-size: 11px; min-height: 14px; }
.readout { font-size: 12.5px; line-height: 1.55; min-width: 250px; }
.readout small { opacity: .7; } .rd-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.scene-chart { background: rgba(10,18,40,.82); color: #dfe7ff; padding: 8px 10px; border-radius: 10px; font-size: 11px; pointer-events: auto; }
.scene-chart canvas { display: block; }
.sch-title { font-weight: 600; margin-bottom: 4px; } .sch-key span { margin-right: 8px; } .sch-key i { display: inline-block; width: 10px; height: 3px; margin-right: 4px; vertical-align: middle; }
.scene-coach { position: absolute; left: 12px; top: 12px; width: 310px; max-height: calc(100% - 190px); overflow: auto; background: rgba(250,251,253,.97); color: #1f2933; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.25); z-index: 4; font-size: 14px; }
.scene-coach.min .cc-body { display: none; }
.cc-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #e4e7eb; }
.cc-av { width: 38px; height: 38px; flex: none; } .cc-av svg { width: 38px; height: 38px; }
.cc-hd { flex: 1; } .cc-step { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #0369a1; } .cc-title { font-weight: 600; font-size: 15px; }
.cc-btn { border: 0; background: #eef2f6; color: #334e68; border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 12px; }
.cc-pause { width: 76px; font-weight: 600; white-space: nowrap; }   /* fixed width: Pause/Play swaps without the header moving */
.cc-pause.on { background: #0369a1; color: #fff; }
.tutor-svg.hush, .tutor-svg.hush * { animation-play-state: paused !important; }
.cc-body { padding: 10px 14px 12px; line-height: 1.5; }
.cc-opts { display: grid; gap: 6px; margin: 10px 0; } .cc-opts button { text-align: left; background: #fff; color: #1f2933; border: 1.5px solid #d9e2ec; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; cursor: pointer; }
.cc-opts button.ok { border-color: #1f7a4d; background: #e8f4ee; } .cc-opts button.no { border-color: #b42318; background: #fbeceb; }
.cc-task { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; padding: 8px 10px; background: #f0f7f9; border-radius: 8px; font-size: 13px; font-weight: 600; color: #0369a1; }
.cc-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #0369a1; margin-top: 4px; flex: none; }
.cc-task.done { background: #e8f4ee; color: #1f7a4d; } .cc-task.done .cc-dot { background: #1f7a4d; border-color: #1f7a4d; }
.cc-fb { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #f5f7fa; font-size: 13.5px; } .cc-fb.ok { background: #e8f4ee; } .cc-fb.no { background: #fbeceb; }
.cc-kp { padding-left: 18px; margin: 4px 0; } .cc-kp li { margin-bottom: 6px; }
.cc-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 8px; }
.cc-nav button { font-size: 13px; padding: 6px 12px; } .cc-nav button:disabled { opacity: .4; }
.cc-prog { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 132px; }
.scene-coach .cc-nav { position: sticky; bottom: -12px; background: rgba(250,251,253,.98); padding: 8px 0 10px; margin-bottom: -12px; }   /* Back/Next always visible */
.cc-nav button { white-space: nowrap; } .cc-prog i { width: 6px; height: 6px; border-radius: 50%; background: #d9e2ec; } .cc-prog i.d { background: #1f7a4d; } .cc-prog i.c { background: #0369a1; }
.scene-check { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(420px, 90%); background: #fff; color: #1f2933; border-radius: 12px; padding: 16px; z-index: 5; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.sc-kicker { font-size: 14px; font-weight: 600; color: #1f2933; } .sc-q { font-weight: 600; margin: 6px 0 10px; }
.sc-opts { display: grid; gap: 6px; } .sc-opts button { text-align: left; background: #fff; color: #1f2933; border: 1.5px solid #d9e2ec; border-radius: 8px; padding: 8px 10px; }
.sc-opts button.ok { border-color: #1f7a4d; background: #e8f4ee; } .sc-opts button.no { border-color: #b42318; background: #fbeceb; }
.sc-fb { margin-top: 10px; font-size: 13.5px; } .sc-go { margin-top: 8px; }
.scene-hud .hud-right { margin-left: auto; }
/* controls never resize as their text changes, so dials don't jump while you turn them */
.scene-panel { align-items: flex-end; }
.scene-panel .ctl.dial-ctl { flex: none; width: 124px; justify-content: center; }
.dl-label, .dl-zone-name { width: 112px; text-align: center; }
.dl-zone-name { height: 28px; line-height: 14px; overflow: hidden; }
.readout { width: 300px; min-width: 0; }
.readout > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-panel .ctl.stat-ctl { flex: none; width: 240px; flex-wrap: nowrap; }
.stat-ctl .statustext { height: 32px; line-height: 16px; overflow: hidden; display: flex; align-items: center; }
.scene-panel .ctl.chemres-ctl { flex: 1 1 100%; min-height: 40px; }
/* walkthrough step where the rig is operated for the learner */
.cc-task.cc-watch { background: #fff6e5; color: #8a5300; }
.cc-task.cc-watch .cc-dot { border-color: #c27c0e; animation: ccPulse 1s ease-in-out infinite; }
.cc-task.cc-watch.done { background: #e8f4ee; color: #1f7a4d; } .cc-task.cc-watch.done .cc-dot { animation: none; }
@keyframes ccPulse { 50% { background: #f3b34c; } }
.scene-panel .ctl.locked { opacity: .45; pointer-events: none; filter: grayscale(.4); }
.cc-compare { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 6px 0 2px; }
.cc-compare th, .cc-compare td { padding: 4px 5px; border-bottom: 1px solid #e4e7eb; text-align: left; vertical-align: top; }
.cc-compare th { font-size: 11px; color: #0369a1; text-transform: uppercase; letter-spacing: .05em; }
.cc-compare td:first-child { font-weight: 600; color: #334e68; white-space: nowrap; }
/* callout labels: a dot on the part, a leader line, and a name box that expands to explain the part when selected */
.scene-label.callout { padding: 0; background: none; border: 0; width: 0; height: 0; overflow: visible; }
.callout .cl { position: absolute; display: flex; align-items: center; }
.callout .cl-dot { width: 7px; height: 7px; border-radius: 50%; background: #7ff5c8; box-shadow: 0 0 0 2px rgba(10, 18, 40, .85); flex: none; }
.callout .cl-line { background: rgba(255, 255, 255, .7); flex: none; }
.callout .cl-box { background: rgba(10, 18, 40, .88); color: #fff; border: 1px solid rgba(255, 255, 255, .2); border-radius: 7px; padding: 3px 8px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; pointer-events: auto; cursor: pointer; }
.callout .cl-desc { display: none; font-weight: 400; white-space: normal; width: 210px; margin-top: 3px; font-size: 12px; line-height: 1.4; color: #dfe7ff; }
.callout.sel { z-index: 3; }
.callout.right .cl-desc { width: 150px; }   /* right-hand labels sit near the scene edge */
.callout .cl-detail { margin-top: 5px; padding-top: 5px; border-top: 1px solid rgba(255,255,255,.2); color: #c9d6f2; }
.callout.brief .cl-detail { display: none; }   /* the guided tour gives the short description; a selected label gives the detail */
/* the control being explained or operated in a demonstration */
.scene-panel .ctl.spot-host { opacity: 1 !important; filter: none !important; }
.scene-panel .ctl.spot, .scene-chart.spot, .sbtn.spot { box-shadow: 0 0 0 2px #7ff5c8, 0 0 16px rgba(127, 245, 200, .55); animation: spotPulse 1.3s ease-in-out infinite; }
.scene-fps { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 6; background: rgba(0,0,0,.65); color: #7ff5c8; font: 12px/1.4 "IBM Plex Mono", monospace; padding: 3px 8px; border-radius: 6px; pointer-events: none; }
.scene-panel .ctl.hint-host { opacity: 1 !important; filter: none !important; }
.hint { animation: hintPulse 1.3s ease-in-out 2; border-radius: 6px; }
@keyframes hintPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(127, 245, 200, 0); } 50% { box-shadow: 0 0 0 3px #7ff5c8, 0 0 22px rgba(127, 245, 200, .8); } }
.scene-label.spot { box-shadow: 0 0 0 2px #7ff5c8, 0 0 16px rgba(127, 245, 200, .55); animation: spotPulse 1.3s ease-in-out infinite; border-radius: 6px; }
@keyframes spotPulse { 50% { box-shadow: 0 0 0 3px #7ff5c8, 0 0 26px rgba(127, 245, 200, .85); } }
/* a button the demonstration presses: it visibly goes down */
.sbtn.pressing { transform: translateY(2px) scale(.94); background: var(--brand); border-color: #7ff5c8; transition: transform .08s; }
/* walkthrough: dots you can jump to, and the moment a step is being set up */
.cc-prog i.go { cursor: pointer; outline: 2px solid transparent; } .cc-prog i.go:hover { outline-color: #0369a1; transform: scale(1.4); }
.scene-coach .cc-busy { display: none; } .scene-coach.busy .cc-busy { display: block; text-align: center; font-size: 13px; color: #0369a1; padding: 6px 0 2px; }
.scene-coach.busy .cc-nav button, .scene-coach.busy .cc-prog { pointer-events: none; opacity: .4; }
/* instrument chart docked bottom right, above the reset/full-screen buttons; the controls stop short of it */
.scene-chart.docked { position: absolute; right: 12px; bottom: 56px; z-index: 2; pointer-events: auto; }
.chart-docked .scene-panel { right: 296px; }
.callout.sel .cl-box { background: #0369a1; border-color: #7ff5c8; }
.callout.sel .cl-desc { display: block; }
.callout.sel .cl-dot { background: #fff; box-shadow: 0 0 0 3px #0369a1; }
.callout.up .cl { flex-direction: column-reverse; left: 0; bottom: 0; transform: translate(-50%, 3.5px); }
.callout.down .cl { flex-direction: column; left: 0; top: 0; transform: translate(-50%, -3.5px); }
.callout.left .cl { flex-direction: row-reverse; right: 0; top: 0; transform: translate(3.5px, -50%); }
.callout.right .cl { flex-direction: row; left: 0; top: 0; transform: translate(-3.5px, -50%); }
.callout.up .cl-line, .callout.down .cl-line { width: 1.5px; height: var(--len, 24px); }
.callout.left .cl-line, .callout.right .cl-line { height: 1.5px; width: var(--len, 24px); }
/* flame test: heat-release gauges beside each strip */
.scene-label.heat-gauge { width: 104px; padding: 8px 10px 10px; border-radius: 12px; background: rgba(10, 18, 40, .9); border: 1px solid rgba(255,255,255,.22); white-space: normal; }
.heat-gauge .hg-title { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #9fb0d0; }
.heat-gauge .hg-name { font-size: 17px; font-weight: 700; margin: 2px 0 6px; }
.heat-gauge .hg-bar { position: relative; width: 34px; height: 130px; margin: 0 auto; border-radius: 8px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); overflow: hidden; }
.heat-gauge .hg-bar i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(0deg, #ffb703, #ff3b1f); transition: height .3s; }
.heat-gauge .hg-tick { position: absolute; left: 0; right: 0; height: 1px; background: rgba(255,255,255,.35); }
.heat-gauge .hg-val { font-size: 20px; font-weight: 700; margin-top: 6px; font-family: "IBM Plex Mono", monospace; }
.heat-gauge .hg-level { font-size: 12.5px; font-weight: 600; color: #9fb0d0; }
.heat-gauge[data-level="low"] .hg-level { color: #7ff5c8; }
.heat-gauge[data-level="mid"] .hg-level { color: #ffb703; }
.heat-gauge[data-level="high"] .hg-level { color: #ff6b5a; }
.heat-gauge[data-level="high"] { box-shadow: 0 0 0 2px rgba(255, 90, 60, .6), 0 0 22px rgba(255, 90, 60, .35); }
.scene-label.heat-gauge.spot { animation: spotPulse 1.3s ease-in-out infinite; box-shadow: 0 0 0 2px #7ff5c8, 0 0 16px rgba(127, 245, 200, .55); }
/* partial charges on the PVC molecule */
.scene-label.delta { font-size: 15px; font-weight: 700; padding: 2px 8px; border: 0; color: #fff; }
.scene-label.delta.plus { background: #dc2626; }
.scene-label.delta.minus { background: #16a34a; }
.delta-key { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 4px; font-size: 13px; }
.delta-key .dk { padding: 4px 10px; border-radius: 999px; color: #fff; font-weight: 600; }
.delta-key .dk.plus { background: #dc2626; } .delta-key .dk.minus { background: #16a34a; }
.delta-key .dk-bond { color: #52606d; font-size: 12px; }
/* production site: in → process → out card */
.pl-card { display: grid; gap: 7px; margin: 6px 0 2px; }
.pl-card > div { display: grid; grid-template-columns: 62px 1fr; gap: 8px; align-items: start; }
.pl-card span { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #0369a1; padding-top: 3px; }
.pl-card p { margin: 0; font-size: 13.5px; line-height: 1.45; }
.scene-hud .tag .pl-card span { color: #7ff5c8; }
/* a switch held in place (e.g. Guided walkthrough during the demonstration) */
.sbtn.held { opacity: .6; cursor: not-allowed; }
.sbtn.held::before { content: "🔒 "; font-size: .9em; }

/* ===================== Ingrained Learning brand (1 Dec 2026): matches the Platform Demo end card ===================== */
.brand-word { font-family: "Segoe UI", "IBM Plex Sans", system-ui, sans-serif; font-weight: 600; font-size: 18px; letter-spacing: .1px; color: #fff; white-space: nowrap; }
.brand-word b { font-weight: 600; color: #38bdf8; }
.topbar { background: #0a1018; border-bottom-color: #38bdf8; }
body.lp-mode, .lp { background: #070b11 radial-gradient(ellipse 60% 55% at 50% 30%, #13283c 0%, #0b1520 45%, #070b11 100%) no-repeat fixed; }
.lp-head { justify-content: center; text-align: center; margin-bottom: 26px; }
.lp-word { font-family: "Segoe UI", "IBM Plex Sans", system-ui, sans-serif; color: #fff; letter-spacing: -.3px; }
.lp-word span { color: #38bdf8; }
.lp-word::after { width: 90px; height: 3px; margin: 14px auto 0; background: #38bdf8; border-radius: 2px; }
.lp-tag { font-family: "Segoe UI", "IBM Plex Sans", system-ui, sans-serif; font-weight: 300; color: #d6e0ea; font-size: clamp(15px, 2.2vw, 19px); margin-top: 12px; }
.lp-card { border-color: #1d2a38; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
/* phones: keep the wordmark, avatar and Sign out on one line (the name shows on the course page) */
@media (max-width: 520px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand-word { font-size: 16px; }
  .topbar .me { gap: 6px; }
  .topbar .me > span:not(.pill):not(.badge) { display: none; }
}

/* ---- word definitions (glossary.js): key terms are bold (the course's own bold terms and glossary words alike); tapping one opens a small definition box */
.gl { font-weight: 600; cursor: pointer; border-radius: 3px; transition: background .12s, color .12s; }   /* same weight as the course's bold key terms */
.gl-def + .gl-def { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.gl-multi { max-height: min(60vh, 420px); overflow-y: auto; }
b .gl, strong .gl, h1 .gl, h2 .gl, h3 .gl, h4 .gl { font-weight: inherit; }
.gl:hover, .gl.on { color: var(--brand-2); background: var(--brand-soft); }
.gl:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.gl-pop { position: absolute; z-index: 60; width: 340px; max-width: calc(100vw - 24px); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 10px 28px rgba(16, 24, 40, .10), 0 2px 6px rgba(16, 24, 40, .06);
  padding: 12px 16px 13px; font-size: 14.5px; line-height: 1.55; color: var(--ink); animation: glIn .14s ease; }
.gl-pop.above { animation-name: glInUp; }
.gl-caret { position: absolute; top: -6px; width: 11px; height: 11px; margin-left: -5.5px; background: var(--panel);
  border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.gl-pop.above .gl-caret { top: auto; bottom: -6px; transform: rotate(225deg); }
.gl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.gl-term { font-weight: 600; font-size: 15px; color: var(--brand-2); }
.gl-x { background: none; border: 0; padding: 0 2px; margin: -4px -4px 0 0; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; box-shadow: none; min-height: 0; }
.gl-x:hover { color: var(--ink); background: none; }
.gl-short, .gl-more { margin: 0; }
.gl-more { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); }
.gl-morebtn { background: none; border: 0; padding: 0; margin-top: 8px; color: var(--brand); font-size: 13.5px; font-weight: 500; cursor: pointer; box-shadow: none; min-height: 0; }
.gl-morebtn:hover { text-decoration: underline; background: none; }
.gl-note { margin-top: 10px; font-size: 12px; color: var(--muted); }
@keyframes glIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes glInUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .gl-pop { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto !important; max-width: none; border-radius: 16px 16px 0 0;
    border: 0; border-top: 1px solid var(--line); box-shadow: 0 -8px 28px rgba(16, 24, 40, .14);
    padding: 18px 20px calc(20px + env(safe-area-inset-bottom)); font-size: 15.5px; animation: glUp .2s ease; }
  .gl-pop::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: -8px auto 12px; }
  .gl-caret { display: none; }
  @keyframes glUp { from { transform: translateY(100%); } to { transform: none; } }
}
@media print { .gl-pop { display: none; } }

/* ---- owner's learner preview (tutor dashboard): the learning site in a frame at desktop, tablet or phone width */
.pv-features { margin: 14px 0 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: #fafbfc; }
.pv-feature { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 0; }
.pv-feature + .pv-feature { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: #eef1f5; border-radius: 9px; }
.seg button, .seg button.ghost { background: transparent; color: var(--muted); border: 0; box-shadow: none; padding: 6px 12px; border-radius: 7px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.pv-stage { background: #eef1f5; border-radius: var(--radius); padding: 14px; display: flex; justify-content: center; }
.pv-frame { display: block; width: 100%; height: 78vh; min-height: 560px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
  transition: width .2s ease; }
.pv-frame.pv-device { border: 8px solid #1f2933; border-radius: 22px; max-width: 100%; }

/* ---- Revision section (revision.js): pop-out notepad on each learning card, and the Revision page */
.topbar nav a[hidden] { display: none !important; }
.nb-fab { position: fixed; right: 22px; bottom: 22px; z-index: 55; display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px;
  border-radius: 999px; background: var(--brand); color: #fff; border: 0; font-weight: 600; font-size: 15px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(3, 105, 161, .28), 0 2px 4px rgba(16, 24, 40, .12); transition: transform .12s, background .12s; }
.nb-fab:hover { background: var(--brand-2); transform: translateY(-1px); }
.nb-fab[aria-expanded="true"] { background: var(--brand-2); }
.nb-dot { width: 8px; height: 8px; border-radius: 50%; background: #fbbf24; display: inline-block; box-shadow: 0 0 0 2px var(--brand); }
.nb-dot[hidden] { display: none; }
.nb-panel { position: fixed; right: 22px; bottom: 84px; z-index: 56; width: 400px; max-width: calc(100vw - 32px); max-height: min(76vh, 640px);
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 20px 48px rgba(16, 24, 40, .18), 0 4px 10px rgba(16, 24, 40, .08); animation: glIn .16s ease; }
.nb-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px 18px; }
.nb-title { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.nb-title span { color: var(--brand); }
.nb-x { background: none; border: 0; box-shadow: none; font-size: 24px; line-height: 1; color: var(--muted); padding: 2px 8px; cursor: pointer; min-height: 0; border-radius: 8px; }
.nb-x:hover { color: var(--ink); background: #f2f4f7; }
.nb-tabs { display: flex; gap: 2px; margin: 0 14px; padding: 3px; background: #f2f4f7; border-radius: 10px; }
.nb-tabs button { flex: 1; background: transparent; color: var(--muted); border: 0; box-shadow: none; padding: 7px 10px; border-radius: 8px; font-weight: 500; font-size: 14px; min-height: 0; }
.nb-tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.nb-body { padding: 14px 18px 12px; overflow-y: auto; flex: 1; }
.nb-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 13px; background: #fafbfc; }
.nb-foot a { color: var(--brand); font-weight: 500; text-decoration: none; }
.nb-foot a:hover { text-decoration: underline; }
.nb-private { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.nb-ctx { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.nb-ctx-k { font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--brand); }
.nb-ctx-t { font-weight: 600; font-size: 15px; line-height: 1.3; }
.nb-starbtn { flex-shrink: 0; background: var(--panel); color: var(--muted); border: 1px solid var(--line); box-shadow: none; padding: 5px 10px;
  border-radius: 999px; font-size: 13px; font-weight: 500; cursor: pointer; min-height: 0; }
.nb-starbtn:hover { border-color: #f5b041; color: #b54708; background: var(--panel); }
.nb-starbtn.on { background: #fffaeb; border-color: #fedf89; color: #b54708; }
.nb-back { background: none; border: 0; box-shadow: none; color: var(--brand); padding: 4px 0; font-weight: 500; font-size: 14px; cursor: pointer; min-height: 0; }
.nb-back:hover { background: none; text-decoration: underline; }
.nb-text { width: 100%; min-height: 160px; resize: none; font: inherit; font-size: 15px; line-height: 1.6; padding: 12px 14px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 12px; background: #fffef9; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
.nb-text::placeholder { color: #98a2b3; }
.nb-text:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: #fff; }
.nb-text.nb-bad { border-color: #f04438; }
.nb-new { min-height: 0; }
.nb-status { font-size: 12.5px; color: var(--muted); margin-top: 6px; min-height: 1.2em; }
.nb-status[data-state="ok"]::before { content: "✓ "; color: #039855; }
.nb-status[data-state="busy"] { color: var(--muted); }
.nb-status[data-state="err"] { color: #b42318; }
.nb-quote { display: block; margin: 0 0 8px; background: var(--brand-soft); border: 0; color: var(--brand-2); box-shadow: none; font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.nb-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.nb-row .nb-status { flex: 1; margin: 0; }
.nb-del { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; box-shadow: none; color: #b42318; font-size: 13px; padding: 4px 6px; cursor: pointer; min-height: 0; border-radius: 6px; }
.nb-del:hover { background: #fef3f2; }
.nb-compose { display: flex; gap: 8px; align-items: flex-end; }
.nb-compose .nb-text { min-height: 48px; }
.nb-list { margin-top: 12px; display: grid; gap: 8px; }
.nb-item { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer;
  background: var(--panel); color: var(--ink); box-shadow: none; font-weight: 400; min-height: 0; }
.nb-item:hover { border-color: var(--brand); background: var(--panel); }
.nb-itext { display: -webkit-box; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.nb-imeta { display: flex; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.nb-istar { color: #f59e0b; }
.nb-empty { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin: 4px 0 0; }
@media (max-width: 640px) {
  .nb-fab { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); padding: 11px 18px; }
  .nb-panel { left: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: 85vh; border-radius: 18px 18px 0 0; border: 0;
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); animation: glUp .2s ease; }
  .nb-head::before { content: ""; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line); }
  .nb-head { position: relative; padding-top: 18px; }
}
@media print { .nb-fab, .nb-panel { display: none; } }

/* My notes page */
.mn-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.mn-sum { color: var(--muted); font-size: 14px; }
.mn-search { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.mn-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.mn-search span { color: var(--muted); font-size: 18px; }
.mn-search input { flex: 1; border: 0; outline: none; padding: 9px 0; font: inherit; background: transparent; }
.mn-topic { font-size: 14px; font-weight: 600; color: var(--ink); margin: 14px 0 8px; }
.mn-note { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; transition: border-color .12s; }
.mn-note:hover { border-color: #cfd6de; }
.mn-new { border-color: var(--brand); }
.mn-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.mn-title { font-weight: 600; font-size: 14.5px; color: var(--brand-2); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.mn-title:hover { text-decoration: underline; }
span.mn-title { color: var(--muted); }
.mn-where { font-size: 12px; color: var(--muted); background: #f2f4f7; border-radius: 6px; padding: 2px 7px; flex-shrink: 0; }
.mn-acts { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.mn-date { font-size: 12.5px; color: var(--muted); margin-right: 6px; }
.mn-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; background: none; border: 0; box-shadow: none;
  color: #98a2b3; border-radius: 8px; cursor: pointer; font-size: 17px; min-height: 0; }
.mn-icon:hover { background: #f2f4f7; color: var(--ink); }
.mn-star.on { color: #f59e0b; }
.mn-danger:hover { background: #fef3f2; color: #b42318; }
.mn-text { white-space: pre-wrap; font-size: 15px; line-height: 1.6; color: var(--ink); }
.mn-empty { padding: 40px 20px; }
.mn-empty p { max-width: 440px; margin: 8px auto 0; }
.mn-empty-i { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 24px; }
@media (max-width: 640px) {
  .mn-date { display: none; }
  .rev-tools .seg { width: 100%; }
  .rev-tools .seg button { flex: 1; }
}

.rev { max-width: 980px; margin: 0 auto; }
.rev-head h1 { margin: 2px 0 4px; font-size: 28px; }
.rev-head p { margin: 0; }
.rev-tabs { display: flex; gap: 4px; margin: 18px 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.rev-tabs::-webkit-scrollbar { display: none; }
.rev-tools .seg button { white-space: nowrap; }
.rev-tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.rev-tabs a:hover { color: var(--ink); }
.rev-tabs a.on { color: var(--brand-2); border-bottom-color: var(--brand); }
.rev-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.rev-search { flex: 1; min-width: 180px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; }
.rev-mod { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 22px 0 8px; }
.rev-empty { text-align: center; color: var(--muted); padding: 36px 16px; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); line-height: 1.6; }
.rev-card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.fc-intro { font-size: 14px; color: var(--muted); background: var(--panel); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; line-height: 1.55; }
.fc-top, .fc-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.fc-deck { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px 16px; background: var(--panel);
  color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; font-weight: 400; }
.fc-deck:hover { border-color: var(--brand); background: var(--panel); }
.fc-deck span { font-size: 13px; color: var(--muted); }
.fc-deck em { color: var(--brand); font-style: normal; font-weight: 600; }
.fc-main { background: var(--brand-soft); border-color: #bae6fd; }
.fc-main:hover { background: var(--brand-soft); }
a.fc-deck { text-decoration: none; }
a.fc-deck:hover { text-decoration: none; }
.fc-step { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 18px 0 12px; }
.fc-step span { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; }
.fc-crumbs { font-size: 14px; color: var(--muted); margin: 2px 0 4px; }
.fc-crumbs a { color: var(--brand); }
.fc-alt { margin: 16px 0 0; font-size: 14px; }
.fc-alt a { color: var(--brand); }
.fc-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.fc-prog { height: 4px; background: #e4e7eb; border-radius: 4px; margin: 10px 0 16px; overflow: hidden; }
.fc-prog i { display: block; height: 100%; background: var(--brand); transition: width .25s; }
.fc-card { max-width: 620px; margin: 0 auto; background: var(--panel); border-radius: 16px; box-shadow: 0 6px 20px rgba(16, 24, 40, .08); padding: 34px 28px;
  text-align: center; min-height: 260px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.fc-meta { font-size: 13px; color: var(--muted); }
.fc-front { font-size: 22px; line-height: 1.35; font-weight: 600; color: var(--brand-2); }
.fc-say { color: var(--muted); margin: 0; }
.fc-back { font-size: 17px; line-height: 1.55; border-top: 1px solid var(--line); padding-top: 16px; animation: glIn .2s ease; }
.fc-more { font-size: 14px; color: var(--muted); margin-top: 8px; }
.fc-choose { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fc-choose button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 10px; border-radius: 12px; box-shadow: none; }
.fc-choose b { font-size: 16px; }
.fc-choose small { font-size: 12.5px; font-weight: 400; opacity: .85; }
.fc-again { background: #fffaeb; color: #93370d; border: 1px solid #fedf89; }
.fc-again:hover { background: #fef0c7; }
.fc-knew { background: #ecfdf3; color: #05603a; border: 1px solid #abefc6; }
.fc-knew:hover { background: #d1fadf; }
.fc-src { font-size: 13px; color: var(--muted); }
.fc-src:hover { color: var(--brand); }
#fcShow { align-self: center; min-width: 180px; }
.fc-done h2 { margin: 0; }
.fc-tick { width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: #ecfdf3; color: #039855; font-size: 26px; }
@media (max-width: 640px) { .fc-choose { grid-template-columns: 1fr; } }
.kt-list { display: grid; gap: 8px; }
.kt { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.kt-term { font-weight: 600; color: var(--brand-2); }
.kt-def { line-height: 1.5; }
.kt details { margin-top: 4px; color: var(--muted); font-size: 14px; }
.kt summary { cursor: pointer; color: var(--brand); font-size: 13px; }
@media (max-width: 640px) {
  .kt { grid-template-columns: 1fr; gap: 4px; }
  .fc-card { padding: 26px 18px; }
  .fc-front { font-size: 24px; }
  kbd { display: none; }
}
