/* ─────────────────────────────────────────────
   CSS Custom Properties — Dark Unity-inspired theme
   ───────────────────────────────────────────── */
:root {
  --bg-deep:    #0d1117;
  --bg-surface: #161b22;
  --bg-card:    #21262d;
  --bg-hover:   #30363d;
  --border:     #30363d;
  --text-main:  #e6edf3;
  --text-muted: #8b949e;
  --text-code:  #a5d6ff;

  --green:  #3fb950;
  --red:    #f85149;
  --yellow: #d29922;
  --blue:   #58a6ff;
  --purple: #bc8cff;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --transition: 200ms ease;
  --font-mono: 'Consolas', 'Cascadia Code', 'Fira Mono', monospace;
  --font-ui:   system-ui, -apple-system, 'Segoe UI', sans-serif;

  --sidebar-w: 300px;
  --docs-w:    500px;
  --header-h:  60px;
}

/* ─── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font-ui);
  background: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
a { color: var(--blue); }
code, pre { font-family: var(--font-mono); }

/* ─── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 3px; }

/* ─── Header ─────────────────────────────────── */
#app-header {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
#app-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}
.header-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 400px;
}
#overall-progress-bar {
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}
#overall-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: 3px;
  width: 0%;
  transition: width 500ms ease;
}
#btn-help {
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.4);
  color: var(--blue);
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition);
}
#btn-help:hover {
  background: rgba(88, 166, 255, 0.2);
  border-color: var(--blue);
}

#btn-bug {
  background: rgba(248, 81, 73, 0.08);
  border: 1px solid rgba(248, 81, 73, 0.35);
  color: var(--red);
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition);
}
#btn-bug:hover {
  background: rgba(248, 81, 73, 0.18);
  border-color: var(--red);
}

/* ─── Mode Tabs ─────────────────────────────── */
.mode-tabs {
  display: flex;
  gap: 3px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  flex-shrink: 0;
}
.mode-tab {
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 20px;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: 0.02em;
  font-family: var(--font-ui);
}
.mode-tab:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text-main);
}
.mode-tab.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.mode-tab[data-mode="teoria"].active  { color: var(--blue); }
.mode-tab[data-mode="practica"].active { color: var(--green); }

/* ─── Practice Main ──────────────────────────── */
#practice-main {
  display: none;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--bg-deep);
}
#practice-main.active { display: block; }

/* ─── Practice Layout ────────────────────────── */
.practice-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.practice-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  padding: 0.25rem 0;
}
.practice-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--font-ui);
  transition: var(--transition);
}
.practice-nav-btn:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.practice-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.practice-counter { font-size: 0.8rem; color: var(--text-muted); min-width: 90px; text-align: center; }

.practice-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}
.practice-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}
.practice-difficulty { color: var(--yellow); font-size: 0.88rem; }
.practice-genre {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 2px 9px;
  border-radius: 10px;
}
.practice-tag {
  font-size: 0.7rem;
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 28%, transparent);
  padding: 2px 9px;
  border-radius: 10px;
  position: relative;
}
.practice-tag[data-tooltip] {
  cursor: help;
  text-decoration: underline dotted color-mix(in srgb, var(--green) 50%, transparent);
  text-underline-offset: 3px;
}
/* Tooltip box */
.practice-tag[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.5;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  white-space: normal;
  width: max-content;
  max-width: 300px;
  text-align: center;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  font-weight: 400;
  text-decoration: none;
}
/* Arrow pointing down toward the tag */
.practice-tag[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
  z-index: 201;
  pointer-events: none;
}
.practice-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.practice-context {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 0.5rem;
}
.practice-scenario {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.25rem;
}
.practice-section-label {
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.practice-eval-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 0.75rem;
}
.eval-hint { font-size: 0.8rem; }

/* ─── Practice Results ───────────────────────── */
.practice-results-hidden { display: none; }
.practice-results-visible { display: block; }

.results-card { border-top: 3px solid var(--green); }
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.results-score-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.results-score { font-size: 1.5rem; font-weight: 800; }
.criteria-list { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.criteria-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  line-height: 1.5;
}
.criteria-pass {
  background: color-mix(in srgb, var(--green) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
}
.criteria-fail {
  background: color-mix(in srgb, var(--red) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 18%, transparent);
}
.criteria-check { font-size: 0.95rem; flex-shrink: 0; margin-top: 1px; }
.criteria-label-text { flex: 1; }
.criteria-pts { font-weight: 700; font-size: 0.78rem; white-space: nowrap; flex-shrink: 0; }

.results-feedback {
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  border-left: 3px solid var(--blue);
  padding: 0.7rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.87rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.results-feedback strong { color: var(--text-main); }

.results-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.results-details summary {
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
  background: var(--bg-hover);
  transition: var(--transition);
  list-style: none;
}
.results-details summary:hover { color: var(--text-main); }
.results-details[open] summary {
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}
.ideal-solution-wrap { overflow: hidden; }
.alts-list {
  list-style: none;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.alt-item {
  font-size: 0.84rem;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-left: 2px solid var(--green);
  line-height: 1.55;
}

/* ─── CodeMirror Overrides ───────────────────── */
.cm-wrap .CodeMirror {
  font-family: var(--font-mono) !important;
  font-size: 0.85rem !important;
  line-height: 1.65 !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
/* Read-only starter: auto-height, no scroll */
.cm-readonly .CodeMirror { height: auto; }
/* Editable solution: fixed height, scrollable */
.cm-editable .CodeMirror { height: 300px; }
/* Ideal solution inside details */
.ideal-solution-wrap .CodeMirror { height: auto; border-radius: 0; border: none; }

/* ─── SweetAlert2 dark theme override ───────── */
.swal2-popup {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  font-family: var(--font-ui) !important;
}
.swal2-title {
  color: var(--text-main) !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
}
.swal2-html-container {
  color: var(--text-muted) !important;
  font-size: 0.88rem !important;
}
.swal2-html-container strong {
  color: var(--text-main) !important;
}
.swal2-confirm {
  background: var(--blue) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  padding: 6px 20px !important;
  box-shadow: none !important;
}
.swal2-confirm:focus { box-shadow: 0 0 0 3px rgba(88,166,255,0.3) !important; }
.swal2-cancel {
  background: var(--bg-hover) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-muted) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  padding: 6px 20px !important;
  box-shadow: none !important;
}
.swal2-cancel:hover { background: var(--border) !important; color: var(--text-main) !important; }
.swal2-validation-message {
  background: rgba(248, 81, 73, 0.1) !important;
  color: var(--red) !important;
  border: 1px solid rgba(248, 81, 73, 0.25) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 0.8rem !important;
}

/* ─── Bug report form ────────────────────────── */
.bug-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-align: left;
}
.bug-form label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.bug-form select,
.bug-form textarea {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  padding: 8px 10px;
  outline: none;
  transition: border-color var(--transition);
}
.bug-form select:focus,
.bug-form textarea:focus { border-color: var(--blue); }
.bug-form select option { background: var(--bg-card); }
.bug-form textarea { resize: vertical; min-height: 90px; }
.bug-disclaimer {
  font-size: 0.75rem;
  color: var(--yellow);
  background: rgba(210, 153, 34, 0.08);
  border: 1px solid rgba(210, 153, 34, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  line-height: 1.55;
  margin-top: 0.25rem;
}

.header-right { margin-left: auto; display: flex; align-items: center; gap: 1rem; }

.user-email {
  font-size: 0.75rem;
  color: var(--text-muted, #8b949e);
  background: var(--bg-card, #0d1117);
  border: 1px solid var(--border, #30363d);
  border-radius: 999px;
  padding: 2px 10px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
#btn-reset {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition);
}
#btn-reset:hover { border-color: var(--red); color: var(--red); }

/* ─── Main Layout ────────────────────────────── */
#app-main {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--docs-w);
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}

/* ─── Sidebar ────────────────────────────────── */
#sidebar {
  min-width: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#sidebar h2 {
  padding: 1rem 1.25rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#sections-nav {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem 0;
}

.nav-item {
  padding: 0;
  margin: 2px 0.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid transparent;
  transition: var(--transition);
}
.nav-item.unlocked { cursor: pointer; }
.nav-item.unlocked:hover { border-color: var(--section-color, var(--border)); background: color-mix(in srgb, var(--section-color, var(--blue)) 8%, transparent); }
.nav-item.active { border-color: var(--section-color, var(--blue)); background: color-mix(in srgb, var(--section-color, var(--blue)) 12%, transparent); }
.nav-item.locked { opacity: 0.45; }

.nav-item-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
}
.nav-icon {
  font-size: 1.3rem;
  width: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--section-color, var(--text-main));
}
.nav-item-info { flex: 1; min-width: 0; }
.nav-title { display: block; font-size: 0.9rem; font-weight: 600; }
.nav-score { display: block; font-size: 0.7rem; color: var(--text-muted); }

.nav-history-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.nav-history-toggle:hover { background: var(--bg-hover); }

.nav-mini-progress {
  height: 3px;
  background: var(--bg-hover);
  margin: 0 0.9rem 0.4rem;
  border-radius: 2px;
  overflow: hidden;
}
.nav-mini-bar {
  height: 100%;
  background: var(--section-color, var(--green));
  border-radius: 2px;
  transition: width 500ms ease;
}

.nav-session-history {
  display: none;
  background: var(--bg-deep);
  padding: 0.5rem 0.9rem;
  border-top: 1px solid var(--border);
}
.nav-session-history.visible { display: block; }
.nav-history-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.nav-session-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.72rem;
  padding: 2px 0;
  border-bottom: 1px solid var(--border);
}
.nav-session-item:last-child { border: none; }
.session-num { color: var(--text-muted); }
.session-date { color: var(--text-muted); }
.session-score { font-weight: 700; }
.score-high { color: var(--green); }
.score-mid  { color: var(--yellow); }
.score-low  { color: var(--red); }
.session-detail { color: var(--text-muted); }

/* ─── Evaluation Panel ───────────────────────── */
#evaluation-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-deep);
}

#current-question-container {
  flex-shrink: 0;
  padding: 1.5rem 1.5rem 0;
  max-height: 70vh;
  overflow-y: auto;
}

#topic-questions-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ─── Question Cards ─────────────────────────── */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  animation: card-in 300ms ease forwards;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.question-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.question-difficulty {
  font-size: 0.75rem;
  color: var(--yellow);
  letter-spacing: 0.05em;
}
.question-counter {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.question-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}
.mc-badge   { background: color-mix(in srgb, var(--blue) 20%, transparent); color: var(--blue); }
.id-badge   { background: color-mix(in srgb, var(--purple) 20%, transparent); color: var(--purple); }
.cw-badge   { background: color-mix(in srgb, var(--yellow) 20%, transparent); color: var(--yellow); }

.question-preamble { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.75rem; }
.question-text { font-size: 1rem; font-weight: 500; line-height: 1.6; margin-bottom: 1.25rem; }

/* ─── Code blocks ────────────────────────────── */
.code-block {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-code);
  margin-bottom: 1rem;
}
.code-block.small { font-size: 0.78rem; padding: 0.6rem 0.9rem; }
.code-highlight { background: rgba(255, 215, 0, 0.25); color: #ffd700; border-radius: 3px; padding: 0 2px; font-style: normal; }
.code-blank { background: rgba(88, 166, 255, 0.2); color: var(--blue); border-bottom: 2px solid var(--blue); font-weight: 600; }

/* ─── Multiple Choice Options ────────────────── */
.options-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.option-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.option-item:hover { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, transparent); }
.option-item.selected { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); }
.option-item.option-correct { border-color: var(--green) !important; background: color-mix(in srgb, var(--green) 15%, transparent) !important; }
.option-item.option-wrong   { border-color: var(--red)   !important; background: color-mix(in srgb, var(--red)   15%, transparent) !important; }
.option-radio { display: none; }
.option-letter {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-hover);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
.option-item.selected .option-letter {
  background: var(--blue);
  color: #fff;
}
.option-text { font-size: 0.9rem; line-height: 1.5; }

/* ─── Inputs ─────────────────────────────────── */
.input-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.answer-input {
  flex: 1;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  color: var(--text-main);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}
.answer-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 20%, transparent); }
.code-input { font-family: var(--font-mono); font-size: 0.9rem; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.input-shake { animation: shake 0.35s ease; border-color: var(--red) !important; }

/* ─── Buttons ────────────────────────────────── */
.btn-submit {
  background: var(--blue);
  color: #000;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.65rem 1.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-submit:hover:not(:disabled) { background: color-mix(in srgb, var(--blue) 85%, white); }
.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Hints ──────────────────────────────────── */
.hints-container { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.5rem; }
.hint-item {
  background: color-mix(in srgb, var(--yellow) 10%, transparent);
  border-left: 3px solid var(--yellow);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  animation: card-in 200ms ease;
}
.hint-number { font-weight: 700; color: var(--yellow); margin-right: 0.4rem; }
.attempts-counter { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.25rem; }

/* ─── Question Feedback ──────────────────────── */
.question-feedback {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  animation: card-in 200ms ease;
}
.feedback-correct { background: color-mix(in srgb, var(--green) 15%, transparent); border: 1px solid var(--green); }
.feedback-wrong   { background: color-mix(in srgb, var(--red) 15%, transparent);   border: 1px solid var(--red); }
.feedback-icon { font-size: 1.2rem; font-weight: 800; }
.feedback-correct .feedback-icon { color: var(--green); }
.feedback-wrong   .feedback-icon { color: var(--red); }
.explanation-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}
.explanation-text code { background: var(--bg-hover); padding: 1px 5px; border-radius: 3px; color: var(--text-code); font-size: 0.82rem; }

/* ─── History Items ──────────────────────────── */
.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  animation: card-in 200ms ease;
}
.history-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
}
.history-correct { border-left: 3px solid var(--green); }
.history-wrong   { border-left: 3px solid var(--red); }
.history-icon { font-size: 0.95rem; flex-shrink: 0; }
.history-correct .history-icon { color: var(--green); }
.history-wrong   .history-icon { color: var(--red); }
.history-preview { flex: 1; font-size: 0.82rem; color: var(--text-muted); }
.history-type-tag {
  font-size: 0.65rem;
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}
.history-toggle { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.75rem; padding: 2px 4px; }
.history-body { padding: 0.75rem 0.9rem; border-top: 1px solid var(--border); }
.history-full-question { font-size: 0.87rem; margin-bottom: 0.5rem; }
.history-explanation { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.5rem; line-height: 1.6; }

/* ─── Section Start / Complete ───────────────── */
.section-start-card, .section-complete {
  text-align: center;
  padding: 3rem 2rem;
  animation: card-in 300ms ease;
}
.section-start-icon, .complete-icon { font-size: 3.5rem; display: block; margin-bottom: 1rem; }
.section-start-card h2, .section-complete h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.section-start-card p, .section-complete p { color: var(--text-muted); line-height: 1.6; }
.panel-message { padding: 2rem; color: var(--text-muted); text-align: center; }

/* ─── Documentation Panel ────────────────────── */
#documentation-panel {
  min-width: 0;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#documentation-panel h2 {
  padding: 1rem 1.25rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#documentation-content {
  overflow-y: auto;
  flex: 1;
  padding: 0.75rem;
}
.doc-placeholder { color: var(--text-muted); font-size: 0.85rem; padding: 1rem 0.5rem; text-align: center; }

.doc-section {
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 400ms ease, transform 400ms ease;
  border-top: 3px solid var(--section-color, var(--blue));
}
.doc-section.doc-section-visible { opacity: 1; transform: none; }
.doc-section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--section-color, var(--blue)) 10%, transparent);
}
.doc-section-header h3 { font-size: 0.9rem; font-weight: 700; flex: 1; }
.doc-icon { font-size: 1.1rem; }
.doc-section-toggle {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.doc-section-toggle:hover { color: var(--text); background: var(--border); }
.doc-section-body { padding: 0.25rem; }

.doc-entry { border-bottom: 1px solid var(--border); }
.doc-entry:last-child { border: none; }
.doc-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}
.doc-entry-header:hover { background: var(--bg-hover); }
.doc-entry-title { font-size: 0.82rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.4rem; }
.doc-entry-title .icon { width: 0.95rem; height: 0.95rem; color: var(--section-color, var(--blue)); flex-shrink: 0; }
.doc-entry-toggle { font-size: 0.65rem; color: var(--text-muted); transition: transform var(--transition); }
.doc-entry.collapsed .doc-entry-toggle { transform: rotate(-90deg); }
.doc-entry.collapsed .doc-entry-body { display: none; }
.doc-entry-body { padding: 0 0.75rem 0.75rem; }

.doc-text { font-size: 0.82rem; line-height: 1.7; color: var(--text-muted); }
.doc-text strong { color: var(--text-main); }
.doc-text code, .doc-text em { color: var(--text-code); background: var(--bg-hover); padding: 1px 4px; border-radius: 3px; font-size: 0.78rem; }
.doc-note { background: color-mix(in srgb, var(--yellow) 10%, transparent); border-left: 3px solid var(--yellow); padding: 0.5rem 0.75rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 0.8rem; line-height: 1.6; color: var(--text-muted); }
.doc-analogy { background: color-mix(in srgb, var(--blue) 10%, transparent); border-left: 3px solid var(--blue); padding: 0.5rem 0.75rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 0.8rem; line-height: 1.6; color: var(--text-muted); }
.doc-list { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; padding: 0; }
.doc-list li { font-size: 0.8rem; color: var(--text-muted); padding: 0.25rem 0; border-bottom: 1px solid var(--border); line-height: 1.5; }
.doc-list li:last-child { border: none; }
.doc-list li code { color: var(--text-code); background: var(--bg-hover); padding: 1px 4px; border-radius: 3px; font-size: 0.76rem; }
.doc-code-block { background: #0d1117; border-radius: var(--radius-sm); padding: 0.75rem; font-size: 0.75rem; color: var(--text-code); line-height: 1.6; overflow-x: auto; white-space: pre; }

/* ─── Loading Overlay ────────────────────────── */
#loading-overlay {
  position: fixed; inset: 0;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 9999;
  transition: opacity 300ms ease;
}
#loading-overlay p { color: var(--text-muted); font-size: 0.9rem; }
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--bg-hover);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-message { text-align: center; max-width: 500px; padding: 2rem; }
.error-icon { font-size: 3rem; margin-bottom: 1rem; }
.error-message h2 { margin-bottom: 0.75rem; }
.error-message p { color: var(--text-muted); margin: 0.4rem 0; font-size: 0.9rem; }
.error-message code { background: var(--bg-card); padding: 2px 8px; border-radius: 4px; color: var(--text-code); }
.error-message details { margin-top: 1rem; text-align: left; }
.error-message pre { background: var(--bg-card); padding: 0.75rem; border-radius: var(--radius-md); font-size: 0.75rem; color: var(--red); white-space: pre-wrap; }
.error-link { display: inline-block; margin-top: 0.5rem; padding: 0.5rem 1.5rem; background: var(--blue); color: #000; border-radius: var(--radius-md); text-decoration: none; font-weight: 700; }

/* ─── SweetAlert2 overrides ──────────────────── */
.swal2-popup { font-family: var(--font-ui) !important; }
.swal2-title { color: var(--text-main) !important; }
.unlock-content { text-align: center; }
.unlock-icon { font-size: 3rem; display: block; margin-bottom: 0.75rem; }
.unlock-content h3 { font-size: 1.3rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.5rem; }
.unlock-content p { color: var(--text-muted); font-size: 0.9rem; }

/* ─── Sidebar Groups ─────────────────────────── */
.nav-group {
  margin: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  border-left: 3px solid var(--group-color, var(--border));
}
.nav-group-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  background: color-mix(in srgb, var(--group-color, var(--blue)) 8%, transparent);
  cursor: default;
}
.nav-group-num {
  min-width: 1.4rem;
  height: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--group-color, var(--blue)) 22%, transparent);
  color: var(--group-color, var(--blue));
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}
.nav-group-icon { font-size: 1rem; }
.nav-group-title { flex: 1; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.nav-group-toggle { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.65rem; padding: 2px 4px; border-radius: var(--radius-sm); transition: var(--transition); }
.nav-group-toggle:hover { background: var(--bg-hover); }
.nav-group-body { background: var(--bg-deep); }

/* Override: items inside groups have no outer margin */
.nav-group .nav-item { margin: 2px 4px; }

/* ─── Master Quest Button ─────────────────────── */
.btn-master-quest {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: var(--transition);
  flex-shrink: 0;
}
.btn-master-quest:hover {
  background: color-mix(in srgb, #FFD700 15%, transparent);
  border-color: #FFD700;
  color: #FFD700;
}
.master-quest-banner {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  background: color-mix(in srgb, #FFD700 15%, transparent);
  border: 1px solid #FFD700;
  border-radius: var(--radius-md);
  color: #FFD700;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ─── All-Explored CTA Button ───────────────── */
.btn-start-mq-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  padding: 0.6rem 1.4rem;
  background: color-mix(in srgb, #FFD700 15%, transparent);
  border: 1px solid #FFD700;
  border-radius: var(--radius-md);
  color: #FFD700;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-start-mq-cta:hover {
  background: color-mix(in srgb, #FFD700 25%, transparent);
}

/* ─── Exam Item in Sidebar ───────────────────── */
.nav-exam-item {
  border-style: dashed;
  border-color: var(--section-color, #FFD700);
}
.nav-exam-item.unlocked { border-style: solid; }

/* ─── Legendary styles ───────────────────────── */
.legendary-complete { background: color-mix(in srgb, #FFD700 8%, transparent); border: 1px solid #FFD700; border-radius: var(--radius-lg); }
.legendary-complete h2 { color: #FFD700; font-size: 2rem; }
.legendary-badge-text { color: #FFD700; font-weight: 700; font-size: 1rem; margin-top: 0.5rem !important; }
.session-score.score-legendary { color: #FFD700; }

/* ─── Session History improvements ───────────── */
.nav-session-history {
  display: block;
  background: var(--bg-deep);
  padding: 0.4rem 0.9rem 0.5rem;
  border-top: 1px solid var(--border);
}
.nav-history-label { font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.35rem; }
.nav-session-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.71rem;
  padding: 2px 0;
  border-bottom: 1px solid var(--border);
}
.nav-session-item:last-child { border: none; }
.session-num { color: var(--text-muted); }
.session-date { color: var(--text-muted); }
.session-score { font-weight: 700; }
.score-high { color: var(--green); }
.score-mid  { color: var(--yellow); }
.score-low  { color: var(--red); }
.session-detail { color: var(--text-muted); }
.btn-history-more {
  width: 100%;
  background: none;
  border: none;
  color: var(--blue);
  font-size: 0.7rem;
  cursor: pointer;
  text-align: left;
  padding: 4px 0;
  transition: var(--transition);
}
.btn-history-more:hover { color: color-mix(in srgb, var(--blue) 80%, white); }
.nav-history-rest { border-top: 1px dashed var(--border); padding-top: 4px; margin-top: 2px; }

/* ─── Documentation Controls ─────────────────── */
.doc-controls {
  padding: 0.5rem 0.75rem 0;
  flex-shrink: 0;
}
.btn-doc-collapse-all {
  width: 100%;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 5px 10px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}
.btn-doc-collapse-all:hover { border-color: var(--blue); color: var(--blue); }

/* ─── Documentation Groups ───────────────────── */
.doc-group { margin-bottom: 0.75rem; }
.doc-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  margin-bottom: 0.35rem;
  cursor: default;
}
.doc-group-title { flex: 1; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.doc-group-toggle { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.65rem; padding: 2px 4px; transition: var(--transition); }

/* ─── Code inside question text (from TextFormatter) ─── */
.question-text code, .question-preamble code {
  background: #0d1117;
  border: 1px solid var(--border);
  color: var(--text-code);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  white-space: nowrap;
}
.question-text strong { color: var(--text-main); }

/* ─── Panel toggle buttons ────────────────────── */
.panel-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  flex-shrink: 0;
  line-height: 1;
}
.panel-toggle-btn:hover { background: var(--bg-hover); color: var(--text-main); }

/* Make h2 in panels flex so the toggle btn can be positioned */
#sidebar h2 {
  display: flex;
  align-items: center;
}
#sidebar h2 .panel-toggle-btn { margin-left: auto; }

#documentation-panel h2 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
#documentation-panel h2 .panel-toggle-btn { margin-right: 0.25rem; }

/* Restore buttons — shown outside panels when collapsed */
.panel-restore-btn {
  display: none;
  position: fixed;
  top: calc(var(--header-h) + 1rem);
  z-index: 150;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  width: 20px;
  padding: 10px 3px;
  font-size: 0.65rem;
  line-height: 1;
  transition: var(--transition);
}
.panel-restore-btn:hover { background: var(--bg-hover); color: var(--text-main); }
.panel-restore-left  { left: 0;  border-left: none;  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.panel-restore-right { right: 0; border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }

/* Smooth column transitions for desktop collapses */
#app-main { transition: grid-template-columns 250ms ease; }

#app-main.sidebar-collapsed {
  grid-template-columns: 0 1fr var(--docs-w);
}
#app-main.docs-collapsed {
  grid-template-columns: var(--sidebar-w) 1fr 0;
}

/* ─── Mobile Navigation Bar ─────────────────── */
#mobile-nav { display: none; }

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 1100px) {
  :root { --docs-w: 260px; }
}
@media (max-width: 860px) {
  #app-main { grid-template-columns: 200px 1fr; }
  #documentation-panel { display: none; }
}
@media (max-width: 600px) {
  /* Only evaluation panel visible by default; JS switches panels */
  #app-main {
    grid-template-columns: 1fr;
    padding-bottom: 56px;
    height: calc(100vh - var(--header-h) - 56px);
  }
  #sidebar { display: none; }
  #documentation-panel { display: none; }

  /* Hide desktop toggle/restore buttons on mobile */
  .panel-toggle-btn, .panel-restore-btn { display: none !important; }

  /* Mobile bottom nav */
  #mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 56px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    z-index: 200;
  }
  #mobile-nav button {
    flex: 1;
    background: transparent;
    border: none;
    border-top: 2px solid transparent;
    color: var(--text-muted);
    padding: 4px 0.5rem;
    font-size: 0.68rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-family: var(--font-ui);
  }
  #mobile-nav button span:first-child { font-size: 1.15rem; }
  #mobile-nav button.active {
    color: var(--blue);
    border-top-color: var(--blue);
  }
}

/* ─────────────────────────────────────────────
   SVG sprite icons — minimalist outline + neon glow
   ───────────────────────────────────────────── */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  transition: filter var(--transition), color var(--transition), transform var(--transition);
  pointer-events: none;
}
.icon-sm { font-size: 0.85em; }
.icon-lg { font-size: 1.5em; }

/* Hover glow on interactive parents */
button:not(:disabled):hover > .icon,
button:not(:disabled):hover .icon,
a:hover .icon,
.mode-tab:hover .icon,
.nav-item.unlocked:hover .nav-icon .icon,
.nav-item.unlocked:hover .nav-icon > .icon,
#mobile-nav button:hover .icon {
  filter:
    drop-shadow(0 0 4px currentColor)
    drop-shadow(0 0 1px currentColor);
}

/* Active / selected glow (slightly stronger, slightly larger) */
.mode-tab.active .icon,
.nav-item.active .nav-icon .icon,
.nav-item.active .nav-icon > .icon,
#mobile-nav button.active .icon,
.icon-active {
  filter:
    drop-shadow(0 0 6px currentColor)
    drop-shadow(0 0 2px currentColor);
}

/* Section/group icons inherit color from --section-color or --group-color */
.nav-item .nav-icon { color: var(--section-color, var(--text-main)); }
.nav-group-header .nav-group-icon { color: var(--group-color, var(--blue)); }
.doc-section-header .doc-icon { color: var(--section-color, var(--blue)); }
.section-start-icon { color: var(--section-color, var(--blue)); }
.unlock-icon { color: var(--section-color, var(--blue)); }

/* Big celebration/legendary icons keep their flavor color */
.legendary-complete .complete-icon { color: #FFD700; }
.section-complete:not(.legendary-complete) .complete-icon { color: var(--blue); }
.all-explored .complete-icon { color: #FFD700; }
.legendary-badge-text .icon { color: #FFD700; }
.legendary-marker { color: #FFD700; display: inline-flex; align-items: center; }
.legendary-marker .icon { width: 0.85em; height: 0.85em; }

/* Locked sections: muted icon */
.nav-item.locked .nav-icon { color: var(--text-muted); }

/* Sidebar nav-icon: ensure svg is properly sized inside the centering wrapper */
.nav-icon .icon, .nav-icon > .icon { width: 1.3rem; height: 1.3rem; }
.nav-group-icon .icon { width: 1rem; height: 1rem; }
.doc-icon .icon { width: 1.1rem; height: 1.1rem; }

/* Hint lightbulb */
.hint-number .icon { color: var(--yellow); width: 1em; height: 1em; vertical-align: -0.18em; margin-right: 0.25em; }

/* Master Quest */
.btn-master-quest .icon { width: 1rem; height: 1rem; }
.master-quest-banner { display: inline-flex; align-items: center; gap: 0.45rem; }
.master-quest-banner .icon { width: 1rem; height: 1rem; }
.btn-start-mq-cta .icon { width: 1.05rem; height: 1.05rem; }

/* Practice genre tag */
.practice-genre { display: inline-flex; align-items: center; gap: 0.3rem; }
.practice-genre .icon { width: 0.9rem; height: 0.9rem; }

/* Header & tab icons */
.mode-tab { display: inline-flex; align-items: center; gap: 0.4rem; }
.mode-tab .icon { width: 1rem; height: 1rem; }
#btn-help, #btn-bug { display: inline-flex; align-items: center; gap: 0.4rem; }
#btn-help .icon, #btn-bug .icon { width: 0.9rem; height: 0.9rem; }
#app-header h1 { display: inline-flex; align-items: center; gap: 0.5rem; }
#app-header h1 .icon { width: 1.1rem; height: 1.1rem; color: var(--blue); }

/* Documentation panel header */
#documentation-panel h2 { display: inline-flex; align-items: center; gap: 0.4rem; }
#documentation-panel h2 .icon { width: 1.1rem; height: 1.1rem; color: var(--blue); }

/* Doc group title icon */
.doc-group-title { display: inline-flex; align-items: center; gap: 0.4rem; }
.doc-group-title .icon { width: 0.9rem; height: 0.9rem; color: var(--text-muted); }

/* Mobile nav: SVG sits where emoji used to */
#mobile-nav button .icon { width: 1.4rem; height: 1.4rem; }

/* SweetAlert title icon (unlock dialogs etc.) */
.swal2-title .icon { width: 1.1rem; height: 1.1rem; vertical-align: -0.15em; margin-right: 0.35rem; }

/* Big history check/x */
.history-icon .icon { width: 0.95rem; height: 0.95rem; vertical-align: -0.15em; }

/* Criteria pass/fail icons */
.criteria-check .icon { width: 0.95rem; height: 0.95rem; }
.criteria-pass .criteria-check { color: var(--green); }
.criteria-fail .criteria-check { color: var(--red); }

/* Login / comprar / success page hero icons */
.auth-card h1, .buy-card h1 { display: inline-flex; align-items: center; gap: 0.5rem; }
.auth-card h1 .icon, .buy-card h1 .icon { width: 1.4rem; height: 1.4rem; color: var(--blue); }
.ok-card .check { display: inline-flex; align-items: center; justify-content: center; }
.ok-card .check .icon { width: 4rem; height: 4rem; color: var(--green); filter: drop-shadow(0 0 8px currentColor); }
.ok-card .hint { display: flex; align-items: flex-start; gap: 0.6rem; text-align: left; }
.ok-card .hint .icon { width: 1.2rem; height: 1.2rem; color: var(--blue); flex-shrink: 0; margin-top: 2px; }

/* Bug disclaimer warning icon */
.bug-disclaimer { display: flex; align-items: flex-start; gap: 0.4rem; }
.bug-disclaimer .icon { width: 0.95rem; height: 0.95rem; color: var(--yellow); flex-shrink: 0; margin-top: 2px; }

/* Error overlay */
.error-icon .icon { width: 3rem; height: 3rem; color: var(--red); }

/* Reduce hover/active glow for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .icon { transition: none; }
}

