/* ==========================================================
   Etude World – CELPIP practice pages + test screen
   ========================================================== */

/* ---------- Hub / list pages ---------- */
.celpip-hero { padding: 48px 0 40px; background: radial-gradient(900px 380px at 90% 0%, rgba(15,157,138,.12), transparent 60%), radial-gradient(700px 300px at 0% 100%, rgba(47,107,255,.08), transparent 60%), var(--tint); }
.celpip-hero--sm { padding: 40px 0 32px; }
.celpip-hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -.02em; }
.celpip-hero .lead { max-width: 720px; }
.celpip-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.celpip-jump a { padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: .9rem; color: var(--navy); }
.celpip-jump a:hover { border-color: var(--primary); color: var(--primary); }

.celpip-section { padding: 56px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 72px; }
.celpip-section--mock { background: linear-gradient(180deg, #fff, #f8fafe); }
.celpip-section__head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 28px; }
.celpip-section__head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; margin-bottom: 6px; }
.celpip-section__head p { color: var(--muted); max-width: 680px; margin: 0; }
.celpip-section__head .eyebrow { margin-bottom: 8px; }
.celpip-section__icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0; background: var(--primary); color: #fff; }
.celpip-section__icon .icon { width: 28px; height: 28px; }
.celpip-section--mock .celpip-section__icon { background: linear-gradient(135deg, var(--navy), var(--primary)); }
.celpip-section--reading .celpip-section__icon { background: #0f9d8a; }
.celpip-section--listening .celpip-section__icon { background: #2f6bff; }
.celpip-section--writing .celpip-section__icon { background: #7b3fe4; }
.celpip-section--speaking .celpip-section__icon { background: #ff8a3d; }
.celpip-section__btn { margin-left: auto; flex-shrink: 0; white-space: nowrap; }
.muted-inline { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.celpip-empty { padding: 28px; border: 2px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); background: #fff; }
.section--compact { padding: 36px 0 80px; }

.celpip-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.celpip-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-weight: 600; color: var(--navy); }
.celpip-tabs a:hover { border-color: var(--primary); color: var(--primary); }
.celpip-tabs a.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.celpip-tabs .icon, .test-card .icon, .btn-test .icon, .pill .icon { width: 18px; height: 18px; }

/* ---------- Test cards ---------- */
.test-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.test-card {
    position: relative; display: flex; flex-direction: column; gap: 10px;
    background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px;
    border-top: 4px solid var(--primary); transition: transform .2s, box-shadow .2s;
}
.test-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.test-card--mock { border-top-color: var(--navy); }
.test-card--reading { border-top-color: #0f9d8a; }
.test-card--writing { border-top-color: #7b3fe4; }
.test-card--speaking { border-top-color: #ff8a3d; }
.test-card__top { display: flex; align-items: center; gap: 8px; }
.test-card__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--tint); color: var(--navy); margin-right: auto; }
.test-card__title { font-size: 1.12rem; margin: 4px 0 0; }
.test-card__meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .88rem; margin: 0; }
.test-card__modules { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.test-card__modules li { font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #f1f3f8; color: #8a93a6; }
.test-card__modules li.is-ready { background: #e3f6ea; color: #12a150; }
.test-card__modules li.is-ready::before { content: "✓ "; }
.test-card__foot { margin-top: auto; padding-top: 8px; }
.test-card.is-locked .test-card__title { color: #4a5468; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pill--free { background: #e3f6ea; color: #12a150; }
.pill--premium { background: #fff3dc; color: #a86200; }
.pill--draft { background: #eef0f4; color: #5b6478; }
.pill--soon { background: #eef0f4; color: #5b6478; }
.pill .icon { width: 13px; height: 13px; }

.btn-test { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px 16px; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 700; transition: background .15s; }
.btn-test:hover { background: var(--primary-dark); }
.btn-test--locked { background: #fff7e8; color: #a86200; border: 1px solid #f5d9a6; }
.btn-test--locked:hover { background: #ffefd2; }
.btn-test--soon { background: #f1f3f8; color: #8a93a6; cursor: default; }

/* ---------- Locked / coming soon ---------- */
.gate { min-height: 60vh; display: grid; place-items: center; padding: 64px 20px; background: var(--tint); }
.gate__card { max-width: 540px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 44px 36px; box-shadow: var(--shadow-lg); }
.gate__card h1 { font-size: 1.7rem; margin: 14px 0 10px; }
.gate__card p { color: var(--muted); }
.gate__icon { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 16px; display: grid; place-items: center; background: #fff3dc; color: #d98300; }
.gate__icon .icon { width: 34px; height: 34px; }
.gate__icon--soon { background: var(--tint); color: var(--primary); }
.gate__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ==========================================================
   Test screen
   ========================================================== */
.exam-body { background: #eef2f8; min-height: 100vh; }
.exam-bar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px;
    height: 64px; padding: 0 24px; background: var(--navy); color: #fff;
}
.exam-bar__brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1.05rem; color: #fff; }
.exam-bar__brand strong { color: var(--accent); }
.exam-bar__title { display: flex; flex-direction: column; line-height: 1.2; padding-left: 18px; border-left: 1px solid rgba(255,255,255,.18); min-width: 0; }
.exam-bar__title strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-bar__title span { font-size: .8rem; color: #aab5ce; }
.exam-progress { list-style: none; margin: 0 auto; padding: 0; display: flex; gap: 6px; }
.exam-progress li { font-size: .78rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); color: #aab5ce; }
.exam-progress li.is-current { background: var(--primary); color: #fff; }
.exam-progress li.is-done { background: rgba(18,161,80,.25); color: #8ff0b6; }
.exam-progress li.is-done::before { content: "✓ "; }
.exam-timer { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; background: rgba(255,255,255,.1); font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.exam-progress + .exam-timer, .exam-timer:first-of-type { margin-left: auto; }
.exam-bar__title + .exam-timer { margin-left: auto; }
.exam-timer .icon { width: 18px; height: 18px; }
.exam-timer.is-warning { background: #ffb020; color: #3d2a00; }
.exam-timer.is-danger { background: #d7263d; color: #fff; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .75; } }
.exam-bar__exit { color: #c8d1e6; font-weight: 600; font-size: .9rem; padding: 8px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.2); }
.exam-bar__exit:hover { background: rgba(255,255,255,.1); color: #fff; }
/* Exit always sits at the far right of the top bar (right after the timer when a timer is showing) */
.exam-bar__exit { margin-left: auto; }
.exam-timer:not([hidden]) + .exam-bar__exit { margin-left: 0; }

.exam-main { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; }
.exam-step--center { display: grid; place-items: center; min-height: calc(100vh - 160px); }
.exam-step[hidden] { display: none !important; }

.exam-intro { max-width: 640px; width: 100%; background: #fff; border-radius: 24px; padding: 40px; box-shadow: var(--shadow-lg); text-align: center; }
.exam-intro h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 14px 0 10px; }
.exam-intro h2 { font-size: 1.8rem; margin: 6px 0 10px; }
.exam-intro p { color: var(--muted); }
.exam-intro .btn-lg, .btn-lg { padding: 16px 32px; font-size: 1.05rem; margin-top: 10px; }
.exam-intro .btn .icon { width: 20px; height: 20px; }
.exam-plan { list-style: none; padding: 0; margin: 24px 0; text-align: left; display: grid; gap: 10px; }
.exam-plan li { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; }
.exam-plan li div { display: flex; flex-direction: column; margin-right: auto; }
.exam-plan li small { color: var(--muted); }
.exam-plan li.is-soon { opacity: .65; }
.exam-plan__icon { width: 38px; height: 38px; border-radius: 10px; background: var(--tint); color: var(--primary); display: grid; place-items: center; }
.exam-plan__icon .icon { width: 20px; height: 20px; }
.exam-tips { text-align: left; color: #4a5468; font-size: .92rem; background: var(--tint); border-radius: 14px; padding: 14px 18px 14px 34px; margin: 0 0 22px; }
.exam-tips li { margin: 4px 0; }
.exam-restored { margin-top: 16px; font-size: .9rem; color: #0b6b35 !important; }
.link-btn { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; padding: 0; }
.exam-section-num { font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); }
.exam-intro__icon { width: 76px; height: 76px; margin: 16px auto 4px; border-radius: 22px; display: grid; place-items: center; background: var(--tint); color: var(--primary); }
.exam-intro__icon .icon { width: 36px; height: 36px; }
.exam-intro__icon--done { background: #fff3dc; color: #e08a00; }

/* Writing task */
.task-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.task-card, .answer-card { background: #fff; border-radius: 18px; padding: 26px; box-shadow: 0 2px 10px rgba(19,35,74,.06); }
.task-card { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; }
.task-kicker { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #7b3fe4; margin-bottom: 12px; }
.task-text { color: #2a3245; line-height: 1.7; }
.task-text p { margin: 0 0 1em; }
.task-text ul, .task-text ol { padding-left: 1.3em; margin: 0 0 1em; }
.task-text img { border-radius: 10px; }
.task-options { border: 0; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.task-options legend { font-weight: 600; color: var(--navy); margin-bottom: 10px; }
.task-option { display: block; cursor: pointer; }
.task-option input { position: absolute; opacity: 0; pointer-events: none; }
.task-option__box { display: block; border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; transition: border-color .15s, background .15s; }
.task-option:hover .task-option__box { border-color: #b9cbff; }
.task-option input:checked + .task-option__box { border-color: var(--primary); background: #f3f6ff; }
.task-option input:focus-visible + .task-option__box { outline: 3px solid rgba(47,107,255,.35); }
.task-option input:disabled + .task-option__box { cursor: not-allowed; opacity: .7; }
.task-option__head { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.task-option__radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #b9c2d4; flex-shrink: 0; }
.task-option input:checked + .task-option__box .task-option__radio { border-color: var(--primary); background: radial-gradient(var(--primary) 45%, transparent 50%); }
.task-option__text { display: block; color: #4a5468; font-size: .95rem; }
.task-option__text p { margin: 0 0 .5em; }

.answer-label { display: block; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.answer-box {
    width: 100%; min-height: 440px; resize: vertical; font: inherit; font-size: 1.02rem; line-height: 1.7; color: var(--ink);
    padding: 16px 18px; border: 1px solid #d4dbe8; border-radius: 12px; background: #fbfcfe;
}
.answer-box:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,107,255,.15); background: #fff; }
.answer-box:disabled { background: #f1f3f8; cursor: not-allowed; }
.answer-box[readonly] { background: #f6f7fa; color: #5b6478; }
.answer-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: .9rem; color: var(--muted); }
.answer-foot strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.word-target.is-low { color: #b86e00; }
.word-target.is-good { color: #12a150; font-weight: 700; }
.word-target.is-high { color: #d7263d; }
.time-up { display: flex; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: #fde8eb; color: #9b1325; font-weight: 600; }
.time-up .icon { width: 18px; height: 18px; }
.exam-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding: 14px 20px; background: #fff; border-radius: 14px; }
.exam-actions .btn .icon { width: 18px; height: 18px; }

/* Results */
.exam-done { max-width: 860px; margin: 0 auto; }
.exam-done__head { text-align: center; margin-bottom: 26px; }
.exam-done__head h2 { font-size: 1.9rem; margin: 12px 0 8px; }
.exam-done__head p { color: var(--muted); max-width: 620px; margin: 0 auto; }
.review { display: grid; gap: 16px; }
.review-item { background: #fff; border-radius: 18px; padding: 24px; box-shadow: 0 2px 10px rgba(19,35,74,.06); }
.review-item header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.review-item h3 { font-size: 1.05rem; margin: 0; }
.review-count { font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #eef0f4; color: #5b6478; }
.review-count.is-good { background: #e3f6ea; color: #12a150; }
.review-count.is-low { background: #fff3dc; color: #a86200; }
.review-count.is-high, .review-count.is-empty { background: #fde8eb; color: #b0182c; }
.review-choice { color: var(--primary); margin-bottom: 8px; }
.review-text { color: #2a3245; line-height: 1.7; background: var(--tint); border-radius: 12px; padding: 16px; white-space: normal; }
.review-empty { text-align: center; color: var(--muted); background: #fff; padding: 24px; border-radius: 16px; }
.exam-done__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .test-grid { grid-template-columns: repeat(2, 1fr); }
    .exam-progress { display: none; }
}
@media (max-width: 860px) {
    .task-grid { grid-template-columns: 1fr; }
    .task-card { position: static; max-height: none; }
    .answer-box { min-height: 320px; }
    .celpip-section__head { flex-wrap: wrap; }
    .celpip-section__btn { margin-left: 0; }
}
@media (max-width: 640px) {
    .test-grid { grid-template-columns: 1fr; }
    .exam-bar { padding: 0 12px; gap: 10px; }
    .exam-bar__brand span, .exam-bar__exit { display: none; }
    .exam-bar__title { padding-left: 0; border-left: 0; }
    .exam-main { padding: 16px 12px 40px; }
    .exam-intro { padding: 28px 20px; }
    .task-card, .answer-card { padding: 18px; }
    .celpip-section { padding: 40px 0; }
}
.exam [hidden] { display: none !important; }

/* ---------- CELPIP main page: one section, items one after the other, no borders ---------- */
.hub-wrap { padding: 36px 0 80px; }
.hub-panel { display: flex; flex-direction: column; gap: 8px; max-width: 900px; }
.hub-item { display: flex; flex-direction: column; gap: 14px; padding: 28px 0; scroll-margin-top: 80px; }
.hub-item__head { display: flex; align-items: center; gap: 14px; }
.hub-item__head h2 { font-size: clamp(1.2rem, 2vw, 1.4rem); font-weight: 800; margin: 0; }
.hub-item--mock .hub-item__head h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); }
.hub-item__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; color: #fff; background: var(--primary); }
.hub-item__icon .icon { width: 24px; height: 24px; }
.hub-item--mock .hub-item__icon { background: linear-gradient(135deg, var(--navy), var(--primary)); }
.hub-item--reading .hub-item__icon   { background: #0f9d8a; }
.hub-item--listening .hub-item__icon { background: #2f6bff; }
.hub-item--writing .hub-item__icon   { background: #7b3fe4; }
.hub-item--speaking .hub-item__icon  { background: #ff8a3d; }
.hub-item__text { color: #4a5468; margin: 0; max-width: 820px; }
.hub-item__foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.hub-item__foot .btn .icon { width: 18px; height: 18px; }
.hub-item__foot small { color: var(--muted); font-size: .82rem; }

.feature-tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.feature-tag { font-size: .74rem; font-weight: 700; line-height: 1; padding: 6px 10px; border-radius: 999px; }
.feature-tag--0 { background: #eaf0ff; color: #1f52d6; }
.feature-tag--1 { background: #e3f6ea; color: #0f7a3d; }
.feature-tag--2 { background: #f0e9ff; color: #6a2fd0; }
.feature-tag--3 { background: #fff0e4; color: #c25a10; }
.feature-tag--4 { background: #e0f6f2; color: #0b7d6d; }
.feature-tag--5 { background: #fde8eb; color: #b0182c; }

@media (max-width: 640px) {
    .hub-item { padding: 22px 0; }
    .hub-item__foot .btn { width: 100%; justify-content: center; }
}

/* ---------- Writing screen: exact half-and-half split that fills the screen ---------- */
@media (min-width: 861px) {
    .exam-step[data-task] { display: flex; flex-direction: column; height: calc(100vh - 64px - 92px); min-height: 520px; }
    .exam-step[data-task][hidden] { display: none !important; }
    .exam-step[data-task] .task-grid { grid-template-columns: 1fr 1fr; flex: 1; min-height: 0; align-items: stretch; }
    .exam-step[data-task] .task-card { position: static; max-height: none; overflow-y: auto; }
    .exam-step[data-task] .answer-card { display: flex; flex-direction: column; min-height: 0; }
    .exam-step[data-task] .answer-box { flex: 1; min-height: 200px; resize: none; }
    .exam-step[data-task] .exam-actions { flex-shrink: 0; }
}
.exam-actions .muted-inline { white-space: normal; }
.exam-actions .muted-inline strong { color: var(--navy); font-weight: 600; }

/* Cut / Copy / Paste / Undo / Redo */
.answer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.answer-head .answer-label { margin: 0; }
.edit-tools { display: flex; align-items: center; gap: 4px; padding: 3px; background: var(--tint); border: 1px solid var(--line); border-radius: 10px; }
.edit-tools button {
    font: inherit; font-size: .82rem; font-weight: 600; color: var(--navy);
    padding: 6px 11px; border: 0; border-radius: 7px; background: transparent; cursor: pointer;
}
.edit-tools button:hover { background: #fff; box-shadow: 0 1px 3px rgba(19,35,74,.12); }
.edit-tools button:active { transform: translateY(1px); }
.edit-tools button:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; background: transparent; }
.edit-tools__sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }

/* Message shown after a timer runs out */
.exam-toast {
    position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 30;
    max-width: min(560px, calc(100vw - 24px)); padding: 12px 18px; border-radius: 12px;
    background: #9b1325; color: #fff; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.25); text-align: center;
}

/* ---------- Spell check: red wavy line under misspelled words ----------
   A copy of the text sits behind the (transparent) typing box with exactly the same
   size, font and line wrapping; only the misspelled words are underlined there. */
.spell-wrap { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; border-radius: 12px; background: #fbfcfe; }
.spell-wrap .answer-box,
.spell-backdrop {
    font: inherit; font-size: 1.02rem; line-height: 1.7; letter-spacing: normal;
    padding: 16px 18px; border: 1px solid transparent; border-radius: 12px;
    white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4;
    overflow-y: auto; scrollbar-gutter: stable; box-sizing: border-box;
}
.spell-wrap .answer-box { position: relative; z-index: 1; background: transparent; border-color: #d4dbe8; }
.spell-wrap .answer-box:focus { background: transparent; }
.spell-wrap:focus-within { background: #fff; }
.spell-backdrop {
    position: absolute; inset: 0; z-index: 0; color: transparent; pointer-events: none;
    overflow: hidden; scrollbar-gutter: stable;
}
.spell-backdrop mark {
    background: none; color: transparent;
    text-decoration: underline wavy #e5484d; text-decoration-thickness: 1.5px;
    text-underline-offset: 4px; text-decoration-skip-ink: none;
}
.spell-wrap:has(.answer-box:disabled) { background: #f1f3f8; }
.spell-wrap:has(.answer-box[readonly]) { background: #f6f7fa; }
.spell-wrap .answer-box:disabled, .spell-wrap .answer-box[readonly] { background: transparent; }
@media (max-width: 860px) { .spell-wrap .answer-box { min-height: 320px; } }

/* ---------- Sample Answers overview ---------- */
.sa-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.sa-exam h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 14px; }
.sa-skill { margin-bottom: 22px; }
.sa-skill h3 { font-size: .85rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.sa-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.sa-links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--tint); font-weight: 600; color: var(--navy); transition: background .15s, color .15s; }
.sa-links a:hover { background: #e6edff; color: var(--primary); }
.sa-links small { font-weight: 600; font-size: .8rem; color: var(--muted); }
@media (max-width: 860px) { .sa-groups { grid-template-columns: 1fr; } }

/* ───────── Listening test: one box, all parts ───────── */
.lsx-box { max-width: 1040px; margin: 0 auto; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; min-height: calc(100vh - 170px); }
.lsx-head, .lsx-foot { display: flex; align-items: center; gap: 14px; padding: 14px 22px; }
.lsx-head { border-bottom: 1px solid var(--line); background: var(--tint); }
.lsx-foot { border-top: 1px solid var(--line); margin-top: auto; justify-content: flex-end; }
.lsx-head h2 { font-size: 1.1rem; margin: 0; color: var(--navy); }
.lsx-nav { display: flex; gap: 10px; margin-left: auto; }
.lsx-timer { font-weight: 600; color: var(--navy); background: #fff; border: 1px solid var(--line); padding: 6px 12px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.lsx-timer.is-warning { background: #d7263d; color: #fff; border-color: #d7263d; }
.lsx-stage { padding: 28px 32px 34px; font-size: 1.02rem; line-height: 1.65; color: var(--ink); }
.lsx-text h3 { color: var(--navy); margin: 0 0 .6em; }
.lsx-text ul, .lsx-text ol { padding-left: 1.4em; }
.lsx-text li { margin: .4em 0; }
.lsx-img { max-width: 100%; border-radius: 12px; display: block; }
.lsx-info.has-image, .lsx-qgrid.has-image { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 28px; align-items: start; }
.lsx-playing { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-size: .92rem; }
.lsx-bars { display: inline-flex; gap: 3px; align-items: flex-end; height: 16px; }
.lsx-bars i { width: 4px; background: var(--primary); border-radius: 2px; animation: lsx-bar 1s infinite ease-in-out; }
.lsx-bars i:nth-child(2) { animation-delay: .2s; } .lsx-bars i:nth-child(3) { animation-delay: .4s; }
@keyframes lsx-bar { 0%, 100% { height: 4px; } 50% { height: 16px; } }
.lsx-recording { max-width: 720px; margin: 0 auto; text-align: center; }
.lsx-audio { display: flex; justify-content: center; margin: 22px 0; }
.lsx-audio audio { width: min(520px, 100%); }
.lsx-hint { color: var(--muted); font-size: .92rem; }
.lsx-question .lsx-audio { margin-top: 0; }
.lsx-qnum { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin: 0 0 8px; }
.lsx-statement { font-weight: 600; color: var(--navy); margin: 0 0 14px; }
.lsx-options { display: grid; gap: 10px; }
.lsx-options.is-pictures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lsx-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.lsx-opt:hover { border-color: #12a150; background: #eafaf0; }
.lsx-opt input { position: absolute; opacity: 0; pointer-events: none; }
.lsx-opt__letter { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--tint); color: var(--navy); }
.lsx-opt__body { display: flex; flex-direction: column; gap: 6px; }
.lsx-opt__body img { max-width: 100%; max-height: 180px; border-radius: 8px; object-fit: contain; }
.lsx-opt:has(input:checked) { border-color: #12a150; background: #eafaf0; }
.lsx-opt:has(input:checked) .lsx-opt__letter { background: #12a150; color: #fff; }
.lsx-opt:has(input:focus-visible) { outline: 3px solid rgba(47,107,255,.35); outline-offset: 2px; }
.lsx-pause { text-align: center; padding: 60px 0; color: var(--muted); }
.lsx-pause strong { display: block; font-size: 3.4rem; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.lsx-end h3 { color: var(--navy); }
.lsx-review { list-style: none; padding: 0; display: grid; gap: 8px; }
.lsx-review li { display: flex; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--tint); }
.lsx-review small { color: var(--muted); }
.lsx-review__mark { font-weight: 800; }
.lsx-review .is-right .lsx-review__mark { color: #12a150; }
.lsx-review .is-wrong .lsx-review__mark { color: #d7263d; }
@media (max-width: 760px) {
  .lsx-info.has-image, .lsx-qgrid.has-image, .lsx-options.is-pictures { grid-template-columns: 1fr; }
  .lsx-stage { padding: 20px 16px; }
  .lsx-head { flex-wrap: wrap; }
}

/* Next (top) and Back (bottom) always sit in the right corner */
.lsx-head h2 { flex: 1 1 auto; min-width: 0; }
.lsx-head .lsx-nav, .lsx-foot .lsx-nav { margin-left: auto; justify-content: flex-end; }
@media (max-width: 760px) { .lsx-head h2 { flex-basis: 100%; } }

/* Question screens: recording on the left, question and options on the right */
.lsx-split { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr); gap: 28px; align-items: start; }
.lsx-split__left { position: sticky; top: 16px; display: grid; gap: 16px; padding: 18px; background: var(--tint); border-radius: 14px; }
.lsx-split__left .lsx-audio { margin: 0; }
.lsx-split__left audio { width: 100%; }
.lsx-split__right .lsx-opt__body img { max-height: 140px; }
@media (max-width: 860px) { .lsx-split { grid-template-columns: 1fr; } .lsx-split__left { position: static; } }

/* Split screen v2: visible divider, audio centred on the left, options in one column */
.lsx-split { align-items: stretch; gap: 0; }
.lsx-split__left { position: static; background: none; border-radius: 0; padding: 0 28px 0 0; border-right: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.lsx-split__right { padding-left: 28px; }
.lsx-split .lsx-options.is-pictures { grid-template-columns: 1fr; }
@media (max-width: 860px) {
  .lsx-split__left { border-right: 0; border-bottom: 2px solid var(--line); padding: 0 0 20px; }
  .lsx-split__right { padding: 20px 0 0; }
}
.lsx-split__left .lsx-audio, .lsx-split__left .lsx-img { width: 100%; }

/* ───────── Reading test: passage left, questions right ───────── */
.lsx-head .lsx-nav { align-items: center; }
.rdx-stage { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.rdx-intro { padding: 28px 32px; font-size: 1.02rem; line-height: 1.65; }
.rdx-split { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: calc(100vh - 300px); min-height: 440px; }
.rdx-left, .rdx-right { overflow-y: auto; padding: 24px 28px; line-height: 1.65; }
.rdx-left { border-right: 2px solid var(--line); background: #fbfcfe; }
.rdx-right { background: #f3f8fc; }
.rdx-passage img { max-width: 100%; height: auto; }
.rdx-passage table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.rdx-passage td, .rdx-passage th { border: 1px solid var(--line); padding: 8px 10px; vertical-align: top; }
.rdx-section + .rdx-section { margin-top: 26px; }
.rdx-instructions { display: flex; gap: 10px; font-weight: 700; color: var(--navy); font-size: 1.05rem; line-height: 1.45; margin-bottom: 14px; }
.rdx-instructions p { margin: 0; }
.rdx-info { flex: none; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; background: var(--primary); color: #fff; font: 700 .8rem/22px Georgia, serif; text-align: center; }
.rdx-card { background: #fff; border: 1px solid #c9d3e3; border-radius: 10px; padding: 16px 20px; }
.rdx-q { padding: 9px 0; }
.rdx-q + .rdx-q { border-top: 1px dashed var(--line); }
.rdx-blanks { line-height: 2.3; }
.rdx-blanks p { margin: 0 0 .6em; }
.rdx-blank { white-space: nowrap; }
.rdx-num { font-weight: 700; margin-right: 4px; }
.rdx-select { font: inherit; font-size: .95rem; min-width: 120px; max-width: 100%; padding: 4px 28px 4px 8px; border: 1px solid #b9c4d6; border-bottom: 2px solid var(--primary); border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; }
.rdx-select:hover { border-color: #12a150; }
.rdx-select:focus { outline: 3px solid rgba(47,107,255,.25); }
.rdx-select:disabled { background: #eef1f6; cursor: not-allowed; }
.rdx-section--matching .rdx-select { margin-right: 4px; }
.rdx-timeup { background: #fff3dc; color: #7a4b00; border-radius: 10px; padding: 10px 14px; font-weight: 600; margin: 0 0 16px; }
.rdx-box .lsx-end { padding: 28px 32px; }
@media (max-width: 860px) {
  .rdx-split { grid-template-columns: 1fr; height: auto; }
  .rdx-left { border-right: 0; border-bottom: 2px solid var(--line); }
  .rdx-left, .rdx-right { overflow: visible; padding: 20px 16px; }
}
.rdx-split { flex: none; grid-template-rows: minmax(0, 1fr); } .rdx-left, .rdx-right { min-height: 0; }
@media (max-width: 860px) { .rdx-split { grid-template-rows: auto; } }

/* Reading: last minute – the time turns red */
.rdx-box .lsx-timer.is-warning { background: #fff0f1; border-color: #d7263d; color: #d7263d; }
.rdx-box .lsx-timer.is-warning strong { color: #d7263d; }

/* Reading: our own drop-down with a fixed width */
.rdx-dd { position: relative; display: inline-block; vertical-align: middle; }
.rdx-dd__btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; width: 150px; height: 32px; padding: 0 8px; font: inherit; font-size: .92rem; color: var(--ink); background: #fff; border: 1px solid #b9c4d6; border-bottom: 2px solid var(--primary); border-radius: 6px; cursor: pointer; text-align: left; }
.rdx-dd__btn:hover { border-color: #12a150; }
.rdx-dd__btn:focus-visible { outline: 3px solid rgba(47,107,255,.25); }
.rdx-dd__btn:disabled { background: #eef1f6; cursor: not-allowed; }
.rdx-dd__val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdx-dd__arrow { flex: none; color: var(--primary); font-size: .8rem; }
.rdx-dd__list { position: absolute; left: 0; top: calc(100% + 4px); z-index: 30; width: 220px; max-height: 260px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid #c9d3e3; border-radius: 8px; box-shadow: 0 10px 24px rgba(19,35,74,.16); white-space: normal; line-height: 1.35; }
.rdx-dd.is-up .rdx-dd__list { top: auto; bottom: calc(100% + 4px); }
.rdx-dd__list li { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: .92rem; overflow-wrap: anywhere; }
.rdx-dd__list li:hover, .rdx-dd__list li:focus { background: #eafaf0; color: #0b6b35; outline: none; }
.rdx-dd__list li[aria-selected="true"] { background: #12a150; color: #fff; }
.rdx-blank .rdx-dd { white-space: normal; }

/* Reading: once an answer is chosen, show it as bold green text (no box), like the official test */
.rdx-dd.has-value .rdx-dd__btn { width: auto; max-width: 100%; height: auto; min-height: 28px; padding: 0 2px 1px; background: none; border: 0; border-bottom: 1px dotted #9fb3c8; border-radius: 0; color: #0b5d3a; font-weight: 700; font-size: 1.02rem; }
.rdx-dd.has-value .rdx-dd__val { overflow: visible; white-space: normal; text-overflow: clip; }
.rdx-dd.has-value .rdx-dd__arrow { display: none; }
.rdx-dd.has-value .rdx-dd__btn:hover { border-bottom-color: #12a150; background: #eafaf0; }
.rdx-dd.has-value .rdx-dd__btn:disabled { background: none; color: #4a5468; }
.rdx-dd.has-value { vertical-align: baseline; } .rdx-dd.has-value .rdx-dd__btn { min-height: 0; display: inline; text-align: left; line-height: 1.5; }
/* narrower answer box and option list */
.rdx-dd__btn { width: 115px; }
.rdx-dd__list { width: 190px; }

/* Reading: Submit button and results */
.btn-submit { background: #12a150; color: #fff; border: 0; }
.btn-submit:hover { background: #0e8a44; color: #fff; }
.rdx-box [data-rd-next]:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.rdx-result { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 22px; border-radius: 16px; background: linear-gradient(135deg, #eef4ff, #eafaf0); margin-bottom: 22px; }
.rdx-result__score { width: 120px; height: 120px; border-radius: 50%; background: #fff; display: grid; place-content: center; text-align: center; box-shadow: 0 6px 18px rgba(19,35,74,.1); }
.rdx-result__score strong { font-size: 2.4rem; line-height: 1; color: var(--navy); }
.rdx-result__score span { font-size: .85rem; color: var(--muted); }
.rdx-result__band p { margin: 0; }
.rdx-result__label { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.rdx-result__level { font-size: 1.9rem; font-weight: 800; color: var(--navy); }
.rdx-result__level span { font-size: 1rem; font-weight: 700; color: #0b6b35; background: #fff; border-radius: 999px; padding: 4px 12px; margin-left: 6px; vertical-align: middle; }
.rdx-result__note { color: #4a5468; margin-top: 4px !important; }
.rdx-result__small { font-size: .85rem; color: var(--muted); margin-top: 6px !important; }
.rdx-bands { width: 100%; border-collapse: collapse; font-size: .92rem; margin-bottom: 24px; }
.rdx-bands th, .rdx-bands td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.rdx-bands th { background: var(--tint); color: var(--navy); font-weight: 700; }
.rdx-bands tr.is-you td { background: #eafaf0; font-weight: 700; color: #0b6b35; }
@media (max-width: 640px) { .rdx-bands { font-size: .82rem; } .rdx-bands th, .rdx-bands td { padding: 7px 6px; } }

/* Results PDF (built off-screen by public/js/celpip-results-pdf.js) */
.ew-pdf { width: 700px; padding: 8px 6px; background: #fff; color: var(--ink); font-family: "Plus Jakarta Sans", system-ui, sans-serif; }
.ew-pdf__head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 3px solid var(--primary); }
.ew-pdf__brand { font-size: 1.5rem; font-weight: 600; color: var(--navy); }
.ew-pdf__brand strong { color: var(--accent); }
.ew-pdf__meta { text-align: right; display: flex; flex-direction: column; }
.ew-pdf__meta strong { color: var(--navy); }
.ew-pdf__meta span { font-size: .85rem; color: var(--muted); }
.ew-pdf .lsx-end { padding: 0 !important; }
.ew-pdf .lsx-review li { break-inside: avoid; }

/* Results screen: "Download the results" sits in the middle */
.lsx-foot:has([data-results-download]:not([hidden])) { justify-content: center; }
.lsx-foot:has([data-results-download]:not([hidden])) .lsx-nav { margin: 0 auto; justify-content: center; }

/* Writing: Text Editor 2 – shown above the response box, inside the same card */
.answer-note { padding: 12px 14px; margin-bottom: 14px; background: var(--tint); border-left: 3px solid var(--primary); border-radius: 8px; line-height: 1.6; color: var(--ink); }
.answer-note > :first-child { margin-top: 0; }
.answer-note > :last-child { margin-bottom: 0; }
.answer-note img { max-width: 100%; height: auto; }

/* ───────── Writing: one box per task, split in two (like Reading) ───────── */
.wrx-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-rows: minmax(0, 1fr); height: calc(100vh - 300px); min-height: 480px; }
.wrx-left, .wrx-right { min-height: 0; overflow-y: auto; padding: 24px 28px; line-height: 1.65; }
.wrx-left { border-right: 2px solid var(--line); background: #fbfcfe; }
.wrx-right { display: flex; flex-direction: column; background: #fff; }
.wrx-right .spell-wrap { flex: 1; min-height: 260px; display: flex; }
.wrx-right .answer-box { min-height: 260px; }
.wrx-right .task-options { margin: 0 0 16px; }
.wrx-right .time-up { margin-bottom: 14px; }
.wrx-box .lsx-timer.is-warning { background: #fff0f1; border-color: #d7263d; color: #d7263d; }
.wrx-box .lsx-timer.is-warning strong { color: #d7263d; }
.wrx-box .lsx-head .btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.wrx-box .lsx-foot { min-height: 64px; }
@media (max-width: 860px) {
  .wrx-split { grid-template-columns: 1fr; grid-template-rows: auto; height: auto; }
  .wrx-left { border-right: 0; border-bottom: 2px solid var(--line); }
  .wrx-left, .wrx-right { overflow: visible; padding: 20px 16px; }
}
@media (min-width: 861px) { .exam-step[data-task] { display: block; height: auto; min-height: 0; } }
/* Writing: 30% task on the left, 70% response side on the right */
@media (min-width: 861px) { .wrx-split { grid-template-columns: minmax(0, 3fr) minmax(0, 7fr); } }

/* Listening: the answer timer turns red in the last 10 seconds */
.lsx-box:not(.rdx-box):not(.wrx-box) .lsx-timer.is-warning { background: #fff0f1; border-color: #d7263d; color: #d7263d; }
.lsx-box:not(.rdx-box):not(.wrx-box) .lsx-timer.is-warning strong { color: #d7263d; }

/* Listening info screens with a picture: text on top, picture below, both centred */
.lsx-info.has-image { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px; }
.lsx-info.has-image .lsx-text { max-width: 760px; }
.lsx-info.has-image .lsx-img { max-width: min(520px, 100%); max-height: 340px; object-fit: contain; }
/* "Audio is playing…" centred on every listening screen */
.lsx-playing { display: flex; justify-content: center; width: 100%; }

/* ───────── Listening Part 4: all questions on one screen ───────── */
.lsx-group { max-width: 900px; }
.lsx-group__intro { display: flex; gap: 10px; font-weight: 700; color: var(--navy); font-size: 1.1rem; line-height: 1.45; margin-bottom: 22px; }
.lsx-group__intro p { margin: 0; }
.lsx-group__qs { display: grid; gap: 4px; }
.lsx-gq { padding: 12px 0; line-height: 2; }
.lsx-gq + .lsx-gq { border-top: 1px dashed var(--line); }
.lsx-dd .rdx-dd__list li { display: flex; align-items: center; gap: 10px; border-bottom: 1px dotted var(--line); border-radius: 0; }
.lsx-dd .rdx-dd__list li::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #9aa3b5; background: #fff; }
.lsx-dd .rdx-dd__list li[aria-selected="true"]::before { border-color: #fff; background: #12a150; box-shadow: inset 0 0 0 3px #fff; }
.lsx-dd .rdx-dd__list li:last-child { border-bottom: 0; }
.lsx-video video { width: min(720px, 100%); border-radius: 12px; background: #000; }
/* Listening Part 4/5 option lists: as wide as the longest option (up to a limit), like the official test */
.lsx-dd .rdx-dd__list { width: max-content; min-width: 190px; max-width: min(440px, 80vw); }

/* ───────── Speaking test ───────── */
.spx-times { color: var(--muted); font-size: .92rem; white-space: nowrap; }
.spx-times strong { color: var(--navy); }
.spx-question { display: flex; gap: 10px; font-weight: 700; color: var(--navy); font-size: 1.12rem; line-height: 1.45; }
.spx-question p { margin: 0; }
.spx-rule { border: 0; border-top: 1px solid var(--line); margin: 20px 0 26px; }
.spx-panel { display: flex; align-items: center; gap: 22px; width: min(480px, 100%); margin: 0 auto; padding: 22px 26px; border-radius: 14px; background: #e3e7ee; }
.spx-icon { flex: none; width: 82px; height: 82px; border-radius: 10px; background: #f3f4f7; color: #9aa3b5; display: grid; place-items: center; }
.spx-icon svg { width: 46px; height: 46px; }
.spx-panel__body { flex: 1; text-align: center; }
.spx-panel__label { margin: 0 0 6px; font-weight: 600; color: var(--ink); font-size: 1.08rem; }
.spx-panel__count { margin: 0; color: var(--primary); font-size: 1.15rem; font-variant-numeric: tabular-nums; min-height: 1.4em; }
.spx-panel.is-rec { background: #fdecee; }
.spx-panel.is-rec .spx-icon { color: #d7263d; background: #fff; animation: spx-pulse 1.2s infinite; }
.spx-panel.is-rec .spx-panel__count { color: #d7263d; font-weight: 700; }
.spx-panel.is-done { background: #e6f6ec; }
.spx-panel.is-done .spx-icon { color: #12a150; background: #fff; }
.spx-panel audio { width: 100%; margin-top: 6px; }
@keyframes spx-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(215,38,61,.35); } 50% { box-shadow: 0 0 0 10px rgba(215,38,61,0); } }
.spx-note { margin-top: 28px; color: var(--muted); }
.spx-error { margin: 18px auto 0; max-width: 560px; background: #fff3dc; color: #7a4b00; border-radius: 10px; padding: 10px 14px; text-align: center; }
.spx-small { font-size: .88rem; color: var(--muted); margin: 6px 0 0; }
.spx-end { text-align: center; padding: 30px 0; }
.spx-end .exam-intro__icon { font-size: 2rem; font-weight: 800; }

/* Welcome screen: student's name and email */
.exam-student { text-align: left; background: #f4f7fc; border-radius: 14px; padding: 14px 18px; margin: 0 0 18px; }
.exam-student p { margin: 0 0 10px; font-size: .92rem; color: #4a5468; }
.exam-student__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.exam-student input { width: 100%; padding: 10px 12px; border: 1px solid #c9d3e3; border-radius: 10px; font: inherit; }
.exam-student input:focus { outline: 3px solid rgba(47,107,255,.25); border-color: var(--primary); }
.exam-student__error { color: #d7263d !important; font-weight: 600; margin: 8px 0 0 !important; }
@media (max-width: 560px) { .exam-student__fields { grid-template-columns: 1fr; } .spx-panel { flex-direction: column; } .spx-times { display: none !important; } }

/* Welcome screen: "Logged in as …" */
p.exam-student { display: block; font-size: .92rem; color: #4a5468; }

/* ───────── Speaking: pictures, Task 5 options, "start speaking now" ───────── */
.spx-sub { font-weight: 500; color: var(--muted); font-size: .95rem; margin: 8px 0 0; }
.spx-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.spx-split .spx-panel { width: 100%; }
.spx-image { display: block; width: 100%; max-height: 460px; object-fit: contain; border-radius: 10px; }
.spx-options { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.spx-options.is-single { grid-template-columns: 1fr; }
.spx-option { display: flex; flex-direction: column; gap: 10px; text-align: left; font: inherit; color: var(--ink); background: #fff; border: 2px solid #1c2333; border-radius: 6px; padding: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.spx-option:disabled { cursor: default; }
.spx-option img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 4px; }
.spx-option__text { font-size: .92rem; line-height: 1.5; color: #4a5468; }
.spx-option__text p { margin: 0 0 4px; }
.spx-option__pick { margin-top: auto; align-self: flex-start; font-size: .85rem; font-weight: 700; color: var(--primary); }
.spx-option:not(:disabled):hover { border-color: #12a150; box-shadow: 0 0 0 4px rgba(18,161,80,.15); }
.spx-option.is-chosen { border-color: #12a150; box-shadow: 0 0 0 4px rgba(18,161,80,.2); }
.spx-option.is-chosen .spx-option__pick { color: #12a150; }
.spx-below { margin-top: 22px; }
.spx-panel.is-choose { background: #eef4ff; }
.spx-panel.is-choose .spx-icon { color: var(--primary); background: #fff; }
.spx-panel.is-cue { background: #fff3dc; }
.spx-panel.is-cue .spx-icon { color: #e08a00; background: #fff; animation: spx-pulse 1s infinite; }
.spx-instructions { max-width: 760px; }
.spx-portal { background: #eef4ff; border-radius: 12px; padding: 12px 16px; display: inline-block; }
@media (max-width: 860px) { .spx-split, .spx-options { grid-template-columns: 1fr; } }

/* Final page: Writing / Speaking results come later in the portal */
.exam-portal-note { background: #eef4ff; border: 1px solid #c9d8ff; border-radius: 14px; padding: 16px 20px; margin: 0 auto 22px; max-width: 760px; text-align: center; }
.exam-portal-note p { margin: 0 0 10px; color: var(--navy); }
/* Speaking: the timer card sits level with the middle of the picture */
.spx-split { align-items: center; }

/* ───────── IELTS Speaking ───────── */
.ipx-exit { margin-left: auto; }
/* Part 1 / Part 2 / Part 3 – inside the box header */
.ipx-parts { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; gap: 6px; }
.ipx-parts li { font-size: .8rem; font-weight: 700; padding: 6px 14px; border-radius: 999px; background: #e6eaf2; color: #5b6478; white-space: nowrap; }
.ipx-parts li.is-current { background: var(--primary); color: #fff; }
.ipx-parts li.is-done { background: #e3f6ea; color: #12a150; }
.ipx-parts li.is-done::before { content: "✓ "; }
.ipx-box .lsx-head .lsx-nav { margin-left: 0; }
.ipx-box .lsx-head .lsx-nav:has([data-ip-next][hidden]) { display: none; }
.ipx-partnext { white-space: nowrap; font-size: 1rem; padding: 10px 18px; }
.ipx-box { min-height: calc(100vh - 200px); }
.ipx-start { text-align: center; margin-top: 30px; }
.ipx-qnum { text-align: center; font-size: 1.35rem; font-weight: 800; color: var(--navy); margin: 10px 0 22px; }
.ipx-stop { margin-top: 12px; background: #d7263d; color: #fff; border: 0; display: inline-flex; align-items: center; gap: 8px; }
.ipx-stop:hover { background: #b81e32; color: #fff; }
.ipx-stop:disabled { opacity: .6; }
.ipx-stop__sq { width: 12px; height: 12px; border-radius: 2px; background: #fff; }
.spx-panel.is-ask { background: #eef4ff; }
.spx-panel.is-ask .spx-icon { color: var(--primary); background: #fff; animation: spx-pulse 1.4s infinite; }
.spx-panel.is-prep { background: #e3e7ee; }
.spx-panel__count.is-warning { color: #d7263d; font-weight: 700; }
.ipx-split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.ipx-split .spx-panel { width: 100%; }
.ipx-card { border: 2px solid var(--navy); border-radius: 10px; padding: 20px 24px; background: #fffdf5; font-size: 1.05rem; line-height: 1.6; }
.ipx-card p { margin: 0 0 8px; }
.ipx-card ul { margin: 4px 0 10px; padding-left: 1.3em; }
.ipx-fallback { max-width: 560px; margin: 20px auto 0; text-align: center; }
.ipx-student { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 16px; }
@media (max-width: 860px) { .ipx-split { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .ipx .exam-bar__title { display: none; } .ipx-exit { display: none; } .ipx-partnext { margin-left: auto; } .ipx-parts { margin-left: 0; } }

/* IELTS practice pages: same layout as CELPIP, with the IELTS red tint in the header */
.ielts-hero { background: radial-gradient(900px 380px at 90% 0%, rgba(215,38,61,.10), transparent 60%), radial-gradient(700px 300px at 0% 100%, rgba(47,107,255,.08), transparent 60%), var(--tint); }
.spx-panel.is-retry { background: #fff3dc; }
.spx-panel.is-retry .spx-icon { color: #e08a00; background: #fff; }
.spx-panel.is-retry .btn { margin-top: 10px; }
/* IELTS Writing: half and half, so Task 1 graphs and charts are clearly visible */
@media (min-width: 861px) { .ipw .wrx-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ipw .task-text img { max-width: 100%; height: auto; }
.ipw .answer-box { width: 100%; flex: 1; resize: none; }
/* IELTS Writing: title left · one timer in the centre · Submit right; Task 1 / Task 2 buttons centred at the bottom */
.ipw-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
.ipw-head .lsx-timer { justify-self: center; }
.ipw-head .lsx-nav { justify-self: end; margin-left: 0; }
.ipw-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
.ipw-foot .ipw-tasks { grid-column: 2; }
.ipw-foot__end { grid-column: 3; justify-self: end; }
.ipw-tasks { display: flex; gap: 10px; justify-content: center; }
.ipw-task { font: inherit; font-weight: 700; font-size: .95rem; padding: 10px 26px; border-radius: 10px; border: 2px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; transition: border-color .15s, background .15s; }
.ipw-task:hover { border-color: var(--primary); color: var(--primary); }
.ipw-task.is-current { background: var(--navy); border-color: var(--navy); color: #fff; }
.ipw .answer-box { -webkit-user-drag: none; }
@media (max-width: 760px) {
  .ipw-head { grid-template-columns: 1fr auto; }
  .ipw-head h2 { grid-column: 1 / -1; }
  .ipw-head .lsx-timer { justify-self: start; }
}

/* "Words from this test" card on the results pages */
.ew-vc { background: #fff; border: 1px solid #d9e2f0; border-radius: 14px; padding: 18px 22px; margin: 0 0 22px; text-align: center; }
.ew-vc h3 { margin: 0 0 10px; color: var(--navy); }
.ew-vc__samples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 0 0 12px; }
.ew-vc__samples span { background: #eef3fb; border-radius: 999px; padding: 4px 12px; font-weight: 600; }
.ew-vc__samples em { color: var(--muted); }
.ew-vc__lang { display: block; margin-bottom: 12px; font-size: .92rem; }
.ew-vc__lang select { font: inherit; padding: 6px 10px; margin-left: 6px; }
.ew-vc__btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ew-vc__btns a { font-weight: 700; font-size: .9rem; padding: 10px 18px; border-radius: 8px; border: 1px solid #c3c9d3; background: #fff; color: var(--navy); text-decoration: none; }
.ew-vc__btns a.is-primary { background: #1f4fbf; border-color: #1f4fbf; color: #fff; }

/* TOEFL introduction page */
.tf-intro h2{margin:0 0 22px;text-align:center}
.tf-intro__grid{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}
.tf-intro__grid--3{grid-template-columns:repeat(3,1fr)}
.tf-intro__card{background:#fff;border:1px solid var(--line,#e5e7ef);border-radius:14px;padding:22px}
.tf-intro__card h3{margin:0 0 8px;font-size:1.1rem;display:flex;align-items:center;gap:8px}
.tf-intro__card h3 svg{width:20px;height:20px}
.tf-intro__card p{margin:0 0 8px}
.tf-intro__card ul{margin:0;padding-left:18px}
.tf-intro__card li{margin:6px 0}
.tf-intro__cta{text-align:center;margin-top:26px}
.tf-intro--narrow{max-width:820px}
.tf-faq{background:#fff;border:1px solid var(--line,#e5e7ef);border-radius:12px;padding:14px 18px;margin:10px 0}
.tf-faq summary{cursor:pointer;font-weight:700}
.tf-faq p{margin:10px 0 0}
.tf-note{font-size:.85rem;color:#6b7280;margin-top:22px}
@media(max-width:800px){.tf-intro__grid,.tf-intro__grid--3{grid-template-columns:1fr}}

/* IELTS Writing: the test screen fills the whole window (edge to edge) instead of sitting in a centred card */
.ipw .exam-main { max-width: none; padding: 0; }
.ipw .exam-step:not([data-task]) { padding: 28px 24px 60px; }
.ipw .exam-step[data-task] .wrx-box { max-width: none; width: 100%; border-radius: 0; box-shadow: none; min-height: calc(100vh - 64px); height: calc(100vh - 64px); }
.ipw .wrx-box .wrx-split { flex: 1; height: auto; min-height: 0; }
.ipw .wrx-box .wrx-left, .ipw .wrx-box .wrx-right { min-height: 0; overflow-y: auto; }
@media (max-width: 860px) { .ipw .wrx-box .wrx-left, .ipw .wrx-box .wrx-right { overflow: visible; } .ipw .exam-step[data-task] .wrx-box { height: auto; min-height: calc(100vh - 64px); } .ipw .wrx-box .wrx-split { flex: none; } }

/* Lock screen over a premium test card (shown until the visitor has paid access) */
.test-card.is-locked { position: relative; overflow: hidden; }
.test-card.is-locked:hover { transform: none; }
.lock-screen { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px; text-align: center; background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.lock-screen__icon { width: 46px; height: 46px; border-radius: 50%; background: var(--navy, #13234a); color: #fff; display: grid; place-items: center; }
.lock-screen__icon .icon { width: 22px; height: 22px; }
.lock-screen strong { font-size: 1.05rem; color: var(--navy, #13234a); }
.lock-screen p { margin: 0; font-size: .86rem; line-height: 1.45; color: var(--muted, #5d6679); max-width: 240px; }
.lock-screen .btn { margin-top: 4px; }
