:root {
  --bg: #f0f2f5;
  --bg-secondary: #e8eaef;
  --card: #ffffff;
  --card-hover: #f7f8fa;
  --text: #1a1a2e;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --accent: #4a7de4;
  --accent-hover: #3b6dd4;
  --accent-light: rgba(74, 125, 228, 0.12);
  --ok: #059669;
  --ok-light: rgba(5, 150, 105, 0.1);
  --bad: #dc2626;
  --bad-light: rgba(220, 38, 38, 0.1);
  --border: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 0, 0, 0.2);
  --shadow: rgba(0, 0, 0, 0.08);
  --gradient-1: #4a7de4;
  --gradient-2: #7c3aed;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Splash intro screen ───────────────────────── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  will-change: transform;
}

/* Curtain lift – the whole splash slides up */
.splash.splash-out {
  animation: curtainLift 0.65s cubic-bezier(.76,0,.24,1) forwards;
}

.splash-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.3em;
  max-width: 700px;
  padding: 0 24px;
}

/* Each word starts invisible & blurred */
.splash-word {
  font-size: clamp(34px, 6.5vw, 64px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.12);
  filter: blur(6px);
  transform: translateY(6px);
  transition: color 0.4s ease, filter 0.4s ease, transform 0.4s ease;
}

/* Lit-up state: word is "spotlighted" */
.splash-word.lit {
  color: #fff;
  filter: blur(0);
  transform: translateY(0);
  text-shadow: 0 0 30px rgba(110, 168, 254, 0.4);
}

/* Accent word gets the gradient */
.splash-word-accent.lit {
  background: linear-gradient(135deg, #6ea8fe, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: blur(0) drop-shadow(0 0 20px rgba(167, 139, 250, 0.35));
}

@keyframes curtainLift {
  to { transform: translateY(-100%); }
}

.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 10%, rgba(74, 125, 228, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 40% 60%, rgba(5, 150, 105, 0.04) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1570px;
  margin: 0 auto;
  padding: 0 24px 24px;
}

.hidden {
  display: none !important;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-bottom: 12px;
  gap: 16px;
  animation: fadeUp 0.6s 1.3s cubic-bezier(.22,1,.36,1) both;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  flex-wrap: wrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.iconbtn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  color: var(--text);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.iconbtn:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.iconbtn:active {
  transform: translateY(0);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-cert-switch {
  white-space: nowrap;
}

.topbar-left .btn-cert-switch {
  margin-left: auto;
}

.logo-icon {
  filter: drop-shadow(0 4px 12px rgba(74, 125, 228, 0.3));
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-width: 165px;
  justify-content: center;
  box-sizing: border-box;
  height: 44px;
}

.meta-item svg {
  opacity: 0.7;
}

.meta-score {
  background: linear-gradient(135deg, rgba(74, 125, 228, 0.3) 0%, rgba(124, 58, 237, 0.25) 100%);
  border: 1px solid rgba(74, 125, 228, 0.5);
  color: var(--text);
  width: 215px;
  flex: 0 0 215px;
  justify-content: center;
  padding: 10px 16px;
  box-shadow: 0 0 0 1px rgba(74, 125, 228, 0.3) inset;
}

.meta-score svg {
  opacity: 1;
  color: #fbbf24;
  filter: drop-shadow(0 2px 6px rgba(251, 191, 36, 0.5));
}

/* Layout */
.layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

/* ── Landing animations ─────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-fade-up       { animation: fadeUp 0.6s cubic-bezier(.22,1,.36,1) both; animation-delay: 1.4s; }
.anim-delay-1       { animation-delay: 1.9s; }
.anim-delay-2       { animation-delay: 2.1s; }

/* ── Hub layout: single centered column ────────── */
.certification-hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto 16px;
}

/* ── Hero copy block ───────────────────────────── */
.hub-hero {
  text-align: center;
  padding: 4px 24px 0;
}

.hub-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(74, 125, 228, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hub-hero h2 {
  font-size: clamp(28px, 4.5vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
}

.hub-hero-accent {
  background: linear-gradient(135deg, var(--accent), #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hub-hero p {
  max-width: 54ch;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ── Card row ──────────────────────────────────── */
.hub-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
}

.cert-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 28px 26px 24px;
  border: 1px solid rgba(74, 125, 228, 0.14);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(74, 125, 228, 0.10), rgba(255, 255, 255, 0.95)),
    #ffffff;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.cert-card:hover {
  transform: translateY(-4px);
  border-color: rgba(74, 125, 228, 0.34);
  box-shadow: 0 24px 48px rgba(74, 125, 228, 0.16);
}

.cert-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.cert-card-icon {
  font-size: 28px;
}

.cert-card h3 {
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.cert-card p {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
}

.cert-card small {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.cert-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.cert-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(74, 125, 228, 0.08);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.cert-stat strong {
  font-weight: 800;
  color: var(--accent);
  font-size: 13px;
}

.cert-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(5, 150, 105, 0.12);
  color: var(--ok);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cert-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding: 12px 22px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cert-card:hover .cert-card-cta {
  background: #3b6fd8;
  transform: translateX(3px);
}

/* ── Disclaimer bar ────────────────────────────── */
.hub-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.07);
}

.hub-disclaimer-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.hub-disclaimer-text {
  font-size: 13px;
  line-height: 1.7;
  color: #92400e;
  font-weight: 500;
}

.hub-disclaimer-text strong {
  font-weight: 700;
}

/* ── Legacy classes (unused, kept for safety) ──── */
.cert-card-soon { display: none; }

.session-panel-empty {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.session-panel-empty strong {
  color: var(--text);
}

.session-summary {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
  font-weight: 500;
}

.session-summary strong {
  color: var(--accent);
}

/* Legend Panel (Right Sidebar) */
.sidebar-right {
  width: 215px;
  flex: 0 0 215px;
  position: sticky;
  top: 16px;
}

.legend-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  padding: 16px;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(0, 0, 0, 0.06);
}

.legend-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0 0 14px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.legend-dot.legend-ok {
  background: var(--ok);
  border-color: var(--ok);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.legend-dot.legend-bad {
  background: var(--bad);
  border-color: var(--bad);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Legend panel in content area (below footer) */
.legend-panel-bottom {
  margin-top: 12px;
}
.legend-panel-bottom .legend-items {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
}

/* Session Panel */
.session-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* Pool Groups */
.pool-group {
  margin-bottom: 8px;
}

.pool-group:last-child {
  margin-bottom: 0;
}

.pool-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.pool-header:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.95);
}

.pool-header.open {
  border-color: var(--accent);
  background: var(--accent-light);
}

.pool-chevron {
  flex-shrink: 0;
  transition: transform 0.25s ease;
  transform: rotate(-90deg);
}

.pool-header.open .pool-chevron {
  transform: rotate(0deg);
}

.pool-title {
  flex: 1;
  white-space: nowrap;
}

.pool-count {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 11px;
}

.pool-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.25s ease;
  margin-top: 0;
}

.pool-content.open {
  max-height: 600px;
  opacity: 1;
  margin-top: 6px;
}

.session-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.session-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.session-btn:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.9);
}

.session-btn.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(74, 125, 228, 0.15);
}

.session-btn .session-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.session-btn.active .session-dot {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(74, 125, 228, 0.5);
}

.session-btn .session-label {
  flex: 1;
}

.session-btn .session-label small {
  color: var(--text-muted);
  font-weight: 400;
}

.session-btn.active .session-label small {
  color: var(--text-secondary);
}

.workspace-disclaimer {
  width: 100%;
  margin-top: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(180, 83, 9, 0.2);
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.09);
  color: #92400e;
  font-size: 14px;
  line-height: 1.8;
  font-weight: 600;
}

.workspace-disclaimer strong {
  color: #b45309;
}

.sidebar-info {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(0, 0, 0, 0.06);
}

.sidebar-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  font-weight: 500;
  margin: 0 0 14px 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-desc strong {
  color: var(--accent);
  font-weight: 700;
}

.sidebar-credit {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
}

.sidebar-legal {
  margin: 0 0 14px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid rgba(180, 83, 9, 0.15);
  color: #92400e;
  font-size: 12px;
  line-height: 1.7;
  font-weight: 600;
}

.sidebar-credit strong {
  color: var(--text);
  font-weight: 600;
}

.sidebar-credit a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.sidebar-credit a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Sidebar */
.sidebar {
  width: 275px;
  flex: 0 0 275px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 100px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(0, 0, 0, 0.06);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 14px;
  border-top: 1px solid rgba(74, 125, 228, 0.15);
  border-bottom: 1px solid rgba(74, 125, 228, 0.2);
  border-radius: 16px 16px 0 0;
  background: linear-gradient(135deg, rgba(74, 125, 228, 0.06) 0%, rgba(124, 58, 237, 0.04) 100%);
  position: relative;
}

.sidebar-head::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74, 125, 228, 0.4), transparent);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-transform: uppercase;
}

.sidebar-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-sort-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.sidebar-sort-btn:active {
  transform: translateY(0);
}

.sidebar-sort-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sidebar-sort-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(30, 30, 50, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.sidebar-sort-btn:hover::after,
.sidebar-sort-btn:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sidebar-title svg {
  opacity: 0.8;
  color: var(--accent);
  filter: drop-shadow(0 2px 4px rgba(74, 125, 228, 0.3));
}

.sidebar-sub {
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  background: rgba(74, 125, 228, 0.15);
  border: 1px solid rgba(74, 125, 228, 0.3);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(74, 125, 228, 0.2);
}

.sidebar-list {
  padding: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 100px - 52px);
  display: grid;
  gap: 4px;
}

.sidebar-list::-webkit-scrollbar {
  width: 6px;
}

.sidebar-list::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

.sidebar-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

.qitem {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.qitem::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(74, 125, 228, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.qitem:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(4px);
}

.qitem:hover::before {
  opacity: 1;
}

.qitem.active {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 
    0 0 0 3px rgba(74, 125, 228, 0.1),
    0 8px 20px rgba(74, 125, 228, 0.2);
}

.qitem.active::before {
  opacity: 1;
}

.qnum {
  width: 32px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 11px;
  flex: 0 0 auto;
  transition: all 0.2s ease;
}

.qitem:hover .qnum {
  background: rgba(74, 125, 228, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.qitem.active .qnum {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(74, 125, 228, 0.4);
}

.qstatus {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: rgba(0, 0, 0, 0.05);
  flex: 0 0 auto;
  transition: all 0.2s ease;
}

.qstatus.ok {
  background: var(--ok);
  border-color: var(--ok);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.qstatus.bad {
  background: var(--bad);
  border-color: var(--bad);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.qstatus.answered {
  background: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.qtext {
  flex: 1 1 auto;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.qitem:hover .qtext {
  color: var(--text);
}

.qitem.active .qtext {
  color: var(--text);
}

/* Content */
.content {
  flex: 1 1 auto;
  min-width: 0;
}

.card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(0, 0, 0, 0.06);
  animation: cardFadeIn 0.4s ease;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide transitions for question change */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.card.slide-right .question,
.card.slide-right .answers,
.card.slide-right .feedback {
  animation: slideInRight 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.card.slide-left .question,
.card.slide-left .answers,
.card.slide-left .feedback {
  animation: slideInLeft 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.question-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-light) 0%, rgba(124, 58, 237, 0.1) 100%);
  border: 1px solid rgba(74, 125, 228, 0.3);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-percent {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  min-width: 42px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

.progress-percent.complete {
  color: var(--ok);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--gradient-2) 100%);
  border-radius: 10px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 20px rgba(74, 125, 228, 0.5);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.08), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.question h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Question row with copy button */
.question-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.question-row h2 {
  flex: 1;
}

.copy-question-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.copy-question-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.05);
}

.copy-question-btn:active {
  transform: scale(0.95);
}

.copy-question-btn.copied {
  background: var(--ok-light);
  border-color: var(--ok);
  color: var(--ok);
}

.hint {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.02);
  border-left: 3px solid rgba(74, 125, 228, 0.3);
  border-radius: 8px;
}

/* Answers */
.answers {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.answer {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--border);
  padding: 14px 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text);
  text-align: left;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}

.answer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(74, 125, 228, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.answer:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.answer:hover::before {
  opacity: 1;
}

.answer:active {
  transform: translateY(0);
}

.answer.disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.answer.disabled.correct {
  opacity: 1;
}

.answer.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 
    0 0 0 3px rgba(74, 125, 228, 0.15),
    0 8px 24px rgba(74, 125, 228, 0.25);
}

.answer.selected::before {
  opacity: 1;
}

.answer.correct {
  border-color: var(--ok);
  background: var(--ok-light);
  box-shadow: 
    0 0 0 3px rgba(16, 185, 129, 0.15),
    0 8px 24px rgba(16, 185, 129, 0.25);
}

.answer.correct::before {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, transparent 100%);
  opacity: 1;
}

.answer.wrong {
  border-color: var(--bad);
  background: var(--bad-light);
  box-shadow: 
    0 0 0 3px rgba(239, 68, 68, 0.15),
    0 8px 24px rgba(239, 68, 68, 0.25);
}

.answer.wrong::before {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, transparent 100%);
  opacity: 1;
}

/* Feedback */
.feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-secondary);
  min-height: 50px;
  line-height: 1.5;
  font-size: 14px;
  animation: fadeIn 0.3s ease;
}

.pdf-ref {
  display: none;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  animation: fadeIn 0.3s ease;
}

.pdf-ref.show {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Actions */
.actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  align-items: center;
}

.actions-separator {
  width: 1px;
  height: 32px;
  background: var(--border);
  margin: 0 8px;
  flex-shrink: 0;
}

body.exam-mode .actions-separator {
  display: block;
}

body:not(.exam-mode) .actions-separator {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(74, 125, 228, 0.3);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(74, 125, 228, 0.4);
}

.btn:hover::before {
  opacity: 1;
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:disabled:hover {
  background: var(--accent);
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--border-hover);
  color: var(--text);
  box-shadow: none;
}

.btn-ghost:disabled {
  opacity: 0.4;
}

.btn.btn-cert-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid rgba(74, 125, 228, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 250, 255, 0.9));
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow:
    0 6px 14px rgba(74, 125, 228, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.btn.btn-cert-switch svg {
  opacity: 0.85;
}

.btn.btn-cert-switch:hover {
  background: linear-gradient(180deg, #ffffff, rgba(236, 245, 255, 0.95));
  border-color: rgba(74, 125, 228, 0.48);
  color: #1e293b;
  transform: translateY(-1px);
  box-shadow:
    0 9px 18px rgba(74, 125, 228, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.btn.btn-cert-switch:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--gradient-2) 100%);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #6d28d9 100%);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.btn-success:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.btn-success:disabled:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  transform: none;
}

/* Footer */
.footer {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-muted);
  text-align: center;
}

.footer small {
  font-size: 12px;
  display: block;
  line-height: 1.5;
}

/* Mobile */
@media (max-width: 1024px) {
  .app {
    padding: 0 20px 32px;
  }

  .iconbtn {
    display: inline-flex;
  }

  .topbar {
    padding: 20px 0;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .topbar-left {
    flex: 1;
  }

  .topbar-right {
    gap: 8px;
  }

  .layout {
    flex-direction: column;
    gap: 16px;
  }

  .hub-cards {
    grid-template-columns: 1fr 1fr;
  }

  .sidebar-right {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 88px;
    left: 20px;
    right: 20px;
    width: auto;
    max-height: 70vh;
    transform: translateY(-150%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 
      0 30px 60px rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(0, 0, 0, 0.06);
  }

  .sidebar.open {
    transform: translateY(0);
  }

  .card {
    padding: 24px;
    border-radius: 20px;
  }

  .question h2 {
    font-size: 20px;
  }

  .meta {
    gap: 12px;
  }

  .meta-item {
    padding: 6px 12px;
    font-size: 13px;
  }

  .actions {
    gap: 10px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  .app {
    padding: 0 16px 24px;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 16px 0;
    gap: 12px;
  }

  .topbar-left {
    flex: 1 1 100%;
    margin-bottom: 0;
    justify-content: flex-start;
  }

  .hub-cards {
    grid-template-columns: 1fr;
  }

  .cert-card {
    padding: 20px;
  }

  .hub-hero {
    padding: 32px 16px 0;
  }

  .topbar h1 {
    font-size: 18px;
  }

  /* Pulsante Esame rimpicciolito su mobile */
  .btn-exam {
    min-width: auto;
    padding: 10px 14px;
    font-size: 13px;
    gap: 6px;
    margin-left: 0;
  }

  .btn-cert-switch {
    padding: 10px 14px;
    font-size: 13px;
    margin-left: 0;
    order: 3;
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .btn-exam svg {
    width: 14px;
    height: 14px;
  }

  .btn-exam-text {
    display: none;
  }

  .btn-exam-text-short {
    display: inline;
  }

  /* Meta items sulla seconda riga */
  .topbar-right {
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .meta-item {
    flex: 1;
    min-width: auto;
    padding: 8px 12px;
    font-size: 13px;
  }

  .meta-item svg {
    width: 14px;
    height: 14px;
  }

  .meta {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .card {
    padding: 20px;
  }

  .question h2 {
    font-size: 18px;
  }

  .answer {
    padding: 16px 18px;
    font-size: 16px;
  }

  .actions {
    justify-content: stretch;
    gap: 12px;
  }

  .btn {
    flex: 1;
    justify-content: center;
    padding: 14px 12px;
    min-height: 48px;
    font-size: 15px;
    font-weight: 600;
  }

  .sidebar {
    top: 120px;
    left: 16px;
    right: 16px;
  }

  /* Nascondi Ricomincia su mobile */
  #restartBtn {
    display: none !important;
  }

  .actions-separator {
    display: none;
  }
}

/* ======================== */
/* Exam Session Mode        */
/* ======================== */

/* Sessione Esame Button */
.btn-exam {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 165px;
  justify-content: center;
  box-sizing: border-box;
  height: 44px;
}

.btn-exam-text {
  display: inline;
}

.btn-exam-text-short {
  display: none;
}

.topbar-left .btn-exam {
  margin-left: 12px;
}

.btn-exam:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.btn-exam:active {
  transform: translateY(0);
}

/* Timer */
.meta-timer {
  background: rgba(245, 158, 11, 0.15) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  color: #f59e0b !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  animation: timerPulse 2s ease-in-out infinite;
  width: 215px;
  flex: 0 0 215px;
}

.meta-timer.timer-warning {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #ef4444 !important;
  animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* Termina Test Button (red) */
.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Exam Modal Overlay */
.exam-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.exam-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 90%;
  max-width: 480px;
  padding: 32px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.1);
  animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.exam-modal-small {
  max-width: 420px;
  padding: 28px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.exam-modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.exam-modal-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.exam-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.confirm-text {
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.confirm-text strong {
  color: var(--text);
  display: block;
  margin-top: 8px;
}

/* Score Circle */
.exam-score-circle {
  position: relative;
  width: 120px;
  height: 120px;
}

.exam-score-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-bg {
  fill: none;
  stroke: rgba(0, 0, 0, 0.06);
  stroke-width: 8;
}

.score-fill {
  fill: none;
  stroke: var(--ok);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  transition: none;
}

.score-fill.animate-score {
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-fill.fail {
  stroke: var(--bad);
}

.score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
}

/* Stats */
.exam-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.exam-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
}

.stat-correct { color: var(--ok); }
.stat-wrong { color: var(--bad); }
.stat-skipped { color: var(--text-muted); }

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Result message */
.exam-result-msg {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 12px;
  width: 100%;
}

.exam-result-msg.pass {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--ok);
}

.exam-result-msg.fail {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--bad);
}

/* Modal Actions */
.exam-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: center;
}

.exam-modal-actions .btn {
  flex: 1;
}

/* Hide elements in exam mode */
body.exam-mode .meta-score {
  display: none;
}

body.exam-mode .session-panel {
  opacity: 0.4;
  pointer-events: none;
}

body.exam-mode .btn-exam {
  display: none;
}

body.exam-mode .topbar-left {
  justify-content: flex-start;
  flex: 0 1 auto;
}

body.exam-mode #restartBtn {
  display: none;
}

/* Review mode label */
.review-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  color: #f59e0b;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Logo clickable (no inline styles) */
.logo {
  cursor: pointer;
  user-select: none;
}

/* Feedback colors (no inline styles) */
.feedback-correct {
  color: var(--ok);
}
.feedback-wrong {
  color: var(--bad);
}
.feedback-skipped {
  color: var(--text-muted);
}

.feedback-explanation {
  display: block;
  margin-top: 10px;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: rgba(74, 125, 228, 0.08);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

/* Explanation Button & Panel */
.explanation-wrapper {
  display: none;
  margin-top: 12px;
}

.explanation-wrapper.show {
  display: block;
}

.btn-explanation {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: rgba(74, 125, 228, 0.1);
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-explanation:hover {
  background: rgba(74, 125, 228, 0.2);
  box-shadow: 0 2px 8px rgba(74, 125, 228, 0.2);
}

.btn-explanation.active {
  background: var(--accent-light);
  border-color: var(--accent);
}

.explanation-chevron {
  transition: transform 0.25s ease;
}

.btn-explanation.active .explanation-chevron {
  transform: rotate(180deg);
}

.explanation-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.3s ease;
  margin-top: 0;
}

.explanation-panel.open {
  max-height: 1500px;
  opacity: 1;
  margin-top: 10px;
}

.explanation-content {
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  border-radius: 0 14px 14px 0;
  background: linear-gradient(180deg, rgba(74, 125, 228, 0.12) 0%, rgba(74, 125, 228, 0.06) 100%);
  box-shadow: inset 0 0 0 1px rgba(74, 125, 228, 0.08);
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.85;
}

.explanation-content p {
  margin: 0;
}

.explanation-content p + p {
  margin-top: 14px;
}

.explanation-content strong {
  color: var(--text);
  font-weight: 700;
}

.explanation-content .explanation-section-title {
  display: block;
  margin-top: 6px;
  margin-bottom: 4px;
  font-size: 15px;
}

.explanation-content .explanation-label {
  color: var(--accent);
}

.explanation-content a {
  color: var(--accent);
  font-weight: 600;
  word-break: break-word;
}

/* =============================================
   Security: initial hidden state
   (CSP-compliant — replaces inline style="display:none")
   ============================================= */
/* =============================================
   Visibility utility classes (CSP-compliant)
   No inline styles needed — all display toggling
   is done via class additions/removals in JS.
   ============================================= */
#examTimer,
#submitBtn,
#endExamBtn,
#confirmEndModal,
#examModal {
  display: none;
}

.show-flex {
  display: flex !important;
}

.show-inline-flex {
  display: inline-flex !important;
}

.force-hidden {
  display: none !important;
}

/* =============================================
   Notification toast (replaces alert())
   ============================================= */
.notification-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid var(--accent);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  z-index: 10000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(74, 125, 228, 0.3);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.notification-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Terms Modal ───────────────────────────────── */
.terms-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9999;
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.terms-modal-overlay.active {
  display: flex;
}
.terms-modal {
  background: var(--card);
  border-radius: 14px;
  max-width: 620px; width: 100%;
  max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  animation: modalSlideIn .35s cubic-bezier(.34,1.56,.64,1);
}
.terms-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
}
.terms-modal-header h2 { margin: 0; font-size: 1.15rem; color: var(--text); }
.terms-modal-close {
  background: none; border: none; font-size: 1.6rem; cursor: pointer;
  color: var(--text-muted); line-height: 1;
}
.terms-modal-close:hover { color: var(--text); }
.terms-modal-body {
  padding: 1.2rem 1.4rem;
  overflow-y: auto;
  font-size: .92rem; line-height: 1.65;
  color: var(--text-secondary);
}
.terms-modal-body ol { padding-left: 1.2em; margin: 0; }
.terms-modal-body li { margin-bottom: .7rem; }
.terms-modal-body strong { color: var(--text); }

/* ── Cookie Consent Banner ─────────────────────── */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: .9rem 1.4rem;
  display: none; align-items: center; justify-content: space-between;
  gap: 1rem;
  z-index: 10000;
  box-shadow: 0 -4px 20px rgba(0,0,0,.1);
  flex-wrap: wrap;
}
.cookie-banner.active {
  display: flex;
}
.cookie-banner-text {
  flex: 1 1 300px;
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.cookie-banner-actions {
  display: flex; gap: .5rem; flex-shrink: 0;
}
.cookie-btn {
  padding: .45rem 1.1rem;
  border-radius: 8px; border: none;
  font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: background .2s, color .2s;
}
.cookie-btn-accept {
  background: var(--accent); color: #fff;
}
.cookie-btn-accept:hover { background: var(--accent-hover); }
.cookie-btn-reject {
  background: var(--bg-secondary); color: var(--text-secondary);
}
.cookie-btn-reject:hover { background: var(--border); }
