/* exam.css — main exam-taking interface. Desktop-first (matches real
   IELTS computer-delivered layout), responsive down to 320px. */

/* The exam is a fixed-viewport app (topbar / content / audio / navigator
   stacked in a column), not a scrolling page — flexbox column so the
   audio bar can grow (Practice Mode adds a second row) without needing
   hand-calculated absolute-position math. */
/* Fixed-viewport shell (topbar + flex:1 main + optional bottom nav, no page
   scroll — only the panes inside scroll). Scoped to body.exam-shell rather
   than a blanket `body` selector: writing-check.html also loads exam.css
   (for .icon-btn/.modal) but has a normal-scrolling chooser view alongside
   its split-pane editor view, so it toggles this class at runtime instead
   of always having it (see public/js/writing-check.js). */
html { height: 100%; }
body.exam-shell { height: 100%; overflow: hidden; display: flex; flex-direction: column; }

/* ---------------- TOP BAR ---------------- */
.exam-topbar {
  height: var(--topbar-height);
  background: var(--ielts-navy);
  color: var(--on-dark-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; overflow: hidden; }
.topbar-logo { font-weight: 800; font-size: 18px; letter-spacing: 0.04em; flex-shrink: 0; }
.topbar-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.3); flex-shrink: 0; }
.topbar-candidate, .topbar-test {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mode-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.timer-wrap { display: flex; align-items: center; gap: 6px; }
.timer-display {
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 700;
  min-width: 62px;
  text-align: right;
}
.timer-display.warning { color: #ffb020; }
.timer-display.critical { color: #ff5c5c; animation: pulse 1s infinite; }
.timer-display.hidden-timer { visibility: hidden; }
@keyframes pulse { 50% { opacity: 0.4; } }

.icon-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  color: var(--on-dark-text);
  border-radius: 6px;
  width: 30px; height: 30px;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(255,255,255,0.12); }

/* ---------------- MAIN CONTENT ---------------- */
.exam-main {
  flex: 1 1 auto;
  min-height: 0; /* required for the child to actually scroll inside a flex column */
  overflow-y: auto;
  background: var(--ielts-bg);
}
.exam-content-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}
.content-heading h1 {
  font-size: 20px;
  margin: 0 0 4px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.content-heading h1 span { font-weight: 400; color: var(--ielts-text-secondary); font-size: 16px; }
.part-context { color: var(--ielts-text); font-size: 14.5px; line-height: 1.5; margin: 0 0 16px; }

.question-group { background: var(--ielts-white); border: 1px solid var(--ielts-border); border-radius: 8px; padding: 16px 20px; margin-bottom: 18px; }
.group-instruction { font-weight: 600; margin: 0 0 14px; font-size: 14.5px; }
.group-image-wrap { margin: 0 0 16px; text-align: center; }
.group-image-wrap img { max-width: 100%; border: 1px solid var(--ielts-border); border-radius: 6px; }

.q-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 6px; border-radius: 6px; scroll-margin-top: 16px; }
.q-row.flash-highlight, .table-blank.flash-highlight { animation: flashBg 1.4s ease; }
@keyframes flashBg { 0% { background: #fff3cd; } 100% { background: transparent; } }
/* Dark mode: the light-yellow flash would briefly wash out near-white
   body text, so flash with a dark-mode-safe amber tint instead. */
body.dark-theme .q-row.flash-highlight,
body.dark-theme .table-blank.flash-highlight,
body.dark-theme .note-item.flash-highlight { animation-name: flashBgDark; }
@keyframes flashBgDark { 0% { background: #4a3f1a; } 100% { background: transparent; } }

/* Real multi-column table for table_completion, matching the source book. */
.table-completion-wrap { margin-top: 4px; }
.completion-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 480px; }
.completion-table th, .completion-table td { border: 1px solid var(--ielts-border); padding: 8px 10px; text-align: left; vertical-align: top; }
.completion-table th { background: var(--ielts-bg); font-weight: 700; }
.table-blank { display: inline-flex; align-items: center; gap: 2px; border-radius: 4px; scroll-margin-top: 16px; }
.table-q-num { font-size: 10px; font-weight: 700; color: var(--ielts-text-muted); }
input.table-inline-answer {
  width: 130px;
  border: none;
  border-bottom: 2px solid var(--ielts-blue);
  background: var(--ielts-blue-light);
  color: var(--ielts-text);
  font-size: 14.5px;
  padding: 3px 6px;
}
.q-num-badge {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ielts-navy);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.q-body { flex: 1; min-width: 0; }
.q-text { font-size: 14.5px; margin-bottom: 6px; line-height: 1.5; }
.q-text input.inline-answer {
  border: none;
  border-bottom: 2px solid var(--ielts-blue);
  background: var(--ielts-blue-light);
  padding: 3px 6px;
  font-size: 14.5px;
  min-width: 140px;
  margin: 0 2px;
}
.answer-input {
  width: 100%;
  max-width: 320px;
  padding: 8px 10px;
  border: 1px solid var(--ielts-border);
  border-radius: 6px;
  font-size: 14.5px;
  background: var(--ielts-white);
  color: var(--ielts-text);
}
.answer-input:focus, input.inline-answer:focus { outline: 2px solid var(--ielts-blue); }

.option-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.option-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.option-item input { width: 16px; height: 16px; flex-shrink: 0; }
.option-item label { cursor: pointer; }

select.answer-select {
  padding: 7px 10px;
  border: 1px solid var(--ielts-border);
  border-radius: 6px;
  font-size: 14px;
  max-width: 100%;
  background: var(--ielts-white);
  color: var(--ielts-text);
}

.review-flag-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--ielts-border);
  border-radius: 6px;
  font-size: 12px;
  padding: 4px 8px;
  color: var(--ielts-text-muted);
  align-self: flex-start;
  margin-top: 2px;
}
.review-flag-btn.active { background: #fff1e0; border-color: var(--ielts-review); color: var(--ielts-review); font-weight: 700; }

/* Multi-select checkbox group (choose TWO letters etc.) */
.checkbox-group-note { font-size: 12.5px; color: var(--ielts-text-muted); margin: -6px 0 8px; }

/* Highlighting + note-taking */
/* Highlight pen colors are fixed pastels regardless of theme, so the text
   sitting on them must stay dark in both light and dark mode — otherwise
   dark-mode's near-white body text becomes unreadable on a light marker. */
mark.user-highlight { background: #fff59d; color: #1b1b24; padding: 0 1px; border-radius: 2px; cursor: pointer; }
mark.user-note {
  background: var(--ielts-blue-light);
  border-bottom: 2px dotted var(--ielts-blue);
  padding: 0 1px;
  border-radius: 2px;
  cursor: pointer;
}
mark.user-note::after {
  content: "";
  display: inline-block;
  width: 10px; height: 10px;
  margin-left: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B8DEF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3v4a1 1 0 0 0 1 1h4'/%3E%3Cpath d='M17 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2Z'/%3E%3C/svg%3E") center/contain no-repeat;
  vertical-align: middle;
}

.notes-count {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--ielts-review);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  padding: 0 2px;
}
.notes-count.hidden { display: none; }
#notesBtn { position: relative; }

.note-item { background: var(--ielts-bg); border: 1px solid var(--ielts-border); border-radius: 6px; padding: 10px 12px; }
.note-item .note-quote { font-size: 12.5px; color: var(--ielts-text-muted); font-style: italic; margin-bottom: 4px; }
.note-item .note-text { font-size: 13.5px; white-space: pre-wrap; }
.note-item .note-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.note-item .note-part-label { font-size: 11px; color: var(--ielts-text-muted); }
.note-item .note-delete-btn { background: transparent; border: none; color: var(--ielts-incorrect); font-size: 12px; cursor: pointer; }

/* ---------------- AUDIO BAR ---------------- */
.audio-bar-wrap { flex-shrink: 0; background: var(--ielts-white); }
.audio-bar {
  height: 56px;
  border-top: 1px solid var(--ielts-border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
}
.audio-toggle-btn.hidden { display: none; }
.speed-select.hidden { display: none; }
.speed-select {
  flex-shrink: 0;
  padding: 5px 6px;
  border-radius: 6px;
  border: 1px solid var(--ielts-border);
  font-size: 13px;
  background: var(--ielts-white);
  color: var(--ielts-text);
}

/* Practice Mode extra row: jump-to-part + custom time range. */
.practice-controls.hidden { display: none; }
.practice-controls {
  border-top: 1px solid var(--ielts-border);
  padding: 8px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--ielts-bg);
}
.practice-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.practice-row.hidden { display: none; }
.practice-label { font-size: 12px; font-weight: 700; color: var(--ielts-text-muted); flex-shrink: 0; }
.part-jump-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.part-jump-btn {
  border: 1px solid var(--ielts-border);
  background: var(--ielts-white);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 600;
}
.part-jump-btn:hover { background: var(--ielts-blue-light); }
.practice-mini-btn { padding: 5px 12px; font-size: 12.5px; }
.range-time-input {
  width: 64px;
  padding: 5px 6px;
  border: 1px solid var(--ielts-border);
  border-radius: 6px;
  font-size: 12.5px;
  text-align: center;
  background: var(--ielts-white);
  color: var(--ielts-text);
}
.practice-hint { font-size: 11.5px; color: var(--ielts-text-muted); }
.audio-progress-wrap { flex: 1; }
.audio-progress-track { height: 6px; border-radius: 3px; background: var(--ielts-border); cursor: default; position: relative; }
.audio-progress-track.seekable { cursor: pointer; }
.audio-progress-fill { height: 100%; border-radius: 3px; background: var(--ielts-blue); width: 0%; }
.audio-time { font-size: 12px; color: var(--ielts-text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.audio-volume-wrap { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.audio-volume-wrap input[type=range] { width: 90px; }

/* ---------------- QUESTION NAVIGATOR ---------------- */
.question-nav {
  flex-shrink: 0;
  height: var(--navbar-height);
  background: var(--ielts-white);
  border-top: 1px solid var(--ielts-border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
}
.collapse-nav-btn { display: none; }
.nav-scroll {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 0;
}
.nav-part-group { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.nav-part-group.current-part {
  background: var(--ielts-bg);
  border-radius: 8px;
  padding: 4px 10px;
}
.nav-part-label { font-size: 11px; font-weight: 700; color: var(--ielts-text-muted); margin-right: 2px; }
.nav-q-btn {
  position: relative;
  width: 30px; height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--ielts-border);
  background: var(--ielts-white);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ielts-text);
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.nav-q-btn:hover { transform: translateY(-1px); border-color: var(--ielts-blue); }
.nav-q-btn.answered { background: var(--ielts-answered); border-color: var(--ielts-answered); color: #fff; }
.nav-q-btn.current { outline: 3px solid var(--ielts-current); outline-offset: 1px; }
.nav-q-btn.review::after {
  content: "";
  position: absolute;
  top: -3px; right: -3px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ielts-review);
  border: 1px solid #fff;
}

/* Collapsed (non-active) Part/Passage — "Part 2  ·  3 of 10" summary that
   jumps there on click, matching the real exam's bottom bar. */
.nav-part-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.nav-part-summary:hover { background: var(--ielts-bg); }
.nav-part-summary .nav-part-label { margin-right: 0; }
.nav-part-progress { font-size: 12px; font-weight: 600; color: var(--ielts-text); }

.nav-controls { display: flex; gap: 8px; flex-shrink: 0; }
.nav-controls .btn { white-space: nowrap; padding: 8px 14px; font-size: 13px; transition: transform 0.12s ease, opacity 0.12s ease; }
.nav-controls .btn:not(:disabled):hover { transform: translateY(-1px); }
.nav-icon-btn {
  width: 38px; height: 38px;
  flex-shrink: 0;
  border-radius: 8px;
  border: none;
  background: var(--ielts-navy);
  color: #fff;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.nav-icon-btn:hover:not(:disabled) { transform: translateY(-1px); }
.nav-icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------------- CONTEXT MENU ---------------- */
.context-menu {
  position: fixed;
  z-index: 200;
  background: var(--ielts-navy);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.context-menu.hidden { display: none; }
.context-menu button {
  display: block;
  width: 100%;
  background: transparent;
  color: #fff;
  border: none;
  padding: 9px 16px;
  font-size: 13px;
  text-align: left;
}
.context-menu button:hover { background: rgba(255,255,255,0.15); }

/* ---------------- SELECTION TOOLBAR (Highlight / Note) ---------------- */
.selection-toolbar {
  position: absolute;
  z-index: 210;
  display: flex;
  background: var(--ielts-white);
  border: 1px solid var(--ielts-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.selection-toolbar.hidden { display: none; }
.selection-toolbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  color: var(--ielts-text);
  border: none;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.selection-toolbar button:hover { background: var(--ielts-bg); }
.selection-toolbar button + button { border-left: 1px solid var(--ielts-border); }
.sel-toolbar-icon { font-size: 17px; line-height: 1; }

/* ---------------- NOTES PANEL (toggleable right-side drawer) ---------------- */
.notes-panel {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 90vw;
  background: var(--ielts-white);
  border-left: 1px solid var(--ielts-border);
  box-shadow: -4px 0 16px rgba(0,0,0,0.12);
  z-index: 190;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.2s ease;
}
.notes-panel.hidden { transform: translateX(100%); pointer-events: none; }
.notes-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--ielts-border); flex-shrink: 0; }
/* .icon-btn defaults to white-on-transparent for the dark topbar; this
   panel has a light background, so it needs its own dark-on-light look. */
.notes-panel-close-btn {
  border-color: var(--ielts-border);
  color: var(--ielts-text);
}
.notes-panel-close-btn:hover { background: var(--ielts-bg); }
.notes-panel-header h3 { margin: 0; font-size: 15px; font-family: var(--font-heading); }
.notes-panel-compose { padding: 14px 16px; border-bottom: 1px solid var(--ielts-border); flex-shrink: 0; }
.notes-panel-compose.hidden { display: none; }
.notes-panel-compose textarea {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--ielts-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13.5px;
  resize: vertical;
  background: var(--ielts-white);
  color: var(--ielts-text);
}
.notes-panel-compose-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.notes-panel-list { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.note-item.flash-highlight { animation: flashBg 1.4s ease; }

@media (max-width: 480px) {
  .notes-panel { width: 100%; max-width: 100%; }
}

/* Modal box structure lives in base.css (shared with index.html). */
.settings-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--ielts-border); }
.settings-row:last-child { border-bottom: none; }
.settings-row > label { font-weight: 600; font-size: 13.5px; }

/* Font-size segmented control (A / A+ / A++) */
.segmented { display: flex; border: 1px solid var(--ielts-border); border-radius: 8px; overflow: hidden; }
.segmented button {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--ielts-text-muted);
  border-left: 1px solid var(--ielts-border);
  transition: background-color 0.12s ease, color 0.12s ease;
}
.segmented button:first-child { border-left: none; }
.segmented button:hover { background: var(--ielts-bg); }
.segmented button.active { background: var(--unio-dark); color: #fff; }

/* Dark/Light theme switch — a real sliding toggle, sun/moon icons at each end. */
.theme-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--ielts-text-muted);
}
.theme-switch-track {
  position: relative;
  width: 42px; height: 24px;
  border-radius: 12px;
  background: var(--ielts-border);
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}
.theme-switch-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}
.theme-switch.on .theme-switch-track { background: var(--unio-dark); }
.theme-switch.on .theme-switch-thumb { transform: translateX(18px); }
.theme-switch-icon { width: 15px; height: 15px; }

/* Highlight pen color swatches */
.color-swatch-row { display: flex; gap: 8px; }
.color-swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.active { border-color: var(--unio-dark); }
body.dark-theme .color-swatch.active { border-color: #fff; }

/* Help modal — icon + short heading + description rows instead of a wall of text. */
.help-section { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ielts-border); }
.help-section:last-of-type { border-bottom: none; }
.help-section-icon {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--ielts-blue-light);
  color: var(--unio-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.help-section h4 { margin: 0 0 4px; font-size: 14px; }
.help-section p { margin: 0; font-size: 13px; color: var(--ielts-text-muted); line-height: 1.5; }

/* Font-size setting applied on <body> — covers question text, tables,
   options and the reading passage so nothing is left at a fixed size. */
body.font-large .q-text,
body.font-large .q-num-badge,
body.font-large .group-instruction,
body.font-large .completion-table,
body.font-large .table-q-num,
body.font-large .option-item,
body.font-large .answer-input,
body.font-large select.answer-select,
body.font-large .part-context,
body.font-large .passage-body,
body.font-large .q-text input.inline-answer,
body.font-large input.table-inline-answer { font-size: 116%; }

body.font-xlarge .q-text,
body.font-xlarge .group-instruction,
body.font-xlarge .completion-table,
body.font-xlarge .table-q-num,
body.font-xlarge .option-item,
body.font-xlarge .answer-input,
body.font-xlarge select.answer-select,
body.font-xlarge .part-context,
body.font-xlarge .passage-body,
body.font-xlarge .q-text input.inline-answer,
body.font-xlarge input.table-inline-answer { font-size: 132%; }

/* ================= RESPONSIVE ================= */

/* Laptop */
@media (max-width: 1024px) {
  .exam-content-inner { max-width: 100%; padding: 16px; }
  .topbar-test { max-width: 160px; }
}

/* Tablet — collapse the question grid behind a toggle, shrink topbar text */
@media (max-width: 768px) {
  :root { --navbar-height: 64px; }
  .topbar-candidate { display: none; }
  .topbar-test { max-width: 120px; font-size: 12px; }
  .collapse-nav-btn {
    display: block;
    flex-shrink: 0;
    background: var(--ielts-white);
    border: 1px solid var(--ielts-border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
  }
  .question-nav { flex-wrap: wrap; height: auto; padding: 8px 10px; }
  .nav-scroll {
    order: 3;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
  }
  .question-nav.nav-expanded .nav-scroll { max-height: 140px; overflow-y: auto; }
  .nav-controls { order: 2; margin-left: auto; }
  .audio-bar { padding: 0 10px; gap: 8px; }
  .audio-volume-wrap input[type=range] { width: 60px; }
  .practice-controls { padding: 8px 10px; }
}

/* Mobile */
@media (max-width: 480px) {
  .exam-topbar { padding: 0 10px; }
  .topbar-logo { font-size: 15px; }
  .topbar-test { display: none; }
  .mode-badge { display: none; }
  .timer-display { font-size: 14px; min-width: 50px; }
  .icon-btn { width: 26px; height: 26px; font-size: 12px; }
  .exam-content-inner { padding: 12px; }
  .content-heading h1 { font-size: 17px; }
  .question-group { padding: 12px 14px; }
  .answer-input, .q-text input.inline-answer { max-width: 100%; width: 100%; }
  .nav-controls { flex-wrap: wrap; gap: 6px; }
  .nav-controls .btn { padding: 8px 10px; font-size: 12px; }
  .audio-time { display: none; }
  .speed-select { font-size: 12px; padding: 4px; }
  .practice-label { width: 100%; }
  .part-jump-btn, .practice-mini-btn { padding: 6px 8px; font-size: 11.5px; }
}

@media (max-width: 340px) {
  .nav-controls #prevPartBtn, .nav-controls #nextPartBtn { padding: 8px; }
}
