/* ==========================================================================
   ParasitoLingo — Design System (Duolingo-inspired Practical Parasitology)
   ========================================================================== */

:root {
  /* Core Duolingo-inspired palette */
  --green: #58cc02;
  --green-dark: #46a302;
  --green-light: #d7ffb8;
  --green-soft: #f0fce4;

  --blue: #1cb0f6;
  --blue-dark: #1899d6;
  --blue-light: #ddf4ff;

  --purple: #ce82ff;
  --purple-dark: #a560e8;
  --purple-light: #f3e6ff;

  --teal: #00b894;
  --teal-dark: #009174;
  --teal-light: #e0fbf4;

  --orange: #ff9600;
  --orange-dark: #e07b00;
  --orange-light: #fff3d6;

  --gold: #ffc800;
  --gold-dark: #e5a400;
  --gold-light: #fff9db;

  --red: #ff4b4b;
  --red-dark: #ea2b2b;
  --red-light: #ffdfe0;

  /* Neutrals */
  --bg: #ffffff;
  --bg-subtle: #f7f9fa;
  --surface: #ffffff;
  --border: #e5e5e5;
  --border-strong: #cfcfcf;
  --text: #3c3c3c;
  --text-muted: #777777;
  --text-light: #afafaf;

  /* Microscope dark optics */
  --scope-bg: #0f1419;
  --scope-ring: #1e293b;
  --scope-accent: #38bdf8;

  /* Layout & typography */
  --font-display: 'Nunito', 'Fredoka', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --sidebar-w: 248px;
  --rightbar-w: 336px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font-family: inherit;
}

em, i {
  font-style: italic;
}

/* ==========================================================================
   3D Tactile Buttons (Duolingo signature bevel)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 13px 22px;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.12s ease, background 0.15s ease;
  user-select: none;
  text-decoration: none;
}

.btn:active:not(:disabled) {
  transform: translateY(3px);
}

.btn:disabled {
  background: #e5e5e5 !important;
  color: #afafaf !important;
  box-shadow: 0 4px 0 #d4d4d4 !important;
  border-color: #d4d4d4 !important;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 0 var(--green-dark);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
}
.btn-primary:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--green-dark);
}

.btn-blue {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 0 var(--blue-dark);
}
.btn-blue:hover:not(:disabled) {
  filter: brightness(1.05);
}
.btn-blue:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--blue-dark);
}

.btn-purple {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 4px 0 var(--purple-dark);
}
.btn-purple:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn-gold {
  background: var(--gold);
  color: #5c3d00;
  box-shadow: 0 4px 0 var(--gold-dark);
}

.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 0 var(--red-dark);
}
.btn-danger:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--red-dark);
}

.btn-outline {
  background: #fff;
  color: var(--text);
  border: 2px solid var(--border);
  box-shadow: 0 3px 0 var(--border);
}
.btn-outline:hover:not(:disabled) {
  background: var(--bg-subtle);
}
.btn-outline:active:not(:disabled) {
  box-shadow: 0 0 0 var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  box-shadow: none;
  padding: 8px 14px;
}
.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   App Shell (3-Column Desktop, Bottom Nav Mobile)
   ========================================================================== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rightbar-w);
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
}

/* Left Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 2px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.55rem;
  color: var(--green);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.brand-lu {
  color: #46a302;
}

.brand-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 55%, #b45309 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.nav-item.active {
  background: var(--blue-light);
  border-color: #84d8ff;
  color: var(--blue-dark);
}

.nav-icon {
  font-size: 1.35rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 2px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sound-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 4px 0;
  color: var(--text);
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
}

/* Main Content Area */
.main-content {
  padding: 24px 32px 96px;
  min-width: 0;
}

/* Mobile Top Stats Bar (hidden on desktop) */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--border);
  padding: 10px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Right Sidebar */
.rightbar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px 22px 40px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stats-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 4px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-weight: 900;
  font-size: 0.95rem;
  background: var(--bg-subtle);
  border: 2px solid transparent;
  cursor: default;
}

.stat-pill.streak { color: var(--orange); }
.stat-pill.xp { color: var(--blue-dark); }
.stat-pill.hearts { color: var(--red); cursor: pointer; }
.stat-pill.hearts:hover { border-color: var(--red-light); background: #fff5f5; }

.widget-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.widget-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 900;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.progress-track {
  height: 14px;
  background: #e5e5e5;
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: var(--radius-pill);
  transition: width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 8px;
  right: 8px;
  height: 4px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-pill);
}

.progress-fill.gold { background: var(--gold); }
.progress-fill.blue { background: var(--blue); }
.progress-fill.purple { background: var(--purple); }
.progress-fill.teal { background: var(--teal); }
.progress-fill.orange { background: var(--orange); }

.phylum-meter-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.phylum-meter-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.phylum-meter-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 800;
}

.phylum-meter-row .progress-track {
  height: 9px;
}

.tip-box {
  background: var(--gold-light);
  border: 2px solid #ffe484;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.tip-box strong {
  color: #8a5a00;
}

.tip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

/* ==========================================================================
   Learning Path View (Duolingo Winding Trail)
   ========================================================================== */
.path-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--bg-subtle);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
}

.mode-switch {
  display: inline-flex;
  background: #e9eef2;
  padding: 4px;
  border-radius: var(--radius-sm);
  gap: 4px;
}

.mode-switch button {
  border: none;
  background: transparent;
  padding: 7px 12px;
  border-radius: 9px;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-switch button.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.group-divider {
  margin: 28px 0 18px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  display: flex;
  align-items: center;
  gap: 14px;
}

.group-divider.proto {
  border-color: #99f6e4;
  background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
}

.group-divider.helminth {
  border-color: #e9d5ff;
  background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
}

.group-divider.exam {
  border-color: #fde68a;
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.group-badge {
  font-size: 1.7rem;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #fff;
  border: 2px solid var(--border);
}

.group-divider h2 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1.25;
}

.group-divider p {
  margin: 3px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Unit Header Banner (Duolingo colored strip) */
.unit-block {
  margin-bottom: 34px;
}

.unit-banner {
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  position: relative;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.14);
}

.unit-banner.theme-teal { background: #00a884; box-shadow: 0 5px 0 #008266; }
.unit-banner.theme-blue { background: #1cb0f6; box-shadow: 0 5px 0 #148ec9; }
.unit-banner.theme-green { background: #58cc02; box-shadow: 0 5px 0 #46a302; }
.unit-banner.theme-purple { background: #a560e8; box-shadow: 0 5px 0 #823ec7; }
.unit-banner.theme-gold { background: #f59e0b; box-shadow: 0 5px 0 #c97d00; }

.unit-kicker {
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.9;
}

.unit-title {
  margin: 2px 0 4px;
  font-size: 1.26rem;
  font-weight: 900;
  line-height: 1.2;
}

.unit-desc {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.95;
  line-height: 1.35;
}

.unit-guide-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.unit-guide-btn:hover {
  background: rgba(255, 255, 255, 0.32);
}

/* Winding Path Nodes */
.unit-nodes {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 10px 0 6px;
}

.node-row {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.node-anchor {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s ease;
}

.node-btn {
  width: 78px;
  height: 72px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  font-size: 1.85rem;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s ease, filter 0.15s ease;
  z-index: 2;
}

.node-btn:active:not(:disabled) {
  transform: translateY(4px);
}

/* Node states */
.node-btn.state-done {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 7px 0 var(--gold-dark);
}

.node-btn.state-current.theme-teal { background: #00a884; color: #fff; box-shadow: 0 7px 0 #007d62; }
.node-btn.state-current.theme-blue { background: #1cb0f6; color: #fff; box-shadow: 0 7px 0 #148ec9; }
.node-btn.state-current.theme-green { background: #58cc02; color: #fff; box-shadow: 0 7px 0 #46a302; }
.node-btn.state-current.theme-purple { background: #a560e8; color: #fff; box-shadow: 0 7px 0 #823ec7; }
.node-btn.state-current.theme-gold { background: #f59e0b; color: #fff; box-shadow: 0 7px 0 #c97d00; }

.node-btn.state-unlocked.theme-teal { background: #00a884; color: #fff; box-shadow: 0 7px 0 #007d62; }
.node-btn.state-unlocked.theme-blue { background: #1cb0f6; color: #fff; box-shadow: 0 7px 0 #148ec9; }
.node-btn.state-unlocked.theme-green { background: #58cc02; color: #fff; box-shadow: 0 7px 0 #46a302; }
.node-btn.state-unlocked.theme-purple { background: #a560e8; color: #fff; box-shadow: 0 7px 0 #823ec7; }
.node-btn.state-unlocked.theme-gold { background: #f59e0b; color: #fff; box-shadow: 0 7px 0 #c97d00; }

.node-btn.state-locked {
  background: #e5e5e5;
  color: #afafaf;
  box-shadow: 0 7px 0 #c8c8c8;
  cursor: pointer;
}

/* Ring around current active node */
.node-ring {
  position: absolute;
  inset: -11px;
  border-radius: 50%;
  border: 5px solid #e5e5e5;
  pointer-events: none;
  z-index: 1;
}

.node-ring.active {
  border-color: var(--green);
  animation: pulseRing 2.1s infinite ease-in-out;
}

@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.07); opacity: 0.45; }
}

.node-start-callout {
  position: absolute;
  top: -42px;
  background: #fff;
  color: var(--green-dark);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 5px 12px;
  font-weight: 900;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  animation: floatBob 2s infinite ease-in-out;
  z-index: 5;
}

.node-start-callout::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 11px;
  height: 11px;
  background: #fff;
  border-right: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
}

@keyframes floatBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.node-label {
  margin-top: 12px;
  text-align: center;
  max-width: 240px;
}

.node-label-title {
  font-weight: 800;
  font-size: 0.93rem;
  color: var(--text);
  line-height: 1.25;
}

.node-label-sub {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 2px;
}

.node-stars {
  display: inline-flex;
  gap: 2px;
  margin-top: 3px;
  font-size: 0.8rem;
}

/* Floating Mascot alongside path */
.unit-mascot-float {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.mascot-bubble {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 7px 11px;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text);
  max-width: 155px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Lesson Preview Popover Modal */
.lesson-popover-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 80;
  animation: fadeIn 0.15s ease;
}

.lesson-popover {
  background: #fff;
  border-radius: 24px;
  border: 2px solid var(--border);
  max-width: 460px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
  animation: popUp 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lesson-popover-head {
  padding: 22px 24px 18px;
  color: #fff;
}

.lesson-popover-head.theme-teal { background: #00a884; }
.lesson-popover-head.theme-blue { background: #1cb0f6; }
.lesson-popover-head.theme-green { background: #58cc02; }
.lesson-popover-head.theme-purple { background: #a560e8; }
.lesson-popover-head.theme-gold { background: #f59e0b; }

.lesson-popover-body {
  padding: 20px 24px 24px;
}

.popover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  color: var(--text);
}

/* ==========================================================================
   Optical Microscope Simulator Component
   ========================================================================== */
.microscope-card {
  background: #111827;
  border-radius: 22px;
  padding: 18px 18px 14px;
  color: #e2e8f0;
  border: 3px solid #263244;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  margin: 0 auto 20px;
  max-width: 560px;
}

.microscope-top-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #94a3b8;
}

.hud-badge {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.32);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
}

.eyepiece-stage {
  position: relative;
  width: 288px;
  height: 288px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: #0a0f14;
  border: 8px solid #1e293b;
  box-shadow:
    inset 0 0 42px rgba(0, 0, 0, 0.85),
    0 0 0 2px #334155,
    0 10px 26px rgba(0, 0, 0, 0.45);
}

.eyepiece-img-wrap {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}

.eyepiece-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease, filter 0.18s ease;
  user-select: none;
  pointer-events: none;
}

.eyepiece-img.stain-lugol {
  filter: sepia(0.68) saturate(1.8) hue-rotate(-14deg) contrast(1.12);
}

.eyepiece-img.stain-contrast {
  filter: contrast(1.28) saturate(1.15);
}

.eyepiece-vignette {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, transparent 58%, rgba(0, 0, 0, 0.52) 92%, rgba(0, 0, 0, 0.9) 100%);
}

.eyepiece-reticle {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
}

.eyepiece-reticle::before,
.eyepiece-reticle::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.55);
}

.eyepiece-reticle::before {
  left: 50%;
  top: 12%;
  bottom: 12%;
  width: 1px;
}

.eyepiece-reticle::after {
  top: 50%;
  left: 12%;
  right: 12%;
  height: 1px;
}

.eyepiece-scalebar {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
  z-index: 3;
}

.scale-line {
  width: 64px;
  height: 3px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
  border-left: 2px solid #fff;
  border-right: 2px solid #fff;
}

.scale-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.98);
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 6px;
  border-radius: 999px;
}

.schematic-layer {
  position: absolute;
  inset: 0;
  background: #fdfbf4;
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 4;
}

.schematic-layer svg {
  width: 100%;
  height: 100%;
}

.microscope-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #263244;
}

.scope-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.scope-btn {
  background: #1e293b;
  color: #cbd5e1;
  border: 1.5px solid #334155;
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scope-btn:hover {
  background: #2b3b52;
  color: #fff;
}

.scope-btn.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #fff;
}

.focus-slider-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  font-weight: 800;
  color: #94a3b8;
}

.focus-slider-wrap input[type="range"] {
  width: 86px;
  accent-color: #38bdf8;
  cursor: pointer;
}

.scope-caption {
  margin-top: 8px;
  font-size: 0.72rem;
  color: #94a3b8;
  text-align: center;
}

/* ==========================================================================
   Full-Screen Quiz Session Modal
   ========================================================================== */
.quiz-overlay {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.quiz-header {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.quiz-close-btn {
  background: transparent;
  border: none;
  font-size: 1.65rem;
  color: var(--text-light);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  line-height: 1;
}

.quiz-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.quiz-progress-wrap {
  flex: 1;
}

.quiz-progress-wrap .progress-track {
  height: 16px;
}

.quiz-hearts {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 900;
  font-size: 1.08rem;
  color: var(--red);
}

.combo-chip {
  background: var(--orange-light);
  color: var(--orange-dark);
  border: 2px solid #ffd480;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: 900;
  font-size: 0.8rem;
  animation: popUp 0.25s ease;
}

.quiz-body {
  flex: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 24px 160px;
  display: flex;
  flex-direction: column;
}

.quiz-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--purple-dark);
  margin-bottom: 6px;
}

.quiz-kicker.retry {
  color: var(--orange-dark);
}

.quiz-prompt {
  margin: 0 0 18px;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.28;
  color: var(--text);
}

.quiz-subprompt {
  margin: -10px 0 18px;
  font-size: 0.96rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-left: 4px solid var(--blue);
  padding: 10px 14px;
  border-radius: 0 12px 12px 0;
}

/* Multiple Choice Options */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.choice-grid.single-col {
  grid-template-columns: 1fr;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 3px 0 var(--border);
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.choice-card:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.choice-card.selected {
  background: var(--blue-light);
  border-color: var(--blue);
  box-shadow: 0 3px 0 var(--blue-dark);
  color: #0b5d85;
}

.choice-card.correct {
  background: var(--green-light);
  border-color: var(--green);
  box-shadow: 0 3px 0 var(--green-dark);
  color: #2c6e00;
}

.choice-card.wrong {
  background: var(--red-light);
  border-color: var(--red);
  box-shadow: 0 3px 0 var(--red-dark);
  color: #a61c1c;
}

.choice-key {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 2px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-shrink: 0;
  background: #fff;
}

.choice-card.selected .choice-key {
  border-color: var(--blue);
  color: var(--blue-dark);
}

.choice-text-main {
  font-weight: 800;
  line-height: 1.3;
}

.choice-text-sub {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Visual Slide Comparison Grid (Duolingo 4-tile picture picker) */
.slide-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.slide-choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--border);
  cursor: pointer;
  transition: all 0.14s ease;
}

.slide-choice-card:hover:not(:disabled) {
  background: var(--bg-subtle);
  transform: translateY(-2px);
}

.slide-choice-card.selected {
  background: var(--blue-light);
  border-color: var(--blue);
  box-shadow: 0 4px 0 var(--blue-dark);
}

.slide-choice-card.correct {
  background: var(--green-light);
  border-color: var(--green);
  box-shadow: 0 4px 0 var(--green-dark);
}

.slide-choice-card.wrong {
  background: var(--red-light);
  border-color: var(--red);
  box-shadow: 0 4px 0 var(--red-dark);
}

.mini-ocular {
  width: 156px;
  height: 156px;
  border-radius: 50%;
  overflow: hidden;
  border: 5px solid #1e293b;
  background: #0f172a;
  position: relative;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.7);
}

.mini-ocular img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-ocular-label {
  font-weight: 800;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Match Pairs Mechanic */
.match-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-col-head {
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2px;
}

.match-tile {
  padding: 14px 14px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  box-shadow: 0 3px 0 var(--border);
  background: #fff;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.14s ease;
  text-align: center;
  min-height: 62px;
  display: grid;
  place-items: center;
}

.match-tile:hover:not(:disabled) {
  background: var(--bg-subtle);
}

.match-tile.selected {
  background: var(--blue-light);
  border-color: var(--blue);
  box-shadow: 0 3px 0 var(--blue-dark);
  color: #0b5d85;
}

.match-tile.matched {
  background: var(--green-soft);
  border-color: #a5e66f;
  box-shadow: none;
  color: #46a302;
  opacity: 0.58;
  cursor: default;
}

.match-tile.shake-wrong {
  background: var(--red-light);
  border-color: var(--red);
  animation: shake 0.35s ease;
}

/* Taxonomy Builder Mechanic (Duolingo Word Bank) */
.taxonomy-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px;
  background: var(--bg-subtle);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.tax-slot {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.tax-slot-label {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
}

.tax-slot-value {
  font-weight: 800;
  font-size: 0.9rem;
  text-align: center;
  color: var(--text);
}

.tax-slot.filled {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: 0 3px 0 var(--blue-dark);
}

.tax-slot.correct {
  border-color: var(--green);
  background: var(--green-light);
}

.tax-slot.wrong {
  border-color: var(--red);
  background: var(--red-light);
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.word-chip {
  padding: 10px 16px;
  border-radius: 14px;
  border: 2px solid var(--border);
  box-shadow: 0 3px 0 var(--border);
  background: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.12s ease;
}

.word-chip:hover:not(:disabled) {
  background: var(--bg-subtle);
  transform: translateY(-1px);
}

.word-chip.used {
  background: #ebebeb;
  color: transparent;
  border-color: #dcdcdc;
  box-shadow: none;
  pointer-events: none;
}

/* Hint box inside quiz */
.quiz-hint-banner {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--gold-light);
  border: 2px solid #ffe484;
  font-size: 0.9rem;
  color: #6b4500;
  font-weight: 700;
  animation: fadeIn 0.2s ease;
}

/* Fixed Bottom Feedback Footer */
.quiz-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid var(--border);
  padding: 18px 24px;
  z-index: 110;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.quiz-footer.state-correct {
  background: var(--green-light);
  border-top-color: #a5e66f;
}

.quiz-footer.state-wrong {
  background: var(--red-light);
  border-top-color: #ffb3b3;
}

.quiz-footer-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.feedback-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
}

.feedback-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 900;
  flex-shrink: 0;
  background: #fff;
}

.state-correct .feedback-icon { color: var(--green-dark); }
.state-wrong .feedback-icon { color: var(--red-dark); }

.feedback-title {
  font-weight: 900;
  font-size: 1.12rem;
  margin-bottom: 2px;
}

.state-correct .feedback-title { color: #2f7200; }
.state-wrong .feedback-title { color: #b91c1c; }

.feedback-explain {
  font-size: 0.89rem;
  line-height: 1.4;
  color: var(--text);
  font-weight: 700;
}

/* Celebration Screen */
.celebration-screen {
  max-width: 560px;
  margin: 36px auto;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.celebration-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin: 8px 0 12px;
}

.celeb-stat-box {
  border-radius: var(--radius-md);
  border: 2px solid var(--gold);
  overflow: hidden;
  background: #fff;
}

.celeb-stat-box.blue { border-color: var(--blue); }
.celeb-stat-box.green { border-color: var(--green); }

.celeb-stat-head {
  background: var(--gold);
  color: #5c3d00;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 8px;
}

.celeb-stat-box.blue .celeb-stat-head { background: var(--blue); color: #fff; }
.celeb-stat-box.green .celeb-stat-head { background: var(--green); color: #fff; }

.celeb-stat-val {
  padding: 14px 8px;
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text);
}

/* ==========================================================================
   Atlas & Taxonomy Views
   ========================================================================== */
.view-header {
  margin-bottom: 20px;
}

.view-header h1 {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 900;
}

.view-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-pill {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--border);
  background: #fff;
  font-weight: 800;
  font-size: 0.84rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.14s ease;
}

.filter-pill.active {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue-dark);
}

.atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 16px;
}

.atlas-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 0 var(--border);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
  display: flex;
  flex-direction: column;
}

.atlas-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
}

.atlas-thumb {
  height: 175px;
  background: #0f172a;
  position: relative;
  overflow: hidden;
}

.atlas-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.atlas-phylum-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
}

.atlas-stage-tag {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(88, 204, 2, 0.92);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

.atlas-body {
  padding: 15px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.atlas-name {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 900;
  color: var(--text);
}

.atlas-summary {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.atlas-size {
  margin-top: auto;
  padding-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--blue-dark);
  font-weight: 700;
}

/* Atlas Detail Modal */
.atlas-modal {
  background: #fff;
  border-radius: 24px;
  max-width: 720px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.detail-box {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.detail-box-label {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.detail-box-val {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
}

.hallmark-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.9rem;
}

.hallmark-list li {
  margin-bottom: 4px;
}

/* Taxonomy Reference Table */
.tax-table-wrap {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  background: #fff;
  margin-bottom: 22px;
}

.tax-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.tax-table th {
  background: var(--bg-subtle);
  text-align: left;
  padding: 14px 16px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}

.tax-table td {
  padding: 14px 16px;
  border-bottom: 1.5px solid var(--border);
  vertical-align: top;
}

.tax-table tr:last-child td {
  border-bottom: none;
}

.tax-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  margin: 2px 4px 2px 0;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
}

.tax-pill-btn:hover {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue-dark);
}

/* Practice Bench Cards */
.bench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.bench-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 0 var(--border);
}

.bench-card-icon {
  font-size: 2.2rem;
}

.bench-card h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.bench-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
}

/* Achievements Grid */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.badge-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  background: #fff;
}

.badge-card.locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.badge-icon {
  font-size: 2.3rem;
  margin-bottom: 6px;
}

.badge-name {
  font-weight: 900;
  font-size: 0.94rem;
}

.badge-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Confetti Canvas */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

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

@keyframes popUp {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ==========================================================================
   Responsive Design (Tablet & Mobile)
   ========================================================================== */
@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 84px minmax(0, 1fr) 290px;
  }
  .brand-text, .nav-label-txt, .sidebar-footer {
    display: none;
  }
  .sidebar {
    align-items: center;
    padding: 16px 8px;
  }
  .nav-item {
    justify-content: center;
    padding: 12px;
    position: relative;
  }
  .nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
  }
  .unit-mascot-float {
    display: none;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }
  .rightbar {
    display: none;
  }
  .mobile-topbar {
    display: flex;
  }
  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    flex-direction: row;
    border-right: none;
    border-top: 2px solid var(--border);
    padding: 6px 10px;
    justify-content: space-around;
    z-index: 40;
  }
  .brand {
    display: none;
  }
  .nav-list {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    gap: 4px;
  }
  .nav-item {
    width: auto;
    flex: 1;
    padding: 8px;
  }
  .main-content {
    padding: 16px 16px 94px;
  }
  .choice-grid,
  .slide-choice-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .eyepiece-stage {
    width: 244px;
    height: 244px;
  }
  .quiz-prompt {
    font-size: 1.2rem;
  }
  .quiz-footer-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .celebration-stats {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Multi-Dataset Bank Badges, Thumbnail Strip & Source Dashboard
   ========================================================================== */
.dataset-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.32);
}

.dataset-badge.ds-cdc_dpdx {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.4);
}
.dataset-badge.ds-parasitobank {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border-color: rgba(192, 132, 252, 0.45);
}
.dataset-badge.ds-lids_unicamp {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.42);
}
.dataset-badge.ds-wikimedia {
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.4);
}

.dataset-badge-light {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text);
}

.dataset-badge-light.ds-cdc_dpdx { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
.dataset-badge-light.ds-parasitobank { background: #f3e8ff; border-color: #d8b4fe; color: #7e22ce; }
.dataset-badge-light.ds-lids_unicamp { background: #dcfce7; border-color: #86efac; color: #15803d; }
.dataset-badge-light.ds-wikimedia { background: #fef3c7; border-color: #fcd34d; color: #92400e; }

.slide-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.slide-thumb-btn {
  flex: 0 0 auto;
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all 0.12s ease;
}

.slide-thumb-btn:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}

.slide-thumb-btn.active {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: 0 3px 0 var(--blue-dark);
}

.slide-thumb-btn img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #1e293b;
  background: #0f172a;
}

.slide-thumb-tag {
  font-size: 0.62rem;
  font-weight: 900;
  color: var(--text-muted);
  white-space: nowrap;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dataset-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.dataset-source-card {
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dataset-select-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 16px;
  margin-bottom: 18px;
}
