/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'JetBrains Mono', 'Space Mono', 'SF Mono', Menlo, monospace;
  background: #0a0a0a;
  color: #fafafa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: #fafafa; color: #0a0a0a; }

/* ===== Page padding ===== */
.page-pad { padding-left: 48px; padding-right: 48px; }
@media (min-width: 768px) { .page-pad { padding-left: 96px; padding-right: 96px; } }
@media (max-width: 600px) { .page-pad { padding-left: 20px; padding-right: 20px; } }

/* ===== Nav ===== */
#main-nav {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding: 0 48px;
  flex-shrink: 0;
}
@media (min-width: 768px) { #main-nav { padding: 0 96px; } }

/* ── Logo pill — mirrors Iris exactly ── */
.nav-logo {
  font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.28);
  border-radius: 100px;
  padding: 0.35rem 0.52rem;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  cursor: default;
  transition: border-color 0.3s, padding 0.35s ease;
  letter-spacing: 0.02em;
  line-height: 1;
  user-select: none;
}
@media (min-width: 681px) {
  .nav-logo:hover {
    border-color: rgba(255,255,255,0.55);
    padding: 0.35rem 0.72rem;
  }
}
.logo-text {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.35s ease;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  vertical-align: middle;
}
@media (min-width: 681px) {
  .nav-logo:hover .logo-text { max-width: 56px; }
}

/* Mobile: tap to expand */
@media (max-width: 680px) {
  .nav-logo { cursor: pointer; }
  .nav-logo.logo-open .logo-text { max-width: 56px; }
  .nav-logo.logo-open { padding: 0.35rem 0.72rem; border-color: rgba(255,255,255,0.55); }
}

.nav-right {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
}
@media (max-width: 600px) {
  #main-nav { padding: 0 20px; }
  .nav-right { font-size: 11px; letter-spacing: 0.08em; }
}


/* ===== Landing Page ===== */
.landing-gap-top { height: 72px; }
.landing-gap     { height: 32px; }
.landing-gap-sm  { height: 16px; }

.landing-headline {
  font-size: clamp(36px, 6.5vw, 80px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: #fafafa;
}

.landing-sub {
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.55);
  max-width: 680px;
}

.landing-rule {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.22);
  margin: 28px 0;
}

/* ===== Exam type switch (EN / BAC) ===== */
.exam-switch {
  display: inline-flex;
  position: relative;
  border: 1px solid rgba(255,255,255,0.22);
  padding: 3px;
  margin-bottom: 22px;
  user-select: none;
}
.esw-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.28);
  transition: left 0.22s ease, width 0.22s ease;
  pointer-events: none;
}
.esw-opt {
  position: relative;
  z-index: 1;
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 7px 18px;
  cursor: pointer;
  transition: color 0.18s;
  white-space: nowrap;
}
.esw-opt.esw-active { color: #fafafa; }
.esw-opt:not(.esw-active):hover { color: rgba(255,255,255,0.65); }

/* Subject selector label */
.subject-selector-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 12px;
}

/* Subject toggle group */
.subject-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 640px;
}

.subject-toggle-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 20px;
  border: 1px solid rgba(255,255,255,0.18);
  background: transparent;
  color: rgba(255,255,255,0.65);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.subject-toggle-btn:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.04);
  color: #fafafa;
}
.subject-toggle-active {
  border-color: #fafafa !important;
  background: rgba(255,255,255,0.06) !important;
  color: #fafafa !important;
}
.subject-toggle-disabled {
  opacity: 0.3;
  cursor: not-allowed !important;
}

.stb-name {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.stb-meta {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}
.stb-soon {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 1px 5px;
  align-self: flex-start;
}
.stb-avail {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 1px 5px;
  align-self: flex-start;
}
.stb-testing {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,200,80,0.75);
  border: 1px solid rgba(255,200,80,0.35);
  padding: 1px 5px;
  align-self: flex-start;
}

/* Landing bottom: subjects left, CTA right */
.landing-bottom-row {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}
.landing-subjects-col { flex: 1; min-width: 0; }
.landing-cta-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 220px;
  max-width: 300px;
  padding-top: 26px;
}
@media (max-width: 860px) {
  .landing-bottom-row { flex-direction: column; gap: 28px; }
  .landing-cta-col { max-width: 100%; padding-top: 0; }
}

/* Force a row break inside the subject toggle flex container */
.stg-break { flex-basis: 100%; height: 0; }

.btn-xlarge { padding: 22px 32px; font-size: 1.1rem; width: 100%; justify-content: center; letter-spacing: 0.04em; }
#start-btn { padding: 22px 32px; font-size: 1.1rem; }

.landing-disclaimer {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  line-height: 1.8;
  max-width: 480px;
}

/* ── Variant preview chip (below start button) ── */
.variant-preview {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 7px 14px;
  display: none;
}
.variant-preview.vp-visible { display: block; }

/* ── Resume panel ── */
.resume-kicker {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 10px;
}
.resume-variant-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fafafa;
  margin-bottom: 20px;
  line-height: 1.3;
}
.abandon-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-family: inherit;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.18s;
}
.abandon-btn:hover { color: rgba(255,255,255,0.65); }

/* ── Back confirmation bar ── */
.back-confirm {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border: 1px solid rgba(255,255,255,0.14);
  padding: 14px 18px;
  margin-bottom: 24px;
  background: rgba(255,255,255,0.03);
}
.back-confirm-text {
  flex: 1;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.6);
}
.back-confirm-actions { display: flex; gap: 10px; }
.back-confirm-btn {
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.22);
  background: none;
  color: rgba(255,255,255,0.6);
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.back-confirm-btn:hover { border-color: rgba(255,255,255,0.5); color: #fafafa; }
.back-confirm-yes { border-color: rgba(255,80,80,0.4); color: rgba(255,120,120,0.85); }
.back-confirm-yes:hover { border-color: rgba(255,80,80,0.8); color: rgb(255,120,120); }

/* Fade-in animation (used by landing page) */
.fade-in {
  animation: fadeIn 600ms ease-out both;
}

/* ===== Score Tracker (sticky) ===== */
#score-tracker {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(255,255,255,0.22);
  padding: 10px 48px;
}
.tracker-inner { max-width: 900px; margin: 0 auto; }
.tracker-text {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
#tracker-score {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fafafa;
}
.tracker-sep { color: rgba(255,255,255,0.25); font-size: 0.75rem; }
.tracker-oficiu { font-size: 0.72rem; color: rgba(255,255,255,0.4); letter-spacing: 0.06em; }
#tracker-done {
  margin-left: auto;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tracker-bar-bg {
  height: 2px;
  background: rgba(255,255,255,0.1);
}
.tracker-bar-fill {
  height: 100%;
  width: 0%;
  background: #fafafa;
  transition: width 0.4s ease;
}
@media (max-width: 600px) { #score-tracker { padding: 10px 20px; } }

/* ===== Main ===== */
main {
  flex: 1;
  padding: 0 48px 60px;
  width: 100%;
}
@media (min-width: 768px) { main { padding-left: 96px; padding-right: 96px; } }
@media (max-width: 600px) { main { padding-left: 20px; padding-right: 20px; } }

#exam-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 32px;
}

/* Exam top bar: back + tutorial button on same row */
.exam-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

/* Back button */
.back-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.5);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 16px;
  transition: border-color 0.15s, color 0.2s;
}
.back-btn:hover { border-color: rgba(255,255,255,0.45); color: rgba(255,255,255,0.9); }

/* Tutorial button — right side of exam top bar */
.tutorial-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.5);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 16px;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
  margin-left: auto;
}
.tutorial-btn:hover { border-color: rgba(255,255,255,0.45); color: rgba(255,255,255,0.9); }

.oficiu-note {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* ===== Subject Section ===== */
.subject-section { margin-bottom: 56px; }
.subject-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}
.subject-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fafafa;
}
.subject-points-label {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.1em;
}

/* ===== Exercise Card ===== */
.ex-card {
  border: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.ex-card.state-correct   { border-color: rgba(74,222,128,0.4); }
.ex-card.state-incorrect { border-color: rgba(248,113,113,0.35); }

.ex-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.16);
}
.ex-number {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  min-width: 2.2rem;
}
.ex-points-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  white-space: nowrap;
}
.ex-points-badge.earned-full    { color: #4ade80; }
.ex-points-badge.earned-partial { color: #facc15; }
.ex-points-badge.earned-zero    { color: #f87171; }

.ex-body { padding: 16px 16px 14px; }

/* ===== Problem Prompt ===== */
.ex-prompt {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #fafafa;
  white-space: pre-line;
  margin-bottom: 16px;
}

/* ===== Desmos Graph ===== */
.graph-section { margin-bottom: 20px; }
.graph-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 8px;
}
.desmos-container {
  width: 100%;
  height: 260px;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
}

/* ===== Geometric Figure ===== */
.ex-content-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.ex-content-row .ex-prompt {
  flex: 1;
  margin-bottom: 0;
}
.fig-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 340px;
  cursor: crosshair;
}
.fig-wrapper::after {
  content: 'dublu-click · adnotează';
  position: absolute;
  bottom: 5px;
  right: 7px;
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0);
  pointer-events: none;
  transition: color 0.2s;
}
.fig-wrapper:hover::after { color: rgba(255,255,255,0.22); }
.ex-figure {
  width: 100%;
  display: block;
  opacity: 0.9;
}
.ex-figure[src$=".png"] {
  filter: invert(1);
  opacity: 0.85;
}
@media (max-width: 600px) {
  .ex-content-row { flex-direction: column; }
  .fig-wrapper { width: 100%; max-width: 340px; }
}

/* ===== Figure Stickers ===== */
.sticker {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(10,10,10,0.88);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 2px 5px 2px 7px;
  cursor: grab;
  user-select: none;
  white-space: nowrap;
  z-index: 10;
  touch-action: none;
}
.sticker:active { cursor: grabbing; }
.sticker-text {
  font-size: 0.7rem;
  color: #fafafa;
  letter-spacing: 0.04em;
}
.sticker-delete {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 0.8rem;
  padding: 0 1px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.12s;
  flex-shrink: 0;
}
.sticker-delete:hover { color: #f87171; }

/* Rotation line + knob above sticker */
.sticker-rot-line {
  position: absolute;
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,0.35);
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}
.sticker-rot-handle {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.65);
  background: rgba(10,10,10,0.92);
  bottom: calc(100% + 18px);
  left: 50%;
  transform: translateX(-50%);
  cursor: grab;
  opacity: 0;
  transition: opacity 0.12s;
}
.sticker-rot-handle:active { cursor: grabbing; }

/* Resize corner handle — bottom-right */
.sticker-resize-handle {
  position: absolute;
  width: 9px;
  height: 9px;
  border-right: 2px solid rgba(255,255,255,0.65);
  border-bottom: 2px solid rgba(255,255,255,0.65);
  bottom: -5px;
  right: -5px;
  cursor: se-resize;
  opacity: 0;
  transition: opacity 0.12s;
}

.sticker:hover .sticker-rot-line,
.sticker:hover .sticker-rot-handle,
.sticker:hover .sticker-resize-handle { opacity: 1; }
.sticker-input-el {
  position: absolute;
  transform: translate(-50%, -50%);
  background: #111;
  border: 1px solid rgba(255,255,255,0.55);
  color: #fafafa;
  font-family: inherit;
  font-size: 0.75rem;
  padding: 3px 8px;
  outline: none;
  z-index: 20;
  width: 88px;
}

/* ===== Answer Area ===== */
.answer-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 8px;
}
.answer-input {
  width: 100%;
  max-width: 380px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #fafafa;
  font-family: inherit;
  font-size: 0.9rem;
  display: block;
  transition: border-color 0.2s;
  outline: none;
}
.answer-input:focus { border-color: rgba(255,255,255,0.6); }
.answer-input:disabled { opacity: 0.4; cursor: not-allowed; }
.answer-input::placeholder { color: rgba(255,255,255,0.25); }

/* Multiple choice */
.choices-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.choice-label {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.75);
  transition: border-color 0.15s, background 0.15s;
}
.choice-label:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.04); }
.choice-label input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid #555;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}
.choice-label input[type="radio"]:checked {
  border-color: #888;
  background: #777;
  box-shadow: inset 0 0 0 3px #0a0a0a;
}
.choice-letter { font-size: 0.68rem; font-weight: 700; color: rgba(255,255,255,0.35); letter-spacing: 0.06em; min-width: 1.2rem; }

/* ===== Buttons ===== */
.ex-actions, .post-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.post-actions {
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.btn {
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn:hover:not(:disabled) { border-color: rgba(255,255,255,0.6); color: #fafafa; }
.btn:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-primary {
  background: rgba(255,255,255,0.1);
  color: #fafafa;
  border-color: rgba(255,255,255,0.35);
}
.btn-primary:hover:not(:disabled) { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.65); color: #fafafa; }
.btn-primary:disabled { background: rgba(255,255,255,0.04); border-color: transparent; color: rgba(255,255,255,0.3); }

.btn-secondary { background: transparent; }
.btn-outline   { background: transparent; }
.btn-large { padding: 12px 28px; font-size: 0.78rem; }

/* ===== Hint / Sugestie (shared between EN mate and BAC mate) ===== */
.hint-panel {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(255, 200, 80, 0.04);
  border: 1px dashed rgba(255, 200, 80, 0.28);
  padding: 11px 14px;
  margin-top: 12px;
  animation: fadeIn 0.2s ease;
}
.hint-panel p { color: rgba(255, 220, 140, 0.85); font-size: 0.85rem; line-height: 1.55; letter-spacing: 0.01em; }

/* ===== Loading ===== */
.ex-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; color: rgba(255,255,255,0.4);
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.spinner {
  width: 16px; height: 16px;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.7);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Feedback ===== */
.ex-feedback {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  animation: fadeIn 0.25s ease;
}
.result-badge {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.result-badge.correct   { background: rgba(74,222,128,0.06); border: 1px solid rgba(74,222,128,0.3); }
.result-badge.incorrect { background: rgba(248,113,113,0.06); border: 1px solid rgba(248,113,113,0.25); }
.result-icon { font-size: 1.1rem; flex-shrink: 0; }
.result-badge strong { display: block; font-size: 0.82rem; letter-spacing: 0.06em; }
.result-badge.correct   strong { color: #4ade80; }
.result-badge.incorrect strong { color: #f87171; }
.result-score { display: block; font-size: 0.68rem; color: rgba(255,255,255,0.35); margin-top: 2px; letter-spacing: 0.06em; }

.feedback-short { font-size: 0.85rem; line-height: 1.65; color: rgba(255,255,255,0.75); margin-bottom: 10px; }
.encouragement  { font-size: 0.8rem; font-style: italic; color: rgba(255,255,255,0.45); margin-top: 6px; }

/* ===== Solution ===== */
.ex-solution {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  animation: fadeIn 0.2s ease;
}
.solution-label {
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: rgba(255,255,255,0.35); margin-bottom: 10px;
}
.solution-content {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 2px solid rgba(255,255,255,0.25);
  padding: 14px 16px;
  font-size: 0.88rem;
  line-height: 1.85;
  white-space: pre-line;
  color: rgba(255,255,255,0.8);
}

/* ===== Exam Footer ===== */
.exam-footer { display: flex; justify-content: center; margin: 40px 0 24px; }

/* ===== Final Results ===== */
#final-results {
  border: 1px solid rgba(255,255,255,0.12);
  padding: 32px;
  margin-bottom: 40px;
  animation: fadeIn 0.3s ease;
}
.final-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.final-score-display {
  display: flex; align-items: center; gap: 24px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 20px;
}
.final-score-display.grade-high { border-color: rgba(74,222,128,0.4); }
.final-score-display.grade-mid  { border-color: rgba(250,204,21,0.4); }
.final-score-display.grade-low  { border-color: rgba(248,113,113,0.35); }

.final-nota { font-size: 3.5rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.grade-high .final-nota { color: #4ade80; }
.grade-mid  .final-nota { color: #facc15; }
.grade-low  .final-nota { color: #f87171; }

.final-score-details { display: flex; flex-direction: column; gap: 4px; }
.final-score-details strong { font-size: 0.82rem; letter-spacing: 0.06em; }
.final-score-details span   { font-size: 0.7rem; color: rgba(255,255,255,0.4); letter-spacing: 0.06em; }

.final-breakdown { display: flex; flex-direction: column; gap: 4px; }
.breakdown-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 0.75rem;
}
.breakdown-subject { font-weight: 600; min-width: 110px; color: rgba(255,255,255,0.6); letter-spacing: 0.06em; }
.breakdown-score   { color: rgba(255,255,255,0.5); }
.breakdown-score.full { color: #4ade80; font-weight: 600; }

/* ===== Error ===== */
.error-msg {
  border: 1px solid rgba(248,113,113,0.4);
  background: rgba(248,113,113,0.06);
  color: #f87171;
  padding: 10px 14px;
  font-size: 0.78rem;
  margin-top: 8px;
  letter-spacing: 0.04em;
}

/* ===== KaTeX overrides for dark theme ===== */
.katex { color: #fafafa !important; }

/* ===== Math Input Modal ===== */
.math-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.math-modal-box {
  background: #111;
  border: 1px solid rgba(255,255,255,0.18);
  width: min(680px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.18s ease;
}
.math-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.math-modal-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.math-modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}
.math-modal-close:hover { color: #fafafa; }

.math-symbol-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sym-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.75);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 5px 11px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  min-width: 40px;
  text-align: center;
  user-select: none;
}
.sym-btn:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.38);
  color: #fafafa;
}

.math-modal-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: #fafafa;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.75;
  padding: 18px 18px;
  resize: none;
  min-height: 220px;
  outline: none;
}
.math-modal-textarea::placeholder {
  color: rgba(255,255,255,0.18);
  font-size: 0.85rem;
}

.math-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

/* ─── BAC Math modal — grouped symbol palette ─── */
.bacmath-modal-box { width: min(820px, 100%); }
.bm-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 18px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  overflow-x: auto;
}
.bm-tab {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-bottom: none;
  color: rgba(255,255,255,0.45);
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.bm-tab:hover { color: #fafafa; background: rgba(255,255,255,0.04); }
.bm-tab-active {
  background: rgba(255,255,255,0.07);
  color: #fafafa;
  border-color: rgba(255,255,255,0.32);
}
.bm-panels { flex-shrink: 0; }
.bm-panel {
  display: none;
  flex-direction: column;
  padding: 10px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  max-height: 260px;
  overflow-y: auto;
}
.bm-panel-active { display: flex; }
.bm-panel-hint {
  font-size: 0.7rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.02em;
  padding: 4px 0 10px;
  margin-bottom: 4px;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
}
.bm-panel-syms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.bm-panel .sym-btn {
  min-width: 38px;
  font-size: 0.95rem;
  padding: 5px 9px;
}

/* BAC Math editor (MathLive math-field) */
.bm-mathfield-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  background: #0a0a0a;
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: 300px;
  overflow: auto;
  gap: 10px;
}
.bm-mathfield-help {
  font-size: 0.72rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.02em;
  padding: 8px 12px;
  border: 1px dashed rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.015);
  flex-shrink: 0;
}
math-field.bm-mathfield {
  flex: 1;
  width: 100%;
  min-height: 220px;
  font-size: 1.3rem;
  color: #fafafa;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 2px;
  padding: 18px 18px;
  --selection-background-color: rgba(255,255,255,0.10);
  --selection-background-color-focused: rgba(255,255,255,0.12);
  --selection-color: #fafafa;
  --contains-highlight-background-color: rgba(255,255,255,0.04);
  --caret-color: #fafafa;
  --placeholder-color: rgba(255,255,255,0.28);
  --placeholder-opacity: 1;
  --primary: rgba(255,255,255,0.6);
  --smart-fence-color: rgba(255,255,255,0.28);
  --smart-fence-opacity: 0.5;
  --highlight-text: rgba(74,222,128,0.18);
}
math-field.bm-mathfield:focus,
math-field.bm-mathfield:focus-within {
  border-color: rgba(255,255,255,0.4);
  outline: none;
}
/* Hide MathLive's built-in virtual-keyboard toggle and menu (three-dots) icons. */
math-field.bm-mathfield::part(virtual-keyboard-toggle),
math-field.bm-mathfield::part(menu-toggle),
math-field.bm-mathfield::part(toolbar) {
  display: none !important;
}

/* BAC hint box (shown when "Hint" pressed) */
.bac-hint-box {
  margin-top: 12px;
  padding: 11px 14px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: rgba(255, 220, 140, 0.85);
  background: rgba(255, 200, 80, 0.04);
  border: 1px dashed rgba(255, 200, 80, 0.28);
  letter-spacing: 0.01em;
}
.btn-hint { color: rgba(255, 220, 140, 0.85); border-color: rgba(255, 200, 80, 0.32); }
.btn-hint:hover { background: rgba(255, 200, 80, 0.08); border-color: rgba(255, 200, 80, 0.55); }

/* BAC partial state for cards (between correct and incorrect) */
.ex-card.state-partial { border-color: rgba(255, 200, 80, 0.35); }
.ex-card.state-partial .ex-card-header { background: rgba(255, 200, 80, 0.05); }
.result-badge.partial {
  background: rgba(255, 200, 80, 0.08);
  border-color: rgba(255, 200, 80, 0.28);
  color: rgba(255, 220, 140, 0.95);
}
.result-badge.partial .result-icon { color: rgba(255, 200, 80, 0.9); }
.solution-toggle {
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.025);
}
.solution-toggle summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  user-select: none;
}
.solution-toggle summary:hover { color: #fafafa; }
.solution-toggle .solution-content {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
  white-space: pre-wrap;
}

/* Answer preview under the open-modal button */
.answer-preview {
  margin-top: 8px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}

/* ===== Tutorial Modal ===== */
.tut-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.tut-box {
  background: #111;
  border: 1px solid rgba(255,255,255,0.18);
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.18s ease;
}
.tut-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.tut-title {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}
.tut-close-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}
.tut-close-btn:hover { color: #fafafa; }

.tut-stage {
  position: relative;
  height: 220px;
  overflow: hidden;
}
.tut-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  opacity: 0;
  transition: opacity 0.22s;
  pointer-events: none;
}
.tut-slide.tut-active { opacity: 1; pointer-events: auto; }
.tut-caption {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
}
.tut-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.tut-nav-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.45);
  font-family: inherit;
  font-size: 0.75rem;
  padding: 4px 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.tut-nav-btn:hover:not(:disabled) { border-color: rgba(255,255,255,0.5); color: #fafafa; }
.tut-nav-btn:disabled { opacity: 0.18; cursor: default; }
.tut-dots {
  display: flex;
  gap: 7px;
  align-items: center;
}
.tut-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.tut-dot.tut-dot-active { background: rgba(255,255,255,0.75); }

/* ── Slide visuals ── */
.tut-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Slide 1 — card lines appearing */
.tut-card-mock {
  width: 240px;
  border: 1px solid rgba(255,255,255,0.12);
  padding: 12px 14px;
}
.tut-card-hdr {
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
  margin-bottom: 10px;
  text-transform: uppercase;
}
.tut-bar {
  height: 5px;
  background: rgba(255,255,255,0.18);
  margin-bottom: 6px;
  transform-origin: left;
  animation: tutBar 3.2s ease-in-out infinite;
}
.tut-bar:nth-child(2) { width: 100%; animation-delay: 0s; }
.tut-bar:nth-child(3) { width: 80%;  animation-delay: 0.2s; }
.tut-bar:nth-child(4) { width: 55%;  animation-delay: 0.4s; }
@keyframes tutBar {
  0%, 5%   { transform: scaleX(0); opacity: 0; }
  22%, 78% { transform: scaleX(1); opacity: 1; }
  93%, 100%{ transform: scaleX(1); opacity: 0; }
}

/* Slide 2 — typing into input */
.tut-input-mock {
  width: 200px;
  border: 1px solid rgba(255,255,255,0.22);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: #fafafa;
  gap: 1px;
}
.tut-typed {
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  display: inline-block;
  animation: tutType 3.2s steps(2, end) infinite;
}
@keyframes tutType {
  0%, 18% { width: 0; }
  45%, 80% { width: 1.15em; }
  95%, 100%{ width: 0; }
}
.tut-cursor {
  display: inline-block;
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  animation: tutBlink 0.75s step-end infinite;
}
@keyframes tutBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Slide 3 — button press → green badge */
.tut-v-check { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tut-btn-mock {
  background: #fafafa;
  color: #0a0a0a;
  border: none;
  padding: 7px 16px;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: tutPress 3.2s ease-in-out infinite;
}
@keyframes tutPress {
  0%, 22%  { transform: scale(1); }
  28%      { transform: scale(0.93); }
  34%, 100%{ transform: scale(1); }
}
.tut-badge-mock {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(74,222,128,0.07);
  border: 1px solid rgba(74,222,128,0.3);
  padding: 7px 14px;
  font-size: 0.72rem;
  color: #4ade80;
  font-weight: 600;
  letter-spacing: 0.06em;
  animation: tutBadge 3.2s ease-in-out infinite;
}
@keyframes tutBadge {
  0%, 32%  { opacity: 0; transform: translateY(8px); }
  48%, 80% { opacity: 1; transform: translateY(0); }
  94%, 100%{ opacity: 0; }
}

/* Slide 4 — figure + sticker */
.tut-v-annotate {
  position: relative;
  width: 210px;
  height: 130px;
}
.tut-fig-lines {
  position: absolute;
  inset: 16px;
  border-left: 1.5px solid rgba(255,255,255,0.25);
  border-bottom: 1.5px solid rgba(255,255,255,0.25);
}
.tut-fig-lines::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 100%;
  border-right: 1.5px solid rgba(255,255,255,0.15);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}
.tut-ripple {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.55);
  top: 42%;
  left: 54%;
  transform: translate(-50%,-50%) scale(0);
  animation: tutRipple 3.2s ease-in-out infinite;
}
@keyframes tutRipple {
  0%, 14%  { transform: translate(-50%,-50%) scale(0); opacity: 0.9; }
  32%      { transform: translate(-50%,-50%) scale(1.2); opacity: 0; }
  100%     { opacity: 0; }
}
.tut-sticker-mock {
  position: absolute;
  background: rgba(10,10,10,0.9);
  border: 1px solid rgba(255,255,255,0.32);
  padding: 2px 7px;
  font-size: 0.62rem;
  color: #fafafa;
  letter-spacing: 0.04em;
  top: 28%;
  left: 60%;
  transform: translate(-50%, -60%);
  white-space: nowrap;
  animation: tutSticker 3.2s ease-in-out infinite;
}
@keyframes tutSticker {
  0%, 30%  { opacity: 0; transform: translate(-50%,-65%); }
  50%, 80% { opacity: 1; transform: translate(-50%,-50%); }
  94%, 100%{ opacity: 0; }
}

/* Slide 5 — autosave */
.tut-v-save { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tut-save-mark {
  font-size: 2.2rem;
  line-height: 1;
  animation: tutSaveMark 3.2s ease-in-out infinite;
}
@keyframes tutSaveMark {
  0%, 12%  { opacity: 0; transform: scale(0.7); }
  28%, 72% { opacity: 1; transform: scale(1); }
  90%, 100%{ opacity: 0; }
}
.tut-save-sub {
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  animation: tutSaveMark 3.2s ease-in-out infinite;
  animation-delay: 0.25s;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Footer ===== */
footer {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 0 48px;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}
.footer-link {
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-link:hover { color: rgba(255,255,255,0.7); }
@media (min-width: 768px) { footer { padding: 0 96px; } }
@media (max-width: 600px) {
  footer { padding: 0 20px; font-size: 0.58rem; }
}

/* ===== Romanian Exam ===== */

.ro-passages { margin-bottom: 40px; display: flex; flex-direction: column; gap: 12px; }
.ro-passage { border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.02); }
.ro-passage-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; cursor: pointer; user-select: none; gap: 16px;
}
.ro-passage-header:hover { background: rgba(255,255,255,0.03); }
.ro-passage-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.55); }
.ro-passage-source { font-size: 0.68rem; color: rgba(255,255,255,0.3); font-style: italic; flex: 1; text-align: right; }
.ro-passage-toggle { font-size: 0.75rem; color: rgba(255,255,255,0.3); flex-shrink: 0; transition: transform 0.22s ease; }
.ro-passage.open .ro-passage-toggle { transform: rotate(180deg); }
.ro-passage-body { display: none; padding: 0 20px 20px; border-top: 1px solid rgba(255,255,255,0.06); }
.ro-passage.open .ro-passage-body { display: block; }
.ro-passage-para { font-size: 0.82rem; line-height: 1.85; color: rgba(255,255,255,0.72); margin-bottom: 0.6em; }
.ro-passage-para.dialogue { padding-left: 1.25em; color: rgba(255,255,255,0.78); }
.ro-passage-footnote { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.06); font-size: 0.72rem; font-style: italic; color: rgba(255,255,255,0.35); }

.ro-section { margin-bottom: 40px; }
.ro-section-header { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.ro-section-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.45); }
.ro-section-points { font-size: 0.62rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.25); }
.ro-subsection { margin-bottom: 12px; }
.ro-subsection-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.3); margin-bottom: 12px; margin-top: 20px; }

.ro-ex-card { border: 1px solid rgba(255,255,255,0.08); padding: 20px 22px; margin-bottom: 10px; background: rgba(255,255,255,0.015); }
.ro-ex-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ro-ex-number { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.15em; color: rgba(255,255,255,0.35); text-transform: uppercase; }
.ro-ex-points { font-size: 0.58rem; color: rgba(255,255,255,0.25); letter-spacing: 0.08em; margin-left: auto; }
.ro-ex-instruction { font-size: 0.78rem; color: rgba(255,255,255,0.4); margin-bottom: 10px; line-height: 1.55; font-style: italic; }
.ro-ex-prompt { font-size: 0.84rem; color: rgba(255,255,255,0.82); line-height: 1.65; margin-bottom: 14px; white-space: pre-line; }

.ro-choices { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ro-choice-label {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 9px 12px; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 3px;
  transition: border-color 0.15s, background 0.15s;
  color: rgba(255,255,255,0.75);
}
.ro-choice-label:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.04); }
.ro-choice-label input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 15px; height: 15px;
  border: 1.5px solid rgba(255,255,255,0.3); border-radius: 50%;
  flex-shrink: 0; transition: border-color 0.15s, background 0.15s;
}
.ro-choice-label input[type="radio"]:checked { border-color: #888; background: #777; box-shadow: inset 0 0 0 3px #0a0a0a; }
.ro-choice-label.selected { border-color: rgba(255,255,255,0.4); color: #fafafa; background: rgba(255,255,255,0.05); }
.ro-choice-label.correct  { border-color: rgba(100,220,130,0.7); background: rgba(100,220,130,0.07); color: rgba(200,255,215,0.9); }
.ro-choice-label.wrong    { border-color: rgba(220,80,80,0.5);   background: rgba(220,80,80,0.06);  color: rgba(255,180,180,0.8); }
.ro-choice-letter { font-size: 0.68rem; font-weight: 700; color: rgba(255,255,255,0.35); letter-spacing: 0.06em; min-width: 1.2rem; }
.ro-check-btn {
  margin-top: 12px; font-family: inherit; font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; border: 1px solid rgba(255,255,255,0.22);
  background: none; color: rgba(255,255,255,0.55); padding: 8px 18px; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.ro-check-btn:hover { border-color: rgba(255,255,255,0.5); color: #fafafa; }
.ro-check-btn:disabled { opacity: 0.3; cursor: default; }
.ro-result-badge { display: inline-block; margin-top: 10px; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 10px; border: 1px solid; }
.ro-result-badge.correct { border-color: rgba(100,220,130,0.5); color: rgba(150,255,180,0.9); }
.ro-result-badge.wrong   { border-color: rgba(220,80,80,0.4);   color: rgba(255,150,150,0.9); }

.ro-fib-sentence { font-size: 0.84rem; color: rgba(255,255,255,0.8); line-height: 2.2; margin-bottom: 12px; }
.ro-fib-input {
  display: inline-block; font-family: inherit; font-size: 0.82rem; background: none;
  border: none; border-bottom: 1px solid rgba(255,255,255,0.3); color: #fafafa;
  width: 140px; padding: 0 4px 2px; outline: none; margin: 0 4px;
  transition: border-color 0.15s; vertical-align: baseline;
}
.ro-fib-input:focus { border-bottom-color: rgba(255,255,255,0.7); }
.ro-fib-input.correct { border-bottom-color: rgba(100,220,130,0.7); color: rgba(200,255,215,0.9); }
.ro-fib-input.wrong   { border-bottom-color: rgba(220,80,80,0.6);  color: rgba(255,180,180,0.9); }

.ro-tf-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; margin-bottom: 12px; }
.ro-tf-table th {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.35); border: 1px solid rgba(255,255,255,0.1); padding: 8px 14px;
  text-align: center; background: rgba(255,255,255,0.03);
}
.ro-tf-table td { border: 1px solid rgba(255,255,255,0.08); padding: 10px 14px; color: rgba(255,255,255,0.7); vertical-align: middle; }
.ro-tf-table td.tf-group-cell {
  font-size: 0.58rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.02); text-align: center; width: 80px;
}
.ro-tf-table td.tf-choice { text-align: center; width: 70px; }
.ro-tf-radio { display: none; }
.ro-tf-box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer; transition: border-color 0.15s, background 0.15s; font-size: 0.7rem; font-weight: 700;
}
.ro-tf-radio:checked ~ .ro-tf-box { border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.12); color: #fafafa; }
.ro-tf-table tr.tf-correct td { background: rgba(100,220,130,0.05); }
.ro-tf-table tr.tf-wrong   td { background: rgba(220,80,80,0.05); }

.ro-essay-textarea {
  width: 100%; min-height: 120px; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.82);
  font-family: inherit; font-size: 0.82rem; line-height: 1.7; padding: 12px 14px;
  resize: vertical; outline: none; transition: border-color 0.15s; box-sizing: border-box;
}
.ro-essay-textarea:focus { border-color: rgba(255,255,255,0.3); }
.ro-word-count { font-size: 0.6rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.25); margin-top: 5px; text-align: right; }
.ro-word-count.target-met { color: rgba(100,220,130,0.6); }

@media (max-width: 600px) {
  .ro-ex-card { padding: 16px; }
  .ro-tf-table { font-size: 0.72rem; }
  .ro-tf-table th, .ro-tf-table td { padding: 7px 8px; }
  .ro-passage-header { padding: 12px 14px; }
  .ro-passage-body { padding: 0 14px 16px; }
}

/* ===== BAC Math ===== */
.ex-figure-wrap {
  margin: 0 0 16px;
  text-align: center;
}
.ex-figure-wrap .ex-figure {
  max-width: 100%;
  width: auto;
  display: inline-block;
}
.ex-figure-wrap .ex-figure[src$="chim_detergent.svg"] {
  max-width: 280px;
}

.bac-context {
  font-size: 0.82rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 2px solid rgba(255,255,255,0.2);
  padding: 12px 16px;
  margin-bottom: 16px;
  white-space: pre-line;
}

.bac-grade-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.bac-correct-btn {
  border-color: rgba(100,220,130,0.45);
  color: rgba(150,255,180,0.85);
}
.bac-correct-btn:hover:not(:disabled) {
  background: rgba(100,220,130,0.08);
  border-color: rgba(100,220,130,0.75);
  color: rgba(180,255,200,1);
}

.bac-wrong-btn {
  border-color: rgba(220,80,80,0.4);
  color: rgba(255,150,150,0.8);
}
.bac-wrong-btn:hover:not(:disabled) {
  background: rgba(220,80,80,0.07);
  border-color: rgba(220,80,80,0.65);
  color: rgba(255,180,180,1);
}

.mc-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.mc-opt-btn {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: rgba(255,255,255,0.78);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.55;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.mc-opt-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.28);
}
.mc-opt-btn.mc-selected {
  border-color: rgba(180,160,255,0.55);
  background: rgba(160,130,255,0.08);
  color: #fff;
}
.mc-opt-btn:disabled { opacity: 0.55; cursor: default; }
.mc-label {
  font-weight: 700;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  flex-shrink: 0;
  min-width: 18px;
}
.mc-opt-btn.mc-selected .mc-label { color: rgba(180,160,255,0.9); }
.mc-text { flex: 1; }

.code-block {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.65;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 6px;
  padding: 12px 14px;
  margin: 10px 0;
  overflow-x: auto;
  white-space: pre;
}
.code-block code { background: none; padding: 0; border: none; font-size: inherit; }
.inline-code {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 0.85em;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  padding: 1px 5px;
}


/* ===== Geography context blocks ===== */
.geo-map-block {
  border: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 10px;
  overflow: hidden;
}
.geo-map-iframe {
  display: block;
  width: 100%;
  height: 62vh;
  min-height: 340px;
  max-height: 580px;
  border: none;
  background: #050812;
}
.geo-map-desc {
  padding: 10px 16px;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.48);
  border-top: 1px solid rgba(255,255,255,0.07);
  white-space: pre-line;
}

.geo-chart-block {
  border: 1px solid rgba(255,255,255,0.1);
  padding: 18px 18px 12px;
  margin-bottom: 10px;
}
.geo-chart-figure {
  display: block;
  width: 100%;
}
.geo-chart-desc {
  margin: 10px 0 0;
  font-size: 0.82rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.45);
  font-style: italic;
  white-space: pre-line;
}
