/* Tactile Console & Lab Workbench System (Refactored from liquid-glass)
   Dieter Rams / Braun / Teenage Engineering aesthetic:
   Strict 0px border-radius, 1px solid #1A1A1A borders, sharp tactile drop shadows,
   warm paper palette, mono accents, zero blur, zero gradient glare. */

:root {
  --glass-surface: #FAF8F5;
  --glass-strong: #FAF8F5;
  --glass-stroke: #1A1A1A;
  --glass-edge: #1A1A1A;
  --glass-glow: transparent;
  --glass-shadow: 4px 4px 0px #1A1A1A;
  --glass-inner: none;
}

:root[data-theme="dark"] {
  --glass-surface: #21201D;
  --glass-strong: #21201D;
  --glass-stroke: #3D3B37;
  --glass-edge: #3D3B37;
  --glass-glow: transparent;
  --glass-shadow: 4px 4px 0px #000000;
  --glass-inner: none;
}

/* De-AI-ify: No gradient glare overlays */
.topbar::before,
.exercise-submit-bar::before,
.lookup-dialog::before,
.resume-dialog::before {
  display: none !important;
}

.brand-mark {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

:root[data-theme="dark"] .brand-mark {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Ẩn thanh trang chủ và nút Dynamic Island khi đang tải dữ liệu hoặc ở trang đăng nhập */
body.auth-page .topbar,
body.auth-page #islandDock,
body.is-loading .topbar,
body.is-loading #islandDock,
body:has(#splashPreloader:not(.fade-out)) .topbar,
body:has(#splashPreloader:not(.fade-out)) #islandDock,
body:has(.loading-panel) .topbar,
body:has(.loading-panel) #islandDock {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Tactile Dynamic Console Topbar */
.topbar {
  top: 10px;
  width: min(66px, calc(100% - 24px));
  min-height: 60px;
  margin: 10px auto 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--paper);
  box-shadow: 4px 4px 0px var(--line);
  justify-content: center;
  align-items: center;
  gap: 0;
  isolation: isolate;
  transition: width .25s ease, box-shadow .15s ease;
}

:root[data-theme="dark"] .topbar {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: 4px 4px 0px #000000;
}

/* Island Stats: Lab Counter Badges */
.island-stats {
  position: absolute;
  top: 50%;
  display: flex;
  gap: 8px;
  transform: translateY(-50%);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}
.island-stats[hidden] { display: none; }
.island-stats-left { right: calc(100% + 12px); }
.island-stats-right { left: calc(100% + 12px); }

.island-stat {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 150px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 0px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0px var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}
.island-stat strong { color: var(--ink); font-size: 15px; font-family: var(--font-mono); }
.island-stats-left strong { color: var(--moss-green); }
.island-stats-right strong { color: var(--earth-yellow); }
.island-stat-icon { font-size: 14px; line-height: 1; }
.island-stat-unit { color: var(--muted); font-size: 10px; font-family: var(--font-mono); }
:root[data-theme="dark"] .island-stat {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: 2px 2px 0px #000000;
}

.topbar:hover .island-stats,
.topbar:has(:focus-visible) .island-stats,
.topbar[data-open="true"] .island-stats { display: none; }

.topbar .brand { min-width: 0; flex: 0 0 auto; text-decoration: none; }
.topbar .brand > span:last-child {
  display: none;
  min-width: 0;
  white-space: nowrap;
}
.topbar .brand strong,
.topbar .brand small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar:hover .brand > span:last-child,
.topbar:has(:focus-visible) .brand > span:last-child,
.topbar[data-open="true"] .brand > span:last-child {
  display: block;
}

.topbar nav {
  flex: 0 1 0;
  width: 0;
  min-width: 0;
  max-width: 0;
  gap: 6px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: max-width .3s ease, opacity .2s ease, visibility 0s linear .25s;
}
#mainNav > [hidden] { display: none !important; }

/* Mechanical Navigation Buttons */
.topbar nav > a,
.nav-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 0px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0px var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .05s ease, box-shadow .05s ease, background .1s ease;
}

.topbar nav > a:hover,
.nav-button:hover,
.room-nav.active {
  color: var(--ink);
  background: var(--paper-hover);
  border-color: var(--line);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--line);
}

.topbar nav > a:active,
.nav-button:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--line);
}

.nav-button span:not([aria-hidden]) {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0px;
  color: var(--paper);
  background: var(--ink);
  font-size: 11px;
  font-family: var(--font-mono);
}

.theme-toggle { width: 38px; padding: 5px; font-size: 16px; border-radius: 0px; }
.user-nav { border-color: var(--line); }

.island-toggle {
  display: none;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0px var(--line);
  cursor: pointer;
  font: 700 20px/1 var(--font-mono);
  transition: transform .05s ease, box-shadow .05s ease, background .1s ease;
}
.island-toggle:hover { background: var(--paper-hover); }
.island-toggle:active { transform: translate(2px, 2px); box-shadow: 0px 0px 0px; }
.island-toggle span { display: block; transform: translateY(-1px); transition: transform .25s ease; }
.topbar[data-open="true"] .island-toggle span { transform: rotate(180deg); }
.island-toggle:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }

.study-room-bar { top: var(--island-sticky-bottom, 84px); }

/* Desktop Expansion on Hover/Focus */
@media (min-width: 651px) and (hover: hover) and (pointer: fine) {
  .topbar:hover,
  .topbar:has(:focus-visible),
  .topbar[data-open="true"] {
    width: min(1220px, calc(100% - 24px));
    justify-content: space-between;
  }

  .topbar:hover nav,
  .topbar:has(:focus-visible) nav,
  .topbar[data-open="true"] nav {
    flex: 0 1 auto;
    width: auto;
    max-width: 950px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
}

/* Mobile Console Layout */
@media (max-width: 650px), (hover: none) {
  .topbar {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: center;
    gap: 0 6px;
    width: min(96px, calc(100% - 96px));
    min-height: 56px;
    padding: 6px 8px;
    border-radius: 0px;
  }

  .topbar:not([data-open="true"]) .brand > span:last-child { display: none !important; }
  .topbar[data-open="true"] {
    grid-template-columns: minmax(0, 1fr) auto;
    width: calc(100% - 16px);
  }
  .topbar[data-open="true"] .brand > span:last-child { display: block !important; }

  .topbar .brand { grid-column: 1; padding: 0; }
  .topbar .brand strong { display: block; max-width: 195px; font-size: 12px; }
  .topbar .brand small { display: block; max-width: 195px; font-size: 9px; font-family: var(--font-mono); }
  .island-stats { gap: 4px; }
  .island-stats-left { right: calc(100% + 6px); }
  .island-stats-right { left: calc(100% + 6px); }
  .island-stat { gap: 2px; width: 56px; min-height: 38px; padding: 4px; font-size: 8px; }
  .island-stat strong { font-size: 10px; }
  .island-stat-icon { display: none; }
  .island-stat-label { display: none; }
  .island-stat-unit { font-size: 8px; }
  .island-stats-left .island-stat-label { display: inline; }
  .island-stats-right .island-stat-label { display: inline; }
  .island-toggle { display: block; grid-column: 2; }
  .topbar nav {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: none;
    max-height: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    scroll-snap-type: none;
    transition: max-height .3s ease, opacity .2s ease, visibility 0s linear .25s;
  }

  .topbar[data-open="true"] { width: calc(100% - 16px); }
  .topbar[data-open="true"] nav {
    max-height: 280px;
    padding: 9px 0 2px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .topbar nav > a,
  .topbar .nav-button { min-height: 38px; padding: 7px 10px; }
  .topbar .user-nav { border-left: 0; }
}

@media (max-width: 360px) {
  .island-stats-left .island-stat-label { display: none; }
  .island-stats-right .island-stat-label { display: none; }
  .island-stat { width: 40px; }
  .topbar .brand small { display: none; }
}

.topbar .nav-button :is(.nav-label-full, .nav-label-short) {
  display: inline;
  min-width: 0;
  height: auto;
  color: inherit;
  background: none;
  box-shadow: none;
}
.topbar .nav-label-short,
.topbar .nav-button .nav-label-short { display: none; }

/* Island Dock: Container for Dynamic Island + Lesson Control Tower */
.island-dock {
  display: contents;
}

.island-dock.lesson-mode,
body:has(.topbar.lesson-island) .island-dock {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 30;
  width: 60px;
  pointer-events: none;
  max-height: calc(100vh - 20px);
}

@media (min-width: 901px) {
  .island-dock.lesson-mode,
  body:has(.topbar.lesson-island) .island-dock {
    left: max(16px, calc((100vw - 1440px) / 2 + 16px));
  }
}

@media (max-width: 650px), (hover: none) {
  .island-dock.lesson-mode,
  body:has(.topbar.lesson-island) .island-dock {
    width: 56px;
  }
}

/* Lesson Island: Left Pinned Laboratory Controller */
.topbar.lesson-island {
  position: relative;
  top: auto;
  left: auto;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  width: 60px;
  height: auto;
  min-height: 60px;
  max-height: 60px;
  margin: 0;
  padding: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--paper);
  box-shadow: 4px 4px 0px var(--line);
  transition: width .25s ease, max-height .3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}
body:not(:has(.island-dock)) .topbar.lesson-island {
  position: fixed;
  top: 10px;
  left: 12px;
}
.topbar.lesson-island .island-stats { display: none; }
.topbar.lesson-island .brand { flex: 0 0 42px; justify-content: center; width: 100%; }
.topbar.lesson-island .brand-mark { flex: 0 0 42px; }
.topbar.lesson-island .brand > span:last-child { display: none; }
.topbar.lesson-island .island-toggle { display: none; }
.topbar.lesson-island .nav-label-full {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.topbar.lesson-island .nav-label-short,
.topbar.lesson-island .nav-button .nav-label-short { display: inline; }
.topbar.lesson-island nav {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  gap: 4px;
  width: 100%;
  max-width: none;
  max-height: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: max-height .3s ease, padding .3s ease, opacity .2s ease, visibility 0s linear .3s;
}
.topbar.lesson-island nav::-webkit-scrollbar { display: none; width: 0; height: 0; }
.topbar.lesson-island:is(:hover, :has(:focus-visible), [data-open="true"]) {
  width: min(88px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 20px));
}
.topbar.lesson-island:is(:hover, :has(:focus-visible), [data-open="true"]) nav {
  max-height: min(490px, calc(100vh - 82px));
  padding: 8px 0 0;
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
.topbar.lesson-island nav > *:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  gap: 4px;
  padding: 8px 5px;
  text-align: center;
}
.topbar.lesson-island nav > [hidden] { display: none; }
.topbar.lesson-island nav .user-nav { flex-wrap: wrap; border-left: 0; border-top: 1px solid var(--line); }
.topbar.lesson-island ~ #app,
.island-dock.lesson-mode ~ #app,
body:has(.topbar.lesson-island) #app { padding-top: 20px; }

/* In-Lesson Lab Sidebars: Under-island timer and score counters */
.lesson-room-layout .room-question-timer,
.lesson-room-layout .room-score-column {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0px;
  box-shadow: 3px 3px 0px var(--line);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme="dark"] .lesson-room-layout .room-question-timer,
:root[data-theme="dark"] .lesson-room-layout .room-score-column {
  background: var(--paper);
  border-color: var(--line);
  box-shadow: 3px 3px 0px #000000;
}

@media (min-width: 901px) {
  .topbar.lesson-island ~ #app:has(.lesson-room-layout),
  .island-dock.lesson-mode ~ #app:has(.lesson-room-layout),
  body:has(.topbar.lesson-island) #app:has(.lesson-room-layout) {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 10px 16px 40px;
  }
}
@media (max-width: 650px), (hover: none) {
  .topbar.lesson-island { width: 56px; }
  .topbar.lesson-island .brand-mark { flex: 0 0 38px; width: 38px; height: 38px; }
}

/* Tactile Workbench Cards & Interactive Elements */
.hero {
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 4px 4px 0px var(--line);
}
.hero h1 { color: var(--ink); font-family: var(--font-serif); }
.hero p { color: var(--muted); }
.hero .eyebrow { color: var(--moss-green); font-family: var(--font-mono); }
:root[data-theme="dark"] .hero {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: 4px 4px 0px #000000;
}

.hero .metric {
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--paper);
  box-shadow: 2px 2px 0px var(--line);
  font-family: var(--font-mono);
}

.home-search-panel,
.set-card {
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--paper);
  box-shadow: 4px 4px 0px var(--line);
}
:root[data-theme="dark"] .set-card {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: 4px 4px 0px #000000;
}

.search-box {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 0px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: inset 1px 1px 0px rgba(0,0,0,.08);
  font-family: var(--font-sans);
}
:root[data-theme="dark"] .search-box {
  color: var(--ink);
  background: var(--paper);
  box-shadow: inset 1px 1px 0px rgba(0,0,0,.4);
}

/* Mechanical Action Buttons */
.primary-link,
.primary-button {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 2px 2px 0px var(--line);
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: transform .05s ease, box-shadow .05s ease, background .1s ease;
}
.primary-link:hover,
.primary-button:hover {
  background: var(--moss-green);
  color: #ffffff;
  border-color: var(--line);
  box-shadow: 3px 3px 0px var(--line);
}
.primary-link:active,
.primary-button:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--line);
}

:root[data-theme="dark"] .primary-link,
:root[data-theme="dark"] .primary-button {
  background: var(--ink);
  color: var(--page);
  border-color: var(--line);
  box-shadow: 2px 2px 0px #000000;
}
:root[data-theme="dark"] .primary-link:hover,
:root[data-theme="dark"] .primary-button:hover {
  background: var(--moss-green);
  color: #ffffff;
}

.secondary-button {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 0px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0px var(--line);
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: transform .05s ease, box-shadow .05s ease, background .1s ease;
}
.secondary-button:hover {
  background: var(--paper-hover);
  box-shadow: 3px 3px 0px var(--line);
}
.secondary-button:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--line);
}

.audio-button {
  border: 1px solid var(--line);
  border-radius: 0px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0px var(--line);
  font-family: var(--font-mono);
  transition: transform .05s ease, box-shadow .05s ease, background .1s ease;
}
.audio-button:hover {
  background: var(--paper-hover);
  border-color: var(--line);
  box-shadow: 3px 3px 0px var(--line);
}
.audio-button:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--line);
}

:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .audio-button {
  border-color: var(--line);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0px #000000;
}

/* Breadcrumb & Progress */
.lesson-room-layout .breadcrumb a,
.lesson-room-layout .breadcrumb button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 0px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0px var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: none;
}
.lesson-room-layout .breadcrumb { align-items: center; margin-bottom: 17px; }
.lesson-top {
  gap: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.lesson-top strong { font-size: 11px; font-family: var(--font-mono); }
.progress-track {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--page);
  height: 8px;
}
.progress-track > span {
  border-radius: 0px;
  background: var(--moss-green);
}

/* Index Card Study Workbench */
.lesson-card {
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--paper);
  box-shadow: 4px 4px 0px var(--line);
}
:root[data-theme="dark"] .lesson-card {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: 4px 4px 0px #000000;
}

.lesson-card .choice-grid button {
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--paper);
  box-shadow: 2px 2px 0px var(--line);
  font-family: var(--font-sans);
  transition: transform .05s ease, box-shadow .05s ease, background .1s ease;
}
.lesson-card .choice-grid button:hover {
  background: var(--paper-hover);
  box-shadow: 3px 3px 0px var(--line);
}
.lesson-card .choice-grid button:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--line);
}
:root[data-theme="dark"] .lesson-card .choice-grid button {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
  box-shadow: 2px 2px 0px #000000;
}

.lesson-card .choice-grid button:focus-visible,
.topbar :is(a, button):focus-visible,
.lesson-room-layout .breadcrumb :is(a, button):focus-visible {
  outline: 2px solid var(--line);
  outline-offset: 2px;
}

.exam-lesson-card .exam-reading-passage,
.exam-lesson-card .exam-option-bank article {
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--paper);
  box-shadow: 2px 2px 0px var(--line);
}

/* Mechanical Submit Bar & Dialogs */
.exercise-submit-bar {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--paper);
  box-shadow: 4px 4px 0px var(--line);
  isolation: isolate;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme="dark"] .exercise-submit-bar {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: 4px 4px 0px #000000;
}

.lookup-dialog,
.resume-dialog {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--paper);
  box-shadow: 6px 6px 0px var(--line);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme="dark"] .lookup-dialog,
:root[data-theme="dark"] .resume-dialog {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: 6px 6px 0px #000000;
}

@media (prefers-reduced-motion: reduce) {
  .topbar,
  .topbar nav,
  .island-toggle span,
  .nav-button,
  .primary-button,
  .secondary-button { transition-duration: .01ms; }
}

/* ==========================================================================
   Tactile Lab Manual: Unified Lesson Control Hub & Typography Scaler
   Đồng thời điều chỉnh cỡ chữ của cả CÂU HỎI và PHẦN CÂU TRẢ LỜI
   ========================================================================== */

:root {
  --exam-font-scale: 1.15;
}

/* --------------------------------------------------------------------------
   1. PHẦN CÂU HỎI (Questions, Prompts, Passages, Stimulus)
   -------------------------------------------------------------------------- */

/* Tiêu đề & nội dung câu hỏi trắc nghiệm / tự luận */
.exam-question-prompt h2 {
  font-size: calc(clamp(20px, 2.6vw, 27px) * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.65 !important;
}

.exam-question-prompt p,
.exam-question-prompt .prompt-text {
  font-size: calc(16.5px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.65 !important;
}

.exam-question-prompt > span {
  font-size: calc(11px * var(--exam-font-scale, 1.15)) !important;
}

/* Ngữ liệu đọc (Đoạn văn đọc hiểu & Đề bài tóm tắt) */
.exam-reading-passage p {
  font-size: calc(16.5px * var(--exam-font-scale, 1.15)) !important;
  line-height: calc(2.15 * var(--exam-font-scale, 1.15)) !important;
}

.exam-reading-passage header strong {
  font-size: calc(11px * var(--exam-font-scale, 1.15)) !important;
}

.exam-group-passage p {
  font-size: calc(16.5px * var(--exam-font-scale, 1.15)) !important;
  line-height: calc(2.65 * var(--exam-font-scale, 1.15)) !important;
}

.exam-stimulus-text {
  font-size: calc(16px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.85 !important;
}

/* Câu hỏi phần nghe (Listening Questions & Transcripts) */
.exam-listening-question > p {
  font-size: calc(15px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.65 !important;
}

.exam-listening-question > header strong {
  font-size: calc(12px * var(--exam-font-scale, 1.15)) !important;
}

.exam-listening-question > header span {
  font-size: calc(10.5px * var(--exam-font-scale, 1.15)) !important;
}

.exam-listening-audio details p {
  font-size: calc(14.5px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.8 !important;
}

/* Câu hỏi bài học từ vựng (Lesson Prompts) */
.lesson-card .prompt-hanzi {
  font-size: calc(clamp(32px, 5.5vw, 56px) * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.35 !important;
}

.lesson-card .prompt-pinyin {
  font-size: calc(20px * var(--exam-font-scale, 1.15)) !important;
}

.lesson-card .prompt-meaning {
  font-size: calc(16px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.55 !important;
}

.lesson-card .task-prompt {
  font-size: calc(16px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.65 !important;
}

/* Câu hỏi khi xem lại kết quả */
.exam-review-prompt h2,
.exam-review-prompt {
  font-size: calc(18px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.65 !important;
}

.exam-review-stimulus p {
  font-size: calc(15.5px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.85 !important;
}

/* --------------------------------------------------------------------------
   2. PHẦN CÂU TRẢ LỜI (Answers, Choices, Inputs, Essays, Gaps)
   -------------------------------------------------------------------------- */

/* Lưới lựa chọn trắc nghiệm bài thi & bài học */
.choice-grid button,
.exam-choice-grid button {
  min-height: calc(76px * var(--exam-font-scale, 1.15)) !important;
  padding: calc(12px * var(--exam-font-scale, 1.15)) calc(15px * var(--exam-font-scale, 1.15)) !important;
  font-size: calc(16px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.55 !important;
}

.choice-grid button > strong,
.exam-choice-grid button > strong {
  font-size: calc(16.5px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.65 !important;
}

.choice-grid button > span,
.exam-choice-grid button > span {
  font-size: calc(13px * var(--exam-font-scale, 1.15)) !important;
  min-width: calc(24px * var(--exam-font-scale, 1.15)) !important;
}

/* Lựa chọn trắc nghiệm phần nghe */
.exam-listening-options button {
  min-height: calc(44px * var(--exam-font-scale, 1.15)) !important;
  padding: calc(8px * var(--exam-font-scale, 1.15)) calc(10px * var(--exam-font-scale, 1.15)) !important;
  grid-template-columns: calc(25px * var(--exam-font-scale, 1.15)) minmax(0, 1fr) !important;
  gap: calc(8px * var(--exam-font-scale, 1.15)) !important;
}

.exam-listening-options button > b {
  font-size: calc(14px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.6 !important;
}

.exam-listening-options button > span {
  width: calc(24px * var(--exam-font-scale, 1.15)) !important;
  height: calc(24px * var(--exam-font-scale, 1.15)) !important;
  font-size: calc(11px * var(--exam-font-scale, 1.15)) !important;
}

/* Ô lựa chọn điền khuyết trong đoạn văn */
.exam-group-passage select,
.exam-reading-passage select,
select[data-exam-gap] {
  font-size: calc(15px * var(--exam-font-scale, 1.15)) !important;
  padding: calc(3px * var(--exam-font-scale, 1.15)) calc(8px * var(--exam-font-scale, 1.15)) !important;
  height: auto !important;
  line-height: 1.5 !important;
}

/* Ô nhập bài viết tự luận & bài viết đã làm */
.exam-manual-form textarea,
#examManualAnswer,
.result-manual-editor textarea {
  font-size: calc(16px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.85 !important;
  font-family: var(--font-hanzi, "Noto Serif SC", "SimSun", serif) !important;
}

.writing-char-counter {
  font-size: calc(12.5px * var(--exam-font-scale, 1.15)) !important;
}

.exam-review-writing-essay .writing-essay-body {
  font-size: calc(16.5px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.9 !important;
}

/* Ô nhập chữ Hán & ghép thẻ bài học */
#hanziInput,
.hanzi-input-field {
  font-size: calc(28px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.4 !important;
}

.arrange-tiles button,
.arrange-slot,
.matching-col button {
  font-size: calc(16px * var(--exam-font-scale, 1.15)) !important;
}

/* Phần câu trả lời & giải thích khi xem lại kết quả */
.exam-review-options li {
  font-size: calc(15px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.65 !important;
}

.exam-review-options li strong {
  font-size: calc(15.5px * var(--exam-font-scale, 1.15)) !important;
}

.exam-review-options li span {
  font-size: calc(15px * var(--exam-font-scale, 1.15)) !important;
}

.exam-review-answers-summary .answer-row {
  font-size: calc(14.5px * var(--exam-font-scale, 1.15)) !important;
}

.exam-review-answers-summary .answer-val {
  font-size: calc(15px * var(--exam-font-scale, 1.15)) !important;
}

.exam-review-explanation p {
  font-size: calc(14.5px * var(--exam-font-scale, 1.15)) !important;
  line-height: 1.75 !important;
}

/* Layout Expansion */
.lesson-room-layout {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 1100px !important;
  margin: 0 auto !important;
}

.lesson-room-layout .journey-shell {
  width: 100% !important;
  max-width: none !important;
  margin: 0 auto !important;
}

/* Unified Control Hub: Placed in #lessonControlHubHost directly under Logo Dynamic Island */
.lesson-control-hub-host {
  width: 100%;
  pointer-events: auto;
  transition: transform .25s ease;
}

.lesson-control-hub {
  position: relative;
  top: auto;
  left: auto;
  width: 60px;
  box-sizing: border-box;
  padding: 5px 3px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0px;
  box-shadow: 3px 3px 0px var(--line);
  pointer-events: auto;
  user-select: none;
}

/* Fallback if rendered outside island-dock */
body:not(:has(.island-dock)) .lesson-control-hub {
  position: fixed;
  top: 76px;
  left: 12px;
  z-index: 29;
}
@media (min-width: 901px) {
  body:not(:has(.island-dock)) .lesson-control-hub {
    left: max(16px, calc((100vw - 1440px) / 2 + 16px));
  }
}

@media (max-width: 650px), (hover: none) {
  .lesson-control-hub {
    width: 56px;
    padding: 4px 2px 5px;
  }
}

:root[data-theme="dark"] .lesson-control-hub {
  background: var(--paper);
  border-color: var(--line);
  box-shadow: 3px 3px 0px #000000;
}

/* Hub Blocks (Vertical Stack) */
.hub-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.hub-block-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1;
}

.hub-block-icon {
  font-size: 9px;
  color: var(--moss-green);
  line-height: 1;
}

.hub-timer-display {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
  margin: 2px 0 3px;
  letter-spacing: .02em;
}

.hub-pause-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 18px;
  padding: 0;
  font-size: 8.5px;
  font-weight: 800;
  border: 1px solid var(--line);
  background: var(--paper-hover);
  color: var(--ink);
  cursor: pointer;
  border-radius: 0px;
  box-shadow: 1px 1px 0px var(--line);
  transition: transform .05s ease, background .1s ease;
}
.hub-pause-btn:hover {
  background: var(--paper);
}
.hub-pause-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 0px 0px 0px;
}

.hub-divider {
  width: 100%;
  height: 1px;
  background: var(--line);
  opacity: 0.25;
  margin: 1px 0;
}

.hub-progress-display {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--moss-green);
  line-height: 1.2;
  margin-top: 2px;
  letter-spacing: .02em;
}

.hub-font-stepper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  margin-top: 2px;
}

.hub-font-btn {
  width: 100%;
  max-width: 48px;
  height: 19px;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  border: 1px solid var(--line);
  background: var(--paper-hover);
  color: var(--ink);
  cursor: pointer;
  border-radius: 0px;
  box-shadow: 1px 1px 0px var(--line);
  display: grid;
  place-items: center;
  transition: transform .05s ease, background .1s ease;
}
.hub-font-btn:hover {
  background: var(--paper);
}
.hub-font-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 0px 0px 0px;
}

.exam-font-scale-value {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  color: var(--ink);
  padding: 1px 0;
  line-height: 1.1;
}

.hub-report-action-btn {
  width: 100%;
  max-width: 50px;
  min-height: 30px;
  padding: 3px 2px;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  border: 1px solid var(--brick-red);
  background: rgba(200, 75, 49, 0.08);
  color: var(--brick-red);
  cursor: pointer;
  border-radius: 0px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  box-shadow: 1px 1px 0px var(--brick-red);
  transition: transform .05s ease, background .12s ease;
}
.hub-report-action-btn:hover {
  background: rgba(200, 75, 49, 0.16);
}
.hub-report-action-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 0px 0px 0px;
}
:root[data-theme="dark"] .hub-report-action-btn {
  border-color: #E26D5C;
  color: #FFAAA0;
  background: rgba(226, 109, 92, 0.12);
  box-shadow: 1px 1px 0px #E26D5C;
}
:root[data-theme="dark"] .hub-report-action-btn:hover {
  background: rgba(226, 109, 92, 0.22);
}

.hub-report-icon {
  font-size: 11px;
  line-height: 1;
}

.hub-report-text {
  font-size: 7.5px;
  letter-spacing: .03em;
  line-height: 1;
}

/* Report Dialog: Tactile Lab Index Card Style */
.tactile-dialog {
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--paper);
  box-shadow: 6px 6px 0px var(--line);
  color: var(--ink);
  padding: 0;
  width: min(500px, calc(100vw - 32px));
  max-height: 90vh;
}

.tactile-dialog::backdrop {
  background: rgba(20, 20, 20, 0.55);
  backdrop-filter: blur(2px);
}

.tactile-dialog-shell {
  display: flex;
  flex-direction: column;
}

.tactile-dialog-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-hover);
}

.dialog-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.dialog-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-title-row h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
}

.dialog-location-text {
  margin: 4px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.tactile-dialog-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
}

.report-prompt-preview {
  padding: 8px 10px;
  border: 1px dashed var(--line);
  background: var(--paper-hover);
  font-family: var(--font-hanzi);
  font-size: 13px;
  color: var(--ink);
  border-radius: 0px;
}

.report-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.report-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-chip {
  cursor: pointer;
}

.report-chip input {
  display: none;
}

.report-chip span {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  box-shadow: 1px 1px 0px var(--line);
  transition: all .1s ease;
}

.report-chip input:checked + span {
  background: #191919;
  color: #FAF8F5;
  border-color: #191919;
}

:root[data-theme="dark"] .report-chip input:checked + span {
  background: #FAF8F5;
  color: #191919;
  border-color: #FAF8F5;
}

.report-field-group textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 12.5px;
  padding: 8px 10px;
  resize: vertical;
  min-height: 60px;
  box-shadow: inset 1px 1px 0px rgba(0,0,0,0.06);
}

.tactile-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--paper-hover);
}

.report-form-status {
  padding: 8px 12px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.report-form-status.success {
  background: #EAF3EC;
  border-color: var(--moss-green);
  color: var(--moss-green);
}

.report-form-status.error {
  background: #FAF0EE;
  border-color: var(--brick-red);
  color: var(--brick-red);
}

/* Admin Reports Panel Styling */
.admin-callout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.report-stats-grid article strong.stat-pending-num {
  color: var(--brick-red);
}
.report-stats-grid article strong.stat-fixed-num {
  color: var(--moss-green);
}

.report-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.report-tabs {
  display: flex;
  gap: 6px;
}

.report-tab {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 0px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 2px 2px 0px var(--line);
}

.report-tab.active {
  background: #191919;
  color: #FAF8F5;
  box-shadow: none;
  transform: translate(1px, 1px);
}

:root[data-theme="dark"] .report-tab.active {
  background: #FAF8F5;
  color: #191919;
}

.report-card.is-fixed {
  border-color: rgba(46, 111, 64, 0.4);
  background: #FAFDFB;
}

:root[data-theme="dark"] .report-card.is-fixed {
  background: #101B13;
}

.report-card-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.report-status-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 0px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-status-badge.badge-pending {
  background: #FAF0EE;
  border-color: var(--brick-red);
  color: var(--brick-red);
}

.report-status-badge.badge-draft {
  background: #FFF8E1;
  border-color: #F57C00;
  color: #E65100;
}

:root[data-theme="dark"] .report-status-badge.badge-draft {
  background: rgba(245, 124, 0, 0.18);
  border-color: #FFA726;
  color: #FFB74D;
}

.report-status-badge.badge-fixed,
.report-status-badge.badge-published {
  background: #EAF3EC;
  border-color: var(--moss-green);
  color: var(--moss-green);
}

:root[data-theme="dark"] .report-status-badge.badge-fixed,
:root[data-theme="dark"] .report-status-badge.badge-published {
  background: rgba(76, 175, 80, 0.18);
  border-color: #66BB6A;
  color: #81C784;
}

.report-card-content {
  flex: 1;
  min-width: 0;
}

.report-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.report-type-tag {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--line);
  background: var(--paper-hover);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-question-id {
  margin: 4px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

.report-prompt-snippet {
  margin: 6px 0;
  padding: 6px 10px;
  background: var(--paper-hover);
  border: 1px dashed var(--line);
  font-family: var(--font-hanzi);
  font-size: 12.5px;
}

.report-desc-text {
  margin: 4px 0 6px;
  font-size: 12px;
  line-height: 1.5;
}

.report-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted);
}

.report-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}

.admin-toggle-fix-btn {
  padding: 6px 12px;
  font-size: 10.5px;
}

