/* The real-test environment for TOEFL, CELPIP, PTE, Duolingo, OET and TOEIC practice (assets/js/exam-env.js, phase 31).
 * One full-screen layout; each test gets its own colours and button places (.xe-toefl, .xe-pte …), as in the real test. */
html.xe-on, html.xe-on body { overflow: hidden !important; }
.xe { --bar: #ffffff; --bar-ink: #1f2937; --bar-line: #d1d5db; --bg: #ffffff; --ink: #1f2937; --muted: #5b6474; --btn: #1d4ed8; --btn-ink: #fff; --pane: #f8fafc; --accent: #1d4ed8;
  position: fixed; inset: 0; z-index: 2147483000; display: flex; flex-direction: column; background: var(--bg); color: var(--ink);
  font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.55; }
.xe *, .xe *::before, .xe *::after { box-sizing: border-box; }
.xe [hidden] { display: none !important; }
.xe .ex-ms { font-family: 'Material Symbols Outlined'; font-size: 1.2rem; line-height: 1; font-weight: normal; font-style: normal; vertical-align: middle; }
.xe-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding: .5rem 1rem; background: var(--bar); color: var(--bar-ink); border-bottom: 1px solid var(--bar-line); }
.xe-brand { display: grid; line-height: 1.2; min-width: 0; }
.xe-brand b { font-size: 1.05rem; }
.xe-brand span { font-size: .8rem; opacity: .8; }
.xe-tools { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-left: auto; }
.xe-tool { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid currentColor; background: transparent; color: inherit; border-radius: 6px; padding: .3rem .55rem; font: inherit; font-size: .85rem; cursor: pointer; opacity: .9; }
.xe-tool[aria-pressed="true"] { background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 2px currentColor; opacity: 1; }
.xe-count { font-size: .85rem; font-weight: 700; white-space: nowrap; }
.xe-clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .95rem; padding: .25rem .55rem; border-radius: 6px; background: rgba(0, 0, 0, .06); white-space: nowrap; }
.xe-clock.off { visibility: hidden; width: 0; padding: 0; overflow: hidden; }
.xe-clock.low { color: #b91c1c; background: #fee2e2; }
.xe-nav { border: 0; border-radius: 6px; padding: .5rem 1.3rem; font: inherit; font-weight: 700; background: var(--btn); color: var(--btn-ink); cursor: pointer; min-height: 40px; }
.xe-nav[data-back] { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.xe-nav:disabled { opacity: .45; cursor: default; }
.xe-main { flex: 1; display: flex; min-height: 0; overflow: auto; position: relative; }
.xe-screen { flex: 1; min-width: 0; padding: 1.2rem 1.4rem 2rem; }
.xe-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem 1rem; border-top: 1px solid var(--bar-line); background: var(--bar); color: var(--bar-ink); }
.xe-type { margin: 0 0 .7rem; font-weight: 700; color: var(--muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .03em; }
.xe-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.xe-pane { min-width: 0; }
.xe-text { background: var(--pane); border: 1px solid var(--bar-line); border-radius: 8px; padding: 1rem 1.1rem; max-height: calc(100vh - 170px); overflow: auto; white-space: normal; }
.xe-single { max-width: 820px; margin: 0 auto; }
.xe-stem { margin: 0 0 .7rem; font-weight: 600; }
.xe-n { display: inline-grid; place-items: center; min-width: 1.7rem; height: 1.7rem; margin-right: .5rem; border-radius: 4px; background: var(--accent); color: #fff; font-size: .85rem; font-weight: 700; vertical-align: 1px; }
.xe-q { padding: .8rem 0 1rem; border-bottom: 1px solid #e5e7eb; }
.xe-q:last-child { border-bottom: 0; }
.xe-opts { display: grid; gap: .45rem; }
.xe-opt { display: flex; align-items: flex-start; gap: .6rem; padding: .55rem .7rem; border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer; background: #fff; }
.xe-opt:hover { border-color: var(--accent); }
.xe-opt input { margin-top: .3rem; accent-color: var(--accent); }
.xe-opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: color-mix(in srgb, var(--accent) 7%, #fff); }
.xe-l { font-weight: 700; min-width: 1.1rem; }
.xe-gap { width: 100%; max-width: 420px; padding: .6rem .75rem; border: 1px solid #9ca3af; border-radius: 6px; font: inherit; }
.xe-write { width: 100%; min-height: 320px; height: calc(100vh - 250px); max-height: 640px; padding: .8rem .9rem; border: 1px solid #9ca3af; border-radius: 6px; font: inherit; resize: vertical; }
.xe-write.short { min-height: 140px; height: 160px; }
.xe-material { white-space: normal; margin-bottom: .9rem; padding-bottom: .8rem; border-bottom: 1px dashed #cbd5e1; }
.xe-pic { margin: 0 0 1rem; text-align: center; }
.xe-pic img { max-width: 100%; max-height: 52vh; border-radius: 6px; border: 1px solid #e5e7eb; background: #fff; }
.xe-audio { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .7rem .9rem; margin-bottom: 1rem; border: 1px solid var(--bar-line); border-radius: 8px; background: #fff; }
.xe-prog { flex: 1 1 160px; height: 8px; border-radius: 4px; background: #e5e7eb; overflow: hidden; }
.xe-prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s linear; }
.xe-at { font-size: .85rem; color: var(--muted); }
.xe-wait > .xe-q { display: none; }
.xe-waitmsg { display: none; }
.xe-wait > .xe-waitmsg { display: block; }
.xe-rec { border: 1px solid var(--bar-line); border-radius: 8px; padding: 1rem; background: #fff; display: grid; gap: .6rem; }
.xe-rec-h { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; }
.xe-rec-h .ex-ms { color: var(--accent); font-size: 1.5rem; }
.xe-rec-t { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.xe-level { height: 10px; border-radius: 5px; background: #e5e7eb; overflow: hidden; }
.xe-level i { display: block; height: 100%; width: 0; background: #16a34a; transition: width .08s; }
.xe-notes { flex: 0 0 300px; display: flex; flex-direction: column; border-left: 1px solid var(--bar-line); background: #fffbea; position: sticky; top: 0; max-height: 100%; }
.xe-notes[hidden] { display: none; }
.xe-notes-h { display: flex; align-items: center; justify-content: space-between; padding: .5rem .7rem; border-bottom: 1px solid #f1e3a4; }
.xe-notes textarea { flex: 1; border: 0; background: transparent; padding: .7rem; font: inherit; resize: none; min-height: 240px; outline: none; }
.xe-hl [data-annotate] { cursor: text; }
.xe-hl [data-annotate]::selection, .xe-hl [data-annotate] *::selection { background: #fde68a; }
.xe-mark { background: #fde047; color: inherit; padding: 0 1px; border-radius: 2px; }
.xe-hl .xe-mark { cursor: pointer; }
.xe-rules { max-width: 760px; margin: 0 auto; }
.xe-rules h2 { margin: .2rem 0 .8rem; font-size: 1.4rem; }
.xe-rules ul { padding-left: 1.2rem; display: grid; gap: .45rem; }
.xe-note { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: .6rem .8rem; }
.xe-mic { display: grid; gap: .5rem; margin: 1rem 0; padding: .8rem; border: 1px dashed #9ca3af; border-radius: 8px; max-width: 460px; }
.xe-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.xe-btn { display: inline-flex; align-items: center; gap: .35rem; border: 0; border-radius: 6px; padding: .65rem 1.2rem; font: inherit; font-weight: 700; background: var(--btn); color: var(--btn-ink); cursor: pointer; min-height: 42px; }
.xe-btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px #9ca3af; }
.xe-btn.small { padding: .4rem .8rem; min-height: 36px; font-size: .9rem; }
.xe-btn:disabled { opacity: .5; cursor: default; }
.xe-small { font-size: .85rem; color: var(--muted); margin: 0; }
.xe-err { color: #b91c1c; font-weight: 600; min-height: 1em; }
.xe-modal { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); display: grid; place-items: center; padding: 1rem; z-index: 5; }
.xe-modal[hidden] { display: none; }
.xe-box { background: #fff; color: #1f2937; border-radius: 10px; max-width: 460px; width: 100%; padding: 1.2rem 1.3rem; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.xe-box p { margin: 0; }
.xe-box .xe-row { justify-content: flex-end; }
.xe:fullscreen { background: var(--bg); }

/* TOEFL iBT: white bar, blue buttons top right */
.xe-toefl { --bar: #ffffff; --bar-ink: #0f2a4a; --btn: #1a5b96; --accent: #1a5b96; --pane: #f7f9fc; }
.xe-toefl .xe-bar { border-bottom: 3px solid #1a5b96; }
/* PTE Academic: dark top bar, grey content, Next in a grey bar at the bottom */
.xe-pte { --bar: #3d4249; --bar-ink: #fff; --bar-line: #c4c7cc; --bg: #eef0f2; --btn: #4a6f9d; --accent: #2f5d8f; --pane: #ffffff; }
.xe-pte .xe-foot { background: #d5d8dc; color: #1f2937; }
.xe-pte .xe-screen { background: #fff; margin: .8rem; border: 1px solid #c4c7cc; border-radius: 2px; }
/* CELPIP: a white page header, then a centred test window: grey title bar ("Practice Test – Listening Part 6: …",
   "Time remaining: 4 minutes", a small blue NEXT), a white or pale mint work area, a grey bottom bar with BACK.
   Blue instruction lines with an (i), a part introduction, a grey player box, answers in drop-down menus. */
.xe-celpip { --bar: linear-gradient(#f8f8f8, #dedfe0); --bar-ink: #3a3a3a; --bar-line: #c8cacc; --bg: #eeeff0; --ink: #333; --muted: #666;
  --btn: #2f6eaa; --btn-ink: #fff; --accent: #2f6eaa; --pane: #ffffff; --cblue: #23629f; --clight: #3e9be0; font-size: 15px; }
.xe-page { flex: none; display: flex; align-items: center; gap: 1.6rem; padding: .7rem 1.6rem; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); margin-bottom: 1rem; }
.xe-logo { font-size: 1.55rem; font-weight: 800; letter-spacing: .14em; color: #2b2b2b; }
.xe-page > span { color: #666; font-size: .9rem; }
.xe-page .xe-who { margin-left: auto; font-size: .75rem; font-weight: 700; text-transform: uppercase; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.xe-celpip > .xe-bar, .xe-celpip > .xe-main, .xe-celpip > .xe-foot { width: min(1060px, calc(100% - 2rem)); margin-inline: auto; }
.xe-celpip > .xe-bar { border: 1px solid var(--bar-line); padding: .45rem .8rem; flex-wrap: nowrap; }
.xe-celpip .xe-brand b { font-size: .95rem; font-weight: 700; color: #444; }
.xe-celpip .xe-count, .xe-celpip .xe-hide { display: none; }
.xe-celpip .xe-clock { background: none; font-weight: 400; color: #555; font-size: .85rem; padding: 0 .3rem; }
.xe-celpip .xe-clock.low { background: none; color: #b91c1c; }
.xe-celpip .xe-nav { min-height: 28px; padding: .3rem 1rem; border-radius: 2px; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; background: var(--btn); color: #fff; box-shadow: inset 0 0 0 1px #1e5285; }
.xe-celpip .xe-nav[data-back] { background: var(--btn); color: #fff; }
.xe-celpip > .xe-main { background: #fff; border-inline: 1px solid var(--bar-line); }
.xe-celpip.xe-mint > .xe-main { background: #e9f5f3; }
.xe-celpip > .xe-foot { border: 1px solid var(--bar-line); background: linear-gradient(#e9e9ea, #d7d8d9); color: #333; margin-bottom: 1rem; }
.xe-celpip > .xe-foot .xe-tools { margin-left: 0; }
.xe-celpip > .xe-foot .xe-tool { background: #fff; border: 1px solid #b5b8bb; border-radius: 2px; color: #333; font-size: .8rem; }
.xe-celpip .xe-tool[aria-pressed="true"] { background: #dbe9f6; box-shadow: none; }
.xe-celpip .xe-screen { padding: 1.1rem 1.4rem 2rem; }
.xe-celpip .xe-type { display: none; }
.xe-celpip .xe-rules h2 { color: var(--cblue); font-size: 1.15rem; }
.xe-celpip .xe-rules ul, .xe-cintro ul { list-style: none; padding: 0; margin: 0; gap: 0; }
.xe-celpip .xe-rules li, .xe-cintro li { position: relative; padding: .6rem 0 .6rem 1.7rem; border-bottom: 1px solid #e2e4e6; color: var(--cblue); font-weight: 700; font-size: .92rem; }
.xe-celpip .xe-rules li::before, .xe-cintro li::before { content: '•'; position: absolute; left: .55rem; color: #8a8f94; }
.xe-celpip .xe-rules li b { color: var(--clight); }
.xe-cintro { max-width: 720px; padding: .4rem .2rem; }
.xe-cintro h3 { margin: 0 0 .5rem; font-size: 1rem; color: #222; }
.xe-cinfo { display: flex; align-items: flex-start; gap: .45rem; margin: 0 0 1.3rem; color: var(--cblue); font-weight: 700; font-size: 1rem; }
.xe-cinfo .ex-ms { color: var(--cblue); font-variation-settings: 'FILL' 1; font-size: 1.25rem; margin-top: .05rem; }
.xe-cinfo em { font-style: normal; color: var(--clight); }
.xe-tri { font-size: .6em; vertical-align: .15em; }
.xe-cplayer { display: flex; align-items: center; gap: 1rem; width: min(430px, 100%); margin: 2.2rem auto 1rem; padding: .7rem; background: #dfe1e3; border-radius: 6px; }
.xe-cspk { display: grid; place-items: center; width: 64px; height: 64px; flex: none; background: #eef0f1; border-radius: 4px; }
.xe-cspk .ex-ms { font-size: 2.4rem; color: #9aa0a6; }
.xe-cpl { flex: 1; display: grid; gap: .45rem; text-align: center; }
.xe-cpl b { font-size: .95rem; color: #333; font-weight: 700; }
.xe-cpl .xe-prog { flex: none; height: 10px; border-radius: 2px; background: #fff; }
.xe-cpl .xe-prog i { background: #1fb3e6; }
.xe-clist { max-width: 900px; }
.xe-cq { margin: 0 0 .5rem; }
.xe-cq p { margin: 0 0 .65rem; font-size: .92rem; color: #333; line-height: 2; }
.xe-cq .xe-pic { text-align: left; }
.xe-cn { margin-right: .15rem; }
.xe-csplit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.xe-celpip .xe-text { background: #fff; border-color: #d4d8db; border-radius: 2px; font-size: .92rem; }
.xe-celpip .xe-gap { display: inline-block; width: auto; min-width: 10rem; padding: .15rem .45rem; border-radius: 2px; border-color: #b9c3c9; font-size: .92rem; }
.xe-dd { position: relative; display: inline-block; vertical-align: middle; max-width: 100%; line-height: 1.4; }
.xe-dd-b { display: inline-flex; align-items: center; justify-content: space-between; gap: .6rem; min-width: 5.6rem; max-width: 100%; min-height: 24px; padding: .1rem .45rem; background: #fff; border: 1px solid #b9c3c9; border-radius: 2px; font: inherit; font-size: .9rem; color: #222; text-align: left; cursor: pointer; }
.xe-dd-b:focus-visible { outline: 2px solid var(--clight); outline-offset: 1px; }
.xe-dd-v { font-weight: 700; color: #1f2d3a; white-space: normal; }
.xe-dd-b .xe-tri { font-size: .65rem; color: #333; vertical-align: 0; }
.xe-dd-m { position: absolute; left: 0; top: calc(100% + 4px); z-index: 4; display: grid; width: max-content; max-width: min(470px, 80vw); padding: .45rem .7rem; background: #fff; border: 1px solid #b9c3c9; border-radius: 4px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.xe-dd-m[hidden] { display: none; }
.xe-dd-m label { display: flex; align-items: flex-start; gap: .5rem; padding: .35rem .2rem; border-bottom: 1px solid #ececec; font-size: .86rem; line-height: 1.4; cursor: pointer; }
.xe-dd-m label:last-child { border-bottom: 0; }
.xe-dd-m label:hover { background: #f1f7fb; }
.xe-dd-m input { margin-top: .15rem; accent-color: var(--cblue); }
.xe-celpip .xe-rec { border-color: #c9cdd0; border-radius: 4px; }
/* Duolingo English Test: clean white, one centred question, a big green Next at the bottom */
.xe-duolingo { --bar: #ffffff; --bar-ink: #3c3c3c; --btn: #58a700; --accent: #58a700; --pane: #f7f7f7; font-size: 17px; }
.xe-duolingo .xe-screen { max-width: 900px; margin: 0 auto; width: 100%; }
.xe-duolingo .xe-nav, .xe-duolingo .xe-btn { border-radius: 14px; box-shadow: 0 4px 0 #3f7a00; text-transform: uppercase; letter-spacing: .05em; }
.xe-duolingo .xe-btn.ghost, .xe-duolingo .xe-nav[data-back] { box-shadow: inset 0 0 0 2px #d1d5db; }
.xe-duolingo .xe-opt { border-width: 2px; border-radius: 12px; }
/* OET: purple bar */
.xe-oet { --bar: #3f2a6e; --bar-ink: #fff; --btn: #3f2a6e; --accent: #5b3fa0; --pane: #faf8ff; }
.xe-oet .xe-foot { background: #f4f1fb; color: #1f2937; }
/* TOEIC: navy bar, grey footer */
.xe-toeic { --bar: #21386b; --bar-ink: #fff; --btn: #21386b; --accent: #21386b; --pane: #f5f7fb; }
.xe-toeic .xe-foot { background: #e9edf5; color: #1f2937; }

@media (max-width: 820px) {
  .xe-split { grid-template-columns: 1fr; }
  .xe-text { max-height: none; }
  .xe-screen { padding: .9rem .9rem 1.6rem; }
  .xe-pte .xe-screen { margin: .5rem; }
  .xe-notes { position: absolute; right: 0; top: 0; bottom: 0; width: min(88vw, 320px); box-shadow: -8px 0 24px rgba(0, 0, 0, .2); z-index: 3; }
  .xe-tool span:last-child:not(.ex-ms) { display: none; }
  .xe-tool { padding: .3rem .4rem; }
  .xe-write { height: 42vh; min-height: 200px; }
  .xe-brand span { display: none; }
  .xe-page { padding: .5rem .8rem; gap: .8rem; margin-bottom: 0; }
  .xe-logo { font-size: 1.15rem; }
  .xe-page > span:not(.xe-who) { display: none; }
  .xe-celpip > .xe-bar, .xe-celpip > .xe-main, .xe-celpip > .xe-foot { width: 100%; }
  .xe-celpip > .xe-foot { margin-bottom: 0; }
  .xe-celpip .xe-brand b { font-size: .82rem; }
  .xe-csplit { grid-template-columns: 1fr; }
  .xe-celpip .xe-screen { padding: .9rem .9rem 1.6rem; }
  .xe-dd { display: block; margin-top: .25rem; }
  .xe-dd-b { width: 100%; }
  .xe-dd-m { width: 100%; max-width: none; }
}
@media (max-width: 420px) {
  .xe-bar { padding: .4rem .6rem; }
  .xe-count { font-size: .78rem; }
  .xe-nav { padding: .45rem .9rem; }
}
