/* ==========================================================
   Computer-delivered IELTS — test interface
   Deliberately plain: Arial, white, black, grey, a single blue.
   This matches the look candidates see on test day.
   ========================================================== */
:root {
  --fs: 16px;
  --bg: #ffffff;
  --fg: #000000;
  --muted: #4b4b4b;
  --line: #c8c8c8;
  --panel: #f1f2f2;
  --panel-2: #e6e7e8;
  --blue: #3a6ea5;
  --blue-soft: #dce8f5;
  --hl: #ffe95c;
  --input-bg: #ffffff;
  --btn: #333333;
  --btn-fg: #ffffff;
  --header-h: 58px;
  --footer-h: 64px;
}
body.ts-l { --fs: 19px; }
body.ts-xl { --fs: 22px; }
body.ct-wob { --bg:#000; --fg:#fff; --muted:#ddd; --line:#777; --panel:#1a1a1a; --panel-2:#2a2a2a; --blue:#8fc1ff; --blue-soft:#1d3550; --input-bg:#000; --btn:#fff; --btn-fg:#000; --hl:#7a6a00; }
body.ct-yob { --bg:#000; --fg:#ffef00; --muted:#ffef00; --line:#8a8200; --panel:#111; --panel-2:#222; --blue:#ffef00; --blue-soft:#333000; --input-bg:#000; --btn:#ffef00; --btn-fg:#000; --hl:#5e5600; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: Arial, Helvetica, sans-serif; font-size: var(--fs); line-height: 1.5;
  display: flex; flex-direction: column; overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.cd-header {
  height: var(--header-h); flex: 0 0 var(--header-h);
  display: flex; align-items: center; gap: 22px; padding: 0 16px;
  border-bottom: 1px solid var(--line); background: var(--bg);
  font-size: 15px; position: relative; z-index: 20;
}
.cd-brand { display: flex; flex-direction: column; line-height: 1; }
.cd-logo { font-weight: 900; letter-spacing: .08em; font-size: 19px; color: #c8102e; }
body.ct-wob .cd-logo, body.ct-yob .cd-logo { color: var(--fg); }
.cd-logo-sub { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.cd-candidate { color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-timer { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-left: 8px; }
.cd-timer.warn { color: #c8102e; animation: blink 1s steps(2) infinite; }
body.ct-wob .cd-timer.warn, body.ct-yob .cd-timer.warn { color: var(--fg); }
@keyframes blink { 50% { opacity: .35; } }
.cd-audio { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.cd-audio .eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.cd-audio .eq i { width: 3px; background: var(--fg); animation: eq .9s ease-in-out infinite; }
.cd-audio .eq i:nth-child(2) { animation-delay: .2s } .cd-audio .eq i:nth-child(3) { animation-delay: .45s } .cd-audio .eq i:nth-child(4) { animation-delay: .1s }
.cd-audio.paused .eq i { animation-play-state: paused; }
@keyframes eq { 0%,100% { height: 3px } 50% { height: 14px } }
.cd-audio-ctrl button { border: 1px solid var(--line); background: var(--panel); padding: 2px 10px; font-size: 13px; margin-left: 4px; }
.cd-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.cd-icon { background: none; border: 0; padding: 4px; display: inline-flex; position: relative; color: var(--fg); }
.cd-icon .dot { position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: #c8102e; }
.cd-btn { background: var(--panel); border: 1px solid var(--line); padding: 5px 14px; font-size: 14px; }
.cd-btn:hover { background: var(--panel-2); }
.cd-volume { display: flex; align-items: center; gap: 6px; }
.cd-volume input { width: 90px; accent-color: var(--fg); }

.cd-menu {
  position: fixed; top: calc(var(--header-h) - 2px); right: 12px; z-index: 50;
  background: var(--bg); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.18);
  width: 240px; padding: 12px; font-size: 14px;
}
.cd-menu-title { font-weight: 700; margin-bottom: 8px; }
.cd-menu-group { margin-bottom: 12px; }
.cd-menu-group .lbl { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.cd-menu-group button { display: block; width: 100%; text-align: left; background: none; border: 1px solid transparent; padding: 5px 8px; }
.cd-menu-group button.on { border-color: var(--fg); font-weight: 700; }
.cd-menu-group button:hover { background: var(--panel); }
.cd-menu-exit { display: block; border-top: 1px solid var(--line); padding-top: 10px; color: var(--blue); }

/* ---------- main ---------- */
main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.part-header {
  margin: 14px 16px 0; padding: 10px 16px; background: var(--panel); border: 1px solid var(--line);
}
.part-header b { display: block; font-size: 1.05em; }
.part-header span { font-size: .95em; }

.split { flex: 1 1 auto; min-height: 0; display: flex; margin: 12px 16px 0; }
.pane { overflow: auto; min-width: 200px; padding: 6px 22px 40px 4px; }
.pane-left { flex: 0 0 50%; }
.pane-right { flex: 1 1 auto; padding-left: 22px; }
.single { flex: 1 1 auto; overflow: auto; padding: 8px 16px 48px; }
.single-inner { max-width: 980px; }

.divider { flex: 0 0 10px; position: relative; cursor: col-resize; background: transparent; }
.divider::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.divider .grip {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line);
  display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
body.dragging { user-select: none; cursor: col-resize; }

/* passage */
.passage h2 { font-size: 1.25em; margin: 6px 0 4px; }
.passage .sub { font-style: italic; color: var(--muted); margin: 0 0 14px; }
.passage p { margin: 0 0 14px; }
.passage .para-label { font-weight: 700; margin-right: 6px; }
.passage .para { position: relative; }

/* question area */
.qgroup { margin-bottom: 30px; }
.qgroup h3 { font-size: 1em; margin: 0 0 4px; }
.qgroup .instr { margin: 0 0 10px; }
.qgroup .instr b { font-weight: 700; }
.legend { border-collapse: collapse; margin: 6px 0 14px; font-size: .95em; }
.legend td { padding: 2px 16px 2px 0; vertical-align: top; }
.legend td:first-child { font-weight: 700; white-space: nowrap; }

.q { display: flex; gap: 10px; margin: 0 0 16px; padding: 6px 8px; border: 2px solid transparent; scroll-margin: 70px; }
.q.current { border-color: var(--blue); }
.qnum { font-weight: 700; min-width: 26px; }
.qbody { flex: 1; }
.qbody .stem { margin-bottom: 6px; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 5px 8px; margin: 2px 0; cursor: pointer; border: 1px solid transparent; }
.opt:hover { background: var(--panel); }
.opt input { margin-top: .3em; accent-color: var(--fg); width: 16px; height: 16px; flex: 0 0 auto; }
.opt.sel { background: var(--blue-soft); border-color: var(--blue); }
.opt .letter { font-weight: 700; min-width: 16px; }

/* gap-fill */
.gaptext { line-height: 2.3; }
.gaptext h4 { margin: 10px 0 2px; font-size: 1em; }
.gaptext ul { margin: 0 0 6px; padding-left: 22px; }
.notes-box { border: 1px solid var(--line); padding: 14px 20px; }
.notes-box .title { text-align: center; font-weight: 700; margin-bottom: 4px; }
input.gap {
  font: inherit; font-size: .95em; width: 150px; height: 1.9em; padding: 0 6px; text-align: center;
  border: 1px solid #8a8a8a; background: var(--input-bg); color: var(--fg); border-radius: 0;
  vertical-align: middle; scroll-margin: 90px;
}
input.gap::placeholder { color: var(--fg); font-weight: 700; opacity: 1; }
input.gap:focus::placeholder { color: transparent; }
input.gap:focus, select.qsel:focus { outline: 2px solid var(--blue); outline-offset: 0; }
select.qsel { font: inherit; font-size: .95em; padding: 3px 6px; min-width: 120px; border: 1px solid #8a8a8a; background: var(--input-bg); color: var(--fg); }

/* drag & drop */
.optbox { border: 1px solid var(--line); padding: 10px 12px; margin: 8px 0 14px; }
.optbox .ttl { font-weight: 700; margin-bottom: 6px; }
.chips { display: flex; flex-direction: column; gap: 6px; }
.chips.row { flex-direction: row; flex-wrap: wrap; }
.chip {
  border: 1px solid #8a8a8a; background: var(--bg); padding: 5px 10px; cursor: grab;
  user-select: none; transition: background .12s, box-shadow .12s;
}
.chip:hover { background: var(--panel); }
.chip.picked { outline: 2px solid var(--blue); background: var(--blue-soft); }
.chip.dragging { opacity: .4; }
.chip .rn { font-weight: 700; margin-right: 8px; }
.dropzone {
  display: inline-flex; align-items: center; gap: 8px; min-width: 190px; min-height: 2em; padding: 2px 8px;
  border: 1px dashed #8a8a8a; background: var(--bg); vertical-align: middle; scroll-margin: 90px;
}
.dropzone.block { display: flex; margin: 0 0 8px; min-height: 2.4em; }
.dropzone .ph { font-weight: 700; }
.dropzone.over { background: var(--blue-soft); border-color: var(--blue); border-style: solid; }
.dropzone.filled { border-style: solid; }
.dropzone.current { outline: 2px solid var(--blue); }
.dropzone .val { flex: 1; }
.dropzone .x { border: 0; background: none; font-size: 18px; line-height: 1; padding: 0 2px; color: var(--muted); }

/* highlights */
mark.hl { background: var(--hl); color: inherit; }
mark.hl.noted { border-bottom: 2px dotted var(--fg); cursor: pointer; }
.ctx { position: fixed; z-index: 80; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.2); display: flex; flex-direction: column; min-width: 130px; }
.ctx button { background: none; border: 0; text-align: left; padding: 7px 14px; font-size: 14px; }
.ctx button:hover { background: var(--panel); }
.note-pop { position: fixed; z-index: 81; width: 260px; background: #fff9c4; border: 1px solid #c9b800; box-shadow: 0 6px 18px rgba(0,0,0,.2); color: #000; }
.note-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; font-size: 13px; font-weight: 700; border-bottom: 1px solid #e0d36a; }
.note-head button { border: 0; background: none; font-size: 18px; }
.note-pop textarea { width: 100%; height: 110px; border: 0; background: transparent; resize: vertical; padding: 8px; font: 14px Arial, sans-serif; }

/* writing */
.task-prompt .box { border: 1px solid var(--line); padding: 14px 18px; margin: 10px 0; }
.task-prompt .chart { margin: 12px 0; }
.write-area { display: flex; flex-direction: column; height: 100%; }
.write-area textarea {
  flex: 1 1 auto; min-height: 320px; width: 100%; resize: none; padding: 12px; font: inherit; line-height: 1.6;
  border: 1px solid #8a8a8a; background: var(--input-bg); color: var(--fg);
}
.write-area textarea:focus { outline: 2px solid var(--blue); }
.wordcount { text-align: right; padding: 6px 2px; font-size: .9em; color: var(--muted); }

/* ---------- footer nav ---------- */
.cd-footer {
  flex: 0 0 var(--footer-h); height: var(--footer-h); border-top: 1px solid var(--line); background: var(--bg);
  display: flex; align-items: center; gap: 14px; padding: 0 14px; font-size: 14px; z-index: 10;
}
.cd-review { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.cd-review input { accent-color: var(--fg); }
.cd-nav { flex: 1; display: flex; align-items: center; gap: 6px; overflow-x: auto; min-width: 0; }
.ptab { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid transparent; background: none; white-space: nowrap; }
.ptab .pl { font-weight: 700; margin-right: 6px; }
.ptab.collapsed { color: var(--muted); }
.ptab.collapsed:hover { background: var(--panel); }
.ptab.collapsed .cnt { margin-left: 4px; }
.ptab.active { background: var(--panel); border-color: var(--line); }
.qbtn {
  width: 28px; height: 28px; border: 1px solid transparent; background: none; font-size: 13px; position: relative;
  display: inline-grid; place-items: center; padding: 0;
}
.qbtn:hover { border-color: var(--line); }
.qbtn.answered::after { content: ""; position: absolute; left: 5px; right: 5px; bottom: 1px; height: 3px; background: var(--fg); }
.qbtn.current { border: 2px solid var(--blue); font-weight: 700; }
.qbtn.review { border-radius: 50%; border: 2px dashed var(--fg); }
.qbtn.review.current { border-style: solid; border-color: var(--blue); }
.cd-arrows { display: flex; gap: 6px; }
.cd-arrow, .cd-submit {
  width: 46px; height: 42px; border: 0; background: var(--btn); color: var(--btn-fg); display: grid; place-items: center;
}
.cd-arrow:hover, .cd-submit:hover { opacity: .85; }
.cd-arrow:disabled { opacity: .3; cursor: default; }
.cd-submit { background: var(--panel-2); color: var(--fg); border: 1px solid var(--line); margin-left: 8px; }

/* ---------- pre-test screens ---------- */
.screen { flex: 1; overflow: auto; display: flex; justify-content: center; padding: 34px 16px; }
.screen-box { width: 100%; max-width: 760px; }
.screen-box h1 { font-size: 1.5em; margin: 0 0 18px; }
.screen-box h2 { font-size: 1.05em; margin: 22px 0 6px; text-transform: uppercase; letter-spacing: .02em; }
.screen-box ul { padding-left: 22px; margin: 4px 0; }
.details { background: var(--panel); border: 1px solid var(--line); padding: 18px 22px; margin-bottom: 18px; }
.details div { display: flex; gap: 16px; padding: 4px 0; }
.details dt, .details .k { width: 170px; font-weight: 700; }
.info-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-left: 4px solid var(--blue); background: var(--blue-soft); margin: 14px 0; }
.cd-primary { background: var(--btn); color: var(--btn-fg); border: 0; padding: 11px 26px; font-weight: 700; margin-top: 18px; }
.cd-primary:hover { opacity: .88; }
.cd-secondary { background: var(--panel); border: 1px solid var(--line); padding: 10px 20px; margin-top: 18px; margin-right: 8px; }
.inline-field { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.inline-field input { font: inherit; padding: 6px 8px; border: 1px solid #8a8a8a; }
.mode-pill { display: inline-block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border: 1px solid var(--fg); margin-left: 8px; vertical-align: middle; }

/* ---------- speaking ---------- */
.spk { flex: 1; overflow: auto; display: grid; grid-template-columns: 300px 1fr; min-height: 0; }
.spk-side { border-right: 1px solid var(--line); padding: 18px; overflow: auto; }
.spk-side ol { list-style: none; padding: 0; margin: 0; }
.spk-side li { padding: 8px 10px; border-left: 3px solid transparent; color: var(--muted); font-size: .92em; }
.spk-side li.done { color: var(--fg); }
.spk-side li.done::before { content: "✓ "; }
.spk-side li.now { border-left-color: var(--blue); background: var(--blue-soft); color: var(--fg); font-weight: 700; }
.spk-main { padding: 26px 34px; overflow: auto; }
.examiner { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.examiner .av { width: 58px; height: 58px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; position: relative; }
.examiner .av.talking::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--blue); animation: pulse 1.1s ease-out infinite; }
@keyframes pulse { from { transform: scale(.9); opacity: 1 } to { transform: scale(1.25); opacity: 0 } }
.bubble { border: 1px solid var(--line); padding: 14px 18px; background: var(--panel); font-size: 1.1em; max-width: 720px; }
.cue-card { border: 2px solid var(--fg); padding: 18px 24px; max-width: 560px; margin: 16px 0; }
.cue-card h3 { margin: 0 0 8px; }
.cue-card ul { margin: 6px 0 10px; }
.rec-bar { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: #c8102e; animation: blink 1s steps(2) infinite; }
.level { width: 180px; height: 8px; background: var(--panel-2); position: relative; overflow: hidden; }
.level i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--fg); width: 0; transition: width .08s; }
.big-count { font-size: 2.4em; font-weight: 700; font-variant-numeric: tabular-nums; }
.prep-notes { width: 100%; max-width: 560px; height: 140px; font: inherit; padding: 10px; border: 1px solid #8a8a8a; background: var(--input-bg); color: var(--fg); }
.recs audio { display: block; margin: 4px 0 14px; width: 100%; max-width: 520px; }

/* ---------- misc overlays ---------- */
.cd-hidden-screen { position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg); z-index: 60; display: grid; place-items: center; text-align: center; }
.cd-modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90; display: grid; place-items: center; }
.cd-modal-box { background: var(--bg); border: 1px solid var(--line); width: min(520px, 92vw); padding: 22px 26px; }
.cd-modal-box h2 { margin: 0 0 10px; font-size: 1.15em; }
.cd-modal-box .actions { display: flex; justify-content: flex-end; gap: 8px; }
.cd-toast { position: fixed; top: calc(var(--header-h) + 10px); right: 16px; z-index: 70; background: var(--bg); border: 1px solid var(--line); border-left: 5px solid var(--blue); padding: 12px 16px; box-shadow: 0 6px 18px rgba(0,0,0,.15); max-width: 340px; font-size: 14px; }
.review-band { margin: 0 16px; padding: 8px 14px; background: var(--blue-soft); border: 1px solid var(--blue); font-weight: 700; }
.transcript { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 14px; font-size: .92em; color: var(--muted); }
.transcript summary { cursor: pointer; font-weight: 700; color: var(--fg); }

@media (max-width: 820px) {
  .cd-candidate, .cd-logo-sub { display: none; }
  .split { flex-direction: column; }
  .pane-left { flex: 0 0 auto; max-height: 45%; border-bottom: 1px solid var(--line); }
  .divider { display: none; }
  .spk { grid-template-columns: 1fr; }
  .spk-side { display: none; }
}

/* ---- converted VisaHouse bank content ---- */
.notes-box h4 { text-align: center; margin: 0 0 10px; font-size: 1em; }
.qtable { border-collapse: collapse; width: 100%; margin: 4px 0; }
.qtable th, .qtable td { border: 1px solid #8a8a8a; padding: 7px 10px; text-align: left; vertical-align: top; line-height: 1.9; }
.qtable th { background: #f1f1f1; font-weight: 700; }
.label-inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 20px; }
.label-inputs p { margin: 4px 0; }
.ending-stem { margin: 10px 0; line-height: 2.1; }
.qimage { margin: 6px 0 14px; }
.qimage img, .task-prompt .chart img { max-width: 100%; height: auto; border: 1px solid #d0d0d0; background: #fff; display: block; }
.passage .foot { font-size: .85em; color: #555; border-top: 1px solid #ccc; padding-top: 8px; margin-top: 18px; }
body.ct-wob .qtable th, body.ct-yob .qtable th { background: #222; }
body.ct-wob .qimage img, body.ct-yob .qimage img, body.ct-wob .task-prompt .chart img, body.ct-yob .task-prompt .chart img { filter: invert(1) hue-rotate(180deg); }
