/* Classwork AI: shared styles */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #1b1f2a;
  --muted: #5b6475;
  --border: #dde2ee;
  --accent: #4f46e5;
  --accent-soft: #e6e5fd;
  --accent-text: #ffffff;
  --pos: #0f9d58;
  --pos-soft: #dcf5e8;
  --neg: #d93a3a;
  --neg-soft: #fde4e4;
  --warn: #c77700;
  --c1: #4f46e5;
  --c2: #e8590c;
  --c3: #0f9d58;
  --c4: #c2255c;
  --shadow: 0 1px 2px rgba(20,24,40,.06), 0 4px 16px rgba(20,24,40,.06);
  --radius: 14px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1220;
  --surface: #181c2e;
  --surface-2: #22273d;
  --text: #e9ecf5;
  --muted: #9aa3b8;
  --border: #2e3450;
  --accent: #8b85ff;
  --accent-soft: #2a2858;
  --accent-text: #0f1220;
  --pos: #3ccf8e;
  --pos-soft: #133a2a;
  --neg: #ff6b6b;
  --neg-soft: #401e24;
  --warn: #ffb547;
  --c1: #8b85ff;
  --c2: #ff8f4d;
  --c3: #3ccf8e;
  --c4: #f06595;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-text); font-size: .8rem; }
.crumbs { color: var(--muted); font-size: .9rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.icon-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 1.05rem;
  display: grid; place-items: center; flex: none;
}
.icon-btn:hover { background: var(--surface-2); }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 80px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: 10px; cursor: pointer; font: inherit; font-size: .95rem; font-weight: 600;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Cards & grids */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
a.card { text-decoration: none; color: inherit; display: block; transition: transform .15s, border-color .15s; }
a.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card.disabled { opacity: .55; pointer-events: none; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.tag.soon { background: var(--surface-2); color: var(--muted); }
.big-num { font-size: 2.6rem; font-weight: 800; color: var(--accent); line-height: 1; }

/* Gate */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate .card { width: 100%; max-width: 380px; text-align: center; }
.gate input {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); margin: 12px 0; text-align: center; letter-spacing: .15em;
}
.gate .err { color: var(--neg); min-height: 1.4em; font-size: .9rem; }

/* Topic sections */
.topic { margin-top: 36px; scroll-margin-top: 70px; }
.topic-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.topic-head h2 { margin: 0; }
.topic-num { color: var(--accent); font-weight: 800; margin-right: 6px; }
.viz {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); position: relative;
}
.viz:fullscreen { overflow: auto; padding: 32px; font-size: 1.15rem; }
.viz-tools { position: absolute; top: 10px; right: 10px; }
.callout { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; margin: 12px 0 0; font-size: .95rem; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.toc a { font-size: .85rem; padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.toc a:hover { border-color: var(--accent); }

/* Tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); padding: 7px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 600; }
.tab.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* Controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 10px 0; }
.controls label { font-size: .9rem; display: flex; align-items: center; gap: 8px; }
input[type=range] { accent-color: var(--accent); width: 140px; }
.stat { font-variant-numeric: tabular-nums; font-weight: 700; }
.two-col { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .two-col { grid-template-columns: 1.4fr 1fr; } }

svg { display: block; max-width: 100%; height: auto; }
svg text { fill: var(--text); font-family: inherit; }
.chip {
  display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: grab; font-size: .9rem; user-select: none; margin: 3px;
}
.chip.ok { background: var(--pos-soft); border-color: var(--pos); }
.chip.bad { background: var(--neg-soft); border-color: var(--neg); }

/* Quiz modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(10,12,24,.55); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-back.open { display: flex; }
.modal {
  background: var(--surface); color: var(--text); border-radius: 18px; width: 100%; max-width: 620px;
  max-height: 92vh; overflow: auto; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.quiz-progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 8px 0 18px; }
.quiz-progress span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.quiz-q { font-size: 1.15rem; font-weight: 600; margin-bottom: 14px; }
.opt {
  display: block; width: 100%; text-align: left; font: inherit; padding: 12px 14px; margin: 8px 0;
  border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt.correct { border-color: var(--pos); background: var(--pos-soft); }
.opt.wrong { border-color: var(--neg); background: var(--neg-soft); }
.opt:disabled { cursor: default; }
.explain { font-size: .92rem; color: var(--muted); margin-top: 8px; min-height: 1.4em; }
.score-big { font-size: 3.4rem; font-weight: 800; color: var(--accent); text-align: center; }

footer.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 30px 16px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .viz { padding: 14px; }
  .crumbs { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Visual helpers */
.flow { stroke-dasharray: 7 5; animation: flow .9s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -24; } }
.clickable { cursor: pointer; }
.draggable { cursor: grab; }
.calc { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.calc td { padding: 4px 6px; border-bottom: 1px solid var(--border); }
.calc td:last-child { text-align: right; font-weight: 600; }
.basket { display: inline-block; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 10px; padding: 6px 8px; margin: 4px; font-size: 1.25rem; min-width: 70px; text-align: center; }
.basket.hit { border-color: var(--accent); background: var(--accent-soft); }
.basket small { display: block; font-size: .7rem; color: var(--muted); }
.bar-row { display: grid; grid-template-columns: 110px 1fr 48px; align-items: center; gap: 8px; margin: 6px 0; font-size: .9rem; }
.bar { height: 14px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.nrow { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.nrow input[type=range] { width: 120px; }

/* ---------- Generic activities ---------- */
.act-prompt { margin-bottom: 8px; }
.act-msg { min-height: 1.5em; margin: 10px 0 6px; font-size: .93rem; }
.act-msg.good { color: var(--pos); }
.act-msg.bad { color: var(--neg); }
.sort-tray { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px; border: 1.5px dashed var(--border); border-radius: 12px; min-height: 52px; margin-bottom: 10px; }
.chip.sel { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.sort-buckets { display: grid; gap: 10px; }
.bucket { border: 2px solid var(--bc); border-radius: 12px; padding: 8px 10px; min-height: 90px; cursor: pointer; background: color-mix(in srgb, var(--bc) 7%, transparent); transition: transform .15s; }
.bucket:hover { transform: translateY(-1px); }
.bucket-h { font-weight: 800; color: var(--bc); font-size: .95rem; }
.bucket-items .chip { cursor: default; font-size: .82rem; }
.bucket.flash-bad { animation: shake .4s; border-color: var(--neg); }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.order-list { list-style: none; padding: 0; margin: 0; }
.order-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; margin: 6px 0; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); }
.order-item.good { border-color: var(--pos); background: var(--pos-soft); }
.order-item.bad { border-color: var(--neg); background: var(--neg-soft); }
.order-n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.order-btns { display: flex; gap: 4px; }
.order-btns .icon-btn { width: 32px; height: 32px; font-size: .8rem; }
.order-btns .icon-btn:disabled { opacity: .3; }
.flip-grid { display: grid; gap: 12px; }
.flip-card { perspective: 900px; border: 0; padding: 0; background: none; min-height: 150px; cursor: pointer; font: inherit; color: var(--text); text-align: center; }
.flip-inner { position: relative; display: block; width: 100%; height: 100%; min-height: 150px; transition: transform .5s; transform-style: preserve-3d; }
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid var(--border); }
.flip-front { background: var(--surface); border-top: 5px solid var(--fc); }
.flip-back { background: var(--accent-soft); transform: rotateY(180deg); font-size: .88rem; line-height: 1.45; }
.flip-icon { font-size: 2rem; }
.match-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match-h { margin-bottom: 4px; font-weight: 700; }
.match-item { display: block; width: 100%; text-align: left; font: inherit; font-size: .92rem; padding: 10px 12px; margin: 6px 0; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.match-item.sel { border-color: var(--accent); background: var(--accent-soft); }
.match-item.done { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 14%, var(--surface)); cursor: default; }
.scene-s { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin: 8px 0 10px; }
.scene-icon { font-size: 2.2rem; line-height: 1; }
.canvas-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.canvas-quad { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; position: relative; }
.canvas-center { grid-column: 1 / -1; text-align: center; font-weight: 800; font-size: 1.1rem; padding: 6px; background: var(--accent-soft); border-radius: 10px; }
.canvas-field { display: flex; flex-direction: column; gap: 4px; border: 1.5px solid var(--border); border-left: 5px solid var(--fc); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.canvas-label { font-weight: 800; color: var(--fc); }
.canvas-field textarea { font: inherit; font-size: .92rem; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; background: var(--surface-2); color: var(--text); resize: vertical; }
.canvas-out { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); line-height: 1.7; }
.canvas-blank { color: var(--muted); font-style: italic; }
.cycle-svg { max-width: 440px; margin: 0 auto; }
.cycle-card { box-shadow: none; border-top: 5px solid var(--sc); }
.pipe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.pipe-step { display: flex; align-items: center; gap: 6px; font: inherit; font-size: .9rem; font-weight: 700; padding: 8px 12px; border-radius: 12px; border: 2px solid var(--sc); background: var(--surface); color: var(--text); cursor: pointer; }
.pipe-step.on { background: var(--sc); color: #fff; transform: scale(1.05); }
.pipe-step.past { background: color-mix(in srgb, var(--sc) 15%, var(--surface)); }
.pipe-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; background: color-mix(in srgb, var(--sc) 20%, transparent); }
.pipe-arrow { color: var(--muted); }
.tl-track { display: flex; gap: 6px; overflow-x: auto; padding: 6px 2px 10px; scroll-behavior: smooth; position: relative; }
.tl-dot { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font: inherit; border: 0; background: none; color: var(--muted); cursor: pointer; min-width: 64px; padding: 4px; }
.tl-mark { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border); background: var(--surface); font-size: 1.1rem; }
.tl-dot.past .tl-mark { border-color: var(--accent); }
.tl-dot.on .tl-mark { background: var(--accent); border-color: var(--accent); transform: scale(1.15); }
.tl-dot.on { color: var(--accent); font-weight: 800; }
.tl-year { font-size: .78rem; }
.tl-card { box-shadow: none; border-left: 5px solid var(--accent); }
.explore-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); align-content: start; }
.explore-card { display: flex; flex-direction: column; align-items: center; gap: 4px; font: inherit; font-size: .85rem; font-weight: 600; padding: 10px 6px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-align: center; }
.explore-card.on { border-color: var(--accent); background: var(--accent-soft); }
.explore-icon { font-size: 1.6rem; }
.tabset > .tabs { margin-bottom: 12px; }
.pyrun textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.5; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); resize: vertical; tab-size: 4; }
.py-out { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; white-space: pre-wrap; background: #10131f; color: #d8e1ff; border-radius: 10px; padding: 10px 12px; min-height: 48px; max-height: 360px; overflow: auto; margin-top: 8px; }
.py-out .err { color: #ff8b8b; }
.py-out img { max-width: 100%; background: #fff; border-radius: 6px; margin-top: 6px; }
.py-stdin { width: 100%; font-family: ui-monospace, monospace; font-size: .85rem; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
@media (max-width: 560px) { .match-cols { grid-template-columns: 1fr; } .canvas-quad { grid-template-columns: 1fr; } }
.opt.picked { border-color: var(--accent); background: var(--accent-soft); }
.opt.lens-pick { border-color: var(--lc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lc) 30%, transparent); }
.tab:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Class 10 Unit 3: evaluation ---------- */
.ae-row { display: grid; grid-template-columns: 70px minmax(120px, 1fr) repeat(5, 72px); gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.ae-head { border-bottom: 0; padding-bottom: 0; }
.ae-total { border-bottom: 0; font-size: 1rem; }
.ae-track { position: relative; height: 30px; }
.ae-track::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 3px; border-radius: 2px; background: var(--border); }
.ae-track input { position: absolute; inset: 0; width: 100%; height: 30px; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
.ae-track input::-webkit-slider-runnable-track { height: 30px; background: transparent; }
.ae-track input::-moz-range-track { background: transparent; }
.ae-track input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: 6px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.ae-track input::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.ae-actual { position: absolute; top: 2px; bottom: 2px; width: 4px; margin-left: -2px; background: var(--text); border-radius: 2px; }
.ae-gap { position: absolute; top: 8px; height: 14px; background: var(--neg-soft); border: 1.5px solid var(--neg); border-radius: 4px; }
@media (max-width: 700px) {
  .ae-row { grid-template-columns: 64px 1fr 64px 64px; }
  .ae-row > :nth-child(3), .ae-row > :nth-child(6) { display: none; }
}
.cm { display: grid; grid-template-columns: auto 1fr 1fr; gap: 6px; font-size: .88rem; }
.cm-h { display: grid; place-items: center; text-align: center; font-weight: 700; color: var(--muted); padding: 4px; }
.cm-cell { border: 2px solid var(--bc); background: color-mix(in srgb, var(--bc) 10%, var(--surface)); border-radius: 12px; padding: 8px; min-height: 74px; text-align: center; cursor: pointer; transition: transform .15s; }
.cm-cell:hover { transform: translateY(-1px); }
.cm-cell b { display: block; color: var(--bc); font-size: 1rem; }
.cm-cell .cm-n { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.cm-cell.flash-bad { animation: shake .4s; border-color: var(--neg); }
.day-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.day-card { font: inherit; font-size: .85rem; text-align: left; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.day-card.sel { border-color: var(--accent); background: var(--accent-soft); }
.day-card.done { opacity: .45; cursor: default; }
.day-card .lbl { color: var(--muted); font-size: .75rem; }
.mbar { display: grid; grid-template-columns: 82px 1fr 46px; gap: 8px; align-items: center; margin: 6px 0; font-size: .88rem; }
.mbar .bar span { transition: width .25s; }
.mformula { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); margin-top: -4px; }
/* keep text clear of the fullscreen button */
.viz > p:first-child, .viz > .tabs:first-child, .viz .two-col > div:last-child > :first-child { padding-right: 44px; }
.orw-preview { background: var(--surface-2); border-radius: 12px; padding: 14px; min-height: 200px; }
.orw-preview .calc th { font-size: .78rem; color: var(--muted); padding: 4px 6px; text-align: right; }
.stat-cards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-top: 12px; }
.stat-card { border: 1.5px solid var(--border); border-top: 4px solid var(--sc); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.stat-v { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--sc); }
.sl-sorted { grid-column: 1 / -1; }
.sl-sorted .chip { padding: 2px 9px; margin: 2px; }
.draggable { touch-action: none; }
select { font: inherit; font-size: .9rem; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }

/* ---------- Class 10 Unit 5: computer vision ---------- */
.cv-canvas { width: 100%; height: auto; border-radius: 12px; display: block; }
.px-canvas { width: 100%; max-width: 384px; height: auto; border-radius: 10px; display: block; margin: 0 auto; image-rendering: pixelated; cursor: crosshair; touch-action: none; }
.px-channels { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.px-channels figure { margin: 0; text-align: center; font-size: .8rem; color: var(--muted); }
.px-channels canvas { width: 96px; height: 96px; border-radius: 8px; image-rendering: pixelated; display: block; }
.px-mix { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; margin: 10px 0; }
.px-swatch { height: 96px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: .85rem; border: 1px solid var(--border); }
.px-mrow { display: grid !important; grid-template-columns: 46px 1fr 34px; align-items: center; gap: 6px; margin: 4px 0; }
.px-mrow input { width: 100%; }
.ft-patches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ft-tile { font: inherit; font-weight: 800; border: 2px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); padding: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ft-tile canvas { width: 72px; height: 72px; image-rendering: pixelated; border-radius: 6px; border: 1px solid var(--border); }
.ft-tile.sel { border-color: var(--accent); background: var(--accent-soft); }
.cvl-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.cvl-grid figure { margin: 0; text-align: center; }
.cvl-canvas { width: 100%; max-width: 256px; height: auto; image-rendering: pixelated; border-radius: 8px; border: 1px solid var(--border); touch-action: none; }
.cvl-kernel { display: grid; grid-template-columns: repeat(3, 58px); gap: 4px; }
.cvl-kernel input { width: 58px; font: inherit; font-size: .9rem; text-align: center; padding: 8px 2px; border-radius: 8px; border: 1.5px solid var(--accent); background: var(--accent-soft); color: var(--text); }
.cvl-math { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 10px; }
.cvl-3x3 { display: grid; grid-template-columns: repeat(3, 64px); gap: 3px; }
.cvl-cell { background: var(--surface-2); border-radius: 6px; padding: 3px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.cvl-cell small { display: block; font-weight: 400; color: var(--muted); }
@media (max-width: 700px) { .cvl-grid { grid-template-columns: 1fr 1fr; } .cvl-mid { grid-column: 1 / -1; order: 3; } }
.ss-pad { width: 100%; max-width: 280px; aspect-ratio: 1; height: auto; display: block; border-radius: 12px; border: 2px dashed var(--border); background: #fff; touch-action: none; cursor: crosshair; }
.ss-class { border-left: 5px solid var(--sc); padding: 6px 10px; margin: 6px 0; background: var(--surface-2); border-radius: 8px; }
.ss-thumbs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; min-height: 30px; }
.ss-thumbs img { width: 30px; height: 30px; border-radius: 4px; border: 1px solid var(--border); background: #fff; }
.ss-bins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.ss-bin { border: 2px solid var(--sc); border-top-width: 8px; border-radius: 6px 6px 14px 14px; min-height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 6px; font-size: .8rem; font-weight: 700; color: var(--sc); }
.ss-bin img { width: 44px; height: 44px; border-radius: 6px; background: #fff; animation: drop .5s ease-out; }
.ss-bin.hit { background: color-mix(in srgb, var(--sc) 14%, transparent); }
@keyframes drop { from { transform: translateY(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
[hidden] { display: none !important; }

/* ---------- Class 10 Unit 6: NLP ---------- */
.nls-track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0; }
.nls-st { font: inherit; font-size: .78rem; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-align: center; }
.nls-st span { font-size: 1.3rem; }
.nls-st em { font-style: normal; font-weight: 800; min-height: 1.2em; }
.nls-st.on { border-color: var(--accent); background: var(--accent-soft); }
.nls-st.ok em { color: var(--pos); } .nls-st.fail em { color: var(--neg); } .nls-st.fail { border-color: var(--neg); }
.nls-panel { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.nls-sent { margin: 6px 0; }
.nls-tok { display: inline-flex; flex-direction: column; align-items: center; padding: 4px 8px; margin: 3px; border-radius: 8px; border: 2px solid var(--pc); background: var(--surface); font-weight: 600; }
.nls-tok small { font-size: .65rem; font-weight: 700; color: var(--pc); }
.nls-ph { background: var(--accent-soft); border-radius: 6px; padding: 1px 4px; }
.nls-res { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border-left: 5px solid var(--muted); background: var(--surface); }
.nls-res.ok { border-color: var(--pos); } .nls-res.fail { border-color: var(--neg); background: var(--neg-soft); }
@media (max-width: 640px) { .nls-track { grid-template-columns: repeat(3, 1fr); } }
.cb-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cb-box { border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.cb-head { font-weight: 800; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.cb-log { height: 260px; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.cb-b { max-width: 85%; padding: 7px 11px; border-radius: 14px; font-size: .9rem; line-height: 1.4; }
.cb-b.bot { background: var(--surface); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.cb-b.me { background: var(--accent); color: var(--accent-text); align-self: flex-end; border-bottom-right-radius: 4px; }
.cb-sugg { margin: 10px 0 6px; }
.cb-sugg .chip { cursor: pointer; font: inherit; font-size: .85rem; color: var(--text); }
.cb-form { display: flex; gap: 8px; }
.cb-form input { flex: 1; font: inherit; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); min-width: 0; }
@media (max-width: 640px) { .cb-wrap { grid-template-columns: 1fr; } .cb-log { height: 200px; } }
.tp-in { width: 100%; font: inherit; font-size: .95rem; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); resize: vertical; margin: 4px 0 10px; }
.tp-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tp-step { font: inherit; font-size: .8rem; font-weight: 600; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.tp-step b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: .72rem; }
.tp-step.on { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }
.tp-step.on b { background: var(--accent-text); color: var(--accent); }
.tp-step.past b { background: var(--accent-soft); color: var(--accent); }
.tp-out { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.tp-sent { margin: 5px 0; line-height: 2.1; }
.tp-sent > b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: .75rem; margin-right: 4px; }
.tp-tok { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; padding: 3px 8px; margin: 2px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); font-size: .9rem; vertical-align: middle; }
.tp-tok small { font-size: .65rem; color: var(--muted); text-decoration: line-through; }
.tp-tok.gone { opacity: .45; text-decoration: line-through; border-style: dashed; color: var(--neg); }
.tp-tok.changed { border-color: var(--c3); background: var(--pos-soft); }
.bow-docs { display: grid; gap: 6px; }
.bow-doc { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: center; font-size: .85rem; font-weight: 700; color: var(--muted); }
.bow-doc input { font: inherit; font-size: .95rem; font-weight: 400; color: var(--text); padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
.bow-table { border-collapse: separate; border-spacing: 2px; font-size: .85rem; font-variant-numeric: tabular-nums; }
.bow-table th { font-weight: 700; padding: 4px 6px; white-space: nowrap; }
.bow-table th[data-w] { writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; height: 92px; }
.bow-table td { text-align: center; min-width: 40px; padding: 6px 4px; border-radius: 6px; }
.bow-table tr[data-r] { cursor: pointer; }
.bow-table tr.focus th { color: var(--accent); }
.bow-table .hl { outline: 2px solid var(--c2); }
.bow-meta td { color: var(--muted); font-size: .78rem; }
.sen-sugg .chip { cursor: pointer; font: inherit; font-size: .82rem; color: var(--text); }
.sen-words { margin: 4px 0 12px; line-height: 2.2; }
.sen-w { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; padding: 3px 8px; margin: 2px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); vertical-align: middle; }
.sen-w small { font-size: .66rem; font-weight: 700; }
.sen-w.pos { border-color: var(--pos); background: var(--pos-soft); }
.sen-w.negw { border-color: var(--neg); background: var(--neg-soft); }
.sen-w.neg, .sen-w.int { border-color: var(--warn); border-style: dashed; }
.sen-meter { max-width: 520px; }
.sen-scale { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }
.sen-bar { position: relative; height: 16px; border-radius: 99px; background: linear-gradient(90deg, var(--neg), var(--surface-2) 50%, var(--pos)); }
.sen-needle { position: absolute; top: -5px; width: 8px; height: 26px; margin-left: -4px; border-radius: 4px; background: var(--text); transition: left .35s; }
.sen-summary { display: flex; height: 30px; border-radius: 10px; overflow: hidden; color: #fff; font-weight: 700; font-size: .85rem; margin-bottom: 8px; }
.sen-summary div { display: grid; place-items: center; white-space: nowrap; overflow: hidden; }
.sen-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.sen-row b { white-space: nowrap; }
.viz > .bow-docs:first-child, .viz > .controls:first-child, .viz > label:first-child { padding-right: 44px; }
