/* DET Practice Test simulation runner and results.
   Visual language follows the DET-style mock test while inheriting the
   learner's shared PrepEx DET theme preference. */

:root {
    --det-pt-bg: #f6f7f9;
    --det-pt-card: #ffffff;
    --det-pt-ink: #1f2d3d;
    --det-pt-muted: #6b7a8c;
    --det-pt-line: #e4e8ee;
    --det-pt-accent: #ffb020;
    --det-pt-accent-soft: #ffe6b8;
    --det-pt-primary: #3d5a80;
    --det-pt-primary-text: #3d5a80;
    --det-pt-primary-ink: #ffffff;
    --det-pt-blue: #326fb7;
    --det-pt-green-soft: #e3f6e6;
    --det-pt-green-line: #7fce8f;
    --det-pt-red-soft: #fdeaea;
    --det-pt-red-line: #e58c8c;
    --det-pt-red-ink: #b23b3b;
    --det-pt-surface-raised: #fdfefe;
    --det-pt-surface-soft: #f6f8fa;
    --det-pt-surface-subtle: #fbfcfe;
    --det-pt-field: #ffffff;
    --det-pt-field-border: #cdd5de;
    --det-pt-field-muted: #f2f5f8;
    --det-pt-placeholder: #9aa6b3;
    --det-pt-disabled: #d5dbe3;
    --det-pt-disabled-strong: #c7d4e8;
    --det-pt-track: #eceff3;
    --det-pt-selected: #eef3fa;
    --det-pt-tint-blue: #eef3fd;
    --det-pt-tint-purple: #f1effd;
    --det-pt-tint-green: #eafaf0;
    --det-pt-highlight: #ffe9a8;
    --det-pt-waveform: #d3dbe4;
    --det-pt-path: #f8fafc;
    --det-pt-path-step: #e6ebf1;
    --det-pt-warning: #d96b0b;
    --det-pt-success: #2e9e54;
    --det-pt-shadow: 0 10px 30px rgba(31, 45, 61, 0.06);
    --det-pt-radius: 16px;
}

body.dark-mode .det-pt-shell,
body.dark-mode .det-pt-results-shell,
body.dark-mode .det-pt-modal {
    --det-pt-bg: #101512;
    --det-pt-card: #19211c;
    --det-pt-ink: #e8eee9;
    --det-pt-muted: #a2b0a8;
    --det-pt-line: #34443b;
    --det-pt-accent: #e5b768;
    --det-pt-accent-soft: #493d24;
    --det-pt-primary: #356b55;
    --det-pt-primary-text: #a8d5bc;
    --det-pt-blue: #326fb7;
    --det-pt-green-soft: #1f3b2b;
    --det-pt-green-line: #447e59;
    --det-pt-red-soft: #402525;
    --det-pt-red-line: #8e4f4f;
    --det-pt-red-ink: #ff9b9b;
    --det-pt-surface-raised: #1c251f;
    --det-pt-surface-soft: #202a24;
    --det-pt-surface-subtle: #1c251f;
    --det-pt-field: #151c18;
    --det-pt-field-border: #405047;
    --det-pt-field-muted: #202a24;
    --det-pt-placeholder: #829087;
    --det-pt-disabled: #34443b;
    --det-pt-disabled-strong: #405047;
    --det-pt-track: #344139;
    --det-pt-selected: #22392f;
    --det-pt-tint-blue: #223149;
    --det-pt-tint-purple: #302b46;
    --det-pt-tint-green: #21382b;
    --det-pt-highlight: #665429;
    --det-pt-waveform: #4a5a51;
    --det-pt-path: #202a24;
    --det-pt-path-step: #34443b;
    --det-pt-warning: #f0b36b;
    --det-pt-success: #74d59e;
    --det-pt-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.det-pt-shell,
.det-pt-results-shell {
    min-height: calc(100vh - 60px);
    background: var(--det-pt-bg);
    display: flex;
    justify-content: center;
    padding: 28px 16px 48px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--det-pt-ink);
    color-scheme: light;
}

body.dark-mode .det-pt-shell,
body.dark-mode .det-pt-results-shell,
body.dark-mode .det-pt-modal {
    color-scheme: dark;
}

.det-pt-shell textarea,
.det-pt-shell input,
.det-pt-shell select,
.det-pt-results-shell textarea,
.det-pt-results-shell input {
    background-color: var(--det-pt-field);
    color: var(--det-pt-ink);
}

.det-pt-shell ::placeholder {
    color: var(--det-pt-placeholder);
    opacity: 1;
}

.det-pt-card {
    width: 100%;
    max-width: 920px;
    background: var(--det-pt-card);
    border: 1px solid var(--det-pt-line);
    border-radius: var(--det-pt-radius);
    box-shadow: var(--det-pt-shadow);
    padding: 28px 34px 24px;
    display: flex;
    flex-direction: column;
    min-height: 620px;
}

.det-pt-loading {
    margin: auto;
    color: var(--det-pt-muted);
    font-size: 15px;
}

/* ------------------------------------------------------------------ */
/* Header: timer + progress                                            */
/* ------------------------------------------------------------------ */

.det-pt-header {
    margin-bottom: 18px;
}

.det-pt-timer {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--det-pt-ink);
    font-variant-numeric: tabular-nums;
}

.det-pt-timer.warning { color: var(--det-pt-warning); }

.det-pt-progress {
    margin-top: 8px;
    height: 6px;
    border-radius: 999px;
    background: var(--det-pt-track);
    overflow: hidden;
}

.det-pt-progress span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--det-pt-accent);
    transition: width 300ms ease;
}

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

.det-pt-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.det-pt-task-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin: 10px 0 26px;
}

.det-pt-subcopy {
    text-align: center;
    color: var(--det-pt-muted);
    font-size: 13.5px;
    margin: -16px 0 22px;
}

/* Footer */
.det-pt-footer {
    border-top: 1px solid var(--det-pt-line);
    margin-top: 26px;
    padding-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.det-pt-btn {
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    border-radius: 10px;
    padding: 11px 26px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 150ms ease, opacity 150ms ease;
}

.det-pt-btn-primary {
    background: var(--det-pt-primary);
    color: var(--det-pt-primary-ink);
}

.det-pt-btn-primary:disabled {
    background: var(--det-pt-disabled);
    color: var(--det-pt-placeholder);
    cursor: not-allowed;
}

.det-pt-btn-outline {
    background: var(--det-pt-field);
    color: var(--det-pt-primary-text);
    border-color: var(--det-pt-primary-text);
}

.det-pt-btn-blue {
    background: var(--det-pt-blue);
    color: #fff;
}

.det-pt-btn:focus-visible {
    outline: 3px solid rgba(47, 128, 237, 0.35);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Intro + speaker check                                               */
/* ------------------------------------------------------------------ */

.det-pt-intro-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin: 26px 0 34px;
}

.det-pt-checklist {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}

.det-pt-check-card {
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--det-pt-line);
    border-radius: 14px;
    padding: 18px 20px;
    background: var(--det-pt-surface-raised);
}

.det-pt-check-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--det-pt-line);
}

.det-pt-check-icon svg { width: 24px; height: 24px; stroke: var(--det-pt-primary-text); fill: none; stroke-width: 1.8; }
.det-pt-check-icon.tint-blue { background: var(--det-pt-tint-blue); }
.det-pt-check-icon.tint-purple { background: var(--det-pt-tint-purple); }
.det-pt-check-icon.tint-green { background: var(--det-pt-tint-green); }

.det-pt-check-card strong { font-size: 15px; font-weight: 600; }

.det-pt-note {
    max-width: 640px;
    margin: 26px auto 0;
    background: var(--det-pt-surface-soft);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--det-pt-muted);
    font-size: 13px;
    text-align: center;
}

.det-pt-readiness-disclaimer {
    margin-top: 12px;
    text-align: left;
    line-height: 1.55;
}

.det-pt-readiness-disclaimer strong {
    color: var(--det-pt-ink);
}

.det-pt-readiness-disclaimer a {
    color: var(--det-pt-primary-text);
    font-weight: 700;
}

.det-pt-speaker-copy {
    max-width: 560px;
    margin: 0 auto 26px;
    text-align: center;
    color: var(--det-pt-ink);
    font-size: 14.5px;
    line-height: 1.6;
}

.det-pt-bigplay {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: none;
    background: var(--det-pt-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(47, 128, 237, 0.35);
}

.det-pt-bigplay svg { width: 30px; height: 30px; fill: #fff; margin-left: 4px; }
.det-pt-bigplay.playing { opacity: 0.75; }
.det-pt-bigplay:disabled { background: var(--det-pt-disabled-strong); cursor: not-allowed; box-shadow: none; }

.det-pt-equipment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

.det-pt-equipment-card,
.det-pt-resume-microphone {
    border: 1px solid var(--det-pt-line);
    border-radius: 14px;
    background: var(--det-pt-surface-raised);
    padding: 22px;
    text-align: center;
}

.det-pt-resume-microphone {
    max-width: 520px;
    margin: 0 auto;
}

.det-pt-equipment-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--det-pt-tint-blue);
    color: var(--det-pt-primary-text);
}

.det-pt-equipment-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.det-pt-equipment-card h2,
.det-pt-resume-microphone h2 {
    margin: 14px 0 7px;
    font-size: 16px;
}

.det-pt-equipment-card p,
.det-pt-resume-microphone > p {
    min-height: 42px;
    margin: 0 0 16px;
    color: var(--det-pt-muted);
    font-size: 12.5px;
    line-height: 1.55;
}

.det-pt-equipment-button {
    min-height: 42px;
    border: 1px solid var(--det-pt-primary);
    border-radius: 8px;
    background: var(--det-pt-card);
    color: var(--det-pt-primary-text);
    padding: 9px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}

.det-pt-equipment-button:hover:not(:disabled) {
    background: var(--det-pt-selected);
}

.det-pt-equipment-button:focus-visible,
.det-pt-record-btn:focus-visible {
    outline: 3px solid rgba(47, 128, 237, 0.35);
    outline-offset: 2px;
}

.det-pt-equipment-button:disabled {
    border-color: var(--det-pt-line);
    color: var(--det-pt-muted);
    cursor: wait;
}

.det-pt-equipment-confirm {
    display: block;
    width: 100%;
    margin-top: 10px;
    border-color: var(--det-pt-line);
}

.det-pt-device-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.det-pt-device-label {
    color: var(--det-pt-ink);
    font-size: 11.5px;
    font-weight: 600;
}

.det-pt-device-select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--det-pt-line);
    border-radius: 8px;
    background: var(--det-pt-card);
    color: var(--det-pt-ink);
    padding: 8px 34px 8px 10px;
    font: 500 12.5px/1.35 inherit;
}

.det-pt-device-select:focus,
.det-pt-device-select:focus-visible {
    outline: 3px solid rgba(47, 128, 237, 0.35);
    outline-offset: 2px;
}

.det-pt-sample-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.det-pt-sample-countdown {
    min-width: 38px;
    color: var(--det-pt-ink);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: center;
}

.det-pt-equipment-status {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    min-height: 20px !important;
    margin: 14px 0 0 !important;
    color: var(--det-pt-muted) !important;
    font-size: 11.5px !important;
}

.det-pt-equipment-status > span:first-child {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--det-pt-disabled-strong);
}

.det-pt-equipment-status[data-state="checking"] > span:first-child { background: var(--det-pt-warning); }
.det-pt-equipment-status[data-state="ready"] { color: var(--det-pt-success) !important; }
.det-pt-equipment-status[data-state="ready"] > span:first-child { background: var(--det-pt-success); }
.det-pt-equipment-status[data-state="error"] { color: var(--det-pt-red-ink) !important; }
.det-pt-equipment-status[data-state="error"] > span:first-child { background: var(--det-pt-red-ink); }

/* ------------------------------------------------------------------ */
/* Read and Select                                                     */
/* ------------------------------------------------------------------ */

.det-pt-word {
    text-align: center;
    font-size: 44px;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin: 46px 0 42px;
}

.det-pt-binary-row {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.det-pt-binary-btn {
    min-width: 96px;
    padding: 10px 22px;
    border-radius: 8px;
    border: 1px solid var(--det-pt-line);
    background: var(--det-pt-field);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--det-pt-ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.det-pt-binary-btn:hover { border-color: var(--det-pt-primary-text); }
.det-pt-binary-btn.selected { border-color: var(--det-pt-primary-text); background: var(--det-pt-selected); }
.det-pt-binary-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.det-pt-binary-btn .mark { color: var(--det-pt-muted); font-size: 13px; }

/* ------------------------------------------------------------------ */
/* Letter boxes (Fill in the Blanks / Read and Complete)               */
/* ------------------------------------------------------------------ */

.det-pt-sentence-frame {
    border: 1px solid var(--det-pt-line);
    border-radius: 12px;
    padding: 34px 30px;
    margin: 8px auto 0;
    max-width: 720px;
    width: 100%;
    font-size: 15px;
    line-height: 2.4;
    text-align: left;
}

.det-pt-passage-frame {
    border: 1px solid var(--det-pt-line);
    border-radius: 12px;
    padding: 26px 30px;
    margin: 0 auto;
    max-width: 760px;
    width: 100%;
    font-size: 14.5px;
    line-height: 2.5;
}

.det-pt-passage-frame h3 {
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 14px;
}

.det-pt-letter-guidance {
    color: var(--det-pt-muted);
    font-size: 12.5px;
    font-weight: 500;
    margin: -8px auto 14px;
    max-width: 760px;
    text-align: center;
}

.det-pt-boxes {
    align-items: center;
    display: inline-flex;
    gap: 2px;
    line-height: 1;
    vertical-align: middle;
    margin: 0 2px;
    white-space: nowrap;
}

.det-pt-box {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: block;
    flex: 0 0 24px;
    width: 24px;
    height: 28px;
    border: 2px solid var(--det-pt-primary-text);
    border-radius: 4px;
    text-align: center;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 24px;
    color: var(--det-pt-ink);
    background: var(--det-pt-field);
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

.det-pt-boxes span.det-pt-box {
    display: inline-grid;
    line-height: 1;
    place-items: center;
}

.det-pt-box.prefix {
    background: var(--det-pt-field-muted);
    color: var(--det-pt-muted);
    border: 1px solid var(--det-pt-line);
    font-weight: 600;
}

.det-pt-box.prefix + .det-pt-box:not(.prefix) {
    margin-left: 3px;
}

.det-pt-box:focus {
    outline: none;
    border-color: var(--det-pt-primary-text);
    box-shadow: 0 0 0 3px var(--det-pt-selected);
}

/* ------------------------------------------------------------------ */
/* Listen and Type                                                     */
/* ------------------------------------------------------------------ */

.det-pt-dictation {
    display: flex;
    gap: 26px;
    align-items: flex-start;
    justify-content: center;
    margin-top: 12px;
}

.det-pt-textarea {
    width: 100%;
    min-height: 120px;
    border: 1px solid var(--det-pt-field-border);
    border-radius: 10px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--det-pt-ink);
    resize: vertical;
}

.det-pt-textarea:focus {
    outline: none;
    border-color: var(--det-pt-blue);
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.15);
}

.det-pt-dictation-field { flex: 1; max-width: 420px; }

.det-pt-replays {
    margin-top: 10px;
    font-size: 13px;
    color: var(--det-pt-ink);
}

/* ------------------------------------------------------------------ */
/* Interactive Reading                                                 */
/* ------------------------------------------------------------------ */

.det-pt-ir-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 24px;
    flex: 1;
    min-height: 0;
}

.det-pt-ir-passage {
    border: 1px solid var(--det-pt-line);
    border-radius: 12px;
    padding: 18px 20px;
    font-size: 13.5px;
    line-height: 2.1;
    overflow-y: auto;
    max-height: 520px;
    white-space: pre-line;
}

.det-pt-ir-passage .kicker {
    display: block;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--det-pt-muted);
    margin-bottom: 10px;
}

.det-pt-ir-blank-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px dashed var(--det-pt-field-border);
    border-radius: 8px;
    padding: 1px 12px;
    margin: 0 3px;
    background: var(--det-pt-surface-subtle);
    min-width: 88px;
    justify-content: center;
}

.det-pt-ir-blank-chip.filled { border-style: solid; border-color: var(--det-pt-blue); background: var(--det-pt-field); }
.det-pt-ir-blank-chip .num {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--det-pt-blue);
    color: #fff;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.det-pt-ir-gap {
    display: inline-block;
    border: 1px dashed var(--det-pt-field-border);
    border-radius: 8px;
    background: var(--det-pt-surface-subtle);
    min-width: 200px;
    min-height: 26px;
    vertical-align: middle;
    margin: 0 3px;
    padding: 2px 10px;
}

.det-pt-ir-tasks h3 {
    font-size: 15.5px;
    font-weight: 700;
    margin: 4px 0 16px;
}

.det-pt-ir-selects { display: flex; flex-direction: column; gap: 10px; }

.det-pt-ir-select-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--det-pt-line);
    border-radius: 10px;
    padding: 8px 12px;
}

.det-pt-ir-select-row.active { border-color: var(--det-pt-blue); }
.det-pt-ir-select-row .num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--det-pt-line);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--det-pt-ink);
}

.det-pt-ir-select-row select {
    flex: 1;
    border: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--det-pt-ink);
    background: transparent;
    cursor: pointer;
}
.det-pt-ir-select-row select:focus { outline: none; }

.det-pt-ir-select-row option {
    background-color: var(--det-pt-field);
    color: var(--det-pt-ink);
}

.det-pt-options { display: flex; flex-direction: column; gap: 10px; }

.det-pt-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border: 1px solid var(--det-pt-line);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    font-size: 13.5px;
    line-height: 1.5;
    background: var(--det-pt-field);
}

.det-pt-option:hover { border-color: var(--det-pt-primary-text); }
.det-pt-option.selected { border-color: var(--det-pt-blue); background: var(--det-pt-selected); }
.det-pt-option input { margin-top: 3px; accent-color: var(--det-pt-blue); }

.det-pt-highlight-box {
    border: 1px solid var(--det-pt-field-border);
    border-radius: 10px;
    min-height: 130px;
    padding: 12px 14px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--det-pt-ink);
    background: var(--det-pt-surface-raised);
}

.det-pt-highlight-box.empty { color: var(--det-pt-muted); }

.det-pt-ir-passage.highlightable { cursor: text; }
.det-pt-ir-passage.highlightable::selection,
.det-pt-ir-passage.highlightable *::selection { background: var(--det-pt-highlight); }
.det-pt-ir-passage mark.det-pt-mark { background: var(--det-pt-highlight); color: inherit; padding: 0; }

/* ------------------------------------------------------------------ */
/* Interactive Listening                                               */
/* ------------------------------------------------------------------ */

.det-pt-il-scenario-stage {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.det-pt-il-scenario-stage.is-listening-only {
    justify-content: center;
    padding-bottom: 68px;
}

.det-pt-il-scenario-stage.is-listening-only .det-pt-task-title {
    margin-top: 0;
}

.det-pt-il-scenario-stage.is-questions-visible {
    justify-content: flex-start;
}

.det-pt-il-conversation-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 24px;
    align-items: start;
    width: 100%;
}

.det-pt-il-reference {
    background: var(--det-pt-surface-soft);
    border: 1px solid var(--det-pt-line);
    border-radius: 14px;
    min-width: 0;
    padding: 18px;
}

.det-pt-il-reference-heading { margin-bottom: 14px; }

.det-pt-il-reference-kicker {
    color: var(--det-pt-primary-text);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin: 0 0 5px;
    text-transform: uppercase;
}

.det-pt-il-reference-heading h3 {
    font-size: 15px;
    line-height: 1.4;
    margin: 0 0 5px;
}

.det-pt-il-reference-heading > p:last-child {
    color: var(--det-pt-muted);
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
}

.det-pt-audio-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--det-pt-line);
    border-radius: 14px;
    padding: 12px 18px;
    max-width: 460px;
    margin: 0 auto 26px;
}

.det-pt-il-reference-audio {
    background: var(--det-pt-field);
    box-sizing: border-box;
    margin: 0 0 14px;
    max-width: none;
    padding: 10px 12px;
    width: 100%;
}

.det-pt-il-reference-audio .det-pt-playbtn {
    height: 38px;
    width: 38px;
}

.det-pt-audio-tile .det-pt-playbtn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--det-pt-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.det-pt-audio-tile .det-pt-playbtn svg { width: 18px; height: 18px; fill: #fff; margin-left: 2px; }
.det-pt-audio-tile .det-pt-playbtn:disabled { background: var(--det-pt-disabled-strong); cursor: not-allowed; }

.det-pt-waveform { display: flex; align-items: center; gap: 2px; flex: 1; height: 34px; }
.det-pt-waveform span {
    width: 3px;
    border-radius: 2px;
    background: var(--det-pt-waveform);
}
.det-pt-waveform.played span { background: var(--det-pt-blue); }

.det-pt-il-questions {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}

.det-pt-il-questions[hidden] { display: none; }

.det-pt-il-question h4 { font-size: 14.5px; font-weight: 600; margin: 0 0 10px; }

.det-pt-il-answer {
    background: var(--det-pt-surface-soft);
    border-radius: 10px;
    padding: 16px 18px;
    font-size: 14px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.det-pt-il-answer input {
    border: none;
    border-bottom: 1.5px solid var(--det-pt-field-border);
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    padding: 2px 6px;
    min-width: 170px;
    color: var(--det-pt-ink);
}

.det-pt-il-answer input:focus { outline: none; border-bottom-color: var(--det-pt-blue); }

.det-pt-il-reference-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.det-pt-il-reference-sentence {
    background: var(--det-pt-field);
    border-radius: 9px;
    color: var(--det-pt-ink);
    font-size: 12.5px;
    line-height: 1.65;
    padding: 9px 11px;
}

.det-pt-il-reference-answer {
    border-bottom: 1.5px solid var(--det-pt-primary-text);
    color: var(--det-pt-primary-text);
    display: inline-block;
    font-weight: 700;
    margin: 0 0.2em;
    min-width: 4.5rem;
    padding: 0 0.2em;
    text-align: center;
}

.det-pt-il-dialogue { min-width: 0; }

.det-pt-il-dialogue > .det-pt-chat { margin-top: 0; }

.det-pt-chat { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

.det-pt-chat-note {
    font-size: 12px;
    color: var(--det-pt-muted);
    margin: 4px 0 2px;
}

.det-pt-bubble-row { display: flex; gap: 10px; align-items: flex-start; }

.det-pt-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--det-pt-tint-blue);
    border: 1px solid var(--det-pt-line);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.det-pt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.det-pt-avatar svg { width: 18px; height: 18px; stroke: var(--det-pt-primary-text); fill: none; stroke-width: 1.6; }

.det-pt-bubble {
    border: 1px solid var(--det-pt-line);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.5;
    max-width: 82%;
    background: var(--det-pt-field);
}

.det-pt-bubble.audio { display: flex; align-items: center; gap: 10px; min-width: 240px; }

.det-pt-bubble.audio.det-pt-turn-audio-player {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: auto minmax(90px, 1fr);
    max-width: 100%;
    padding: 11px 13px;
    width: min(100%, 420px);
}

.det-pt-turn-audio-player .det-pt-playbtn {
    align-items: center;
    background: var(--det-pt-blue);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    flex-shrink: 0;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.det-pt-turn-audio-player .det-pt-playbtn svg {
    fill: #fff;
    height: 17px;
    margin-left: 2px;
    width: 17px;
}

.det-pt-turn-audio-player .det-pt-playbtn:disabled {
    background: var(--det-pt-disabled-strong);
    cursor: not-allowed;
}

.det-pt-turn-audio-player .det-pt-waveform {
    min-width: 0;
    overflow: hidden;
}

.det-pt-turn-audio-status {
    color: var(--det-pt-muted);
    font-size: 11.5px;
    grid-column: 1 / -1;
    margin-left: 52px;
}
.det-pt-bubble.user {
    margin-left: auto;
    background: var(--det-pt-green-soft);
    border-color: var(--det-pt-green-line);
}

.det-pt-bubble.feedback {
    margin-left: auto;
    background: var(--det-pt-red-soft);
    border-color: var(--det-pt-red-line);
    max-width: 86%;
}

.det-pt-bubble.feedback .wrong { text-decoration: line-through; color: var(--det-pt-red-ink); display: block; }
.det-pt-bubble.feedback .label { display: block; font-size: 11.5px; color: var(--det-pt-muted); margin-top: 6px; }
.det-pt-bubble.feedback .best { display: block; margin-top: 2px; }

.det-pt-minibtn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: var(--det-pt-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.det-pt-minibtn svg { width: 14px; height: 14px; fill: #fff; margin-left: 1px; }
.det-pt-minibtn:disabled { background: var(--det-pt-disabled-strong); cursor: not-allowed; }

.det-pt-turn-block { margin-top: 10px; }
.det-pt-turn-block .kicker { font-size: 13px; font-weight: 600; margin: 12px 0 8px; }
.det-pt-turn-instruction { font-size: 13px; margin: 0 0 8px; }

.det-pt-summary-box { max-width: 560px; margin: 8px auto 0; width: 100%; }

/* ------------------------------------------------------------------ */
/* Writing tasks                                                       */
/* ------------------------------------------------------------------ */

.det-pt-photo-layout {
    display: flex;
    gap: 22px;
    justify-content: center;
    align-items: flex-start;
    margin-top: 6px;
}

.det-pt-photo {
    width: 300px;
    max-width: 42%;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--det-pt-line);
    flex-shrink: 0;
}

.det-pt-photo img { width: 100%; display: block; }

.det-pt-photo-placeholder {
    background: var(--det-pt-field-muted);
    color: var(--det-pt-muted);
    font-size: 13px;
    padding: 40px 20px;
    text-align: center;
}

.det-pt-writing-field { flex: 1; max-width: 420px; }

.det-pt-wordcount { margin-top: 8px; font-size: 12.5px; color: var(--det-pt-muted); }
.det-pt-wordcount .target { color: var(--det-pt-success); }

.det-pt-iw-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    margin-top: 6px;
}

.det-pt-iw-col h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.det-pt-iw-col h4 .stepnum {
    background: var(--det-pt-blue);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.det-pt-iw-col .prompt-copy { font-size: 13px; color: var(--det-pt-ink); line-height: 1.55; margin: 0 0 10px; }
.det-pt-iw-col.locked { opacity: 0.55; pointer-events: none; }

.det-pt-prompt-card {
    border: 1px solid var(--det-pt-line);
    border-radius: 12px;
    padding: 18px 22px;
    max-width: 560px;
    margin: 0 auto 26px;
    font-size: 14.5px;
    line-height: 1.6;
}

.det-pt-prompt-card h4 { margin: 0 0 8px; font-size: 15px; }
.det-pt-prompt-card ul { margin: 6px 0 0 4px; padding-left: 16px; color: var(--det-pt-ink); }
.det-pt-prompt-card li { margin: 3px 0; font-size: 13.5px; }

/* ------------------------------------------------------------------ */
/* Speaking tasks                                                      */
/* ------------------------------------------------------------------ */

.det-pt-speaking-status {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 560px;
    box-sizing: border-box;
    margin: 0 auto 24px;
    padding: 15px 18px;
    border: 1px solid var(--det-pt-line);
    border-left: 5px solid var(--det-pt-warning);
    border-radius: 12px;
    background: var(--det-pt-surface-soft);
    text-align: left;
}

.det-pt-speaking-status-dot {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border: 4px solid var(--det-pt-accent-soft);
    border-radius: 50%;
    background: var(--det-pt-warning);
    box-sizing: content-box;
}

.det-pt-speaking-status-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.det-pt-speaking-status-copy strong {
    color: var(--det-pt-warning);
    font-size: 17px;
    line-height: 1.3;
}

.det-pt-speaking-status-copy > span {
    color: var(--det-pt-ink);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
}

.det-pt-speaking-status[data-state="listening"],
.det-pt-speaking-status[data-state="your-turn"] {
    border-left-color: var(--det-pt-blue);
    background: var(--det-pt-tint-blue);
}

.det-pt-speaking-status[data-state="listening"] .det-pt-speaking-status-dot,
.det-pt-speaking-status[data-state="your-turn"] .det-pt-speaking-status-dot {
    border-color: var(--det-pt-selected);
    background: var(--det-pt-blue);
}

.det-pt-speaking-status[data-state="listening"] .det-pt-speaking-status-copy strong,
.det-pt-speaking-status[data-state="your-turn"] .det-pt-speaking-status-copy strong {
    color: var(--det-pt-primary-text);
}

.det-pt-speaking-status[data-state="recording"] {
    border-left-color: var(--det-pt-red-ink);
    background: var(--det-pt-red-soft);
}

.det-pt-speaking-status[data-state="recording"] .det-pt-speaking-status-dot {
    border-color: var(--det-pt-red-line);
    background: var(--det-pt-red-ink);
    animation: det-pt-pulse 1s infinite;
}

.det-pt-speaking-status[data-state="recording"] .det-pt-speaking-status-copy strong {
    color: var(--det-pt-red-ink);
}

.det-pt-speaking-status[data-state="saved"] {
    border-left-color: var(--det-pt-success);
    background: var(--det-pt-green-soft);
}

.det-pt-speaking-status[data-state="saved"] .det-pt-speaking-status-dot {
    border-color: var(--det-pt-green-line);
    background: var(--det-pt-success);
}

.det-pt-speaking-status[data-state="saved"] .det-pt-speaking-status-copy strong {
    color: var(--det-pt-success);
}

.det-pt-speaking-saved {
    flex: 1;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.det-pt-speaking-saved .det-pt-speaking-status { margin-bottom: 0; }

.det-pt-speaking-stage {
    width: 100%;
    max-width: 560px;
    box-sizing: border-box;
    margin: 22px auto 0;
    text-align: center;
}

.det-pt-prep-note {
    margin: 0 0 14px;
    color: var(--det-pt-warning);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.det-pt-record-btn {
    background: var(--det-pt-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    min-height: 48px;
    min-width: 190px;
    padding: 12px 30px;
    cursor: pointer;
}

.det-pt-record-btn:disabled { background: var(--det-pt-disabled-strong); cursor: not-allowed; }

.det-pt-speaking-helper {
    margin: 10px 0 0;
    color: var(--det-pt-muted);
    font-size: 12px;
    line-height: 1.5;
}

@keyframes det-pt-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.det-pt-mic-check {
    max-width: 460px;
    margin: 22px auto 0;
    border: 1px solid var(--det-pt-line);
    border-radius: 10px;
    padding: 10px 14px;
    text-align: left;
}

.det-pt-mic-check .bar {
    height: 8px;
    background: var(--det-pt-track);
    border-radius: 999px;
    overflow: hidden;
}

.det-pt-mic-check .bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--det-pt-primary);
    border-radius: 999px;
    transition: width 120ms linear;
}

.det-pt-mic-check .label { font-size: 11px; color: var(--det-pt-muted); margin-top: 6px; }

.det-pt-examiner {
    width: 170px;
    height: 170px;
    margin: 8px auto 4px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--det-pt-line);
    background: var(--det-pt-field-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.det-pt-examiner img { width: 100%; height: 100%; object-fit: cover; }
.det-pt-examiner svg { width: 70px; height: 70px; stroke: #9aa6b3; fill: none; stroke-width: 1.2; }

.det-pt-turn-kicker { text-align: center; font-size: 15px; font-weight: 600; margin-bottom: 14px; }

/* Processing / interstitial */
.det-pt-processing {
    margin: auto;
    text-align: center;
    color: var(--det-pt-muted);
}

.det-pt-processing h3 { color: var(--det-pt-ink); font-size: 17px; margin-bottom: 8px; }

.det-pt-spinner {
    width: 38px;
    height: 38px;
    margin: 0 auto 18px;
    border-radius: 50%;
    border: 3px solid var(--det-pt-line);
    border-top-color: var(--det-pt-blue);
    animation: det-pt-spin 0.9s linear infinite;
}

@keyframes det-pt-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ */
/* Results page                                                        */
/* ------------------------------------------------------------------ */

.det-pt-results-card {
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.det-pt-results-hero {
    background: var(--det-pt-card);
    border: 1px solid var(--det-pt-line);
    border-radius: var(--det-pt-radius);
    padding: 34px 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.det-pt-results-hero .overall { text-align: center; }
.det-pt-results-hero .overall .score { font-size: 56px; font-weight: 800; color: var(--det-pt-primary-text); line-height: 1; }
.det-pt-results-hero .overall .scale { color: var(--det-pt-muted); font-size: 13px; margin-top: 6px; }
.det-pt-results-hero h1 { font-size: 22px; margin: 0 0 6px; }
.det-pt-results-hero .meta { color: var(--det-pt-muted); font-size: 13.5px; }

.det-pt-score-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.det-pt-score-tile {
    background: var(--det-pt-card);
    border: 1px solid var(--det-pt-line);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
}

.det-pt-score-tile .value { font-size: 26px; font-weight: 700; color: var(--det-pt-ink); }
.det-pt-score-tile .name { font-size: 12.5px; color: var(--det-pt-muted); margin-top: 4px; }

.det-pt-panel {
    background: var(--det-pt-card);
    border: 1px solid var(--det-pt-line);
    border-radius: var(--det-pt-radius);
    padding: 24px 28px;
}

.det-pt-panel h2 { font-size: 16.5px; margin: 0 0 14px; }
.det-pt-panel .hint { color: var(--det-pt-muted); font-size: 12.5px; margin-top: 12px; }

.det-pt-feedback-kicker {
    color: var(--det-pt-primary-text);
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.det-pt-feedback-panel > h2 {
    font-size: 21px;
    margin-bottom: 8px;
}

.det-pt-feedback-summary {
    color: var(--det-pt-ink);
    font-size: 14px;
    line-height: 1.65;
    margin: 0;
}

.det-pt-progress-note,
.det-pt-overall-math {
    align-items: flex-start;
    background: var(--det-pt-tint-blue);
    border: 1px solid var(--det-pt-selected);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
    padding: 13px 15px;
}

.det-pt-progress-note span,
.det-pt-overall-math span {
    color: var(--det-pt-ink);
    font-size: 13px;
    line-height: 1.55;
}

.det-pt-feedback-columns {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    margin-top: 24px;
}

.det-pt-feedback-columns h3,
.det-pt-subheading {
    font-size: 14px;
    margin: 0 0 10px;
}

.det-pt-worked-list,
.det-pt-practice-plan {
    display: grid;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.det-pt-worked-list li {
    background: var(--det-pt-green-soft);
    border: 1px solid var(--det-pt-green-line);
    border-radius: 10px;
    display: grid;
    gap: 3px;
    padding: 12px 13px;
}

.det-pt-worked-list strong,
.det-pt-worked-list span,
.det-pt-limit-card p,
.det-pt-skill-feedback p,
.det-pt-skill-feedback dd,
.det-pt-practice-plan p,
.det-pt-practice-plan small {
    font-size: 12.5px;
    line-height: 1.5;
}

.det-pt-worked-list span,
.det-pt-skill-feedback p,
.det-pt-skill-feedback dd,
.det-pt-practice-plan small {
    color: var(--det-pt-muted);
}

.det-pt-limit-list {
    display: grid;
    gap: 10px;
}

.det-pt-limit-card,
.det-pt-skill-feedback,
.det-pt-score-math-grid article {
    border: 1px solid var(--det-pt-line);
    border-radius: 10px;
    padding: 12px 13px;
}

.det-pt-limit-card h3,
.det-pt-skill-feedback h3 {
    font-size: 13px;
    margin: 0 0 6px;
}

.det-pt-limit-card p,
.det-pt-skill-feedback p,
.det-pt-practice-plan p {
    margin: 4px 0 0;
}

.det-pt-subheading {
    margin-top: 24px;
}

.det-pt-skill-feedback-grid,
.det-pt-score-math-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.det-pt-skill-feedback dl,
.det-pt-skill-feedback dd {
    margin: 0;
}

.det-pt-skill-feedback dl {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}

.det-pt-skill-feedback dt {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.det-pt-practice-plan li {
    align-items: flex-start;
    border-top: 1px solid var(--det-pt-line);
    display: grid;
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr);
    padding-top: 12px;
}

.det-pt-plan-number {
    align-items: center;
    background: var(--det-pt-primary);
    border-radius: 50%;
    color: #FFFFFF;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    height: 26px;
    justify-content: center;
    width: 26px;
}

.det-pt-score-math-grid {
    margin-top: 14px;
}

.det-pt-score-math-grid article > div {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.det-pt-score-math-grid article p {
    font-size: 12.5px;
    line-height: 1.5;
    margin: 8px 0 4px;
}

.det-pt-score-math-grid article small {
    color: var(--det-pt-muted);
}

.det-pt-path { display: flex; flex-wrap: wrap; column-gap: 8px; row-gap: 10px; }

.det-pt-path-chip {
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.2;
    padding: 6px 12px;
    border: 1px solid var(--det-pt-line);
    background: var(--det-pt-path);
    display: inline-flex;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
}

.det-pt-path-chip .stepnum {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--det-pt-path-step);
    color: var(--det-pt-muted);
    font-size: 10.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.det-pt-path-chip .band { font-weight: 700; text-transform: capitalize; }
.det-pt-path-chip.easy .band { color: var(--det-pt-success); }
.det-pt-path-chip.medium .band { color: var(--det-pt-warning); }
.det-pt-path-chip.hard .band { color: var(--det-pt-red-ink); }
.det-pt-path-chip.fixed .band { color: var(--det-pt-muted); }

.det-pt-task-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-color: var(--det-pt-line) transparent;
    -webkit-overflow-scrolling: touch;
}

.det-pt-task-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 13.5px;
}
.det-pt-task-table th, .det-pt-task-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--det-pt-line);
}
.det-pt-task-table th { color: var(--det-pt-muted); font-weight: 600; font-size: 12px; }
.det-pt-task-table td.num { font-variant-numeric: tabular-nums; }

.det-pt-task-review {
    color: var(--det-pt-primary-text);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.det-pt-no-review {
    color: var(--det-pt-muted);
    font-size: 12px;
    white-space: nowrap;
}

.det-pt-results-actions { display: flex; gap: 12px; justify-content: center; padding-bottom: 20px; }

@media (max-width: 720px) {
    .det-pt-feedback-columns,
    .det-pt-skill-feedback-grid,
    .det-pt-score-math-grid {
        grid-template-columns: 1fr;
    }

    .det-pt-results-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }
}

/* ------------------------------------------------------------------ */
/* Modal                                                               */
/* ------------------------------------------------------------------ */

.det-pt-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 32, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.det-pt-modal {
    background: var(--det-pt-card);
    border: 1px solid var(--det-pt-line);
    border-radius: 14px;
    box-sizing: border-box;
    color: var(--det-pt-ink);
    max-width: 420px;
    width: calc(100% - 40px);
    padding: 26px 28px;
    text-align: center;
}

.det-pt-modal h3 { margin: 0 0 8px; font-size: 17px; }
.det-pt-modal p { color: var(--det-pt-muted); font-size: 13.5px; margin: 0 0 20px; }
.det-pt-modal .row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 860px) {
    .det-pt-card { padding: 20px 18px; }
    .det-pt-passage-frame { padding: 22px 18px; }
    .det-pt-ir-layout { grid-template-columns: 1fr; }
    .det-pt-ir-passage { max-height: 300px; }
    .det-pt-iw-layout { grid-template-columns: 1fr; }
    .det-pt-photo-layout { flex-direction: column; align-items: center; }
    .det-pt-photo { max-width: 100%; width: 100%; }
    .det-pt-writing-field { max-width: 100%; width: 100%; }
    .det-pt-dictation { flex-direction: column; align-items: center; }
    .det-pt-score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .det-pt-word { font-size: 34px; }
    .det-pt-il-conversation-layout { grid-template-columns: 1fr; }
    .det-pt-il-reference { padding: 16px; }
}

@media (max-width: 480px) {
    .det-pt-equipment-grid { grid-template-columns: 1fr; }
    .det-pt-equipment-card,
    .det-pt-resume-microphone { padding: 18px 16px; }
    .det-pt-speaking-status { padding: 14px; }
    .det-pt-speaking-status-copy strong { font-size: 16px; }
    .det-pt-record-btn { width: 100%; }
    .det-pt-sample-actions { grid-template-columns: 1fr; }
    .det-pt-sample-countdown { grid-row: 1; }
    .det-pt-sentence-frame,
    .det-pt-passage-frame { padding: 22px 16px; }
    .det-pt-il-scenario-stage.is-listening-only { padding-bottom: 24px; }
    .det-pt-audio-tile { padding-inline: 12px; }
    .det-pt-il-answer { padding: 14px; }
    .det-pt-il-answer input { min-width: min(170px, 58vw); }
    .det-pt-bubble-row { gap: 8px; }
    .det-pt-turn-audio-player { min-width: 0; }
    .det-pt-turn-audio-status { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .det-pt-speaking-status[data-state="recording"] .det-pt-speaking-status-dot {
        animation: none;
    }
}

@media (max-width: 360px) {
    .det-pt-sentence-frame,
    .det-pt-passage-frame { padding: 20px 12px; }
    .det-pt-boxes { gap: 1px; margin-inline: 1px; }
    .det-pt-box {
        flex-basis: 18px;
        width: 18px;
        height: 26px;
        font-size: 12px;
        line-height: 22px;
    }
    .det-pt-box.prefix + .det-pt-box:not(.prefix) { margin-left: 1px; }
}
