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

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

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

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

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

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

#ielts-bb-theme-toggle {
    border: 1px solid #1f2937;
    background: #1f2937;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}


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

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

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

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

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

#ielts-bb-start-btn,
#ielts-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;
}

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

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

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

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

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

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

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

.ielts-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;
}

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

body.ielts-bb-dark .ielts-bb-exam {
    filter: invert(0.92) hue-rotate(180deg);
}

.ielts-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;
}

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

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

.ielts-bb-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.ielts-bb-timer-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ielts-bb-brand-logo {
    height: 28px;
    flex: 0 0 auto;
    object-fit: contain;
}

.ielts-bb-start-logo {
    display: block;
    margin: auto;
    margin-bottom: 15px;
    height: 65px;
}

@media (max-width: 782px) {
    .ielts-bb-header-left {
        gap: 10px;
    }

    .ielts-bb-brand-logo {
        width: 40px;
        height: 40px;
    }
}

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

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

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

#ielts-bb-audio-status {
    line-height: 1.2;
}

.ielts-bb-part-nav {
    flex: 0 0 auto;
    display: flex;
    gap: 0;
    width: 100%;
    /*padding: 0 24px;*/
    border-top: 1px solid #d7dee8;
    /*border-bottom: 1px solid #d7dee8;*/
    background: #f4f7fb;
    overflow-x: auto;
    justify-content: center;
    scrollbar-width: thin;
    box-sizing: border-box;
}

.ielts-bb-part-tab-group {
    display: flex;
    flex: 1 1 0;
    width: calc(100% / var(--ielts-bb-part-count, 1));
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 14px;
    border-bottom: 4px solid transparent;
    background: transparent;
    box-sizing: border-box;
    cursor: pointer;
    transition: background-color 160ms ease,
        border-color 160ms ease;
}

.ielts-bb-part-tab-group:hover,
.ielts-bb-part-tab-group:focus-within {
    background: rgba(255, 255, 255, 0.75);
}

.ielts-bb-part-tab-group.ielts-bb-part-tab-active {
    border-bottom-color: #358ec5;
    background: #ffffff;
}

.ielts-bb-part-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    border: none;
    background: transparent;
    color: #526277;
    padding: 0;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.ielts-bb-part-tab:hover,
.ielts-bb-part-tab:focus-visible {
    color: #1e293b;
}

.ielts-bb-part-tab-label {
    display: inline-block;
}

.ielts-bb-part-tab.ielts-bb-part-tab-active {
    color: #102437;
}

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

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

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

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

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

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

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

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

.ielts-bb-highlight-popover {
    position: fixed;
    z-index: 10020;
    background: #1f2937;
    border-radius: 6px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    padding: 4px;
}

.ielts-bb-highlight-popover button {
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 8px;
}

.ielts-bb-inline-highlight {
    background: #fff176;
}

body.ielts-bb-dark .ielts-bb-inline-highlight,
body.ielts-bb-dark .ielts-bb-brand-logo,
body.ielts-bb-dark .ielts-bb-start-logo {
    /*background: #5cb8ff;*/
     filter: invert(1) hue-rotate(180deg);
}

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

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

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

.ielts-bb-text-answer,
.ielts-bb-textarea-answer {
    width: 100%;
    max-width: 850px;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 2px solid #b8c0cc;
    border-radius: 4px;
    color: #111827;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.4;
}

.ielts-bb-textarea-answer {
    min-height: 500px;
    resize: vertical;
}

.ielts-bb-inline-blank {
    display: inline-block;
    width: 100px;
    min-width: 70px;
    max-width: 180px;
    max-height: 30px !important;
    margin-top: 4px;
    margin-bottom: 4px;
    padding: 2px 6px;
    border: none !important;
    border-bottom: 2px solid #111827 !important;
    background: transparent;
    color: #0c121d !important;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.8;
    vertical-align: baseline;
    border-radius: 0;
}

.ielts-bb-note-box {
    border: 2px solid #111827;
    padding: 18px 22px;
    /*border-radius: 6px;*/
    background: #fff;
    margin-bottom: 24px;
}

.ielts-bb-notes-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.ielts-bb-notes-table th,
.ielts-bb-notes-table td {
    border: 2px solid #0c111b;
    padding: 10px 12px;
    text-align: left;
}

.ielts-bb-inline-blank:focus {
    outline: none;
    border-bottom-color: #2563eb;
}

/* Disable transitions inherited from global styles to avoid brief flash
   when inline blanks lose focus. */
.ielts-bb-inline-blank,
.ielts-bb-inline-blank:focus,
.ielts-bb-inline-blank:focus-visible {
    transition: none !important;
    -webkit-transition: none !important;
}

.ielts-bb-word-count {
    margin-top: 8px;
    color: #4b5563;
    font-size: 16px;
    line-height: 1.4;
}

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

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

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

    .ielts-bb-part-nav {
        padding: 0 16px;
        overflow-x: auto;
    }

    .ielts-bb-part-tab-group {
        gap: 8px;
        padding: 10px 12px;
        justify-content: flex-start;
    }

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

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