@import url("../../css/platform-type.css");
/* ====================================================== */
/*                  1. ROOT & GLOBAL STYLES               */
/* ====================================================== */
:root {
  --primary-color: hsl(215, 50%, 47%);
  --primary-hover: hsl(215, 41%, 36%);
  --primary-light: hsl(215, 50%, 95%);
  --text-dark: #1f2937;
  --text-light: #4b5563;
  --bg-main: #f8fafc;
  --bg-panel: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: var(--primary-color);
  --success-color: #16a34a;
  --error-color: #dc2626;
  --answered-color: hsl(170, 45%, 45%);

  --body-font: var(--platform-font-body, "Plus Jakarta Sans"), system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --panel-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;

  /* Inspera-style interface tokens */
  --app--background: #f2f2f2;
  --app--foreground: #000000;
  --app--font-color: #000000;
  --app--label-color: #595959;
  --app--divider-bg: rgba(0, 0, 0, 0.5);
  --app--divider-bar-bg: rgba(0, 0, 0, 0.1);
  --header--height: 3.5em;
  --header--background: #ffffff;
  --header-footer--box-shadow: 0 0 45px rgba(0,0,0,0.15);
  --header--icon-color: #333333;
  --header-border-color: #c1c1c1;
  --rubric-block--background: #ffffff;
  --instruction-band-bg: #f4f5ef;
  --question--dynamic-rubric-block-border: 1px #d5d5d5 solid;
  --question--input-border: #949494;
  --question--input-border-focus: #4B90C5;
  --question--label-background-hover: #e4e4e4;
  --question--interaction-checked-bg: #bbd8f0;
  --question--interaction-checked-color: #000000;
  --main-button-color: #ffffff;
  --main-button-bg-color: #2a6c96;
  --main-button-bg-hover: #19445f;
  --footer--background: #ffffff;
  --footer--color: #535353;
  --footer--selected-bg: #aed7ff;
  --footer--selected-question-no-bg: #2a6c96;
  --footer--selected-question-color: #ffffff;
  --footer--subquestion-active-bg: #2a6c96;
  --footer--subquestion-attempted-bg: #2a6c96;
  --footer--question-background: #efefef;
  --footer--selected-border: #c1c1c1;
  --footer--progress-bar-background: #f2f2f2;
  --footer--progress-bar-fill-color: #2a6c96;
  --secondary-button-bg-color: #4c4c4c;
  --default-gray-border: #595959;
  --resize-btn-bg: #f9f9f9;
  --resize-btn-color: #535353;
  --resize-btn-bg-hover: #e1e1e1;
}

body.theme-dark {
  --primary-color: hsl(210, 68%, 62%);
  --primary-hover: hsl(210, 62%, 52%);
  --primary-light: #1f344d;
  --text-dark: #f3f4f6;
  --text-light: #cbd5e1;
  --bg-main: #111827;
  --bg-panel: #1f2937;
  --border-color: #374151;
  --border-focus: hsl(210, 68%, 62%);
  --panel-shadow: 0 4px 10px rgba(0, 0, 0, 0.32);
  --app--background: #111827;
  --app--foreground: #f3f4f6;
  --app--font-color: #f3f4f6;
  --app--label-color: #cbd5e1;
  --header--background: #1f2937;
  --header-border-color: #374151;
  --rubric-block--background: #1f2937;
  --instruction-band-bg: #f4f5ef;
  --question--dynamic-rubric-block-border: 1px #374151 solid;
  --question--label-background-hover: #263548;
  --question--interaction-checked-bg: #244b68;
  --question--interaction-checked-color: #f3f4f6;
  --footer--background: #1f2937;
  --footer--color: #cbd5e1;
  --footer--question-background: #263548;
  --footer--progress-bar-background: #334155;
  --footer--progress-bar-fill-color: #60a5fa;
  --default-gray-border: #94a3b8;
  --resize-btn-bg: #263548;
  --resize-btn-color: #f3f4f6;
  --resize-btn-bg-hover: #334155;
}

body.theme-yellow-black {
  --primary-color: #ffd400;
  --primary-hover: #ffe766;
  --primary-light: #1f1f00;
  --text-dark: #fff36b;
  --text-light: #f6e86a;
  --bg-main: #000000;
  --bg-panel: #000000;
  --border-color: #f3d94e;
  --border-focus: #ffd400;
  --panel-shadow: none;
  --app--background: #000000;
  --app--foreground: #fff36b;
  --app--font-color: #fff36b;
  --app--label-color: #f6e86a;
  --header--background: #000000;
  --header-border-color: #f3d94e;
  --rubric-block--background: #000000;
  --question--dynamic-rubric-block-border: 1px #f3d94e solid;
  --question--label-background-hover: #1f1f00;
  --question--interaction-checked-bg: #332b00;
  --question--interaction-checked-color: #fff36b;
  --footer--background: #000000;
  --footer--color: #fff36b;
  --footer--question-background: #000000;
  --footer--selected-border: #f3d94e;
  --footer--progress-bar-background: #3a3200;
  --footer--progress-bar-fill-color: #ffd400;
  --default-gray-border: #f3d94e;
  --resize-btn-bg: #000000;
  --resize-btn-color: #fff36b;
  --resize-btn-bg-hover: #1f1f00;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--body-font);
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.8;
}

#app {
  transition: font-size 0.2s ease-in-out;
  padding-bottom: 80px; /* Make space for the bottom bar */
}
body.writing-active #app {
  padding-bottom: 0;
}

.hidden {
  display: none !important;
}

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

h1, h2, h3 { color: var(--text-dark); }
h1 { margin-bottom: 1rem; font-weight: 700; }
h2 { margin-bottom: 1.5rem; font-weight: 600; }
h3 { margin-bottom: 1rem; font-weight: 500; }

/* ====================================================== */
/*                2. FONT SIZE UTILITIES                  */
/* ====================================================== */
.font-size-small   { font-size: 0.875rem; }
.font-size-medium  { font-size: 1rem; }
.font-size-large   { font-size: 1.125rem; }
.font-size-xlarge  { font-size: 1.25rem; }

/* ====================================================== */
/*              3. BOTTOM CONTROL BAR (FOOTER)            */
/* ====================================================== */
#bottomControlBar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background-color: var(--bg-panel);
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.06), 0 -1px 2px rgba(0, 0, 0, 0.1);
  border-top: 1px solid var(--border-color);
  gap: 1rem;
  height: 68px;
}

.bottom-bar-section { display: flex; align-items: center; gap: 0.75rem; }
.bar-section-nav { flex-grow: 1; justify-content: center; }
.bar-section-info { min-width: 250px; }
.bar-section-tools { min-width: 150px; justify-content: flex-end; }
.bar-section-tools:empty { display: none; }

.bottom-bar-btn {
  background-color: transparent; border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem; border-radius: var(--border-radius);
  cursor: pointer; font-family: var(--body-font); font-weight: 500;
  transition: background-color 0.2s, color 0.2s; color: var(--text-light);
}
.bottom-bar-btn:hover { background-color: var(--bg-main); color: var(--primary-color); }
.bottom-bar-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.timer-display { font-weight: 600; background-color: var(--bg-main); padding: 0.5rem 0.75rem; border-radius: var(--border-radius); font-variant-numeric: tabular-nums; color: var(--text-dark); }
.timer-display.final-warning,
.listening-time.final-warning {
  color: var(--error-color);
}
.user-info-display { font-size: 0.8rem; color: var(--text-light); }

/* --- New Hierarchical Nav --- */
#navigationContainer { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.passage-nav-btn {
    border: 1px solid var(--border-color); background-color: rgb(119, 138, 149);
    padding: 0.5rem 1rem; border-radius: var(--border-radius);
    font-weight: 600; cursor: pointer; transition: all 0.2s ease;
    flex-shrink: 0;
}
.passage-nav-btn.active {
    background-color: var(--primary-color); color: white; border-color: var(--primary-color);
}
.question-nav-container {
    display: flex; gap: 6px; padding: 2px;
    animation: slideIn 0.4s ease-out;
}
@keyframes slideIn {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.q-nav-item {
    width: 32px; height: 32px; flex-shrink: 0;
    border: 1px solid #94a3b8; border-radius: 4px; background-color: var(--bg-panel);
    color: var(--text-light); cursor: pointer; font-weight: 500;
    transition: all 0.2s; padding: 0;
}
.q-nav-item:hover { border-color: var(--primary-color); background-color: var(--primary-light); }
.q-nav-item.answered { background-color: var(--answered-color); color: white; border-color: var(--answered-color); }
.q-nav-item.current {
    background-color: var(--primary-color); color: white; border-color: var(--primary-color);
    transform: scale(1.1); font-weight: 700; box-shadow: 0 0 8px rgba(0,0,0,0.2);
}

/* ====================================================== */
/*          4. WELCOME, SELECTION & HUB VIEWS             */
/* ====================================================== */
.view-center {
    display: flex; flex-direction: column; justify-content: center;
    align-items: center; min-height: 90vh; text-align: center; padding: 2rem;
}
.welcome-box {
    background-color: var(--bg-panel); padding: 2rem 3rem;
    border-radius: 12px; box-shadow: var(--panel-shadow);
    max-width: 550px; width: 100%;
}
.welcome-logo {
    display: block;
    width: min(180px, 45%);
    height: auto;
    margin: 0.5rem auto 1.25rem;
}
.mock-return-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    margin-bottom: 1rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}
.mock-return-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
}
.welcome-box p { color: var(--text-light); margin-bottom: 1.5rem; }
.welcome-box input, .welcome-box select {
    display: block; width: 100%; padding: 0.75rem;
    margin-bottom: 1rem; border: 1px solid var(--border-color);
    border-radius: var(--border-radius); font-size: 1rem;
}
.welcome-box input:focus, .welcome-box select:focus {
    outline: none; border-color: var(--border-focus);
    box-shadow: 0 0 0 3px hsla(215, 50%, 47%, 0.3);
}
.welcome-box button { margin-top: 1rem; width: 100%; }
#welcomeView,
#testSelectionView {
    background: #f8f3f2;
    color: #231719;
    min-height: 100vh;
    margin-bottom: -80px;
    padding-bottom: calc(2rem + 80px);
}
#welcomeView .welcome-box,
#testSelectionView .welcome-box {
    background: #ffffff;
    border: 1px solid rgba(177, 24, 35, 0.18);
    box-shadow: 0 18px 48px rgba(63, 24, 29, 0.14);
}
#welcomeView .welcome-box h1,
#testSelectionView .welcome-box h2 {
    color: #241719;
}
#welcomeView .welcome-box p,
#testSelectionView .welcome-box p,
#testSelectionView .test-selector-container label {
    color: #6f5558;
}
#welcomeView .welcome-box input,
#welcomeView .welcome-box select,
#testSelectionView .welcome-box select {
    background: #fffafa;
    border-color: #e3d4d5;
    color: #241719;
}
#welcomeView .welcome-box input::placeholder {
    color: #9a8588;
}
#welcomeView .welcome-box input:focus,
#welcomeView .welcome-box select:focus,
#testSelectionView .welcome-box select:focus {
    border-color: #b11823;
    box-shadow: 0 0 0 3px rgba(177, 24, 35, 0.26);
}
#welcomeView .welcome-box button,
#testSelectionView .welcome-box button {
    background: #b11823;
    border-color: #b11823;
    color: #ffffff;
}
#welcomeView .welcome-box button:hover:not(:disabled),
#testSelectionView .welcome-box button:hover:not(:disabled) {
    background: #8f141d;
    border-color: #8f141d;
}
#home,
#adminTestLoaderView,
#adminPlaygroundView,
#reviewView {
    background: #f8f3f2;
    color: #231719;
    min-height: 100vh;
    margin-bottom: -80px;
    padding-bottom: calc(2rem + 80px);
}
#home .welcome-box,
#adminTestLoaderView .setup-container,
#adminPlaygroundView .setup-container,
#reviewView .setup-container {
    background: #ffffff;
    border: 1px solid rgba(177, 24, 35, 0.18);
    box-shadow: 0 18px 48px rgba(63, 24, 29, 0.14);
}
#home .welcome-box h1,
#adminTestLoaderView .setup-container h2,
#adminPlaygroundView .setup-container h2,
#reviewView .setup-container h2,
#reviewView .setup-container h3 {
    color: #241719;
}
#home .welcome-box p,
#adminTestLoaderView .setup-container p,
#adminPlaygroundView .setup-container p,
#reviewView .setup-container p,
#adminTestLoaderView .selector-group label,
#adminPlaygroundView .selector-group label {
    color: #6f5558;
}
#home .admin-stat-card,
#reviewView .review-item {
    background: #fffafa;
    border-color: #e3d4d5;
}
#home .admin-stat-card strong {
    color: #b11823;
}
#adminTestLoaderView .selector-group select,
#adminPlaygroundView .selector-group select {
    background: #fffafa;
    border-color: #e3d4d5;
    color: #241719;
}
#adminTestLoaderView .selector-group select:focus,
#adminPlaygroundView .selector-group select:focus {
    outline: none;
    border-color: #b11823;
    box-shadow: 0 0 0 3px rgba(177, 24, 35, 0.26);
}
#home .admin-buttons button:not(.admin-danger):not(.admin-ghost),
#adminTestLoaderView .submit-btn,
#adminPlaygroundView .submit-btn,
#reviewView .review-item button {
    background: #b11823;
    border-color: #b11823;
    color: #ffffff;
}
#home .admin-buttons button:not(.admin-danger):not(.admin-ghost):hover:not(:disabled),
#adminTestLoaderView .submit-btn:hover:not(:disabled),
#adminPlaygroundView .submit-btn:hover:not(:disabled),
#reviewView .review-item button:hover:not(:disabled) {
    background: #8f141d;
    border-color: #8f141d;
}
#home .admin-buttons .admin-ghost,
#adminTestLoaderView .back-button,
#adminPlaygroundView .back-button,
#reviewView .back-button {
    color: #6f5558;
    border-color: #e3d4d5;
}
#home .admin-buttons .admin-ghost:hover:not(:disabled),
#adminTestLoaderView .back-button:hover,
#adminPlaygroundView .back-button:hover,
#reviewView .back-button:hover {
    color: #241719;
    background: #fffafa;
}
.test-selector-container { text-align: left; }
.test-selector-container label {
    font-weight: 600; font-size: 0.9rem;
    margin-bottom: 0.25rem; display: block;
}
.error-message { color: var(--error-color); margin-top: 0.5rem; }

/* --- Pre-Test Hub --- */
.hub-container {
    background-color: var(--bg-panel); padding: 2rem 3rem;
    border-radius: 12px; box-shadow: var(--panel-shadow);
    max-width: 700px; width: 100%;
}
.hub-buttons {
    display: grid; grid-template-columns: 1fr;
    gap: 1.5rem; margin-top: 2rem;
}
.hub-buttons button {
    padding: 1.25rem; font-size: 1.2rem; font-weight: 600;
}
.hub-skill {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.skill-instructions {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: left;
}
.skill-instructions h3 {
    margin-bottom: 0.75rem;
}
.instruction-video {
    width: 100%;
    border-radius: var(--border-radius);
    background-color: #000000;
}
.instruction-continue-btn {
    margin-top: 0.75rem;
    width: 100%;
}
.hub-buttons button.completed {
    background-color: var(--success-color); border-color: var(--success-color);
    cursor: default;
}
.hub-buttons button:disabled {
    background-color: #e2e8f0; color: #94a3b8;
    border-color: #e2e8f0; cursor: not-allowed;
}

/* Tutorial-styled pre-test hub */
#preTestHubView {
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    min-height: 100vh;
    background: #f5f5f5;
}
.tutorial-shell {
    width: 100%;
    min-height: 100vh;
    background: #f5f5f5;
}
.tutorial-topbar {
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid #d9d9d9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}
.tutorial-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
}
.tutorial-brand-logo {
    display: block;
    width: 150px;
    height: auto;
    max-height: 38px;
    object-fit: contain;
}
.tutorial-candidate-display {
    color: #111827;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}
.brand-red {
    color: #e51c45;
}
.tutorial-main {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 20px 28px;
    text-align: left;
}
.tutorial-main h1 {
    color: #e51c45;
    margin: 4px 0 14px;
    font-weight: 500;
}
.tutorial-day-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}
.tutorial-day-row strong {
    font-size: 2rem;
}
.day-line {
    flex: 1;
    border-bottom: 1px solid #cccccc;
}
.tutorial-cards {
    gap: 12px;
}
.tutorial-card {
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    background: #ffffff;
    padding: 16px 18px;
    gap: 10px;
    position: relative;
}
.tutorial-card h2 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 700;
}
.tutorial-status {
    margin: 0;
    color: #e51c45;
    font-weight: 600;
}
.tutorial-timing {
    margin: 0;
    color: #444;
}
.tutorial-info-row {
    border: 1px solid #cfcfcf;
    border-radius: 3px;
    padding: 10px 12px;
    background: #fafafa;
    color: #454545;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tutorial-info-row span {
    color: #4f8a4f;
    margin-left: 8px;
    font-weight: 600;
}
.tutorial-info-btn {
    width: fit-content;
    margin: 0;
    padding: 0.35rem 0.6rem !important;
    font-size: 0.85rem !important;
    border-radius: 4px;
}
.tutorial-info-row .tutorial-info-label {
    color: #444 !important;
    font-size: 0.9rem;
    margin-left: 0;
    font-weight: 500;
}
.tutorial-info-btn {
    background: #ffffff !important;
    color: #222 !important;
    border: 1px solid #cfcfcf !important;
}
.tutorial-info-btn:hover:not(:disabled) {
    background: #f0f0f0 !important;
    border-color: #bbbbbb !important;
}
.tutorial-info-confirm {
    color: #1f8f3a !important;
    margin-left: 0 !important;
}
.tutorial-confirm-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #cfcfcf;
    background: #ffffff;
    color: #333;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 0.85rem;
}
.tutorial-confirm-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1f8f3a;
    cursor: pointer;
}
.tutorial-start-btn {
    width: fit-content;
    min-width: 240px;
    background: #111111 !important;
    border-color: #111111 !important;
    color: #fff !important;
    padding: 0.6rem 0.85rem !important;
    font-size: 0.95rem !important;
}
.tutorial-start-btn:hover:not(:disabled) {
    background: #000000 !important;
    border-color: #000000 !important;
}
.tutorial-card .skill-instructions {
    margin-top: 10px;
}
.tutorial-card .instruction-continue-btn {
    background: #111111 !important;
    border-color: #111111 !important;
}
.tutorial-card-check {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #1ca33b;
    box-shadow: 0 0 0 4px rgba(28, 163, 59, 0.12);
}
.tutorial-card-check::before {
    content: "";
    position: absolute;
    left: 19px;
    top: 14px;
    width: 21px;
    height: 34px;
    border: solid #ffffff;
    border-width: 0 7px 7px 0;
    transform: rotate(45deg);
}
.tutorial-card.completed-view .tutorial-info-row,
.tutorial-card.completed-view .tutorial-start-btn,
.tutorial-card.completed-view .skill-instructions {
    display: none !important;
}
.tutorial-card.completed-view .tutorial-status {
    color: #1f8f3a;
}
.tutorial-done-panel {
    margin-top: 16px;
    border: 1px solid #b7dfbd;
    border-radius: 4px;
    background: #f0fbf2;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.tutorial-done-panel p {
    margin: 0;
    color: #168030;
    font-size: 1.05rem;
    font-weight: 700;
}
.tutorial-exit-btn {
    background: #0b0b0b !important;
    border-color: #0b0b0b !important;
    color: #ffffff !important;
    padding: 0.5rem 1.1rem !important;
    min-width: 84px;
}
.tutorial-exit-btn:hover:not(:disabled) {
    background: #000000 !important;
    border-color: #000000 !important;
}

/* ====================================================== */
/*               5. GENERAL BUTTONS & INPUTS              */
/* ====================================================== */
button {
  font-family: var(--body-font); font-size: 1rem; padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius); border: 1px solid var(--primary-color);
  background-color: var(--primary-color); color: white; cursor: pointer;
  transition: all 0.2s ease; font-weight: 600;
}
button:hover:not(:disabled) {
  background-color: var(--primary-hover); border-color: var(--primary-hover);
  box-shadow: var(--panel-shadow);
}
button:disabled {
  background-color: var(--text-light); border-color: var(--text-light);
  cursor: not-allowed; opacity: 0.8;
}
.back-button {
  display: block; width: fit-content; background-color: transparent;
  color: var(--text-light); border-color: var(--border-color);
  margin-bottom: 1.5rem; padding: 0.5rem 1rem; font-weight: 500;
}
.back-button:hover { background-color: var(--bg-main); color: var(--text-dark); }

/* ====================================================== */
/*        6. READING & LISTENING TEST VIEW STYLES         */
/* ====================================================== */
.test-view { height: calc(100vh - 62px); background: var(--bg-panel); } /* Adjusted for bottom bar */
#testView,
#listeningView {
    font-family: Arial, Helvetica, sans-serif;
}
.reading-topbar {
    height: 50px;
    background: var(--header--background);
    border-bottom: 1px solid var(--header-border-color);
    padding: 0;
    display: block;
}
.header__topbar___2CQ4O {
    height: 100%;
    display: flex;
    align-items: center;
    background: var(--header--background);
    box-shadow: none;
}
.header__logo___3xoBS {
    height: 100%;
    min-width: 164px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 18px 0 22px;
}
.reading-logo-mark {
    position: relative;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    background: #b00000;
    border: 2px solid #b00000;
}
.reading-logo-mark::before,
.reading-logo-mark::after {
    content: "";
    position: absolute;
}
.reading-logo-mark::before {
    inset: 6px;
    border: 2px solid #ffffff;
}
.reading-logo-mark::after {
    left: 9px;
    bottom: 9px;
    width: 23px;
    height: 2px;
    background: #ffffff;
    transform: rotate(-45deg);
    transform-origin: left center;
}
.reading-logo-text {
    color: #b00000;
    font-size: 1.22rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
}
.header__subToolbar___TmVu0 {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    position: relative;
}
.header__centralBar___3GpJy {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 28px;
    pointer-events: none;
}
.header__connectionAndButtonContainer___1t_Gd {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 16px;
}
.header__connectionStatusContainer___3YItW {
    display: flex;
    align-items: center;
    color: var(--header--icon-color);
    font-size: 1.05rem;
}
.header__statusText___1fRqd {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--app--font-color);
    font-weight: 700;
}
.header__name___1Cw2x {
    color: var(--app--font-color);
}
#readingCandidateDisplay {
    color: var(--app--font-color);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.reading-header-time {
    justify-self: auto;
    font-size: 1.08rem;
}
.reading-header-icon-btn {
    width: 36px;
    height: 30px;
    border: 1px solid var(--footer--selected-border);
    border-radius: 4px;
    background: var(--footer--question-background);
    color: var(--header--icon-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.reading-header-icon-btn span {
    width: 18px;
    height: 2px;
    background: var(--header--icon-color);
    border-radius: 2px;
    display: block;
}
.header__optionsButton___1BF6Z {
    flex-direction: column;
    gap: 3px;
}
.reading-header-submit {
    min-width: 78px;
}

#testView .reading-topbar button,
#bottomControlBar .reading-footer-shell button {
    box-shadow: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

#testView .reading-topbar {
    height: 50px;
    background: var(--header--background);
    border-bottom: 1px solid var(--header-border-color);
}

#testView .header__topbar___2CQ4O {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(360px, 1fr) auto minmax(360px, 1fr);
    align-items: center;
}

#testView .header__logo___3xoBS {
    height: 50px;
    min-width: 0;
    padding: 0 18px 0 22px;
    display: flex;
    align-items: center;
    grid-column: 1;
}

#testView .header__subToolbar___TmVu0 {
    height: 100%;
    min-width: 0;
    display: contents;
}

#testView .header__centralBar___3GpJy {
    min-width: 0;
    width: auto;
    grid-column: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

#testView .header__subHeaderWrapper___3FyBR {
    justify-self: start;
    min-width: 0;
}

#testView .reading-header-time {
    justify-self: center;
    grid-column: 2;
    font-size: 1.38rem;
    font-weight: 700;
    color: var(--app--font-color);
    background: transparent;
    padding: 0;
}

#testView .header__connectionAndButtonContainer___1t_Gd {
    height: 100%;
    display: flex;
    align-items: center;
    grid-column: 3;
    justify-self: end;
    gap: 8px;
    padding: 0 12px 0 10px;
}

#testView .reading-header-icon-btn {
    width: 44px;
    height: 28px;
    padding: 0;
    border: 1px solid #a7b0bd;
    border-radius: 4px;
    background: #eef3f8;
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#testView .reading-header-icon-btn span {
    width: 19px;
    height: 2px;
    background: #111827;
}

#testView .reading-header-submit {
    min-width: 76px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid #a7b0bd;
    border-radius: 4px;
    background: #eef3f8;
    color: var(--app--font-color);
    font-size: 0.92rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

#testView .reading-header-icon-btn:hover,
#testView .reading-header-submit:hover {
    background: var(--resize-btn-bg-hover);
    border-color: var(--footer--selected-border);
}
.reading-instruction-band {
    margin: 18px 22px 12px;
    padding: 14px 20px;
    background: var(--instruction-band-bg);
    border: var(--question--dynamic-rubric-block-border);
    border-radius: 4px;
}
.sectionRubricBlock__sectionRubric {
    outline: none;
}
.reading-instruction-band h2 {
    margin: 0 0 2px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--app--font-color);
}
.reading-instruction-band p {
    margin: 0;
    font-size: 1rem;
    color: var(--app--font-color);
}
.reading-split-content {
    display: flex;
    height: calc(100vh - 50px - 118px - 62px);
    min-height: 320px;
}
.DisplayTypeContainer__displayTypeContainer {
    width: 100%;
}
.StimulusDisplay__sectionStimulusWrapper,
.DisplayTypeContainer__sectionContent {
    min-width: 0;
}
.DisplayTypeContainer__divider {
    touch-action: none;
}
.left-panel, .right-panel { flex: 1 1 50%; overflow-y: auto; padding: 1.5rem 2rem; position: relative; }
.left-panel { background-color: var(--bg-panel); border-right: none; }
.right-panel { background-color: var(--bg-panel); }
.resizer {
    flex: 0 0 18px;
    background: transparent;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--resize-btn-color);
    position: relative;
}
.resizer::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    background: var(--app--divider-bg);
}
.resizer span {
    position: relative;
    z-index: 1;
    width: 38px;
    height: 38px;
    border: 2px solid var(--default-gray-border, #595959);
    background: var(--resize-btn-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
    line-height: 1;
}
.resize-handle-icon::before,
.resize-handle-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 9px;
    height: 9px;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
}
.resize-handle-icon::before {
    left: 9px;
    transform: translateY(-50%) rotate(-45deg);
}
.resize-handle-icon::after {
    right: 9px;
    transform: translateY(-50%) rotate(135deg);
}
.resizer:hover::before { background-color: var(--main-button-bg-color); }
.resizer:hover span { background: var(--resize-btn-bg-hover); }
.passage-panel { padding: 0.5rem; }
.passage-panel > br {
    display: none;
}
.passage-panel p {
    margin: 0 0 1rem;
}
.passage-panel h2,
.passage-panel h3,
.passage-panel h4 {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}
.passage-panel h2:first-child,
.passage-panel h3:first-child,
.passage-panel h4:first-child {
    margin-top: 0;
}
.passage-panel ul,
.passage-panel ol {
    margin: 0.5rem 0 1rem 1.5rem;
}
.passage-panel li {
    margin: 0.25rem 0;
}

.test-view-single {
    max-width: 1200px; margin: 2rem auto; padding: 1.5rem 2rem;
    background-color: var(--bg-panel); border-radius: var(--border-radius);
    box-shadow: var(--panel-shadow); display: flex; flex-direction: column;
}
#listeningView.test-view-single {
    max-width: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--header--background);
    min-height: calc(100vh - 50px);
    overflow: hidden;
}
#listeningView .listening-main-content::before {
    content: "Listen to the audio and answer questions 1-40.";
    white-space: pre-line;
    display: block;
    padding: 14px 20px;
    background: var(--instruction-band-bg);
    border: var(--question--dynamic-rubric-block-border);
    border-radius: 4px;
    color: var(--app--font-color);
    font-size: 1rem;
    line-height: 1.45;
}
#listeningQuestionsContainer h2,
#listeningQuestionsContainer h3,
#listeningQuestionsContainer h4,
#listeningQuestionsContainer h5,
#listeningQuestionsContainer strong,
#listeningQuestionsContainer b {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1em !important;
    line-height: inherit !important;
    font-weight: 700 !important;
}
#listeningQuestionsContainer [style*="font-size"] {
    font-size: 1em !important;
}
.listening-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--header--background);
    border-bottom: 1px solid var(--header-border-color);
    min-height: 50px;
    padding: 7px 16px 7px 22px;
    display: grid;
    grid-template-columns: minmax(360px, 1fr) auto minmax(360px, 1fr);
    align-items: center;
    column-gap: 16px;
}
.listening-topbar-left,
.writing-topbar-left,
.exam-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.listening-logo-mark {
    width: 34px;
    height: 34px;
    display: inline-block;
    background: #c40000;
    border: 2px solid #c40000;
    position: relative;
    flex: 0 0 auto;
}
.listening-logo-mark::before,
.listening-logo-mark::after {
    content: "";
    position: absolute;
    border: 2px solid #ffffff;
}
.listening-logo-mark::before {
    inset: 5px;
}
.listening-logo-mark::after {
    width: 24px;
    transform: rotate(-45deg);
    left: 4px;
    top: 14px;
    border-width: 1px 0 0;
}
.listening-brand,
.exam-brand-text {
    color: #c40000;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
}
.exam-brand-logo {
    display: block;
    width: 142px;
    height: auto;
    max-height: 34px;
    object-fit: contain;
    flex: 0 0 auto;
}
.listening-candidate,
.exam-candidate-display {
    color: var(--app--font-color);
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.listening-time {
    justify-self: center;
    font-weight: 700;
    color: var(--app--font-color);
    font-size: 1.28rem;
    line-height: 1;
    white-space: nowrap;
}
.listening-audio-status {
    color: var(--text-light);
}
.listening-topbar-right,
.writing-topbar-right {
    display: flex;
    justify-self: end;
    align-items: center;
    gap: 8px;
    color: var(--header--icon-color);
}
.listening-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}
.listening-volume-control svg {
    width: 28px;
    height: 28px;
}
.listening-volume-control input[type="range"] {
    width: 126px;
    accent-color: #1683f7;
}
.listening-icon-btn,
.listening-submit-btn {
    height: 28px;
    border: 1px solid var(--footer--selected-border);
    border-radius: 5px;
    background: var(--footer--question-background);
    color: var(--app--font-color);
    cursor: pointer;
}
.listening-icon-btn {
    width: 44px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}
.listening-icon-btn span {
    width: 19px;
    height: 2px;
    background: var(--header--icon-color);
    border-radius: 2px;
    display: block;
    flex: 0 0 auto;
}
.listening-submit-btn {
    min-width: 76px;
    padding: 0 12px;
    font-size: 0.92rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.listening-icon-btn:hover,
.listening-submit-btn:hover {
    background: var(--resize-btn-bg-hover);
}
body.playground-mode #listeningSubmitBtn,
body.playground-mode #readingSubmitBtn {
    display: none !important;
}
.exam-settings-btn {
    width: 48px;
    height: 34px;
    border: 1px solid var(--footer--selected-border);
    border-radius: 5px;
    background: var(--footer--question-background);
    color: var(--app--font-color);
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.exam-settings-btn span {
    width: 22px;
    height: 3px;
    background: var(--header--icon-color);
    border-radius: 2px;
}
.exam-settings-btn:hover {
    background: var(--resize-btn-bg-hover);
}
.reading-settings-btn {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 90;
}
.listening-main-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 22px 84px;
    background: var(--bg-panel);
}
/* ====================================================== */
/*                 7. WRITING TEST VIEW                   */
/* ====================================================== */
.test-view-writing {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 54px);
    background: var(--bg-panel);
    padding: 0;
}
.writing-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--header--background);
    border-bottom: 1px solid var(--header-border-color);
    min-height: 50px;
    padding: 7px 16px 7px 22px;
    display: grid;
    grid-template-columns: minmax(360px, 1fr) auto minmax(360px, 1fr);
    align-items: center;
    column-gap: 16px;
    flex: 0 0 auto;
}
.writing-header-time {
    justify-self: center;
}
.writing-instruction-band {
    flex: 0 0 auto;
    margin: 12px 22px 0;
    padding: 10px 16px;
    background: var(--instruction-band-bg);
    border: var(--question--dynamic-rubric-block-border);
    border-radius: 4px;
}
.writing-instruction-band h2 {
    margin: 0 0 2px;
    color: var(--app--font-color);
    font-size: 1rem;
    font-weight: 700;
}
.writing-instruction-band p {
    margin: 0;
    color: var(--app--font-color);
    font-size: 0.98rem;
    line-height: 1.45;
}
.writing-main-content {
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    padding: 14px 22px 8px;
    background: var(--bg-panel);
}
.writing-prompts,
.writing-inputs {
    min-width: 0;
    background-color: var(--bg-panel);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.writing-prompts {
    flex: 1 1 50%;
}
.writing-inputs {
    flex: 1 1 50%;
    padding: 32px 20px 0 18px;
}
.writing-resizer {
    flex: 0 0 18px;
}
.writing-prompt-panel {
    padding: 24px 20px 0 0;
    overflow-y: auto;
    flex-grow: 1;
    color: var(--app--font-color);
    line-height: 1.65;
}
.writing-prompt-panel > h3:first-child,
.writing-prompt-panel .prompt-box h3:first-child {
    display: none;
}
.writing-prompt-panel img {
    display: block;
    width: 100% !important;
    max-width: none !important;
    max-height: none;
    height: auto;
    margin: 22px 0;
}
.writing-tabs { display: none; border-bottom: 1px solid var(--border-color); }
.writing-tab { flex-grow: 1; padding: 0.75rem; border: none; background-color: var(--bg-main); color: var(--text-light); border-bottom: 3px solid transparent; font-weight: 500; cursor: pointer; }
.writing-tab.active { background-color: var(--bg-panel); color: var(--primary-color); font-weight: 600; border-bottom-color: var(--primary-color); }
.writing-input-panel {
    min-height: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.writing-textarea {
    width: 100%;
    height: 190px;
    min-height: 190px;
    max-height: 100%;
    flex: 0 0 auto;
    border: 2px solid #b9b9b9;
    border-radius: 2px;
    padding: 12px;
    background: #ffffff;
    color: #111111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1rem;
    line-height: 1.55;
    resize: none;
    overflow-y: hidden;
}
.writing-textarea:focus {
    outline: none;
    border-color: var(--question--input-border-focus);
    box-shadow: 0 0 0 2px hsla(205, 100%, 31%, 0.18);
}
.writing-meta {
    padding-top: 6px;
    text-align: right;
    color: var(--app--font-color);
    font-size: 0.98rem;
    font-weight: 600;
}
.writing-footer-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}
.writing-footer-task {
    min-width: 92px;
    height: 38px;
    border: none;
    border-top: 3px solid transparent;
    background: transparent;
    color: var(--app--font-color);
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    padding: 0 12px;
}
.writing-footer-task.active {
    border-top-color: var(--app--font-color);
}
.writing-footer-progress {
    color: var(--app--font-color);
    font-weight: 600;
    white-space: nowrap;
}
.writing-footer-controls {
    margin-left: auto;
    display: flex;
    gap: 6px;
}
.writing-footer-arrow {
    width: 44px;
    height: 44px;
    border: 1px solid #111111;
    border-radius: 2px;
    background: #000000;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}
.writing-footer-arrow:disabled {
    background: #d9d9d9;
    border-color: #d9d9d9;
    color: #ffffff;
    cursor: not-allowed;
    opacity: 1;
}
#bottomControlBar.writing-bottom-mode {
    height: 54px;
    min-height: 54px;
    padding: 0 14px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: none;
    align-items: stretch;
}
#bottomControlBar.writing-bottom-mode .bar-section-info,
#bottomControlBar.writing-bottom-mode .bar-section-tools {
    display: none;
}
#bottomControlBar.writing-bottom-mode #navigationContainer {
    width: 100%;
    height: 54px;
    display: block;
    overflow: visible;
}
#bottomControlBar.writing-bottom-mode .writing-footer-shell {
    width: 100%;
    height: 54px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 22px;
}
#bottomControlBar.writing-bottom-mode .writing-footer-task {
    width: 100%;
    height: 54px;
    min-width: 0;
    border: 0;
    border-top: 3px solid #cfd4d8;
    border-radius: 0;
    background: #ffffff;
    color: #111111;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 20px;
    font: 700 1rem Arial, Helvetica, sans-serif;
    cursor: pointer;
    box-shadow: none;
}
#bottomControlBar.writing-bottom-mode .writing-footer-task.active {
    border-top-color: #2e7d32;
}
#bottomControlBar.writing-bottom-mode .writing-footer-check {
    color: #2e7d32;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
    visibility: hidden;
}
#bottomControlBar.writing-bottom-mode .writing-footer-task.active .writing-footer-check {
    visibility: visible;
}
#bottomControlBar.writing-bottom-mode .writing-footer-count {
    color: #6b7280;
    font-weight: 700;
}

#app.font-size-small {
  --exam-content-font-size: 0.875rem;
}
#app.font-size-medium {
  --exam-content-font-size: 1rem;
}
#app.font-size-large {
  --exam-content-font-size: 1.125rem;
}
#app.font-size-xlarge {
  --exam-content-font-size: 1.25rem;
}
#readingText,
#allQuestionsWrapper,
#listeningQuestionsContainer,
.writing-prompt-panel,
.writing-textarea {
  font-size: var(--exam-content-font-size, 1rem);
}
#readingText [style*="font-size" i],
#allQuestionsWrapper [style*="font-size" i],
#listeningQuestionsContainer [style*="font-size" i],
.writing-prompt-panel [style*="font-size" i] {
  font-size: inherit !important;
}

/* ====================================================== */
/*                  8. QUESTION STYLES                    */
/* ====================================================== */
.question-block { margin-bottom: 2rem; padding: 0; border: none; background-color: transparent; }
.question-block .instructions {
  background-color: var(--rubric-block--background); color: var(--app--font-color);
  padding: 1rem 1.5rem; border: var(--question--dynamic-rubric-block-border);
  border-radius: var(--border-radius); margin-bottom: 1.5rem;
}
.question-number-marker {
  border-radius: 4px; padding: 2px; margin: -2px; 
  transition: background-color 0.2s;
  color: #000000;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
}
.question-number-marker.focused {
  background-color: hsla(215, 50%, 47%, 0.2); outline: 2px solid var(--primary-color);
}
.answer-container { display: inline-block; vertical-align: middle; margin: 0 0.25em; }
.radio-options, .checkbox-options {
  display: block; margin-top: 0.75rem; border: 1px solid var(--border-color);
  border-radius: var(--border-radius); padding: 0.75rem; background-color: var(--bg-panel);
}
.radio-options label, .checkbox-options label {
  display: block; padding: 0.35rem 0.4rem; border-radius: 6px;
  cursor: pointer; transition: background-color 0.2s;
}
.radio-options label:hover, .checkbox-options label:hover { background-color: var(--question--label-background-hover); }
.matrix-question {
    margin: 0.75rem 0 1.25rem;
    overflow-x: auto;
    font-size: var(--exam-content-font-size, 1rem);
    line-height: inherit;
    text-transform: none;
}
.matrix-question tr.answer-container {
    display: table-row;
    margin: 0;
}
.matrix-question table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    table-layout: fixed;
    background: #ffffff;
    border: 1px solid #b9b9b9;
    font-size: var(--exam-content-font-size, 1rem);
}
.matrix-question th,
.matrix-question td {
    border: 1px solid #b9b9b9;
}
.matrix-question thead th {
    height: 34px;
    padding: 0.25rem 0.2rem;
    color: #111111;
    font-size: 1em;
    font-weight: 700;
    text-align: center;
    text-transform: none;
}
.matrix-question thead th:not(.matrix-prompt-header),
.matrix-question tbody td {
    width: 38px;
    border-left: 1px solid #9d9d9d;
}
.matrix-prompt-header {
    width: auto;
    border-right: 3px solid #767676;
}
.matrix-row-prompt {
    border-right: 3px solid #767676;
    padding: 0.32rem 0.55rem;
    color: #111111;
    font-weight: 400;
    font-size: var(--exam-content-font-size, 1rem);
    line-height: 1.35;
    text-align: left;
    text-transform: none;
    vertical-align: middle;
}
.matrix-row-layout {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 0.45rem;
    align-items: center;
    width: 100%;
}
.matrix-row-layout .question-number-marker {
    display: inline-flex;
    justify-content: center;
    min-width: 28px;
    padding: 0.05rem 0.25rem;
    color: #111111;
}
.matrix-row-text {
    min-width: 0;
    color: #111111;
    font-size: var(--exam-content-font-size, 1rem);
    font-weight: 400;
    line-height: inherit;
    text-transform: none;
}
.matrix-question td {
    padding: 0;
    text-align: center;
    vertical-align: middle;
}
.matrix-radio-option {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    width: 100%;
    cursor: pointer;
    color: #111111;
    font-weight: 600;
    line-height: 1;
    position: relative;
}
.matrix-radio-option input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #2a6c96;
    cursor: pointer;
}
.matrix-radio-option span {
    display: none;
    pointer-events: none;
}
.matrix-question td:has(input[type="radio"]:checked) {
    background: #c8dceb;
}
.map-matrix-question {
    display: grid;
    grid-template-columns: minmax(340px, 1.25fr) minmax(300px, 0.95fr);
    gap: 1rem;
    align-items: start;
    margin: 0.75rem 0 1.25rem;
}
.map-matrix-media {
    min-width: 0;
}
.map-matrix-media h4 {
    margin: 0 0 0.5rem;
    color: #111111;
    font-size: 1em;
    line-height: 1.35;
    text-align: center;
}
.map-matrix-media .test-map,
.map-matrix-media img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
}
.map-matrix-choices {
    min-width: 0;
}
.map-matrix-choices .matrix-question {
    margin: 0;
}
.map-matrix-choices .matrix-question table {
    min-width: 300px;
}
.map-matrix-choices .matrix-question thead th:not(.matrix-prompt-header),
.map-matrix-choices .matrix-question tbody td {
    width: 34px;
}
.map-matrix-choices .matrix-row-layout {
    grid-template-columns: 30px 1fr;
    gap: 0.35rem;
}
.map-matrix-choices .matrix-row-prompt {
    padding: 0.28rem 0.45rem;
}
@media (max-width: 860px) {
    .map-matrix-question {
        grid-template-columns: 1fr;
    }
}
.matrix-question tr.teaching-answer-correct .matrix-row-prompt,
.matrix-question tr.teaching-answer-incorrect .matrix-row-prompt {
    box-shadow: inset 4px 0 0 currentColor;
}
.matrix-question tr.teaching-answer-correct .matrix-row-prompt,
.matrix-question tr.teaching-answer-correct td {
    background-color: #dcfce7 !important;
}
.matrix-question tr.teaching-answer-incorrect .matrix-row-prompt,
.matrix-question tr.teaching-answer-incorrect td {
    background-color: #fee2e2 !important;
}
.matrix-question .matrix-radio-option.teaching-answer-correct,
.matrix-question .matrix-radio-option.teaching-answer-incorrect {
    min-height: 40px;
    border: 2px solid currentColor !important;
    box-shadow: inset 0 0 0 2px #ffffff, 0 0 0 2px currentColor !important;
}
.matrix-question .matrix-radio-option.teaching-answer-correct input {
    accent-color: #16a34a;
}
.matrix-question .matrix-radio-option.teaching-answer-incorrect input {
    accent-color: #dc2626;
}
.matrix-question td:has(.matrix-radio-option.teaching-answer-correct) {
    background-color: #86efac !important;
}
.matrix-question td:has(.matrix-radio-option.teaching-answer-incorrect) {
    background-color: #fca5a5 !important;
}
.teaching-answer-correct {
    border-color: #16a34a !important;
    background-color: #ecfdf3 !important;
    color: #166534 !important;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18) !important;
}
.teaching-answer-incorrect {
    border-color: #dc2626 !important;
    background-color: #fff1f2 !important;
    color: #991b1b !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.16) !important;
}
.teaching-answer-stats {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
    vertical-align: middle;
    white-space: nowrap;
}
.radio-options label.teaching-answer-correct,
.checkbox-options label.teaching-answer-correct,
.radio-options label.teaching-answer-incorrect,
.checkbox-options label.teaching-answer-incorrect {
    border: 1px solid currentColor;
}
body.theme-dark .radio-options label:hover,
body.theme-dark .checkbox-options label:hover { background-color: #263548; }
body.theme-dark .listening-topbar,
body.theme-dark .reading-topbar,
body.theme-dark .writing-topbar,
body.theme-dark .reading-instruction-band,
body.theme-dark #listeningView .listening-main-content::before,
body.theme-dark #bottomControlBar.listening-bottom-mode {
    background: var(--bg-panel);
    border-color: var(--border-color);
}
body.theme-dark .listening-brand,
body.theme-dark .exam-brand-text { color: #ff6b6b; }
body.theme-dark .listening-candidate,
body.theme-dark .exam-candidate-display,
body.theme-dark .listening-time,
body.theme-dark .listening-topbar-right,
body.theme-dark .writing-topbar-right,
body.theme-dark .reading-instruction-band h2,
body.theme-dark .reading-instruction-band p,
body.theme-dark #listeningView .listening-main-content::before {
    color: var(--text-dark);
}
body.theme-dark .listening-icon-btn,
body.theme-dark .listening-submit-btn,
body.theme-dark .reading-header-icon-btn,
body.theme-dark .reading-header-submit,
body.theme-dark .part-switch-btn,
body.theme-dark .exam-settings-btn {
    background: #263548;
    border-color: #475569;
    color: var(--text-dark);
}
body.theme-dark .listening-icon-btn span,
body.theme-dark .reading-header-icon-btn span,
body.theme-dark .exam-settings-btn span {
    background: var(--text-dark);
}
body.theme-dark .reading-footer-part-btn,
body.theme-dark .reading-footer-question {
    color: var(--text-dark);
}
body.theme-dark .reading-instruction-band,
body.theme-dark #listeningView .listening-main-content::before {
    background: var(--instruction-band-bg);
    color: #000000;
}
body.theme-dark .reading-instruction-band h2,
body.theme-dark .reading-instruction-band p {
    color: #000000;
}
body.theme-dark {
    --text-dark: #ffffff;
    --text-light: #ffffff;
    --bg-main: #000000;
    --bg-panel: #000000;
    --border-color: #ffffff;
    --app--font-color: #ffffff;
    --app--label-color: #ffffff;
    --header--background: #000000;
    --header-border-color: #ffffff;
    --footer--background: #000000;
    --footer--color: #ffffff;
    --footer--question-background: #000000;
    --footer--selected-border: #ffffff;
    --resize-btn-bg: #000000;
    --resize-btn-color: #ffffff;
    --resize-btn-bg-hover: #1f1f1f;
}
body.theme-dark .reading-instruction-band,
body.theme-dark #listeningView .listening-main-content::before {
    background: #000000;
    color: #ffffff;
}
body.theme-dark .reading-instruction-band h2,
body.theme-dark .reading-instruction-band p,
body.theme-dark .exam-brand-text,
body.theme-dark .listening-brand {
    color: #ffffff;
}
body.theme-yellow-black .reading-instruction-band,
body.theme-yellow-black #listeningView .listening-main-content::before {
    background: #000000;
    color: #fff36b;
}
body.theme-yellow-black .reading-instruction-band h2,
body.theme-yellow-black .reading-instruction-band p,
body.theme-yellow-black .exam-brand-text,
body.theme-yellow-black .listening-brand,
body.theme-yellow-black h1,
body.theme-yellow-black h2,
body.theme-yellow-black h3 {
    color: #fff36b;
}
body.theme-yellow-black .listening-icon-btn span,
body.theme-yellow-black .reading-header-icon-btn span,
body.theme-yellow-black .exam-settings-btn span {
    background: #fff36b;
}
body.theme-yellow-black .reading-header-icon-btn,
body.theme-yellow-black .reading-header-submit,
body.theme-yellow-black .listening-icon-btn,
body.theme-yellow-black .listening-submit-btn,
body.theme-yellow-black .settings-action-btn {
    background: #000000;
    color: #fff36b;
    border-color: #f3d94e;
}
body.theme-dark .question-number-marker {
    color: #ffffff;
}
body.theme-yellow-black .question-number-marker {
    color: #fff36b;
}
.radio-options input[type="radio"], .checkbox-options input[type="checkbox"] {
  margin-right: 0.55rem; accent-color: var(--primary-color);
  transform: scale(1.1); cursor: pointer;
}
#listeningView .radio-options label:has(input[type="radio"]:checked),
#listeningView .checkbox-options label:has(input[type="checkbox"]:checked) {
  background-color: var(--question--interaction-checked-bg);
  color: var(--question--interaction-checked-color);
}
.answer-container input[type="text"], .answer-container select {
  border: 2px solid var(--question--input-border); border-radius: 6px; background: var(--bg-panel);
  font-family: var(--body-font); font-size: 1em; padding: 3px 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, width 0.12s ease;
  position: relative;
  z-index: 2;
  scroll-margin: 96px 24px;
}
.answer-container input[type="text"] {
  min-width: 150px;
  max-width: min(100%, 420px);
}
.answer-container select {
  max-width: 150px;
}
.answer-container input[type="text"]:focus, .answer-container select:focus {
  outline: none; border-color: var(--question--input-border-focus);
  box-shadow: 0 0 0 3px hsla(215, 50%, 47%, 0.3);
}

/* ====================================================== */
/*                  9. REVIEW & RESULTS                   */
/* ====================================================== */
.setup-container {
    background-color: var(--bg-panel); padding: 2rem 3rem;
    border-radius: 12px; box-shadow: var(--panel-shadow);
    max-width: 1100px; margin: 3rem auto;
}
.review-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: var(--bg-main);
    text-align: left;
}
.review-candidate-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #b11823;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 800;
}
.review-item-info {
    min-width: 0;
}
.review-item-header {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    flex-wrap: wrap;
}
.review-item-info h4 {
    margin: 0;
    color: #241719;
    font-size: 1.15rem;
}
.review-item-header span {
    color: #8a6b6f;
    font-size: 0.88rem;
    font-weight: 700;
}
.review-item-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
}
.review-test-title {
    color: #4b3034 !important;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.review-meta {
    color: #7b6265 !important;
}
.review-score-panel {
    min-width: 112px;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    background: #fff0f1;
    border: 1px solid #f0c7cb;
    text-align: center;
}
.review-score-panel span,
.review-score-panel small {
    display: block;
    color: #7b6265;
    font-size: 0.76rem;
    font-weight: 700;
}
.review-score-panel strong {
    display: block;
    color: #b11823;
    font-size: 1.55rem;
    line-height: 1.1;
}
.review-score-panel.practice strong {
    font-size: 1rem;
}
.review-item button {
    min-width: 92px;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
}

.comparison-table {
    flex: 1; min-width: 300px; border: 1px solid var(--border-color);
    border-radius: var(--border-radius); background-color: var(--bg-panel);
    overflow: hidden; display: flex; flex-direction: column;
}
.comparison-table table { width: 100%; border-collapse: collapse; }
.comparison-table th, .comparison-table td {
    padding: 0.75rem 1rem; text-align: left;
    border-bottom: 1px solid var(--border-color); font-size: 0.95rem;
}
.correct-cell { color: var(--success-color); font-weight: 700; }
.incorrect-cell { color: var(--error-color); font-weight: 700; }

.review-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid #ead8da;
  margin-bottom: 1.5rem;
}
.review-tab {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border: 1px solid #e3d4d5;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background-color: #fffafa;
  color: #6f5558;
  font-weight: 700;
  font-size: 1rem;
  transform: translateY(1px);
  transition: all 0.2s ease-in-out;
}
.review-tab:hover {
  color: #b11823;
  background-color: #fff0f1;
  border-color: #f0c7cb;
}
.review-tab.active {
  color: #ffffff;
  background-color: #b11823;
  border-color: #b11823;
}
.review-detail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 0 0 1.5rem;
  padding: 1.25rem;
  border: 1px solid #e3d4d5;
  border-radius: 8px;
  background: #fffafa;
}
.review-detail-info {
  min-width: 0;
}
.review-detail-info h3,
.review-detail-summary h3 {
  margin: 0 0 0.5rem;
  color: #241719;
}
.review-detail-info p,
.review-detail-summary p {
  margin: 0.2rem 0;
  color: #6f5558;
}
.review-score-circle {
  width: 156px;
  height: 156px;
  flex: 0 0 156px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#b11823 var(--score-percent), #ead8da 0);
  box-shadow: 0 12px 28px rgba(63, 24, 29, 0.16);
}
.review-score-circle-inner {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  text-align: center;
}
.review-score-circle-inner span,
.review-score-circle-inner small {
  color: #7b6265;
  font-size: 0.78rem;
  font-weight: 700;
}
.review-score-circle-inner strong {
  color: #b11823;
  font-size: 2rem;
  line-height: 1.05;
}
.review-score-circle-list {
  width: 112px;
  height: 112px;
  flex-basis: 112px;
  box-shadow: 0 10px 20px rgba(63, 24, 29, 0.12);
}
.review-score-circle-list .review-score-circle-inner {
  width: 84px;
  height: 84px;
}
.review-score-circle-list .review-score-circle-inner strong {
  font-size: 1.35rem;
}
.review-score-circle-list .review-score-circle-inner span,
.review-score-circle-list .review-score-circle-inner small {
  font-size: 0.68rem;
}


/* ====================================================== */
/*                 10. MODALS & HIGHLIGHTER               */
/* ====================================================== */
.lightbox-overlay {
    position: fixed; z-index: 1000; padding: 20px;
    left: 0; top: 0; width: 100%; height: 100%;
    overflow: auto; background-color: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
}
.video-modal-content {
    background-color: var(--bg-panel); border-radius: var(--border-radius);
    padding: 2rem; max-width: 800px; width: 100%;
    box-shadow: var(--panel-shadow); animation: zoom 0.4s;
}
.video-modal-content video { margin: 1.5rem 0; border: 1px solid var(--border-color); }
.video-modal-content button { width: 100%; }
@keyframes zoom { from {transform:scale(0)} to {transform:scale(1)} }

.exam-settings-menu {
  position: fixed;
  z-index: 1400;
  width: 276px;
  background: var(--bg-panel);
  color: var(--text-dark);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  padding: 0.75rem;
  backdrop-filter: blur(8px);
}
.settings-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 0.85rem;
  padding: 0.45rem 0;
  font-weight: 600;
}
.settings-row > span {
  color: var(--text-light);
  font-size: 0.82rem;
}
.settings-button-group {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
}
.settings-action-btn {
  min-width: 38px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-main);
  color: var(--text-dark);
  font: 700 0.86rem/1 var(--body-font);
  cursor: pointer;
}
.settings-action-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.settings-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.contrast-button-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}
.contrast-btn {
  height: 34px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 800 1rem/1 Arial, Helvetica, sans-serif;
  padding: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.contrast-btn span {
  color: inherit;
  font: inherit;
}
.contrast-bw {
  background: #ffffff;
  color: #000000;
}
.contrast-wb {
  background: #000000;
  color: #ffffff;
}
.contrast-yb {
  background: #000000;
  color: #ffe600;
}
.contrast-btn:hover,
.contrast-btn.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color) 32%, transparent);
}
.contrast-btn.active {
  transform: translateY(-1px);
}

.highlighter-menu {
  position: fixed; z-index: 1300; background-color: var(--bg-panel);
  border: 1px solid var(--border-color); border-radius: var(--border-radius);
  box-shadow: var(--panel-shadow); padding: 0.25rem; display: flex;
  flex-direction: column; gap: 0.25rem;
}
.highlighter-menu button {
  width: 100%; background-color: transparent; color: var(--text-dark);
  border: none; padding: 0.5rem 1rem; font-size: 0.9rem;
  text-align: left; font-weight: 500;
}
.highlighter-menu button:hover { background-color: var(--primary-light); color: var(--primary-color); }
.highlighted-text { background-color: #fffb8f; border-radius: 2px; }
body.theme-dark .highlighted-text { background-color: #8a7418; }

/* ====================================================== */
/*               11. RESPONSIVE ADJUSTMENTS               */
/* ====================================================== */
@media (max-width: 768px) {
  .listening-topbar,
  .writing-topbar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px 10px;
  }
  #testView .header__topbar___2CQ4O {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 10px;
  }
  #testView .header__logo___3xoBS,
  #testView .header__centralBar___3GpJy,
  #testView .header__connectionAndButtonContainer___1t_Gd {
    grid-column: 1;
    justify-self: start;
    height: auto;
    padding: 0;
  }
  .reading-topbar {
    height: auto;
    min-height: 92px;
  }
  .header__logo___3xoBS {
    min-width: 86px;
    gap: 7px;
    padding: 0 10px;
  }
  .reading-logo-mark {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }
  .reading-logo-text {
    font-size: 1.05rem;
  }
  .header__subToolbar___TmVu0 {
    grid-template-columns: 1fr;
  }
  .header__centralBar___3GpJy {
    justify-self: start;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
  .header__connectionAndButtonContainer___1t_Gd {
    padding-right: 8px;
    gap: 6px;
  }
  .listening-time,
  .listening-topbar-right,
  .writing-topbar-right {
    justify-self: start;
  }
  .reading-instruction-band {
    margin: 12px;
    padding: 12px 14px;
  }
  .reading-split-content {
    height: auto;
    flex-direction: column;
  }
  .listening-volume-control input[type="range"] {
    width: 96px;
  }
  .listening-icon-btn {
    width: 48px;
  }
  .reading-settings-btn {
    top: 8px;
    right: 8px;
  }
  .listening-submit-btn {
    min-width: 82px;
    padding: 0 12px;
  }
  .listening-main-content {
    padding: 24px 12px 92px;
  }
  .test-view, .test-view-writing {
    flex-direction: column; height: auto; display: flex;
  }
  .writing-main-content {
    grid-template-columns: 1fr;
  }
  .left-panel, .right-panel, .writing-prompts, .writing-inputs {
    flex-basis: auto; height: 50vh;
  }
  .resizer { height: 10px; width: 100%; cursor: row-resize; }
  #bottomControlBar {
      flex-direction: column;
      height: auto;
      padding: 0.5rem;
      gap: 0.5rem;
  }
  #app { padding-bottom: 120px; } /* More padding for taller bar */
}

/* In style.css (add to the bottom) */

/* Admin Dashboard Buttons */
.admin-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}
.admin-buttons button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    padding: 1rem;
}
.admin-buttons svg {
    width: 24px;
    height: 24px;
}
.admin-dashboard-box {
    max-width: 760px;
}
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin: 1rem 0 1.5rem 0;
}
.admin-stat-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-main);
    padding: 0.9rem;
    text-align: left;
}
.admin-stat-label {
    display: block;
    color: var(--text-light);
    font-size: 0.85rem;
}
.admin-stat-card strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.35rem;
    color: var(--primary-color);
}
.admin-buttons .admin-danger {
    background-color: var(--error-color);
    border-color: var(--error-color);
}
.admin-buttons .admin-danger:hover:not(:disabled) {
    background-color: #b91c1c;
    border-color: #b91c1c;
}
.admin-buttons .admin-ghost {
    background-color: transparent;
    color: var(--text-light);
    border-color: var(--border-color);
}
.admin-buttons .admin-ghost:hover:not(:disabled) {
    color: var(--text-dark);
    background-color: var(--bg-main);
    border-color: var(--border-color);
}

/* Admin Test Loader Styles */
.admin-test-selector-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    align-items: flex-end;
    margin: 2rem 0;
}
.admin-test-selector-grid .selector-group button {
    margin-top: 0.75rem;
}
.selector-group label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--text-light);
}
.selector-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: var(--bg-panel);
}
.selector-group select:disabled {
    background-color: var(--bg-main);
}
.admin-playground-note {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.35rem;
}
#adminPlaygroundView .admin-test-selector-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
}

.teaching-mode-panel {
    margin-top: 2rem;
    border-top: 1px solid #b91c1c;
    padding-top: 1.25rem;
}
#playgroundTeachingTiles {
    margin-top: 1rem;
    overflow-x: auto;
}
.teaching-tabs {
    justify-content: flex-start;
    margin-bottom: 0.75rem;
}
.teaching-tabs .review-tab {
    border-color: #e5b9b9;
    color: #7f1d1d;
}
.teaching-tabs .review-tab:hover {
    border-color: #b91c1c;
    background: #fff5f5;
}
.teaching-tabs .review-tab.active {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #ffffff;
}
.teaching-mode-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.teaching-mode-header h3 {
    margin: 0 0 0.25rem;
}
.teaching-mode-header p,
.teaching-mode-header span {
    color: var(--text-light);
    font-size: 0.9rem;
}
.teaching-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}
.teaching-tile {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 126px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-panel);
    color: var(--text-dark);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.teaching-tile:hover {
    border-color: #b91c1c;
    box-shadow: 0 8px 20px rgba(127, 29, 29, 0.12);
    transform: translateY(-1px);
}
.teaching-tile span,
.teaching-tile small {
    color: #8a3a3a;
    font-size: 0.82rem;
}
.teaching-tile strong {
    font-size: 1rem;
    line-height: 1.3;
    color: #581111;
}
.teaching-matrix-summary {
    color: #7f1d1d;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}
.teaching-matrix {
    display: grid;
    grid-template-columns: 72px repeat(var(--teaching-cols), minmax(170px, 1fr));
    gap: 0.6rem;
    min-width: calc(72px + (var(--teaching-cols) * 180px));
}
.teaching-matrix-corner,
.teaching-matrix-head,
.teaching-matrix-test,
.teaching-matrix-empty,
.teaching-matrix-cell {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-panel);
}
.teaching-matrix-corner,
.teaching-matrix-head {
    border-color: #d8a7a7;
    background: #7f1d1d;
    color: #ffffff;
}
.teaching-matrix-corner,
.teaching-matrix-head {
    padding: 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
}
.teaching-matrix-test {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    min-height: 88px;
    border-color: #e5b9b9;
    background: #fff5f5;
}
.teaching-matrix-test strong {
    color: #7f1d1d;
    font-size: 0.82rem;
    line-height: 1.15;
    text-align: center;
}
.teaching-matrix-cell {
    display: flex;
    flex-direction: column;
    min-height: 88px;
    padding: 0.85rem;
    color: var(--text-dark);
    text-align: left;
    cursor: pointer;
    border-color: #e5b9b9;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.teaching-matrix-cell:hover:not(:disabled) {
    background: #fff1f1;
    border-color: #b91c1c;
    color: #581111;
    box-shadow: 0 8px 20px rgba(127, 29, 29, 0.12);
    transform: translateY(-1px);
}
.teaching-matrix-cell:hover:not(:disabled) strong {
    color: #581111;
}
.teaching-matrix-cell:hover:not(:disabled) small {
    color: #7f1d1d;
}
.teaching-matrix-cell strong,
.teaching-matrix-cell small {
    display: block;
}
.teaching-matrix-cell strong {
    font-size: 0.92rem;
    line-height: 1.25;
    color: #581111;
}
.teaching-matrix-cell small {
    color: #8a3a3a;
    font-size: 0.8rem;
    margin-top: 0.35rem;
}
.teaching-question-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: auto;
    padding-top: 0.65rem;
}
.teaching-question-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0.12rem 0.4rem;
    border: 1px solid #e5b9b9;
    border-radius: 999px;
    background: #fff5f5;
    color: #7f1d1d;
    font-size: 0.68rem;
    line-height: 1;
    font-weight: 700;
}
.teaching-matrix-cell:hover:not(:disabled) .teaching-question-tags span {
    background: #ffffff;
    border-color: #d89a9a;
    color: #581111;
}
.teaching-matrix-empty {
    display: flex;
    min-height: 88px;
    align-items: center;
    justify-content: center;
    color: #9f6b6b;
    font-size: 0.85rem;
    border-color: #ead0d0;
    background: #fffafa;
}

.admin-json-workbench {
    position: fixed;
    top: 0;
    left: 0;
    width: 420px;
    height: calc(100vh - 68px);
    padding: 0.9rem;
    border-right: 1px solid var(--border-color);
    background-color: #0f172a;
    color: #e2e8f0;
    z-index: 110;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.admin-json-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-json-header h3 {
    margin: 0;
    color: #f8fafc;
}
.admin-json-close-btn {
    border: 1px solid #334155;
    background-color: transparent;
    color: #cbd5e1;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}
.admin-json-close-btn:hover:not(:disabled) {
    border-color: #475569;
    background-color: #1e293b;
}
.admin-json-meta {
    margin: 0;
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.35;
}
#adminJsonEditor {
    width: 100%;
    flex: 1;
    border: 1px solid #334155;
    background-color: #020617;
    color: #dbeafe;
    border-radius: 6px;
    padding: 0.8rem;
    resize: none;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.85rem;
    line-height: 1.45;
}
#adminJsonEditor:focus {
    outline: none;
    border-color: #64748b;
}
.admin-json-status {
    margin: 0;
    font-size: 0.82rem;
    color: #fca5a5;
}
.admin-json-status.success {
    color: #86efac;
}
.admin-json-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.admin-json-actions button {
    font-size: 0.85rem;
    padding: 0.55rem 0.5rem;
}
.admin-editable-content[contenteditable="true"] {
    outline: 1px dashed rgba(59, 130, 246, 0.55);
    border-radius: 4px;
    padding: 0.25rem;
    margin: 0.2rem 0;
}
.admin-editable-content[contenteditable="true"]:focus {
    outline: 2px solid rgba(59, 130, 246, 0.8);
}
.admin-editable-image {
    cursor: pointer;
    outline: 2px dashed rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}
.admin-editable-image.selected {
    outline: 3px solid #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}
.admin-inline-selected-image {
    outline: 3px solid #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}
.admin-inline-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 0.3rem;
    background-color: rgba(15, 23, 42, 0.96);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 0.45rem;
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.35);
    flex-wrap: wrap;
    max-width: 100%;
    margin-bottom: 0.5rem;
}
.admin-inline-toolbar button {
    border: 1px solid #334155;
    background-color: #0b1221;
    color: #dbeafe;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
}
.admin-inline-toolbar select,
.admin-inline-toolbar input[type="color"] {
    border: 1px solid #334155;
    background-color: #0b1221;
    color: #dbeafe;
    padding: 0.28rem 0.36rem;
    font-size: 0.74rem;
    border-radius: 4px;
    height: 30px;
}
.admin-inline-toolbar input[type="color"] {
    width: 38px;
    padding: 0.1rem;
}
.toolbar-divider {
    width: 1px;
    background-color: #334155;
    margin: 0 0.15rem;
}
.admin-inline-toolbar button:hover:not(:disabled) {
    background-color: #1e293b;
    border-color: #475569;
}
#bottomControlBar.listening-bottom-mode {
    background: var(--footer--background);
    border-top: 1px solid var(--footer--selected-border);
    box-shadow: none;
    height: auto;
    min-height: 62px;
    align-items: flex-start;
    padding: 2px 20px 6px;
}
#bottomControlBar.listening-bottom-mode .bar-section-info,
#bottomControlBar.listening-bottom-mode .bar-section-tools {
    display: none;
}
#bottomControlBar.listening-bottom-mode .bar-section-nav {
    width: 100%;
    justify-content: flex-start;
}
#bottomControlBar.exam-bottom-mode {
    background: var(--footer--background);
    border-top: 1px solid var(--footer--selected-border);
    box-shadow: none;
    height: auto;
    min-height: 62px;
    align-items: center;
    padding: 2px 20px 6px;
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .bar-section-info {
    display: none;
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .bar-section-info,
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .bar-section-tools {
    min-width: auto;
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .bar-section-nav {
    justify-content: flex-start;
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) #navigationContainer {
    width: 100%;
    gap: 12px;
    align-items: stretch;
}
.reading-footer-shell {
    width: 100%;
    display: flex;
    align-items: stretch;
    gap: 14px;
    background: var(--footer--background);
    color: var(--footer--color);
}
.footer__navButtons___Gtvxu {
    display: flex;
    align-items: center;
    gap: 8px;
    order: 2;
    margin-left: auto;
}
.footer__arrowIconBtn___3AiJS {
    width: 40px;
    height: 34px;
    border: 1px solid var(--footer--selected-border);
    border-radius: 6px;
    background: var(--footer--question-background);
    color: var(--app--font-color);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
}
.footer__arrowIconBtn___3AiJS:hover {
    background: var(--footer--selected-bg);
}
.reading-footer-nav {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: stretch;
    gap: 12px;
}
.reading-footer-parts {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: stretch;
    gap: 12px;
}
.reading-footer-part {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0 0;
    border-top: 3px solid var(--footer--selected-border);
    background: transparent;
}
.reading-footer-part.selected {
    flex: 2.4 1 0;
    border-top-color: var(--footer--selected-question-no-bg);
}
.footer__questionNo___3WNct {
    border: none;
    background: transparent;
    color: var(--app--font-color);
    font-weight: 700;
    padding: 0;
    margin: 0;
    box-shadow: none;
    line-height: 1.1;
    white-space: nowrap;
    cursor: pointer;
}
.attemptedCount {
    color: var(--app--label-color);
    font-weight: 700;
    font-size: 0.95rem;
    margin-left: 8px;
}
.reading-footer-part.selected .attemptedCount,
.reading-footer-part:not(.selected) .footer__subquestionWrapper___9GgoP {
    display: none;
}
.footer__subquestionWrapper___9GgoP {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}
.subQuestion.scorable-item {
    border: none;
    background: transparent;
    color: var(--app--font-color);
    padding: 0 7px;
    min-width: 24px;
    width: auto;
    height: 30px;
    border-radius: 2px;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1;
    text-align: center;
    transform: none;
    box-shadow: none;
    cursor: pointer;
}
.subQuestion.scorable-item:hover {
    background: var(--footer--selected-question-no-hover, #aed7ff);
    color: var(--footer--selected-question-no-bg);
}
.subQuestion.scorable-item.attempted {
    background: var(--footer--subquestion-attempted-bg);
    color: var(--footer--selected-question-color);
}
.subQuestion.scorable-item.current,
.subQuestion.scorable-item.active {
    background: var(--footer--subquestion-active-bg);
    color: var(--footer--selected-question-color);
    outline: 2px solid var(--footer--subquestion-active-bg);
    outline-offset: 0;
}
.footer__deliverButton___3FM07 {
    width: 36px;
    height: 34px;
    border: 1px solid var(--footer--selected-border);
    border-radius: 4px;
    background: var(--footer-toc--deliver-bg, #efefef);
    color: var(--footer-toc--deliver-color, #535353);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}
.footer__deliverButton___3FM07:hover {
    background: var(--footer-toc--deliver-bg-hover, #c3d8ec);
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) {
    min-height: 62px;
    padding: 0;
    overflow: visible;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) #navigationContainer {
    width: 100%;
    height: 62px;
    overflow: visible;
    align-items: stretch;
    gap: 0;
}

#bottomControlBar .reading-footer-shell {
    height: 62px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
    gap: 12px;
    padding: 0 12px 0 20px;
    background: var(--footer--background);
    border-top: 1px solid var(--footer--selected-border);
}

#bottomControlBar .reading-footer-nav {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: stretch;
    gap: 10px;
}

#bottomControlBar .reading-footer-parts {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    gap: 12px;
}

#bottomControlBar .reading-footer-part {
    min-width: 0;
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 3px;
    border-top: 3px solid var(--footer--selected-border);
}

#bottomControlBar .reading-footer-part.selected {
    flex: 2.4 1 0;
    border-top-color: var(--footer--selected-question-no-bg);
}

#bottomControlBar .footer__questionNo___3WNct,
#bottomControlBar .subQuestion.scorable-item,
#bottomControlBar .footer__deliverButton___3FM07,
#bottomControlBar .footer__arrowIconBtn___3AiJS {
    padding: 0;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

#bottomControlBar .footer__questionNo___3WNct {
    height: 32px;
    min-width: max-content;
    color: var(--app--font-color);
    background: transparent;
    border: 0;
    font-weight: 700;
}

#bottomControlBar .attemptedCount {
    margin-left: 8px;
    color: var(--app--label-color);
    font-size: 0.95rem;
}

#bottomControlBar .reading-footer-part.selected .attemptedCount,
#bottomControlBar .reading-footer-part:not(.selected) .footer__subquestionWrapper___9GgoP {
    display: none !important;
}

#bottomControlBar .footer__subquestionWrapper___9GgoP {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

#bottomControlBar .subQuestion.scorable-item {
    min-width: 26px;
    height: 30px;
    border: 0;
    border-radius: 2px;
    background: transparent;
    color: var(--app--font-color);
    font-size: 1rem;
    font-weight: 500;
}

#bottomControlBar .subQuestion.scorable-item:hover {
    background: var(--footer--selected-bg);
    color: var(--footer--selected-question-no-bg);
}

#bottomControlBar .subQuestion.scorable-item.attempted {
    background: var(--footer--subquestion-attempted-bg);
    color: var(--footer--selected-question-color);
}

#bottomControlBar .subQuestion.scorable-item.current {
    background: var(--footer--subquestion-active-bg);
    color: var(--footer--selected-question-color);
}

#bottomControlBar .footer__navButtons___Gtvxu {
    grid-column: 2;
    grid-row: 1;
    order: initial;
    margin-left: 0;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

#bottomControlBar .footer__arrowIconBtn___3AiJS,
#bottomControlBar .footer__deliverButton___3FM07 {
    width: 40px;
    height: 34px;
    border: 1px solid var(--footer--selected-border);
    border-radius: 6px;
    background: var(--footer--question-background);
    color: var(--app--font-color);
    font-size: 1.05rem;
}

#bottomControlBar .footer__deliverButton___3FM07 {
    width: 36px;
    margin-left: auto;
}
.part-switch-controls {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.part-switch-btn {
    width: 32px;
    height: 28px;
    border: 1px solid var(--footer--selected-border);
    border-radius: 4px;
    background: var(--footer--question-background);
    color: var(--app--font-color);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.part-switch-btn:hover:not(:disabled) {
    background: var(--resize-btn-bg-hover);
}
.part-switch-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .passage-nav-btn {
    border: none;
    background: transparent;
    color: var(--app--font-color);
    font-weight: 700;
    padding: 0;
    margin: 0;
    box-shadow: none;
    line-height: 1.1;
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .reading-footer-part-btn {
    display: inline-flex;
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .passage-nav-btn.active {
    background: transparent;
    color: var(--app--font-color);
    border: none;
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .question-nav-container {
    gap: 2px;
    align-items: flex-end;
    padding: 0;
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .q-nav-item {
    border: none;
    background: transparent;
    color: var(--app--label-color);
    padding: 0 7px;
    min-width: 24px;
    width: auto;
    height: auto;
    border-top: 3px solid var(--footer--selected-border);
    border-radius: 0;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.15;
    text-align: center;
    transform: none;
    box-shadow: none;
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .q-nav-item:hover {
    border-color: transparent;
    background: transparent;
    color: var(--main-button-bg-color);
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .q-nav-item.answered {
    border-top-color: var(--completed-color, green);
    background: transparent !important;
    color: var(--main-button-bg-color) !important;
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .q-nav-item.current {
    color: var(--app--font-color);
    background: transparent;
    transform: none;
    box-shadow: none;
    border-top-color: var(--footer--selected-border);
    outline: 2px solid var(--main-button-bg-color);
    outline-offset: 0;
    border-radius: 1px;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) {
    min-height: 54px;
    height: 54px;
    padding: 0;
    background: #ffffff;
    border-top: 1px solid #d1d5db;
    box-shadow: 0 -1px 7px rgba(15, 23, 42, 0.08);
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) #navigationContainer {
    height: 54px;
    width: 100%;
    gap: 0;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .reading-footer-shell {
    height: 54px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 114px;
    gap: 12px;
    padding: 0 6px 0 20px;
    border-top: 0;
    background: #ffffff;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .reading-footer-nav {
    height: 54px;
    min-width: 0;
    display: flex;
    align-items: stretch;
    gap: 0;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .reading-footer-parts {
    height: 54px;
    min-width: 0;
    display: flex;
    align-items: stretch;
    gap: 0;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .reading-footer-part {
    height: 54px;
    min-width: 0;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    border-top: 0;
    background: #ffffff;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .reading-footer-part.selected {
    flex: 2.7 1 0;
    border-top-color: transparent;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .reading-footer-part:not(.selected) {
    flex: 1 1 0;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .reading-footer-part-btn {
    height: 54px;
    min-width: 88px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    border-top: 3px solid #aeb5bf;
    background:
        linear-gradient(var(--footer--progress-bar-fill-color, #2a6c96), var(--footer--progress-bar-fill-color, #2a6c96)) 0 0 / var(--attempted-percent, 0%) 3px no-repeat;
    color: #111827;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .reading-footer-part-btn > span {
    display: inline-flex;
    align-items: baseline;
    gap: 9px;
    white-space: nowrap;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .attemptedCount {
    margin-left: 0;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 700;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .reading-footer-question-strip {
    flex: 1 1 auto;
    min-width: 0;
    height: 54px;
    display: flex;
    align-items: stretch;
    gap: 0;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .subQuestion.scorable-item,
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .q-nav-item {
    min-width: 42px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-top: 3px solid #aeb5bf;
    border-radius: 0;
    background: transparent !important;
    color: #64748b !important;
    font-size: 1.04rem;
    font-weight: 500;
    line-height: 1;
    outline: 0;
    box-shadow: none;
    transform: none;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .subQuestion.scorable-item:hover,
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .q-nav-item:hover {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .subQuestion.scorable-item.attempted,
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .q-nav-item.answered {
    border-top-color: var(--completed-color, green);
    background: transparent !important;
    color: var(--main-button-bg-color) !important;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .subQuestion.scorable-item.current,
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .subQuestion.scorable-item.active,
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .q-nav-item.current {
    border-top-color: #aeb5bf;
    background: transparent !important;
    color: #111827 !important;
    outline: 2px solid var(--main-button-bg-color);
    outline-offset: 0;
    border-radius: 1px;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .footer__deliverButton___3FM07 {
    display: none;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .footer__navButtons___Gtvxu {
    grid-column: 2;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 8px 0 0;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .footer__arrowIconBtn___3AiJS {
    width: 52px;
    height: 42px;
    border: 1px solid #9ca3af;
    border-radius: 8px;
    background: #f8fafc;
    color: #111827;
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 3px;
}

#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .footer__arrowIconBtn___3AiJS:hover {
    background: #eef2f7;
}
.listening-admin-check-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.82rem;
    border-radius: 4px;
    white-space: nowrap;
}
.admin-return-btn {
    background-color: var(--secondary-button-bg-color, #4c4c4c);
    margin-right: 0.4rem;
}
.listening-admin-check-btn,
.listening-admin-return-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.82rem;
    border-radius: 4px;
    white-space: nowrap;
}
.teaching-submit-btn,
.teaching-check-btn {
    min-height: 24px;
    height: 24px;
    padding: 0.15rem 0.55rem;
    font-size: 0.78rem;
    line-height: 1;
    border-radius: 4px;
    white-space: nowrap;
}
.teaching-submit-btn {
    background: #15803d;
    border-color: #15803d;
    color: #ffffff;
}
.teaching-submit-btn:hover:not(:disabled) {
    background: #166534;
    border-color: #166534;
}
.teaching-check-btn {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #ffffff;
}
.teaching-check-btn:hover:not(:disabled) {
    background: #991b1b;
    border-color: #991b1b;
}
.listening-progress-wrapper {
    flex: 1 1 auto;
    display: flex;
    gap: 18px;
    overflow: hidden;
    padding-bottom: 0;
    align-items: flex-start;
}
.listening-part-block {
    flex: 1 1 0;
    min-width: 0;
    padding-top: 0;
}
.listening-part-block.active {
    flex: 3.2 1 0;
    min-width: 0;
}
.listening-part-block.active .listening-part-topline {
    background: transparent;
    height: 0;
    margin-bottom: 0;
}
.listening-part-block.active .listening-part-fill {
    width: 0 !important;
}
.listening-part-topline {
    height: 3px;
    background: var(--footer--progress-bar-background, #f2f2f2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}
.listening-part-fill {
    height: 100%;
    width: 0;
    background: var(--footer--progress-bar-fill-color, #2a6c96);
    transition: width 0.2s ease;
}
.listening-part-row {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    min-width: 0;
    min-height: 44px;
}
.listening-part-block .listening-part-done {
    color: var(--completed-color, green);
    margin-right: 4px;
}
.listening-part-block.active .listening-part-btn {
    color: var(--app--font-color);
    text-decoration: none;
}
.listening-part-btn {
    border: none;
    background: transparent;
    color: var(--app--font-color);
    font-weight: 700;
    padding: 0;
    margin: 0;
    box-shadow: none;
    line-height: 1.1;
    font-size: 1rem;
}
.listening-part-btn:hover:not(:disabled) {
    background: transparent;
    color: var(--main-button-bg-color);
    box-shadow: none;
}
.listening-part-meta {
    color: var(--app--label-color);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0;
}
.listening-question-strip {
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
    align-items: flex-end;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    margin-top: 0;
}
.listening-part-block:not(.active) .listening-question-strip {
    display: none;
}
.listening-progress-segment {
    border: none;
    background: transparent;
    color: var(--app--label-color);
    padding: 0 7px;
    min-width: 24px;
    border-top: 3px solid var(--footer--selected-border);
    border-radius: 0;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.15;
    text-align: center;
}
.listening-progress-segment.answered {
    border-top-color: var(--completed-color, green);
    background: transparent !important;
    color: var(--main-button-bg-color) !important;
}
.listening-progress-segment.current {
    color: var(--app--font-color);
    background: transparent;
    transform: none;
    box-shadow: none;
    outline: 2px solid var(--main-button-bg-color);
    outline-offset: 0;
    border-radius: 1px;
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) {
    background: var(--footer--background);
    border-top: 1px solid var(--footer--selected-border);
    box-shadow: none;
    height: auto;
    min-height: 62px;
    align-items: flex-start;
    padding: 2px 20px 6px;
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .bar-section-info,
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) .bar-section-tools {
    display: none;
}
#bottomControlBar.exam-bottom-mode:not(.listening-bottom-mode) #navigationContainer {
    width: 100%;
    height: auto;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 18px;
    overflow: hidden;
}
.reading-progress-wrapper {
    flex: 1 1 auto;
    display: flex;
    gap: 18px;
    overflow: hidden;
    padding-bottom: 0;
    align-items: flex-start;
}
.reading-part-block {
    flex: 1 1 0;
    min-width: 0;
    padding-top: 0;
}
.reading-part-block.active {
    flex: 3.2 1 0;
    min-width: 0;
}
.reading-part-block.active .reading-part-topline {
    background: transparent;
    height: 0;
    margin-bottom: 0;
}
.reading-part-block.active .reading-part-fill {
    width: 0 !important;
}
.reading-part-topline {
    height: 3px;
    background: var(--footer--progress-bar-background, #f2f2f2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}
.reading-part-fill {
    height: 100%;
    width: 0;
    background: var(--footer--progress-bar-fill-color, #2a6c96);
    transition: width 0.2s ease;
}
.reading-part-row {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    min-width: 0;
    min-height: 44px;
}
.reading-part-block .reading-part-done {
    color: var(--completed-color, green);
    margin-right: 4px;
}
.reading-part-block.active .reading-part-btn {
    color: var(--app--font-color);
    text-decoration: none;
}
.reading-part-btn {
    border: none;
    background: transparent;
    color: var(--app--font-color);
    font-weight: 700;
    padding: 0;
    margin: 0;
    box-shadow: none;
    line-height: 1.1;
    font-size: 1rem;
    cursor: pointer;
}
.reading-part-btn:hover:not(:disabled) {
    background: transparent;
    color: var(--main-button-bg-color);
    box-shadow: none;
}
.reading-part-meta {
    color: var(--app--label-color);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0;
}
.reading-part-block.active .reading-part-meta {
    display: none;
}
.reading-question-strip {
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
    align-items: flex-end;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    margin-top: 0;
}
.reading-part-block:not(.active) .reading-question-strip {
    display: none;
}
.reading-progress-segment {
    border: none;
    background: transparent;
    color: var(--app--label-color);
    padding: 0 7px;
    min-width: 24px;
    border-top: 3px solid var(--footer--selected-border);
    border-radius: 0;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
}
.reading-progress-segment.answered {
    border-top-color: var(--completed-color, green);
    background: transparent !important;
    color: var(--main-button-bg-color) !important;
}
.reading-progress-segment.current {
    color: var(--app--font-color) !important;
    background: transparent;
    transform: none;
    box-shadow: none;
    outline: 2px solid var(--main-button-bg-color);
    outline-offset: 0;
    border-radius: 1px;
}
.reading-progress-segment.marked-for-review {
    box-shadow: inset 0 -3px #b45309;
}
.reading-review-toggle {
    flex: none;
    min-height: 32px;
    padding: 4px 9px;
    border: 1px solid currentColor;
    border-radius: 4px;
    background: transparent;
    color: var(--app--font-color);
    font: inherit;
    cursor: pointer;
}
.reading-review-toggle[aria-pressed="true"] {
    background: #fef3c7;
    color: #78350f;
}
.reading-review-toggle:disabled { opacity: .5; cursor: default; }
.reading-part-switch-controls {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    white-space: nowrap;
}
.reading-part-switch-btn {
    width: 32px;
    height: 28px;
    border: 1px solid var(--footer--selected-border);
    border-radius: 4px;
    background: var(--footer--question-background);
    color: var(--app--font-color);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 2px;
}
.reading-part-switch-btn:hover:not(:disabled) {
    background: var(--resize-btn-bg-hover);
}
.reading-part-switch-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
#app.admin-workbench-open .test-view,
#app.admin-workbench-open .test-view-single,
#app.admin-workbench-open .test-view-writing {
    margin-left: 420px;
    width: calc(100% - 420px);
}
#app.admin-workbench-open ~ #bottomControlBar {
    padding-left: 430px;
}
/* In style.css (ADD this entire block to the very end) */

/* ====================================================== */
/*          12. ADVANCED CONTENT STYLES                   */
/* ====================================================== */

ul, ol {
  padding-left: 25px;
  margin-bottom: 1rem;
}
ul { list-style-type: disc; } 
ol { list-style-type: decimal; }

/* Improved Table Styling */
.question-block table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  font-size: 0.95em;
}

.question-block th {
  background-color: var(--bg-main);
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.question-block th,
.question-block td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--border-color);
}

.question-block tbody tr:hover {
  background-color: var(--primary-light);
}

.question-block tbody tr:last-child td {
  border-bottom: 1px solid var(--border-color);
}

/* Styles for Two-Column Layouts */
.two-column-layout {
    display: flex;
    gap: 2rem;
    margin: 1.5rem 0;
}
.column-left, .column-right {
    flex: 1;
}

.diagram-container {
  position: relative;
  max-width: 800px;
  margin: 1.5rem auto;
}

.diagram-container img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.diagram-label {
  position: absolute;
  max-width: 50%;
  padding: 0;
  border: none;
}

.test-map {
  max-width: 700px;
  width: 100%;
  display: block;
  margin: 1.5rem auto;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

@media (max-width: 768px) {
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
  #adminPlaygroundView .admin-test-selector-grid {
    grid-template-columns: 1fr;
  }
  .review-item {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .review-score-panel,
  .review-item button {
    grid-column: 2;
    justify-self: start;
  }
  .review-detail-summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .review-score-circle {
    align-self: center;
  }
  .admin-json-workbench {
    width: 100%;
    height: 50vh;
    top: auto;
    bottom: 68px;
    border-right: none;
    border-top: 1px solid #334155;
  }
  #app.admin-workbench-open .test-view,
  #app.admin-workbench-open .test-view-single,
  #app.admin-workbench-open .test-view-writing {
    margin-left: 0;
    width: 100%;
    margin-bottom: 50vh;
  }
  #app.admin-workbench-open ~ #bottomControlBar {
    padding-left: 0.5rem;
  }
}

/* ================================
   PLATFORM TYPOGRAPHY REFRESH
================================== */
body, button, input, textarea, select {
  font-family: var(--platform-font-body, "Plus Jakarta Sans", system-ui, sans-serif);
  letter-spacing: 0;
}
button, input, textarea, select {
  font: inherit;
}
h1, h2, h3, h4, h5, h6 {
  letter-spacing: 0;
}

/* Softer exam typography: neutral, readable, and less visually heavy. */
.tutorial-card,
.tutorial-card button,
.teaching-tile,
.test-selector-container,
#readingText,
#allQuestionsWrapper,
#listeningView,
#listeningQuestionsContainer,
#listeningQuestionsContainer h2,
#listeningQuestionsContainer h3,
#listeningQuestionsContainer h4,
#listeningQuestionsContainer h5,
#listeningQuestionsContainer strong,
#listeningQuestionsContainer b,
.question-number-marker {
  font-family: "Times New Roman", Times, serif;
}

.tutorial-card h2,
.teaching-tile strong,
#readingText h2,
#readingText h3,
#readingText h4,
#allQuestionsWrapper h2,
#allQuestionsWrapper h3,
#allQuestionsWrapper h4,
#listeningQuestionsContainer h2,
#listeningQuestionsContainer h3,
#listeningQuestionsContainer h4,
#listeningQuestionsContainer h5 {
  font-weight: 600 !important;
}

#readingText,
.passage-panel {
  line-height: 1.72;
}

#allQuestionsWrapper,
#listeningQuestionsContainer {
  line-height: 1.62;
}

.question-number-marker {
  font-weight: 600;
}

/* Override font declarations embedded in imported database HTML. */
#readingText *,
#allQuestionsWrapper *,
#listeningQuestionsContainer * {
  font-family: "Times New Roman", Times, serif !important;
}
