/* ══════════════════════════════════════════════════════════
   CivicLearn v2 — Quiz / Test Styles
   Used by: simulation, quick, topics, traps
   ══════════════════════════════════════════════════════════ */

/* ── QUIZ CONTAINER ── */
.quiz-container {
  max-width: 780px;
}

/* ── CARD ── */
.ce-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 36px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.35s cubic-bezier(0.22,1,0.36,1) forwards;
}

/* ── QUESTION HEADER ROW ── */
.ce-q-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

/* Main topic badge (e.g. "History · 10") */
.ce-q-main {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  letter-spacing: -0.01em;
}

/* Question counter */
.ce-q-meta {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Microtopic + save star wrapper */
.ce-q-subtopic-wrap {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ce-q-subtopic {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}

/* Save star */
.ce-save-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.28;
  transition: opacity 0.2s;
  padding: 0;
  line-height: 1;
}

.ce-save-btn::before { content: '☆'; }
.ce-save-btn:hover { opacity: 0.55; }
.ce-save-btn.active { opacity: 1; }
.ce-save-btn.active::before { content: '★'; color: #f59e0b; }

/* ── QUESTION TEXT ── */
.ce-question-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 26px;
}

.ce-question {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: -0.02em;
  color: var(--text);
  flex: 1;
}

/* TTS speak button */
.ce-speak-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.4;
  transition: opacity 0.15s;
  padding: 2px;
  flex-shrink: 0;
}

.ce-speak-btn:hover { opacity: 0.7; }

.ce-speak-small {
  font-size: 13px;
  margin-left: auto;
}

/* ── OPTIONS ── */
.ce-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 26px;
}

.ce-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  letter-spacing: -0.01em;
  width: 100%;
}

.ce-option:hover:not(.answered):not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Answered states (during quiz — parent has .answered) */
.ce-options.answered .ce-option {
  cursor: default;
  opacity: 0.55;
}

.ce-options.answered .ce-option.correct {
  border-color: var(--correct);
  background: var(--correct-bg);
  color: #166534;
  opacity: 1;
}

.ce-options.answered .ce-option.wrong {
  border-color: var(--wrong);
  background: var(--wrong-bg);
  color: #991b1b;
  opacity: 1;
}

/* Standalone correct/wrong (review mode — no .answered parent) */
.ce-option.correct {
  border-color: var(--correct);
  background: var(--correct-bg);
  color: #166534;
}

.ce-option.wrong {
  border-color: var(--wrong);
  background: var(--wrong-bg);
  color: #991b1b;
}

.ce-option:disabled { cursor: default; }

.ce-option-label { flex: 1; }

/* ── EXPLANATION BOX (Topics mode) ── */
.ce-explanation {
  margin: -10px 0 20px;
  padding: 14px 18px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text);
  letter-spacing: -0.01em;
  animation: fadeUp 0.3s cubic-bezier(0.22,1,0.36,1) forwards;
}

/* ── NEXT BUTTON ── */
.ce-q-footer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ce-next-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: -0.01em;
}

.ce-next-btn:hover { background: #0b6265; }
.ce-next-btn:disabled { opacity: 0.3; cursor: default; }

/* ══════════════════════════════════════════════════════════
   TIMER RING (simulation)
   ══════════════════════════════════════════════════════════ */

#ce-timer-ring {
  width: 52px;
  height: 52px;
}

#ce-timer-ring svg {
  width: 100%;
  height: 100%;
}

#ce-timer-ring .track {
  fill: none;
  stroke: var(--border);
  stroke-width: 3;
}

#ce-timer-ring .fill {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 1s linear;
}

#ce-timer-ring text {
  font-family: var(--font);
  letter-spacing: -0.02em;
}

.ce-timer-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

.ce-timer-critical { animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ══════════════════════════════════════════════════════════
   RESULT SCREEN
   ══════════════════════════════════════════════════════════ */

.ce-result {
  text-align: center;
  padding: 40px;
}

.ce-result h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.ce-result .muted {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.ce-result-score {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  margin-bottom: 20px;
}

.ce-result-grade { margin-bottom: 16px; }

.ce-result-status {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ce-result-status.pass {
  background: var(--correct-bg);
  color: #166534;
}

.ce-result-status.fail {
  background: var(--wrong-bg);
  color: #991b1b;
}

.ce-result-list {
  list-style: none;
  text-align: left;
  max-width: 320px;
  margin: 0 auto 24px;
}

.ce-result-list li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-mid);
  border-bottom: 1px solid var(--border-lt);
}

.ce-result-list li strong {
  color: var(--text);
  font-weight: 600;
}

.ce-result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Topics result layout ── */
.ce-result-layout {
  display: flex;
  gap: 28px;
  align-items: center;
  text-align: left;
}

.ce-result-main { flex: 1; }
.ce-result-ring { flex-shrink: 0; }

.ce-topics-ring {
  text-align: center;
}

.ce-topics-ring-svg {
  width: 80px;
  height: 80px;
}

.ce-topics-ring-caption {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  max-width: 120px;
}

/* ══════════════════════════════════════════════════════════
   REVIEW MODE
   ══════════════════════════════════════════════════════════ */

.ce-review-item {
  text-align: left;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-lt);
}

.ce-review-item:last-child {
  border-bottom: none;
}

/* ══════════════════════════════════════════════════════════
   TOPICS PAGE — Topic card selector
   ══════════════════════════════════════════════════════════ */

#topicContainer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  border-radius: var(--radius);
  font-family: var(--font);
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.18s ease;
  color: var(--text);
  text-align: left;
}

.topic-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.topic-card.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.topic-card.active .topic-card-pct,
.topic-card.active .topic-card-count {
  color: rgba(255,255,255,0.7);
}

.topic-card.active .topic-card-bar {
  background: rgba(255,255,255,0.2);
}

.topic-card.active .topic-card-bar-fill {
  background: rgba(255,255,255,0.7);
}

.topic-card.mastered {
  border-color: var(--correct);
  background: var(--correct-bg);
}

.topic-card.mastered .topic-card-bar-fill {
  background: var(--correct);
}

.topic-card-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.topic-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topic-card-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.topic-card-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.topic-card-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}

.topic-card-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.6s cubic-bezier(0.22,1,0.36,1);
}

@media (max-width: 900px) {
  #topicContainer {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  #topicContainer {
    grid-template-columns: 1fr;
  }
}

/* ── TOPIC CHIP (shared — used by flashcards) ── */
.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.18s ease;
  color: var(--text);
  letter-spacing: -0.01em;
}

.topic-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.topic-chip.selected,
.topic-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

#startBtn {
  margin-top: 16px;
  display: none;
}

/* ══════════════════════════════════════════════════════════
   v3 QUIZ LAYER — ported from Luxembourg/Denmark 18 Sep 2026
   Additive, scoped to body.qz-v3. Delete this block and remove
   class="qz-v3" from the quiz pages to revert.
   ══════════════════════════════════════════════════════════ */

body.qz-v3 { background: #faf7f1; }

/* ── HEADER CHIPS ── */
body.qz-v3 .ce-q-header { gap: 8px; margin-bottom: 18px; }
body.qz-v3 .ce-q-meta {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  background: #f6ebd6;
  color: #8a6417;
  font-size: 12.5px;
  font-weight: 700;
}

/* ── QUESTION ── */
body.qz-v3 .ce-question {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: -0.025em;
}

/* ── OPTIONS: lettered badges ── */
body.qz-v3 .ce-options { counter-reset: ceopt; gap: 11px; }

body.qz-v3 .ce-option {
  padding: 15px 18px;
  border-radius: 13px;
  gap: 13px;
  align-items: flex-start;
}

body.qz-v3 .ce-option::before {
  counter-increment: ceopt;
  content: counter(ceopt, upper-alpha);
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  transition: all 0.18s ease;
}

body.qz-v3 .ce-option-label { padding-top: 1px; }

body.qz-v3 .ce-option:hover:not(.answered):not(:disabled)::before {
  border-color: var(--accent);
  color: var(--accent);
}

body.qz-v3 .ce-option.correct::before,
body.qz-v3 .ce-options.answered .ce-option.correct::before {
  content: "\2713";
  background: var(--correct);
  border-color: var(--correct);
  color: #ffffff;
  font-size: 13px;
}
body.qz-v3 .ce-option.wrong::before,
body.qz-v3 .ce-options.answered .ce-option.wrong::before {
  content: "\2715";
  background: var(--wrong);
  border-color: var(--wrong);
  color: #ffffff;
  font-size: 12px;
}

/* ── PROGRESS BAR ──
   The pages already carry .ce-progress-global, driven by the
   engine. Restyled here rather than replaced. */
body.qz-v3 .ce-progress-global {
  height: 4px;
  border-radius: 3px;
  background: #ece9e2;
  margin-bottom: 20px;
}
body.qz-v3 .ce-progress-global-bar {
  border-radius: 3px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── NEXT BUTTON ── */
body.qz-v3 .ce-next-btn {
  padding: 13px 30px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════
   v3 QUIZ — MOBILE
   The card chrome is dropped so the question sits on the page
   like an app screen, and the next button becomes a sticky
   full-width bar within thumb reach.
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  body.qz-v3 .ce-card {
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  body.qz-v3 .ce-progress-global { margin-bottom: 16px; }

  body.qz-v3 .ce-question { font-size: 19px; }

  body.qz-v3 .ce-option {
    padding: 15px 16px;
    font-size: 14px;
    background: var(--surface);
  }

  body.qz-v3 .ce-options { margin-bottom: 18px; }

  body.qz-v3 .ce-q-footer {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 0 -16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(250, 247, 241, 0) 0%, #faf7f1 22%);
  }

  body.qz-v3 .ce-next-btn {
    width: 100%;
    justify-content: center;
    padding: 16px;
    border-radius: 14px;
    font-size: 15px;
  }
}

/* ══════════════════════════════════════════════════════════
   CZ — bilingual questions, pictures, "Jó tudni"
   (engine-hr.js). The exam is in Czech: the Czech line is the
   main text, the UI-language translation sits underneath.
   ══════════════════════════════════════════════════════════ */

.ce-question .ce-q-cs { display: block; }

.ce-question .ce-q-tr {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text-mid);
}
body.qz-v3 .ce-question .ce-q-tr { font-size: 14.5px; }

.ce-question u {
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.ce-option-label .ce-opt-cs { display: block; }

.ce-option-label .ce-opt-tr {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-mid);
}
.ce-options.answered .ce-option.correct .ce-opt-tr { color: #166534; }
.ce-options.answered .ce-option.wrong .ce-opt-tr { color: #991b1b; }

/* Picture under the question */
.ce-q-img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  margin: -10px auto 24px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  object-fit: contain;
}

/* Picture options: 2 x 2 grid, 1 column on phones */
.ce-options.ce-options-img {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ce-option.ce-option-img {
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 12px 12px;
  min-height: 120px;
}

/* The letter is rendered explicitly for picture options */
body.qz-v3 .ce-option.ce-option-img::before { display: none; }

.ce-opt-letter {
  position: absolute;
  top: 8px;
  left: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 21px;
  text-align: center;
}
.ce-option-img.correct .ce-opt-letter { background: var(--correct); border-color: var(--correct); color: #fff; }
.ce-option-img.wrong .ce-opt-letter { background: var(--wrong); border-color: var(--wrong); color: #fff; }

.ce-opt-img {
  display: block;
  max-width: 100%;
  max-height: 160px;
  width: auto;
  height: auto;
  border-radius: 6px;
  object-fit: contain;
}

@media (max-width: 479px) {
  .ce-options.ce-options-img { grid-template-columns: 1fr; }
}

/* "Jó tudni" explanation card (after answering; review list) */
.ce-explain {
  margin: -8px 0 22px;
  padding: 14px 18px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  animation: fadeUp 0.3s cubic-bezier(0.22,1,0.36,1) forwards;
}
.ce-explain-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.ce-explain-body {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text);
}
.ce-review-item .ce-explain { margin: 12px 0 0; }
.ce-review-item .ce-q-topic { font-size: 12px; color: var(--text-muted); margin: 4px 0 8px; }
.ce-review-item .ce-question { font-size: 16px; margin-bottom: 12px; }
.ce-review-item .ce-q-img { margin: 0 auto 14px; }

/* ══════════════════════════════════════════════════════════
   CZ — topics page: 30 topics in 9 groups (topics.html)
   ══════════════════════════════════════════════════════════ */
#topicContainer.grouped { display: block; }

.topic-group { margin-bottom: 18px; }

.topic-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px 14px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font);
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: all 0.18s ease;
}
.topic-group-head:hover { background: var(--accent-soft); border-color: var(--accent-mid); }
.topic-group-head.active { background: var(--accent-soft); border-color: var(--accent); }

.topic-group-check {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.topic-group-head.active .topic-group-check { background: var(--accent); border-color: var(--accent); }
.topic-group-head.active .topic-group-check::before { content: "\2713"; }
.topic-group-head.partial .topic-group-check { border-color: var(--accent); }
.topic-group-head.partial .topic-group-check::before { content: ""; width: 10px; height: 2px; background: var(--accent); border-radius: 1px; }

.topic-group-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.topic-group-name { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.topic-group-meta { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.topic-group-pct { font-size: 13px; font-weight: 700; color: var(--accent); }

.topic-group-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 900px) { .topic-group-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .topic-group-grid { grid-template-columns: 1fr; } }
/* a mastered topic that is also selected: show it as selected (white text stays readable) */
.topic-card.mastered.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.topic-card.mastered.active .topic-card-bar-fill { background: rgba(255,255,255,0.7); }

/* ── HR: typed answers in the simulation (written-answer questions) ── */
.ce-typed { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.ce-typed-hint { font-size: 14px; color: var(--text-muted); }
.ce-typed-row { display: flex; align-items: center; gap: 10px; }
.ce-typed-num { min-width: 22px; font-weight: 600; color: var(--text-muted); }
.ce-typed-input {
  flex: 1; min-width: 0; padding: 13px 14px; font-family: var(--font); font-size: 16px; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm, 10px); outline: none;
}
.ce-typed-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ce-typed-input.correct { border-color: var(--correct); background: var(--correct-bg); }
.ce-typed-input.wrong { border-color: var(--wrong); background: var(--wrong-bg); }
.ce-typed-input:disabled { color: var(--text); opacity: 1; -webkit-text-fill-color: var(--text); }
.ce-typed-check { align-self: flex-start; margin-top: 2px; }
.ce-typed-result { font-size: 15px; font-weight: 600; padding: 10px 12px; border-radius: var(--radius-sm, 10px); }
.ce-typed-result.correct, .ce-typed-result.spelling { color: var(--correct); background: var(--correct-bg); }
.ce-typed-result.wrong { color: var(--wrong); background: var(--wrong-bg); }
.ce-typed-review { cursor: default; margin-bottom: 8px; }
.ce-typed-review-label { font-weight: 600; margin-right: 4px; }

/* ══════════════════════════════════════════════════════════
   ΠΕΓΠ (Greece) — widgets for the seven official question
   formats: multi-answer MC, Σ/Λ, cloze, match, sort, list,
   plus the 🌐 peek button, exam chips and image placeholder.
   ══════════════════════════════════════════════════════════ */

/* ── 🌐 peek button (hold to see the other language) ── */
.ce-peek-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 3px 7px;
  opacity: 0.55;
  transition: opacity 0.15s, border-color 0.15s, background 0.15s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.ce-peek-btn:hover { opacity: 0.9; border-color: var(--accent); }
.ce-card.peeking .ce-peek-btn { opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.ce-card.peeking [data-alt] { color: var(--accent); }
.ce-card.peeking .ce-option [data-alt] { color: inherit; font-style: italic; }

/* ── Chip "In the exam: open answer / map" ── */
.ce-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: -8px 0 14px;
}
.ce-chip-exam { background: #fef3c7; color: #92400e; }

/* ── Hints / notes under the question ── */
.ce-widget-hint { font-size: 13.5px; color: var(--text-muted); margin: 0 0 12px; }
.ce-widget-note { font-size: 13px; font-style: italic; color: var(--text-muted); margin: -6px 0 12px; }

/* ── Image placeholder (pictures not yet available) ── */
.ce-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 120px;
  margin: 0 0 22px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm, 10px);
  background: var(--bg, #faf7f1);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}
.ce-img-placeholder-icon { font-size: 26px; opacity: 0.6; }

/* ── Check button + result line (training) ── */
.ce-check-btn { margin: 4px 0 18px; }
.ce-check-result {
  font-size: 15px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius-sm, 10px);
  margin: 0 0 18px;
}
.ce-check-result.correct { color: var(--correct); background: var(--correct-bg); }
.ce-check-result.wrong { color: var(--wrong); background: var(--wrong-bg); }

/* ── Simulation: selected option (no feedback yet) ── */
.ce-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
body.qz-v3 .ce-option.selected::before {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

/* ── Multi-answer MC: checkboxes ── */
.ce-options-multi .ce-option-multi { align-items: center; }
body.qz-v3 .ce-options-multi .ce-option::before { display: none; }
.ce-checkbox {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  position: relative;
  transition: all 0.18s ease;
}
.ce-option-multi.checked { border-color: var(--accent); background: var(--accent-soft); }
.ce-option-multi.checked .ce-checkbox { border-color: var(--accent); background: var(--accent); }
.ce-option-multi.checked .ce-checkbox::after {
  content: "\2713";
  position: absolute;
  inset: 0;
  color: #ffffff;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  font-weight: 700;
}
.ce-options.answered .ce-option-multi.correct .ce-checkbox { border-color: var(--correct); background: var(--correct); }
.ce-options.answered .ce-option-multi.correct .ce-checkbox::after { content: "\2713"; position: absolute; inset: 0; color: #fff; font-size: 13px; line-height: 20px; text-align: center; }
.ce-options.answered .ce-option-multi.wrong .ce-checkbox { border-color: var(--wrong); background: var(--wrong); }
.ce-options.answered .ce-option-multi.wrong .ce-checkbox::after { content: "\2715"; position: absolute; inset: 0; color: #fff; font-size: 12px; line-height: 20px; text-align: center; }

/* ── Σ/Λ rows ── */
.ce-tf { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.ce-tf-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  font-size: 14.5px;
  line-height: 1.45;
}
.ce-tf-num { font-weight: 700; color: var(--text-muted); min-width: 20px; }
.ce-tf-text { flex: 1; }
.ce-tf-toggle { display: inline-flex; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.ce-tf-btn {
  min-width: 40px;
  padding: 7px 12px;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ce-tf-btn + .ce-tf-btn { border-left: 1.5px solid var(--border); }
.ce-tf-btn:hover:not(:disabled) { color: var(--accent); background: var(--accent-soft); }
.ce-tf-btn.on { background: var(--accent); color: #ffffff; }
.ce-tf-btn:disabled { cursor: default; }
.ce-tf-row.correct { border-color: var(--correct); background: var(--correct-bg); }
.ce-tf-row.wrong { border-color: var(--wrong); background: var(--wrong-bg); }
.ce-tf-row.correct .ce-tf-btn.on { background: var(--correct); }
.ce-tf-row.wrong .ce-tf-btn.on { background: var(--wrong); }
.ce-tf-btn.reveal { background: var(--correct); color: #ffffff; outline: 2px dashed var(--correct); outline-offset: -2px; }
.ce-tf-answer { margin-left: auto; font-weight: 600; }
.ce-tf-answer s { color: var(--wrong); font-weight: 500; margin-left: 4px; }

/* ── Cloze ── */
.ce-cloze { margin-bottom: 18px; }
.ce-cloze-bank { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.ce-cloze-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.ce-cloze-text { font-size: 15.5px; line-height: 2.1; }
.ce-cloze-line + .ce-cloze-line { margin-top: 6px; }
.ce-cloze-blank { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; margin: 0 2px; }
.ce-cloze-select,
.ce-match-select {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 6px 28px 6px 10px;
  max-width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2.5'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ce-cloze-select:focus, .ce-match-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ce-cloze-select.correct, .ce-match-row.correct .ce-match-select, .ce-cloze-input.correct { border-color: var(--correct); background-color: var(--correct-bg); }
.ce-cloze-select.wrong, .ce-match-row.wrong .ce-match-select, .ce-cloze-input.wrong { border-color: var(--wrong); background-color: var(--wrong-bg); }
.ce-cloze-select:disabled, .ce-match-select:disabled { opacity: 1; color: var(--text); }
.ce-cloze-input { width: 11em; max-width: 60vw; padding: 6px 10px; line-height: 1.3; font-size: 14.5px; }
.ce-cloze-fix, .ce-match-fix {
  font-size: 13px;
  font-weight: 700;
  color: var(--correct);
  background: var(--correct-bg);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}
.ce-cloze-word.correct { color: var(--correct); }
.ce-cloze-word.wrong { color: var(--correct); text-decoration: underline; text-decoration-style: dotted; }
.ce-cloze-user { color: var(--wrong); }

/* ── Match ── */
.ce-match { margin-bottom: 18px; }
.ce-match-col-title { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 8px; }
.ce-match-col2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 4px 16px;
  padding: 12px 14px;
  margin: 0 0 16px;
  border-radius: var(--radius-sm, 10px);
  background: var(--accent-soft);
  font-size: 14px;
}
.ce-match-col2 .ce-match-col-title { grid-column: 1 / -1; }
.ce-match-col2-item { display: flex; gap: 8px; align-items: baseline; }
.ce-match-letter { font-weight: 700; color: var(--accent); min-width: 1.6em; }
.ce-match-rows { display: flex; flex-direction: column; gap: 8px; }
.ce-match-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  font-size: 14.5px;
}
.ce-match-num { font-weight: 700; color: var(--text-muted); min-width: 20px; }
.ce-match-left { flex: 1 1 160px; }
.ce-match-select { flex: 0 1 240px; }
.ce-match-row.correct { border-color: var(--correct); background: var(--correct-bg); }
.ce-match-row.wrong { border-color: var(--wrong); background: var(--wrong-bg); }
.ce-match-arrow { color: var(--text-muted); }
.ce-match-right s { color: var(--wrong); margin-left: 4px; }

/* ── Sort ── */
.ce-sort { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.ce-sort-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  font-size: 14.5px;
}
.ce-sort-item { flex: 1 1 140px; font-weight: 500; }
.ce-sort-toggle { display: inline-flex; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; }
.ce-sort-btn {
  padding: 7px 14px;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ce-sort-btn + .ce-sort-btn { border-left: 1.5px solid var(--border); }
.ce-sort-btn:hover:not(:disabled) { color: var(--accent); background: var(--accent-soft); }
.ce-sort-btn.on { background: var(--accent); color: #ffffff; }
.ce-sort-btn:disabled { cursor: default; }
.ce-sort-row.correct { border-color: var(--correct); background: var(--correct-bg); }
.ce-sort-row.wrong { border-color: var(--wrong); background: var(--wrong-bg); }
.ce-sort-row.correct .ce-sort-btn.on { background: var(--correct); }
.ce-sort-row.wrong .ce-sort-btn.on { background: var(--wrong); }
.ce-sort-btn.reveal { background: var(--correct); color: #ffffff; }
.ce-sort-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.ce-sort-group { padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 11px; background: var(--surface); }
.ce-sort-group-title { font-weight: 700; margin-bottom: 6px; color: var(--accent); }
.ce-sort-group ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.7; }
.ce-sort-group li.correct { color: #166534; }
.ce-sort-group li.wrong { color: #991b1b; }
.ce-sort-group li s { margin-left: 4px; opacity: 0.8; }

/* ── List (simulation typed answers) + accepted answers in the review ── */
.ce-list { margin-bottom: 18px; }
.ce-list-answers { padding: 12px 14px; border-radius: 11px; background: var(--accent-soft); font-size: 14px; }
.ce-list-answers-title { font-weight: 700; margin-bottom: 4px; }
.ce-list-indicative { font-weight: 500; color: var(--text-muted); }
.ce-list-answers ul { margin: 0; padding-left: 18px; line-height: 1.7; }

/* ── Review ── */
.ce-review-answer { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ce-review-static { margin-top: 10px; margin-bottom: 0; }
.ce-review-item .ce-tf-row, .ce-review-item .ce-match-row { font-size: 14px; }
.ce-review-unanswered { font-size: 13px; color: var(--text-muted); margin: -14px 0 12px; }

/* ── Results: ΠΕΓΠ points ── */
.ce-result-points {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin: -8px 0 14px;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .ce-tf-row { align-items: flex-start; }
  .ce-tf-toggle { margin-left: auto; }
  .ce-match-select { flex-basis: 100%; }
  .ce-cloze-text { font-size: 15px; }
  .ce-cloze-input { width: 9em; }
}

/* ══════════════════════════════════════════════════════════
   ΠΕΓΠ v2 — hint-language chip (next to 🌐) and the map widget
   ══════════════════════════════════════════════════════════ */

/* ── "EN ▾" hint-language chip + menu ── */
.ce-hint-chip-wrap { position: relative; display: inline-flex; }
.ce-hint-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 7px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: none;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-mid);
  cursor: pointer;
  line-height: 1.2;
  transition: border-color 0.15s, color 0.15s;
}
.ce-hint-chip:hover, .ce-hint-chip[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.ce-hint-chip-caret { font-size: 9px; opacity: 0.7; }
.ce-hint-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 150px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 10px);
  box-shadow: var(--shadow-md, 0 4px 16px rgba(0,0,0,0.08));
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ce-hint-menu[hidden] { display: none; }
.ce-hint-menu-item {
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.ce-hint-menu-item:hover { background: var(--surface-alt); }
.ce-hint-menu-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

/* ── Map widget ── */
.ce-map { margin-bottom: 18px; }
.ce-map-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.ce-map-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 6px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.ce-map-chip:hover { border-color: var(--accent); }
.ce-map-chip-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 700;
}
.ce-map-chip.placed .ce-map-chip-num { background: var(--accent); color: #fff; }
.ce-map-chip.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-mid); }
.ce-map-chip.correct { border-color: var(--correct); background: var(--correct-bg); }
.ce-map-chip.correct .ce-map-chip-num { background: var(--correct); color: #fff; }
.ce-map-chip.wrong { border-color: var(--wrong); background: var(--wrong-bg); }
.ce-map-chip.wrong .ce-map-chip-num { background: var(--wrong); color: #fff; }
.ce-map-chip:disabled { cursor: default; }
.ce-map-chip-extra:empty { display: none; }
.ce-map-chip-extra { font-size: 12px; font-weight: 500; color: var(--wrong); }

.ce-map-stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 10px);
  overflow: hidden;
  background: #e6f1f5;
}
.ce-map-svg {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ce-map.answered .ce-map-svg, .ce-map-review .ce-map-svg { cursor: default; }
.ce-map-sea { fill: #e6f1f5; }
.ce-map-neighbours { fill: #e4e2dd; stroke: none; }
.ce-map-greece { fill: #f7f4ec; stroke: var(--accent); stroke-width: 1.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ce-map-pins, .ce-map-fb { pointer-events: none; }
.ce-map-pin-dot { fill: var(--accent); stroke: #fff; stroke-width: 2.5; }
.ce-map-pin.selected .ce-map-pin-dot { fill: var(--orange); }
.ce-map-pin.correct .ce-map-pin-dot { fill: var(--correct); }
.ce-map-pin.wrong .ce-map-pin-dot { fill: var(--wrong); }
.ce-map-pin-num { fill: #fff; font-family: var(--font); font-size: 11px; font-weight: 800; }
.ce-map-pin-label {
  fill: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(255,255,255,0.92);
  stroke-width: 3.5px;
  stroke-linejoin: round;
}
.ce-map-ring circle { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.ce-map-fb-line { stroke: var(--wrong); fill: none; opacity: 0.8; }
.ce-map-km text {
  fill: var(--wrong);
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(255,255,255,0.92);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.ce-map-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ce-map-zoom-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.ce-map-zoom-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ce-map-zoom-btn:disabled { opacity: 0.4; cursor: default; }

.ce-map-status { font-size: 13px; font-weight: 600; color: var(--text-mid); margin: 0 0 14px; }

/* Review (static map + legend) */
.ce-map-review { margin: 10px 0 0; }
.ce-map-review .ce-map-stage { margin-bottom: 8px; }
.ce-map-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; }
.ce-map-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ce-map-legend-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 700; color: #fff; background: var(--text-muted);
}
.ce-map-legend li.correct .ce-map-legend-num { background: var(--correct); }
.ce-map-legend li.wrong .ce-map-legend-num { background: var(--wrong); }
.ce-map-legend-km { font-size: 12px; color: var(--text-muted); }

@media (max-width: 640px) {
  .ce-map-chip { font-size: 13px; padding: 5px 10px 5px 5px; }
  .ce-map-stage { max-width: none; }
  .ce-map-zoom-btn { width: 36px; height: 36px; }
}
