/**
 * Phrason Listening — Images & Audio
 */

.ph-li-status {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
    font-size:.76rem;
    font-weight:800;
    opacity:.68;
}

.ph-li-level {
    padding:4px 8px;
    border-radius:999px;
    background:rgba(127,127,127,.12);
}

.ph-li-images-layout {
    display:grid;
    grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);
    gap:14px;
    align-items:stretch;
}

.ph-li-image-panel,
.ph-li-audio-panel {
    min-width:0;
    border:1px solid rgba(127,127,127,.22);
    border-radius:16px;
    background:rgba(255,255,255,.035);
    overflow:hidden;
}

.ph-li-image-panel {
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:360px;
    padding:10px;
}

.ph-li-context-image {
    display:block;
    width:100%;
    height:100%;
    max-height:480px;
    object-fit:cover;
    border-radius:11px;
}

.ph-li-audio-panel {
    padding:16px;
}

.ph-li-step-label {
    margin-bottom:9px;
    font-size:.78rem;
    font-weight:850;
    letter-spacing:.02em;
    text-transform:uppercase;
    opacity:.66;
}

.ph-li-step-answers {
    margin-top:18px;
}

.ph-li-play,
.ph-li-choose,
.ph-li-next {
    border:1px solid rgba(127,127,127,.25);
    border-radius:11px;
    background:var(--ph-window-bg,#fff);
    color:inherit;
    font:inherit;
    cursor:pointer;
}

.ph-li-play {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:44px;
    padding:9px 13px;
    font-size:.8rem;
    font-weight:800;
}

.ph-li-main-play {
    width:100%;
    min-height:54px;
    font-size:.9rem;
}

.ph-li-play:hover:not(:disabled),
.ph-li-choose:hover:not(:disabled),
.ph-li-next:hover:not(:disabled) {
    border-color:currentColor;
}

.ph-li-play:disabled,
.ph-li-choose:disabled {
    opacity:.42;
    cursor:not-allowed;
}

.ph-li-play.is-playing {
    box-shadow:inset 3px 0 0 currentColor;
}

.ph-li-play.has-error {
    box-shadow:inset 3px 0 0 #c75050;
}

.ph-li-play-icon {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:25px;
    height:25px;
    border-radius:50%;
    background:rgba(127,127,127,.12);
}

.ph-li-hint {
    margin:8px 0 0;
    font-size:.73rem;
    line-height:1.4;
    opacity:.58;
}

.ph-li-answers {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:9px;
    transition:opacity .18s ease;
}

.ph-li-answers.is-locked {
    opacity:.55;
}

.ph-li-answer-card {
    border:1px solid rgba(127,127,127,.18);
    border-radius:13px;
    padding:9px;
    background:rgba(127,127,127,.035);
}

.ph-li-answer-head {
    display:grid;
    grid-template-columns:34px minmax(0,1fr);
    gap:8px;
    align-items:center;
}

.ph-li-answer-letter {
    display:flex;
    align-items:center;
    justify-content:center;
    width:32px;
    height:32px;
    border-radius:50%;
    font-weight:900;
    background:rgba(127,127,127,.12);
}

.ph-li-answer-play {
    width:100%;
}

.ph-li-choose {
    width:100%;
    margin-top:7px;
    padding:7px 10px;
    font-size:.72rem;
    font-weight:800;
}

.ph-li-choose.correct {
    border-color:rgba(46,157,96,.55);
    box-shadow:inset 3px 0 0 #2e9d60;
}

.ph-li-choose.wrong {
    border-color:rgba(199,80,80,.55);
    box-shadow:inset 3px 0 0 #c75050;
}

.ph-li-feedback {
    margin-top:12px;
    padding:10px 11px;
    border-radius:10px;
    font-size:.8rem;
    line-height:1.45;
    background:rgba(127,127,127,.07);
}

.ph-li-feedback.is-correct {
    box-shadow:inset 3px 0 0 #2e9d60;
}

.ph-li-feedback.is-wrong {
    box-shadow:inset 3px 0 0 #c75050;
}

.ph-li-nav {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-top:13px;
}

.ph-li-score {
    font-size:.76rem;
    font-weight:800;
    opacity:.68;
}

.ph-li-next {
    padding:8px 13px;
    font-weight:850;
}

@media (max-width:768px) {
    .ph-li-images-layout {
        grid-template-columns:1fr;
    }

    .ph-li-image-panel {
        min-height:220px;
    }

    .ph-li-context-image {
        max-height:300px;
    }

    .ph-li-answers {
        grid-template-columns:1fr;
    }
}


/* Long Texts */

.ph-li-lt-head {
    display:flex;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
    font-size:.76rem;
    font-weight:800;
    opacity:.68;
}

.ph-li-lt-card,
.ph-li-lt-question-card {
    border:1px solid rgba(127,127,127,.22);
    border-radius:16px;
    padding:16px;
    background:rgba(255,255,255,.035);
}

.ph-li-lt-transcript {
    margin-top:16px;
    border-top:1px solid rgba(127,127,127,.15);
    padding-top:14px;
}

.ph-li-lt-text {
    max-height:260px;
    overflow:auto;
    white-space:pre-wrap;
    line-height:1.62;
    font-size:.88rem;
    padding-right:6px;
}

.ph-li-lt-start {
    margin-top:14px;
    padding:9px 14px;
}

.ph-li-lt-question-text {
    margin:12px 0 4px;
    padding:10px 12px;
    border-radius:10px;
    background:rgba(127,127,127,.07);
    font-size:.9rem;
    line-height:1.45;
    font-weight:700;
}

.ph-li-lt-answer-text {
    margin-top:8px;
    min-height:48px;
    font-size:.78rem;
    line-height:1.4;
    opacity:.82;
}

@media (max-width:768px) {
    .ph-li-lt-text {
        max-height:none;
    }
}


/* Long Texts 1.2 — fixed reference area + forward-only question area */
.ph-li-lt-shell { position:relative; }

.ph-li-lt-reference {
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:16px;
    border:1px solid rgba(127,127,127,.22);
    border-radius:16px;
    padding:14px 16px;
    margin-bottom:12px;
    background:rgba(255,255,255,.035);
}

.ph-li-lt-reference-copy { flex:1; min-width:0; }

.ph-li-lt-reference-actions {
    display:flex;
    align-items:stretch;
    gap:10px;
    flex-wrap:wrap;
}

.ph-li-lt-text-button {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    min-width:150px;
    padding:8px 13px;
    border:1px solid rgba(127,127,127,.24);
    border-radius:11px;
    background:rgba(255,255,255,.72);
    font-weight:850;
    cursor:pointer;
}

.ph-li-lt-text-button small {
    display:block;
    font-size:.62rem;
    font-weight:650;
    opacity:.58;
}

.ph-li-lt-progress {
    flex:0 0 auto;
    padding-bottom:7px;
    font-size:.75rem;
    font-weight:800;
    opacity:.68;
}

.ph-li-lt-overlay[hidden] { display:none !important; }

.ph-li-lt-overlay {
    position:absolute;
    inset:0;
    z-index:40;
    display:flex;
    align-items:flex-start;
    justify-content:center;
    padding:18px;
    background:rgba(12,18,20,.58);
    backdrop-filter:blur(3px);
    border-radius:16px;
}

.ph-li-lt-overlay-panel {
    width:min(760px, 96%);
    max-height:calc(100% - 20px);
    overflow:auto;
    padding:18px;
    border-radius:16px;
    background:#f5fbfa;
    box-shadow:0 18px 60px rgba(0,0,0,.25);
}

.ph-li-lt-overlay-head {
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:16px;
    margin-bottom:14px;
}

.ph-li-lt-overlay-head div {
    display:flex;
    flex-direction:column;
    gap:3px;
}

.ph-li-lt-overlay-head span {
    font-size:.72rem;
    opacity:.62;
}

.ph-li-lt-overlay-close {
    width:36px;
    height:36px;
    border:0;
    border-radius:9px;
    font-size:1.35rem;
    cursor:pointer;
}

@media (max-width:768px) {
    .ph-li-lt-reference {
        align-items:stretch;
        flex-direction:column;
    }
    .ph-li-lt-reference-actions {
        flex-direction:column;
    }
    .ph-li-lt-text-button,
    .ph-li-lt-main {
        width:100%;
    }
    .ph-li-lt-progress {
        padding-bottom:0;
    }
    .ph-li-lt-overlay {
        padding:8px;
    }
}


/* Audio Quiz — 100% audio */
.ph-li-aq-shell {
    max-width:760px;
    margin:0 auto;
}

.ph-li-aq-top {
    display:flex;
    justify-content:space-between;
    gap:12px;
    margin-bottom:12px;
    font-size:.76rem;
    font-weight:800;
    opacity:.68;
}

.ph-li-aq-base,
.ph-li-aq-answers {
    border:1px solid rgba(127,127,127,.22);
    border-radius:16px;
    padding:16px;
    background:rgba(255,255,255,.035);
}

.ph-li-aq-base {
    margin-bottom:12px;
}

.ph-li-aq-base-play {
    width:100%;
    min-height:54px;
}

.ph-li-aq-answers {
    display:grid;
    gap:9px;
    transition:opacity .18s ease;
}

.ph-li-aq-answers.is-locked {
    opacity:.52;
}

.ph-li-aq-answer {
    display:grid;
    grid-template-columns:38px minmax(0,1fr) auto;
    gap:9px;
    align-items:center;
    padding:9px;
    border:1px solid rgba(127,127,127,.16);
    border-radius:12px;
    background:rgba(127,127,127,.035);
}

.ph-li-aq-letter {
    display:flex;
    align-items:center;
    justify-content:center;
    width:34px;
    height:34px;
    border-radius:50%;
    font-weight:900;
    background:rgba(127,127,127,.12);
}

.ph-li-aq-answer-play {
    width:100%;
}

.ph-li-aq-choose {
    margin:0;
    padding:8px 12px;
}

@media (max-width:768px) {
    .ph-li-aq-answer {
        grid-template-columns:36px 1fr;
    }

    .ph-li-aq-choose {
        grid-column:1 / -1;
        width:100%;
    }
}


/* Shadowing */
.ph-sh-shell { width:100%; }

.ph-sh-topline {
    display:flex;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
    font-size:.76rem;
    font-weight:800;
    opacity:.68;
}

.ph-sh-layout {
    display:grid;
    gap:14px;
    align-items:start;
}

.ph-sh-vertical .ph-sh-layout {
    grid-template-columns:minmax(220px,.78fr) minmax(0,1.22fr);
}

.ph-sh-horizontal .ph-sh-layout {
    grid-template-columns:1fr;
}

.ph-sh-image-panel {
    position:relative;
    border:1px solid rgba(127,127,127,.2);
    border-radius:16px;
    overflow:hidden;
    background:rgba(127,127,127,.04);
}

.ph-sh-image-panel img {
    display:block;
    width:100%;
    height:auto;
    object-fit:cover;
}

.ph-sh-vertical .ph-sh-image-panel img {
    max-height:720px;
}

.ph-sh-horizontal .ph-sh-image-panel img {
    width:100%;
    max-height:320px;
    object-fit:cover;
}

.ph-sh-image-title {
    position:absolute;
    left:10px;
    bottom:10px;
    padding:6px 9px;
    border-radius:8px;
    background:rgba(0,0,0,.56);
    color:#fff;
    font-size:.74rem;
    font-weight:800;
}

.ph-sh-practice-panel {
    display:grid;
    gap:10px;
    min-width:0;
}

.ph-sh-phrase {
    border:1px solid rgba(127,127,127,.19);
    border-radius:14px;
    padding:11px;
    background:rgba(255,255,255,.035);
}

.ph-sh-tier {
    margin-bottom:7px;
    font-size:.67rem;
    font-weight:900;
    letter-spacing:.06em;
    opacity:.55;
}

.ph-sh-player {
    display:grid;
    grid-template-columns:40px minmax(0,1fr) auto;
    gap:9px;
    align-items:center;
}

.ph-sh-play {
    width:38px;
    height:38px;
    border:1px solid rgba(127,127,127,.24);
    border-radius:50%;
    background:var(--ph-window-bg,#fff);
    color:inherit;
    cursor:pointer;
    font-weight:900;
}

.ph-sh-seek {
    width:100%;
    cursor:pointer;
}

.ph-sh-time {
    min-width:74px;
    text-align:right;
    font-size:.68rem;
    font-weight:750;
    opacity:.6;
}

.ph-sh-dictation {
    display:block;
    margin-top:9px;
}

.ph-sh-dictation span {
    display:block;
    margin-bottom:5px;
    font-size:.68rem;
    font-weight:800;
    opacity:.62;
}

.ph-sh-dictation textarea {
    width:100%;
    resize:vertical;
    min-height:48px;
    padding:9px 10px;
    border:1px solid rgba(127,127,127,.22);
    border-radius:10px;
    background:rgba(255,255,255,.65);
    color:inherit;
    font:inherit;
}

.ph-sh-actions {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    margin-top:8px;
}

.ph-sh-reveal,
.ph-sh-record,
.ph-sh-next {
    border:1px solid rgba(127,127,127,.24);
    border-radius:10px;
    background:var(--ph-window-bg,#fff);
    color:inherit;
    font:inherit;
    font-weight:800;
    cursor:pointer;
}

.ph-sh-reveal,
.ph-sh-record {
    padding:8px 11px;
    font-size:.72rem;
}

.ph-sh-record:disabled,
.ph-sh-reveal:disabled {
    opacity:.45;
    cursor:not-allowed;
}

.ph-sh-answer {
    margin-top:8px;
    padding:9px 10px;
    border-radius:9px;
    background:rgba(127,127,127,.07);
    font-size:.8rem;
    line-height:1.42;
    font-weight:750;
}

.ph-sh-recording {
    margin-top:8px;
    padding-top:8px;
    border-top:1px solid rgba(127,127,127,.13);
}

.ph-sh-record-status {
    margin-bottom:5px;
    font-size:.68rem;
    font-weight:800;
    opacity:.65;
}

.ph-sh-recording audio {
    width:100%;
    height:34px;
}

.ph-sh-nav {
    display:flex;
    justify-content:flex-end;
    padding-top:2px;
}

.ph-sh-next {
    padding:9px 14px;
}

@media (max-width:768px) {
    .ph-sh-vertical .ph-sh-layout,
    .ph-sh-horizontal .ph-sh-layout {
        grid-template-columns:1fr;
    }

    .ph-sh-vertical .ph-sh-image-panel img,
    .ph-sh-horizontal .ph-sh-image-panel img {
        max-height:300px;
    }

    .ph-sh-player {
        grid-template-columns:38px minmax(0,1fr);
    }

    .ph-sh-time {
        grid-column:2;
        text-align:left;
        min-width:0;
    }

    .ph-sh-actions {
        align-items:stretch;
        flex-direction:column;
    }

    .ph-sh-reveal,
    .ph-sh-record {
        width:100%;
    }
}


/* 1.4.1 — Shadowing player alignment + compact recording controls */
.ph-sh-player {
    align-items:center !important;
}

.ph-sh-play {
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    align-self:center !important;
    margin:0 !important;
    padding:0 !important;
    line-height:1 !important;
}

.ph-sh-seek {
    display:block !important;
    align-self:center !important;
    margin:0 !important;
    vertical-align:middle !important;
}

.ph-sh-recording {
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}

.ph-sh-recording[hidden] {
    display:none !important;
}

.ph-sh-record-status {
    margin:0 !important;
}

.ph-sh-own-play,
.ph-sh-own-delete {
    width:34px;
    height:30px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:0;
    border:1px solid rgba(127,127,127,.24);
    border-radius:7px;
    background:var(--ph-window-bg,#fff);
    color:inherit;
    font:inherit;
    font-weight:800;
    cursor:pointer;
}

.ph-sh-own-play:disabled,
.ph-sh-own-delete:disabled {
    opacity:.4;
    cursor:not-allowed;
}

.ph-sh-own-audio {
    display:none !important;
}


/* Paraphrase — Listening 5/5 */
.ph-pr-shell {
    display:grid;
    grid-template-columns:minmax(220px,.72fr) minmax(0,1.28fr);
    gap:16px;
    align-items:start;
}

.ph-pr-guide,
.ph-pr-question {
    border:1px solid rgba(127,127,127,.18);
    border-radius:16px;
    padding:14px;
    background:rgba(255,255,255,.035);
}

.ph-pr-guide-title {
    font-size:.88rem;
    font-weight:900;
    margin-bottom:6px;
}

.ph-pr-guide-copy {
    font-size:.72rem;
    line-height:1.4;
    opacity:.65;
    margin-bottom:11px;
}

.ph-pr-patterns {
    display:flex;
    flex-wrap:wrap;
    gap:7px;
}

.ph-pr-pattern {
    display:inline-flex;
    align-items:center;
    padding:7px 9px;
    border:1px solid rgba(127,127,127,.2);
    border-radius:999px;
    font-size:.7rem;
    font-weight:800;
    line-height:1.2;
}

.ph-pr-counter {
    font-size:.7rem;
    font-weight:850;
    opacity:.58;
    margin-bottom:10px;
}

.ph-pr-original-label,
.ph-pr-compare-label {
    font-size:.78rem;
    font-weight:900;
    margin-bottom:7px;
}

.ph-pr-compare-label {
    margin-top:15px;
}

.ph-pr-player {
    display:grid;
    grid-template-columns:40px minmax(0,1fr) auto;
    gap:9px;
    align-items:center;
}

.ph-pr-play {
    width:38px;
    height:38px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:0;
    margin:0;
    border:1px solid rgba(127,127,127,.24);
    border-radius:50%;
    background:var(--ph-window-bg,#fff);
    color:inherit;
    font:inherit;
    font-weight:900;
    cursor:pointer;
}

.ph-pr-seek {
    display:block;
    width:100%;
    margin:0;
    cursor:pointer;
}

.ph-pr-time {
    min-width:74px;
    text-align:right;
    font-size:.67rem;
    font-weight:750;
    opacity:.58;
}

.ph-pr-answers {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:9px;
}

.ph-pr-answer {
    border:1px solid rgba(127,127,127,.18);
    border-radius:13px;
    padding:10px;
    min-width:0;
}

.ph-pr-answer-head {
    display:flex;
    align-items:center;
    gap:7px;
    margin-bottom:8px;
    font-size:.7rem;
    font-weight:850;
}

.ph-pr-letter {
    width:24px;
    height:24px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    border:1px solid rgba(127,127,127,.25);
    font-weight:900;
}

.ph-pr-player-compact {
    grid-template-columns:36px minmax(0,1fr);
    gap:7px;
}

.ph-pr-player-compact .ph-pr-play {
    width:34px;
    height:34px;
}

.ph-pr-player-compact .ph-pr-time {
    grid-column:2;
    text-align:left;
    min-width:0;
    margin-top:-3px;
}

.ph-pr-choose,
.ph-pr-next {
    border:1px solid rgba(127,127,127,.24);
    border-radius:9px;
    background:var(--ph-window-bg,#fff);
    color:inherit;
    font:inherit;
    font-weight:850;
    cursor:pointer;
}

.ph-pr-choose {
    width:100%;
    margin-top:8px;
    padding:8px 9px;
    font-size:.7rem;
}

.ph-pr-choose:disabled {
    cursor:not-allowed;
    opacity:.65;
}

.ph-pr-answer.is-correct {
    outline:2px solid rgba(70,160,100,.45);
}

.ph-pr-answer.is-wrong {
    outline:2px solid rgba(190,75,75,.42);
}

.ph-pr-feedback {
    margin-top:11px;
    padding:9px 10px;
    border-radius:9px;
    font-size:.76rem;
    font-weight:800;
    background:rgba(127,127,127,.07);
}

.ph-pr-nav {
    display:flex;
    justify-content:flex-end;
    margin-top:9px;
}

.ph-pr-next {
    padding:9px 14px;
}

@media (max-width:900px) {
    .ph-pr-shell {
        grid-template-columns:1fr;
    }
}

@media (max-width:680px) {
    .ph-pr-answers {
        grid-template-columns:1fr;
    }

    .ph-pr-player {
        grid-template-columns:38px minmax(0,1fr);
    }

    .ph-pr-time {
        grid-column:2;
        text-align:left;
        min-width:0;
    }
}
