/* CCS HUB — courses, exam bank and exam UI */

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.course-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.course-card:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--ink); }
.course-card.closed { opacity: 0.55; }
.course-card-head { display: flex; gap: 0.9rem; align-items: center; }
.course-card-head .arena-icon { color: var(--accent); }
.course-card-head code { font-size: 0.75rem; color: var(--accent); }
.course-card-head h2 { font-size: 1.05rem; margin: 0.1rem 0 0; font-weight: 600; }
.course-card p { font-size: 0.88rem; color: #51615a; margin: 0; flex-grow: 1; }
.course-card-foot { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* Courses page browser (assets/js/courses-browser.js) */
.cb-toolbar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; padding: .75rem .9rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: .5rem; }
.cb-search { position: relative; flex: 1 1 260px; min-width: 220px; display: flex; align-items: center; }
.cb-search .arena-icon { position: absolute; left: .7rem; color: #64748b; pointer-events: none; }
.cb-search input { padding-left: 2.1rem; padding-right: 2rem; border-radius: 10px; }
.cb-kbd { position: absolute; right: .55rem; font-size: .7rem; color: #64748b; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 4px; padding: 0 .3rem; }
.cb-filters, .cb-view { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.cb-filters .form-select, .cb-view .form-select { width: auto; min-width: 7.5rem; padding-right: 2.1rem; border-radius: 8px; }
.cb-chip { border: 1px solid var(--line); background: #f8fafc; color: var(--ink-soft); border-radius: 999px; padding: .2rem .7rem; font-size: .82rem; white-space: nowrap; }
.cb-chip.active { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.cb-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cb-toggle button { border: 0; background: #fff; padding: .15rem .55rem; font-size: 1rem; color: #64748b; line-height: 1.5; }
.cb-toggle button + button { border-left: 1px solid var(--line); }
.cb-toggle button.active { background: var(--accent); color: #fff; }
.cb-status-row { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin: .2rem .2rem .4rem; }
.cb-status-row .cb-actions { margin-left: auto; display: inline-flex; gap: .8rem; }
.cb .btn-link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.cb-jump { display: flex; gap: .35rem; overflow-x: auto; padding: .1rem .1rem .5rem; margin-bottom: .4rem; scrollbar-width: thin; }
.cb-jump a { flex: 0 0 auto; font-size: .78rem; padding: .2rem .65rem; border-radius: 999px; background: rgba(15, 122, 98, .08); color: var(--accent); white-space: nowrap; }
.cb-jump a:hover { background: rgba(15, 122, 98, .16); }
.cb-jump a span { font-weight: 700; margin-left: .15rem; }
.cb-recent { margin-bottom: 1rem; }
.cb-recent-head { margin: 0 .2rem .3rem; }
.cb-recent-list { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; }
.cb-recent-item { flex: 0 0 auto; max-width: 260px; display: flex; gap: .45rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .35rem .7rem; font-size: .82rem; }
.cb-recent-item:hover { border-color: var(--accent); }
.cb-recent-item code { color: var(--accent); font-size: .74rem; }
.cb-recent-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-group { margin-bottom: 1.1rem; }
.cb-group-head { display: flex; align-items: center; gap: .55rem; width: 100%; border: 0; background: none; padding: .35rem .2rem; margin-bottom: .45rem; text-align: left; color: var(--ink); border-bottom: 1px solid var(--line); }
.cb-group-head:hover .cb-group-label { color: var(--accent); }
.cb-caret { display: inline-block; transition: transform .15s ease; color: #64748b; transform: rotate(90deg); }
.cb-group.is-collapsed .cb-caret { transform: rotate(0deg); }
.cb-group-label { font-weight: 600; font-size: 1rem; }
.cb-group-count { font-size: .72rem; font-weight: 700; background: var(--paper-2); color: var(--ink-soft); border-radius: 999px; padding: .05rem .5rem; }
.cb-group.is-collapsed .cb-body { display: none; }
.cb-group.is-collapsed .cb-group-head { margin-bottom: 0; }
.cb-group.is-starred-group .cb-group-label { color: #b45309; }
.no-heads .cb-group-head { display: none; }
.cb .course-card { position: relative; cursor: pointer; }
.cb .course-card-link { color: inherit; }
.cb .course-card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.cb-star { position: absolute; top: .55rem; right: .65rem; border: 0; background: none; font-size: 1.2rem; line-height: 1; color: #cbd5e1; padding: .1rem; z-index: 1; }
.cb-star:hover, .course-card.is-starred .cb-star { color: #f59e0b; }
.cb .course-grid.is-list { grid-template-columns: 1fr; gap: .4rem; }
.cb .is-list .course-card { flex-direction: row; align-items: center; gap: 1rem; padding: .55rem 2.6rem .55rem .9rem; border-radius: 12px; box-shadow: none; }
.cb .is-list .course-card:hover { transform: none; }
.cb .is-list .course-card-head { flex: 1 1 auto; min-width: 0; gap: .7rem; }
.cb .is-list .course-card-head .icon-xl { font-size: 1.5rem; }
.cb .is-list .course-card-head > div { display: flex; align-items: baseline; gap: .6rem; min-width: 0; }
.cb .is-list .course-card-head code { flex: 0 0 auto; min-width: 5.5rem; font-size: .8rem; }
.cb .is-list .course-card-head h2 { font-size: .95rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb .is-list .course-card-desc, .cb .is-list .cb-hide-list { display: none; }
.cb .is-list .course-card-foot { flex: 0 0 auto; flex-wrap: nowrap; justify-content: flex-end; }
.cb .is-list .cb-star { top: 50%; transform: translateY(-50%); }
.cb .course-grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.cb .course-card { min-width: 0; }
@media (max-width: 767.98px) {
  .cb-view { width: 100%; }
  .cb .is-list .course-card { flex-direction: column; align-items: stretch; gap: .35rem; }
  .cb .is-list .course-card-head > div { flex-direction: column; align-items: flex-start; gap: 0; }
  .cb .is-list .course-card-head h2 { white-space: normal; }
  .cb .is-list .course-card-foot { flex-wrap: wrap; justify-content: flex-start; }
  .cb-status-row .cb-actions { margin-left: 0; }
}

.world-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.world-card { position: relative; }
.topic-list { padding-left: 0; list-style: none; margin: 0; }
.topic-list li { padding: 0.3rem 0; font-size: 0.9rem; border-bottom: 1px dashed var(--line); }
.topic-list li:last-child { border-bottom: 0; }

.assess-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  background: #fbfcfb;
}
.assess-row.boss {
  border-color: var(--accent);
  background: linear-gradient(90deg, rgba(15, 122, 98, 0.08), transparent);
}
.assess-row > div:first-child { min-width: 0; }
.assess-open-state .tag { white-space: normal; }
.assess-open { margin-top: 0.35rem; font-size: 0.85rem; }
.assess-open > summary { cursor: pointer; color: var(--accent); font-weight: 600; width: max-content; }
.assess-open form { margin-top: 0.4rem; padding: 0.5rem 0.65rem; border: 1px dashed var(--line); border-radius: 10px; }
.assess-open .form-check { margin-bottom: 0.15rem; }

.switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  background: #eceff0;
  color: #66756f;
  border-radius: 999px;
  padding: 0.2rem 0.7rem 0.2rem 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.switch-btn span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.switch-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.row-muted td { opacity: 0.55; }
.btn-ghost.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }

.mini-course-list { display: grid; gap: 0.5rem; }
.mini-course {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
}
.mini-course:hover { border-color: var(--accent); color: var(--ink); }
.mini-course .arena-icon { color: var(--accent); }
.mini-course strong { display: block; font-size: 0.92rem; }
.mini-course small { color: #66756f; }

/* Google Forms–style cards */
.gform { max-width: 820px; margin: 0 auto; }
.gform-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
  box-shadow: 0 6px 18px rgba(15, 28, 36, 0.05);
}
.gform-head { border-top: 8px solid var(--accent); }
.gform-title { font-weight: 600; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; padding-left: 0; }
.gform-title:focus { box-shadow: none; border-bottom-color: var(--accent); }

.q-opts { list-style: none; padding: 0; margin: 0; }
.q-opts li { padding: 0.2rem 0 0.2rem 1.4rem; position: relative; font-size: 0.9rem; }
.q-opts li::before { content: "○"; position: absolute; left: 0.2rem; color: #9aa7a1; }
.q-opts li.correct { color: var(--ok); font-weight: 600; }
.q-opts li.correct::before { content: "●"; color: var(--ok); }

.pick-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font-size: 0.9rem;
}
.pick-row:hover { background: #f6faf8; }
.pick-row input { margin-top: 0.2rem; flex-shrink: 0; }

/* Assessment builder steps, student picker and copy-to-sections */
.asm-steps { display: flex; flex-wrap: wrap; gap: 0.5rem; max-width: 820px; margin: 0 auto 1rem; }
.asm-steps > a, .asm-steps > span {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  font-size: 0.88rem;
}
.asm-steps > a:hover { border-color: var(--accent); }
.asm-steps .num {
  width: 1.6rem;
  height: 1.6rem;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #e6efe9;
  font-weight: 700;
  font-size: 0.8rem;
}
.asm-steps .active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
.asm-steps .active .num, .asm-steps .done .num { background: var(--accent); color: #fff; }
.asm-steps .disabled { opacity: 0.55; }
.reuse-card summary { cursor: pointer; }
.stu-list { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.stu-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #eef2ef;
  cursor: pointer;
  font-size: 0.88rem;
}
.stu-row:hover { background: #f6faf8; }
.stu-row input { flex-shrink: 0; margin-top: 0; }
.copy-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.5rem; }
.copy-class {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
}
.copy-class:has(input:checked) { border-color: var(--accent); background: #f0faf6; }
.copy-class input { flex-shrink: 0; margin-top: 0.15rem; }

/* Exam taking */
.exam-wrap { padding-bottom: 1rem; }
.exam-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
}
.exam-bar .text-secondary { color: #b6c4bd !important; }
.exam-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}
.exam-timer.danger { background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.7; } }

.exam-q { border-left: 4px solid transparent; transition: border-color 0.2s; }
.exam-q.answered { border-left-color: var(--accent); }
.exam-q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.exam-q-text { font-size: 1rem; margin-bottom: 0.8rem; }

/* Anti-cheat */
.ac-rules { border-left: 4px solid var(--warn); }
.ac-rules ul { padding-left: 1.1rem; }
.ac-nocopy, .ac-nocopy * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ac-nocopy input, .ac-nocopy textarea { -webkit-user-select: text; user-select: text; }
.ac-away #exam-form, .ac-blocked #exam-form { filter: blur(14px); pointer-events: none; }
.ac-blocked #exam-form { visibility: hidden; }
.ac-shot #exam-form, .code-lab.ac-shot { visibility: hidden !important; }
.code-lab.ac-away, .code-lab.ac-blocked, .lab-scope.ac-away, .lab-scope.ac-blocked { filter: blur(14px); pointer-events: none; }
.code-lab.ac-blocked, .lab-scope.ac-blocked { visibility: hidden; }
.code-exam-banner .exam-back { white-space: nowrap; font-size: 0.95rem; padding: 0.55rem 1.1rem; }
.exam-q:target { box-shadow: 0 0 0 3px var(--accent, #1f8f6a); scroll-margin-top: 90px; }
.ac-watermark {
  position: fixed;
  inset: -20vh -20vw;
  z-index: 1040;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 5rem 4rem;
  padding: 2rem;
  transform: rotate(-24deg);
  pointer-events: none;
  overflow: hidden;
  opacity: 0.07;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  color: #000;
}
.ac-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(11, 21, 18, 0.82);
  backdrop-filter: blur(6px);
}
.ac-overlay-card {
  max-width: 440px;
  padding: 1.6rem;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.ac-overlay-icon { color: var(--warn); margin-bottom: 0.4rem; }
.ac-overlay.cheat { background: rgba(70, 10, 16, 0.85); }
.ac-overlay.cheat .ac-overlay-card { border-top: 6px solid var(--danger); }
.ac-overlay.cheat .ac-overlay-icon, .ac-overlay.cheat .ac-overlay-icon *, .ac-overlay.cheat #ac-title { color: var(--danger) !important; }
.ac-overlay.cheat #ac-count { color: var(--danger) !important; font-weight: 600; }
.ac-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(161, 38, 47, 0.3);
  border-radius: 12px;
  background: #fbeeee;
  color: var(--danger);
  font-size: 0.88rem;
}
.ac-notice .icon-sm { flex-shrink: 0; margin-top: 0.15rem; }
.ac-overlay-icon .icon { width: 2.4rem; height: 2.4rem; }
/* Exam integrity */
.exam-sub { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.15rem; font-size: 0.78rem; }
.exam-sub .exam-code { font-family: var(--mono); letter-spacing: 0.04em; color: #fff; }
.save-state::before { content: "●"; margin-right: 0.3rem; color: #4fd18b; }
.exam-net, .exam-idle {
  position: sticky;
  top: 4.2rem;
  z-index: 19;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
}
.exam-net { background: #fdf0d8; border: 1px solid #e6b85c; color: #7a4b00; }
.exam-idle { background: #e7f0fb; border: 1px solid #8fb2e0; color: #1d4479; }
.q-ref { font-family: var(--mono); font-size: 0.72rem; color: #8a9a93; letter-spacing: 0.03em; margin-right: 0.35rem; }
.tag.info { background: #e4eefb; color: #24548f; }
.risk-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.risk-1 .score-dial, .risk-badge.risk-1 { background: #e3f3e8; color: #1f7a45; }
.risk-2 .score-dial, .risk-badge.risk-2 { background: #eef5d6; color: #5d7413; }
.risk-3 .score-dial, .risk-badge.risk-3 { background: #fdf0d2; color: #8a5a00; }
.risk-4 .score-dial, .risk-badge.risk-4 { background: #fbe1d3; color: #a2401a; }
.risk-5 .score-dial, .risk-badge.risk-5 { background: #f7d4d8; color: #9b1c2c; }
.integrity-score { border-left: 6px solid currentColor; }
.integrity-score.risk-1 { border-left-color: #1f7a45; }
.integrity-score.risk-2 { border-left-color: #8aa61f; }
.integrity-score.risk-3 { border-left-color: #d79a1c; }
.integrity-score.risk-4 { border-left-color: #d0602d; }
.integrity-score.risk-5 { border-left-color: #b3263a; }
.score-dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  flex-shrink: 0;
}
.score-dial strong { font-size: 2.2rem; line-height: 1; }
.score-dial span { font-size: 0.8rem; opacity: 0.8; }
.stat-card small { display: block; color: #7b8a84; font-size: 0.72rem; margin-top: 0.15rem; }
.q-time-bar { height: 4px; border-radius: 4px; background: #e6ece9; margin-top: 0.25rem; max-width: 120px; overflow: hidden; }
.q-time-bar span { display: block; height: 100%; background: var(--accent, #1f8f6a); }
.ac-always { padding: 0.6rem 0.8rem; border-radius: 10px; background: #f1f6f4; color: #4b5d56; line-height: 1.45; }
.integrity-weights input { max-width: 90px; }
.ac-list-info { max-width: 260px; line-height: 1.35; }
.ac-list-info .tag { display: inline-flex; align-items: center; gap: 0.25rem; }
.ac-switches { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0.6rem 1.5rem; }
.ac-switches .form-text { margin-top: 0; margin-left: 1.6rem; }
@media print { .ac-noprint { display: none !important; } }

.choice {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 0.45rem;
  cursor: pointer;
}
.choice:hover { background: #f6faf8; }
.choice:has(input:checked) { border-color: var(--accent); background: rgba(15, 122, 98, 0.07); }
.choice input { margin-top: 0.25rem; accent-color: var(--accent); }

.blank-input {
  border: 0;
  border-bottom: 2px solid var(--accent);
  min-width: 140px;
  padding: 0 0.3rem;
  font-weight: 600;
  background: rgba(15, 122, 98, 0.05);
}
.blank-input:focus { outline: none; background: rgba(15, 122, 98, 0.12); }

.match-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 0.5rem 0.75rem;
  align-items: center;
}
.match-grid .order-pos { max-width: 90px; }
.match-left { font-size: 0.92rem; font-weight: 500; }

.exam-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
}
.exam-facts div {
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: var(--paper);
}
.exam-facts span { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: #66756f; }
.exam-facts strong { font-size: 1.05rem; }

.result-head.pass { border-top-color: var(--ok); }
.result-head.fail { border-top-color: var(--warn); }
.result-head.pending { border-top-color: #c9a227; }

.review-q { border-left: 5px solid var(--line); }
.review-q.right { border-left-color: var(--ok); }
.review-q.partial { border-left-color: #c9a227; }
.review-q.wrong { border-left-color: var(--danger); }
.review-q.pending { border-left-color: #7b8b84; }
.answer-box {
  white-space: normal;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: var(--paper);
  font-size: 0.92rem;
}
.feedback { padding: 0.5rem 0.7rem; border-radius: 8px; background: #eef7f3; }

.scenario-card { border-left: 5px solid var(--warn, #d9a441); }
.scenario-body {
  white-space: normal;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.5;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: var(--paper);
  overflow-x: auto;
}
.scenario-img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  margin-top: 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
}
.lab-item {
  padding: 0.8rem 0.9rem;
  border-radius: 10px;
  border: 1px dashed rgba(0, 0, 0, 0.18);
  background: var(--paper);
}
.lab-item.done { border-style: solid; border-color: var(--ok, #2f9e6b); }
.term {
  border-radius: 10px;
  overflow: hidden;
  background: #0d1117;
  color: #c9d1d9;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  cursor: text;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 0.75rem;
  background: #1f2630;
}
.term-bar span { width: 11px; height: 11px; border-radius: 50%; background: #ff5f56; }
.term-bar span:nth-child(2) { background: #ffbd2e; }
.term-bar span:nth-child(3) { background: #27c93f; }
.term-bar em { margin-left: 0.5rem; font-style: normal; font-size: 0.78rem; color: #8b949e; }
.term-body { padding: 0.8rem 0.9rem 1rem; }
.term-out { white-space: pre-wrap; color: #8b949e; margin: 0.15rem 0 0.5rem; }
.term-task { color: #6a9955; margin-top: 0.45rem; }
.term-line { display: flex; align-items: baseline; gap: 0.5rem; margin: 0.1rem 0; width: 100%; }
.term-prompt { color: #3fb950; white-space: nowrap; font-weight: 600; }
.term-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed #30363d;
  color: #f0f6fc;
  font: inherit;
  caret-color: #3fb950;
  outline: none;
  padding: 0.1rem 0;
}
.term-input:focus { border-bottom-color: #3fb950; }
.term-cmd { color: #f0f6fc; flex: 1; }
.term-cmd i { color: #8b949e; }
.term-mark.ok { color: #3fb950; }
.term-mark.bad { color: #f85149; }
.term-hint { color: #d29922; font-size: 0.82rem; margin-bottom: 0.3rem; }
.term-review { margin: 0.5rem 0; cursor: default; }
.term-step-edit {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 0.6rem;
  margin-bottom: 0.6rem;
  background: var(--paper);
}
.lab-item-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; flex-wrap: wrap; }

/* Cyber Lab certification-style simulation (cert_sim) */
.cert-sim .cert-scenario { font-size: 0.9rem; background: #fff8e6; border: 1px solid #f1d58a; border-radius: 10px; padding: 0.6rem 0.75rem; }
.cert-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
.cert-tabs button { border: 1px solid var(--line, #d6dbe1); background: #fff; border-radius: 8px; padding: 0.25rem 0.65rem; font-size: 0.8rem; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.cert-tabs button.active { background: #0d1117; color: #3fb950; border-color: #0d1117; }
.cert-pre { margin: 0; height: 360px; }
.cert-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.cert-table th, .cert-table td { border: 1px solid #d5dee8; padding: 0.3rem 0.45rem; vertical-align: top; }
.cert-table th { background: #eef3f8; position: sticky; top: 0; }
.cert-table tbody tr:nth-child(even) { background: #f8fafc; }
.cert-text { font-size: 0.88rem; white-space: normal; background: #fff; border: 1px solid #e3e8ee; border-radius: 10px; padding: 0.75rem; max-height: 380px; overflow: auto; }
.cert-q { border: 1px solid var(--line, #d6dbe1); border-radius: 12px; padding: 0.65rem 0.75rem; margin-bottom: 0.6rem; }
.cert-q.wrong { border-color: #e5484d; box-shadow: 0 0 0 2px rgba(229, 72, 77, 0.15); }
.cert-q-text { font-size: 0.9rem; margin-bottom: 0.45rem; }
.cert-q-no { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #0d1117; color: #3fb950; font-size: 0.75rem; font-weight: 700; margin-right: 0.3rem; }
.cert-q .choice-grid label { padding: 0.5rem 0.7rem; font-size: 0.86rem; }

/* Network Admin Simulation (Packet Tracer style) */
.netsim { border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 12px; padding: 0.75rem; background: var(--paper); }
.netsim-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0.75rem; align-items: start; }
@media (max-width: 860px) { .netsim-top { grid-template-columns: 1fr; } }
.netsim-topo { background: #eef3f8; border: 1px solid #d5dee8; border-radius: 10px; min-height: 180px; }
.netsim-topo svg { display: block; width: 100%; height: auto; }
.ns-link { stroke: #222; stroke-width: 2.5; }
.ns-link.serial { stroke: #c0392b; stroke-dasharray: 10 5; }
.ns-light { stroke: #fff; stroke-width: 1.5; }
.ns-light.up { fill: #2ecc40; }
.ns-light.half { fill: #ff9f1a; }
.ns-light.down { fill: #e74c3c; }
.ns-port { font: 600 15px ui-monospace, Consolas, monospace; fill: #37474f; text-anchor: middle; }
.ns-name { font: 700 17px system-ui, sans-serif; fill: #1b2733; text-anchor: middle; }
.ns-dev.router { fill: #1f6fb2; stroke: #0f4c81; stroke-width: 2; }
.ns-dev.switch { fill: #2a8fbd; stroke: #136a91; stroke-width: 2; }
.ns-dev.pc { fill: #d9dee4; stroke: #4b5563; stroke-width: 2; }
.ns-screen { fill: #4aa3df; }
.ns-glyph { stroke: #fff; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ns-dev.pc + .ns-glyph, .ns-dev.pc ~ .ns-glyph { stroke: #4b5563; }
.ns-node { cursor: pointer; outline: none; }
.ns-node:hover .ns-dev, .ns-node:focus .ns-dev { filter: brightness(1.12); }
.ns-node.sel .ns-dev { stroke: #f59e0b; stroke-width: 4; }
.netsim-tasks { font-size: 0.88rem; background: #fff; border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 10px; padding: 0.6rem 0.75rem; max-height: 300px; overflow: auto; }
.netsim-tasks ol { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.netsim-tasks li { margin-bottom: 0.2rem; }
.netsim-table { width: 100%; margin: 0.75rem 0 0.25rem; font-size: 0.82rem; border-collapse: collapse; background: #fff; }
.netsim-table th, .netsim-table td { border: 1px solid #d5dee8; padding: 0.3rem 0.5rem; font-family: ui-monospace, Consolas, monospace; }
.netsim-table th { background: #eef3f8; font-family: inherit; }
.netsim-devtabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0 0.5rem; }
.netsim-devtabs button { border: 1px solid #c9d3de; background: #fff; border-radius: 8px; padding: 0.3rem 0.65rem; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.netsim-devtabs button small { font-size: 0.7rem; color: #6b7280; }
.netsim-devtabs button.active { border-color: #1f6fb2; box-shadow: 0 0 0 2px rgba(31, 111, 178, 0.25); }
.ns-cli, .ns-pc { border-radius: 10px; overflow: hidden; border: 1px solid #1f2630; }
.ns-cli-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.7rem; background: #1f2630; color: #e6edf3; font-size: 0.85rem; flex-wrap: wrap; }
.ns-cli-head span { color: #8b949e; }
.ns-cli-tab { margin-left: auto; background: #0d1117; color: #3fb950 !important; padding: 0.05rem 0.5rem; border-radius: 5px; font-weight: 600; }
.ns-cli-out { margin: 0; height: 280px; overflow: auto; background: #0d1117; color: #c9d1d9; padding: 0.6rem 0.75rem; font: 0.84rem/1.35 ui-monospace, Consolas, monospace; white-space: pre-wrap; }
.ns-cli-line { display: flex; gap: 0.4rem; align-items: baseline; background: #0d1117; padding: 0 0.75rem 0.6rem; font: 0.84rem ui-monospace, Consolas, monospace; }
.ns-cli-prompt { color: #3fb950; font-weight: 600; white-space: nowrap; }
.ns-cli-in { flex: 1; min-width: 0; background: transparent; border: 0; border-bottom: 1px dashed #30363d; color: #f0f6fc; font: inherit; outline: none; caret-color: #3fb950; }
.ns-pc { background: #fff; border-color: #c9d3de; }
.ns-pc .ns-cli-head { background: #e9eef4; color: #1b2733; }
.ns-pc-tabs { margin-left: auto; display: flex; gap: 0.3rem; }
.ns-pc-tabs button { border: 1px solid #c9d3de; background: #fff; border-radius: 6px; font-size: 0.78rem; padding: 0.15rem 0.5rem; }
.ns-pc-tabs button.active { background: #1f6fb2; border-color: #1f6fb2; color: #fff; }
.ns-pc-body[data-body="ip"] { padding: 0.75rem; }
.ns-pc-mode { display: flex; gap: 1rem; margin-bottom: 0.6rem; font-size: 0.9rem; }
.ns-pc-grid { display: grid; grid-template-columns: max-content minmax(0, 260px); gap: 0.4rem 0.75rem; align-items: center; font-size: 0.88rem; }
.ns-pc-grid input { border: 1px solid #c9d3de; border-radius: 6px; padding: 0.25rem 0.5rem; font-family: ui-monospace, Consolas, monospace; }
.ns-pc-grid input[readonly] { background: #f3f4f6; color: #6b7280; }
.ns-pc-status { margin-top: 0.5rem; }
.netsim-review details { margin-top: 0.4rem; }
.netsim-review summary { cursor: pointer; font-size: 0.88rem; font-weight: 600; }
.netsim-checks { list-style: none; padding: 0; margin: 0.25rem 0 0.5rem; font-size: 0.88rem; }
.netsim-checks li { padding: 0.15rem 0; }
.netsim-cfg { background: #0d1117; color: #c9d1d9; border-radius: 8px; padding: 0.5rem 0.65rem; font-size: 0.78rem; max-height: 320px; overflow: auto; white-space: pre-wrap; }

/* Code questions: Arrange / Complete the Code and their review */
.arrange-list {
  list-style: none;
  counter-reset: arr;
  padding: 0;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #0d1117;
}
.arrange-line {
  counter-increment: arr;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.4rem 0.2rem 0.6rem;
  border-bottom: 1px solid #21262d;
  transition: background 0.2s;
}
.arrange-line::before { content: counter(arr); width: 1.6rem; color: #6e7681; font: 0.78rem ui-monospace, Consolas, monospace; text-align: right; }
.arrange-line.moved { background: #1f2a37; }
.arrange-line code {
  flex: 1;
  min-width: 0;
  white-space: pre;
  overflow-x: auto;
  color: #e6edf3;
  background: none;
  font-size: 0.88rem;
}
.arrange-btns { display: flex; gap: 2px; }
.arrange-btns button {
  border: 0;
  border-radius: 6px;
  width: 1.9rem;
  height: 1.6rem;
  background: #21262d;
  color: #c9d1d9;
  font-size: 0.7rem;
  cursor: pointer;
}
.arrange-btns button:hover:not(:disabled) { background: #30363d; color: #fff; }
.code-complete, .code-review {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border-radius: 10px;
  background: #0d1117;
  color: #e6edf3;
  font: 0.88rem/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre;
  overflow-x: auto;
}
.code-blank-input {
  background: #161b22;
  border: 0;
  border-bottom: 2px solid #d29922;
  border-radius: 4px 4px 0 0;
  color: #f0f6fc;
  font: inherit;
  padding: 0 0.25rem;
  outline: none;
  caret-color: #3fb950;
}
.code-blank-input:focus { border-bottom-color: #3fb950; background: #1f2630; }
.code-line { display: inline-block; min-width: 100%; padding-left: 0.4rem; border-left: 3px solid transparent; }
.code-line.ok { border-left-color: #3fb950; }
.code-line.bad { border-left-color: #f85149; background: rgba(248, 81, 73, 0.12); }
.code-blank { padding: 0 0.2rem; border-radius: 4px; }
.code-blank.ok { background: rgba(63, 185, 80, 0.22); color: #7ee787; }
.code-blank.bad { background: rgba(248, 81, 73, 0.2); color: #ffa198; text-decoration: line-through; }
.code-exam-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.75rem;
  border-radius: 10px;
  border: 1px solid #c9a227;
  background: #fff8e1;
  color: #4a3b00;
}

/* Math: KaTeX equations, graphs, editor toolbar */
.katex { font-size: 1.12em; }
.katex-display { margin: .6rem 0; overflow-x: auto; overflow-y: hidden; padding: .2rem 0; }
.choice .katex-display { margin: 0; }
sup { font-size: .72em; }
.math-graph { margin: .75rem 0; max-width: 600px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; padding: .35rem; }
.math-graph svg { display: block; width: 100%; height: auto; }
.math-graph-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; padding: .25rem .5rem .1rem; font-size: .85rem; color: #0f172a; }
.math-graph-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: .4rem; vertical-align: middle; }
.math-graph-error { display: inline-block; padding: .2rem .5rem; border-radius: 6px; background: #fef2f2; color: #b91c1c; font-size: .85rem; }
.math-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-bottom: .3rem; }
.math-toolbar-label { font-size: .78rem; color: #64748b; margin-right: .15rem; }
.math-btn { border: 1px solid #cbd5e1; background: #f8fafc; color: #0f172a; border-radius: 6px; padding: .1rem .5rem; font-size: .82rem; line-height: 1.5; }
.math-btn:hover { background: #e0f2fe; border-color: #7dd3fc; }
.math-help-btn { font-weight: 700; }
.math-tips { font-size: .8rem; color: #334155; background: #f1f5f9; border-radius: 8px; padding: .5rem .65rem; margin-bottom: .35rem; line-height: 1.7; }
.math-tips code { font-size: .78rem; }
.math-preview { margin-top: .4rem; border: 1px dashed #94a3b8; border-radius: 8px; padding: .5rem .7rem; background: #fff; }
.math-preview-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin-bottom: .25rem; }
.math-sym-btn { background: #eef2ff; border-color: #a5b4fc; font-weight: 600; }

/* Symbol palette (assets/js/symbol-palette.js) */
.sym-open-btn { border: 1px solid #cbd5e1; background: #f8fafc; color: #334155; border-radius: 6px; font-size: .8rem; line-height: 1.4; padding: .05rem .45rem; margin-top: .25rem; }
.sym-open-btn:hover { background: #e0f2fe; border-color: #7dd3fc; }
.sym-open-btn.is-inline { margin: 0 .2rem; vertical-align: middle; }
.sym-open-btn:disabled { opacity: .4; }
.sym-palette { position: absolute; z-index: 2000; background: #fff; color: #0f172a; border: 1px solid #cbd5e1; border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .22); display: flex; flex-direction: column; max-height: 400px; overflow: hidden; font-size: .9rem; }
.sym-palette[hidden] { display: none; }
.sym-head, .sym-tabs, .sym-foot { flex-shrink: 0; }
.sym-head { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem; border-bottom: 1px solid #e2e8f0; }
.sym-search { flex: 1; min-width: 0; border: 1px solid #cbd5e1; border-radius: 8px; padding: .25rem .5rem; font-size: .85rem; }
.sym-close { border: 0; background: transparent; font-size: 1.3rem; line-height: 1; color: #64748b; padding: 0 .25rem; }
.sym-tabs { display: flex; gap: .25rem; overflow-x: auto; padding: .4rem .6rem; border-bottom: 1px solid #e2e8f0; scrollbar-width: thin; }
.sym-tab { flex: 0 0 auto; border: 1px solid #e2e8f0; background: #f8fafc; color: #334155; border-radius: 999px; padding: .1rem .6rem; font-size: .78rem; white-space: nowrap; }
.sym-tab.active { background: #1e40af; border-color: #1e40af; color: #fff; }
.sym-grid { overflow-y: auto; padding: .35rem .6rem .5rem; flex: 1; min-height: 120px; }
.sym-sub { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin: .45rem 0 .2rem; }
.sym-row { display: flex; flex-wrap: wrap; gap: .25rem; }
.sym-item { min-width: 2.1rem; height: 2.1rem; border: 1px solid #e2e8f0; background: #fff; color: #0f172a; border-radius: 6px; font-size: 1.15rem; line-height: 1; padding: 0 .35rem; font-family: "Cambria Math", "STIX Two Math", "Segoe UI Symbol", "Times New Roman", serif; }
.sym-item .sym-base { color: #94a3b8; }
.sym-item:hover, .sym-item:focus-visible { background: #e0f2fe; border-color: #38bdf8; }
.sym-item.is-wide { font-size: .82rem; font-family: inherit; }
.sym-item.is-tex { background: #f5f3ff; border-color: #ddd6fe; }
.sym-item.is-el { position: relative; min-width: 2.3rem; font-family: inherit; font-size: .9rem; font-weight: 600; padding-top: .45rem; }
.sym-item.is-el small { position: absolute; top: 1px; left: 3px; font-size: .55rem; font-weight: 400; color: #64748b; }
.sym-item.is-circuit { height: auto; width: 5.4rem; display: inline-flex; flex-direction: column; align-items: center; gap: .1rem; padding: .25rem; font-family: inherit; }
.sym-item.is-circuit span { font-size: .62rem; line-height: 1.15; color: #475569; white-space: normal; }
.sym-empty { color: #64748b; font-size: .85rem; margin: .75rem 0; }
.sym-foot { border-top: 1px solid #e2e8f0; padding: .35rem .6rem; font-size: .74rem; color: #475569; min-height: 1.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sym-foot code { font-size: .72rem; }
.circuit-sym { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 .2rem; color: inherit; }
.circuit-sym svg { width: 3.6em; height: auto; overflow: visible; }
.circuit-sym-label { font-size: .75em; line-height: 1.1; }

.scenario-body { white-space: normal; line-height: 1.6; }
body[data-math-auto] .scenario-body { font-family: inherit; font-size: 0.98rem; }

@media (max-width: 640px) {
  .match-grid { grid-template-columns: 1fr; }
  .exam-bar { flex-direction: column; align-items: flex-start; }
}
