/* ──────────────────────────────────────────────────────────────────────────
   Inline explainer (research §3.1 role 1) — selection-triggered AI tooltip
   ────────────────────────────────────────────────────────────────────────── */

#explainer-floater {
  position: absolute;
  z-index: 80;
  background: var(--c-text);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  display: none;
  white-space: nowrap;
  border: none;
  font-family: inherit;
  transition: transform var(--t-fast);
}
#explainer-floater:hover { transform: translateY(-1px); }
#explainer-floater::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  margin-left: -5px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--c-text);
}
#explainer-floater.visible { display: block; }

#explainer-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
}
#explainer-modal.open { display: flex; }
.explainer-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  max-width: 540px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
}
.explainer-head {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s-3);
}
.explainer-head-title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-primary-text);
  margin-bottom: 4px;
}
.explainer-head-term {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.explainer-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--c-text-muted);
  padding: 4px 8px;
  border-radius: var(--r);
  flex-shrink: 0;
}
.explainer-close:hover { color: var(--c-text); background: var(--c-surface-2); }
.explainer-body {
  padding: var(--s-5);
  overflow-y: auto;
  flex: 1;
  font-size: var(--fs-base);
  line-height: var(--lh-loose);
  color: var(--c-text);
  white-space: pre-wrap;
}
.explainer-loading {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--c-text-muted);
}
.explainer-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: explainer-spin 0.8s linear infinite;
}
@keyframes explainer-spin { to { transform: rotate(360deg); } }
.explainer-foot {
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  background: var(--c-surface-2);
}

/* ──────────────────────────────────────────────────────────────────────────
   Practice trainer modal (research §3.1 role 3) — pre-assessment
   ────────────────────────────────────────────────────────────────────────── */

#practice-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4);
}
#practice-modal[hidden] { display: none; }
.practice-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  max-width: 600px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 100px rgba(0,0,0,0.4);
}
.practice-head {
  padding: var(--s-5) var(--s-6);
  background: linear-gradient(135deg, var(--c-primary), #1d4ed8);
  color: #fff;
}
.practice-head-eyebrow {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
  margin-bottom: 6px;
}
.practice-head-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  margin: 0;
}
.practice-progress {
  margin-top: var(--s-3);
  display: flex;
  gap: 4px;
}
.practice-progress-step {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
}
.practice-progress-step.is-done { background: rgba(255,255,255,0.95); }
.practice-body {
  padding: var(--s-6);
  overflow-y: auto;
  flex: 1;
}
.practice-q-num {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-primary-text);
  margin-bottom: var(--s-2);
}
.practice-q-text {
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--c-text);
  margin-bottom: var(--s-4);
}
.practice-options {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}
.practice-option {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 2px solid var(--c-border);
  border-radius: var(--r);
  cursor: pointer;
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.practice-option:hover { border-color: var(--c-border-strong); }
.practice-option.is-selected {
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
}
.practice-option-marker {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--c-border-strong);
  flex-shrink: 0;
  margin-top: 1px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.practice-option.is-selected .practice-option-marker {
  border-color: var(--c-primary);
  background: var(--c-primary);
  box-shadow: inset 0 0 0 3px var(--c-surface);
}
.practice-hint {
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: var(--r);
  font-size: var(--fs-sm);
  color: #92400e;
  line-height: var(--lh-normal);
  white-space: pre-wrap;
}
.practice-foot {
  padding: var(--s-4) var(--s-6);
  border-top: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.practice-foot-left { display: flex; gap: var(--s-2); }
