* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: Arial, sans-serif;
            background-color: #ffffff;
            line-height: 1.4;
            font-size: 16px;
            padding-bottom: 90px; /* nav-row height (80px) + some extra spacing */
        }

        /* Page watermark */
        body::after {
            content: "@BG2FOU";
            position: fixed;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%) rotate(-20deg);
            font-size: 72px;
            font-weight: 800;
            letter-spacing: 2px;
            color: #000000;
            opacity: 0.02; /* subtle */
            pointer-events: none;
            z-index: 0;
            white-space: nowrap;
        }

        .header {
            background-color: #ffffff;
            padding: 12px 20px;
            border-bottom: 1px solid #e0e0e0;
            display: flex;
            justify-content: flex-start;
            align-items: center;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 100;
            height: 70px;
            gap: 20px;
        }

        .ielts-logo {
            display: none;
        }

        .header-logo {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .header-logo img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .test-info {
            display: flex;
            align-items: center;
            gap: 30px;
            font-size: 14px;
            color: #333;
        }

        .audio-indicator {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 16px;
        }

        .audio-icon {
            width: 16px;
            height: 16px;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"></polygon></svg>') no-repeat center;
        }

        .header-icons {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .telegram-link {
            color: #3e3e3e;
            text-decoration: none;
            font-weight: 700;
            font-size: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 12px;
            border: 2px solid #3e3e3e;
            border-radius: 9999px;
            background-color: #ffffff;
            line-height: 1;
        }

        .telegram-link:hover {
            background-color: #f6f6f6;
        }

        .telegram-link::before {
            content: '';
            display: inline-block;
            width: 20px;
            height: 20px;
            background-color: currentColor;
            -webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.78 18.65l.28-4.23l7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3L3.64 12c-.88-.25-.89-1.37.2-1.64l16.56-6.4c.75-.29 1.4.22 1.2.94l-2.67 12.61c-.22.95-1.13 1.18-1.78.73l-4.5-3.32l-2.23 2.15c-.47.44-1.29.21-1.48-.37z"/></svg>');
            mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.78 18.65l.28-4.23l7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3L3.64 12c-.88-.25-.89-1.37.2-1.64l16.56-6.4c.75-.29 1.4.22 1.2.94l-2.67 12.61c-.22.95-1.13 1.18-1.78.73l-4.5-3.32l-2.23 2.15c-.47.44-1.29.21-1.48-.37z"/></svg>');
            background-size: contain;
            background-repeat: no-repeat;
        }

        #volume-slider {
            -webkit-appearance: none;
            appearance: none;
            width: 80px;
            height: 4px;
            background: #ddd;
            outline: none;
            border-radius: 2px;
            cursor: pointer;
        }

        #volume-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: #333;
            cursor: pointer;
        }

        #volume-slider::-moz-range-thumb {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: #333;
            cursor: pointer;
            border: none;
        }

        .icon {
            width: 20px;
            height: 20px;
            cursor: pointer;
            opacity: 0.7;
            color: #333;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .icon:hover {
            opacity: 1;
        }
        
        #play-pause-btn {
            background: none;
            border: none;
            padding: 0;
        }

        .main-container {
            margin-top: 60px;
            display: flex;
            background: #ffffff;
            padding-bottom: 100px; /* Space for bottom nav */
        }

        .main-container.results-mode {
            display: flex;
            flex-direction: row;
        }

        /* Left Panel */
        .left-panel {
            width: 100%;
            padding: 20px;
            transition: width 0.4s ease;
        }

        .main-container.results-mode .left-panel {
            width: 75%;
            overflow-y: auto;
            height: calc(100vh - 195px);
        }

        /* Right Panel */
        .right-panel {
            display: none;
            width: 50%;
            padding: 20px;
            position: relative;
            border-left: 1px solid #e0e0e0;
            overflow-y: auto;
            height: calc(100vh - 195px);
        }

        #transcription-container h2 {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 10px;
        }

        #transcription-text {
            white-space: pre-wrap; /* preserve line breaks from source */
            font-family: inherit;
            font-size: 15px;
            line-height: 1.7;
        }
        
        .transcription-instruction {
            display: block;
            margin: 1em 0;
            font-style: italic;
            color: #444;
        }

        .main-container.results-mode .right-panel {
            display: block;
            width: 25%;
            border-left: 1px solid #e0e0e0;
            border-top: none;
            height: calc(100vh - 195px);
            overflow-y: auto;
        }

        .help-button {
            background: #4a90e2;
            color: white;
            border: none;
            padding: 6px 12px;
            border-radius: 4px;
            font-size: 14px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            margin-bottom: 20px;
        }

        /* Inline correct answer hint (shown after checking) */
        .correct-inline {
            color: #28a745;
            font-weight: 700;
            margin-left: 10px;
            display: inline-block;
            vertical-align: middle;
            white-space: nowrap;
        }
        .correct-inline::before {
            content: "\2192  "; /* right arrow */
            font-weight: 700;
        }

        .help-button:hover {
            background: #357abd;
        }

        .section-title {
            font-weight: bold;
            margin-bottom: 15px;
            font-size: 18px;
        }

        .people-section {
            margin-bottom: 30px;
        }

        .people-table {
            width: 100%;
            border-collapse: collapse;
            border: 1px solid #ccc;
        }

        .people-table th {
            text-align: left;
            padding: 10px;
            font-weight: bold;
            border: 1px solid #ddd;
        }

        .people-table td {
            padding: 8px 10px;
            border: 1px solid #ddd;
        }

        #part-1 table td {
            line-height: 1.8;
        }
        /* Increase line height for tables in Part 4 */
        #part-4 table td {
            line-height: 2.0;
            padding-top: 10px;
            padding-bottom: 10px;
        }
        #part-4 table td div { margin: 8px 0; }
        /* Increase line height for Part 3 table (Questions 24-30) */
        #part-3 table td {
            line-height: 2.0;
            padding-top: 10px;
            padding-bottom: 10px;
            vertical-align: top;
        }
        /* Geosequestration table styling */
        .geo-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
        .geo-table th, .geo-table td { border: 1px solid #e5e7eb; padding: 14px; vertical-align: top; }
        .geo-table thead th { background: #f7f9fc; text-align: center; font-weight: 700; }
        .geo-table .arrow-row td { text-align: center; font-size: 20px; color: #6b7280; }

        .person-name {
            font-size: 16px;
        }

        .question-number {
            background: white;
            border: 1px solid #4a90e2;
            padding: 4px 8px;
            border-radius: 3px;
            font-weight: bold;
            font-size: 14px;
            color: #4a90e2;
            min-width: 30px;
            text-align: center;
        }

        .assigned-responsibility {
            background: #f0f0f0;
            padding: 4px 8px;
            border-radius: 3px;
            font-size: 14px;
            border: 1px solid #ddd;
        }

        .responsibilities-section {
            margin-bottom: 30px;
        }

        .responsibility-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            margin-bottom: 20px;
        }

        .responsibility-item {
            background: #f8f9fa;
            border: 1px solid #ddd;
            padding: 8px 12px;
            border-radius: 4px;
            cursor: move;
            font-size: 16px;
            text-align: center;
            transition: all 0.2s;
        }

        .responsibility-item:hover {
            background: #e9ecef;
            transform: translateY(-1px);
        }

        .responsibility-item.dragging {
            opacity: 0.5;
            transform: rotate(2deg);
        }

        .questions-section {
            margin-bottom: 20px;
        }

        .question-title {
            font-weight: bold;
            margin-bottom: 10px;
            font-size: 16px;
        }

        .instruction {
            margin-bottom: 20px;
            font-size: 16px;
            color: #666;
        }

        .centered-title {
            text-align: center;
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 15px;
        }

        /* Map Styles */
        .map-container {
            position: relative;
            margin: 20px auto;
            width: 100%;
            max-width: 600px;
            /* display: block; */
            /* display: flex; */
        }
        .map-container img {
            width: 100%;
            display: block;
        }
        .map-drop-zone {
            position: absolute;
            width: 13%;
            height: 15%;
            border: 2px dashed #999;
            background-color: rgba(255, 255, 255, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            color: #555;
            border-radius: 4px;
            padding: 2px;
        }
        .map-drop-zone:hover {
            background-color: rgba(230, 244, 255, 0.7);
            border-color: #4a90e2;
        }
        .map-drop-zone .drag-item {
            font-size: 14px;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 2px;
        }
        .map-options-list {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
            margin-top: 20px;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 5px;
            background-color: #f9f9f9;
        }
        .map-options-list .drag-item {
            width: calc(25% - 10px);
            text-align: center;
        }

        /* Navigation Arrows */
        .nav-arrows {
            position: fixed;
            bottom: 100px;
            right: 20px;
            display: flex;
            gap: 10px;
            z-index: 101;
        }

        .nav-arrow {
            width: 50px;
            height: 50px;
            background: #f5f5f5;
            color: #888;
            border: 2px solid #d0d0d0;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .nav-arrow:hover:not(:disabled) {
            background: #e8e8e8;
            border-color: #bbb;
        }

        .nav-arrow:disabled {
            background: #f5f5f5;
            border-color: #e0e0e0;
            color: #ccc;
            opacity: 0.5;
            cursor: not-allowed;
        }

        .nav-arrow svg {
            pointer-events: none;
        }

        /* Bottom Navigation - Exact Match */
        .nav-row {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: #ffffff;
        
            padding: 0;
            display: flex;
            align-items: center;
            height: 80px;
            z-index: 100;

            /* Allow horizontal scrolling on smaller screens */
            overflow-x: auto;
            overflow-y: hidden;
            white-space: nowrap;
            -webkit-overflow-scrolling: touch;
        }

        /* Prevent "Score/Band" button text overflow on small screens */
        .footer__deliverButton___3FM07 {
            max-width: 42%;
            white-space: normal;          /* allow wrapping */
            word-break: break-word;       /* break long text if needed */
            line-height: 1.2;
        }
        @media (max-width: 768px) {
            .footer__deliverButton___3FM07 {
                max-width: 55%;
                padding: 10px 12px;
                font-size: 14px;
            }
        }
        @media (max-width: 480px) {
            .footer__deliverButton___3FM07 {
                max-width: 65%;
                padding: 8px 10px;
                font-size: 13px;
            }
        }

        .footer__questionWrapper___1tZ46 {
            display: flex;
            align-items: center;
            margin-right: 20px;
            flex-shrink: 0;
        }


        .footer__questionNo___3WNct {
            background: none;
            border: none;
            padding: 10px 15px;
            font-size: 16px;
            font-weight: 600;
            color: #333;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 5px;
            transition: background-color 0.2s;
        }

        .footer__questionNo___3WNct:hover {
            background-color: #f8f9fa;
        }

        .section-prefix {
            font-size: 16px;
        }

        .sectionNr {
            font-size: 16px;
            font-weight: bold;
        }

        .attemptedCount {
            font-size: 14px;
            color: #666;
            margin-left: 5px;
            font-weight: 400; /* Normal weight */
        }

        @media (max-width: 1024px) {
            .attemptedCount {
                display: none;
            }
        }

        .footer__questionWrapper___1tZ46.selected .attemptedCount {
            display: none;
        }

        .footer__subquestionWrapper___9GgoP {
            display: none;
            gap: 2px;
            margin-left: 10px;
        }

        .footer__questionWrapper___1tZ46.selected .footer__subquestionWrapper___9GgoP {
            display: flex;
        }

        .subQuestion {
            width: 32px;
            height: 32px;
            border: 1px solid #ccc;
            background: white;
            color: #333;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            border-radius: 2px;
        }

        .subQuestion.answered {
            background-color: #e9ecef;
            border-color: #ddd;
        }
        .subQuestion.correct {
            background-color: #28a745;
            color: white;
            border-color: #28a745;
        }
        .subQuestion.incorrect {
            background-color: #dc3545;
            color: white;
            border-color: #dc3545;
        }

        .subQuestion:hover {
            background-color: #f0f0f0;
            border-color: #999;
        }

    

        .subQuestion.completed {
            background-color: #28a745;
            color: white;
            border-color: #28a745;
        }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .footer__deliverButton___3FM07 {
            margin-left: auto;
            margin-right: 20px;
            background-color: #f0f0f0;
            color: #333;
            border: 1px solid #ccc;
            padding: 12px 20px;
            border-radius: 4px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background-color 0.2s, border-color 0.2s;
            min-width: 170px;
            justify-content: center;
        }

        .footer__deliverButton___3FM07:hover {
            background-color: #e0e0e0;
            border-color: #bbb;
        }
        /* Success style for "My Results" button after checking */
        .footer__deliverButton___3FM07.success {
            background-color: #28a745;
            color: #fff;
            border-color: #28a745;
        }
        .footer__deliverButton___3FM07.success:hover {
            background-color: #218838;
            border-color: #1e7e34;
        }

        .footer__deliverButton___3FM07:disabled {
            background: #e9ecef;
            color: #6c757d;
            cursor: not-allowed;
            border-color: #ddd;
        }

        .fa-check::before {
            content: "�?;
        }

        .hidden {
            display: none;
        }

        .footer__exitButton___3FM07 {
            margin-right: 20px;
            background-color: #f0f0f0;
            color: #333;
            border: 1px solid #ccc;
            padding: 12px 20px;
            border-radius: 4px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background-color 0.2s, border-color 0.2s;
            min-width: 100px;
            justify-content: center;
        }

        .footer__exitButton___3FM07:hover {
            background-color: #e0e0e0;
            border-color: #bbb;
        }

        /* Context Menu */
        .context-menu {
            position: absolute;
            background: white;
            border: 1px solid #ccc;
            border-radius: 6px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            z-index: 1000;
            display: none;
            min-width: 140px;
        }

        .context-menu-item {
            padding: 12px 16px;
            cursor: pointer;
            font-size: 16px;
            border-bottom: 1px solid #f0f0f0;
            transition: background-color 0.2s;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .context-menu-item:hover {
            background-color: #f8f9fa;
        }

        .context-menu-item:last-child {
            border-bottom: none;
        }

        .highlight {
            background-color: #ffff00;
        }

        .comment-highlight {
            background-color: #90EE90;
            position: relative;
            cursor: help;
        }

        .comment-tooltip {
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            background: #333;
            color: white;
            padding: 8px 12px;
            border-radius: 4px;
            font-size: 14px;
            white-space: nowrap;
            z-index: 1000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s;
        }

        .comment-highlight:hover .comment-tooltip {
            opacity: 1;
        }

        .question {
            margin-bottom: 40px;
        }
        .question p {
            margin-bottom: 10px;
        }
        .question ul, .question .people-table {
            margin-top: 0;
        }
        .question-prompt {
            margin-bottom: 20px;
        }
        .question ul {
            list-style: none;
            padding-left: 0;
        }
        .question ul li {
            margin-bottom: 5px;
        }
        .answer-input {
            border: 1px solid #9aa3ad;
            border-radius: 4px;
            background-color: #fff;
            padding: 4px 8px;
            font-size: 16px;
            text-align: left; /* start typing from left */
            margin-right: 4px;
            width: 140px;
            max-width: 160px;
            min-width: 120px;
            word-break: break-word;
            overflow-wrap: break-word;
            white-space: normal;
            height: 28px;
            min-height: 28px;
            line-height: 1.2;
            vertical-align: middle;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .answer-input::placeholder {
            color: #999;
            font-weight: bold;
            text-align: center; /* numbers centered until typing starts */
        }
        .answer-input:focus {
            outline: none;
            border-color: #2c6bed;
            border-width: 2px;
        }
        .answer-input.correct {
            border-color: #28a745;
            background-color: #e9f7ef;
        }
        .answer-input.incorrect {
            border-color: #dc3545;
            background-color: #f8d7da;
            color: #721c24;
        }
        .answer-input {
    z-index: 10;
    position: relative;
    pointer-events: auto;
    font-weight: 600;
}
        .drag-drop-container {
            display: flex;
            gap: 30px;
            margin-top: 20px;
            align-items: flex-start;
        }
        .recommendations-box {
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding: 10px;
            min-height: 200px;
        }
        .drag-item {
            background: white;
    border: 1px solid #9c9c9c;
    font-weight: 600;
    padding: 0px 5px;
            border-radius: 4px;
            cursor: move;
            font-size: 16px;
            transition: all 0.2s;
            user-select: none;
        }
        .drag-item:hover {
            background: #e9ecef;
        }
        .drag-item.dragging {
            opacity: 0.5;
            transform: rotate(2deg);
        }
        .drop-zone {
            border: 2px dashed #aaa;
            border-radius: 4px;
            height: 25px;
            margin-top: 19px;
            margin-bottom: 5px;
            transition: background-color 0.2s, border-color 0.2s;
            padding: 0.5px 5px;
            display: flex;
            align-items: center;
            position: relative;
            color: #b3b3b3;
            font-weight: 600;
            min-width: 200px;
            width: auto;
        }
        .drop-zone.drag-over {
            background-color: #e6f4ff;
            border-color: #4a90e2;
        }
        /* Letter pill displayed inside drop-zones */
        .drop-letter {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 22px;
            height: 20px;
            padding: 0 6px;
            border: 1px solid #4a90e2;
            color: #0f5bd7;
            background: #eef5ff;
            border-radius: 9999px;
            font-weight: 700;
            cursor: move;
            user-select: none;
        }
        .drop-zone.correct {
            background-color: #e9f7ef;
            border-color: #28a745;
            border-style: solid;
        }
        .drop-zone.incorrect {
            background-color: #f8d7da;
            border-color: #dc3545;
            border-style: solid;
        }
        .drop-zone .drag-item {
            cursor: default;
        }
        .drag-item.selected {
            border-color: #4a90e2;
            box-shadow: 0 0 0 1px #4a90e2;
        }
        .questions-container {
            width: 50%;
        }
        /* When transcription (results mode) is visible, give questions container 80% of left panel */
        .main-container.results-mode .questions-container {
            width: 80%;
        }
        audio {
            width: 100%;
            margin-bottom: 20px;
        }
        .part-header {
            background-color: #f1f2ec;
            padding: 15px;
            border-radius: 5px;
            margin-bottom: 20px;
            border: 1px solid #e0e0e0;
        }
        .part-header p {
            margin: 0;
        }

        .question li.correct {
            color: #155724;
            font-weight: bold;
        }
        .question li.incorrect {
            color: #721c24;
        }
        .question li.correct::before {
            content: '�?';
            color: #28a745;
        }
        .question li.incorrect::before {
            content: '�?';
            color: #dc3545;
        }

        .example-box {
            margin: 20px 0;
        }

        .timer-container {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: center;
            gap: 2px;
        }
        .timer-container .timer-tooltip {
            display: none;
        }

        .listening-timer-display {
            font-size: 13px;
            font-weight: normal;
            color: #666;
            padding: 4px 8px;
            background: transparent;
            border-radius: 4px;
            margin-top: 0;
            text-align: left;
        }

        .listening-timer-display.warning {
            color: #ff6b00;
        }

        .listening-timer-display.critical {
            color: #dc3545;
            animation: pulse-timer 1s infinite;
        }

        @keyframes pulse-timer {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }

        .audio-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(40, 40, 40, 0.9);
            z-index: 2000;
            display: flex;
            justify-content: center;
            align-items: center;
            color: white;
            text-align: center;
        }
        .audio-modal-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
            max-width: 500px;
            padding: 20px;
        }
        .audio-modal-content p {
            font-size: 16px;
            line-height: 1.5;
            color: #eee;
        }
        .audio-modal-icon {
            margin-bottom: 20px;
        }
        .modal-play-btn {
            background-color: #000;
            color: white;
            border: 1px solid white;
            padding: 12px 24px;
            border-radius: 6px;
            font-size: 18px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: background-color 0.2s;
        }
        .modal-play-btn:hover {
            background-color: #333;
        }
        #goto-widget {
            display: flex;
            align-items: center;
            gap: 5px;
        }
        #goto-input {
            width: 80px;
            padding: 4px 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        #goto-btn {
            padding: 4px 10px;
            border: 1px solid #ccc;
            background-color: #f0f0f0;
            border-radius: 4px;
            cursor: pointer;
        }

        @keyframes flash {
            0% { background-color: #e6f4ff; }
            100% { background-color: transparent; }
        }

        .question.flash {
            animation: flash 1s ease-out;
        }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.6);
            z-index: 2000;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }
        .modal-content {
            background: white;
            padding: 25px;
            border-radius: 8px;
            width: 100%;
            max-width: 800px;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 5px 15px rgba(0,0,0,0.3);
        }
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #ddd;
            padding-bottom: 15px;
            margin-bottom: 20px;
        }
        .modal-header h2 {
            font-size: 24px;
            color: #333;
        }
        .modal-close-btn {
            background: none;
            border: none;
            font-size: 28px;
            cursor: pointer;
            color: #888;
            line-height: 1;
        }
        .modal-close-btn:hover {
            color: #333;
        }

        #part-2 .questions-container {
width: 75%;
        }
        #score-summary {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 20px;
        }
        #result-details table {
            width: 100%;
            border-collapse: collapse;
            font-size: 14px;
        }
        #result-details th, #result-details td {
            border: 1px solid #ddd;
            padding: 10px;
            text-align: left;
            vertical-align: middle;
        }
        #result-details th {
            background-color: #f8f9fa;
            font-weight: 600;
        }
        #result-details td:nth-child(1) {
            font-weight: bold;
            text-align: center;
        }
        .result-correct {
            color: #28a745;
            font-weight: bold;
        }
        .result-incorrect {
            color: #dc3545;
            font-weight: bold;
        }

        .context-menu-icon {
            width: 16px;
            height: 16px;
            display: inline-block;
            vertical-align: middle;
            margin-right: 8px;
        }

        .matching-container {
            display: flex;
            justify-content: space-between;
            gap: 40px;
            margin-top: 20px;
            align-items: flex-start;
        }
        /* Two-column drag-and-drop layout like screenshot */
        .dnd-col-title { font-weight: 700; margin-bottom: 10px; }
        .matching-question-container { display: flex; gap: 30px; align-items: flex-start; }
        .matching-options-bank { flex: 1; display: flex; flex-direction: column; gap: 10px; }
        .matching-questions { flex: 2; display: flex; flex-direction: column; gap: 24px; }
        .matching-questions .matching-question-item { display: flex; align-items: center; gap: 16px; padding: 6px 0; }
        .matching-questions .matching-question-item span { min-width: 180px; }
        .matching-questions .drop-zone { width: 100%; min-width: 360px; height: 34px; border: 2px dashed #aab3bd; border-radius: 4px; background: #fff; display: flex; align-items: center; padding: 0 8px; justify-content: flex-start; text-align: left; }
        .matching-questions .drop-zone .placeholder { color: #6b7280; font-weight: 700; }
        .matching-options-bank .drag-item { border-radius: 6px; padding: 6px 12px; background: #ffffff; border: 1px solid #d1d5db; font-weight: 600; box-shadow: 0 1px 0 rgba(0,0,0,0.02); }
        .matching-table {
            flex: 4;
            border-collapse: collapse;
        }
        .matching-table th, .matching-table td {
            padding: 6px 12px;
            text-align: left;
            vertical-align: middle;
        }
        .matching-table th {
            background-color: #f8f9fa;
            font-weight: 600;
        }
        .matching-table .drop-zone {
            /* Unify with global drop-zone styling */
            border: 2px dashed #aaa;
            border-radius: 4px;
            height: 25px;
            width: 100%;
            max-width: none;
            min-width: 200px;
            padding: 0.5px 5px;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            flex-wrap: nowrap;
            background-color: transparent;
            word-break: break-word;
            overflow-wrap: break-word;
            text-align: left;
            line-height: 1.2;
            color: #b3b3b3;
            font-weight: 600;
        }
        .matching-table .drop-zone .drag-item {
            width: auto;
            max-width: none;
            text-align: left;
            padding: 6px 8px;
            font-size: 14px;
            line-height: 1.2;
            word-break: break-word;
            overflow-wrap: break-word;
            box-sizing: border-box;
            background: white;
            border: 1px solid #ddd;
            border-radius: 4px;
            margin: 2px;
        }
        .matching-options-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            flex: 1;
            background-color: transparent;
            padding: 0;
            border: none;
            min-height: 250px;
            min-width: 280px; /* ensure enough width for long option text to stay on one line */
        }
        .matching-options-list .drag-item {
            width: 100%;
        }
        .matching-question-item .drop-zone .placeholder {
            color: #999;
            font-weight: bold;
        }

        /* Clickable cell styles for matching questions */
        .clickable-cell {
            cursor: pointer;
            text-align: center;
            transition: all 0.2s ease;
            min-width: 50px;
            min-height: 50px;
            border: 2px solid #e0e0e0;
            position: relative;
            background-color: #f8f9fa;
            margin: 2px;
        }
       
        .clickable-cell:hover {
            background-color: #e6f4ff;
            border-color: #4a90e2;
        }
        .clickable-cell.selected {
            background-color: #75a8e4 !important;
            color: white !important;
        }
       
        .clickable-cell.correct {
            background-color: #28a745 !important;
            color: white !important;
        }
        .clickable-cell.correct::after {
            content: "�?;
            font-weight: bold;
        }
        .clickable-cell.incorrect {
            background-color: #dc3545 !important;
            color: white !important;
        }
        .clickable-cell.incorrect::after {
            content: "�?;
            font-weight: bold;
        }
        
        /* Clickable cell styles for questions 27-30 */
        .clickable-cell {
            cursor: pointer;
            text-align: center;
            transition: all 0.2s ease;
            min-width: 50px;
            min-height: 50px;
            border: 2px solid #e0e0e0;
            position: relative;
            background-color: #f8f9fa;
            margin: 2px;
        }
       
        .clickable-cell:hover {
            background-color: #e6f4ff;
            border-color: #4a90e2;
        }
        .clickable-cell.selected {
            background-color: #4a90e2 !important;
            color: white !important;
        }
        
        .clickable-cell.correct {
            background-color: #28a745 !important;
            color: white !important;
        }
        
        .clickable-cell.incorrect {
            background-color: #dc3545 !important;
            color: white !important;
        }
        

        
        .statement {
            font-weight: 500;
            padding-right: 20px;
        }

        .option strong,
        .question ul li label strong {
            display: none;
        }

        /* Mobile selection toolbar */
        .mobile-selection-menu {
            position: absolute;
            background: #333;
            color: #fff;
            padding: 6px 10px;
            border-radius: 6px;
            display: flex;
            gap: 8px;
            z-index: 3000;
            box-shadow: 0 2px 6px rgba(0,0,0,0.25);
        }
        .mobile-selection-menu button {
            background: transparent;
            border: 1px solid #fff;
            color: #fff;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 14px;
        }
        .mobile-selection-menu.hidden {
            display: none;
        }

        /* === Matching table styling for Questions 13-16 === */
        .matching-table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
        }
        .matching-table th,
        .matching-table td {
            border: 1px solid #ddd;
            padding: 8px 4px;
            vertical-align: middle;
            text-align: center;
        }
        .matching-table .clickable-cell {
            padding: 8px 4px;
            min-width: 50px;
            min-height: 50px;
        }
        .matching-table th {
            background-color: #1e6de6;
            color: #ffffff;
            font-weight: 600;
            text-align: center;
        }
        .matching-table th:first-child {
            text-align: left;
            background-color: #f8f9fa;
            color: #333;
        }
        .matching-table tbody td:first-child {
            font-weight: 500;
            text-align: left;
            background-color: #f8f9fa;
        }
        .matching-table tr:nth-child(even) td {
            background-color: #f8faff;
        }

        /* === MCQ table styling for Questions 11-15 === */
        .mcq-table {
            width: 100%;
            border-collapse: collapse;
        }
        .mcq-table th,
        .mcq-table td {
            border: 1px solid #ddd;
            padding: 8px 12px;
            vertical-align: middle;
            text-align: center;
        }
        .mcq-table th {
            background-color: #1e6de6; /* vibrant blue header like screenshot */
            color: #ffffff;
            font-weight: 600;
            text-align: center;
        }
        .mcq-table th:first-child {
            text-align: left;
        }
        .mcq-table tbody td:first-child {
            font-weight: 500;
            text-align: left;
        }
        .mcq-table tr:nth-child(even) td {
            background-color: #f8faff; /* subtle alternating row colour */
        }
        .mcq-table input[type="radio"] {
            transform: scale(1.1);
            cursor: pointer;
        }
        /* list of options (A, B, C) shown above the table */
        .mcq-options {
            list-style: none;
            padding-left: 0;
            margin: 10px 0;
        }
        .mcq-options li {
            margin-bottom: 4px;
            font-size: 16px;
        }

        /* MCQ design: full-width selectable panels */
        .multi-choice-question { margin: 12px 0 18px; }
        .multi-choice-option { display:block; width:100%; padding: 12px 14px;  background-color: #fff; border: 1px solid transparent;  transition: background-color 0.2s ease, border-color 0.2s ease; }
        .multi-choice-option:hover { background-color: #f1f7ff; border-color: #c6dcfb; }
        .multi-choice-option:has(input[type="radio"]:checked) { background-color: #cfe3f9; }
        .multi-choice-option label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 16px; width:100%; }

        .aligned-form .question-row {
            display: flex;
            align-items: center;
            margin-bottom: 8px;
        }
        .aligned-form .question-label {
            width: 230px;
            padding-right: 10px;
        }

        /* Responsive adjustments for tablets */
        @media (max-width: 1024px) {
            .main-container {
                flex-direction: column;
            }
            .right-panel, .main-container.results-mode .right-panel {
                display: none;
            }
            .left-panel, .main-container.results-mode .left-panel {
                width: 100%;
                padding: 20px 10px;
                height: auto; /* Reset height for mobile */
            }
            .questions-container {
                width: 100%;
            }
        }

        .single-choice label.correct {
            color: #155724;
            font-weight: bold;
        }
        .single-choice label.correct::before {
            content: '�?';
            color: #28a745;
        }
        .single-choice label.incorrect {
            color: #721c24;
            text-decoration: line-through;
        }
        .single-choice label.incorrect::before {
            content: '�?';
            color: #dc3545;
        }
        .mcq-table tbody tr.correct {
            background-color: #d4edda !important;
            color: #155724;
            font-weight: bold;
        }
        .mcq-table tbody tr.incorrect {
            background-color: #f8d7da !important;
            text-decoration: line-through;
        }
        .mcq-table tbody tr.incorrect td {
            color: #721c24;
        }

        /* New Audio Player Styles */
        .audio-player-container {
            position: relative;
            width: 480px;
            max-width: 480px;
            height: 40px;
            background: #f9f9f9;
            border: 1px solid #ddd;
            border-radius: 8px;
            display: flex;
            align-items: center;
            padding: 0 15px;
            gap: 10px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            flex-shrink: 0;
        }
        .main-container {
            margin-top: 70px;
        }
        .player-btn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 5px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .player-btn svg {
            width: 20px;
            height: 20px;
            fill: #333;
        }
        .progress-container {
            flex-grow: 1;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        #progress-bar {
            flex-grow: 1;
            -webkit-appearance: none;
            appearance: none;
            height: 4px;
            background: #ddd;
            outline: none;
            border-radius: 3px;
            cursor: pointer;
        }
        #progress-bar::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #4a90e2;
            cursor: pointer;
        }
        #progress-bar::-moz-range-thumb {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #4a90e2;
            cursor: pointer;
            border: none;
        }
        #current-time, #total-duration {
            font-size: 12px;
            color: #555;
            min-width: 35px;
            text-align: center;
        }
        .controls-container {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .volume-container {
            display: flex;
            align-items: center;
            position: relative;
        }
        #new-volume-slider {
            -webkit-appearance: none;
            appearance: none;
            width: 60px;
            height: 3px;
            background: #ccc;
            outline: none;
            border-radius: 2px;
            cursor: pointer;
            margin-left: 8px;
            display: block; 
        }
    
        #new-volume-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #333;
        }
        #new-volume-slider::-moz-range-thumb {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #333;
            border: none;
        }
        .speed-container {
            position: relative;
        }
        #speed-btn {
            font-size: 12px;
            font-weight: 600;
            color: #333;
            background-color: #e9ecef;
            border: 1px solid #ced4da;
            border-radius: 4px;
            padding: 4px 8px;
        }
        #speed-options {
            position: absolute;
            top: calc(100% + 5px); /* Position below the button with a small gap */
            right: 0;
            background: white;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            z-index: 101;
        }
        #speed-options div {
            padding: 8px 15px;
            cursor: pointer;
        }
        #speed-options div:hover {
            background-color: #f0f0f0;
        }

        /* Flowchart styles */
        .flowchart-container {
            border: 1px solid #ccc;
            padding: 0 20px;
        }
        .flowchart-step {
            text-align: center;
            margin: 0;
            padding: 20px 0;
            border-top: 1px solid #ddd;
        }
        .flowchart-step:first-child {
            border-top: none;
            padding-top: 20px;
            margin-top: 0;
        }
        .flowchart-arrow {
            text-align: center;
            margin: 0;
            padding: 15px 0;
            font-size: 20px;
            color: #555;
            border-top: 1px solid #ddd;
        }
        .flowchart-split {
            display: flex;
            justify-content: space-between;
            align-items: stretch;
            gap: 20px;
            border-top: 1px solid #ddd;
        }
        .flowchart-split-col {
            width: 48%;
            text-align: center;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        .flowchart-split .flowchart-step {
            border-top: none;
            padding-top: 0;
            margin-top: 0;
            flex-grow: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px 0;
        }
        .flowchart-split .flowchart-arrow {
            border-top: none;
            padding: 15px 0;
        }


        /* Responsive adjustments for tablets */
        @media (max-width: 1024px) {
            .audio-player-container {
                width: 380px;
                max-width: 380px;
                gap: 8px;
                padding: 0 10px;
            }
            .progress-container {
                gap: 6px;
            }
            #new-volume-slider {
                width: 50px;
            }
            .main-container {
                flex-direction: column;
            }
            .right-panel, .main-container.results-mode .right-panel {
                display: none;
            }
            .left-panel, .main-container.results-mode .left-panel {
                width: 100%;
                padding: 20px 10px;
                height: auto; /* Reset height for mobile */
            }
            .questions-container {
                width: 100%;
            }
            
            /* Adjust input boxes for tablets */
            .answer-input {
                width: 90px;
                max-width: 110px;
                font-size: 15px;
            }
            
            .drop-zone {
                max-width: 110px;
                min-width: 90px;
            }
            
            .matching-table .drop-zone {
                max-width: 110px;
                min-width: 90px;
            }
        }
        
        /* Responsive adjustments for mobile phones */
        @media (max-width: 768px) {
            .header {
                height: auto;
                flex-wrap: wrap;
                padding: 8px 15px;
            }
            .audio-player-container {
                width: 100%;
                max-width: 100%;
                order: 3;
                margin-top: 8px;
            }
            .timer-container {
                font-size: 14px;
            }
            .answer-input {
                width: 80px;
                max-width: 100px;
                font-size: 14px;
                padding: 2px 4px;
            }
            
            .drop-zone {
                max-width: 100px;
                min-width: 80px;
                font-size: 14px;
            }
            
            .matching-table .drop-zone {
                max-width: 100px;
                min-width: 80px;
            }
            
            .drag-item {
                font-size: 13px;
                padding: 4px 6px;
            }
            
            .matching-table .drop-zone .drag-item {
                font-size: 12px;
            }
            
            /* Ensure drag-drop containers are more mobile-friendly */
            .drag-drop-container {
                flex-direction: column;
                gap: 15px;
            }
            
            .matching-container {
                flex-direction: column;
                gap: 20px;
            }
        }
        
        /* Extra small screens */
        @media (max-width: 480px) {
            .audio-player-container {
                padding: 0 8px;
                gap: 6px;
            }
            #current-time, #total-duration {
                font-size: 11px;
                min-width: 30px;
            }
            .player-btn svg {
                width: 18px;
                height: 18px;
            }
            #new-volume-slider {
                width: 40px;
            }
            .answer-input {
                width: 70px;
                max-width: 90px;
                font-size: 13px;
            }
            
            .drop-zone {
                max-width: 90px;
                min-width: 70px;
            }
            
            .matching-table .drop-zone {
                max-width: 90px;
                min-width: 70px;
            }
        }

        /* ===== Imported designs from Reading 4.html ===== */
        /* TRUE/FALSE/NOT GIVEN styles */
        .tf-question { margin-bottom: 25px; padding: 10px 0; border-radius: 4px; }
        .tf-question-line { display: flex; align-items: flex-start; margin-bottom: 15px; padding: 5px 0; border-radius: 4px; }
        .tf-question-number, .question-number-box { border: 2px solid #ccc; padding: 2px 8px; margin-right: 10px; border-radius: 3px; font-weight: bold; display: inline-block; }
        .tf-question.active-question .tf-question-number { border-color: #4a90e2; }
        .tf-question-text { padding-top: 3px; }
        .tf-options { padding-left: 5px; }
        .tf-option { display: flex; align-items: center; padding: 10px 12px; background-color: #fff; transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
        .tf-option:hover { background-color: #f1f7ff; border-color: #c6dcfb; }
        .tf-option.correct { background-color: #d4edda !important; border-color: #28a745 !important; }
        .tf-option.incorrect { background-color: #f8d7da !important; border-color: #dc3545 !important; }
        .tf-option input[type="radio"] { margin-right: 10px; transform: scale(1.2); }
        .tf-question.correct .tf-question-line { background-color: #e9f7ef; }
        .tf-question.incorrect .tf-question-line { background-color: #f8d7da; }

        /* Multi-choice question styles */
        .multi-choice-question { margin-bottom: 20px; padding: 10px; border-radius: 4px; border: 3px solid transparent; }
        .multi-choice-question .question-prompt p > strong:first-child { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; padding: 2px 6px; margin-right: 8px; border: 1px solid #d0d7e2; border-radius: 6px; background: #fff; }
        .multi-choice-question.active-question .question-prompt p > strong:first-child { border-color: #4a90e2; border-width: 2px; }
        .multi-choice-option { padding: 10px 12px; background-color: #fff; transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
        .multi-choice-option:hover { background-color: #f1f7ff; border-color: #c6dcfb; }
        .multi-choice-option.correct { background-color: #d4edda !important;  }
        .multi-choice-option.incorrect { background-color: #f8d7da !important;  }
        .multi-choice-option label { display: flex; align-items: center; cursor: pointer; font-size: 16px; }
        .multi-choice-option input[type="checkbox"], .multi-choice-option input[type="radio"] { margin-right: 12px; transform: scale(1.3); accent-color: #4a90e2; }

        /* Checkbox TWO-answers block (match screenshot) */
        .checkbox-question .question-prompt p > strong:first-child {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 24px;
           
            background: #fff;
        }
        .checkbox-group { display: flex; flex-direction: column;  }
        .checkbox-group label { display: flex; align-items: center; padding: 10px 12px; border: 1px solid transparent; background: #fff; transition: background-color 0.2s, border-color 0.2s; }
        .checkbox-group label:hover { background: #f1f7ff; border-color: #c6dcfb; }
        .checkbox-group label:has(input[type="checkbox"]:checked) { background: #cfe3f9; }
        .checkbox-group input[type="checkbox"] { margin-right: 10px; transform: scale(1.2); }
        .checkbox-group label.correct { background-color: #d4edda !important; }
        .checkbox-group label.incorrect { background-color: #f8d7da !important;  }
        .checkbox-group label.correct::before { content: '�?'; color: #28a745; font-weight: 600; margin-right: 6px; }
        .checkbox-group label.incorrect::before { content: '�?'; color: #dc3545; font-weight: 600; margin-right: 6px; }

        /* Drag & Drop enhancements */
        /* When filled, hide zone border and show a blue outlined pill around the dropped option */
        .drop-zone.filled { 
            background: transparent; 
            border: none !important; 
            padding: 0; 
            justify-content: flex-start; 
            width: auto;
            min-width: fit-content;
        }
        .drop-zone.filled .drag-item { 
            width: auto; 
            height: auto; 
            display: inline-block; 
            white-space: nowrap; 
            border: 1px solid #2c6bed; 
            border-radius: 4px; 
            padding: 2px 6px; 
            font-weight: 600; 
            background: #fff; 
            color: #222; 
        }

        /* ===== Results Modal UI ===== */
        .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 3000; padding: 20px; }
        .modal-content { background: #ffffff; width: 100%; max-width: 900px; max-height: 85vh; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); overflow: hidden; display: flex; flex-direction: column; }
        .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #e5e7eb; background: #f8fafc; position: sticky; top: 0; z-index: 1; }
        .modal-header h2 { margin: 0; font-size: 20px; font-weight: 700; color: #111827; }
        .modal-close-btn { background: transparent; border: none; font-size: 26px; line-height: 1; cursor: pointer; color: #6b7280; }
        .modal-close-btn:hover { color: #111827; }
        .modal-body { padding: 16px 18px; overflow: auto; }
        #score-summary { font-size: 16px; font-weight: 600; color: #111827; background: #f1f5f9; border: 1px solid #e2e8f0; padding: 10px 12px; border-radius: 8px; display: inline-block; }
        .result-controls { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
        .result-controls .spacer { flex: 1; }
        .result-controls label { display: inline-flex; align-items: center; gap: 6px; color: #374151; }
        .btn-secondary { padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 6px; background: #ffffff; color: #111827; cursor: pointer; }
        .btn-secondary:hover { background: #f8fafc; }
        #result-details { overflow: auto; }
        #result-details table { width: 100%; border-collapse: collapse; border: 1px solid #e5e7eb; }
        #result-details th, #result-details td { padding: 10px 12px; border-bottom: 1px solid #e5e7eb; text-align: left; font-size: 14px; }
        #result-details thead th { position: sticky; top: 0; background: #f1f5f9; z-index: 1; }
        #result-details tr:nth-child(even) td { background: #fafafa; }
        #result-details td.result-correct { color: #0f5132; font-weight: 600; }
        #result-details td.result-incorrect { color: #842029; font-weight: 600; }
