/* =========================================================
   CELPIP ARTICLE / EXAM UI
   Template: bs
   Responsive typography based on exam container width
   ========================================================= */
/* ---------------------------------------------------------
   Exam container
   --------------------------------------------------------- */
.celpip-exam {
    width: 100%;
    max-width: 980px;
    margin: 20px auto;
    overflow: hidden;
    border: 1px solid #cfd4da;
    background: #ffffff;
    box-sizing: border-box;
    /*
     * Typography inside this exam uses cqi units.
     * 1cqi = 1% of this container's inline width.
     */
    container-type: inline-size;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
    color: #343a40;
}
/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */
.celpip-exam-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(10px, 2cqi, 20px);
    padding:
        clamp(8px, 1.1cqi, 10px)
        clamp(12px, 2cqi, 20px);
    background: #dfe3e8;
    border-bottom: 1px solid #c8cdd2;
    box-sizing: border-box;
}
/* Left header title */
.celpip-exam-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: clamp(4px, .7cqi, 7px);
    /*
     * Approx:
     * 980px container -> 18.6px
     * 800px container -> 15.2px, limited by min
     */
    font-size: clamp(15px, 1.9cqi, 19px);
    line-height: 1.35;
    color: #39434d;
}
.celpip-exam-article-title {
    font-weight: 400;
}
.celpip-exam-title-separator {
    color: #555f68;
}
.celpip-exam-task-name {
    font-weight: 400;
}
/* Header right */
.celpip-exam-header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.2cqi, 12px);
}
/* ---------------------------------------------------------
   Timer
   --------------------------------------------------------- */
.celpip-exam-timer {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding-inline:
        clamp(6px, 1.4cqi, 14px);
    font-size:
        clamp(13px, 1.6cqi, 16px);
    line-height: 1;
    color: #30343a;
    white-space: nowrap;
    box-sizing: border-box;
}
.celpip-exam-timer-label {
    font-weight: 400;
}
.celpip-exam-timer-value {
    min-width: 47px;
    display: inline-block;
    font-weight: 700;
    color: #111111;
    text-align: start;
}
/* Warning */
.celpip-exam-timer.celpip-timer-warning
.celpip-exam-timer-value {
    color: #c47700;
}
/* Critical */
.celpip-exam-timer.celpip-timer-critical
.celpip-exam-timer-value {
    color: #c62828;
}
/* Finished */
.celpip-exam-timer.celpip-timer-finished
.celpip-exam-timer-value {
    color: #c62828;
}
/* ---------------------------------------------------------
   NEXT
   --------------------------------------------------------- */
.celpip-exam-next {
    min-width: clamp(60px, 8.3cqi, 62px);
    height: clamp(30px, 4cqi, 32px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: clamp(12px, 1.7cqi, 17px);
    border: 1px solid #07549a;
    border-radius: 1px;
    background:
        linear-gradient(
            to bottom,
            #1288e3 0%,
            #0068bd 100%
        );
    color: #ffffff;
    font-size:
        clamp(13px, 1.6cqi, 16px);
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    box-sizing: border-box;
    box-shadow:
        inset 0 1px 0
        rgba(255, 255, 255, .18);
}
.celpip-exam-next:hover {
    background:
        linear-gradient(
            to bottom,
            #2198ee 0%,
            #0874cc 100%
        );
    color: #ffffff;
}
.celpip-exam-next:focus-visible {
    outline: 2px solid #006ec8;
    outline-offset: 2px;
}
/* ---------------------------------------------------------
   Main exam body
   --------------------------------------------------------- */
.celpip-exam-body {
    display: grid;
    grid-template-columns:
        minmax(280px, 36%)
        minmax(0, 64%);
    min-height: 610px;
    background: #ffffff;
}
/* ---------------------------------------------------------
   Left reading panel
   --------------------------------------------------------- */
.celpip-exam-reading {
    min-width: 0;
    padding:
        clamp(18px, 2.5cqi, 25px)
        clamp(17px, 2.7cqi, 27px)
        clamp(24px, 3.5cqi, 35px);
    background: #f3f3f3;
    border-inline-end: 1px solid #cfd4d8;
    box-sizing: border-box;
    overflow-wrap: break-word;
}
/* ---------------------------------------------------------
   Right writing panel
   --------------------------------------------------------- */
.celpip-exam-writing {
    min-width: 0;
    padding:
        clamp(18px, 2.6cqi, 26px)
        clamp(18px, 3cqi, 30px)
        clamp(22px, 2.8cqi, 28px);
    background: #eaf7fa;
    box-sizing: border-box;
}
/* ---------------------------------------------------------
   Section headings
   --------------------------------------------------------- */
.celpip-section-heading {
    display: flex;
    align-items: flex-start;
    gap: clamp(6px, .9cqi, 9px);
    margin:0 0 clamp(13px, 2cqi, 20px);
    color: #075c9d;
    /*
     * 980px -> approx 20px
     * 800px -> approx 16.4px
     * minimum remains readable
     */
    font-size:
        clamp(16px, 2.05cqi, 18px);
    font-weight: 700;
    line-height: 1.35;
}
.celpip-section-heading > span:last-child {
    min-width: 0;
}
/* ---------------------------------------------------------
   Info icon
   --------------------------------------------------------- */
.celpip-info-icon {
  flex: 0 0 clamp(18px, 2.5cqi, 20px);
  width: clamp(18px, 2.5cqi, 20px);
  height: clamp(18px, 2.5cqi, 20px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  border-radius: 50%;
  background: #1e78b4;
  color: #ffffff;
  font-size: clamp(13px, 1.6cqi, 14px);
  font-family: Georgia, serif;
  font-weight: 700;
  line-height: 1;
}
/* ---------------------------------------------------------
   Reading text
   --------------------------------------------------------- */
.celpip-reading-text {
    max-width: 100%;
    /*
     * 980px -> around 17px
     * narrower container -> gradually smaller
     */
    font-size: clamp(14px, 1.75cqi, 16px);
    /*
     * Original 1.9 was visually too loose at 980px.
     */
    line-height: 1.65;
    color: #30363c;
    overflow-wrap: break-word;
}
/* ---------------------------------------------------------
   Writing instructions
   --------------------------------------------------------- */
.celpip-writing-instruction {
    margin-bottom:
        clamp(10px, 1.5cqi, 15px);
}
/* ---------------------------------------------------------
   Requirements
   --------------------------------------------------------- */
.celpip-writing-requirements {
    margin:
        0
        0
        clamp(18px, 2.6cqi, 26px)
        clamp(28px, 3.9cqi, 39px);
    padding: 0;
    font-size:
        clamp(14.5px, 1.65cqi, 17px);
    line-height: 1.5;
    color: #454b51;
}
.celpip-writing-requirements li {
    margin: 2px 0;
    padding-inline-start: 3px;
}
/* ---------------------------------------------------------
   Answer heading
   --------------------------------------------------------- */
.celpip-answer-heading {
    margin-top:
        clamp(15px, 1.8cqi, 18px);
    margin-bottom:
        clamp(10px, 1.5cqi, 15px);
}
.celpip-answer-heading span {
   font-size: 16px;
}
/* ---------------------------------------------------------
   Textarea
   --------------------------------------------------------- */
.celpip-answer-container {
    width: 100%;
}
.celpip-answer-textarea {
    display: block;
    width: 100%;
    min-height:
        clamp(280px, 34cqi, 340px);
    padding:
        clamp(13px, 1.8cqi, 18px);
    border: 1px solid #6f7478;
    border-radius:
        clamp(4px, .6cqi, 6px);
    background: #ffffff;
    color: #222222;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
    font-size:
        clamp(15px, 1.75cqi, 18px);
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
}
.celpip-answer-textarea:focus {
    border-color: #176ca8;
    box-shadow:
        0 0 0 2px
        rgba(23, 108, 168, .12);
}
/* ---------------------------------------------------------
   Word count
   --------------------------------------------------------- */
.celpip-word-count {
    margin-top: 6px;
    text-align: center;
    font-size:
        clamp(12px, 1.4cqi, 14px);
    line-height: 1.4;
    color: #555b60;
}
/* ---------------------------------------------------------
   Note
   --------------------------------------------------------- */
.celpip-exam-note {
    margin-top: 8px;
    font-size:
        clamp(12px, 1.4cqi, 14px);
    line-height: 1.5;
    color: #4b5156;
}
/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.celpip-exam-footer {
    min-height:
        clamp(48px, 6.2cqi, 62px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding:
        clamp(8px, 1cqi, 10px)
        clamp(15px, 2.6cqi, 26px);
    background: #e1e4e9;
    border-top: 1px solid #d2d6da;
    box-sizing: border-box;
}
/* ---------------------------------------------------------
   Joomla / bs reset inside exam
   --------------------------------------------------------- */
.celpip-exam h1,
.celpip-exam h2,
.celpip-exam h3,
.celpip-exam p {
    margin-top: 0;
}
.celpip-exam button,
.celpip-exam textarea {
    font-family: inherit;
}
/* =========================================================
   STANDARD FALLBACK ARTICLE
   ========================================================= */
.celpip-standard-article {
    max-width: 1200px;
    margin: 20px auto;
}
.celpip-standard-header {
    margin-bottom: 25px;
}
.celpip-standard-header h1 {
    display: none;
}
.celpip-standard-subtitle {
    font-size:
        clamp(15px, 1.7vw, 17px);
    color: #666666;
}
.celpip-standard-content {
    font-size:
        clamp(15px, 1.7vw, 17px);
    line-height: 1.7;
}
/* =========================================================
   TABLET
   ========================================================= */
@media (max-width: 1000px) {
    .celpip-exam {
        margin-top: 10px;
    }
    .celpip-exam-body {
        grid-template-columns:
            minmax(250px, 38%)
            minmax(0, 62%);
    }
    /*
     * Do not hard-code typography here.
     * cqi + clamp() handles scaling automatically.
     */
}
/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 767px) {
    .celpip-exam {
        width: 100%;
        margin: 0;
        border-inline-start: 0;
        border-inline-end: 0;
    }
    /* -----------------------------------------------------
       Header
       ----------------------------------------------------- */
    .celpip-exam-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding:
            13px
            15px;
    }
    .celpip-exam-heading {
        width: 100%;
        gap: 5px;
        /*
         * cqi still works here.
         * Keep a slightly higher minimum for readability.
         */
        font-size:
            clamp(15px, 4.2cqi, 17px);
    }
    .celpip-exam-header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .celpip-exam-timer {
        min-height: 38px;
        padding: 0;
        font-size:
            clamp(13px, 3.8cqi, 15px);
    }
    .celpip-exam-next {
        min-width: 74px;
        height: 38px;
        font-size:
            clamp(13px, 3.7cqi, 14px);
    }
    /* -----------------------------------------------------
       Stack panels vertically
       ----------------------------------------------------- */
    .celpip-exam-body {
        display: block;
        min-height: 0;
    }
    .celpip-exam-reading {
        width: 100%;
        min-height: 0;
        padding:
            20px
            18px
            24px;
        border-inline-end: 0;
        border-bottom:
            1px solid
            #cfd4d8;
    }
    .celpip-exam-writing {
        width: 100%;
        padding:
            20px
            18px
            24px;
    }
    .celpip-section-heading {
        gap: 8px;
        margin-bottom: 15px;
        font-size:
            clamp(17px, 4.7cqi, 19px);
        line-height: 1.4;
    }
    .celpip-info-icon {
        flex-basis:
            clamp(21px, 6cqi, 23px);
        width:
            clamp(21px, 6cqi, 23px);
        height:
            clamp(21px, 6cqi, 23px);
        font-size:
            clamp(13px, 3.8cqi, 14px);
    }
    .celpip-reading-text {
        font-size:
            clamp(15px, 4.2cqi, 16px);
        line-height: 1.65;
    }
    .celpip-writing-requirements {
        margin:
            0
            0
            20px
            30px;
        font-size:
            clamp(15px, 4.2cqi, 16px);
        line-height: 1.5;
    }
    .celpip-answer-textarea {
        min-height: 300px;
        padding: 14px;
        font-size:
            clamp(15px, 4.2cqi, 16px);
        border-radius: 4px;
    }
    .celpip-exam-footer {
        min-height: 48px;
        padding:
            8px
            15px;
    }
}
/* =========================================================
   SMALL MOBILE
   ========================================================= */
@media (max-width: 420px) {
    .celpip-exam-heading {
        display: block;
    }
    .celpip-exam-title-separator {
        margin-inline: 3px;
    }
    .celpip-exam-timer-label {
        font-size: 13px;
    }
    .celpip-exam-timer-value {
        min-width: 44px;
        font-size: 14px;
    }
}

/* =========================================================
   CELPIP AI SCORE REPORT
   ========================================================= */

.celpip-ai-score-actions {
    margin-top: 14px;
    text-align: center;
}

.celpip-ai-score-button {
    min-width: 160px;
    padding: 10px 20px;
    border: 0;
    border-radius: 5px;
    background: #176ca8;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.celpip-ai-score-button:hover {
    opacity: .92;
}

.celpip-ai-score-button:disabled {
    opacity: .6;
    cursor: wait;
}

.celpip-ai-score-result {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #d3d9df;
    border-radius: 8px;
    background: #f8fafc;
    color: #2b3035;
    font-size: 14px;
    line-height: 1.6;
}

.celpip-ai-report-header {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #d8dde3;
}

.celpip-ai-report-score {
    font-size: 25px;
    font-weight: 700;
    line-height: 1.25;
}

.celpip-ai-report-range {
    margin-top: 4px;
    color: #5c636a;
}

.celpip-ai-dimensions {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0 20px;
}

.celpip-ai-dimension {
    padding: 12px;
    border: 1px solid #d8dde3;
    border-radius: 6px;
    background: #ffffff;
    text-align: center;
}

.celpip-ai-dimension-name {
    display: block;
    margin-bottom: 5px;
    color: #5c636a;
    font-size: 12px;
}

.celpip-ai-dimension-score {
    display: block;
    font-size: 22px;
    font-weight: 700;
}

.celpip-ai-section {
    margin-top: 18px;
}

.celpip-ai-section-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
}

.celpip-ai-section ul,
.celpip-ai-section ol {
    margin:
        6px
        0
        0
        22px;
    padding: 0;
}

.celpip-ai-task-item,
.celpip-ai-correction {
    margin-top: 10px;
    padding: 11px 12px;
    border: 1px solid #d8dde3;
    border-radius: 6px;
    background: #ffffff;
}

.celpip-ai-task-status {
    font-weight: 700;
}

.celpip-ai-original {
    margin-top: 6px;
}

.celpip-ai-suggested {
    margin-top: 6px;
    font-weight: 600;
}

.celpip-ai-reason {
    margin-top: 6px;
    color: #5c636a;
}

.celpip-ai-improved-version {
    margin-top: 8px;
    padding: 14px;
    border: 1px solid #d8dde3;
    border-radius: 6px;
    background: #ffffff;
    white-space: pre-wrap;
}

.celpip-ai-wrong-prompt {
    padding: 14px;
    border: 1px solid #d8dde3;
    border-radius: 6px;
    background: #ffffff;
}

@media (max-width: 760px) {
    .celpip-ai-dimensions {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .celpip-ai-score-result {
        padding: 14px;
    }
}

/* =========================================================
   CELPIP WT1 AI Sample Generator
   ========================================================= */

.celpip-ai-sample-generator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.celpip-ai-sample-label {
    font-weight: 600;
}

.celpip-ai-sample-level {
    min-width: 82px;
    padding: 8px 10px;
    border: 1px solid #c8cdd3;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
}

.celpip-ai-sample-button {
    padding: 9px 16px;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.celpip-ai-sample-button:disabled,
.celpip-ai-sample-level:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.celpip-ai-sample-result {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid #d9dee5;
    border-radius: 8px;
    background: #fff;
}

.celpip-ai-sample-header {
    margin-bottom: 12px;
}

.celpip-ai-sample-meta {
    margin-top: 4px;
    font-size: 14px;
    opacity: 0.8;
}

.celpip-ai-sample-answer {
    white-space: pre-wrap;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .celpip-ai-sample-generator {
        align-items: stretch;
    }

    .celpip-ai-sample-level,
    .celpip-ai-sample-button {
        width: 100%;
    }
}

/* =========================================================
   CELPIP AI actions row
   ========================================================= */

.celpip-ai-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    margin-bottom: 14px;
}

.celpip-ai-actions-left,
.celpip-ai-actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.celpip-ai-actions-right {
    margin-left: auto;
}

.celpip-ai-sample-button {
    min-height: 44px;
    padding: 10px 18px;
}

.celpip-ai-sample-level {
    min-width: 115px;
    min-height: 44px;
}

@media (max-width: 640px) {
    .celpip-ai-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .celpip-ai-actions-left,
    .celpip-ai-actions-right {
        width: 100%;
    }

    .celpip-ai-actions-right {
        margin-left: 0;
    }

    .celpip-ai-score-button,
    .celpip-ai-sample-button,
    .celpip-ai-sample-level {
        width: 100%;
    }
}

/* =========================================================
   Answer meta row: note left / word count right
   ========================================================= */

.celpip-answer-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
    margin-bottom: 14px;
}

.celpip-answer-meta-row .celpip-exam-note {
    margin: 0;
    text-align: left;
}

.celpip-answer-meta-row .celpip-word-count {
    margin: 0 0 0 auto;
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .celpip-answer-meta-row {
        gap: 10px;
    }

    .celpip-answer-meta-row .celpip-exam-note {
        font-size: 13px;
    }
}

/* =========================================================
   AI actions row
   ========================================================= */

.celpip-ai-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 12px;
    margin-bottom: 10px;
}

.celpip-ai-actions-left,
.celpip-ai-actions-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.celpip-ai-score-button,
.celpip-ai-sample-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 26px;
    border: 0;
    border-radius: 8px;
    background: #0d6fb8;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    appearance: none;
    -webkit-appearance: none;
}

.celpip-ai-score-button:hover,
.celpip-ai-sample-button:hover {
    background: #0b5f9d;
    color: #fff;
}

.celpip-ai-score-button:disabled,
.celpip-ai-sample-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.celpip-ai-sample-level {
    min-width: 80px;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #c8cdd3;
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
}

@media (max-width: 760px) {
    .celpip-ai-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .celpip-ai-actions-left,
    .celpip-ai-actions-right {
        width: 100%;
        justify-content: space-between;
    }
}


/* =========================================================
   CELPIP SPEAKING TASK 1
   ========================================================= */

.celpip-speaking-exam {
    max-width: 980px;
}


/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */

.celpip-speaking-exam .celpip-exam-header {
    min-height: 42px;
    padding:
        6px
        18px;
    gap: 14px;
}

.celpip-speaking-exam .celpip-exam-heading {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 5px;
    font-size:
        clamp(14px, 1.65cqi, 16px);
    font-weight: 600;
    white-space: nowrap;
}

.celpip-speaking-exam .celpip-exam-article-title,
.celpip-speaking-exam .celpip-exam-task-name {
    font-weight: 600;
}

.celpip-speaking-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.celpip-speaking-header-time {
    font-size:
        clamp(12px, 1.45cqi, 14px);
    line-height: 1;
    color: #30343a;
    white-space: nowrap;
}

.celpip-speaking-header-time strong {
    font-weight: 700;
    color: #111111;
}

.celpip-speaking-exam .celpip-exam-next {
    min-width: 58px;
    height: 27px;
    padding-inline: 10px;
    margin-left: 8px;
    font-size:
        clamp(12px, 1.35cqi, 13px);
}


/* ---------------------------------------------------------
   Body
   --------------------------------------------------------- */

.celpip-speaking-exam .celpip-speaking-body {
    min-height: 670px;
    padding:
        20px
        20px
        28px;
    background: #ffffff;
    box-sizing: border-box;
}


/* ---------------------------------------------------------
   Question
   --------------------------------------------------------- */

.celpip-speaking-exam .celpip-speaking-question-heading {
    margin:
        0
        0
        20px;
    gap: 8px;
    color: #075c9d;
    font-size:
        clamp(15px, 1.8cqi, 17px);
    font-weight: 700;
    line-height: 1.3;
}

.celpip-speaking-exam .celpip-info-icon {
    flex:
        0
        0
        18px;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    font-size: 12px;
}

.celpip-speaking-divider {
    width: 100%;
    height: 1px;
    margin:
        0
        0
        20px;
    background: #e2e5e8;
}


/* ---------------------------------------------------------
   Preparation / Recording card
   --------------------------------------------------------- */

.celpip-speaking-timer-card {
    width: 375px;
    max-width: 100%;
    min-height: 106px;
    margin:
        0
        auto
        28px;
    display: flex;
    align-items: center;
    background: #d9dde3;
    border-radius: 10px;
    overflow: hidden;
    box-sizing: border-box;
}

.celpip-speaking-clock-icon {
    flex:
        0
        0
        66px;
    width: 66px;
    height: 66px;
    margin-left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: #f4f5f6;
    color: #a6a9ac;
    font-size: 43px;
    line-height: 1;
    box-sizing: border-box;
}

.celpip-speaking-timer-content {
    flex: 1 1 auto;
    padding:
        18px
        22px
        18px
        18px;
    text-align: center;
    box-sizing: border-box;
}

.celpip-speaking-timer-label {
    margin-bottom: 10px;
    color: #111111;
    font-size:
        clamp(15px, 1.8cqi, 17px);
    line-height: 1.2;
}

.celpip-speaking-timer-value {
    color: #0066cc;
    font-size:
        clamp(15px, 1.7cqi, 17px);
    line-height: 1;
}


/* ---------------------------------------------------------
   Note
   --------------------------------------------------------- */

.celpip-speaking-exam .celpip-speaking-note {
    margin:
        0;
    text-align: left;
    color: #3f474e;
    font-size:
        clamp(12px, 1.35cqi, 14px);
    line-height: 1.4;
}

.celpip-speaking-exam .celpip-speaking-note strong {
    font-weight: 700;
}


/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.celpip-speaking-exam .celpip-exam-footer {
    min-height: 50px;
    padding:
        8px
        30px;
}

.celpip-speaking-back {
    min-width: 58px !important;
    height: 27px !important;
    padding-inline: 10px !important;
    font-size:
        clamp(12px, 1.35cqi, 13px) !important;
}


/* ---------------------------------------------------------
   Tablet / mobile
   --------------------------------------------------------- */

@media (max-width: 767px) {

    .celpip-speaking-exam .celpip-exam-header {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
        padding:
            10px
            14px;
    }

    .celpip-speaking-exam .celpip-exam-heading {
        flex-wrap: wrap;
        white-space: normal;
        font-size:
            clamp(14px, 4.2cqi, 16px);
    }

    .celpip-speaking-header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 6px 12px;
    }

    .celpip-speaking-exam .celpip-exam-next {
        margin-left: auto;
    }

    .celpip-speaking-exam .celpip-speaking-body {
        min-height: 0;
        padding:
            18px
            16px
            24px;
    }

    .celpip-speaking-exam .celpip-speaking-question-heading {
        font-size:
            clamp(16px, 4.6cqi, 18px);
    }

    .celpip-speaking-timer-card {
        width: 100%;
        min-height: 96px;
    }

    .celpip-speaking-clock-icon {
        flex-basis: 58px;
        width: 58px;
        height: 58px;
        margin-left: 14px;
        font-size: 38px;
    }

    .celpip-speaking-exam .celpip-exam-footer {
        min-height: 48px;
        padding:
            8px
            16px;
    }

}


/* =========================================================
   CELPIP SPEAKING VIEWPORT HEIGHT
   Keep header/body/footer inside the visible screen
   ========================================================= */

.celpip-speaking-exam {
    height: calc(100dvh - 145px);
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

.celpip-speaking-exam .celpip-speaking-body {
    flex: 1 1 auto;
    min-height: 0;
}

.celpip-speaking-exam .celpip-exam-header,
.celpip-speaking-exam .celpip-exam-footer {
    flex: 0 0 auto;
}

@media (max-width: 767px) {

    .celpip-speaking-exam {
        height: auto;
        min-height: 0;
    }

}


/* ---------------------------------------------------------
   Speaking fixed instruction heading
   Used by Task 7
   --------------------------------------------------------- */

.celpip-speaking-fixed-heading {
    margin:
        0
        0
        12px;
    color: #30363c;
    font-size:
        clamp(15px, 1.7cqi, 17px);
    font-weight: 700;
    line-height: 1.4;
}

@media (max-width: 767px) {

    .celpip-speaking-fixed-heading {
        font-size:
            clamp(15px, 4.3cqi, 17px);
    }

}


/* ---------------------------------------------------------
   Speaking image content
   Shared by Task 3 / 4 / 8
   --------------------------------------------------------- */

.celpip-speaking-image-wrap {
    width: 100%;
    margin:
        0
        auto
        22px;
    text-align: center;
}

.celpip-speaking-question-image {
    display: block;
    max-width: 100%;
    max-height: 360px;
    margin: 0 auto;
    object-fit: contain;
    border: 0;
}

@media (max-width: 767px) {

    .celpip-speaking-question-image {
        max-height: 280px;
    }

}


/* =========================================================
   CELPIP Speaking Task 3 / 4
   Picture left + preparation timer right
   ========================================================= */

.celpip-speaking-image-timer-layout {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 34px;
    margin: 0 0 20px;
    box-sizing: border-box;
}

.celpip-speaking-image-column {
    flex: 1 1 62%;
    min-width: 0;
}

.celpip-speaking-timer-column {
    flex: 0 1 375px;
    min-width: 280px;
}

.celpip-speaking-image-timer-layout .celpip-speaking-image-wrap {
    width: 100%;
    margin: 0 0 12px;
    text-align: center;
}

.celpip-speaking-image-timer-layout .celpip-speaking-question-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 430px;
    margin: 0 auto;
    object-fit: contain;
}

.celpip-speaking-image-timer-layout .celpip-speaking-timer-card {
    width: 100%;
    margin: 0;
}

.celpip-speaking-image-timer-layout .celpip-speaking-note {
    margin: 0;
}

@media (max-width: 767px) {

    .celpip-speaking-image-timer-layout {
        flex-direction: column;
        gap: 18px;
    }

    .celpip-speaking-image-column,
    .celpip-speaking-timer-column {
        width: 100%;
        min-width: 0;
        flex-basis: auto;
    }

    .celpip-speaking-image-timer-layout .celpip-speaking-timer-card {
        width: 100%;
    }

}

/* =========================================================
   CELPIP Speaking internal vertical scrolling
   Keep header/footer fixed inside the exam frame
   ========================================================= */

.celpip-speaking-exam .celpip-speaking-body {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}


/* =========================================================
   Speaking Task 5 - Page 1
   ========================================================= */

.celpip-speaking-task5[data-speaking-phase="intro"]
.celpip-speaking-header-time {
    display: none;
}

.celpip-speaking-task5-stage-intro {
    min-height: 560px;
    padding: 18px 26px 30px;
}

.celpip-task5-intro-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    margin-bottom: 16px;
}

.celpip-task5-intro-content {
    padding-left: 28px;
    font-size: 18px;
    line-height: 1.45;
}

.celpip-task5-intro-content p {
    margin: 0 0 14px;
}

.celpip-task5-intro-content ol {
    margin: 0 0 28px 22px;
    padding-left: 18px;
    font-weight: 600;
}

.celpip-task5-intro-next {
    margin-top: 24px !important;
}

/* =========================================================
   Speaking Task 5 - Page 2 / Page 3
   ========================================================= */

/* ---------- Shared two-column layout ---------- */

.celpip-speaking-task5-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    margin-top: 16px;
}

.celpip-speaking-task5-option {
    box-sizing: border-box;
    min-width: 0;
    height: 100%;
    border: 1px solid #222;
    background: #fff;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.celpip-speaking-task5-option h3 {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 700;
}

.celpip-speaking-task5-option img {
    display: block;
    width: 100%;
    height: 270px;
    object-fit: cover;
    margin: 0 0 10px;
}

.celpip-speaking-task5-details {
    margin-top: 8px;
    font-size: 16px;
    line-height: 1.5;
}


/* ---------- Page 2: Choosing ---------- */

.celpip-speaking-task5-stage-choosing {
    padding: 14px 18px 28px;
}

.celpip-speaking-task5-stage-choosing
.celpip-speaking-question-heading {
    margin-bottom: 8px;
}

.celpip-speaking-task5-stage-choosing
.celpip-speaking-task5-option {
    cursor: pointer;
    transition:
        background-color .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}

.celpip-speaking-task5-stage-choosing
.celpip-speaking-task5-option:hover {
    border-color: #4b7f95;
}

.celpip-speaking-task5-stage-choosing
.celpip-speaking-task5-option.is-selected {
    background: #abd7e6;
    border-color: #477d92;
    box-shadow: inset 0 0 0 1px #477d92;
}


/* ---------- Page 3: Persuasion ---------- */

.celpip-speaking-task5-stage-persuasion {
    padding: 14px 18px 28px;
}

.celpip-speaking-task5-stage-persuasion
.celpip-speaking-question-heading {
    margin-bottom: 8px;
}

.celpip-speaking-task5-stage-persuasion
.celpip-speaking-task5-option {
    padding: 20px;
}

.celpip-speaking-task5-stage-persuasion
.celpip-speaking-task5-option:first-child {
    background: #fff;
}

.celpip-speaking-task5-stage-persuasion
.celpip-speaking-task5-option:last-child {
    background: #edf9df;
}

.celpip-speaking-task5-stage-persuasion
.celpip-speaking-task5-option h3 {
    text-align: center;
    margin-bottom: 10px;
}

.celpip-speaking-task5-stage-persuasion
.celpip-speaking-task5-option img {
    height: 270px;
}


/* ---------- Prevent uneven card heights ---------- */

.celpip-speaking-task5-stage-choosing
.celpip-speaking-task5-options,
.celpip-speaking-task5-stage-persuasion
.celpip-speaking-task5-options {
    grid-auto-rows: 1fr;
}


/* ---------- Mobile ---------- */

@media (max-width: 767px) {

    .celpip-speaking-task5-options {
        grid-template-columns: 1fr;
    }

    .celpip-speaking-task5-option img {
        height: auto;
        max-height: none;
    }

}

/* =========================================================
   CELPIP Speaking Header
   Fixed title width + wrap
   ========================================================= */

.celpip-speaking-exam .celpip-exam-header {
    display: grid;
    grid-template-columns: minmax(0, 760px) auto;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

.celpip-speaking-exam .celpip-exam-heading {
    min-width: 0;
    max-width: 760px;
    display: block;
    line-height: 1.35;
}

.celpip-speaking-exam .celpip-exam-article-title,
.celpip-speaking-exam .celpip-exam-title-separator,
.celpip-speaking-exam .celpip-exam-task-name {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.celpip-speaking-exam .celpip-exam-header-actions {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 991px) {
    .celpip-speaking-exam .celpip-exam-header {
        grid-template-columns: 1fr;
    }

    .celpip-speaking-exam .celpip-exam-heading {
        max-width: 100%;
    }

    .celpip-speaking-exam .celpip-exam-header-actions {
        white-space: normal;
    }
}
/* =========================================================
   CELPIP Speaking Task 6 choices
   ========================================================= */

.celpip-speaking-task6 .celpip-speaking-task6-choices {
    margin-top: 22px;
    margin-bottom: 24px;
}

.celpip-speaking-task6 .celpip-speaking-task6-choose-one {
    margin-bottom: 16px;
    font-size: 17px;
    line-height: 1.5;
}

.celpip-speaking-task6 .celpip-speaking-task6-choice-row {
    display: grid;
    grid-template-columns: 22px 90px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin-bottom: 18px;
    cursor: pointer;
}

.celpip-speaking-task6 .celpip-speaking-task6-choice-label {
    font-weight: 700;
    line-height: 1.6;
}

.celpip-speaking-task6 .celpip-speaking-task6-choice-text {
    line-height: 1.6;
    overflow-wrap: anywhere;
}

@media (max-width: 767px) {
    .celpip-speaking-task6 .celpip-speaking-task6-choice-row {
        grid-template-columns: 22px 64px minmax(0, 1fr);
        gap: 10px;
    }
}

/* =========================================================
   Speaking Task 8 — AI Sample Generator layout
   ========================================================= */

.celpip-speaking-task8 .celpip-ai-actions-row {
    justify-content: flex-start;
    gap: 12px;
    margin-top: 18px;
}

.celpip-speaking-task8 .celpip-ai-actions-left {
    display: none;
}

.celpip-speaking-task8 .celpip-ai-actions-right {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.celpip-speaking-task8 .celpip-ai-sample-button {
    width: auto;
    min-width: 180px;
}

.celpip-speaking-task8 .celpip-ai-sample-level {
    width: auto;
    min-width: 170px;
}

.celpip-speaking-task8 .celpip-ai-sample-result {
    margin-top: 16px;
}

@media (max-width: 768px) {
    .celpip-speaking-task8 .celpip-ai-actions-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .celpip-speaking-task8 .celpip-ai-sample-button,
    .celpip-speaking-task8 .celpip-ai-sample-level {
        width: 100%;
    }
}

/* Speaking Task 8 AI controls — centered below CELPIP exam */
.celpip-sp8-ai-section .celpip-ai-actions-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 22px;
    margin-bottom: 16px;
}

.celpip-sp8-ai-section .celpip-ai-actions-left {
    display: none;
}

.celpip-sp8-ai-section .celpip-ai-actions-right {
    width: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.celpip-sp8-ai-section .celpip-ai-sample-button {
    width: auto;
    min-width: 210px;
}

.celpip-sp8-ai-section .celpip-ai-sample-level {
    width: 180px;
}

@media (max-width: 768px) {
    .celpip-sp8-ai-section .celpip-ai-actions-right {
        width: 100%;
        padding: 0 15px;
        flex-wrap: wrap;
    }

    .celpip-sp8-ai-section .celpip-ai-sample-button,
    .celpip-sp8-ai-section .celpip-ai-sample-level {
        width: 100%;
    }
}

.celpip-sp8-ai-section .celpip-ai-actions-right {
    margin-left: 0;
}

/* =========================================================
   Speaking Task 8 AI section
   - same width as speaking exam
   - more visible with light background
   ========================================================= */
.celpip-sp8-ai-section {
    max-width: 980px;
    width: 100%;
    margin: 18px auto 0;
    padding: 18px 20px 22px;
    box-sizing: border-box;
    background: #f4f9ff;
    border: 1px solid #d9e7f5;
    border-radius: 14px;
}

.celpip-sp8-ai-section .celpip-ai-actions-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 0 0 18px;
}

.celpip-sp8-ai-section .celpip-ai-actions-left {
    display: none;
}

.celpip-sp8-ai-section .celpip-ai-actions-right {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    width: auto;
    margin-left: 0;
}

.celpip-sp8-ai-section .celpip-ai-sample-button {
    min-width: 220px;
    min-height: 48px;
}

.celpip-sp8-ai-section .celpip-ai-sample-level {
    width: 180px;
    min-height: 48px;
}

.celpip-sp8-ai-section .celpip-ai-sample-result {
    width: 100%;
    margin: 0;
    padding: 22px 22px 18px;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #d9e7f5;
    border-radius: 12px;
}

.celpip-sp8-ai-section .celpip-ai-sample-result h3,
.celpip-sp8-ai-section .celpip-ai-sample-result .celpip-ai-sample-header {
    margin-top: 0;
}

@media (max-width: 768px) {
    .celpip-sp8-ai-section {
        padding: 15px;
    }

    .celpip-sp8-ai-section .celpip-ai-actions-row,
    .celpip-sp8-ai-section .celpip-ai-actions-right {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .celpip-sp8-ai-section .celpip-ai-sample-button,
    .celpip-sp8-ai-section .celpip-ai-sample-level {
        width: 100%;
    }
}

/* =========================================================
   Speaking AI section — shared by Task 5 and Task 8
   ========================================================= */

.celpip-speaking-ai-section {
    max-width: 980px;
    width: 100%;
    margin: 18px auto 0;
    padding: 18px 20px 22px;
    box-sizing: border-box;
    background: #f4f9ff;
    border: 1px solid #d9e7f5;
    border-radius: 14px;
}

.celpip-speaking-ai-section .celpip-ai-actions-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 0 0 18px;
}

.celpip-speaking-ai-section .celpip-ai-actions-left {
    display: none;
}

.celpip-speaking-ai-section .celpip-ai-actions-right {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    width: auto;
    margin-left: 0;
}

.celpip-speaking-ai-section .celpip-ai-sample-button {
    width: auto;
    min-width: 220px;
    min-height: 48px;
}

.celpip-speaking-ai-section .celpip-ai-sample-level {
    width: 180px;
    min-height: 48px;
}

.celpip-speaking-ai-section .celpip-ai-sample-result {
    width: 100%;
    margin: 0;
    padding: 22px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #d9e7f5;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .celpip-speaking-ai-section {
        padding: 15px;
    }

    .celpip-speaking-ai-section .celpip-ai-actions-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .celpip-speaking-ai-section .celpip-ai-sample-button,
    .celpip-speaking-ai-section .celpip-ai-sample-level {
        width: 100%;
    }
}

/* Phone layout: bottom NEXT on the BACK row, far left (2026-11-04). */
.celpip-next-bottom {
    display: none;
}

@media (max-width: 767px) {
    .celpip-next-bottom {
        display: inline-flex;
    }
}
