:root {
  --bg: #f6faf7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f0fdf4;
  --primary: #1f6f3f;
  --primary-hover: #16532e;
  --primary-light: #dcfce7;
  --accent: #0f766e;
  --emerald: #10b981;
  --emerald-light: #d1fae5;
  --amber: #f59e0b;
  --amber-light: #fef3c7;
  --rose: #e11d48;
  --rose-light: #ffe4e6;
  --green-600: #047857;
  --amber-600: #b45309;
  --danger: #be123c;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --border: #dce7df;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 16px 36px rgba(31, 111, 63, 0.14);
  --radius: 14px;
  --radius-sm: 9px;
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111827;
  --surface-2: #1e293b;
  --surface-3: #132a1e;
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --muted: #94a3b8;
  --border: #334155;
  --dark-surface-3: #1e293b;
  --dark-primary: #4ade80;
  --dark-primary-hover: #86efac;
  --dark-primary-light: rgba(34, 197, 94, 0.2);
  --btn-primary-bg: #1f6f3f;
  --btn-primary-hover-bg: #16532e;
  --dark-selected-bg: rgba(31, 111, 63, 0.26);
  --dark-soft-bg: rgba(34, 197, 94, 0.14);
  --dark-soft-text: #bbf7d0;
  --dark-soft-border: rgba(74, 222, 128, 0.35);
  --dark-pill-text: #bbf7d0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Header & Navigation */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), #15803d);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(31, 111, 63, 0.28);
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
}

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

.nav-btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.18s ease;
}

.nav-btn:hover {
  background: var(--surface-3);
  color: var(--primary);
}

.nav-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(31, 111, 63, 0.25);
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px calc(120px + env(safe-area-inset-bottom));
}

/* Buttons & Inputs */
button, .btn {
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.15s ease;
  text-decoration: none;
}

button:hover, .btn:hover {
  border-color: #94a3b8;
  background: var(--surface-2);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.btn-success {
  background: var(--green-600);
  color: #fff;
  border-color: var(--green-600);
}

.btn-success:hover {
  background: #059669;
  border-color: #059669;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #9f1239;
  border-color: #9f1239;
}

.btn-soft {
  background: var(--surface-3);
  color: var(--primary);
  border-color: var(--primary-light);
}

.btn-soft:hover {
  background: var(--primary-light);
}

.btn-lg {
  padding: 12px 22px;
  font-size: 15px;
  border-radius: 11px;
}

button, .btn, .nav-btn, a.btn, select, input {
  min-height: 44px;
}

button, .btn, .nav-btn, a.btn {
  min-width: 44px;
}

.btn-sm {
  padding: 9px 14px;
  font-size: 13px;
  border-radius: 8px;
  min-height: 44px;
  min-width: 44px;
}

input, select, textarea {
  font: inherit;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}

input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 13px;
  margin: -8px 0;
  border: none;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

input[type="checkbox"]::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid #94a3b8;
  background: var(--surface);
  transition: all 0.15s ease;
}

input[type="checkbox"]:checked::before {
  border-color: var(--primary);
  background: var(--primary);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 15px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2.2px 2.2px 0;
  transform: rotate(45deg);
}

input[type="radio"]::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #94a3b8;
  background: var(--surface);
}

input[type="radio"]:checked::before {
  border-color: var(--primary);
  border-width: 6px;
}

a.legal-link, .legal-links a, .modal-content a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 6px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 111, 63, 0.16);
}

label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

/* Cards & Grid */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .container { padding: 16px 14px calc(120px + env(safe-area-inset-bottom)); }
}

/* Mode Selector Cards */
.mode-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mode-card:hover {
  border-color: #86efac;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mode-card.selected {
  border-color: var(--primary);
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  box-shadow: var(--shadow-lg);
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--primary);
  width: fit-content;
  margin-bottom: 10px;
}

.mode-card.selected .mode-badge {
  background: var(--primary);
  color: #fff;
}

.mode-title {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--text);
}

.mode-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}

.mode-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* Badges & Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--primary);
}

.pill-green {
  background: var(--emerald-light);
  color: #065f46;
}

.pill-amber {
  background: var(--amber-light);
  color: #92400e;
}

.pill-rose {
  background: var(--rose-light);
  color: #9f1239;
}

.pill-blue {
  background: #dbeafe;
  color: #1e40af;
}

/* Progress Strip & KPI */
.progress-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13.5px;
}

.progress-strip-main {
  color: var(--text);
}

.progress-strip-meta {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.stat-val {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
}

.stat-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* Live Exam Header */
.exam-header {
  background: linear-gradient(135deg, #0b2e1a, #16532e, #1f6f3f);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}

.exam-steps {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.exam-step {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.82);
}

.exam-step.active {
  background: #fff;
  color: #16532e;
}

.exam-step.done {
  background: rgba(16, 185, 129, 0.32);
  color: #d1fae5;
}

.exam-layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 920px) {
  .exam-layout {
    grid-template-columns: 1fr;
  }
}

.question-box {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  position: relative;
}

/* Timer & Progress */
.timer-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.timer-digits {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

.timer-digits.warn {
  color: var(--amber-600);
}

.timer-digits.danger {
  color: var(--danger);
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s linear;
}

/* Structure & Written Expression Question Styling */
.st-sentence {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.75;
  color: var(--text);
  margin: 12px 0 18px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.st-blank {
  display: inline-block;
  min-width: 72px;
  padding: 1px 12px;
  margin: 0 3px;
  border-bottom: 2.5px solid var(--primary);
  background: var(--surface-3);
  color: var(--primary);
  font-weight: 800;
  text-align: center;
  border-radius: 6px 6px 0 0;
}

.we-sentence {
  font-size: 18px;
  font-weight: 500;
  line-height: 2.35;
  color: var(--text);
  margin: 12px 0 18px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  word-wrap: break-word;
}

.we-seg {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: top;
  margin: 0 3px;
  padding: 2px 6px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.14s ease;
  line-height: 1.3;
}

.we-seg:hover {
  background: var(--surface-3);
}

.we-seg-txt {
  border-bottom: 2.5px solid var(--text);
  padding-bottom: 2px;
  font-weight: 700;
}

.we-seg-lbl {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.we-seg.selected {
  background: var(--primary-light);
}

.we-seg.selected .we-seg-txt {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.we-seg.selected .we-seg-lbl {
  color: var(--primary);
}

.we-seg.is-correct {
  background: var(--emerald-light);
}

.we-seg.is-correct .we-seg-txt {
  border-bottom-color: var(--green-600);
  color: #065f46;
}

.we-seg.is-wrong {
  background: var(--rose-light);
}

.we-seg.is-wrong .we-seg-txt {
  border-bottom-color: var(--danger);
  color: var(--danger);
}

.mc-opt-btn, .we-opt-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  padding: 12px 16px;
  min-height: 48px;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.mc-opt-btn:hover, .we-opt-btn:hover {
  border-color: var(--primary);
  background: var(--surface-3);
}

.mc-opt-btn.selected, .we-opt-btn.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-hover);
  font-weight: 700;
}

.mc-opt-btn.opt-correct, .we-opt-btn.opt-correct {
  background: var(--emerald-light);
  border-color: var(--green-600);
  color: #065f46;
}

.mc-opt-btn.opt-wrong, .we-opt-btn.opt-wrong {
  background: var(--rose-light);
  border-color: var(--danger);
  color: #9f1239;
}

.opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.selected .opt-letter {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Doubt Flags & Navigator */
.doubt-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.btn-doubt-1.active {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
}

.btn-doubt-2.active {
  background: #ffe4e6;
  border-color: #e11d48;
  color: #9f1239;
}

.q-nav-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  gap: 6px;
}

.q-nav-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  position: relative;
}

.q-nav-btn.current {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(31, 111, 63, 0.25);
}

.q-nav-btn.answered {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.q-nav-btn.doubt-1 {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
}

.q-nav-btn.doubt-2 {
  background: #ffe4e6;
  border-color: #e11d48;
  color: #9f1239;
}

.q-nav-btn.nav-ok {
  background: var(--emerald-light);
  border-color: var(--green-600);
  color: #065f46;
}

.q-nav-btn.nav-bad {
  background: var(--rose-light);
  border-color: var(--danger);
  color: #9f1239;
}

/* Lesson Blocks (Materi 26 Bab) */
.lesson-h {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  margin: 22px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-light);
}

.callout {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 14px 0;
  border-left: 4px solid var(--primary);
  background: var(--surface-3);
  font-size: 14px;
}

.callout-title {
  font-weight: 800;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.callout-trap {
  border-left-color: var(--rose);
  background: var(--rose-light);
  color: #881337;
}

.callout-idea {
  border-left-color: var(--primary);
  background: var(--primary-light);
  color: #14532d;
}

.callout-tip {
  border-left-color: var(--emerald);
  background: var(--emerald-light);
  color: #065f46;
}

.callout-amber {
  border-left-color: var(--amber);
  background: var(--amber-light);
  color: #78350f;
}

.trap-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--rose);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 10px 0;
  display: grid;
  gap: 6px;
}

.trap-wrong {
  color: var(--danger);
  font-weight: 700;
}

.trap-right {
  color: var(--green-600);
  font-weight: 700;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 14px 0;
}

@media (max-width: 720px) {
  .compare-grid {
    grid-template-columns: 1fr;
  }
}

.compare-box {
  border-radius: 11px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.compare-box-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 6px;
}

/* Tables & Peta Kesalahan Matrix */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table-wrap th,
.table-wrap td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table-wrap th {
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
}

.peta-cell {
  text-align: center !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 34px;
}

.peta-cell-0 { color: var(--muted); }
.peta-cell-1 { background: #fef3c7; color: #92400e; }
.peta-cell-2 { background: #fed7aa; color: #9a3412; }
.peta-cell-3 { background: #ffe4e6; color: #9f1239; }

.err-correction-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.err-wrong-badge {
  color: var(--danger);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.err-right-badge {
  color: var(--green-600);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Utilities, Flex & Modal */
.flex {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-content {
  background: var(--surface);
  border-radius: 16px;
  width: min(920px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
}

.hist-row, .stu-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.hist-row:hover, .stu-row:hover {
  background: var(--surface-2) !important;
}

.start-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.10);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}

.notes-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  line-height: 1.45;
}

.otopsi-row-ok { background: var(--surface); }
.otopsi-row-bad { background: #fff1f2; }
.otopsi-key-text { color: #065f46; }

/* Dark Mode Overrides */
:root[data-theme="dark"] .mode-card.selected {
  background: linear-gradient(180deg, rgba(31, 111, 63, 0.25) 0%, var(--surface) 100%);
  border-color: #4ade80;
}

:root[data-theme="dark"] .mode-card:hover {
  border-color: #4ade80;
}

:root[data-theme="dark"] .question-box {
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
  border-color: #334155;
}

:root[data-theme="dark"] .we-seg.selected,
:root[data-theme="dark"] .mc-opt-btn.selected,
:root[data-theme="dark"] .we-opt-btn.selected {
  background: rgba(31, 111, 63, 0.35);
  border-color: #4ade80;
  color: #dcfce7;
}

:root[data-theme="dark"] .we-seg.is-correct,
:root[data-theme="dark"] .mc-opt-btn.opt-correct,
:root[data-theme="dark"] .we-opt-btn.opt-correct {
  background: rgba(16, 185, 129, 0.24);
  border-color: #34d399;
  color: #a7f3d0;
}

:root[data-theme="dark"] .we-seg.is-wrong,
:root[data-theme="dark"] .mc-opt-btn.opt-wrong,
:root[data-theme="dark"] .we-opt-btn.opt-wrong {
  background: rgba(244, 63, 94, 0.22);
  border-color: #fb7185;
  color: #fecdd3;
}

:root[data-theme="dark"] .callout-trap {
  background: rgba(225, 29, 72, 0.16);
  color: #fecdd3;
}

:root[data-theme="dark"] .callout-idea {
  background: rgba(31, 111, 63, 0.26);
  color: #dcfce7;
}

:root[data-theme="dark"] .callout-tip {
  background: rgba(16, 185, 129, 0.18);
  color: #a7f3d0;
}

:root[data-theme="dark"] .callout-amber {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

:root[data-theme="dark"] .start-bar {
  background: rgba(17, 24, 39, 0.96);
}

:root[data-theme="dark"] .otopsi-row-ok { background: #111827 !important; }
:root[data-theme="dark"] .otopsi-row-bad { background: rgba(244, 63, 94, 0.12) !important; }
:root[data-theme="dark"] .otopsi-key-text { color: #6ee7b7 !important; }
:root[data-theme="dark"] .peta-cell-1 { background: rgba(245, 158, 11, 0.24); color: #fde68a; }
:root[data-theme="dark"] .peta-cell-2 { background: rgba(234, 88, 12, 0.26); color: #fed7aa; }
:root[data-theme="dark"] .peta-cell-3 { background: rgba(225, 29, 72, 0.26); color: #fecdd3; }
:root[data-theme="dark"] .q-nav-btn.answered { background: rgba(31, 111, 63, 0.35); border-color: #4ade80; color: #dcfce7; }
:root[data-theme="dark"] .q-nav-btn.doubt-1 { background: rgba(245, 158, 11, 0.24); border-color: #fbbf24; color: #fde68a; }
:root[data-theme="dark"] .q-nav-btn.doubt-2 { background: rgba(225, 29, 72, 0.24); border-color: #fb7185; color: #fecdd3; }
:root[data-theme="dark"] .q-nav-btn.nav-ok { background: rgba(16, 185, 129, 0.24); border-color: #34d399; color: #a7f3d0; }
:root[data-theme="dark"] .q-nav-btn.nav-bad { background: rgba(225, 29, 72, 0.24); border-color: #fb7185; color: #fecdd3; }

.topbar .nav-btn,
button[data-open-book].btn-sm,
.gh-book-btn,
.mode-card-actions .btn-primary,
.mode-card-actions .btn-soft,
.mode-card-actions [data-open-book] {
  min-height: 44px !important;
  min-width: 44px !important;
}
