.ecsd-speaking-app {
    width: 100%;
    font-family: Poppins, Arial, sans-serif;
    color: #15151c;
    box-sizing: border-box;
}

.ecsd-speaking-app * {
    box-sizing: border-box;
}

.ecsd-login-warning {
    padding: 18px;
    background: #fff9e6;
    color: #765600;
    border-radius: 14px;
    font-family: Poppins, Arial, sans-serif;
}

.ecsd-speaking-card,
.ecsd-result-card {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e8ef;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 18px 48px rgba(22, 34, 51, 0.1);
}

.ecsd-top-actions {
    position: sticky;
    top: 10px;
    z-index: 30;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 14px;
    margin: -8px -8px 18px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    border: 1px solid #eef1f6;
    border-radius: 20px;
}

.ecsd-eyebrow {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff3df;
    color: #e47600;
    font-size: 12px;
    font-weight: 850;
}

.ecsd-top-actions h1,
.ecsd-result-head h1 {
    margin: 6px 0 6px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.ecsd-top-actions p,
.ecsd-result-head p {
    margin: 0;
    color: #717789;
    font-size: 14px;
}

.ecsd-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ecsd-btn {
    min-height: 42px;
    padding: 10px 20px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 850;
    transition: 0.2s ease;
}

.ecsd-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.ecsd-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ecsd-btn-start {
    background:  #ff8412;

    box-shadow: 0 12px 24px rgba(255, 132, 18, 0.28);
}

.ecsd-btn-end {
    background: red;
    color: red;
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.22);
}

.ecsd-btn-secondary {
    background: #f3f5fa;
    color: #15151c;
    border: 1px solid #505255;
}

.ecsd-stage {
    align-items: center;
    gap: 24px;
    min-height: 260px;
    padding: 28px;
    background: white;
    border: 1px solid #e6edf7;
    border-radius: 24px;
    overflow: hidden;
}


.ecsd-sound-wave {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 125px;
    height: 125px;
    border-radius: 999px;
    border: 3px solid rgba(255, 132, 18, 0.28);
    transform: translate(-50%, -50%);
    opacity: 0;
}

.ecsd-speaking-app.is-listening .ecsd-sound-wave.wave-one,
.ecsd-speaking-app.is-speaking .ecsd-sound-wave.wave-one {
    animation: ecsd-wave 1.5s ease-out infinite;
}

.ecsd-speaking-app.is-listening .ecsd-sound-wave.wave-two,
.ecsd-speaking-app.is-speaking .ecsd-sound-wave.wave-two {
    animation: ecsd-wave 1.5s ease-out infinite 0.5s;
}

.ecsd-status-box {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid #e7ebf3;
    border-radius: 22px;
    padding: 24px;

}

.ecsd-status-box strong {
    display: block;
    font-size: 28px;
    margin-bottom: 6px;
}

.ecsd-status-box span {
    display: block;
    color: #6d7280;
}

.ecsd-current-speech,
.ecsd-conversation-box {
    margin-top: 18px;
    padding: 20px;
    border: 1px solid #e7ebf3;
    border-radius: 20px;
    background: #ffffff;
}

.ecsd-current-speech h2,
.ecsd-conversation-box h2,
.ecsd-result-panel h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.ecsd-interim {
    min-height: 46px;
    padding: 14px;
    background: #f8f9fc;
    border-radius: 14px;
    color: #5f6575;
}

.ecsd-conversation {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

.ecsd-empty {
    padding: 18px;
    text-align: center;
    color: #7d8394;
    background: #f8f9fc;
    border-radius: 14px;
}

.ecsd-message {
    width: fit-content;
    max-width: min(78%, 640px);
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 14.5px;
    line-height: 1.45;
}

.ecsd-message.ai {
    align-self: flex-start;
    background: #eef6ff;
    color: #1f3b64;
    border-bottom-left-radius: 5px;
}

.ecsd-message.user {
    align-self: flex-end;
    background: #fff3df;
    color: #603a08;
    border-bottom-right-radius: 5px;
}

.ecsd-result-card {
    animation: ecsd-fade-up 0.35s ease;
}

.ecsd-result-head {
    text-align: center;
    margin-bottom: 22px;
}

.ecsd-result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffb84d, #ff8412);
    color: #ffffff;
    font-weight: 900;
}

.ecsd-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ecsd-result-panel {
    margin-top: 16px;
    padding: 18px;
    background: #f8f9fc;
    border: 1px solid #e7ebf3;
    border-radius: 18px;
}

.ecsd-result-panel.full {
    grid-column: 1 / -1;
}

.ecsd-result-panel ul {
    margin: 0;
    padding-left: 20px;
}

.ecsd-result-panel li {
    margin: 8px 0;
}

.ecsd-result-panel p {
    margin: 0;
    color: #515869;
    line-height: 1.6;
}

.ecsd-result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.ecsd-admin-card {
    max-width: 900px;
    margin-top: 18px;
    background: #ffffff;
    border: 1px solid #dfe3ea;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(22, 34, 51, 0.08);
}

@keyframes ecsd-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes ecsd-wave-arm {
    0%, 100% { transform: rotate(-28deg); }
    50% { transform: rotate(-55deg); }
}

@keyframes ecsd-wave {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.55);
        opacity: 0;
    }
}

@keyframes ecsd-blink {
    0%, 92%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

@keyframes ecsd-fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .ecsd-speaking-card,
    .ecsd-result-card {
        padding: 16px;
        border-radius: 20px;
    }

    .ecsd-top-actions {
        flex-direction: column;
        top: 8px;
    }

    .ecsd-buttons {
        width: 100%;
    }

    .ecsd-buttons .ecsd-btn {
        flex: 1;
    }

    .ecsd-stage {
        color: #000;
        padding: 18px;
        min-height: auto;
    }


    .ecsd-status-box {
        text-align: center;
        width: 180p;
    }

    .ecsd-status-box strong {
        font-size: 23px;
    }

    .ecsd-message {
        max-width: 92%;
    }

    .ecsd-result-grid {
        grid-template-columns: 1fr;
    }
}
