/* Generated by scripts/build-assets.ps1. Edit src/frontend sources. */
:root {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #273549;
  --bg-input: #0b1120;
  --border-color: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #6366f1;
  --accent: #eab308;
  --success: #10b981;
  --success-hover: #059669;
  --warning: #f59e0b;
  --warning-hover: #d97706;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --radius: 12px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}


* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app-container {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  min-width: 0;
}

.hidden {
  display: none !important;
}

sub, sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}


/* ---------------- AUTH SCREEN ---------------- */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  text-align: center;
}

.app-logo {
  font-size: 3rem;
  margin-bottom: 12px;
}

.auth-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------------- INPUTS & BUTTONS ---------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: normal;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}
.btn-secondary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

.btn-accent {
  background: #d97706;
  color: #fff;
}
.btn-accent:hover {
  background: #b45309;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: var(--danger-hover);
}


body.body-modal-open { overflow: hidden; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--primary, #3b82f6); outline-offset: 3px;
}
.theme-toggle-btn, .hamburger-btn, .mobile-nav-close, .card-mini-report-btn, .modal-close-btn {
  min-width: 44px; min-height: 44px;
}
.btn-xs { padding: 6px 10px; font-size: .78rem; }
.btn-copy { white-space: nowrap; }
.quiz-option-btn.selected { outline: 3px solid var(--primary, #3b82f6); outline-offset: 2px; opacity: .8; }

/* ---------------- APP HEADER & NAV ---------------- */
.app-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.header-logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
  cursor: pointer;
}

.header-brand-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.logo-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(135deg, #60a5fa, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
}

.header-profession-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  font-weight: 500;
  max-width: 250px;
  transition: border-color 0.2s;
}

.header-profession-select:focus,
.header-profession-select:hover {
  border-color: var(--primary);
}

[data-theme="light"] .header-profession-select {
  background: #ffffff;
  color: #0f172a;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Farbschema Toggle Button */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.06);
}

[data-theme="light"] .theme-toggle-btn {
  background: #f1f5f9;
}

/* Kombiniertes Header Profil- & Level-Widget */
.header-profile-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 150px;
  user-select: none;
  height: 38px;
  box-sizing: border-box;
}

.header-profile-widget:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary);
}

[data-theme="light"] .header-profile-widget {
  background: #f8fafc;
}

.header-profile-rank-icon {
  font-size: 2.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  overflow: visible;
}

.header-profile-rank-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.rank-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 4px;
  display: inline-block;
}

.rank-color-picker-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  padding: 0;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.rank-color-picker-input:hover {
  transform: scale(1.08);
  border-color: var(--primary, #3b82f6);
}

.rank-color-picker-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.rank-color-picker-input::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.header-profile-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.header-profile-user-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  line-height: 1.2;
}

.header-profile-lvl {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--primary);
  flex-shrink: 0;
}

.header-profile-name {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.header-profile-xp-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-profile-xp-track {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
  min-width: 45px;
}

[data-theme="light"] .header-profile-xp-track {
  background: #cbd5e1;
}

.header-profile-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.header-profile-xp-text {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.user-badge {
  font-size: 0.78rem;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Hamburger Button */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 36px;
  height: 36px;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.hamburger-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Backdrop */
.mobile-nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 999;
  transition: opacity 0.2s ease;
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 290px;
  max-width: 85vw;
  background: var(--bg-card);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
}

[data-theme="light"] .mobile-nav-drawer {
  background: #ffffff;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
}

.header-icon-btn {
  padding: 6px 10px !important;
  font-size: 1.15rem !important;
  line-height: 1 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  gap: 10px;
}

.mobile-nav-top-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.mobile-brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(135deg, #60a5fa, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
}

.mobile-brand-selects {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.mobile-nav-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  font-weight: 500;
  width: 100%;
}

[data-theme="light"] .mobile-nav-select {
  background: #f1f5f9;
  color: #0f172a;
}

.mobile-nav-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 8px;
  line-height: 1;
}

.mobile-nav-close:hover {
  color: var(--text-main);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.mobile-nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

[data-theme="light"] .mobile-nav-link:hover {
  background: rgba(0, 0, 0, 0.05);
}

.mobile-nav-link.active {
  background: var(--primary);
  color: #ffffff;
}

/* Mobile Nav Drawer Footer */
.mobile-nav-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  padding: 10px 14px;
}

.mobile-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  padding: 10px 14px;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

.mobile-guest-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.mobile-guest-buttons .btn {
  width: 100%;
  justify-content: center;
  padding: 10px 14px;
}

/* Tab navigation (compact & sleek) */
.sub-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow-x: auto;
  background: #131d31;
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  scrollbar-width: thin;
  position: relative;
  min-height: 41px;
}

.sub-nav-left-spacer {
  flex: 1 1 0px;
  min-width: 0;
  pointer-events: none;
}

.sub-nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
}

.sub-nav-right {
  flex: 1 1 0px;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

[data-theme="light"] .sub-nav {
  background: #e2e8f0;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav-tab:hover {
  color: var(--text-main);
}

.nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

@media (max-width: 900px) {
  .sub-nav {
    display: none;
  }
  .hamburger-btn {
    display: flex;
  }
  .header-brand-block {
    display: none !important;
  }
  #btn-theme-toggle,
  .header-auth-btn,
  #btn-header-logout {
    display: none !important;
  }
}



/* ---------------- MAIN LAYOUT ---------------- */
.main-content {
  flex: 1;
  padding: 30px 20px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .main-content {
    padding: 16px 12px;
  }
}

.page-section {
  animation: fadeIn 0.25s ease-in-out;
}

.welcome-banner {
  margin-bottom: 24px;
}

.welcome-banner h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.welcome-banner p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ---------------- HOME DASHBOARD (SIDE-BY-SIDE ON DESKTOP, STACKED ON MOBILE) ---------------- */
.home-dashboard-layout {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 22px;
  align-items: start;
  min-width: 0;
  width: 100%;
}

.home-bottom-levels {
  margin-top: 24px;
  min-width: 0;
  width: 100%;
}

@media (max-width: 960px) {
  .home-dashboard-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

.home-modes-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.home-modes-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.mode-card-compact {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px 18px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.mode-card-compact:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .mode-card-compact:hover {
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.1);
}

.mode-compact-icon {
  font-size: 1.7rem;
  flex-shrink: 0;
  line-height: 1;
}

.mode-compact-body {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.mode-compact-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  min-width: 0;
}

.mode-compact-title-row h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.mode-compact-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.3;
  min-width: 0;
}

@media (max-width: 600px) {
  .mode-card-compact {
    padding: 12px 14px;
    gap: 12px;
  }
  .mode-compact-icon {
    font-size: 1.5rem;
  }
  .mode-compact-title-row h3 {
    font-size: 1rem;
  }
  .mode-compact-subtitle {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
    font-size: 0.78rem;
  }
}

.mode-compact-action {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 6px 12px !important;
  font-size: 0.82rem !important;
}

.home-stats-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  width: 100%;
}

.stats-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.stat-box-compact {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  box-sizing: border-box;
}

[data-theme="light"] .stat-box-compact {
  background: #f8fafc;
}

.stat-box-compact .stat-number {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-box-compact .stat-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Mode Setup Screen Relocated Highscores & Progress */
.mode-setup-header-stats {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

[data-theme="light"] .mode-setup-header-stats {
  background: #f8fafc;
}

/* ---------------- COMPACT 2-COLUMN CATEGORY CHECKLIST ---------------- */
.category-group-compact {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
}

[data-theme="light"] .category-group-compact {
  background: #f8fafc;
}

.category-compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.category-compact-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.category-compact-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
}

.category-compact-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
}

[data-theme="light"] .category-compact-badge {
  background: rgba(0, 0, 0, 0.06);
}

.category-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 12px;
}

@media (max-width: 768px) {
  .category-checkbox-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.category-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.category-check-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

[data-theme="light"] .category-check-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.category-check-item.selected {
  color: var(--text-main);
  font-weight: 500;
}

.category-check-item input[type="checkbox"],
.category-compact-header-left input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.category-check-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-check-count {
  font-size: 0.74rem;
  opacity: 0.65;
  flex-shrink: 0;
}

/* Mode List & Card Layout */
.modes-list-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}
.mode-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

/* Wide Mode Cards (Üben & Handlungssituationen) */
.mode-card-wide {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(30, 41, 59, 0.7) 100%);
}
.mode-header-wide {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.mode-title-desc {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mode-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mode-title-row h3 {
  font-size: 1.35rem;
  margin: 0;
}
.badge-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(96, 165, 250, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.3);
}
.mode-action-wrap {
  display: flex;
  align-items: center;
}

/* 2x2 Progress Grid in Top-Right */
.progress-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 10px 14px;
  flex: 1;
  max-width: 480px;
  min-width: 290px;
}
.progress-grid-2x2 .progress-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.progress-grid-2x2 .progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}
.progress-grid-2x2 .progress-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.progress-grid-2x2 .progress-count {
  font-size: 0.76rem;
  font-weight: 600;
  color: #cbd5e1;
}

/* Bottom Action Row in Wide Cards */
.mode-bottom-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.mode-highscore-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: #facc15;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.28);
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mode-highscore-badge .highscore-val {
  color: #fef08a;
  font-weight: 700;
}

.quiz-highscore-tag {
  display: inline-block;
  font-size: 0.88rem;
  color: #facc15;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.quiz-record-alert {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25), rgba(245, 158, 11, 0.35));
  border: 2px solid #eab308;
  color: #fef08a;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 14px 0;
  text-align: center;
}

/* 4 Progress Bars Stack */
.progress-section {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 18px;
}
.progress-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.progress-bars-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px 18px;
}
.progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}
.progress-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-main);
}
.progress-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.fill-green {
  background: linear-gradient(90deg, #059669, #10b981);
}
.fill-yellow {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}
.fill-red {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}
.fill-gray {
  background: linear-gradient(90deg, #475569, #64748b);
}

/* Rows for Flat/Compact Mode Cards */
.mode-row-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.mode-row-three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.mode-card-flat {
  padding: 16px 20px;
}
.mode-flat-content {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.mode-flat-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mode-flat-text h3 {
  font-size: 1.15rem;
  margin: 0;
}
.mode-flat-text p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.35;
}

/* Type Badges (Wert vs Definition) */
.badge-wert {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.badge-def {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.mode-icon {
  font-size: 2.2rem;
}

.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.stats-card h3 {
  margin-bottom: 16px;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.stat-box {
  background: var(--bg-main);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  text-align: center;
}
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #60a5fa;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}


/* ---------------- CARD CONTAINER / BOXES ---------------- */
.card-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.setup-box {
  max-width: 650px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .card-container {
    padding: 18px 14px;
  }
  .setup-box {
    gap: 16px;
  }
  .setup-box h2 {
    font-size: 1.4rem;
  }
}

.setup-box h2 {
  font-size: 1.8rem;
}

.setup-box .desc {
  color: var(--text-muted);
  line-height: 1.5;
}

.rating-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: var(--bg-main);
  padding: 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.config-group {
  align-items: center;
  gap: 12px;
}

.count-selector {
  display: flex;
  gap: 8px;
  align-items: center;
}

.count-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}

.count-btn.active, .count-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

#practice-card-count {
  width: 70px;
  padding: 8px;
  text-align: center;
}

/* ---------------- PROGRESS BAR ---------------- */
.session-progress-bar-container {
  max-width: 700px;
  margin: 0 auto 20px auto;
}

.session-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 500;
}

.round-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.session-progress-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-session-exit {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.btn-session-exit:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fee2e2;
  transform: translateY(-1px);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width 0.3s ease;
}

/* ---------------- FLASHCARD DISPLAY ---------------- */
.flashcard-wrapper {
  max-width: 700px;
  margin: 0 auto;
  perspective: 1000px;
}

.flashcard {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  padding: 42px 32px 32px 32px;
  position: relative;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.side-badge {
  display: none !important;
}

.card-face-back .side-badge {
  display: none !important;
}

.card-face-back {
  border-top: 2px dashed var(--border-color);
  margin-top: 20px;
  padding-top: 20px;
}

.card-content-text {
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text-main);
  word-break: break-word;
}

.card-author {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 16px;
}

/* Controls under card */
.card-controls {
  max-width: 700px;
  margin: 24px auto 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.btn-flip {
  min-width: 220px;
}

.rating-buttons {
  display: flex;
  gap: 16px;
  width: 100%;
  justify-content: center;
}

.btn-rating {
  flex: 1;
  max-width: 180px;
  padding: 16px 12px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s, background-color 0.2s;
  font-family: inherit;
}
.btn-rating:hover {
  transform: translateY(-3px);
}
.btn-rating .rating-icon {
  font-size: 1.8rem;
}
.btn-rating .rating-text {
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-rating-red {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.btn-rating-red:hover {
  background: rgba(239, 68, 68, 0.3);
}

.btn-rating-yellow {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde68a;
}
.btn-rating-yellow:hover {
  background: rgba(245, 158, 11, 0.3);
}

.btn-rating-green {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}
.btn-rating-green:hover {
  background: rgba(16, 185, 129, 0.3);
}

.finish-icon {
  font-size: 3.5rem;
}

/* ---------------- TEST MODUS ---------------- */
.test-question-card {
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.test-question-text {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.55;
  color: #93c5fd;
}

.test-input-group textarea {
  resize: vertical;
  min-height: 100px;
}

.results-header {
  text-align: center;
  margin-bottom: 24px;
}
.score-display {
  display: inline-block;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 12px;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.result-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.result-box {
  background: var(--bg-main);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.result-box-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.result-box-content {
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.result-eval-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.eval-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}
.eval-checkbox-label input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

/* ---------------- WER WIRD MILLIONÄR ---------------- */
.quiz-header-bar {
  max-width: 700px;
  margin: 0 auto 16px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-score-pill {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
  padding: 4px 14px;
  border-radius: 20px;
  font-weight: 600;
}

.quiz-question-box {
  max-width: 700px;
  margin: 0 auto 24px auto;
  background: var(--bg-card);
  border: 2px solid #6366f1;
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
  text-align: center;
}

.quiz-question-text {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.5;
}

.quiz-options-grid {
  max-width: 700px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.quiz-option-btn {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1.35;
}
.quiz-option-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: #6366f1;
  transform: translateY(-2px);
}
.option-letter {
  background: rgba(255, 255, 255, 0.1);
  color: #a5b4fc;
  font-weight: 700;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quiz-option-btn.correct {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: #10b981 !important;
  color: #a7f3d0;
  animation: pulseGreen 0.5s;
}

.quiz-option-btn.wrong {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #fca5a5;
  animation: shake 0.3s;
}

@keyframes pulseGreen {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.quiz-next-container {
  max-width: 700px;
  margin: 24px auto 0 auto;
  text-align: center;
}


/* ---------------- ADMIN VIEW ---------------- */
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 20px;
  overflow-x: auto;
}
.admin-tab-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}
.admin-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.admin-tab-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.proposals-list, .cards-admin-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.proposal-item, .card-item-admin {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.proposal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.proposal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.add-password-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.flex-1 {
  flex: 1;
  min-width: 180px;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}
.data-table th {
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}
.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ---------------- ALERTS ---------------- */
.alert-box {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 12px;
}
.alert-box.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.alert-box.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 650px) {
  .app-header {
    padding: 10px 14px;
  }
  .header-center {
    display: none;
  }
  .quiz-options-grid {
    grid-template-columns: 1fr;
  }
  .result-columns {
    grid-template-columns: 1fr;
  }
  .rating-buttons {
    flex-direction: column;
  }
  .btn-rating {
    max-width: 100%;
    flex-direction: row;
    justify-content: center;
  }
}


/* ================= HANDLUNGSSITUATIONEN STYLES ================= */
.situations-wrapper {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.situations-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(59, 130, 246, 0.12));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius);
  padding: 22px 26px;
  gap: 20px;
}

.situations-banner h2 {
  font-size: 1.45rem;
  margin-bottom: 6px;
  color: #6ee7b7;
}

.situations-banner p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.situations-stats-pill {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  padding: 10px 18px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}

.situations-controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.situations-filter-grid {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.situations-filter-grid .flex-2 {
  flex: 2;
  min-width: 260px;
}

.situations-filter-grid .flex-1 {
  flex: 1;
  min-width: 160px;
}

.situations-action-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 2px;
}

.triplet-nav-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-input);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.triplet-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.triplet-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.triplet-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.triplet-btn:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.triplet-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
}

.triplet-btn.learned {
  border-color: var(--success);
}

.situation-view-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.situation-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.pager-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.situation-index-counter {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.situation-header-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-topic {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-variant {
  background: rgba(234, 179, 8, 0.15);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.badge-status {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.badge-status.learned {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.5);
}

.badge-status.unsure {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.5);
}

.situation-main-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 20px;
  line-height: 1.4;
}

.situation-scenario-block {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 5px solid var(--danger);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 18px;
}

.scenario-block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #fca5a5;
  font-size: 0.95rem;
}

.scenario-content {
  line-height: 1.65;
  color: #e2e8f0;
  font-size: 1rem;
  white-space: pre-wrap;
}

.situation-task-block {
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.task-block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #fde047;
  font-size: 0.95rem;
}

.task-content {
  line-height: 1.6;
  color: #fef08a;
  font-weight: 500;
  font-size: 1.05rem;
  white-space: pre-wrap;
}

.scratchpad-box {
  margin-bottom: 22px;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(11, 17, 32, 0.5);
}

.scratchpad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  user-select: none;
}

.scratchpad-header:hover {
  color: var(--text-main);
}

.scratchpad-body {
  margin-top: 10px;
}

.situation-reveal-row {
  margin-top: 10px;
}

.situation-solution-area {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border-color);
  animation: fadeIn 0.3s ease;
}

.solution-area-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.solution-title {
  font-size: 1.15rem;
  color: #6ee7b7;
  display: flex;
  align-items: center;
  gap: 8px;
}

.solution-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 26px;
}

.solution-step-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 18px;
  line-height: 1.65;
  color: #f1f5f9;
  white-space: pre-wrap;
  font-size: 0.95rem;
}

.solution-step-card strong {
  color: #93c5fd;
}

.situation-rating-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.rating-prompt {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-main);
}

.situations-overview-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
}

.overview-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.overview-box-header h3 {
  font-size: 1.25rem;
  color: #93c5fd;
}

.overview-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.overview-topic-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}

.overview-topic-card h4 {
  font-size: 0.95rem;
  color: #f8fafc;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.overview-variant-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.overview-variant-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.overview-variant-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

.overview-variant-btn.active {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.2);
}

.overview-variant-btn.learned {
  border-left: 3px solid var(--success);
}


/* ================= FOOTER STYLES ================= */
.app-footer {
  margin-top: auto;
  border-top: 1px solid rgba(51, 65, 85, 0.6);
  padding: 18px 24px;
  background: rgba(15, 23, 42, 0.7);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  transition: color 0.15s ease;
}

.footer-link-btn:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.footer-dot {
  color: rgba(148, 163, 184, 0.4);
}

/* ================= MODALS & OVERLAYS ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 17, 32, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
}

.auth-modal-card {
  max-width: 420px;
  width: 100%;
  padding: 32px;
  text-align: center;
}

.legal-card {
  max-width: 760px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.legal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding: 14px 20px;
  background: rgba(15, 23, 42, 0.5);
}

.legal-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.legal-tab-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.legal-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.legal-tab-btn.active {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
  font-weight: 600;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
}

.legal-modal-body {
  padding: 24px;
  overflow-y: auto;
  line-height: 1.65;
  color: #e2e8f0;
  font-size: 0.94rem;
}

.legal-modal-body h3 {
  font-size: 1.25rem;
  color: #93c5fd;
  margin-bottom: 8px;
}

.legal-sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 18px;
}

.legal-section-block {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 14px;
}

.legal-section-block h4 {
  color: #60a5fa;
  font-size: 0.98rem;
  margin-bottom: 6px;
}

.legal-modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 12px 20px;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.5);
}

/* ---------------- ACCOUNT SETTINGS & DATA TRANSPARENCY ---------------- */
.account-container {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.account-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
  margin-bottom: 8px;
}

.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.account-card.danger-card {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.03);
}

.account-card-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.account-card-header .card-icon {
  font-size: 2rem;
  line-height: 1;
}

.account-card-header h3 {
  font-size: 1.22rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.account-card-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.account-table-wrapper {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.4);
  overflow-x: auto;
}

.account-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.account-data-table thead tr {
  background: rgba(30, 41, 59, 0.7);
  border-bottom: 2px solid var(--border-color);
}

.account-data-table th {
  padding: 10px 14px;
  font-weight: 600;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: 0.5px;
}

.account-data-table td {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  vertical-align: middle;
}

.account-data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.account-data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.account-data-table td.cell-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 600;
  color: #60a5fa;
  white-space: nowrap;
}

.account-data-table td.cell-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  word-break: break-all;
  color: #e2e8f0;
}

.account-clear-box {
  background: rgba(245, 158, 11, 0.05);
  border: 1px dashed rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
}

.auth-modal-link {
  text-align: center;
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-modal-link a, .auth-modal-link span {
  color: #60a5fa;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.auth-modal-link a:hover, .auth-modal-link span:hover {
  color: #93c5fd;
}


/* ---------------- CATALOG & FEEDBACK STYLES ---------------- */
.catalog-container {
  max-width: 1100px;
  margin: 0 auto;
}

.catalog-filter-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  align-items: center;
}

.search-input-wrapper {
  flex: 1;
  min-width: 280px;
}

.catalog-category-filter {
  display: flex;
  gap: 8px;
}

.filter-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: #475569;
}

.filter-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.catalog-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 22px;
}

.catalog-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.catalog-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.catalog-filter-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.catalog-counter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.catalog-counter-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 800px) {
  .catalog-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

.catalog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .catalog-card {
    padding: 14px 14px;
  }
}

.catalog-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.catalog-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

.catalog-card-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #93c5fd;
  line-height: 1.4;
  margin: 0 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-card-spacer {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 4px 0 10px 0;
}

.catalog-card-preview {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  flex-grow: 1;
}

.catalog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 10px;
  margin-top: auto;
}

.catalog-card-id {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: monospace;
}

.btn-feedback {
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.1);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-feedback:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.catalog-status-msg {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ---------------- CARD DETAIL MODAL ---------------- */
.card-detail-modal-card {
  max-width: 680px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
}

.card-detail-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-detail-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-detail-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.card-detail-side1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #93c5fd;
  line-height: 1.45;
}

.card-detail-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.card-detail-side2 {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-main);
  white-space: pre-line;
  word-break: break-word;
}

/* ---------------- ADMIN FEEDBACK MODERATION ---------------- */
.admin-feedback-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.admin-feedback-type {
  font-weight: 600;
  color: #f59e0b;
}

.admin-feedback-user {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-feedback-content {
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 6px;
  border-left: 3px solid #3b82f6;
}

.admin-feedback-card-info {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.admin-feedback-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ---------------- TEST DIRECTION SELECTOR ---------------- */
.direction-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
  width: 100%;
  min-width: 0;
}

@media (max-width: 500px) {
  .direction-selector {
    gap: 6px;
  }
}

.direction-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-width: 0;
  width: 100%;
}

@media (max-width: 500px) {
  .direction-btn {
    padding: 8px 4px;
    font-size: 0.8rem;
  }
  .direction-btn .dir-icon {
    font-size: 1.1rem;
  }
  .direction-btn .dir-text small {
    font-size: 0.65rem;
  }
}

.direction-btn:hover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}

.direction-btn.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.direction-btn .dir-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.direction-btn .dir-text {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}

.direction-btn .dir-text small {
  font-size: 0.72rem;
  font-weight: normal;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}


/* ---------------- MATHE-TRAINER (FACHRECHNEN) ---------------- */
.math-trainer-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.math-controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.math-filter-header {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.math-subcat-select {
  display: none;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  box-sizing: border-box;
}

[data-theme="light"] .math-subcat-select {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

.math-subcat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.math-problem-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 48px 28px 28px 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.math-problem-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
  min-height: 38px;
}

.math-badges {
  display: none !important;
}

.math-actions-top {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}

.test-question-card, .quiz-question-box, .math-problem-box {
  position: relative;
  padding-top: 48px !important;
}

@keyframes dicePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.12) rotate(15deg); }
  100% { transform: scale(1); }
}

.btn-pulse {
  animation: dicePulse 0.4s ease;
}

.math-problem-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #93c5fd;
  line-height: 1.35;
}

.math-hint-box,
.math-formula-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 10px 14px;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.math-hint-box .hint-icon,
.math-formula-hint .hint-icon {
  font-size: 0.85rem;
  font-weight: 700;
  color: #a5b4fc;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.math-hint-box code,
#math-formula-code,
.math-formula-hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  color: #e0e7ff;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.45;
  flex: 1;
  min-width: 0;
}

[data-theme="light"] .math-hint-box,
[data-theme="light"] .math-formula-hint {
  background: #eef2ff;
  border-color: #c7d2fe;
}

[data-theme="light"] .math-hint-box code,
[data-theme="light"] #math-formula-code,
[data-theme="light"] .math-formula-hint code {
  color: #3730a3;
}

.math-question-body,
.math-question-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 18px 20px;
  white-space: pre-line;
  word-break: break-word;
  box-sizing: border-box;
  width: 100%;
}

[data-theme="light"] .math-question-body,
[data-theme="light"] .math-question-content {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.math-answer-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.math-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.math-input-group label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

.math-input-wrapper {
  width: 100%;
  position: relative;
}

.math-input {
  width: 100%;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 12px 16px;
  box-sizing: border-box;
}

.btn-submit-math {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 700;
  justify-content: center;
}

@media (max-width: 650px) {
  .math-trainer-container {
    gap: 12px;
  }
  .math-subcat-select {
    display: block;
  }
  .math-subcat-chips {
    display: none !important;
  }
  .math-controls-card {
    padding: 10px 14px;
    gap: 6px;
  }
  .math-filter-header {
    font-size: 0.78rem;
    margin-bottom: 2px;
  }
  .math-problem-box {
    padding: 46px 14px 18px 14px !important;
    gap: 14px;
  }
  .math-problem-header {
    display: flex;
    width: 100%;
    justify-content: stretch;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
    min-height: auto;
  }
  .math-actions-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin-left: 0;
  }
  .math-actions-top .btn:last-child {
    grid-column: span 2;
  }
  .math-problem-title {
    font-size: 1.15rem;
    line-height: 1.35;
    word-break: break-word;
  }
  .math-hint-box {
    padding: 8px 10px;
    gap: 6px;
  }
  .math-hint-box .hint-icon {
    font-size: 0.78rem;
  }
  .math-hint-box code,
  #math-formula-code {
    font-size: 0.84rem;
  }
  .math-question-body {
    padding: 14px 12px;
    font-size: 0.95rem;
    line-height: 1.6;
  }
  .math-input {
    font-size: 1rem;
    padding: 10px 12px;
  }
  .btn-submit-math {
    padding: 10px 14px;
    font-size: 0.95rem;
  }
  .math-solution-inner {
    padding: 12px;
    gap: 10px;
  }
  .math-step-card {
    padding: 10px 12px;
    font-size: 0.88rem;
    line-height: 1.5;
  }
}

.math-feedback-alert {
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 0.98rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn 0.2s ease;
}

.math-feedback-alert.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.math-feedback-alert.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.math-solution-accordion {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.math-toggle-solution-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: #93c5fd;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s ease;
}

.math-toggle-solution-btn:hover {
  color: #bfdbfe;
  text-decoration: underline;
}

.math-solution-drawer {
  margin-top: 14px;
  animation: fadeIn 0.25s ease;
}

.math-solution-inner {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.math-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.math-step-card strong {
  color: #38bdf8;
  display: block;
  margin-bottom: 4px;
}


.math-problem-box code, .math-step-card code { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.math-controls-card select { max-width:100%; min-width:0; }

/* ---------------- HANDLUNGSSITUATIONEN & STÖRFALLMANAGEMENT ---------------- */
.situations-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.situations-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(245, 158, 11, 0.12) 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.situations-banner .banner-text h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: #f87171;
}

.situations-banner .banner-text p {
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 0.95rem;
  max-width: 750px;
}

.situations-stats-pill {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  padding: 8px 18px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #34d399;
}

.situations-controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow);
}

.situations-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.situations-filter-grid .flex-2 {
  flex: 2;
  min-width: 250px;
}

.situations-filter-grid .flex-1 {
  flex: 1;
  min-width: 180px;
}

.situations-action-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 2px;
}

.triplet-nav-box {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.triplet-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.triplet-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.triplet-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.triplet-btn:hover {
  border-color: #60a5fa;
  background: rgba(96, 165, 250, 0.08);
}

.triplet-btn.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  font-weight: 700;
  color: #93c5fd;
}

.triplet-btn.learned {
  border-left: 3px solid #10b981;
}

.situation-view-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: var(--shadow);
}

.situation-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
}

.pager-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.situation-index-counter {
  font-size: 0.95rem;
  font-weight: 700;
  color: #93c5fd;
}

.situation-header-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-topic {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-variant {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-status {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
}

.badge-status.learned {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}

.badge-status.unsure {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}

.situation-main-title {
  font-size: 1.35rem;
  color: #f1f5f9;
  line-height: 1.4;
  margin: 0;
}

.situation-scenario-block,
.situation-task-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scenario-block-header,
.task-block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.scenario-content {
  white-space: pre-line;
  word-break: break-word;
  line-height: 1.65;
  font-size: 1.05rem;
  color: var(--text-main);
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 8px;
  padding: 18px 22px;
}

.task-content {
  white-space: pre-line;
  word-break: break-word;
  line-height: 1.65;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-main);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  padding: 16px 20px;
}

.scratchpad-box {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.scratchpad-header-static {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #93c5fd;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.08);
  border-bottom: 1px solid var(--border-color);
}

.scratchpad-header {
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  user-select: none;
}

.scratchpad-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.scratchpad-body {
  padding: 14px 18px;
  border-top: 1px solid var(--border-color);
}

.scratchpad-body textarea {
  width: 100%;
  resize: vertical;
}

.situation-reveal-row {
  margin-top: 8px;
}

.situation-solution-area {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeIn 0.25s ease;
}

.solution-area-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.solution-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  color: #34d399;
}

.solution-steps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.solution-step-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-left: 4px solid #10b981;
  border-radius: 8px;
  padding: 16px 20px;
  white-space: pre-line;
  word-break: break-word;
  line-height: 1.6;
  font-size: 0.98rem;
}

.solution-step-card strong {
  color: #6ee7b7;
  font-size: 1.02rem;
  display: block;
  margin-bottom: 6px;
}

.situations-overview-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow);
}

.situations-overview-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.overview-topic-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.overview-topic-card h4 {
  font-size: 0.95rem;
  color: #93c5fd;
  margin: 0;
  line-height: 1.3;
}

.overview-variant-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.overview-variant-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  transition: all 0.15s ease;
}

.overview-variant-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
}

.overview-variant-btn.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #93c5fd;
  font-weight: 600;
}

.overview-variant-btn.learned {
  border-left: 3px solid #10b981;
}

/* ---------------- HANDLUNGSSITUATIONEN INHALTSVERZEICHNIS (TOC) ---------------- */
.situations-toc-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.toc-topic-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.toc-topic-header {
  font-size: 1.02rem;
  font-weight: 700;
  color: #93c5fd;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 0;
  line-height: 1.45;
  width: 100%;
}

.toc-topic-tag {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.toc-variant-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px;
  margin-left: 14px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.12s ease;
  color: var(--text-main);
  text-align: left;
  font-size: 0.92rem;
  line-height: 1.45;
  width: calc(100% - 14px);
}

.toc-variant-row:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #fff;
}

.toc-variant-row.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  font-weight: 600;
  color: #93c5fd;
}

.toc-var-badge {
  font-size: 0.84rem;
  font-weight: 700;
  color: #60a5fa;
  flex-shrink: 0;
}

.toc-var-title {
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: normal;
  flex: 1;
}

.toc-dots {
  flex: 1;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.15);
  margin: 0 8px;
  min-width: 16px;
  align-self: center;
}

.toc-status {
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-left: 6px;
}

[data-theme="light"] .toc-topic-block {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .toc-dots {
  border-bottom: 1px dotted rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .toc-topic-tag {
  background: rgba(0, 0, 0, 0.06);
}

/* Card reference links */
.card-term-link {
  color: #60a5fa;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
  padding: 0 2px;
  border-radius: 3px;
}

.card-term-link:hover {
  color: #93c5fd;
  text-decoration-style: solid;
  background: rgba(59, 130, 246, 0.15);
}

[data-theme="light"] .card-term-link {
  color: #2563eb;
}

[data-theme="light"] .card-term-link:hover {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.1);
}

/* Badges & Moderation Styles */
.badge-crown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #facc15;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
}

.badge-diamond {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
}

.badge-checkmark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
}

.badge-status-active {
  color: #34d399;
  font-weight: 600;
}

.badge-status-closed {
  color: #f87171;
  font-weight: 600;
}

.review-status-box {
  margin: 8px 0;
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid #3b82f6;
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.review-status-box.info {
  background: rgba(255, 255, 255, 0.03);
  border-left-color: var(--border-color);
  color: var(--text-muted);
}


/* ================= CATEGORY MULTI-SELECT CHIPS & HEADINGS ================= */
.category-selection-wrapper {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
}

.category-selection-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.category-selection-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.category-selection-buttons {
  display: flex;
  gap: 6px;
}

.category-selection-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-group-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 10px 12px;
}

.category-heading-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px 2px;
  text-align: left;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.category-heading-btn:hover {
  color: var(--primary);
}

.category-heading-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-heading-badge {
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  padding: 2px 8px;
  border-radius: 12px;
}

.category-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-left: 4px;
}

.category-chip-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.category-chip-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
  background: rgba(59, 130, 246, 0.08);
}

.category-chip-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
}

.category-chip-count {
  font-size: 0.75rem;
  opacity: 0.8;
}

.category-selection-status {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: right;
  font-weight: 500;
}

/* ================= QUIZ MULTIPLIER ================= */
.quiz-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-multiplier-pill {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.2));
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
  transition: all 0.25s ease;
}

.quiz-multiplier-pill.pulse {
  animation: multiplierPulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(239, 68, 68, 0.45));
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
}

.quiz-multiplier-pill.reset {
  animation: multiplierShake 0.45s ease;
  border-color: #ef4444;
  color: #f87171;
  background: rgba(239, 68, 68, 0.25);
}

@keyframes multiplierPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

@keyframes multiplierShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ================= TOP 3 BESTENLISTEN (GOLD, SILBER, BRONZE) ================= */
.top3-box {
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
}

.top3-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.top3-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top3-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

/* Gold */
.top-gold {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.12);
  border-color: rgba(255, 215, 0, 0.45);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.18);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.35);
}

/* Silber */
.top-silver {
  color: #e2e8f0;
  background: rgba(226, 232, 240, 0.10);
  border-color: rgba(226, 232, 240, 0.35);
  box-shadow: 0 0 10px rgba(226, 232, 240, 0.12);
}

/* Bronze */
.top-bronze {
  color: #f59e0b;
  background: rgba(205, 127, 50, 0.14);
  border-color: rgba(205, 127, 50, 0.45);
  box-shadow: 0 0 10px rgba(205, 127, 50, 0.15);
}

.top-empty {
  color: #64748b;
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
  font-style: italic;
  font-weight: 500;
}

/* ================= TOP 3 OPT-IN CARD ================= */
.top3-optin-card {
  margin: 16px 0;
  padding: 16px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.4);
  text-align: left;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.top3-optin-msg {
  font-size: 0.95rem;
  font-weight: 600;
  color: #bfdbfe;
  margin-bottom: 12px;
}

.top3-optin-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.top3-optin-input {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  font-size: 0.9rem;
}

.top3-optin-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ================= XP & LEVEL SYSTEM STYLES ================= */
.stat-pill.level-pill {
  cursor: pointer;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.stat-pill.level-pill:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.level-mini-progress {
  width: 44px;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  overflow: hidden;
}

.level-mini-bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.level-mini-xp {
  font-size: 0.72rem;
  color: #fef3c7;
  opacity: 0.85;
}

/* Home Dashboard Level Card */
.levels-dashboard-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .levels-dashboard-card {
    padding: 14px 12px;
  }
}

.levels-dashboard-card:hover {
  border-color: #f59e0b;
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.2);
}

.levels-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}

.overall-level-badge-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.overall-star-icon {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.6));
}

.overall-level-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.overall-level-title-row h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fef3c7;
}

.overall-rank-title {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.overall-xp-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.overall-xp-total-box {
  text-align: right;
}

.total-xp-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.total-xp-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: #f59e0b;
}

.overall-progress-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.overall-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  border-radius: 5px;
  transition: width 0.4s ease;
}

.domains-overview-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.domains-overview-title-row h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.domains-max-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 8 Domains Grid */
.domains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}

.domain-level-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.domain-level-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

.domain-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.domain-title-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #f8fafc;
}

.domain-icon {
  font-size: 1.15rem;
}

.domain-level-badge {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.domain-xp-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.domain-xp-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.domain-xp-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Specific Domain Bar Accents */
.domain-mathe .domain-xp-bar { background: linear-gradient(90deg, #6366f1, #a855f7); }
.domain-chemie .domain-xp-bar { background: linear-gradient(90deg, #06b6d4, #3b82f6); }
.domain-biologie .domain-xp-bar { background: linear-gradient(90deg, #10b981, #34d399); }
.domain-mechanik .domain-xp-bar { background: linear-gradient(90deg, #f97316, #fb923c); }
.domain-elektrotechnik .domain-xp-bar { background: linear-gradient(90deg, #eab308, #fde047); }
.domain-sicherheit .domain-xp-bar { background: linear-gradient(90deg, #ef4444, #f87171); }
.domain-praxis .domain-xp-bar { background: linear-gradient(90deg, #14b8a6, #2dd4bf); }
.domain-allgemein .domain-xp-bar { background: linear-gradient(90deg, #64748b, #94a3b8); }

/* Overall Banner in Modal */
.overall-level-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  padding: 16px 20px;
  transition: all 0.25s ease;
}

.modal-overall-main-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.modal-overall-icon-box {
  width: 80px;
  height: 80px;
  min-width: 80px;
  font-size: 4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  user-select: none;
  transition: all 0.2s ease;
}

.modal-overall-icon-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.modal-overall-content-box {
  flex: 1;
  min-width: 0;
}

.modal-inspected-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: inline-block;
  transition: all 0.2s ease;
}

.overall-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.overall-badge-pill {
  background: #f59e0b;
  color: #0f172a;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
  transition: background 0.2s ease, color 0.2s ease;
}

#levels-modal .modal-dialog {
  width: 100%;
  min-width: 0;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

#levels-modal .modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

#levels-modal .modal-header > div {
  min-width: 0;
  flex: 1;
}

#levels-modal .modal-close-btn {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
}

#levels-modal .modal-body {
  overflow-wrap: anywhere;
}

#modal-professions-grid .profession-level-card {
  cursor: pointer;
  user-select: none;
}

#modal-professions-grid .profession-level-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
  transform: translateY(-2px);
}

#modal-professions-grid .profession-level-card.active-prof {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.14);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.35);
}

@media (max-width: 640px) {
  .modal-overall-main-row {
    gap: 14px;
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-overall-content-box {
    width: 100%;
  }

  #levels-modal .overall-card-header {
    flex-direction: column;
    gap: 12px;
  }

  #levels-modal .profile-section-heading,
  #levels-modal .modal-footer {
    flex-wrap: wrap;
    gap: 8px;
  }
  .modal-overall-icon-box {
    width: 64px;
    height: 64px;
    min-width: 64px;
    font-size: 3.2rem;
    border-radius: 10px;
  }
}

/* Floating XP Indicator */
.floating-xp-indicator {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fbbf24;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 12px rgba(245, 158, 11, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  animation: floatUpFade 1.3s cubic-bezier(0.1, 0.7, 0.1, 1) forwards;
}

@keyframes floatUpFade {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.7);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -15px) scale(1.15);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -35px) scale(1.0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -55px) scale(0.9);
  }
}

/* Level Up Toast & Celebration */
.level-up-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
  border: 2px solid #fef08a;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.5), 0 0 20px rgba(254, 240, 138, 0.6);
  color: #0f172a;
  padding: 16px 28px;
  border-radius: 16px;
  text-align: center;
  z-index: 10000;
  pointer-events: auto;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.level-up-toast.active {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

.levelup-sparkle {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #451a03;
  margin-bottom: 4px;
}

.levelup-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 6px;
  animation: levelUpBounce 0.8s infinite alternate ease-in-out;
}

@keyframes levelUpBounce {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.18) translateY(-4px); }
}

.levelup-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  margin-bottom: 2px;
}

.levelup-desc {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fef3c7;
}

/* ================= MANAGEMENT & TEAM NAV TAB ================= */
.admin-nav-tab {
  background: linear-gradient(110deg, #1e293b 15%, #2563eb 45%, #60a5fa 55%, #1e293b 85%) !important;
  background-size: 250% 100% !important;
  animation: shimmerAdmin 5s infinite ease-in-out;
  border: 1px solid rgba(96, 165, 250, 0.45) !important;
  color: #ffffff !important;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.25);
  transition: all 0.25s ease;
}

.admin-nav-tab:hover {
  border-color: rgba(96, 165, 250, 0.8) !important;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.5) !important;
  transform: translateY(-1px);
}

@keyframes shimmerAdmin {
  0% { background-position: 150% 0; }
  100% { background-position: -150% 0; }
}


/* ================= UT PROFESSIONS HEADER SELECTOR ================= */
.header-profession-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.82rem;
}

.header-prof-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.header-profession-select {
  background: transparent;
  border: none;
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  padding: 2px 4px;
}

.header-profession-select option {
  background: #0f172a;
  color: #f8fafc;
}

.header-year-select {
  margin-left: 4px;
}

.badge-year {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 600;
  white-space: nowrap;
}

[data-theme="light"] .badge-year {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

/* ================= MINI REPORT BUTTONS ON CARDS ================= */
.flashcard,
.test-question-card,
.quiz-question-box,
.math-problem-box,
.situation-view-card {
  position: relative !important;
}

.card-mini-report-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 20;
  padding: 0;
  line-height: 1;
}

.card-mini-report-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* ================= SORTABLE TABLE HEADERS & BATCH BAR ================= */
.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.sortable-th:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sort-icon {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.admin-batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  animation: fadeIn 0.2s ease-in-out;
}

.admin-batch-bar .batch-btns {
  display: flex;
  gap: 8px;
}

/* ================= ADMIN LEVEL & XP SETTINGS STYLES ================= */
.admin-xp-test-btns {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-test-toast {
  color: #10b981;
  font-size: 0.88rem;
  font-weight: 600;
  animation: fadeIn 0.2s ease;
}

.professions-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 6px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
}

.professions-checkbox-grid .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #cbd5e1;
  cursor: pointer;
}

.professions-checkbox-grid .checkbox-label input {
  cursor: pointer;
  width: 16px;
  height: 16px;
}



/* Topbar Logo Image */
.header-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.header-left:hover .header-logo-img {
  transform: scale(1.05);
}

/* Profession Levels Grid */
.professions-levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.profession-level-card {
  background: var(--card-bg, #1e293b);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 12px 14px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.profession-level-card:hover {
  border-color: rgba(96, 165, 250, 0.4);
  transform: translateY(-2px);
}

.profession-level-card.active-prof {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.07);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

.profession-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  margin-bottom: 4px;
}

.profession-card-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.profession-card-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.profession-card-lvl-badge {
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.profession-card-rank {
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 8px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.profession-card-progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.profession-card-progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.profession-abwasser .profession-card-progress-bar {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.profession-wasser .profession-card-progress-bar {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.profession-kreislauf .profession-card-progress-bar {
  background: linear-gradient(90deg, #059669, #34d399);
}

.profession-rohr .profession-card-progress-bar {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

.profession-all .profession-card-progress-bar {
  background: linear-gradient(90deg, #7c3aed, #a855f7);
}

.profession-card-xp-text {
  font-size: 0.75rem;
  color: var(--text-muted, #94a3b8);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  justify-content: space-between;
}

/* Inline Edit for Admin Ranks Table */
.editable-rank-cell {
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s ease, color 0.15s ease;
  user-select: none;
}

.editable-rank-cell:hover {
  background-color: rgba(59, 130, 246, 0.14) !important;
  color: #93c5fd;
}

.editable-rank-cell:hover .rank-title-text::after {
  content: " ✏️";
  font-size: 0.72rem;
  opacity: 0.8;
  vertical-align: middle;
}

.rank-inline-input {
  width: 100% !important;
  min-width: 120px;
  padding: 4px 8px !important;
  font-size: 0.85rem !important;
  font-family: inherit;
  border-radius: 4px !important;
  border: 1px solid var(--accent, #3b82f6) !important;
  background: var(--bg-card, #1e293b) !important;
  color: #fff !important;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3) !important;
  outline: none !important;
}


/* ================= COMPREHENSIVE LIGHT THEME OVERRIDES ================= */
[data-theme="light"] {
  color-scheme: light;
}

[data-theme="light"] body {
  background-color: var(--bg-main);
  color: var(--text-main);
}

[data-theme="light"] .card-container,
[data-theme="light"] .setup-box,
[data-theme="light"] .stats-card,
[data-theme="light"] .auth-card,
[data-theme="light"] .modal-content,
[data-theme="light"] .modal-box,
[data-theme="light"] .admin-card,
[data-theme="light"] .table-card {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .levels-dashboard-card {
  background: linear-gradient(135deg, #ffffff, #f1f5f9);
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .profession-level-card,
[data-theme="light"] .domain-level-card {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .profession-level-card:hover,
[data-theme="light"] .domain-level-card:hover {
  border-color: var(--primary);
  background: #f8fafc;
}

[data-theme="light"] .overall-level-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(59, 130, 246, 0.1));
  border-color: #cbd5e1;
}

[data-theme="light"] .modal-overall-icon-box {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .modal-inspected-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

[data-theme="light"] #modal-professions-grid .profession-level-card.active-prof {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.25);
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="email"],
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
  border-color: var(--primary);
  background: #ffffff;
}

[data-theme="light"] .progress-bar-track,
[data-theme="light"] .overall-progress-track,
[data-theme="light"] .profession-card-progress-track,
[data-theme="light"] .domain-card-progress-track {
  background: #e2e8f0;
}

[data-theme="light"] .rank-inline-input {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #3b82f6 !important;
}

[data-theme="light"] .editable-rank-cell:hover {
  background-color: rgba(59, 130, 246, 0.1) !important;
  color: #1d4ed8;
}

[data-theme="light"] table {
  color: #0f172a;
}

[data-theme="light"] th {
  background: #f1f5f9;
  color: #334155;
  border-bottom: 2px solid #cbd5e1;
}

[data-theme="light"] td {
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] tr:hover td {
  background: #f8fafc;
}

[data-theme="light"] .btn-outline {
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light"] .btn-outline:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: #94a3b8;
  color: #0f172a;
}


/* ==========================================================================
   ADMIN CARDS CATALOG & FILTERING LAYOUT
   ========================================================================== */

.admin-cards-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.mobile-filter-toggle {
  display: none;
}

.admin-cards-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  position: relative;
}

.admin-cards-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #93c5fd;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-checkbox-group .checkbox-label {
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-main);
}

.sidebar-checkbox-group .checkbox-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.sidebar-stats-box {
  padding: 10px 14px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #60a5fa;
}

.admin-cards-main {
  flex: 1;
  min-width: 0;
}

.admin-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}

.admin-card-box:hover {
  border-color: rgba(59, 130, 246, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.admin-card-box.non-admin-view {
  cursor: default;
}
.admin-card-box.non-admin-view:hover {
  transform: none;
  border-color: var(--border-color);
  box-shadow: none;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.admin-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.admin-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.85em;
  margin: 0;
}

.admin-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.admin-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Badges for verification level & type */
.badge-vlevel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.badge-vlevel-1 {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.badge-vlevel-2 {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.badge-vlevel-3 {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.badge-vlevel-4 {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-card-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.badge-card-year {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Factcheck UI */
.luna-factcheck-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.86rem;
  line-height: 1.5;
  margin-top: 8px;
}

.factcheck-verdict {
  font-weight: 700;
  font-size: 0.94rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.factcheck-verdict.correct {
  color: #10b981;
}

.factcheck-verdict.minor {
  color: #f59e0b;
}

.factcheck-verdict.incorrect {
  color: #ef4444;
}

.factcheck-verdict.outdated {
  color: #a855f7;
}

.factcheck-explanation {
  color: #e2e8f0;
  margin-bottom: 8px;
}

.factcheck-correction {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 8px;
  color: #fca5a5;
  font-size: 0.84rem;
}

.factcheck-sources {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.factcheck-sources a {
  color: #60a5fa;
  text-decoration: underline;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-factcheck-card {
  font-size: 0.75rem;
  padding: 3px 8px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-factcheck-card:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #ffffff;
}

/* Light Theme overrides for admin cards */
[data-theme="light"] .admin-cards-sidebar {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .admin-card-box {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .admin-card-box:hover {
  border-color: #3b82f6;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .admin-card-footer {
  border-top-color: #f1f5f9;
}

[data-theme="light"] .badge-card-type {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light"] .luna-factcheck-box {
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme="light"] .factcheck-explanation {
  color: #1e293b;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .mobile-filter-toggle {
    display: inline-flex;
  }

  .admin-cards-layout {
    flex-direction: column;
    gap: 16px;
  }

  .admin-cards-sidebar {
    display: none;
    width: 100%;
    position: static;
    max-height: none;
    box-shadow: none;
  }

  .admin-cards-sidebar.mobile-open {
    display: flex;
  }

  .admin-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Edit Modal Card Styling */
.admin-card-edit-card {
  max-width: 700px;
  width: 94%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px 30px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
  position: relative;
  margin: auto;
}

.btn-edit-card {
  font-size: 0.78rem;
  padding: 3px 9px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-edit-card:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #ffffff;
  border-color: #3b82f6;
}

[data-theme="light"] .admin-card-edit-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Live-Statistik (Admin) */
.metrics-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1000px) {
  .metrics-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .metrics-cards-grid {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.metric-card-green {
  border-left: 4px solid #10b981;
}

.metric-card-yellow {
  border-left: 4px solid #f59e0b;
}

.metric-card-red {
  border-left: 4px solid #ef4444;
}

.metric-card-total {
  border-left: 4px solid #3b82f6;
}

.metric-icon {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.metric-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.metric-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.metric-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
}

.metric-pill-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.metric-pill-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

[data-theme="light"] .metric-card {
  background: #ffffff;
  border-color: #cbd5e1;
}

/* ================= SICHERHEITSSTUFE CORNER BADGE ================= */
.verification-corner-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 9999px;
  backdrop-filter: blur(8px);
  user-select: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.3;
}

.verification-corner-badge.badge-corner {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 15;
}

/* Level 1: Ungeprüft */
.verification-corner-badge.level-1 {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

/* Level 2: KI-Geprüft */
.verification-corner-badge.level-2 {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

/* Level 3: Geprüft (4-Augen) */
.verification-corner-badge.level-3 {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

/* Level 4: Fachlich verifiziert */
.verification-corner-badge.level-4 {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.verification-corner-badge:hover {
  transform: scale(1.04);
}

[data-theme="light"] .verification-corner-badge.level-1 {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border-color: rgba(100, 116, 139, 0.35);
}

[data-theme="light"] .verification-corner-badge.level-2 {
  background: rgba(147, 51, 234, 0.12);
  color: #7e22ce;
  border-color: rgba(147, 51, 234, 0.35);
}

[data-theme="light"] .verification-corner-badge.level-3 {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.35);
}

[data-theme="light"] .verification-corner-badge.level-4 {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.35);
}


.admin-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-edit-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) { .admin-edit-grid { grid-template-columns: minmax(0, 1fr); } }

/* ================= LIGHT MODE POLISH & COLOR RESTORATION ================= */

/* Exit-Style Button in Light Mode */
[data-theme="light"] .btn-session-exit {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
}
[data-theme="light"] .btn-session-exit:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
}

/* Highscore & Badges in Light Mode (High Contrast, No Pale Yellow on Yellow) */
[data-theme="light"] .mode-highscore-badge {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}
[data-theme="light"] .mode-highscore-badge .highscore-val {
  color: #78350f;
  font-weight: 800;
}
[data-theme="light"] .quiz-highscore-tag {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}
[data-theme="light"] .quiz-record-alert {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #d97706;
  color: #78350f;
}
[data-theme="light"] .badge-variant {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}
[data-theme="light"] .badge-topic {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}
[data-theme="light"] .badge-status {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
}
[data-theme="light"] .badge-status.learned {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}
[data-theme="light"] .badge-status.unsure {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

/* 2x2 Progress Grid in Light Mode (Fresh soft gradient, readable text) */
[data-theme="light"] .progress-grid-2x2 {
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
  border: 1px solid #bfdbfe;
  box-shadow: 0 2px 8px -2px rgba(59, 130, 246, 0.08);
}
[data-theme="light"] .progress-grid-2x2 .progress-count {
  color: #1e293b;
  font-weight: 700;
}
[data-theme="light"] .progress-grid-2x2 .progress-bar-track {
  background: #e2e8f0;
}
[data-theme="light"] .progress-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

/* Category Multi-Selection in Light Mode */
[data-theme="light"] .category-selection-wrapper {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .category-group-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
[data-theme="light"] .category-chip-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
}
[data-theme="light"] .category-chip-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}
[data-theme="light"] .category-chip-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
[data-theme="light"] .category-heading-badge {
  background: #eff6ff;
  color: #1d4ed8;
}

/* Rating Legend & Setup Box in Light Mode */
[data-theme="light"] .rating-legend {
  background: linear-gradient(135deg, #f8fafc 0%, #f0fdf4 100%);
  border: 1px solid #cbd5e1;
  color: #334155;
}
[data-theme="light"] .mode-setup-header-stats {
  border-top-color: #e2e8f0;
}

/* Home Dashboard: Stat Boxes & Mode Cards with Fresh Colorful Accents */
[data-theme="light"] .stat-box-compact {
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
  border: 1px solid #bfdbfe;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.06);
}
[data-theme="light"] .stat-box-compact .stat-number {
  color: #1d4ed8;
}
[data-theme="light"] .stat-box-compact .stat-label {
  color: #475569;
}
[data-theme="light"] .mode-card-compact {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .mode-card-compact.mode-card-practice {
  border-left: 4px solid #3b82f6;
}
[data-theme="light"] .mode-card-compact.mode-card-test {
  border-left: 4px solid #8b5cf6;
}
[data-theme="light"] .mode-card-compact.mode-card-quiz {
  border-left: 4px solid #ec4899;
}
[data-theme="light"] .mode-card-compact.mode-card-math {
  border-left: 4px solid #f59e0b;
}
[data-theme="light"] .mode-card-compact.mode-card-situations {
  border-left: 4px solid #10b981;
}
[data-theme="light"] .mode-card-compact.mode-card-catalog {
  border-left: 4px solid #06b6d4;
}
[data-theme="light"] .mode-card-compact:hover {
  background: #fafbfc;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Handlungssituationen in Light Mode (No Dark Remnants) */
[data-theme="light"] .situation-main-title {
  color: #0f172a;
}
[data-theme="light"] .situation-scenario-block {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-left: 5px solid #ef4444;
}
[data-theme="light"] .scenario-block-header {
  color: #b91c1c;
}
[data-theme="light"] .scenario-content {
  color: #1e293b;
}
[data-theme="light"] .situation-task-block {
  background: #fefce8;
  border: 1px solid #fef08a;
  border-left: 5px solid #eab308;
}
[data-theme="light"] .task-block-header {
  color: #854d0e;
}
[data-theme="light"] .task-content {
  color: #713f12;
}
[data-theme="light"] .scratchpad-box {
  background: #f8fafc;
  border-color: #cbd5e1;
}
[data-theme="light"] .solution-title {
  color: #047857;
}
[data-theme="light"] .solution-step-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
}
[data-theme="light"] .solution-step-card strong {
  color: #1d4ed8;
}
[data-theme="light"] .situation-rating-box {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Catalog Cards & Full Detail Modal in Light Mode */
[data-theme="light"] .catalog-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .catalog-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.12);
}
[data-theme="light"] .catalog-card-title {
  color: #1d4ed8;
}
[data-theme="light"] .catalog-card-spacer {
  background: #e2e8f0;
}
[data-theme="light"] .catalog-card-footer {
  border-top-color: #e2e8f0;
}
[data-theme="light"] .card-detail-modal-card {
  background: #ffffff;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
  border: 1px solid #cbd5e1;
}
[data-theme="light"] .card-detail-side1 {
  color: #1d4ed8;
}
[data-theme="light"] .card-detail-divider {
  background: #e2e8f0;
}

/* Account & Luna Fact-check in Light Mode */
[data-theme="light"] .account-table-wrapper {
  background: #ffffff;
  border-color: #cbd5e1;
}
[data-theme="light"] .account-data-table th {
  background: #f1f5f9;
  color: #334155;
}
[data-theme="light"] .luna-factcheck-box {
  background: #f0f7ff;
  border-color: #bfdbfe;
  color: #1e293b;
}


/* QA: readable light-theme overlays and progress details. */
[data-theme="light"] #glossary-close,
[data-theme="light"] .legal-modal-body,
[data-theme="light"] .account-data-table td.cell-val,
[data-theme="light"] .domains-overview-title-row h4,
[data-theme="light"] .domain-title-box { color: #0f172a; }
[data-theme="light"] .legal-modal-header,
[data-theme="light"] .legal-modal-footer,
[data-theme="light"] .legal-section-block { background: #f8fafc; border-color: #cbd5e1; }
[data-theme="light"] .top-silver { color: #334155; background: #f1f5f9; }
[data-theme="light"] .math-solution-inner { background: #f8fafc; color: #0f172a; }
[data-theme="light"] .math-step-card strong { color: #0369a1; }

/* ================= ONLINE MULTIPLAYER QUIZ (KAHOOT-STYLE) ================= */
.mode-globe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: auto;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 5;
}
.mode-globe-btn:hover {
  background: rgba(59, 130, 246, 0.35);
  border-color: #3b82f6;
  transform: scale(1.12);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

.quiz-setup-actions-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.btn-online-quiz {
  border-color: #3b82f6;
  color: #3b82f6;
  font-weight: 600;
}
.btn-online-quiz:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: #60a5fa;
  color: #93c5fd;
}

.quiz-online-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.quiz-online-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.quiz-online-icon {
  font-size: 1.8rem;
}

.quiz-online-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}
.quiz-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.quiz-tab-btn.active {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.quiz-online-panel {
  text-align: left;
  width: 100%;
}
.quiz-online-panel .desc {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.code-input {
  font-size: 1.8rem !important;
  font-weight: 800 !important;
  letter-spacing: 6px !important;
  text-align: center !important;
  text-transform: uppercase;
}

/* Room Info & Code Badge */
.quiz-room-info-card {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.35), rgba(15, 23, 42, 0.5));
  border: 2px solid rgba(59, 130, 246, 0.5);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quiz-room-code-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.code-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}
.code-number {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: #fbbf24;
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 16px;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.quiz-room-link-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.link-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.quiz-link-input-group {
  display: flex;
  gap: 8px;
}
.quiz-link-input-group .link-field {
  flex: 1;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.25);
}

/* Connected Players Roster */
.quiz-players-section {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.quiz-players-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.players-title {
  font-weight: 700;
  font-size: 1rem;
}
.players-status {
  font-size: 0.82rem;
  color: #f59e0b;
  font-weight: 600;
}
.quiz-players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.quiz-player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: transform 0.15s, border-color 0.15s;
}
.quiz-player-card.is-host {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.08);
}
.quiz-player-card.is-me {
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}
.quiz-player-avatar {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}
.quiz-player-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.quiz-player-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quiz-player-role-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.quiz-player-card.is-host .quiz-player-role-badge {
  color: #fbbf24;
  font-weight: 600;
}
.quiz-player-card.is-quizmaster {
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(168, 85, 247, 0.08);
}
.quiz-player-card.is-quizmaster .quiz-player-role-badge {
  color: #c084fc;
  font-weight: 700;
}

/* Settings Card */
.quiz-online-settings-card {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}
.settings-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.setting-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.setting-item label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.setting-checkbox-row {
  margin-top: 14px;
}

/* Lobby Actions */
.quiz-lobby-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.quiz-start-warning {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  color: #f87171;
  font-size: 0.88rem;
  text-align: center;
}

/* Timer Bar */
.quiz-online-timer-wrapper {
  position: relative;
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  margin: 12px 0 20px 0;
  overflow: visible;
}
.quiz-online-timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  border-radius: 6px;
  transition: width 0.95s linear, background-color 0.3s ease;
}
.quiz-online-timer-bar.warning {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}
.quiz-online-timer-bar.danger {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
}
.quiz-online-timer-badge {
  position: absolute;
  right: 0;
  top: -24px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.85);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}



/* Player View Interactive Options */
.quiz-player-selection-hint {
  font-size: 0.84rem;
  color: #60a5fa;
  margin: -10px 0 16px 0;
  text-align: center;
}
.quiz-online-interactive-options .quiz-opt-btn {
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.quiz-online-interactive-options .quiz-opt-btn.selected {
  border-color: #3b82f6 !important;
  background: rgba(59, 130, 246, 0.25) !important;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.5) !important;
  transform: scale(1.02);
}
.quiz-online-interactive-options .quiz-opt-btn.selected::after {
  content: "✓";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 900;
  font-size: 1.2rem;
  color: #3b82f6;
}

/* Quizmaster In-Game View */
.quiz-quizmaster-status-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 20px;
}
.quizmaster-status-badge {
  font-size: 0.95rem;
  font-weight: 700;
  color: #c084fc;
}
.quizmaster-answers-counter {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}
.quizmaster-answers-counter strong {
  color: #60a5fa;
  font-weight: 800;
}
.quiz-quizmaster-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 600px) {
  .quiz-quizmaster-options-grid {
    grid-template-columns: 1fr;
  }
}
.quiz-quizmaster-opt-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1.4;
}
.quiz-quizmaster-opt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Intermission & Reveal */
.quiz-intermission-bar-wrap {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin-bottom: 20px;
}
.quiz-intermission-bar {
  height: 100%;
  width: 100%;
  background: #3b82f6;
  border-radius: 4px;
  transition: width 0.95s linear;
}
.quiz-intermission-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 6px;
}
.quiz-online-feedback-banner {
  padding: 20px;
  border-radius: 14px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
  animation: popIn 0.3s ease-out;
}
.quiz-online-feedback-banner.correct {
  background: rgba(16, 185, 129, 0.2);
  border: 2px solid #10b981;
  color: #34d399;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}
.quiz-online-feedback-banner.wrong {
  background: rgba(239, 68, 68, 0.2);
  border: 2px solid #ef4444;
  color: #f87171;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.35);
}
.quiz-online-feedback-sub {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 6px;
  opacity: 0.9;
}

.quiz-online-correct-box {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
}
.correct-badge-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #34d399;
  font-weight: 800;
}
.correct-answer-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 4px;
}

/* Top 3 Zwischenpodium */
.quiz-intermission-top3 {
  margin-top: 10px;
  text-align: left;
}
.top3-heading {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.top3-podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.top3-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
}
.top3-card.rank-1 {
  border-color: #fbbf24;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(15, 23, 42, 0.5));
}
.top3-card.rank-2 {
  border-color: #94a3b8;
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.18), rgba(15, 23, 42, 0.5));
}
.top3-card.rank-3 {
  border-color: #d97706;
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.18), rgba(15, 23, 42, 0.5));
}
.top3-cup {
  font-size: 1.6rem;
}
.top3-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.top3-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top3-score {
  font-size: 0.85rem;
  color: #fbbf24;
  font-weight: 700;
}

/* Big Final Podium */
.final-podium-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
  height: 240px;
  margin: 30px auto 20px auto;
  max-width: 500px;
}
.final-podium-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 30%;
  animation: podiumRise 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.podium-user-badge {
  font-size: 1.6rem;
  margin-bottom: 4px;
}
.podium-user-name {
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.podium-user-score {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.podium-pillar {
  width: 100%;
  border-radius: 12px 12px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 12px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.podium-pillar .pillar-cup {
  font-size: 1.8rem;
}
.podium-pillar .pillar-num {
  font-size: 1.5rem;
  color: #ffffff;
}

.final-podium-col.rank-1 { height: 100%; }
.final-podium-col.rank-1 .podium-pillar {
  height: 140px;
  background: linear-gradient(180deg, #f59e0b, #b45309);
  border: 2px solid #fde68a;
  border-bottom: none;
}

.final-podium-col.rank-2 { height: 85%; }
.final-podium-col.rank-2 .podium-pillar {
  height: 105px;
  background: linear-gradient(180deg, #94a3b8, #475569);
  border: 2px solid #e2e8f0;
  border-bottom: none;
}

.final-podium-col.rank-3 { height: 72%; }
.final-podium-col.rank-3 .podium-pillar {
  height: 75px;
  background: linear-gradient(180deg, #d97706, #78350f);
  border: 2px solid #fed7aa;
  border-bottom: none;
}

/* Leaderboard Table */
.quiz-online-full-leaderboard {
  margin-top: 20px;
  width: 100%;
  overflow-x: auto;
}
.quiz-leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.quiz-leaderboard-table th {
  padding: 10px 12px;
  border-bottom: 2px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.quiz-leaderboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
}

/* Light Mode Overrides */
[data-theme="light"] .mode-globe-btn {
  background: #eff6ff;
  border-color: #bfdbfe;
}
[data-theme="light"] .quiz-room-info-card {
  background: #f8fafc;
  border-color: #cbd5e1;
}
[data-theme="light"] .code-number {
  background: #ffffff;
  color: #d97706;
  border-color: #fde68a;
}
[data-theme="light"] .quiz-online-correct-box {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
[data-theme="light"] .correct-answer-text {
  color: #065f46;
}
[data-theme="light"] .quiz-player-card {
  background: #ffffff;
  border-color: #e2e8f0;
}
[data-theme="light"] .quiz-online-settings-card,
[data-theme="light"] .quiz-players-section {
  background: #ffffff;
  border-color: #e2e8f0;
}

@keyframes podiumRise {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes popIn {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}


/* ================= MONETARISIERUNG & PREMIUM STYLING ================= */

/* Premium Header Button */
.btn-premium {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.35) !important;
  transition: all 0.25s ease !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-premium:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.55) !important;
  filter: brightness(1.1);
}

.nav-tab.premium-nav-tab,
.mobile-nav-link.premium-nav-link {
  color: #c084fc !important;
  font-weight: 700;
}
.nav-tab.premium-nav-tab:hover,
.mobile-nav-link.premium-nav-link:hover {
  color: #e879f9 !important;
}

/* Situations Hub View */
.situations-hub-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.situations-hub-action-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
[data-theme="light"] .situations-hub-action-card {
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
  border-color: #93c5fd;
}

.hub-action-info h3 {
  margin: 0 0 6px 0;
  font-size: 1.25rem;
  color: var(--text-main);
}
.hub-action-info p {
  margin: 0 0 10px 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 650px;
  line-height: 1.45;
}

.hub-limits-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
}
[data-theme="light"] .hub-limits-pill {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #b45309;
}

.hub-random-btn {
  padding: 14px 28px !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.situation-top-return-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

/* Locked TOC Row */
.toc-variant-row.locked {
  opacity: 0.7;
  background: rgba(15, 23, 42, 0.4);
  border-color: rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .toc-variant-row.locked {
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.toc-variant-row.locked:hover {
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.05);
}
.toc-premium-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}
[data-theme="light"] .toc-premium-lock-badge {
  background: #ffe4e6;
  border-color: #fecdd3;
  color: #e11d48;
}

/* Premium Page Wrapper */
.premium-page-wrapper {
  max-width: 1140px;
  margin: 0 auto;
  padding: 10px 0 40px 0;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Hero Card */
.premium-hero-card {
  text-align: center;
  padding: 36px 24px;
  background: radial-gradient(circle at top, rgba(139, 92, 246, 0.18) 0%, rgba(15, 23, 42, 0.8) 70%);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
[data-theme="light"] .premium-hero-card {
  background: radial-gradient(circle at top, rgba(237, 233, 254, 0.9) 0%, #ffffff 80%);
  border-color: #c4b5fd;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.12);
}

.premium-badge-pill {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c084fc;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}
[data-theme="light"] .premium-badge-pill {
  background: #ede9fe;
  color: #7c3aed;
}

.premium-hero-title {
  font-size: 2.3rem;
  font-weight: 800;
  margin: 0 0 12px 0;
  color: var(--text-main);
  line-height: 1.2;
}
.premium-hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 780px;
  margin: 0 auto 24px auto;
  line-height: 1.6;
}
.premium-hero-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.hero-feat-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-main);
}
[data-theme="light"] .hero-feat-item {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Premium Status Banner */
.premium-status-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.15) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.status-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}
.status-banner-content .status-icon {
  font-size: 2rem;
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 1024px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.25s ease;
  box-shadow: var(--shadow);
}
.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}
[data-theme="light"] .pricing-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

.pricing-card.popular-plan {
  border: 2px solid #8b5cf6;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, var(--bg-card) 40%);
  transform: scale(1.03);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.25);
  z-index: 2;
}
.pricing-card.popular-plan:hover {
  transform: scale(1.05) translateY(-4px);
}
[data-theme="light"] .pricing-card.popular-plan {
  border-color: #7c3aed;
  background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 40%);
}

.popular-ribbon {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 4px 14px;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
  white-space: nowrap;
}

.pricing-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
.plan-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  display: block;
}
.plan-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 4px 0 12px 0;
}
.plan-price {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 3px;
  margin-bottom: 4px;
}
.plan-price .currency {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
}
.plan-price .amount {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}
.plan-price .period {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.plan-billing-note {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-main);
}
.plan-features li {
  line-height: 1.4;
}

.btn-plan {
  margin-top: auto;
  font-weight: 700;
  padding: 12px 18px;
}

/* Feature Comparison Table */
.premium-comparison-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 28px 24px;
}
[data-theme="light"] .premium-comparison-section {
  background: #ffffff;
  border-color: #e2e8f0;
}

.table-responsive {
  overflow-x: auto;
}
.premium-table {
  width: 100%;
  border-collapse: collapse;
}
.premium-table th {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  font-size: 0.95rem;
}
.premium-table th.th-premium {
  background: rgba(139, 92, 246, 0.12);
  color: #c084fc;
  font-weight: 800;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
[data-theme="light"] .premium-table th.th-premium {
  color: #7c3aed;
  background: #ede9fe;
}
.premium-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}
[data-theme="light"] .premium-table td {
  border-bottom-color: #f1f5f9;
}
.premium-table td.td-premium {
  background: rgba(139, 92, 246, 0.05);
}
[data-theme="light"] .premium-table td.td-premium {
  background: #faf5ff;
}
.text-center {
  text-align: center;
}

/* FAQ Accordion */
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}
[data-theme="light"] .faq-item {
  background: #ffffff;
  border-color: #e2e8f0;
}
.faq-item summary {
  list-style: none;
  font-size: 0.98rem;
  color: var(--text-main);
  outline: none;
  position: relative;
  padding-right: 24px;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "▾";
  position: absolute;
  right: 0;
  top: 0;
  transition: transform 0.2s;
}
.faq-item[open] summary::after {
  transform: rotate(180deg);
}
.faq-answer {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Checkout Modal */
.checkout-modal-card {
  max-width: 520px;
}
.checkout-summary-box {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 10px;
  padding: 16px;
}
[data-theme="light"] .checkout-summary-box {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border-color: #c4b5fd;
}
.checkout-plan-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.checkout-plan-badge {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
}
.checkout-price-display {
  text-align: right;
}
.checkout-amount {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}
.checkout-cycle {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
}
.checkout-summary-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.payment-method-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s ease;
}
[data-theme="light"] .payment-method-card {
  background: #ffffff;
  border-color: #cbd5e1;
}
.payment-method-card:hover {
  border-color: var(--primary);
}
.payment-method-card.active {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
}
[data-theme="light"] .payment-method-card.active {
  background: #ede9fe;
  border-color: #7c3aed;
}
.payment-method-card input[type="radio"] {
  display: none;
}
.method-content {
  display: flex;
  flex-direction: column;
}
.method-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}
.method-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Daily Limit Banner Warning */
.mode-daily-limit-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  margin-bottom: 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  font-size: 0.88rem;
  color: #fbbf24;
}
[data-theme="light"] .mode-daily-limit-banner {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}
.mode-daily-limit-banner.limit-exhausted {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}
[data-theme="light"] .mode-daily-limit-banner.limit-exhausted {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}






.premium-wallet-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:18px 0; }
.premium-wallet-stat { display:flex; flex-direction:column; gap:8px; padding:16px; border:1px solid var(--border-color); border-radius:12px; min-width:0; }
.premium-wallet-stat strong { overflow-wrap:anywhere; font-size:1.15rem; }
.premium-credit-choice { display:flex; align-items:flex-start; gap:10px; cursor:pointer; }
.business-card { padding:20px; border:1px solid var(--border-color); border-radius:12px; margin:16px 0; }
.business-card > .btn { margin:4px 8px 12px 0; }
.business-member { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:12px 0; border-bottom:1px solid var(--border-color); }
.business-member span { flex:1; min-width:130px; overflow-wrap:anywhere; }
.business-member select { width:auto; max-width:100%; }
.premium-form { display:flex; align-items:flex-end; flex-wrap:wrap; gap:14px; margin:16px 0; }
.premium-form label { display:flex; flex:1; flex-direction:column; gap:8px; min-width:180px; }
.ad-placeholder { max-width:960px; margin:24px auto; padding:12px 20px; min-height:90px; box-sizing:border-box; border:1px dashed var(--border-color); border-radius:8px; color:var(--text-muted); background:var(--bg-card); text-align:center; pointer-events:none; }
.ad-placeholder-label { display:block; text-align:left; font-size:.7rem; letter-spacing:.08em; text-transform:uppercase; margin-bottom:14px; }
.ad-placeholder-bottom { margin-top:60px; }
.learning-idle-prompt { position:fixed; right:18px; bottom:18px; z-index:3000; max-width:300px; padding:16px; border:1px solid var(--border-color); border-radius:12px; background:var(--bg-card); color:var(--text-main); box-shadow:0 6px 24px #0005; font-size:.9rem; }
.learning-time-dialog { max-width: min(560px,90vw); border:1px solid var(--border-color); border-radius:12px; padding:24px; background:var(--bg-card); color:var(--text-main); }
.learning-time-dialog::backdrop { background:#0008; }
.premium-payment-note { padding:16px; border:1px solid var(--border-color); border-radius:12px; margin:18px 0; }
@media(max-width:650px) { .premium-wallet-grid { grid-template-columns:1fr; } .premium-form { align-items:stretch; } .premium-form label { min-width:0; flex-basis:100%; } .ad-placeholder { margin:18px 14px; min-height:80px; } .ad-placeholder-bottom { margin-top:48px; } }

.card-term-link { display: inline; border: 0; padding: 0; background: none; color: var(--primary, #60a5fa); font: inherit; text-decoration: underline dotted; cursor: pointer; }
.card-term-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.glossary-dialog { position: fixed; inset: 0; margin: auto; width: min(540px, calc(100vw - 32px)); max-height: 80vh; max-height: 80dvh; overflow: auto; overflow-wrap: anywhere; border: 1px solid var(--border-color, #475569); border-radius: 16px; padding: 24px; background: var(--bg-card, #182334); color: var(--text-main, #f1f5f9); box-sizing: border-box; }
.glossary-dialog::backdrop { background: #0009; }
.glossary-toolbar { display: flex; justify-content: flex-end; }
#glossary-close { background: transparent; border: 0; color: #fff; font-size: 1.4rem; font-weight: 900; min-width: 44px; min-height: 44px; cursor: pointer; }
#glossary-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 6px; }
#glossary-definition { line-height: 1.6; }
#glossary-fields { font-size: .85rem; opacity: .75; }
