/* Speaking test — YouPass-style layout */
:root {
    --height-screen: 100vh;
}

body.speaking-test-mode {
    overflow: hidden;
    height: 100vh;
    background: #fff;
}

body.speaking-test-mode .speaking-test-wrap {
    height: 100vh;
    overflow: hidden;
    padding: 0 !important;
    max-width: none !important;
}

body.speaking-test-mode .wrap-content,
body.speaking-test-mode .wrap-home {
    padding: 0 !important;
    max-width: none !important;
}

.speaking-yp-app {
    height: 100vh;
    font-family: Inter, system-ui, sans-serif;
}

.h-screen-mobile {
    height: var(--height-screen);
}

.h6 { font-size: 1.25rem; font-weight: 700; line-height: 1.5; }
.h8 { font-size: 1.125rem; font-weight: 700; line-height: 1.5; }
.h9 { font-size: 0.875rem; font-weight: 600; line-height: 1.5; }
.text-t3-bold { font-size: 1rem; font-weight: 700; line-height: 1.5; }
.text-t4 { font-size: 0.875rem; line-height: 1.5; }
.text-t5-bold { font-size: 0.875rem; font-weight: 700; line-height: 1.5; }

.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

.done-step { background-color: #fff; border: 1px solid #E5E5EA; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.active-step { background-color: #fff; border: 1px solid #E5E5EA; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.unactive-step { background-color: rgba(255,255,255,0.6); border: 1px solid #E5E5EA; opacity: 0.7; }

.speaking-start-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

.speaking-start-overlay.is-hidden {
    display: none !important;
}

/* Mic visual */
.speaking-mic-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    width: 100%;
}

.speaking-mic-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 48px;
}

.speaking-mic-wave span {
    display: block;
    width: 4px;
    height: 12px;
    border-radius: 999px;
    background: var(--speaking-primary);
    animation: speakingWave 1s ease-in-out infinite;
}

.speaking-mic-wave span:nth-child(2) { animation-delay: 0.1s; }
.speaking-mic-wave span:nth-child(3) { animation-delay: 0.2s; }
.speaking-mic-wave span:nth-child(4) { animation-delay: 0.3s; }
.speaking-mic-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes speakingWave {
    0%, 100% { height: 12px; opacity: 0.45; }
    50% { height: 36px; opacity: 1; }
}

.speaking-mic-play {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--speaking-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.speaking-mic-meter {
    height: 8px;
    background: #E5E5EA;
    border-radius: 999px;
    overflow: hidden;
}

.speaking-mic-meter span {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--speaking-primary);
    transition: width 0.1s;
}

.speaking-record-btn.is-recording,
#speaking-primary-btn.is-recording {
    animation: speakingPulse 1s infinite;
    background: #fee2e2 !important;
    border-color: #dc2626 !important;
    color: #dc2626 !important;
}

#speaking-primary-btn.is-recording .speaking-primary-btn__icon path {
    fill: #dc2626;
}

@keyframes speakingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

#speaking-primary-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#speaking-secondary-btn:not(.hidden) {
    display: inline-flex;
}

/* Modals */
.speaking-modal { border: none; border-radius: 16px; overflow: hidden; }
.speaking-modal--login .speaking-modal__icon {
    width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 50%;
    background: color-mix(in srgb, var(--speaking-primary) 12%, transparent); color: var(--speaking-primary);
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.speaking-modal__title { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.75rem; }
.speaking-modal__text { color: #666; margin: 0; line-height: 1.55; }

.speaking-loading-overlay {
    position: fixed; inset: 0; z-index: 10050;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
}
.speaking-loading-overlay[hidden] { display: none !important; }

.speaking-loading-card {
    background: #fff; padding: 2rem; border-radius: 16px; text-align: center; min-width: 280px;
}

.speaking-spinner {
    width: 40px; height: 40px; border: 3px solid #eee;
    border-top-color: var(--speaking-primary); border-radius: 50%;
    animation: speakingSpin 0.8s linear infinite; margin: 0 auto 1rem;
}

@keyframes speakingSpin { to { transform: rotate(360deg); } }

body.speaking-test-mode .modal-backdrop { z-index: 10040 !important; }
body.speaking-test-mode .modal { z-index: 10050 !important; background: transparent; }

/* Result page (unchanged essentials) */
.speaking-result-page { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.speaking-result-hero {
    text-align: center;
    background: linear-gradient(135deg, #fff5ef, #fff);
    border: 1px solid color-mix(in srgb, var(--speaking-primary) 25%, transparent);
    border-radius: 16px; padding: 2rem; margin-bottom: 1.5rem;
}
.speaking-result-band { font-size: 3rem; font-weight: 800; color: var(--speaking-primary); line-height: 1; }
.speaking-criteria-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.speaking-criteria-card { background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; padding: 1rem; }
.speaking-criteria-card h4 { margin: 0 0 0.35rem; font-size: 0.875rem; color: #666; }
.speaking-criteria-card .score { font-size: 1.5rem; font-weight: 700; color: var(--speaking-primary); }
.speaking-result-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.speaking-result-tab { border: 1px solid #d9d9d9; background: #fff; border-radius: 999px; padding: 0.4rem 1rem; cursor: pointer; font-weight: 700; }
.speaking-result-tab.is-active { background: var(--speaking-primary); color: #fff; border-color: var(--speaking-primary); }
.speaking-part-panel { background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; padding: 1.25rem; }
.speaking-transcript { background: #E5F6E9; padding: 1rem; border-radius: 8px; line-height: 1.6; white-space: pre-wrap; border: 1px solid #13A62E; }

.speaking-btn {
    border: none; border-radius: 999px; padding: 0.6rem 1.35rem;
    font-weight: 700; cursor: pointer; font-size: 0.9375rem;
    text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.speaking-btn--primary { background: var(--speaking-primary); color: #fff; }
.speaking-btn--secondary { background: #fff; color: #1a1a1a; border: 1px solid #d9d9d9; }
