        :root {
            --ink: #19324a;
            --ink-strong: #10263b;
            --teal: #0f766e;
            --teal-strong: #0b5f59;
            --teal-soft: #e6f6f4;
            --page: #edf2f5;
            --surface: #ffffff;
            --surface-muted: #f7fafc;
            --line: #cbd5df;
            --text: #1f2937;
            --muted: #5b6875;
            --success: #18794e;
            --success-soft: #effaf4;
            --danger: #b42318;
            --warning: #a65e0b;
            --warning-soft: #fff7e8;
        }

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

        body {
            font-family: "Segoe UI", Arial, sans-serif;
            background-color: var(--page);
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100dvh;
            overflow: hidden;
        }

        body.show-results {
            height: auto;
            min-height: 100dvh;
            overflow-y: auto;
        }

        button,
        input,
        a {
            font: inherit;
        }

        :focus-visible {
            outline: 3px solid #18a999;
            outline-offset: 3px;
        }

        .screen-container {
            width: min(1280px, 100vw);
            height: min(720px, 100dvh);
            background-color: var(--surface);
            display: flex;
            flex-direction: column;
            position: relative;
            border: 1px solid var(--line);
            box-shadow: 0 18px 48px rgba(25, 50, 74, 0.18);
            flex-shrink: 0;
            overflow: hidden;
        }

        body.show-results .screen-container {
            width: min(1280px, 100%);
            height: auto;
            min-height: min(720px, 100dvh);
            overflow: visible;
        }

        /* Single-color app bar keeps the shell visually independent. */
        .header {
            background: var(--ink);
            color: var(--surface);
            height: 60px;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 22px;
            font-weight: bold;
            position: relative;
            box-shadow: 0 2px 8px rgba(16, 38, 59, 0.22);
            z-index: 10;
        }

        .volume-btn {
            position: absolute;
            right: 20px;
            background: var(--teal);
            border: 1px solid var(--teal-strong);
            color: var(--surface);
            padding: 6px 16px;
            font-size: 14px;
            font-weight: bold;
            border-radius: 5px;
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
        }

        .finish-test-btn {
            position: absolute;
            left: 20px;
            padding: 7px 12px;
            border: 1px solid rgba(255, 255, 255, 0.65);
            border-radius: 5px;
            background: transparent;
            color: var(--surface);
            cursor: pointer;
            font-size: 14px;
            font-weight: 700;
        }

        .finish-test-btn:hover:not(:disabled) {
            background: rgba(255, 255, 255, 0.16);
        }

        .finish-test-btn:disabled {
            cursor: wait;
            opacity: 0.7;
        }

        .volume-control {
            position: absolute;
            top: 52px;
            right: 20px;
            width: 240px;
            padding: 12px;
            background: var(--surface);
            border: 1px solid var(--teal);
            border-radius: 6px;
            box-shadow: 0 8px 18px rgba(16, 38, 59, 0.2);
            color: var(--text);
            font-size: 13px;
            font-weight: normal;
            z-index: 20;
        }

        .volume-control[hidden] {
            display: none;
        }

        .volume-control label {
            display: grid;
            grid-template-columns: 52px minmax(0, 1fr) 38px;
            align-items: center;
            gap: 8px;
        }

        .volume-control input {
            width: 100%;
            min-width: 0;
            accent-color: var(--teal);
        }

        .volume-value {
            min-width: 34px;
            text-align: right;
            font-variant-numeric: tabular-nums;
        }

        .recording-status {
            position: absolute;
            bottom: 36px;
            left: 28px;
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--muted);
            font-size: 14px;
            font-weight: 600;
        }

        .recording-status[hidden] {
            display: none;
        }

        .recording-status[data-state="recording"] {
            color: var(--danger);
        }

        .recording-status[data-state="recording"]::before {
            content: '';
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: currentColor;
            animation: recording-pulse 1s ease-in-out infinite;
        }

        .recording-status[data-state="error"] {
            color: var(--danger);
        }

        .ambient-status {
            position: absolute;
            right: 28px;
            bottom: 36px;
            z-index: 1;
            max-width: 300px;
            color: var(--danger);
            font-size: 13px;
            text-align: right;
        }

        .ambient-status[hidden] {
            display: none;
        }

        @keyframes recording-pulse {
            50% {
                opacity: 0.35;
            }
        }

        .recording-results {
            width: 100%;
            margin: 20px auto 0;
            padding: 18px 20px;
            border: 1px solid var(--line);
            border-radius: 8px;
            background: var(--surface-muted);
            text-align: left;
        }

        .recording-list {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            grid-auto-flow: row;
            gap: 8px 14px;
        }

        .recording-row {
            display: grid;
            grid-template-columns: 88px minmax(0, 1fr) 104px;
            align-items: center;
            gap: 8px;
            min-height: 70px;
            padding: 8px;
            border: 1px solid var(--line);
            border-radius: 6px;
            background: var(--surface);
            font-size: 14px;
        }

        .recording-row audio {
            width: 100%;
            height: 32px;
        }

        .end-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
            max-width: 1040px;
            margin: auto;
        }

        .end-content h1 {
            color: var(--ink-strong);
            font-size: 30px;
            line-height: 1.2;
            text-align: center;
        }

        .result-status {
            margin-top: 8px;
            color: var(--muted);
            font-size: 14px;
            text-align: center;
        }

        .result-status:empty {
            display: none;
        }

        .result-status[data-state="error"] {
            color: var(--danger);
        }

        .result-expiry-notice {
            margin-top: 10px;
            padding: 9px 12px;
            border: 1px solid var(--line);
            border-radius: 6px;
            background: var(--surface-muted);
            color: var(--muted);
            font-size: 13px;
            line-height: 1.45;
            text-align: center;
        }

        .recording-actions {
            display: grid;
            gap: 5px;
        }

        .retry-recording {
            width: 100%;
            min-height: 27px;
            padding: 5px 7px;
            border: 1px solid var(--teal);
            border-radius: 4px;
            font-size: 12px;
            line-height: 1.2;
        }

        .model-answer-result-button,
        .model-answer-question-button {
            border: 1px solid var(--teal);
            border-radius: 5px;
            background: var(--surface);
            color: var(--teal-strong);
            font: inherit;
            font-weight: 600;
            cursor: pointer;
        }

        .model-answer-result-button {
            width: 100%;
            min-height: 30px;
            padding: 5px 7px;
            font-size: 12px;
        }

        .model-answer-question-button {
            position: absolute;
            z-index: 2;
            left: 22px;
            bottom: 18px;
            padding: 9px 12px;
            font-size: 13px;
        }

        .model-answer-result-button:hover,
        .model-answer-question-button:hover {
            background: var(--teal-soft);
        }

        .retry-recording {
            background: var(--surface);
            color: var(--teal-strong);
            cursor: pointer;
            font-weight: 700;
        }

        .retry-recording:hover {
            background: var(--teal-soft);
        }

        .recording-unavailable {
            color: var(--muted);
            font-size: 13px;
        }

        .empty-recordings {
            color: var(--muted);
            font-size: 15px;
        }

        .volume-icon {
            width: 16px;
            height: 16px;
            fill: currentColor;
            font-size: 16px;
        }

        .content-area {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 60px 80px 140px 80px;
            position: relative;
        }

        .content-area[hidden] {
            display: none;
        }

        .content-area.exam-picker-area {
            padding: 24px 40px;
            background: var(--surface);
        }

        .exam-picker {
            width: min(840px, 100%);
            color: var(--text);
            text-align: center;
        }

        .brand-logo {
            display: block;
            position: relative;
            width: min(380px, 100%);
            aspect-ratio: 4.2;
            overflow: hidden;
            margin: 0 auto 16px;
        }

        .brand-logo img {
            display: block;
            position: absolute;
            top: 50%;
            left: 0;
            width: 100%;
            height: auto;
            transform: translateY(-50%);
        }

        .exam-picker h1 {
            color: var(--ink);
            font-size: 30px;
            margin-bottom: 8px;
        }

        .exam-picker-description {
            color: var(--muted);
            margin-bottom: 30px;
        }

        .exam-picker-footer {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .exam-legal-notice {
            position: absolute;
            right: 24px;
            bottom: 12px;
            left: 24px;
            color: var(--muted);
            font-size: 11px;
            line-height: 1.4;
            text-align: center;
        }

        .exam-legal-notice p {
            margin: 0;
        }

        .exam-list-card {
            width: 100%;
            max-width: 840px;
            margin: 0 auto;
            padding: 12px;
            border: 1px solid var(--line);
            border-radius: 10px;
            background: #f8fbfb;
            box-sizing: border-box;
        }

        .exam-options {
            display: grid;
            grid-template-columns: repeat(5, minmax(0, 1fr));
            gap: 12px;
            max-height: 128px;
            overflow-y: auto;
            overscroll-behavior: contain;
            scrollbar-gutter: stable;
            padding-right: 3px;
        }

        .exam-option {
            position: relative;
            width: 100%;
            min-width: 0;
            min-height: 58px;
            padding: 10px;
            text-align: center;
            border: 1px solid var(--line);
            border-radius: 5px;
            background: var(--surface);
            color: var(--ink);
            cursor: pointer;
            transition: border-color .15s ease, background-color .15s ease;
        }

        .exam-option:hover:not(:disabled) {
            border-color: var(--teal);
            background: var(--teal-soft);
        }

        .exam-option[aria-pressed="true"] {
            border-color: var(--teal);
            background: var(--teal);
            color: var(--surface);
        }

        .exam-option[aria-pressed="true"]::after {
            content: '✓';
            position: absolute;
            right: 9px;
            top: 5px;
            color: var(--surface);
            font-size: 14px;
        }

        .exam-option:disabled {
            cursor: wait;
            opacity: .65;
        }

        .exam-option.is-completed:disabled {
            cursor: not-allowed;
            background: #edf1f2;
            color: var(--muted);
        }

        .exam-option strong {
            display: block;
            font-size: 17px;
        }

        .exam-option .exam-completed-label {
            display: block;
            margin-top: 2px;
            font-size: 11px;
            font-weight: 700;
        }

        .exam-picker-footer {
            margin-top: 20px;
        }

        .exam-picker-status {
            min-height: 20px;
            color: var(--muted);
            font-size: 14px;
        }

        .exam-picker-status[data-state="error"] {
            color: var(--danger);
        }

        .exam-picker-status[data-state="ready"] {
            color: var(--success);
        }

        .exam-picker-actions {
            display: flex;
            justify-content: center;
            gap: 10px;
            width: 100%;
        }

        .change-test-btn {
            padding: 8px 12px;
            border: 1px solid var(--line);
            border-radius: 7px;
            background: var(--surface);
            color: var(--ink);
            cursor: pointer;
        }

        .exam-continue-btn {
            min-width: 190px;
            padding: 12px 22px;
            border: 0;
            border-radius: 8px;
            background: var(--teal);
            color: white;
            font-weight: 700;
            cursor: pointer;
        }

        .exam-continue-btn:disabled {
            background: #95a6b5;
            cursor: default;
        }

        .today-results-btn {
            min-width: 170px;
            padding: 11px 18px;
            border: 1px solid var(--teal);
            border-radius: 8px;
            background: var(--surface);
            color: var(--teal-strong);
            font-weight: 700;
            cursor: pointer;
        }

        .today-results-btn:hover {
            background: var(--teal-soft);
        }

        .today-results-card {
            width: min(560px, 100%);
        }

        .today-results-list {
            display: grid;
            gap: 10px;
            max-height: 48dvh;
            overflow-y: auto;
        }

        .today-result-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 12px;
            border: 1px solid var(--line);
            border-radius: 8px;
        }

        .today-result-row strong,
        .today-result-row span {
            display: block;
        }

        .today-result-row span {
            margin-top: 3px;
            color: var(--muted);
            font-size: 13px;
        }

        .today-result-row button {
            flex: none;
            padding: 8px 12px;
            border: 1px solid var(--teal);
            border-radius: 6px;
            background: var(--surface);
            color: var(--teal-strong);
            cursor: pointer;
        }

        .today-result-row button:hover {
            background: var(--teal-soft);
        }

        .today-results-status {
            min-height: 20px;
            margin-top: 12px;
            color: var(--danger);
            font-size: 13px;
        }

        .change-test-btn {
            margin-top: 18px;
        }

        .content-area.end-content-area {
            display: block;
            min-height: 0;
            padding: 36px 32px 48px;
            overflow: visible;
        }

        /* Question content is rendered in its own document so that a part's
           layout cannot resize or override the shared header, timer, and
           recording-status area. */
        .content-area.question-content-area {
            padding: 0;
            overflow: hidden;
            isolation: isolate;
        }

        .question-content-frame {
            position: absolute;
            inset: 0;
            z-index: 0;
            display: block;
            width: 100%;
            height: 100%;
            border: 0;
            background: #fff;
        }

        .question-content-area .timer-container,
        .question-content-area .recording-status {
            z-index: 1;
        }

        /* Timer Box */
        .timer-container {
            position: absolute;
            bottom: clamp(20px, 4.5dvh, 40px);
            left: 50%;
            transform: translateX(-50%);
            width: 260px;
            border: 2px solid var(--ink);
            border-radius: 6px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .timer-header {
            background-color: var(--ink);
            color: var(--surface);
            font-size: 14px;
            font-weight: bold;
            padding: 8px 0;
            text-align: center;
            text-transform: uppercase;
        }

        .timer-time {
            background-color: var(--surface-muted);
            color: var(--ink-strong);
            font-size: 24px;
            font-weight: bold;
            padding: 10px 0;
            text-align: center;
            letter-spacing: 2px;
        }

        /* Specific Part Styles */
        .passage {
            font-size: 24px;
            line-height: 1.8;
            color: #000;
            width: 100%;
            margin-top: 40px;
        }

        .image-container {
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            max-height: 450px;
            margin-top: 20px;
        }

        /* Part 2 uses the same flexible content slot as the other parts.
           Keeping the image in this wrapper prevents it from changing the
           shared header, timer, or recording-status layout. */
        .part2-content {
            flex: 1;
            display: flex;
            width: 100%;
            min-height: 0;
        }

        .image-container img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            border: 1px solid #ddd;
        }

        .scenario {
            font-size: 22px;
            margin-bottom: 40px;
            color: #333;
            width: 100%;
            margin-top: -60px;
            text-align: center;
        }

        .question-text {
            font-size: 24px;
            margin-bottom: 25px;
            width: 100%;
            font-weight: bold;
            text-align: center;
        }

        .part4-container {
            display: flex;
            flex-direction: column;
            width: 100%;
            height: 100%;
            margin-top: -40px;
        }

        .info-table-container {
            flex: 1;
            margin-bottom: 30px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .info-table-container p {
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 20px;
            text-align: center;
        }

        table {
            border-collapse: collapse;
            font-size: 18px;
            width: 90%;
        }

        th,
        td {
            border: 1px solid #000;
            padding: 10px 15px;
            text-align: left;
        }

        th {
            background-color: #e6e6e6;
            font-weight: bold;
            text-align: center;
        }

        .opinion-prompt {
            font-size: 26px;
            line-height: 1.6;
            text-align: center;
            font-weight: bold;
            width: 90%;
        }

        .directions-title {
            font-size: 28px;
            font-weight: bold;
            margin-bottom: 40px;
            text-align: center;
            color: var(--ink-strong);
        }

        .directions-text {
            font-size: 24px;
            line-height: 1.6;
            text-align: left;
            max-width: 960px;
            margin: 0 auto;
            color: var(--text);
        }

        /* Stop Talking Modal */
        #stop-talking-modal {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 500px;
            background: var(--warning-soft);
            border: 3px solid var(--warning);
            display: none;
            flex-direction: column;
            z-index: 100;
            border-radius: 10px;
            box-shadow: 0 18px 42px rgba(16, 38, 59, 0.26);
            text-align: center;
        }

        #stop-talking-header {
            background: var(--warning);
            color: var(--surface);
            padding: 10px;
            font-size: 20px;
            font-weight: normal;
        }

        #stop-talking-body {
            padding: 30px 20px;
            font-size: 16px;
            color: var(--text);
            line-height: 1.6;
            font-weight: bold;
        }

        /* Skip Button */
        #skip-btn {
            position: absolute;
            bottom: 20px;
            right: 20px;
            background: var(--warning);
            color: var(--surface);
            border: none;
            padding: 10px 20px;
            font-size: 16px;
            font-weight: bold;
            border-radius: 5px;
            cursor: pointer;
            box-shadow: 0 5px 12px rgba(16, 38, 59, 0.22);
            z-index: 30;
            display: none;
        }

        #skip-btn:hover {
            background: #8d4d08;
        }

        #start-test-btn {
            min-width: 220px;
            padding: 15px 32px;
            font-size: 22px;
            font-weight: 700;
            background: var(--teal);
            color: var(--surface);
            border: none;
            border-radius: 8px;
            cursor: pointer;
        }

        #start-test-btn:hover {
            background: var(--teal-strong);
        }

        #start-test-btn:disabled {
            background: #95a6b5;
            cursor: not-allowed;
        }

        .audio-setup {
            width: min(540px, 100%);
            text-align: center;
        }

        .audio-setup h1 {
            margin-bottom: 10px;
            color: var(--ink);
            font-size: 30px;
        }

        .audio-setup-description {
            margin-bottom: 26px;
            color: var(--muted);
            font-size: 16px;
            line-height: 1.5;
        }

        .audio-test-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
        }

        .audio-test-button {
            min-height: 92px;
            padding: 16px;
            border: 2px solid var(--teal);
            border-radius: 9px;
            background: var(--surface);
            color: var(--teal-strong);
            cursor: pointer;
            font-size: 18px;
            font-weight: bold;
        }

        .audio-test-button:hover:not(:disabled) {
            background: var(--teal-soft);
        }

        .audio-test-button.is-complete {
            border-color: var(--success);
            background: var(--success-soft);
            color: var(--success);
        }

        .audio-test-button:disabled {
            cursor: wait;
            opacity: 0.7;
        }

        .setup-status {
            height: 42px;
            margin-top: 16px;
            color: var(--muted);
            font-size: 14px;
            line-height: 1.4;
            text-align: center;
        }

        .setup-status[data-state="ready"] {
            color: var(--success);
        }

        .setup-status[data-state="error"] {
            color: var(--danger);
        }

        .advanced-settings-button {
            width: 40px;
            height: 40px;
            padding: 8px;
            border: 1px solid var(--line);
            border-radius: 8px;
            background: var(--surface);
            color: var(--ink);
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .advanced-settings-button:hover,
        .advanced-settings-button:focus-visible {
            border-color: var(--teal-strong);
            background: #edf7f5;
        }

        .advanced-settings-button svg {
            width: 22px;
            height: 22px;
            flex: none;
        }

        .header>.advanced-settings-button {
            position: absolute;
            right: 146px;
            width: 34px;
            height: 34px;
            padding: 5px;
            border-color: rgba(255, 255, 255, 0.5);
            background: transparent;
            color: var(--surface);
        }

        .header>.advanced-settings-button:hover,
        .header>.advanced-settings-button:focus-visible {
            background: rgba(255, 255, 255, 0.16);
        }

        .advanced-setting {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px;
            border: 1px solid var(--line);
            border-radius: 7px;
            background: var(--surface-muted);
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
        }

        .advanced-setting+.advanced-setting {
            margin-top: 10px;
        }

        .advanced-setting input {
            width: 16px;
            height: 16px;
            margin: 0;
            accent-color: var(--teal);
        }

        .advanced-setting-help {
            margin: 7px 0 12px 26px;
            color: var(--muted);
            font-size: 13px;
            line-height: 1.4;
        }

        .advanced-settings-card {
            width: min(430px, 100%);
        }

        .advanced-settings-card>p {
            margin-bottom: 18px;
        }

        .microphone-test-controls {
            margin-top: 18px;
            padding: 16px;
            border: 1px solid var(--line);
            border-radius: 8px;
            background: var(--surface-muted);
        }

        .microphone-test-actions {
            display: flex;
            gap: 10px;
        }

        .microphone-record-button {
            flex: 1;
            padding: 11px 14px;
            border: 0;
            border-radius: 6px;
            background: var(--teal);
            color: var(--surface);
            cursor: pointer;
            font-size: 15px;
            font-weight: bold;
        }

        .microphone-record-button:hover:not(:disabled) {
            background: var(--teal-strong);
        }

        .microphone-record-button.end {
            background: var(--danger);
        }

        .microphone-record-button:disabled {
            cursor: not-allowed;
            opacity: 0.55;
        }

        .audio-test-modal {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(16, 38, 59, 0.46);
            z-index: 200;
        }

        .audio-test-modal[hidden] {
            display: none;
        }

        .audio-test-modal-card {
            position: relative;
            width: min(390px, 100%);
            max-height: calc(100dvh - 48px);
            padding: 28px;
            overflow-y: auto;
            border: 1px solid var(--line);
            border-radius: 12px;
            background: var(--surface);
            box-shadow: 0 20px 48px rgba(16, 38, 59, 0.3);
        }

        .audio-test-modal-card h2 {
            margin-bottom: 10px;
            color: var(--ink);
            font-size: 24px;
        }

        .audio-test-modal-card p {
            margin-bottom: 20px;
            color: var(--muted);
            font-size: 15px;
            line-height: 1.45;
        }

        .modal-close-button {
            position: absolute;
            top: 10px;
            right: 12px;
            width: 30px;
            height: 30px;
            border: 0;
            border-radius: 4px;
            background: transparent;
            color: var(--muted);
            cursor: pointer;
            font-size: 24px;
            line-height: 1;
        }

        .modal-close-button:hover {
            background: var(--teal-soft);
        }

        .modal-volume-control {
            display: grid;
            grid-template-columns: 58px minmax(0, 1fr) 40px;
            align-items: center;
            gap: 10px;
            margin-bottom: 20px;
            color: var(--text);
            font-size: 15px;
            font-weight: 600;
        }

        .modal-volume-control input {
            width: 100%;
            min-width: 0;
            accent-color: var(--teal);
        }

        .modal-primary-button {
            width: 100%;
            padding: 12px 16px;
            border: 0;
            border-radius: 6px;
            background: var(--teal);
            color: var(--surface);
            cursor: pointer;
            font-size: 16px;
            font-weight: bold;
        }

        .modal-primary-button:hover:not(:disabled) {
            background: var(--teal-strong);
        }

        .modal-primary-button.recording {
            background: var(--danger);
        }

        .modal-primary-button:disabled {
            cursor: not-allowed;
            opacity: 0.6;
        }

        .modal-status {
            height: 40px;
            margin-top: 14px;
            color: var(--muted);
            font-size: 14px;
            line-height: 1.4;
        }

        .modal-status[data-state="ready"] {
            color: var(--success);
        }

        .modal-status[data-state="error"] {
            color: var(--danger);
        }

        .modal-test-passage {
            margin-bottom: 18px;
            padding: 13px 15px;
            border-left: 4px solid var(--teal);
            background: var(--teal-soft);
            color: var(--text);
            font-size: 15px;
            line-height: 1.55;
        }

        .modal-test-passage strong {
            display: block;
            margin-bottom: 5px;
            color: var(--teal-strong);
        }

        .setup-control {
            display: grid;
            grid-template-columns: 115px minmax(0, 1fr) 42px;
            align-items: center;
            gap: 12px;
            margin-bottom: 24px;
            font-size: 16px;
            font-weight: 600;
        }

        .setup-control input {
            width: 100%;
            min-width: 0;
        }

        .setup-microphone {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 16px;
            border: 1px solid var(--line);
            border-radius: 7px;
        }

        #enable-microphone-btn {
            flex-shrink: 0;
            padding: 9px 13px;
            border: 0;
            border-radius: 5px;
            background: var(--teal);
            color: var(--surface);
            cursor: pointer;
            font-size: 14px;
            font-weight: bold;
        }

        #enable-microphone-btn:hover:not(:disabled) {
            background: var(--teal-strong);
        }

        #enable-microphone-btn:disabled {
            cursor: wait;
            opacity: 0.7;
        }

        .setup-mic-label {
            font-size: 16px;
            font-weight: 600;
        }

        .setup-mic-status {
            margin-top: 4px;
            color: var(--muted);
            font-size: 14px;
            line-height: 1.35;
        }

        .setup-speaker {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 18px;
            padding: 16px;
            border: 1px solid var(--line);
            border-radius: 7px;
        }

        .setup-device-label {
            font-size: 16px;
            font-weight: 600;
        }

        .setup-device-help {
            margin-top: 4px;
            color: var(--muted);
            font-size: 14px;
        }

        .setup-test-btn {
            flex-shrink: 0;
            padding: 9px 13px;
            border: 1px solid var(--teal);
            border-radius: 5px;
            background: var(--surface);
            color: var(--teal-strong);
            cursor: pointer;
            font-size: 14px;
            font-weight: bold;
        }

        .setup-test-btn:hover:not(:disabled) {
            background: var(--teal-soft);
        }

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

        #microphone-test-playback {
            width: 100%;
            margin-top: 14px;
        }

        #microphone-test-playback.is-placeholder {
            visibility: hidden;
            pointer-events: none;
        }

        .microphone-test-passage {
            margin-top: 14px;
            padding: 14px 16px;
            border-left: 4px solid var(--teal);
            background: var(--teal-soft);
            color: var(--text);
            font-size: 16px;
            line-height: 1.55;
        }

        .microphone-test-passage strong {
            display: block;
            margin-bottom: 5px;
            color: var(--teal-strong);
        }

        .setup-mic-status[data-state="ready"] {
            color: var(--success);
        }

        .setup-mic-status[data-state="error"] {
            color: var(--danger);
        }

        .setup-actions {
            display: flex;
            justify-content: center;
            margin-top: 30px;
        }

        .content-area.setup-content-area {
            padding-bottom: 60px;
        }

        @media (max-width: 900px) {
            body {
                height: 100dvh;
                overflow: hidden;
            }

            .screen-container {
                width: 100%;
                height: 100dvh;
                border: 0;
                box-shadow: none;
            }

            .audio-test-modal {
                position: fixed;
            }

            .header {
                flex-shrink: 0;
                padding: 0 174px 0 12px;
                font-size: 16px;
                text-align: left;
            }

            .volume-btn {
                right: 10px;
                padding: 7px 10px;
            }

            .finish-test-btn {
                left: 10px;
            }

            .header>.advanced-settings-button {
                right: 128px;
            }

            .volume-control {
                right: 10px;
            }

            .content-area {
                padding: 40px 24px 140px;
            }

            .content-area.question-content-area {
                min-height: 0;
            }

            .content-area.end-content-area {
                padding: 28px 16px 40px;
            }

            .recording-results {
                padding: 16px;
            }

            .recording-list {
                grid-template-columns: 1fr;
            }

            .content-area.setup-content-area {
                padding: 36px 24px 56px;
            }

            .content-area.exam-picker-area {
                padding: 18px;
            }

            .exam-options {
                grid-template-columns: repeat(3, minmax(0, 1fr));
                max-height: 244px;
            }

            .exam-option {
                min-height: 52px;
                padding: 8px 10px;
            }

            .exam-option strong {
                font-size: 15px;
            }

            .exam-picker h1 {
                font-size: 25px;
            }

            .exam-picker-description {
                margin-bottom: 14px;
            }

            .brand-logo {
                width: min(300px, 70%);
                margin-bottom: 8px;
            }

            .audio-setup h1 {
                font-size: 26px;
            }

            .audio-test-button {
                min-height: 80px;
                padding: 12px;
                font-size: 15px;
            }

            #start-test-btn {
                font-size: 20px;
            }

            #stop-talking-modal {
                width: min(500px, calc(100% - 24px));
            }

            #skip-btn {
                bottom: 12px;
                right: 12px;
            }
        }

        @media (max-width: 600px) {
            .exam-options {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 8px;
                max-height: min(348px, 46vh);
            }

            .exam-list-card {
                padding: 8px;
            }

            .exam-picker-footer {
                margin-top: 10px;
            }

            .exam-picker-actions>button {
                flex: 1;
                min-width: 0;
                padding-left: 6px;
                padding-right: 6px;
                font-size: 13px;
            }

            .header.has-finish {
                height: 96px;
                padding: 0 12px 12px;
                align-items: flex-end;
            }

            .header.has-finish .finish-test-btn,
            .header.has-finish .volume-btn,
            .header.has-finish>.advanced-settings-button {
                top: 10px;
            }

            .header.has-finish .volume-control {
                top: 48px;
            }

        }

        @media (max-width: 900px) and (max-height: 680px) {
            .content-area.exam-picker-area {
                padding: 8px 14px;
            }

            .exam-picker h1 {
                font-size: 21px;
                margin-bottom: 3px;
            }

            .brand-logo {
                width: 160px;
                margin-bottom: 2px;
            }

            .exam-picker-description {
                font-size: 13px;
                line-height: 1.25;
                margin-bottom: 8px;
            }

            .exam-options {
                gap: 6px;
                max-height: min(164px, 36vh);
            }

            .exam-list-card {
                padding: 6px;
            }

            .exam-option {
                min-height: 36px;
                padding: 4px 8px;
            }

            .exam-picker-footer {
                margin-top: 7px;
            }

            .exam-continue-btn {
                padding: 8px 12px;
            }

            .exam-legal-notice {
                bottom: 5px;
                line-height: 1.2;
            }
        }

        @media (max-width: 900px) and (max-height: 500px) {
            .exam-picker-description {
                display: none;
            }
        }
