.page-header--oietc {
  background-image: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.18));
}

.oietc-badge {
  background: rgba(139, 92, 246, 0.2) !important;
  color: #c4b5fd !important;
}

.oietc-topic-card, .oietc-picture-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  line-height: 1.65;
}

.oietc-picture-desc {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.oietc-library-grouped {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.oietc-library-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.oietc-section-head h2 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.oietc-section-head p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
}

.oietc-section-grid {
  margin: 0;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.oietc-library-grouped {
  width: 100%;
}

.oietc-card .desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* OIETC take-page — full viewport single column */
.oietc-speaking-exam #exam-app {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100dvh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.oietc-speaking-exam .exam-topbar h1 {
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  flex: 1 1 auto;
  min-width: 0;
}

.oietc-speaking-exam .exam-parts-bar,
.oietc-speaking-exam .speaking-timer-bar,
.oietc-speaking-exam .exam-camera-skip-banner:not(.exam-camera-skip-banner--compact) {
  flex-shrink: 0;
}

.oietc-speaking-exam .exam-body {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  align-self: stretch;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden;
}

.oietc-speaking-exam .exam-body.layout-single,
.oietc-speaking-exam .exam-body.layout-split,
.oietc-speaking-exam .exam-body.layout-questions-only {
  grid-template-columns: 1fr;
  max-width: none;
}

.oietc-speaking-exam .exam-body .exam-passage {
  display: none !important;
  height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  overflow: hidden !important;
  flex: 0 0 0 !important;
}

.oietc-speaking-exam .exam-body .exam-questions {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 auto !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}

.oietc-speaking-exam .speaking-questions {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.oietc-speaking-exam .speaking-q {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.oietc-speaking-exam .speaking-q.active-q {
  margin: 0;
  border-color: var(--border-glow);
  background: rgba(27, 74, 156, 0.08);
}

.oietc-part-header {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.oietc-part-header h2 {
  font-size: 1.15rem;
  color: var(--accent-2);
  margin-bottom: 0.35rem;
}

.oietc-part-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.55;
}

.oietc-scroll-topic {
  margin-bottom: 1rem;
}

.oietc-speaking-exam.exam-camera-compact .exam-topbar {
  padding-right: 0.65rem;
  position: relative;
  z-index: 140;
  align-items: center;
  flex-wrap: nowrap;
  overflow: visible;
  gap: 0.5rem;
}

/* Desktop: keep camera chip in the topbar flow — never float over the title */
@media (min-width: 901px) {
  .exam-camera-compact .exam-topbar,
  .oietc-speaking-exam.exam-camera-compact .exam-topbar {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    flex-wrap: nowrap;
    overflow: visible;
  }

  body.exam-shell {
    overflow: hidden;
    height: 100dvh;
    max-height: 100dvh;
  }

  body.exam-shell #exam-app:not([hidden]) {
    overflow: hidden;
  }
}

.oietc-speaking-exam.exam-camera-compact .exam-camera-wrap,
.oietc-speaking-exam .exam-camera-wrap.exam-camera-wrap--top,
.oietc-speaking-exam .exam-camera-wrap.exam-camera-wrap--in-topbar {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  z-index: 150;
}

.oietc-prep-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.35);
  font-size: 0.9rem;
  color: #ddd6fe;
}

.oietc-prep-banner.warning {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.oietc-prep-banner.done {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.oietc-prep-lock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.65rem;
  min-height: 220px;
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.oietc-prep-lock i {
  font-size: 2rem;
  color: #a78bfa;
  opacity: 0.85;
}

.oietc-prep-countdown {
  font-size: 2rem;
  font-weight: 700;
  color: #c4b5fd;
  font-variant-numeric: tabular-nums;
}

.oietc-prep-lock.warning .oietc-prep-countdown {
  color: #f87171;
}

.oietc-card:has(.oietc-card-thumb-wrap) {
  padding-top: 0;
  overflow: hidden;
}

.oietc-card-thumb-wrap {
  margin: 0 -1.35rem 0.75rem;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
}

.oietc-card-thumb {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.oietc-picture-img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: min(560px, calc(100vh - 200px));
  object-fit: contain;
  border-radius: var(--radius);
  margin-top: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
}

.oietc-speaking-exam .oietc-picture-card,
.oietc-speaking-exam .oietc-topic-card {
  height: 100%;
}

.oietc-type-badge {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.35rem;
}

.oietc-materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.oietc-material-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.oietc-material-card:hover { border-color: rgba(139, 92, 246, 0.4); }

.oietc-qtype-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.oietc-qtype-table th, .oietc-qtype-table td {
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  text-align: left;
}

.oietc-qtype-table th { background: rgba(27, 74, 156, 0.1); color: var(--primary); }

.oietc-info-block { margin-top: 3rem; }

@media (min-width: 1400px) {
  .oietc-section-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 900px) {
  .oietc-materials-grid { grid-template-columns: 1fr; }
  .oietc-section-head h2 { font-size: 1.05rem; flex-wrap: wrap; }
  .oietc-card-thumb { height: 120px; }

  .oietc-speaking-exam .exam-body .exam-passage {
    display: none !important;
  }

  .oietc-speaking-exam .exam-body .exam-questions {
    display: flex !important;
    flex: 1 1 auto !important;
    max-height: none !important;
    height: auto !important;
  }

  .oietc-speaking-exam .speaking-questions {
    gap: 0.55rem;
  }

  .oietc-speaking-exam .speaking-q {
    padding: 0.85rem 0.9rem;
  }
}

@media (max-width: 768px) {
  .oietc-picture-img { max-height: min(280px, 32vh); }
  .oietc-topic-card, .oietc-picture-card { padding: 0.85rem 0.9rem; }
  .oietc-type-badge { display: inline-block; margin-bottom: 0.35rem; }
  .oietc-qtype-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .oietc-qtype-table th, .oietc-qtype-table td { white-space: normal; min-width: 120px; }
  .oietc-info-block .score-demo { margin: 0 auto; max-width: 220px; }
}

@media (max-width: 480px) {
  .oietc-material-card { padding: 1.15rem; }
  .oietc-picture-img { max-height: 30vh; }
}
