/* ═══════════════════════════════════════════════════════════════
   Exam Preparation Module — shared styles
   Used by exam-prep*.html pages.
   ═══════════════════════════════════════════════════════════════ */

.sb-content { padding: 0; overflow-y: auto; }

/* ── Outer wrapper ─────────────────────────────────────────────── */
.ep-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  width: 100%;
}

/* ── Page header ───────────────────────────────────────────────── */
.ep-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.ep-icon {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(155,93,229,.22), rgba(6,214,224,.16));
  border: 1.5px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
}
.ep-icon svg { width: 26px; height: 26px; stroke: var(--violet); stroke-width: 1.8; fill: none; }
.ep-title  { font-family: 'Unbounded', sans-serif; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.ep-sub    { font-size: .82rem; color: var(--text-2); margin-top: 2px; }

/* ── Tabs bar ──────────────────────────────────────────────────── */
.ep-tabs {
  display: flex; gap: 4px; margin: 18px 0 26px;
  border-bottom: 1.5px solid var(--border);
  overflow-x: auto;
}
.ep-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px;
  font-family: 'Manrope', sans-serif; font-size: .9rem; font-weight: 600;
  color: var(--text-2); text-decoration: none;
  border-bottom: 2.5px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.ep-tab:hover  { color: var(--violet); }
.ep-tab.active { color: var(--violet); border-bottom-color: var(--violet); }
.ep-tab svg    { width: 15px; height: 15px; stroke-width: 2; }

/* ── Cards / sections ──────────────────────────────────────────── */
.ep-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 16px;
  transition: border-color .15s;
}
.ep-card:hover { border-color: var(--border-h); }
.ep-card h3 {
  font-family: 'Unbounded', sans-serif;
  font-size: 1rem; font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -.01em;
}
.ep-card .ep-card-hint {
  font-size: .8rem; color: var(--text-3); margin-bottom: 14px;
}

/* ── Stat grid for dashboard ───────────────────────────────────── */
.ep-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.ep-stat {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.ep-stat-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-3);
  margin-bottom: 8px;
}
.ep-stat-value {
  font-family: 'Unbounded', sans-serif;
  font-size: 1.5rem; font-weight: 800; line-height: 1; letter-spacing: -.02em;
  color: var(--text);
}
.ep-stat-value.ep-violet { color: var(--violet); }
.ep-stat-value.ep-good   { color: #06D6A0; }
.ep-stat-value.ep-warn   { color: #F8961E; }
.ep-stat-sub {
  font-size: .72rem; color: var(--text-3); margin-top: 4px;
}

/* ── Progress bar ──────────────────────────────────────────────── */
.ep-bar {
  height: 8px;
  background: rgba(155,93,229,.10);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}
.ep-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), #06D6E0);
  border-radius: 999px;
  transition: width .35s ease;
}

/* ── Empty / placeholder state ─────────────────────────────────── */
.ep-empty {
  padding: 56px 20px; text-align: center; color: var(--text-3);
}
.ep-empty svg {
  width: 44px; height: 44px; opacity: .45; margin-bottom: 12px;
  stroke: var(--text-3); stroke-width: 1.5; fill: none;
}
.ep-empty h4 {
  font-family: 'Unbounded', sans-serif;
  font-size: 1rem; font-weight: 700; color: var(--text-2);
  margin-bottom: 6px;
}
.ep-empty p { font-size: .85rem; max-width: 380px; margin: 0 auto; }

/* ── CTA action buttons ────────────────────────────────────────── */
.ep-cta-row {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px;
}
.ep-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border: 1.5px solid var(--violet);
  border-radius: 10px;
  background: rgba(155,93,229,.08);
  color: var(--violet);
  font-family: 'Manrope', sans-serif; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: all .15s;
  text-decoration: none;
}
.ep-btn:hover { background: var(--violet); color: #fff; }
.ep-btn.ep-btn-primary {
  background: var(--violet); color: #fff;
}
.ep-btn.ep-btn-primary:hover { filter: brightness(1.08); }
.ep-btn svg { width: 14px; height: 14px; stroke-width: 2; }

/* ── Skeleton loaders ──────────────────────────────────────────── */
.ep-skel {
  background: linear-gradient(90deg, rgba(15,23,42,.05) 0%, rgba(15,23,42,.10) 50%, rgba(15,23,42,.05) 100%);
  background-size: 200% 100%;
  animation: ep-skel-anim 1.4s ease-in-out infinite;
  border-radius: 6px;
  display: inline-block;
}
@keyframes ep-skel-anim {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ═══════════════════════════════════════════════════════════════
   Variants view (`vp-*`)  — used by exam-prep-variants.html
   ═══════════════════════════════════════════════════════════════ */

/* Picker button in the header row */
.vp-picker-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1.5px solid var(--border-h);
  border-radius: 10px;
  background: var(--surface); color: var(--text);
  font-family: 'Manrope', sans-serif; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.vp-picker-btn:hover { border-color: var(--violet); color: var(--violet); }
.vp-picker-btn .vp-chev {
  width: 14px; height: 14px; transition: transform .2s;
}
.vp-picker-btn.open .vp-chev { transform: rotate(180deg); }

/* Picker overlay */
.vp-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.55); z-index: 300;
  align-items: flex-start; justify-content: center; padding-top: 80px;
  backdrop-filter: blur(2px);
}
.vp-overlay.visible { display: flex; }
.vp-panel {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.32);
  width: min(680px, 94vw); max-height: calc(100vh - 120px);
  overflow-y: auto; padding: 22px 22px 26px;
  animation: vp-in .18s ease;
}
@keyframes vp-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.vp-panel-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px;
}
.vp-panel-head h2 {
  font-family: 'Unbounded', sans-serif; font-size: 1rem; font-weight: 800;
}
.vp-panel-close {
  width: 32px; height: 32px; border: none; background: none;
  color: var(--text-2); cursor: pointer; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.vp-panel-close:hover { background: var(--border); color: var(--text); }
.vp-panel-close svg { width: 18px; height: 18px; }

/* Variants grid in the picker */
.vp-grid {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px;
}
.vg-btn {
  aspect-ratio: 1; border: 1.5px solid var(--border-h); border-radius: 8px;
  background: transparent; color: var(--text-2);
  font-family: 'Manrope', sans-serif; font-size: .82rem; font-weight: 700;
  cursor: pointer; transition: all .12s; line-height: 1;
}
.vg-btn:hover    { border-color: var(--violet); color: var(--violet); }
.vg-btn.active   { background: var(--violet); border-color: var(--violet); color: #fff; }
.vg-btn.done     { background: rgba(6,214,160,.15); border-color: #06D6A0; color: #06D6A0; }
.vg-btn.done:hover { background: rgba(6,214,160,.25); }
.vg-btn.done.active { background: #06D6A0; border-color: #06D6A0; color: #fff; }
.vg-btn.partial  { background: rgba(248,150,30,.13); border-color: #F8961E; color: #F8961E; }
.vg-btn.partial:hover { background: rgba(248,150,30,.22); }

@media (max-width: 540px) {
  .vp-grid { grid-template-columns: repeat(8, 1fr); }
}

/* Variant title + tasks */
.vp-title {
  font-family: 'Unbounded', sans-serif; font-size: 1.35rem; font-weight: 800;
  letter-spacing: -.02em; margin-bottom: 18px;
}
.vp-title small {
  font-family: 'Manrope', sans-serif; font-size: .82rem; font-weight: 500;
  color: var(--text-2); margin-left: 10px;
}

.vp-task {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 14px; margin-bottom: 14px; overflow: hidden;
  transition: border-color .15s;
}
.vp-task:hover { border-color: var(--border-h); }
.vp-task-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px; background: rgba(155,93,229,.04);
  border-bottom: 1.5px solid var(--border);
}
.vp-task-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--violet); color: #fff;
  font-family: 'Unbounded', sans-serif; font-size: .82rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.vp-task-label {
  font-family: 'Unbounded', sans-serif; font-size: .82rem; font-weight: 700;
  color: var(--text-2); letter-spacing: .02em;
}
.vp-task-body { padding: 18px 24px; font-size: .98rem; line-height: 1.8; }
.vp-task-text .katex-display { margin: 12px 0 6px; overflow-x: auto; }
.vp-task-figure { margin: 14px 0 4px; }
.vp-task-figure svg, .vp-task-figure img { max-width: 100%; height: auto; }

.vp-opts {
  display: flex; flex-wrap: wrap; gap: 10px 32px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
  align-items: center;
}
.vp-opts-vertical {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.vp-opt { display: inline-flex; align-items: flex-start; gap: 6px; }
.vp-opt-lbl {
  font-family: 'Unbounded', sans-serif; font-weight: 800;
  color: var(--violet); font-size: .9rem; white-space: nowrap;
}

/* Solution toggle */
.vp-sol-wrap { padding: 0 22px 16px; }
.vp-sol-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border: 1.5px solid #06D6A0; border-radius: 8px;
  background: transparent; color: #06D6A0;
  font-family: 'Manrope', sans-serif; font-size: .85rem; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.vp-sol-btn:hover { background: rgba(6,214,160,.12); }
.vp-sol-btn.open  { background: #06D6A0; border-color: #06D6A0; color: #fff; }
.vp-sol-btn svg   { width: 13px; height: 13px; transition: transform .2s; }
.vp-sol-btn.open svg { transform: rotate(90deg); }

.vp-sol-panel {
  display: none; margin-top: 14px; padding: 16px 20px;
  background: rgba(6,214,160,.06); border-radius: 10px;
  border-left: 3px solid #06D6A0;
  line-height: 1.85; font-size: .94rem;
}
.vp-sol-panel.visible { display: block; }
.vp-sol-panel .katex-display { margin: 10px 0 6px; overflow-x: auto; }
.vp-sol-panel ul { margin: 6px 0 6px 22px; }
.vp-sol-panel li { margin: 3px 0; }
.vp-sol-panel .sol-ans {
  display: inline-block; margin-top: 12px; padding: 4px 14px;
  background: rgba(6,214,160,.2); border-radius: 6px;
  font-family: 'Unbounded', sans-serif; font-weight: 800; color: #06D6A0;
}

/* ═══════════════════════════════════════════════════════════════
   TaskCard component (`tc-*`) — reusable across views (F3+)
   ═══════════════════════════════════════════════════════════════ */

.tc-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 14px; margin-bottom: 14px; overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.tc-card:hover { border-color: var(--border-h); }
.tc-card.tc-correct {
  border-color: #06D6A0;
  box-shadow: 0 0 0 1.5px rgba(6,214,160,.25);
}
.tc-card.tc-wrong {
  border-color: #E63946;
  box-shadow: 0 0 0 1.5px rgba(230,57,70,.22);
}

.tc-head {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 22px; background: rgba(155,93,229,.04);
  border-bottom: 1.5px solid var(--border);
}
.tc-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--violet); color: #fff;
  font-family: 'Unbounded', sans-serif; font-size: .82rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tc-num-label {
  font-family: 'Unbounded', sans-serif; font-size: .82rem; font-weight: 700;
  color: var(--text-2); letter-spacing: .02em;
}
.tc-type-badge {
  margin-left: auto;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(155,93,229,.10); color: var(--violet);
}
.tc-type-open { background: rgba(6,214,160,.12); color: #059669; }
.tc-type-long { background: rgba(248,150,30,.12); color: #B45309; }

.tc-body { padding: 18px 24px; font-size: .98rem; line-height: 1.8; }
.tc-text .katex-display { margin: 12px 0 6px; overflow-x: auto; }
.tc-figure { margin: 14px 0 4px; }
.tc-figure svg, .tc-figure img { max-width: 100%; height: auto; }

/* MC: radio options as clickable rows */
.tc-opts {
  display: flex; flex-wrap: wrap; gap: 10px 32px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.tc-opts-vertical {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.tc-opt {
  display: inline-flex; align-items: flex-start; gap: 8px;
  padding: 6px 10px; border-radius: 8px;
  cursor: pointer; transition: background .12s;
  line-height: 1.5;
}
.tc-opt:hover { background: rgba(155,93,229,.06); }
.tc-opt input[type="radio"] {
  accent-color: var(--violet);
  margin-top: 4px; flex-shrink: 0;
}
.tc-opt-lbl {
  font-family: 'Unbounded', sans-serif; font-weight: 800;
  color: var(--violet); font-size: .9rem; white-space: nowrap;
}

/* Open: short text answer */
.tc-input-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.tc-ans-label {
  font-family: 'Manrope', sans-serif; font-size: .85rem; font-weight: 700;
  color: var(--text-2);
}
.tc-ans-input {
  flex: 1; min-width: 140px; max-width: 260px;
  padding: 9px 14px;
  border: 1.5px solid var(--border-h);
  border-radius: 9px;
  background: #fff; color: var(--text);
  font-family: 'Manrope', sans-serif; font-size: .95rem; font-weight: 600;
  transition: border-color .15s;
}
.tc-ans-input:focus { outline: none; border-color: var(--violet); }
.tc-ans-input::placeholder { color: var(--text-3); font-weight: 500; }
.tc-card.tc-correct .tc-ans-input { border-color: #06D6A0; background: rgba(6,214,160,.08); }
.tc-card.tc-wrong   .tc-ans-input { border-color: #E63946; background: rgba(230,57,70,.06); }

/* Check button + verdict */
.tc-action-row {
  display: flex; align-items: center; gap: 14px;
  margin-top: 14px; flex-wrap: wrap;
}
.tc-check-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 22px;
  border: none; border-radius: 9px;
  background: var(--violet); color: #fff;
  font-family: 'Manrope', sans-serif; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: filter .12s, opacity .12s;
}
.tc-check-btn:hover:not(:disabled) { filter: brightness(1.08); }
.tc-check-btn:disabled { opacity: .38; cursor: not-allowed; }

.tc-verdict {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: 'Manrope', sans-serif; font-size: .9rem; font-weight: 700;
}
.tc-verdict-ok, .tc-verdict-bad {
  display: inline-flex; align-items: center; gap: 6px;
}
.tc-verdict-ok  { color: #06D6A0; }
.tc-verdict-bad { color: #E63946; }
.tc-verdict-ok svg, .tc-verdict-bad svg { width: 14px; height: 14px; }

.tc-retry-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  border: 1.5px solid var(--border-h); border-radius: 7px;
  background: transparent; color: var(--text-2);
  font-family: 'Manrope', sans-serif; font-size: .8rem; font-weight: 700;
  cursor: pointer; transition: all .12s;
}
.tc-retry-btn:hover { border-color: var(--violet); color: var(--violet); }
.tc-retry-btn svg { width: 12px; height: 12px; }

/* Long: self-mark */
.tc-self-mark {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.tc-self-mark-label {
  display: block; font-size: .85rem; color: var(--text-2);
  margin-bottom: 10px;
}
.tc-self-mark-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.tc-self-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border: 1.5px solid var(--border-h); border-radius: 9px;
  background: transparent;
  font-family: 'Manrope', sans-serif; font-size: .85rem; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.tc-self-btn:disabled { opacity: .42; cursor: not-allowed; }
.tc-self-btn svg { width: 13px; height: 13px; }
.tc-self-yes { color: #06D6A0; border-color: #06D6A0; }
.tc-self-yes:hover:not(:disabled) { background: rgba(6,214,160,.10); }
.tc-self-no  { color: #E63946; border-color: #E63946; }
.tc-self-no:hover:not(:disabled)  { background: rgba(230,57,70,.10); }

/* Solution toggle within task card */
.tc-sol-wrap { padding: 0 22px 16px; }
.tc-sol-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border: 1.5px solid #06D6A0; border-radius: 8px;
  background: transparent; color: #06D6A0;
  font-family: 'Manrope', sans-serif; font-size: .85rem; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.tc-sol-btn:hover { background: rgba(6,214,160,.12); }
.tc-sol-btn.open  { background: #06D6A0; border-color: #06D6A0; color: #fff; }
.tc-sol-btn svg   { width: 13px; height: 13px; transition: transform .2s; }
.tc-sol-btn.open svg { transform: rotate(90deg); }

.tc-sol-panel {
  display: none; margin-top: 14px; padding: 16px 20px;
  background: rgba(6,214,160,.06); border-radius: 10px;
  border-left: 3px solid #06D6A0;
  line-height: 1.85; font-size: .94rem;
}
.tc-sol-panel.visible { display: block; }
.tc-sol-panel .katex-display { margin: 10px 0 6px; overflow-x: auto; }
.tc-sol-panel ul { margin: 6px 0 6px 22px; }
.tc-sol-panel li { margin: 3px 0; }
.tc-sol-panel .sol-ans {
  display: inline-block; margin-top: 12px; padding: 4px 14px;
  background: rgba(6,214,160,.2); border-radius: 6px;
  font-family: 'Unbounded', sans-serif; font-weight: 800; color: #06D6A0;
}

/* ═══════════════════════════════════════════════════════════════
   Practice view (`pr-*`)  — used by exam-prep-practice.html
   ═══════════════════════════════════════════════════════════════ */

.pr-controls {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
.pr-controls-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.pr-strategy {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.pr-strategy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--border-h);
  border-radius: 9px;
  background: transparent; color: var(--text-2);
  font-family: 'Manrope', sans-serif; font-size: .85rem; font-weight: 700;
  cursor: pointer; transition: all .12s;
}
.pr-strategy-btn:hover:not(:disabled):not(.disabled) {
  border-color: var(--violet); color: var(--violet);
}
.pr-strategy-btn.active {
  background: var(--violet); border-color: var(--violet); color: #fff;
}
.pr-strategy-btn.disabled, .pr-strategy-btn:disabled {
  opacity: .42; cursor: not-allowed;
}
.pr-strategy-btn svg { width: 14px; height: 14px; }

.pr-count-pick {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: auto;
}
.pr-count-pick label {
  font-size: .78rem; color: var(--text-3); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.pr-count-select {
  padding: 7px 10px;
  border: 1.5px solid var(--border-h);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: 'Manrope', sans-serif; font-size: .85rem; font-weight: 600;
  cursor: pointer;
}
.pr-count-select:focus { outline: none; border-color: var(--violet); }

.pr-restart { white-space: nowrap; }
.pr-restart svg { width: 14px; height: 14px; }

.pr-progress {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.pr-progress-meta {
  display: flex; justify-content: space-between;
  font-size: .78rem; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
  margin-bottom: 6px;
}
.pr-progress-counts {
  color: var(--violet);
  text-transform: none; letter-spacing: 0;
  font-size: .8rem;
}

.pr-tasks { margin-top: 6px; }

.pr-finish-row {
  display: flex; justify-content: center;
  margin: 22px 0 0;
}
.pr-finish-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border: 1.5px solid var(--border-h); border-radius: 10px;
  background: var(--surface); color: var(--text-2);
  font-family: 'Manrope', sans-serif; font-size: .85rem; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.pr-finish-btn:hover { border-color: var(--violet); color: var(--violet); }
.pr-finish-btn svg { width: 14px; height: 14px; }

.pr-summary { margin-top: 22px; }
.pr-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.pr-summary-stat {
  padding: 12px 14px;
  background: rgba(155,93,229,.05);
  border-radius: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   Mock exam view (`mk-*`) — used by exam-prep-mock.html
   ═══════════════════════════════════════════════════════════════ */

/* Setup */
.mk-setup p { font-size: .92rem; line-height: 1.7; }
.mk-source {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 18px 0 4px;
}
.mk-source-card {
  border: 1.5px solid var(--border-h);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all .15s;
}
.mk-source-card:hover { border-color: var(--violet); }
.mk-source-card.mk-source-active {
  border-color: var(--violet);
  background: rgba(155,93,229,.06);
}
.mk-source-head {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Manrope', sans-serif; font-size: .95rem; font-weight: 700;
  color: var(--text); margin-bottom: 10px;
}
.mk-source-head svg { width: 18px; height: 18px; color: var(--violet); }
.mk-source-body label {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; color: var(--text-2);
}
.mk-input {
  width: 80px;
  padding: 6px 10px;
  border: 1.5px solid var(--border-h);
  border-radius: 7px;
  background: var(--surface); color: var(--text);
  font-family: 'Manrope', sans-serif; font-size: .9rem; font-weight: 600;
}
.mk-input:focus { outline: none; border-color: var(--violet); }
.mk-source-hint {
  font-size: .78rem; color: var(--text-3); margin-top: 6px;
}
.mk-start-row { margin-top: 16px; }

/* Active phase: sticky bar */
.mk-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.mk-bar-info {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1; min-width: 180px;
}
.mk-bar-source {
  font-family: 'Unbounded', sans-serif; font-size: .9rem; font-weight: 800;
  letter-spacing: -.01em;
}
.mk-bar-count {
  font-size: .78rem; color: var(--text-2);
}
.mk-timer {
  font-family: 'Unbounded', sans-serif;
  font-size: 1.6rem; font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.mk-timer.mk-timer-warn { color: #F8961E; }
.mk-timer.mk-timer-zero { color: #E63946; animation: mk-pulse .8s infinite; }
@keyframes mk-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .4; }
}
.mk-finish-btn { white-space: nowrap; }

.mk-tasks { }

/* Result phase */
.mk-result-stats { margin-bottom: 18px; }
.mk-breakdown-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 1.05rem; font-weight: 800;
  margin: 26px 0 12px;
  letter-spacing: -.01em;
}

/* ═══════════════════════════════════════════════════════════════
   Dashboard widgets (`dh-*`) — used by exam-prep.html (F4)
   ═══════════════════════════════════════════════════════════════ */

.dh-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}
@media (max-width: 880px) {
  .dh-row { grid-template-columns: 1fr; }
}

/* Recent attempts list */
.dh-recent { display: flex; flex-direction: column; }
.dh-recent-list { display: flex; flex-direction: column; gap: 6px; }
.dh-recent-item {
  display: grid;
  grid-template-columns: 24px 70px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: .85rem;
  transition: background .12s;
}
.dh-recent-item:hover { background: rgba(155,93,229,.05); }

.dh-mark {
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: .78rem;
  flex-shrink: 0;
}
.dh-mark-ok      { background: rgba(6,214,160,.18); color: #06D6A0; }
.dh-mark-bad     { background: rgba(230,57,70,.16); color: #E63946; }
.dh-mark-view    { background: rgba(155,93,229,.14); color: var(--violet); }
.dh-mark-pending { background: rgba(15,23,42,.05);   color: var(--text-3); }

.dh-recent-loc {
  font-family: 'Manrope', sans-serif; font-weight: 700; color: var(--violet);
  font-size: .78rem;
  text-decoration: none; white-space: nowrap;
}
.dh-recent-loc:hover { text-decoration: underline; }

.dh-recent-preview {
  color: var(--text-2);
  font-size: .85rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.dh-recent-meta {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 1px;
  font-size: .7rem; color: var(--text-3);
}
.dh-mode {
  text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
  color: var(--violet);
}

/* Activity heatmap */
.dh-heatmap-card { display: flex; flex-direction: column; }
.dh-heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(20px, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}
.dh-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(15,23,42,.06);
  cursor: default;
  transition: filter .12s;
}
.dh-cell:hover { filter: brightness(1.05); }
.dh-cell.dh-l0 { background: rgba(15,23,42,.06); }
.dh-cell.dh-l1 { background: rgba(155,93,229,.20); }
.dh-cell.dh-l2 { background: rgba(155,93,229,.40); }
.dh-cell.dh-l3 { background: rgba(155,93,229,.65); }
.dh-cell.dh-l4 { background: rgba(155,93,229,.90); }
.dh-heatmap-legend {
  display: flex; align-items: center; gap: 4px;
  font-size: .7rem; color: var(--text-3);
}
.dh-heatmap-legend .dh-cell {
  width: 12px; height: 12px; aspect-ratio: 1;
}

/* Weak topics widget */
.dh-weak-rows { display: flex; flex-direction: column; gap: 8px; }
.dh-weak-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  transition: all .15s;
}
.dh-weak-row:hover {
  border-color: #E63946;
  background: rgba(230,57,70,.04);
}
.dh-weak-info { min-width: 0; }
.dh-weak-title {
  font-family: 'Unbounded', sans-serif; font-size: .9rem; font-weight: 700;
}
.dh-weak-meta {
  font-size: .75rem; color: var(--text-3); margin-top: 2px;
}
.dh-weak-accuracy {
  font-family: 'Unbounded', sans-serif; font-size: 1rem; font-weight: 800;
  color: #E63946;
  padding: 4px 10px; border-radius: 7px;
  background: rgba(230,57,70,.10);
}
.dh-weak-cta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .78rem; font-weight: 700; color: var(--violet);
  white-space: nowrap;
}
.dh-weak-cta svg { width: 13px; height: 13px; }
@media (max-width: 540px) {
  .dh-weak-row { grid-template-columns: 1fr auto; }
  .dh-weak-cta { display: none; }
}

/* Recent mocks rows */
.dh-mock-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--text);
  transition: background .12s;
  margin-bottom: 4px;
}
.dh-mock-row:hover { background: rgba(155,93,229,.06); }
.dh-mock-title {
  font-family: 'Manrope', sans-serif; font-weight: 700; font-size: .9rem;
}
.dh-mock-score {
  font-size: .82rem; color: var(--text-2);
}
.dh-mock-active {
  font-size: .78rem; font-weight: 800; letter-spacing: .03em;
  color: #F8961E; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(248,150,30,.12);
}
.dh-mock-when {
  font-size: .72rem; color: var(--text-3);
}

/* ═══════════════════════════════════════════════════════════════
   Plan widget (`dh-plan-*`) — used by dashboard (F10)
   ═══════════════════════════════════════════════════════════════ */

.dh-plan-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.dh-plan-head h3 { margin-bottom: 0; }
.dh-plan-edit {
  width: 32px; height: 32px;
  border: 1.5px solid var(--border-h);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.dh-plan-edit:hover { border-color: var(--violet); color: var(--violet); }
.dh-plan-edit svg { width: 14px; height: 14px; stroke-width: 2; }

.dh-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.dh-plan-stat {
  background: rgba(155,93,229,.05);
  border-radius: 10px;
  padding: 14px 16px;
}

.dh-plan-expired {
  margin-top: 12px; padding: 10px 14px;
  background: rgba(248,150,30,.10); color: #B45309;
  border-left: 3px solid #F8961E;
  border-radius: 6px;
  font-size: .82rem;
}

/* Modal form */
.dh-plan-form {
  display: flex; flex-direction: column; gap: 14px;
}
.dh-plan-field label {
  display: block; font-size: .78rem; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.dh-plan-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border-h);
  border-radius: 9px;
  background: var(--surface); color: var(--text);
  font-family: 'Manrope', sans-serif; font-size: .92rem;
}
.dh-plan-input:focus { outline: none; border-color: var(--violet); }
.dh-plan-hint { font-size: .72rem; color: var(--text-3); margin-top: 4px; }

.dh-plan-derived-card {
  display: flex; flex-direction: column; gap: 5px;
  padding: 10px 12px;
  background: rgba(6,214,160,.06);
  border-left: 3px solid #06D6A0;
  border-radius: 6px;
  font-size: .85rem;
  color: var(--text-2);
}
.dh-plan-derived-card b { color: var(--text); }

/* ═══════════════════════════════════════════════════════════════
   Topics view (`tp-*`) — used by exam-prep-topics.html (F7)
   ═══════════════════════════════════════════════════════════════ */

.tp-sections { display: flex; flex-direction: column; gap: 16px; }

.tp-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.tp-section-head h3 { margin-bottom: 0; }
.tp-section-meta {
  font-family: 'Manrope', sans-serif; font-size: .82rem; font-weight: 700;
  color: var(--text-2);
}
.tp-section-bar { margin-bottom: 14px; }

.tp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.tp-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-h);
  border-radius: 11px;
  background: var(--surface);
  text-decoration: none; color: var(--text);
  transition: all .15s;
}
.tp-card:hover {
  border-color: var(--violet);
  box-shadow: 0 4px 14px rgba(155,93,229,.10);
}

.tp-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.tp-card-title {
  font-family: 'Unbounded', sans-serif; font-size: .88rem; font-weight: 700;
  line-height: 1.3;
}
.tp-card-count {
  font-family: 'Unbounded', sans-serif; font-size: .72rem; font-weight: 800;
  color: var(--text-3);
  padding: 2px 7px; border-radius: 5px;
  background: rgba(15,23,42,.05);
  white-space: nowrap;
}

.tp-card-progress {
  display: flex; align-items: center; gap: 8px;
  font-size: .75rem; color: var(--text-3);
}
.tp-card-progress .ep-bar { flex: 1; margin-top: 0; }

.tp-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px;
}
.tp-card-accuracy {
  font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: .82rem;
  padding: 3px 9px; border-radius: 5px;
  background: rgba(15,23,42,.05);
  color: var(--text-2);
}
.tp-card-accuracy.tp-good { background: rgba(6,214,160,.16); color: #06D6A0; }
.tp-card-accuracy.tp-warn { background: rgba(248,150,30,.14); color: #B45309; }
.tp-card-accuracy.tp-bad  { background: rgba(230,57,70,.14);  color: #E63946; }

.tp-card-cta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .75rem; font-weight: 700; color: var(--violet);
}
.tp-card-cta svg { width: 12px; height: 12px; }

/* Topic practice header */
.tp-back-bar { margin-bottom: 12px; }
.tp-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .85rem; font-weight: 600; color: var(--text-2);
  text-decoration: none;
  padding: 6px 10px; border-radius: 7px;
  transition: background .12s;
}
.tp-back:hover { background: rgba(155,93,229,.06); color: var(--violet); }
.tp-back svg { width: 14px; height: 14px; }

.tp-checkbox {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; color: var(--text-2); cursor: pointer;
}
.tp-checkbox input { accent-color: var(--violet); }

/* ── Mobile tweaks ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ep-wrap   { padding: 20px 16px 60px; }
  .ep-title  { font-size: 1.15rem; }
  .ep-tabs   { gap: 0; }
  .ep-tab    { padding: 9px 12px; font-size: .82rem; }
  .ep-card   { padding: 16px 18px; }
  .ep-stat   { padding: 14px 16px; }
  .vp-task-body, .tc-body { padding: 14px 18px; }
  .vp-sol-wrap, .tc-sol-wrap   { padding: 0 18px 14px; }
  .vp-sol-panel, .tc-sol-panel { padding: 14px 16px; }
  .tc-input-row { gap: 8px; }
  .tc-ans-input { max-width: 100%; }
}

/* ── "Учить тему" link inside a task card ───────────────────────── */
.tc-sol-row {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.tc-ref-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto;
  padding: 6px 12px;
  border: 1.5px solid var(--violet, #7c3aed);
  border-radius: 9px;
  background: rgba(124, 58, 237, 0.08);
  color: var(--violet, #7c3aed);
  font-family: 'Manrope', sans-serif; font-size: .82rem; font-weight: 700;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.tc-ref-btn:hover {
  background: var(--violet, #7c3aed); color: #fff;
}
.tc-ref-btn svg { width: 14px; height: 14px; }

/* ── Difficulty-progression note above the task list ─────────────── */
.pr-difficulty-note {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(6, 214, 160, 0.08);
  border-left: 3px solid #06D6A0;
  border-radius: 6px;
  font-size: .82rem;
  color: var(--text-2);
}
.pr-difficulty-note i, .pr-difficulty-note svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Exclude-topics button + count badge ─────────────────────────── */
.pr-exclude-btn {
  display: inline-flex; align-items: center; gap: 6px;
  position: relative;
}
.pr-exclude-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--violet, #7c3aed); color: #fff;
  font-size: .7rem; font-weight: 800; line-height: 1;
}

/* ── Exclude-topics modal ────────────────────────────────────────── */
.pr-ex-form { display: flex; flex-direction: column; gap: 16px; max-height: 60vh; overflow-y: auto; }
.pr-ex-hint { font-size: .82rem; color: var(--text-3); margin: 0; }
.pr-ex-section { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.pr-ex-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
  font-family: 'Unbounded', sans-serif; font-size: .82rem; font-weight: 800;
  letter-spacing: .02em; color: var(--text);
}
.pr-ex-toggle-all {
  border: 1px solid var(--border-h); background: transparent; color: var(--text-2);
  padding: 3px 10px; border-radius: 6px;
  font-family: 'Manrope', sans-serif; font-size: .72rem; font-weight: 700;
  cursor: pointer; transition: all .12s;
}
.pr-ex-toggle-all:hover { border-color: var(--violet); color: var(--violet); }
.pr-ex-items { display: flex; flex-direction: column; gap: 4px; }
.pr-ex-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
  transition: background .12s;
}
.pr-ex-item:hover { background: var(--border); }
.pr-ex-item input { accent-color: var(--violet); flex-shrink: 0; }
.pr-ex-title { flex: 1; }
.pr-ex-meta { font-size: .76rem; color: var(--text-3); }
.pr-ex-empty { padding: 16px; text-align: center; color: var(--text-3); font-size: .85rem; }
