/* ==========================================================================
   Everest Test Platform — homework workspace, student panel, focus timer, word games
   ========================================================================== */

/* ---------- Teacher: groups and workspace ---------- */
.group-tabs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 12px; margin-bottom: 14px; scrollbar-width: thin; }
.group-tab {
  flex: none; display: grid; gap: 3px; min-width: 180px; padding: 12px 14px; text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.group-tab:hover { border-color: var(--primary-100); transform: translateY(-1px); }
.group-tab.active { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px rgba(37, 88, 230, .1); }
.group-tab-name { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.group-tab-meta { font-size: .78rem; color: var(--muted); }
.group-tab .badge { justify-self: start; margin-top: 2px; }
.ws-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.ws-head h2 { margin: 0 0 2px; font-size: 1.45rem; }
.ws-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ws-hint { display: flex; gap: 8px; align-items: center; margin: 0; padding: 10px 22px; font-size: .82rem; color: var(--text-2); background: var(--primary-50); border-bottom: 1px solid var(--border); }
.ws-hint svg { width: 16px; height: 16px; color: var(--primary); }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: var(--primary-50); }
tr.row-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
tr.row-link td:last-child svg { color: var(--muted); width: 16px; height: 16px; transition: transform .2s; }
tr.row-link:hover td:last-child svg { transform: translateX(3px); color: var(--primary); }
.link-name { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); font-weight: 650; cursor: pointer; text-align: left; }
.link-name:hover { text-decoration: underline; }
button.cell-user.link-name { color: var(--text); }
button.cell-user.link-name small { color: var(--primary); }
.locked-group { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--primary-50); border: 1px solid var(--primary-100); margin-top: 6px; }
.locked-group svg { width: 18px; height: 18px; color: var(--primary); }

/* ---------- Student homework panel (drawer) ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 95; background: rgba(12, 22, 54, .38); backdrop-filter: blur(3px); animation: fadeIn2 .2s; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--bg); box-shadow: -20px 0 60px -20px rgba(12, 22, 54, .45);
  display: flex; flex-direction: column; animation: drawerIn .32s cubic-bezier(.16, 1, .3, 1);
}
.drawer-backdrop.closing { opacity: 0; transition: opacity .2s; }
.drawer-backdrop.closing .drawer { transform: translateX(40px); transition: transform .2s; }
@keyframes drawerIn { from { transform: translateX(60px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 14px; padding: 20px 22px; background: var(--surface); border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 1.25rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 40px; }
.sp-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.sp-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; }
.sp-tile span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.sp-tile b { font-size: 1.25rem; font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.sp-tile small { font-size: .72rem; color: var(--muted); }
.sp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sp-item { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; }
.sp-graded { border-left-color: var(--success); }
.sp-submitted { border-left-color: var(--warning); }
.sp-revision, .sp-missing { border-left-color: var(--danger); }
.sp-todo { border-left-color: var(--primary-100); }
.sp-item-head { display: flex; align-items: center; gap: 10px; }
.sp-item-head .icon-tile { width: 34px; height: 34px; border-radius: 10px; }
.sp-item-head .icon-tile svg { width: 17px; height: 17px; }
.sp-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; font-size: .86rem; }
.sp-label { font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.sp-preview { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-family: var(--font-serif); font-size: .88rem; color: var(--text-2); }
.sp-mark { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sp-mark b { font-size: 1.15rem; font-family: var(--font-display); }
.sp-mark span { font-size: .8rem; color: var(--muted); }
.sp-crit { font-size: .8rem; color: var(--text-2); margin-top: 2px; }
.sp-feedback { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--primary-100); background: var(--primary-50); border-radius: 0 8px 8px 0; font-size: .86rem; white-space: pre-wrap; }
.sp-extra { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: .8rem; color: var(--text-2); }
.sp-extra span { display: inline-flex; gap: 5px; align-items: center; }
.sp-extra svg { width: 14px; height: 14px; color: var(--primary); }
.sp-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Focus timer (Pomodoro) ---------- */
.pomo-fab {
  position: fixed; left: 20px; bottom: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px 0 10px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 30px -10px rgba(19, 33, 63, .4); transition: transform .2s, box-shadow .2s;
}
.pomo-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -12px rgba(19, 33, 63, .45); }
.pomo-fab svg { width: 28px; height: 28px; }
.pomo-fab span { font-variant-numeric: tabular-nums; font-size: .95rem; }
.pomo-fab.running { background: #fff3f1; border-color: #ffd2cc; color: #b9382b; }
.pomo-fab.running.break { background: var(--success-50); border-color: #bfeedd; color: var(--success); }
.pomo-fab.running svg { animation: pomoPulse 2s ease-in-out infinite; }
@keyframes pomoPulse { 50% { transform: scale(1.08); } }
.pomo-panel {
  position: fixed; left: 20px; bottom: 80px; z-index: 61; width: min(330px, calc(100vw - 32px)); padding: 16px; display: grid; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 30px 60px -24px rgba(19, 33, 63, .45); animation: pop .2s var(--ease);
}
.pomo-head { display: flex; align-items: center; gap: 8px; }
.pomo-tomato svg { width: 24px; height: 24px; display: block; }
.pomo-head .is-off { opacity: .4; }
.pomo-modes button { font-size: .78rem; padding: 6px 8px; flex: 1; }
.seg-full { display: flex; width: 100%; }
.pomo-clock { position: relative; display: grid; place-items: center; margin: 4px auto 0; width: 190px; height: 190px; --pc: #ef5a4c; }
.pomo-clock.pomo-short, .pomo-clock.pomo-long { --pc: var(--success); }
.pomo-clock .pomo-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.pomo-ring circle { fill: none; stroke-width: 7; }
.pomo-ring .track { stroke: var(--surface-3); }
.pomo-ring .bar { stroke: var(--pc); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.pomo-clock > div { position: relative; text-align: center; }
.pomo-clock strong { display: block; font-family: var(--font-display); font-size: 2.6rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1; }
.pomo-clock span { font-size: .78rem; color: var(--muted); }
.pomo-dots { display: flex; justify-content: center; gap: 8px; }
.pomo-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.pomo-dots i.on { background: #ef5a4c; }
.pomo-actions { display: flex; gap: 8px; align-items: center; justify-content: center; }
.pomo-actions .btn-lg { flex: 1; }
.pomo-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border); font-size: .78rem; color: var(--text-2); }
.pomo-foot span { display: inline-flex; align-items: center; gap: 4px; }
.pomo-foot svg { width: 15px; height: 15px; color: var(--warning); }
.pomo-foot select { width: auto; margin-left: auto; height: 30px; font-size: .78rem; }
body.in-test .pomo-fab, body.in-test .pomo-panel { display: none; }
@media print { .pomo-fab, .pomo-panel { display: none !important; } }

/* Focus timer & games shortcuts on the student Homework page */
.study-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.study-tool { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s; }
.study-tool:hover { border-color: var(--primary-100); box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
.study-tool > div { flex: 1; min-width: 0; }
.study-tool b { display: block; }
.study-tool > div span { font-size: .84rem; color: var(--muted); }
.pomo-tomato-lg { width: 44px; height: 44px; flex: none; border-radius: 12px; background: #fff3f1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='18' r='11' fill='%23ef5a4c'/%3E%3Cpath d='M16 7c-1.5-2-4-2.5-6-2 1.5 1 2.5 2.5 2.5 4.5C14 8 15 8 16 9c1-1 2-1 3.5.5 0-2 1-3.5 2.5-4.5-2-.5-4.5 0-6 2Z' fill='%232fa36b'/%3E%3C/svg%3E") center / 30px no-repeat; }

/* ---------- Word games ---------- */
.stat-action { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.stat-action:hover { border-color: var(--primary-100); box-shadow: var(--shadow); }
.game-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.game-card { padding: 24px; max-width: 760px; margin: 0 auto; }
.fc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: .86rem; }
.fc-top select { width: auto; max-width: 70%; }

.flashcard { display: block; width: 100%; height: 260px; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1200px; font: inherit; color: inherit; }
.fc-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, 1.2, .4, 1); }
.flashcard.flipped .fc-inner { transform: rotateY(180deg); }
.flashcard:hover .fc-inner { box-shadow: none; }
.fc-face {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; border-radius: 20px; text-align: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 1px solid var(--border); box-shadow: 0 20px 40px -24px rgba(19, 33, 63, .4);
}
.fc-front { background: linear-gradient(160deg, #fff, var(--violet-50)); }
.fc-back { background: linear-gradient(160deg, #fff, var(--teal-50)); transform: rotateY(180deg); }
.fc-tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fc-front strong { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--c-speaking); line-height: 1.15; }
.fc-hint { display: inline-flex; gap: 6px; align-items: center; font-size: .8rem; color: var(--muted); }
.fc-hint svg { width: 14px; height: 14px; }
.fc-meaning { margin: 0; font-size: 1.2rem; font-weight: 650; color: var(--text); max-width: 520px; }
.fc-example { margin: 0; font-family: var(--font-serif); color: var(--text-2); max-width: 520px; }
.fc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }

.game-done { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 26px 10px 6px; animation: pop .3s var(--ease); }
.game-done > svg { width: 44px; height: 44px; color: var(--warning); }
.game-done h3 { margin: 4px 0 0; font-size: 1.3rem; }
.game-done p { color: var(--text-2); margin: 0 0 10px; }

.match-score { display: inline-flex; gap: 14px; }
.match-score span { display: inline-flex; gap: 5px; align-items: center; }
.match-score svg { width: 15px; height: 15px; color: var(--muted); }
.match-board { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 14px; }
.match-col { display: grid; gap: 10px; align-content: start; }
.match-tile {
  min-height: 56px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); text-align: left; cursor: pointer;
  font: inherit; font-size: .9rem; color: var(--text); transition: border-color .15s, background .15s, transform .15s, opacity .3s;
}
.match-tile.term { font-weight: 700; color: var(--c-speaking); }
.match-tile:hover { border-color: var(--primary); transform: translateY(-1px); }
.match-tile.picked { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px rgba(37, 88, 230, .12); }
.match-tile.done { border-color: #bfeedd; background: var(--success-50); color: var(--success); opacity: .6; cursor: default; transform: none; }
.match-tile.wrong { border-color: var(--danger); background: var(--danger-50); animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.combo { padding: 1px 9px; border-radius: 99px; background: var(--amber-50); color: var(--warning); font-weight: 700; font-size: .78rem; }
.lk-word { display: grid; justify-items: center; gap: 6px; padding: 26px 10px; margin-bottom: 16px; border-radius: 18px; background: linear-gradient(160deg, #fff, var(--teal-50)); border: 1px solid var(--border); text-align: center; }
.lk-word span { font-size: .84rem; color: var(--muted); }
.lk-word strong { font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2.2rem); color: var(--c-writing); }
.lk-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lk-options .choice-card { justify-content: center; text-align: center; min-height: 58px; }
.choice-card.right { border-color: var(--success); background: var(--success-50); box-shadow: 0 0 0 3px rgba(15, 159, 110, .12); }
.choice-card.wrong-pick { border-color: var(--danger); background: var(--danger-50); animation: shake .4s; }
.choice-card:disabled { cursor: default; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .ws-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .sp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .study-tools, .game-picker, .lk-options { grid-template-columns: minmax(0, 1fr); }
  .match-board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .match-tile { font-size: .8rem; padding: 8px 10px; }
  .game-card { padding: 16px; }
  .flashcard { height: 230px; }
  .pomo-fab { left: 12px; bottom: 12px; }
  .pomo-panel { left: 12px; bottom: 70px; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .fc-inner, .drawer, .pomo-fab svg, .match-tile, .choice-card { transition: none !important; animation: none !important; }
}

/* ---------- Admission follow-up (result page) ---------- */
.fu-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fu-step {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; transition: border-color .15s, background .15s, box-shadow .15s;
}
.fu-step:hover { border-color: var(--primary-100); }
.fu-step svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.fu-step b { display: block; font-size: .88rem; }
.fu-step small { display: block; font-size: .74rem; color: var(--muted); }
.fu-step.active { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px rgba(37, 88, 230, .1); }
.fu-step.active svg { color: var(--primary); }
.fu-step.fu-enrolled.active { border-color: var(--success); background: var(--success-50); box-shadow: 0 0 0 3px rgba(15, 159, 110, .12); }
.fu-step.fu-enrolled.active svg { color: var(--success); }
.fu-step.fu-contacted.active { border-color: var(--warning); background: var(--warning-50); box-shadow: 0 0 0 3px rgba(217, 119, 6, .12); }
.fu-step.fu-contacted.active svg { color: var(--warning); }
.fu-step.fu-declined.active { border-color: var(--danger); background: var(--danger-50); box-shadow: 0 0 0 3px rgba(220, 38, 38, .1); }
.fu-step.fu-declined.active svg { color: var(--danger); }
@media (max-width: 640px) { .fu-steps { grid-template-columns: minmax(0, 1fr); } }

/* ---------- CDI materials (staff library) ---------- */
.cdi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.cdi-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; position: relative; overflow: hidden; }
.cdi-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--tone, var(--primary)); }
.cdi-card-head { display: flex; gap: 12px; align-items: flex-start; }
.cdi-card-head h3 { margin: 2px 0 0; font-size: 1.05rem; line-height: 1.3; }
.cdi-kicker { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tone, var(--primary)); }
.cdi-parts { margin: 0; padding: 0; list-style: none; counter-reset: part; display: grid; gap: 6px; }
.cdi-parts li { counter-increment: part; display: flex; gap: 10px; align-items: center; font-size: .88rem; color: var(--text-2); }
.cdi-parts li::before { content: counter(part); flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: var(--tone, var(--primary)); background: var(--tone-bg, var(--primary-50)); }
.cdi-facts { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .82rem; color: var(--muted); }
.cdi-facts span { display: inline-flex; gap: 6px; align-items: center; }
.cdi-facts svg { width: 15px; height: 15px; }
.cdi-audio { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: .8rem; color: var(--text-2); }
.cdi-audio svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--c-listening); }
.cdi-actions { display: flex; gap: 8px; margin-top: auto; }
.cdi-actions .btn { flex: 1; }

/* ---------- CDI test page: intro card ---------- */
.cdi-intro { max-width: 620px; margin: 10px auto 0; padding: 32px; display: grid; gap: 14px; justify-items: start; }
.cdi-intro > svg { width: 40px; height: 40px; color: var(--danger); }
.cdi-intro h1 { margin: 0; font-size: 1.7rem; }
.cdi-intro-icon { width: 56px; height: 56px; border-radius: 16px; }
.cdi-intro-icon svg { width: 28px; height: 28px; }
.cdi-for { margin: -6px 0 0; color: var(--text-2); }
.cdi-intro .cdi-parts { width: 100%; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); }
.cdi-rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: .88rem; color: var(--text-2); }
.cdi-rules li { display: flex; gap: 8px; align-items: flex-start; }
.cdi-rules svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--success); }
.cdi-intro .callout { width: 100%; }

/* ---------- CDI test page: the test itself ---------- */
body.cdi-mode .topbar, body.cdi-mode .aurora, body.cdi-mode .pomo-fab { display: none; }
body.cdi-mode { background: var(--bg); }
.cdi-runner { --cdi-top: 56px; --cdi-nav: 58px; }
.cdi-topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: var(--cdi-top); padding: 0 16px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.cdi-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; }
.cdi-title { display: flex; flex-direction: column; min-width: 0; padding-left: 12px; border-left: 1px solid var(--border); line-height: 1.2; }
.cdi-title b { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.cdi-title span { font-size: .76rem; color: var(--muted); }
.cdi-answered { font-size: .84rem; }
/* reading: passage | questions */
.cdi-split { --cdi-left: 50%; display: grid; grid-template-columns: minmax(0, var(--cdi-left)) 10px minmax(0, 1fr); height: calc(100vh - var(--cdi-top) - var(--cdi-nav)); height: calc(100dvh - var(--cdi-top) - var(--cdi-nav)); }
.cdi-split.resizing { cursor: col-resize; user-select: none; }
.cdi-split.resizing .cdi-pane { pointer-events: none; }
.cdi-pane { overflow-y: auto; overscroll-behavior: contain; padding: 26px 28px 40px; min-width: 0; }
.cdi-pane-text { background: var(--surface); }
.cdi-resizer { position: relative; cursor: col-resize; background: var(--surface-2); border-left: 1px solid var(--border); border-right: 1px solid var(--border); touch-action: none; }
.cdi-resizer span { position: absolute; top: 50%; left: 50%; width: 4px; height: 44px; margin: -22px 0 0 -2px; border-radius: 4px; background: var(--border-strong); transition: background .15s, height .15s; }
.cdi-resizer:hover span, .cdi-resizer:focus-visible span, .cdi-split.resizing .cdi-resizer span { background: var(--primary); height: 64px; margin-top: -32px; }
.cdi-resizer:focus-visible { outline: none; }
.cdi-pane-tabs { display: none; }
.cdi-qpart-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: .86rem; font-weight: 700; color: var(--muted); }
.cdi-passage h2 { font-family: var(--font-serif); font-size: 1.55rem; margin: 6px 0 8px; }
.cdi-passage-intro { color: var(--muted); font-style: italic; margin-bottom: 12px; }
.cdi-passage .prose p { margin: 0 0 1em; }
.cdi-passage .prose strong:first-child { color: var(--primary); margin-right: 4px; }
/* listening: player on top */
.is-listening .cdi-pane-text { background: var(--bg); }
.cdi-player-card { padding: 14px; margin-bottom: 14px; position: sticky; top: 0; z-index: 20; box-shadow: var(--shadow); }
.cdi-listen-tip { margin-bottom: 14px; font-size: .86rem; }
.cdi-part-list { display: grid; gap: 8px; margin-bottom: 18px; }
.cdi-part-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.cdi-part-card:hover { border-color: var(--primary); }
.cdi-part-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 88, 230, .14); }
.cdi-part-no { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--c-listening); background: #fdf0f6; }
.cdi-part-card.active .cdi-part-no { color: #fff; background: var(--primary); }
.cdi-part-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.cdi-part-text b { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cdi-part-text small { color: var(--muted); font-size: .78rem; }
.cdi-part-count { flex: none; font-size: .78rem; font-weight: 700; color: var(--muted); padding: 3px 8px; border-radius: 99px; background: var(--surface-2); }
.cdi-part-count.full { color: var(--success); background: var(--success-50); }
.cdi-player-card audio { width: 100%; margin-top: 8px; }
.cdi-part-head { margin: 8px 0 12px; font-size: 1.05rem; color: var(--text-2); }
/* questions */
.cdi-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 16px; }
.cdi-group-title { font-family: var(--font-display); font-weight: 800; font-size: 1rem; margin-bottom: 10px; color: var(--text); }
.cdi-body { font-size: .93rem; line-height: 1.7; color: var(--text-2); }
.cdi-body p { margin: 0 0 .7em; }
.cdi-body h4, .cdi-body h5 { margin: 14px 0 6px; color: var(--text); font-size: .95rem; }
.cdi-body ul, .cdi-body ol { margin: 0 0 .8em; padding-left: 20px; }
.cdi-body table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: .88rem; }
.cdi-body td, .cdi-body th { border: 1px solid var(--border); padding: 7px 10px; vertical-align: top; text-align: left; }
.cdi-body th { background: var(--surface-2); color: var(--text); }
.cdi-body img { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); margin: 8px 0; }
.cdi-body > div + div { margin-top: 2px; }
.cdi-body .q { margin: 10px 0; }
.cdi-row .opts { padding-left: 36px; }
.cdi-row-control { padding-left: 36px; margin-top: 8px; }
.cdi-select { height: 36px; min-width: 200px; max-width: 100%; padding: 0 30px 0 10px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); font: inherit; font-size: .88rem; }
.cdi-gap { display: inline-flex; align-items: center; gap: 5px; margin: 2px 3px; vertical-align: middle; border-radius: 8px; }
.cdi-gap .q-num { margin: 0; min-width: 24px; height: 24px; font-size: .72rem; }
.cdi-gap .gap-input { width: 150px; height: 30px; padding: 0 8px; border: 0; border-bottom: 2px solid var(--border-strong); border-radius: 6px 6px 0 0; background: var(--surface-2); font: inherit; font-weight: 600; color: var(--primary); }
.cdi-gap .gap-input:focus { outline: none; border-bottom-color: var(--primary); background: var(--primary-50); }
.cdi-gap select { height: 30px; min-width: 70px; padding: 0 24px 0 8px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); font: inherit; font-size: .86rem; font-weight: 600; color: var(--primary); }
.cdi-gap.correct, .cdi-gap.incorrect { padding: 2px 4px; }
.cdi-gap.correct { background: var(--success-50); }
.cdi-gap.incorrect { background: var(--danger-50); }
.cdi-gap select.ok { color: var(--success); border-color: var(--success); }
.cdi-gap select.bad { color: var(--danger); border-color: var(--danger); }
.cdi-fix { font-size: .78rem; font-weight: 700; color: var(--success); padding: 1px 6px; border-radius: 6px; background: #fff; border: 1px solid #bfeedd; }
.q.partial { border-color: #f6d79b; background: #fffcf4; }
.opt.is-wrong { border-color: var(--danger); background: var(--danger-50); }
.cdi-quote { font-family: var(--font-serif); font-style: italic; }
.flash { animation: cdiFlash .9s ease; }
@keyframes cdiFlash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 4px rgba(37, 88, 230, .25); } }
.shake { animation: shake .4s; }
/* bottom navigator */
.cdi-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 16px; align-items: center; height: var(--cdi-nav); padding: 0 14px; overflow-x: auto; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px -18px rgba(19, 33, 63, .4); }
.cdi-nav-part { display: flex; gap: 4px; align-items: center; flex: none; }
.cdi-nav-name { border: 0; background: none; font: inherit; font-size: .78rem; font-weight: 800; color: var(--muted); padding: 4px 8px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.cdi-nav-name.active { color: var(--primary); background: var(--primary-50); }
.cdi-nav [data-goto] { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); font: inherit; font-size: .74rem; font-weight: 700; color: var(--text-2); cursor: pointer; flex: none; }
.cdi-nav [data-goto]:hover { border-color: var(--primary); }
.cdi-nav [data-goto].answered { background: var(--primary); border-color: var(--primary); color: #fff; }
.cdi-nav [data-goto].ok { background: var(--success); border-color: var(--success); color: #fff; }
.cdi-nav [data-goto].bad { background: var(--danger); border-color: var(--danger); color: #fff; }
/* result */
.cdi-score { display: flex; gap: 22px; align-items: center; padding: 20px 22px; margin-bottom: 16px; flex-wrap: wrap; }
.cdi-score .ring { --size: 104px; }
.cdi-score-main { flex: 1; min-width: 220px; display: grid; gap: 6px; justify-items: start; }
.cdi-score-main h3 { margin: 0; font-size: 1.2rem; }
.cdi-score-parts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cdi-score-parts span { padding: 3px 10px; border-radius: 99px; background: var(--surface-2); font-size: .8rem; }
/* staff answer review */
.cdi-review { padding: 18px; }
.cdi-review-passage { margin-bottom: 14px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--surface-2); }
.cdi-review-passage summary { cursor: pointer; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.cdi-review-passage summary svg { width: 16px; height: 16px; }
.cdi-review-passage .prose { margin-top: 10px; font-size: .95rem; }

@media (max-width: 1000px) {
  .cdi-pane { padding: 20px 18px 36px; }
}
/* Phones: one pane at a time (Passage/Audio | Questions tabs), each scrolling on its own. */
@media (max-width: 700px) {
  .cdi-runner { --cdi-tabs: 46px; }
  .cdi-pane-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; height: var(--cdi-tabs); padding: 5px 10px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: var(--cdi-top); z-index: 25; }
  .cdi-pane-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 9px; background: none; font: inherit; font-size: .86rem; font-weight: 700; color: var(--muted); cursor: pointer; }
  .cdi-pane-tabs button svg { width: 16px; height: 16px; }
  .cdi-pane-tabs button.active { background: var(--primary-50); color: var(--primary); }
  .cdi-split { grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--cdi-top) - var(--cdi-tabs) - var(--cdi-nav)); height: calc(100dvh - var(--cdi-top) - var(--cdi-tabs) - var(--cdi-nav)); }
  .cdi-resizer { display: none; }
  .cdi-split[data-show="text"] .cdi-pane-questions, .cdi-split[data-show="questions"] .cdi-pane-text { display: none; }
  .cdi-pane { padding: 18px 16px 30px; }
}
@media (max-width: 640px) {
  .cdi-intro { padding: 22px; }
  .cdi-title span, .cdi-brand, .cdi-answered { display: none; }
  .cdi-title { padding-left: 0; border-left: 0; }
  .cdi-row .opts, .cdi-row-control { padding-left: 0; }
  .cdi-gap .gap-input { width: 120px; }
  .cdi-group { padding: 14px; }
}

/* ---------- CDI materials: uploaded tests ---------- */
.cdi-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cdi-toolbar .tabs { margin-bottom: 0; }
.cdi-card-head > div:nth-child(2) { flex: 1; min-width: 0; }
.cdi-card-menu { display: flex; gap: 2px; margin: -4px -6px 0 0; }
.cdi-added { display: flex; gap: 6px; align-items: center; margin: 0; font-size: .78rem; color: var(--muted); }
.cdi-added svg { width: 14px; height: 14px; flex: none; }

.cdu-modal { max-width: 980px; }
.cdu-modal .modal-foot { display: flex; align-items: center; gap: 8px; }
.cdu-pick { display: grid; gap: 16px; }
.cdu-drop { display: grid; justify-items: center; gap: 4px; padding: 36px 20px; }
.cdu-drop b { color: var(--text); font-size: 1rem; }
.cdu-drop svg { width: 34px; height: 34px; margin-bottom: 4px; }
.cdu-help { padding: 14px 18px; border-radius: 12px; background: var(--surface-2); font-size: .87rem; color: var(--text-2); }
.cdu-help h4 { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; font-size: .92rem; color: var(--text); }
.cdu-help h4 svg { width: 16px; height: 16px; color: var(--primary); }
.cdu-help ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
.cdu-audio { padding: 14px; display: flex; gap: 10px; align-items: center; justify-content: center; }
.cdu-audio svg { width: 20px; height: 20px; margin: 0; }
.cdu-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.cdu-part { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); min-width: 0; }
.cdu-part > div { display: grid; min-width: 0; line-height: 1.3; }
.cdu-part b { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cdu-part small { font-size: .76rem; color: var(--muted); }
.cdu-part-no { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .82rem; color: var(--primary); background: var(--primary-50); }
.cdu-part-no svg { width: 15px; height: 15px; }
.cdu-part.total { background: var(--surface-2); }
.cdu-table { max-height: 46vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; margin-top: 8px; }
.cdu-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); }
.cdu-table td { vertical-align: middle; padding: 8px 10px; }
.cdu-table .q-num { margin: 0; }
.cdu-q { font-size: .84rem; color: var(--text-2); max-width: 380px; }
.cdu-a { min-width: 200px; }
.cdu-a .input { height: 36px; font-size: .88rem; }
.cdu-letters { display: flex; flex-wrap: wrap; gap: 4px; }
.cdu-letters label { cursor: pointer; }
.cdu-letters input { position: absolute; opacity: 0; pointer-events: none; }
.cdu-letters span { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--border-strong); font-weight: 700; font-size: .84rem; }
.cdu-letters input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.cdu-letters input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.cdu-table tr.missing td { background: var(--danger-50); }
.cdu-table tr.missing .input { border-color: var(--danger); }
@media (max-width: 640px) {
  .cdu-q { max-width: 160px; }
  .cdu-modal .modal-foot { flex-wrap: wrap; }
}

/* ---------- Branches ---------- */
.br-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.br-summary .stat-tile { display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.br-summary .stat-tile span { display: flex; gap: 6px; align-items: center; font-size: .78rem; font-weight: 700; color: var(--muted); }
.br-summary .stat-tile span svg { width: 15px; height: 15px; color: var(--primary); }
.br-summary .stat-tile strong, .br-kpis strong { font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.br-summary em, .br-kpis em { font-style: normal; font-size: .62em; font-weight: 700; color: var(--muted); }
.br-summary small, .br-kpis small { font-size: .76rem; color: var(--muted); }
.br-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.br-toolbar .search-box { position: relative; flex: 1; max-width: 340px; min-width: 200px; }
.br-toolbar .search-box svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: var(--muted); pointer-events: none; }
.br-toolbar .search-box .input { padding-left: 36px; }
.br-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 16px; }
.br-card { display: flex; flex-direction: column; gap: 16px; padding: 20px; position: relative; overflow: hidden; }
.br-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--primary), #7c5cff); }
.br-head { display: flex; gap: 12px; align-items: flex-start; }
.br-logo { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--primary), #7c5cff); box-shadow: 0 8px 18px -10px var(--primary); }
.br-title { flex: 1; min-width: 0; }
.br-title h3 { margin: 0 0 2px; font-size: 1.12rem; }
.br-title .muted { font-size: .8rem; line-height: 1.4; }
.br-title .muted svg { width: 13px; height: 13px; display: inline; vertical-align: -2px; }
.br-tools { display: flex; gap: 2px; margin: -4px -6px 0 0; }
.br-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.br-card { container-type: inline-size; }
@container (max-width: 500px) { .br-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.br-kpis .kpi { display: grid; gap: 1px; padding: 10px 12px; }
.br-kpis .kpi > span { font-size: .72rem; }
.br-kpis strong { font-size: 1.3rem; }
.br-activity { display: grid; gap: 8px; }
.br-activity-head { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; font-weight: 700; color: var(--text-2); }
.br-activity-head .muted { font-weight: 500; }
.br-bars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; align-items: end; height: 46px; padding: 0 2px; border-bottom: 1px solid var(--border); }
.br-bars span { height: var(--h); border-radius: 5px 5px 2px 2px; background: color-mix(in srgb, var(--primary) 35%, transparent); transition: background .15s; }
.br-bars span.now { background: var(--primary); }
.br-bars span.zero { background: var(--border); }
.br-bars span:hover { background: var(--primary); }
.br-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.br-chip { display: inline-flex; gap: 5px; align-items: center; padding: 4px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; color: var(--text-2); background: var(--surface-2); text-decoration: none; }
.br-chip svg { width: 13px; height: 13px; }
a.br-chip:hover { color: var(--primary); }
.br-chip.warn { color: var(--warning); background: var(--warning-50); }
.br-team { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.br-team-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .78rem; }
.br-team-head .label-text { margin: 0; }
.br-person { display: flex; gap: 10px; align-items: center; min-width: 0; }
.br-person > div { display: grid; min-width: 0; line-height: 1.3; }
.br-person b { font-size: .88rem; }
.br-person small { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
@media (max-width: 900px) { .br-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .br-card { padding: 16px; } }
.br-kpis .kpi > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Full mock: student ---------- */
.fm-page { max-width: 760px; }
.fm-intro { max-width: 720px; }
.fm-steps { list-style: none; margin: 4px 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; }
.fm-steps li { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; border-radius: 12px; background: var(--surface-2); color: var(--muted); text-align: center; font-size: .82rem; }
.fm-steps li svg { width: 20px; height: 20px; }
.fm-steps li span { font-weight: 700; color: var(--text-2); }
.fm-steps li small { font-size: .72rem; }
.fm-steps li.now { background: var(--primary-50); color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); }
.fm-steps li.now span { color: var(--primary); }
.fm-steps li.done { background: var(--success-50); color: var(--success); }
.cdi-rules li.warn svg { color: var(--danger); }
.cdi-rules li.warn { color: var(--text); }
.fm-speaking { justify-items: center; text-align: center; }
.fm-speaking .cdi-rules, .fm-speaking .callout { text-align: left; }
.fm-mic { width: 64px; height: 64px; border-radius: 20px; }
.fm-mic svg { width: 30px; height: 30px; }
.fm-wait { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; width: 100%; max-width: 380px; }
.fm-wait li { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-size: .9rem; color: var(--text-2); }
.fm-wait li svg { width: 17px; height: 17px; }
.fm-wait li.ok { background: var(--success-50); color: var(--success); }
.fm-poll { display: flex; gap: 8px; align-items: center; font-size: .84rem; margin: 0; }
.fm-result { padding: 28px; display: grid; gap: 18px; }
.fm-result-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.fm-result-head h1 { margin: 6px 0 2px; font-size: 1.6rem; }
.fm-result .ring { --size: 120px; }
.fm-bands { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fm-band { display: grid; gap: 2px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.fm-band span { display: flex; gap: 6px; align-items: center; font-size: .8rem; font-weight: 700; color: var(--text-2); }
.fm-band span svg { width: 15px; height: 15px; }
.fm-band strong { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.fm-band small { font-size: .75rem; color: var(--muted); }
.fm-comment { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); }
.fm-comment h4 { display: flex; gap: 6px; align-items: center; margin: 0 0 6px; }
.fm-comment h4 svg { width: 16px; height: 16px; }
.fm-comment p { margin: 0; white-space: pre-line; color: var(--text-2); }
/* writing runner */
.fm-task .fm-task-time { font-size: .86rem; margin: 4px 0 12px; }
.fm-prompt { font-size: .98rem; line-height: 1.7; padding: 16px 18px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--primary); }
.fm-chart { margin-top: 16px; overflow-x: auto; }
.fm-chart svg { max-width: 100%; height: auto; }
.fm-write { display: flex; flex-direction: column; }
.fm-editor { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.fm-editor[hidden] { display: none; }
.fm-textarea { flex: 1; min-height: 340px; width: 100%; resize: none; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); font: inherit; font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.75; color: var(--text); }
.fm-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 88, 230, .14); }
.fm-words { display: flex; justify-content: space-between; font-size: .84rem; font-weight: 700; color: var(--warning); }
.fm-words .ok { color: var(--success); }
.is-writing .cdi-nav-name { font-size: .86rem; padding: 6px 14px; }
/* exam lock */
.exam-lock-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(12, 22, 54, .78); backdrop-filter: blur(6px); }
.exam-lock-card { max-width: 440px; padding: 30px; border-radius: 20px; background: var(--surface); text-align: center; display: grid; gap: 12px; justify-items: center; box-shadow: var(--shadow-lg); }
.exam-lock-card > svg { width: 44px; height: 44px; color: var(--danger); }
.exam-lock-card h2 { margin: 0; }
.exam-lock-card p { margin: 0; color: var(--text-2); }
@media (max-width: 640px) {
  .fm-steps, .fm-bands { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fm-result { padding: 18px; }
}

/* ---------- Full mock: staff ---------- */
.fm-lib { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fm-lib li { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; color: var(--text); }
.fm-lib li > span:last-child { display: grid; line-height: 1.35; min-width: 0; }
.fm-lib small { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.fm-lib-ic { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--primary); }
.fm-lib-ic svg { width: 15px; height: 15px; }
.fm-attempt { display: grid; gap: 16px; }
.fm-attempt .page-head { margin-bottom: 0; }
.fm-summary { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 20px 22px; }
.fm-summary h1 { margin: 0 0 4px; font-size: 1.5rem; }
.fm-summary-bands { display: flex; gap: 8px; flex-wrap: wrap; }
.fm-summary-bands > div { display: grid; justify-items: center; min-width: 74px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.fm-summary-bands span { font-size: .72rem; font-weight: 700; color: var(--muted); }
.fm-summary-bands b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.fm-summary-bands .overall { background: var(--primary); color: #fff; }
.fm-summary-bands .overall span { color: rgba(255, 255, 255, .8); }
.fm-sec .card-head h3 { display: flex; gap: 8px; align-items: center; }
.fm-sec .card-head h3 svg { width: 18px; height: 18px; color: var(--primary); }
.fm-sec-band { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--primary); }
.fm-sec.fm-now { box-shadow: 0 0 0 2px var(--warning), var(--shadow); }
.fm-wtask { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 18px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.fm-wtask-prompt h4 { margin: 8px 0 6px; }
.fm-wtask-prompt p { font-size: .88rem; color: var(--text-2); }
.fm-wtask-meta { display: flex; justify-content: space-between; font-size: .84rem; margin-bottom: 6px; }
.fm-essay { max-height: 360px; overflow-y: auto; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); font-family: var(--font-serif); line-height: 1.75; white-space: normal; }
.fm-crits { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 12px; }
.fm-crit { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border); font-size: .84rem; }
.fm-crit select { width: 78px; }
.fm-crit.total { background: var(--primary-50); border-color: transparent; }
.fm-crit.total b { font-size: 1.1rem; color: var(--primary); }
.fm-crits-wide { margin-bottom: 12px; }
.fm-script { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.fm-script h4 { margin: 0 0 8px; font-size: .9rem; }
.fm-script ol, .fm-script ul { margin: 0; padding-left: 18px; font-size: .88rem; color: var(--text-2); display: grid; gap: 4px; }
.fm-cue { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); margin-bottom: 8px; font-size: .88rem; }
.fm-clock { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.fm-clock-time { font-weight: 800; font-size: 1.1rem; color: var(--primary); }
.fm-answers summary, .fm-violations summary { cursor: pointer; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.fm-answers summary svg, .fm-violations summary svg { width: 16px; height: 16px; }
.fm-answers .table-wrap { max-height: 420px; overflow: auto; margin-top: 8px; }
.fm-violations { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-size: .86rem; }
.fm-violations ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); }
.text-danger { color: var(--danger); }
@media (max-width: 900px) {
  .fm-wtask, .fm-script { grid-template-columns: minmax(0, 1fr); }
}
#fmx label svg { display: inline; width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; color: var(--primary); }
