#toefl-bb-app {
    height: 100%;
    min-height: 100%;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

body.toefl-bb-exam-active {
    overflow: hidden;
}

body.toefl-bb-exam-active .toefl-bb-exam {
    position: fixed;
    inset: 0;
    z-index: 9999;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    margin: 0;
    background: #fff;
}

body.admin-bar.toefl-bb-exam-active .toefl-bb-exam {
    top: 32px;
    height: calc(100dvh - 32px);
}

.toefl-bb-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 16px;
    line-height: 1.45;
}

.toefl-bb-audio-block {
    margin-bottom: 30px;
}

#toefl-bb-audio {
    display: none;
}

.toefl-bb-play-audio-btn {
    border: 1px solid #1f2937;
    background: #1f2937;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.toefl-bb-play-audio-btn:disabled {
    opacity: 0.8;
    cursor: default;
}

/*.toefl-bb-audio-locked {
    padding: 20px;
    background: #e5e7eb;
    border-radius: 8px;
    color: #374151;
    font-weight: bold;
}*/

.toefl-bb-audio-locked {
    width: fit-content;
    border: 1px solid #e5e7eb;
    background: #e5e7eb;
    color: #374151;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.toefl-bb-start-screen {
    min-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f3f5f7;
}

.toefl-bb-start-card {
    width: 500px;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    background: white;
    padding: 40px;
    border-radius: 12px;
}

.toefl-bb-field {
    margin-top: 20px;
}

.toefl-bb-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.toefl-bb-field input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

#toefl-bb-start-btn,
#toefl-bb-begin-section {
    margin-top: 24px;
    width: 100%;
    background: #1f2937;
    color: #fff;
    border-radius: 4px;
    padding: 14px;
    font-size: 16px;
    cursor: pointer;
    transition-duration: 200ms;
}

#toefl-bb-start-btn:hover,
#toefl-bb-begin-section:hover {
    background: #111827;
}

.toefl-bb-finished {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.toefl-bb-image-block {
    margin-bottom: 30px;
    /*text-align: center;*/
}

.toefl-bb-image-block img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.toefl-bb-error {
    padding: 16px;
    margin-bottom: 20px;
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
    border-radius: 8px;
}

.toefl-bb-section-intro {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f5f7;
}

.toefl-bb-section-card {
    width: 500px;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    border-radius: 8px;
    background: #ffffff;
}

.toefl-bb-shell {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.toefl-bb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid #ddd;
    background: white;
    flex: 0 0 auto;
    z-index: 100;
}

.toefl-bb-header.toefl-bb-time-warning {
    background: #fff1f1;
    border-bottom-color: #f0b4b4;
    transition: background-color 200ms ease, border-color 200ms ease;
}

.toefl-bb-header.toefl-bb-time-warning #toefl-bb-timer {
    color: #b91c1c;
}

.toefl-bb-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toefl-bb-candidate {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

#toefl-bb-timer {
    font-size: 20px;
    font-weight: bold;
}

.toefl-bb-part-nav {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    padding: 10px 24px;
    border-top: 1px solid #ddd;
    background: #f8fafc;
    overflow-x: auto;
    justify-content: center;
}

.toefl-bb-part-tab {
    flex: 0 0 auto;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #111827;
    padding: 7px 12px;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.toefl-bb-part-tab-active {
    border-color: #1f2937;
    background: #1f2937;
    color: #fff;
}

.toefl-bb-submit-section,
#toefl-bb-restart-btn {
    border: 1px solid #1f2937;
    background: #1f2937;
    color: #fff;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
}

.toefl-bb-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.toefl-bb-layout-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.toefl-bb-layout-single {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.toefl-bb-layout-single .toefl-bb-questions {
    flex: 1;
    overflow-y: auto;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 48px;
    box-sizing: border-box;
    /*background: #fafafa;*/
    background: #fff;
}

.toefl-bb-passage {
    overflow-y: auto;
    padding: 24px;
    border-right: 1px solid #ddd;
    background: #fff;
}

.toefl-bb-questions {
    overflow-y: auto;
    padding: 24px;
    background: #fafafa;
    color: #111827;
    font-size: 16px;
    line-height: 1.5;
}

.toefl-bb-question {
    margin-bottom: 24px;
    padding-bottom: 20px;
    /*border-bottom: 1px solid #ddd;*/
}

.toefl-bb-question h3 {
    margin: 0 0 12px;
    color: #111827;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

.toefl-bb-choices {
    margin: 0;
}

.toefl-bb-choice input {
    flex: 0 0 auto;
    margin-top: 0;
    position: relative;
    top: 1px;
}


@media (max-width: 782px) {
    body.admin-bar.toefl-bb-exam-active .toefl-bb-exam {
        top: 46px;
        height: calc(100dvh - 46px);
    }

    .toefl-bb-header {
        align-items: flex-start;
        gap: 12px;
        padding: 12px 16px;
    }

    .toefl-bb-header-right {
        gap: 10px;
    }

    .toefl-bb-part-nav {
        padding: 8px 16px;
    }

    .toefl-bb-body {
        grid-template-columns: 1fr;
    }

    .toefl-bb-passage,
    .toefl-bb-questions {
        min-height: 0;
    }
}
