/* The exam rooms like the computer-delivered IELTS ("IELTS on computer", user's item (2), 01/11/2026): one thin top bar
   (candidate · timer with Hide · tools as icons with tooltips · Help · Settings · Save and exit), the question navigator
   at the bottom (parts with "x of n", numbered boxes: answered = underlined, current = outlined, flagged = orange corner;
   Flag for review; ← → ; Submit), and the Settings of the real test (text size, contrast). HELEN IELTS brand kept (dark
   bar, logo, colours). Used by the Listening / Reading room (index.html links it) and the class rooms (exam.css imports
   it: student/write.html, speak.html, practice-room.html Writing). The behaviour is in assets/js/cd-room.js.
   Scope: .xh.cd (the top bar), .ex-foot.cd / .xfoot.cd (the bottom bar), [data-contrast] (a room's root). */

/* ---- icons as masks (paths of assets/js/icons.js), so a button keeps its text for screen readers and tests while it
   shows only the icon: .cd-i draws var(--ic) before the label; .xh-ic / .xf-ic hide the label (font-size 0) ---- */
[data-ic="user"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }
[data-ic="clock"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
[data-ic="eye"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
[data-ic="eye-off"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.9 4.24A9.1 9.1 0 0 1 12 4c6.5 0 10 8 10 8a17.6 17.6 0 0 1-2.16 3.19'/%3E%3Cpath d='M6.6 6.6A17.4 17.4 0 0 0 2 12s3.5 8 10 8a9.7 9.7 0 0 0 5.4-1.6'/%3E%3Cpath d='M14.1 14.1a3 3 0 1 1-4.24-4.24'/%3E%3Cpath d='M3 3l18 18'/%3E%3C/svg%3E"); }
[data-ic="highlighter"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11l-6 6v3h9l3-3'/%3E%3Cpath d='M22 12l-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4'/%3E%3C/svg%3E"); }
[data-ic="eraser"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 21l-4.3-4.3a1 1 0 0 1 0-1.4l10-10a1 1 0 0 1 1.4 0l5.6 5.6a1 1 0 0 1 0 1.4L11 21'/%3E%3Cpath d='M22 21H7'/%3E%3Cpath d='M5 11l9 9'/%3E%3C/svg%3E"); }
[data-ic="note"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z'/%3E%3Cpath d='M14 3v6h6'/%3E%3Cpath d='M8 13h8'/%3E%3Cpath d='M8 17h5'/%3E%3C/svg%3E"); }
[data-ic="settings"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E"); }
[data-ic="help"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.1 9a3 3 0 0 1 5.8 1c0 2-3 3-3 3'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E"); }
[data-ic="flag"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 22V4'/%3E%3Cpath d='M4 4h12l-2 4 2 4H4'/%3E%3C/svg%3E"); }
[data-ic="arrow-left"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5'/%3E%3Cpath d='M12 19l-7-7 7-7'/%3E%3C/svg%3E"); }
[data-ic="arrow-right"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5l7 7-7 7'/%3E%3C/svg%3E"); }
[data-ic="check"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E"); }
[data-ic="volume"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5L6 9H2v6h4l5 4z'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7'/%3E%3Cpath d='M19 5a10 10 0 0 1 0 14'/%3E%3C/svg%3E"); }
[data-ic="close"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6L6 18'/%3E%3Cpath d='M6 6l12 12'/%3E%3C/svg%3E"); }
[data-ic="text-size"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7V5h10v2'/%3E%3Cpath d='M9 5v14'/%3E%3Cpath d='M7 19h4'/%3E%3Cpath d='M14 13v-1h7v1'/%3E%3Cpath d='M17.5 12v7'/%3E%3Cpath d='M16 19h3'/%3E%3C/svg%3E"); }
/* (the rules below give these bars' controls a display; anything the page hides stays hidden) */
.xh.cd [hidden], .ex-foot.cd [hidden], .xfoot.cd [hidden], .xbar.cd [hidden] { display: none !important; }
.cd-i::before, .xh-ic::before, .xf-ic::before { content: ""; flex: none; width: 18px; height: 18px; background-color: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.xh-ic, .xf-ic { font-size: 0 !important; gap: 0 !important; justify-content: center; }   /* (the label stays: screen readers, tooltips, tests) */

/* ================= the top bar ================= */
.xh.cd { background: var(--c-surface-dark); color: var(--c-text-on-dark); }
.xh.cd .xh-row { min-height: 48px; box-sizing: border-box; padding: 6px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.xh.cd .xh-row > svg:first-child { width: 28px; height: 28px; flex: none; }
.xh.cd .xh-id { flex: 1 1 140px; min-width: 0; line-height: 1.25; }
/* candidate: the student's name, as the candidate details of the real test */
.xh.cd .xh-cand { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: #FFFFFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xh.cd .xh-cand::before { width: 15px; height: 15px; background-color: var(--c-text-on-dark-2); }
.xh.cd .xh-cand > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.xh.cd .xh-sub { margin-top: 1px; font-size: 12px; color: var(--c-text-on-dark-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xh.cd .xh-sub b, .xh.cd .xh-sub .ex-title { font-weight: 600; color: #DCE3EB; }
.xh.cd .xh-title { font-size: 14px; }
/* the timer, centred between the candidate and the tools: "32 minutes left", amber in the last 5 minutes, red in the last */
.xh.cd .xh-clock { flex: none; margin-inline: auto; display: flex; align-items: center; gap: 6px; }
.xh.cd .xh-clock[hidden] { display: none; }
.xh.cd .ex-timer, .xh.cd .xh-time { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; box-sizing: border-box; padding: 0 10px; border-radius: var(--r-pill); font-family: var(--font-sans); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; transition: background-color 0.3s, color 0.3s; }
.xh.cd .ex-timer::before, .xh.cd .xh-time::before { content: ""; width: 17px; height: 17px; flex: none; background-color: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.xh.cd .ex-timer, .xh.cd .xh-time { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.xh.cd .xh-time:empty, .xh.cd .ex-timer:has(> span:empty) { display: none; }
.xh.cd .ex-timer.low, .xh.cd .xh-time.low { color: inherit; }
.xh.cd .ex-timer.warn, .xh.cd .xh-time.warn { background: #FBBF24; color: var(--c-text-1); }        /* last 5 minutes (10.6 : 1) */
.xh.cd .ex-timer.last, .xh.cd .xh-time.last { background: #C81E1E; color: #FFFFFF; }                /* last minute (5.9 : 1) */
.xh.cd .ex-timer.last::before, .xh.cd .xh-time.last::before { animation: cd-tick 1s steps(2, start) infinite; }
@keyframes cd-tick { to { opacity: 0.35; } }
.xh.cd .ex-nolimit { font-weight: 400; color: var(--c-text-on-dark-2); }
.xh.cd .ex-timer.is-score { background: var(--c-surface-dark-2); }   /* the review: the score where the timer was */
.xh.cd .ex-timer.is-score::before { display: none; }
/* "Hide timer" / "Show timer": small, next to the time */
.xh.cd .xh-btn.xh-mini { min-height: 28px; padding: 0 8px; font-size: 12px; border-color: transparent; color: #DCE3EB; text-decoration: underline; text-underline-offset: 3px; }
.xh.cd .xh-btn.xh-mini:hover:not(:disabled) { background: var(--c-surface-dark-2); }
.xh.cd .xh-btn.xh-mini[aria-pressed="true"] { background: transparent; border-color: transparent; color: #DCE3EB; }
/* hidden clock (Hide timer, exams too): it keeps its place and keeps running; the last 5 minutes (warn / last) show it again */
.xh.cd .cd-hide:not(.warn):not(.last) { visibility: hidden; }
.xh.cd .xh-chip { font-size: 11px; padding: 2px 8px; white-space: nowrap; }
.xh.cd .xh-tools { margin-left: auto; flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.xh.cd .xh-clock + .xh-tools { margin-left: 0; }
.xh.cd .xh-btn { min-height: 36px; border-radius: 6px; }
.xh.cd .xh-btn.xh-ic { width: 36px; padding: 0; display: inline-flex; align-items: center; }
.xh.cd .xh-btn[aria-pressed="true"], .xh.cd .xh-btn.on { background: #FFFFFF; color: var(--c-text-1); border-color: #FFFFFF; }
.xh.cd .xh-btn.strong { font-size: 13px; }
.xh.cd .xh-sep { width: 1px; height: 24px; background: var(--c-border-on-dark); flex: none; }
.xh.cd .xh-sep:first-child, .xh.cd .xh-sep:last-child, .xh.cd .xh-sep + .xh-sep { display: none; }
/* the pens: icons only (names in tooltips and for screen readers) */
.xh.cd .pen-bar { gap: 4px; }
.xh.cd .pen-bar .pen-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.xh.cd .pen-bar button { padding: 0 9px; }
.xh.cd .pen-bar .pen-caret { padding: 0 !important; }
.xh.cd .pen-bar .pen-ico.clear { display: none !important; }
.xh.cd .pen-bar .pen-clear::before { content: ""; width: 16px; height: 16px; flex: none; background-color: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.xh.cd .pen-bar .pen-clear { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6L6 18'/%3E%3Cpath d='M6 6l12 12'/%3E%3C/svg%3E"); }
/* Listening: the recording player, compact, with the volume (as the real test's volume control) */
.xh.cd .audio-bar { gap: 8px; padding: 3px 12px 3px 4px; }
.xh.cd #audPlay { width: 30px; height: 30px; font-size: 13px; }
.xh.cd .aud-once { padding-left: 8px; font-size: 12px; }
.xh.cd #audSeek { width: 120px; }
.xh.cd .audio-bar.rate-off #audSeek { width: 84px; }
.xh.cd .aud-time { min-width: 0; font-size: 12px; }
.xh.cd .aud-vol { display: inline-flex; align-items: center; gap: 4px; color: #C9D1DC; cursor: pointer; }
.xh.cd .aud-vol::before { width: 16px; height: 16px; }
.xh.cd #audVol { display: inline-block; width: 64px; height: 6px; accent-color: #9CC1E6; }
.xh.cd .aud-msg { max-width: 200px; }
/* tighter steps of the one-row fit (assets/js/pens.js fit) */
.xh.cd .xh-row.pen-tight { column-gap: 10px; }
.xh.cd .xh-row.pen-tight .xh-tools { column-gap: 4px; }
.xh.cd .xh-row.pen-tight #audVol { width: 48px; }
.xh.cd .xh-row.pen-tight .xh-btn.xh-mini { padding: 0 4px; }
.xh.cd .xh-row.pen-tighter .xh-chip { display: none; }

/* ---- Settings (text size, contrast) and Help ---- */
.cdr-pop { position: fixed; z-index: 320; width: 408px; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; background: var(--c-surface); color: var(--c-text-1); border: 1px solid var(--c-border); border-radius: var(--r-lg); box-shadow: var(--sh-3); font: 14px/1.4 var(--font-sans); }
.cdr-pop[hidden] { display: none; }
.cdr-pop h2 { margin: 0; font-size: 15px; font-weight: 600; }
.cdr-pop .cdr-l { font-size: 13px; font-weight: 600; color: var(--c-text-2); margin-bottom: 6px; }
.cdr-pop .cdr-opts { display: flex; gap: 6px; }
.cdr-pop .cdr-opt { flex: 1 1 0; min-height: 44px; padding: 4px 6px; border-radius: var(--r-md); border: 1px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-text-1); font: inherit; font-size: 13px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1.15; }
.cdr-pop .cdr-opt b { font-family: var(--font-serif); font-weight: 600; }
.cdr-pop [data-cd-size] { padding: 4px 2px; font-size: 12px; white-space: nowrap; }   /* (5 text sizes in one row: A−− … A++) */
.cdr-pop .cdr-opt[aria-checked="true"] { border: 2px solid var(--c-brand); background: var(--c-brand-soft); }
.cdr-pop .cdr-opt:focus-visible { outline: var(--focus-w) solid var(--c-focus); outline-offset: 2px; }
.cdr-pop .cdr-opt .cdr-sw { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 22px; border-radius: 4px; font-family: var(--font-serif); font-weight: 600; font-size: 14px; border: 1px solid var(--c-border-control); }
.cdr-pop .cdr-note { margin: 0; font-size: 12px; color: var(--c-text-3); }
/* a two-pane room (Reading, 07/11/2026): one text-size row per side ("Passage", "Questions") under "Text size" */
.cdr-pop .cdr-side + .cdr-side { margin-top: 8px; }
.cdr-pop .cdr-sl { font-size: 12px; font-weight: 600; color: var(--c-text-3); margin-bottom: 4px; }
.cdr-help { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.cdr-help h3 { margin: 4px 0 0; font-size: 15px; font-weight: 600; }
.cdr-help ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--c-text-2); }
.cdr-help .cdr-keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; color: var(--c-text-2); }
.cdr-help .cdr-keys dt { font-weight: 600; color: var(--c-text-1); }
.cdr-help .cdr-keys dd { margin: 0; }
.cdr-dlg { position: fixed; inset: 0; z-index: 330; background: var(--c-overlay); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cdr-dlg[hidden] { display: none; }
.cdr-dlg > .cdr-box { width: 560px; max-width: 100%; max-height: var(--modal-max-h); overflow-y: auto; box-sizing: border-box; background: var(--c-surface); color: var(--c-text-1); border-radius: var(--r-xl); padding: 22px 24px; box-shadow: var(--sh-4); font-family: var(--font-sans); display: flex; flex-direction: column; gap: 12px; }
.cdr-dlg h2 { margin: 0; font-size: 20px; font-weight: 600; }
.cdr-dlg .cdr-acts { display: flex; justify-content: flex-end; }
.cdr-dlg .cdr-acts button { font: inherit; font-weight: 600; min-height: 44px; padding: 0 18px; border-radius: var(--r-md); border: 1px solid var(--c-brand); background: var(--c-brand); color: #FFFFFF; cursor: pointer; }

/* ================= the bottom bar: question navigator (index.html) ================= */
.ex-foot.cd { padding: 6px 16px; gap: 6px 12px; flex-wrap: wrap; align-items: center; }
.ex-foot.cd .foot-parts { flex: 1 1 auto; min-width: 0; gap: 4px 10px; }
.ex-foot.cd .foot-part { gap: 3px; flex-wrap: nowrap; }
.ex-foot.cd .foot-part-label { min-height: 36px; padding: 0 10px; font-size: 14px; font-weight: 600; border-radius: 6px; border: 1px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-text-1); }
.ex-foot.cd .foot-part-label .cnt { margin-left: 2px; font-weight: 400; color: var(--c-text-3); }
.ex-foot.cd .foot-part.open .foot-part-label { border-color: transparent; background: transparent; color: var(--c-brand); padding: 0 6px 0 4px; }
.ex-foot.cd .foot-part.open .foot-part-label .cnt { font-size: 12px; }
.ex-foot.cd .foot-num { position: relative; width: 28px; height: 32px; border-radius: 4px; font-size: 13px; font-weight: 500; border: 1px solid #A9B2BF; background: var(--c-surface); color: var(--c-text-1); }
.ex-foot.cd .foot-num:hover { border-color: var(--c-text-2); }
.ex-foot.cd .foot-num.answered { background: var(--c-surface); box-shadow: inset 0 -3px 0 var(--c-brand); }   /* answered: underlined, as in the real test */
.ex-foot.cd .foot-num.current { border: 2px solid var(--c-brand); background: var(--c-brand-soft); color: var(--c-brand); font-weight: 700; }
.ex-foot.cd .foot-num.flagged { border-top-width: 1px; }
.ex-foot.cd .foot-num.current.flagged { border-top-width: 2px; }
.ex-foot.cd .foot-num.flagged::after { content: ""; position: absolute; top: -1px; right: -1px; width: 0; height: 0; border-style: solid; border-width: 0 10px 10px 0; border-color: transparent #D9822B transparent transparent; border-top-right-radius: 3px; }
.ex-foot.cd .foot-num.right { background: #E3F1E7; border-color: #7FB28E; color: var(--x-ok, #1E5631); box-shadow: none; }
.ex-foot.cd .foot-num.bad { background: #FBE4E1; border-color: #E8A39A; color: var(--x-bad, #B42318); box-shadow: none; }
.ex-foot.cd .foot-num.current.right, .ex-foot.cd .foot-num.current.bad { border-width: 2px; border-color: var(--c-brand); }
/* the legend: the orange corner only (its words for screen readers and in the tooltip), shown once a question is flagged */
.ex-foot.cd .flag-legend { display: inline-flex; align-items: center; gap: 0; font-size: 0; color: var(--c-text-3); white-space: nowrap; }
.ex-foot.cd .flag-legend::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 0 10px 10px 0; border-color: transparent #D9822B transparent transparent; }
.ex-foot.cd .foot-acts { gap: 6px; flex-wrap: nowrap; align-items: center; }
.ex-foot.cd .xf-btn { min-height: 38px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ex-foot.cd .xf-btn.xf-ic { width: 40px; padding: 0; }
.ex-foot.cd .xf-btn.primary.cd-i::before { width: 17px; height: 17px; }
/* Flag for review: the question in view (any type, also a gap inside notes or a table) */
.xf-flag { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--c-border-strong); background: var(--c-surface); color: var(--c-text-2); font-family: inherit; font-size: 13px !important; font-weight: 600 !important; cursor: pointer; white-space: nowrap; }
.xf-flag::before { width: 16px; height: 16px; }
.xf-flag[aria-pressed="true"] { border-color: #D9822B; background: #FDF1E3; color: #8A4B08; }
.xf-flag:disabled { opacity: 0.5; cursor: not-allowed; }
.xf-flag[hidden] { display: none; }
/* a question's own Flag button (Reading, Listening): the flag icon */
.flag-btn.cd-i { display: inline-flex; align-items: center; gap: 4px; }
.flag-btn.cd-i::before { width: 13px; height: 13px; }
/* the review list in the submit dialog: every question, answered / not answered / flagged; a click goes there */
.rv-grid { display: flex; flex-direction: column; gap: 6px; margin: 2px 0; }
.rv-part { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rv-part > b { min-width: 74px; font-size: 13px; font-weight: 600; }
.rv-num { position: relative; width: 28px; height: 28px; padding: 0; border-radius: 4px; border: 1px solid #A9B2BF; background: var(--c-surface); color: var(--c-text-1); font: inherit; font-size: 12px; cursor: pointer; }
.rv-num.answered { box-shadow: inset 0 -3px 0 var(--c-brand); }
.rv-num.missing { border-color: var(--c-warn); color: var(--c-warn); background: var(--c-warn-bg); }
.rv-num.flagged::after { content: ""; position: absolute; top: -1px; right: -1px; border-style: solid; border-width: 0 9px 9px 0; border-color: transparent #D9822B transparent transparent; }
.rv-key { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--c-text-3); }

/* ================= the class rooms (exam.css: write.html, practice-room Writing, speak.html) ================= */
/* the part banner (the real test's grey box: "Part 1 · You should spend about 20 minutes on this task.") */
.cd-room .xbar.cd { padding: 8px 16px; gap: 6px 14px; min-height: 0; }
.cd-room .xbar.cd .xbar-part { font-weight: 600; }
/* the bottom bar: the tasks (Task 1 · 123 words / Task 2) on the left, Save draft / Submit on the right */
.xfoot.cd { padding: 6px 16px; gap: 6px 12px; }
.xfoot.cd .wnav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.xfoot.cd .xtab { min-height: 38px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--c-border-strong); background: var(--c-surface); font-size: 14px; position: relative; }
.xfoot.cd .xtab[aria-pressed="true"] { border: 2px solid var(--c-brand); background: var(--c-brand-soft); color: var(--c-brand); }
.xfoot.cd .xtab .m { font-weight: 400; }
.xfoot.cd .xtab.has-words { box-shadow: inset 0 -3px 0 var(--c-brand); }
.xfoot.cd .t { font-size: 13px; }
.xfoot.cd .xbtn { min-height: 38px; }
.xfoot.cd .xf-ic { width: 40px; padding: 0; }
/* text size of the class rooms (Settings): the task, the answer box, the Speaking card and questions */
.cd-room { --cd-scale: 1; }
.cd-room .prompt-box, .cd-room .essay-box { font-size: calc(17px * var(--cd-scale)); }
.cd-room .wcol, .cd-room .xbar { font-size: calc(15px * var(--cd-scale)); }
.cd-room .wcol h1 { font-size: calc(20px * var(--cd-scale)); }
.cd-room .sq, .cd-room .cue .ttl { font-size: calc(22px * var(--cd-scale)); }
.cd-room .cue ul, .cd-room .cue .lead, .cd-room .snotes textarea { font-size: calc(15px * var(--cd-scale)); }
.cd-room .xh .read-size { display: none; }   /* (the Settings hold the text size here) */
.cd-room .wcol.task > .task-img { box-sizing: border-box; }   /* (its 1 px edge made the task column scroll sideways by 2 px at 1280 px) */
.xh.cd .xh-parts { margin-left: 0; gap: 4px; }
.xh.cd .xh-part { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 6px; }
.xh.cd .xh-part:disabled { opacity: 1; }
.xh.cd .xh-part[aria-pressed="false"]:disabled { color: var(--c-text-on-dark-2); }

/* ================= contrast (Settings): white on black, yellow on black, as in the real test ================= */
[data-contrast] { --cdc-bg: #000000; --cdc-fg: #FFFFFF; --cdc-mute: #D0D5DC; --cdc-line: #9AA3AF; --cdc-soft: #1A1A1A; }
[data-contrast="yob"] { --cdc-fg: #FFE94D; --cdc-mute: #FFF2A6; }
[data-contrast] :is(.ex-banner, .ex-split, .ex-foot, .lp-bar, .x-start, .xbar, .wcols, .xfoot, .smain) { background: var(--cdc-bg) !important; color: var(--cdc-fg) !important; }
[data-contrast] :is(.ex-banner, .ex-split, .ex-foot, .lp-bar, .x-start, .xbar, .wcols, .xfoot, .smain) :where(*:not(img):not(svg):not(svg *):not(mark):not(.pen-el)) { color: inherit !important; background-color: transparent !important; border-color: var(--cdc-line) !important; box-shadow: none !important; }
[data-contrast] :is(.ex-split, .wcols, .smain) :is(input, select, textarea) { background-color: var(--cdc-bg) !important; color: var(--cdc-fg) !important; border-color: var(--cdc-fg) !important; }
[data-contrast] :is(.ex-split, .wcols, .smain) select option { background: var(--cdc-bg); color: var(--cdc-fg); }
[data-contrast] :is(.ex-split, .wcols, .smain) ::placeholder { color: var(--cdc-mute) !important; }
[data-contrast] :is(.ex-banner, .ex-split, .ex-foot, .lp-bar, .xbar, .wcols, .xfoot, .smain) :is(.q-instr, .ex-hint, .xh-sub, .meta, .pick-hint, .wc-row span, .micline, .help, .note-line, .passage-sub, .lp-count) { color: var(--cdc-mute) !important; }
[data-contrast] .question.current, [data-contrast] .foot-num.current, [data-contrast] .xtab[aria-pressed="true"], [data-contrast] .lp-chip.sel { outline: 2px solid var(--cdc-fg) !important; outline-offset: 1px; }
[data-contrast] .foot-num.answered, [data-contrast] .rv-num.answered, [data-contrast] .xtab.has-words { box-shadow: inset 0 -3px 0 var(--cdc-fg) !important; }
[data-contrast] .foot-num.right, [data-contrast] .question.correct, [data-contrast] .lp-chip.ok { border-color: #4ADE80 !important; color: #86EFAC !important; }
[data-contrast] .foot-num.bad, [data-contrast] .question.wrong, [data-contrast] .lp-chip:not(.ok) { border-color: #F87171 !important; }
[data-contrast] .question.correct .key { color: #86EFAC !important; }
[data-contrast] .question.wrong .key { color: #FCA5A5 !important; }
[data-contrast] .xf-btn.primary, [data-contrast] .xbtn.primary, [data-contrast] .lp-btn.main, [data-contrast] .lp-step[aria-pressed="true"] { background-color: var(--cdc-fg) !important; color: var(--cdc-bg) !important; border-color: var(--cdc-fg) !important; }
[data-contrast] .flag-btn[aria-pressed="true"], [data-contrast] .xf-flag[aria-pressed="true"] { border-color: #FDBA74 !important; color: #FDBA74 !important; }
[data-contrast] mark.hl { background: #FDE047 !important; color: #000000 !important; }
[data-contrast] mark.find { background: #7DD3FC !important; color: #000000 !important; }
[data-contrast] mark.ul:not(.hl):not(.find) { text-decoration-color: var(--cdc-fg) !important; }
[data-contrast] .ex-resizer button, [data-contrast] .pr-resizer button, [data-contrast] .sp-resizer button { background: var(--cdc-bg) !important; color: var(--cdc-fg) !important; border-color: var(--cdc-fg) !important; }
[data-contrast] .ex-resizer::before, [data-contrast] .sp-resizer::before { background: var(--cdc-line) !important; }
[data-contrast] .q-img, [data-contrast] .task-img { background: #FFFFFF !important; }
[data-contrast] .lp-s.on { background: #FDE047 !important; color: #000000 !important; }
@media (prefers-reduced-motion: reduce) { .xh.cd .ex-timer.last::before, .xh.cd .xh-time.last::before { animation: none; } }
