/* ========================================
   WEBSITEPILOTEN COMMUNITY - Main Styles
   Circle.so Clone
   ======================================== */

/* Shared content typography (Editor + Lesson Player) */
@import url('/content-styles.css');

/* Utility classes & design tokens (single source of truth) */
@import url('/utilities.css');

:root {
  --primary: #1a8a6e;
  --primary-dark: #15705a;
  --primary-light: #e8f5f0;
  --bg-dark: #1a1a2e;
  --bg-sidebar: #ffffff;
  --bg-main: #f5f5f5;
  --bg-card: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --accent-blue: #3b82f6;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-orange: #f97316;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-width: 240px;
  --header-height: 56px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
}
body.app-body {
  overflow: hidden;
  overflow-x: hidden;
  height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ========== LANDING PAGE (dieberater.de style + Unbounded font) ========== */
.landing-page {
  min-height: 100vh;
  overflow-y: auto;
  background: #0c1024;
  color: #fff;
  font-family: 'Unbounded', sans-serif;
}

/* Nav */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 60px;
  background: transparent;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
}

.landing-nav .logo { display: flex; align-items: center; gap: 10px; }
.landing-nav .logo-crown { height: 22px; width: auto; }
.landing-nav .logo-text {
  font-family: 'Unbounded', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #5de8c5;
}

.landing-nav-links { display: flex; align-items: center; gap: 6px; }
.landing-nav-links a {
  font-family: 'Unbounded', sans-serif;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 8px 16px;
  transition: color 0.2s;
}
.landing-nav-links a:hover { color: #5de8c5; }

.btn-cta-nav {
  font-family: 'Unbounded', sans-serif;
  background: transparent;
  color: #5de8c5;
  border: 2px solid #5de8c5;
  padding: 8px 24px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-cta-nav:hover { background: #5de8c5; color: #0c1024; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: 'Unbounded', sans-serif;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.btn-ghost:hover { background: var(--border-light); }
.btn-lg { padding: 16px 48px; font-size: 14px; letter-spacing: 1.5px; }

.btn-cta-hero {
  font-family: 'Unbounded', sans-serif;
  background: #5de8c5;
  color: #0c1024;
  border: none;
  padding: 16px 48px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-cta-hero:hover { background: #4dd4b1; }

.btn-outline-dark {
  font-family: 'Unbounded', sans-serif;
  background: transparent;
  color: #5de8c5;
  border: 2px solid rgba(93,232,197,0.3);
  padding: 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}
.btn-outline-dark:hover { border-color: #5de8c5; background: rgba(93,232,197,0.05); }

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 40px 80px;
  background: #0c1024;
  position: relative;
}

.hero-crown { margin-bottom: 24px; }
.hero-crown-text {
  font-family: 'Unbounded', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #5de8c5;
  margin-top: 8px;
}

.hero h1 {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(42px, 8vw, 110px);
  font-weight: 900;
  font-style: italic;
  line-height: 1.05;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 40px;
  letter-spacing: -1px;
}

.hero-tagline {
  font-family: 'Unbounded', sans-serif;
  font-size: 13px;
  letter-spacing: 4px;
  color: rgba(93,232,197,0.5);
  margin-bottom: 48px;
}

.hero-buttons { display: flex; justify-content: center; gap: 20px; }

/* Features */
.features-section {
  padding: 100px 60px;
  background: #0c1024;
  text-align: center;
}

.features-section h2 {
  font-family: 'Unbounded', sans-serif;
  font-size: 36px;
  font-weight: 800;
  font-style: italic;
  margin-bottom: 60px;
  color: #fff;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
}

.feature-card {
  padding: 40px 24px;
  border: 1px solid rgba(93,232,197,0.12);
  border-radius: 8px;
  transition: all 0.3s;
}
.feature-card:hover { border-color: rgba(93,232,197,0.35); background: rgba(93,232,197,0.03); }

.feature-card .feature-icon {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  border-radius: 12px;
  background: rgba(93,232,197,0.08);
  display: flex; align-items: center; justify-content: center;
}

.feature-card h3 {
  font-family: 'Unbounded', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 10px;
  color: #5de8c5;
}

.feature-card p { font-size: 13px; color: rgba(255,255,255,0.45); line-height: 1.7; font-family: -apple-system, sans-serif; }

/* Pricing */
.pricing-section {
  padding: 100px 40px;
  text-align: center;
  background: #0a0d1c;
}

.pricing-section h2 {
  font-family: 'Unbounded', sans-serif;
  font-size: 36px;
  font-weight: 800;
  font-style: italic;
  margin-bottom: 12px;
  color: #fff;
}
.pricing-section .subtitle {
  font-family: 'Unbounded', sans-serif;
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  letter-spacing: 2px;
  margin-bottom: 60px;
}

/* ==================== CASE STUDIES ==================== */
.case-studies-section {
  padding: 100px 40px;
  max-width: 1100px;
  margin: 0 auto;
}
.case-studies-section h2 {
  text-align: center;
  font-size: 36px;
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.case-card {
  display: flex;
  gap: 40px;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(93,232,197,0.1);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 32px;
  transition: border-color 0.3s, transform 0.3s;
}
.case-card:hover {
  border-color: rgba(93,232,197,0.3);
  transform: translateY(-2px);
}
.case-content { flex: 1; }
.case-chart { flex: 1; min-width: 0; }
.chart-svg { width: 100%; height: auto; }
.case-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(93,232,197,0.15);
  color: #5de8c5;
  margin-bottom: 12px;
}
.case-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.case-desc {
  font-size: 15px;
  color: #8892b0;
  line-height: 1.6;
  margin-bottom: 24px;
}
.case-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.case-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value {
  font-size: 22px;
  font-weight: 800;
  font-family: 'Unbounded', sans-serif;
}
.stat-arrow {
  font-size: 18px;
  color: #5de8c5;
  align-self: center;
}
.case-stat {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.stat-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
}
@media (max-width: 768px) {
  .case-card { flex-direction: column; padding: 24px; }
  .case-stats { gap: 16px; }
  .stat-value { font-size: 18px; }
}

.pricing-cards { display: flex; justify-content: center; gap: 24px; max-width: 900px; margin: 0 auto; }

.pricing-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(93,232,197,0.12);
  border-radius: 12px;
  padding: 40px 32px;
  flex: 1; max-width: 420px;
  text-align: left;
  transition: all 0.3s;
}

.pricing-card.featured {
  border-color: #5de8c5;
  background: rgba(93,232,197,0.04);
  box-shadow: 0 0 60px rgba(93,232,197,0.08);
  transform: scale(1.05);
}

.pricing-card .badge {
  display: inline-block;
  background: rgba(93,232,197,0.12);
  color: #5de8c5;
  padding: 4px 14px;
  border-radius: 20px;
  font-family: 'Unbounded', sans-serif;
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  margin-bottom: 16px;
}

.pricing-card h3 { font-family: 'Unbounded', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 8px; color: #fff; }
.pricing-card .price { font-family: 'Unbounded', sans-serif; font-size: 44px; font-weight: 900; margin-bottom: 4px; color: #5de8c5; }
.pricing-card .price span { font-size: 14px; color: rgba(255,255,255,0.35); font-weight: 400; }
.pricing-card .price-note { font-size: 12px; color: rgba(255,255,255,0.25); margin-bottom: 24px; }

.pricing-features { list-style: none; margin-bottom: 32px; }
.pricing-features li { padding: 7px 0; display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255,255,255,0.55); }
.pricing-features li svg { color: #5de8c5; flex-shrink: 0; }

.pricing-card .btn, .pricing-card .btn-cta-hero, .pricing-card .btn-outline-dark { width: 100%; }

/* Footer */
.landing-footer {
  padding: 40px 60px;
  background: #080b18;
  text-align: center;
  color: rgba(255,255,255,0.25);
  font-size: 12px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* ========== APP LAYOUT ========== */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  width: 100%;
  overflow-x: hidden;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 50;
}

.header-left { display: flex; align-items: center; gap: 16px; }
.header-left h2 { font-size: 18px; font-weight: 600; }

.header-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  scrollbar-width: none;
}
.header-nav::-webkit-scrollbar { display: none; }
.header-nav a {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.2s;
  font-weight: 500;
  flex-shrink: 0;
  cursor: pointer;
}
.header-nav a:hover { background: var(--border-light); color: var(--text-primary); }
.header-nav a.active { color: var(--text-primary); background: var(--border-light); }

.header-right { display: flex; align-items: center; gap: 16px; }

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--border-light);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.header-search:hover { background: var(--border); }
.header-search svg { color: var(--text-muted); }
.header-search span { color: var(--text-muted); font-size: 14px; }

.header-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  color: var(--text-secondary);
  position: relative;
}
.header-icon:hover { background: var(--border-light); }

.header-icon .badge-count {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: var(--accent-red);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.avatar.lg { width: 40px; height: 40px; font-size: 16px; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.sidebar-logo svg { height: 24px; }

.sidebar-menu { padding: 8px; flex: 1; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 1px;
}

.sidebar-item:hover { background: var(--border-light); color: var(--text-primary); }
.sidebar-item.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }

.sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Single-line label with fade + marquee */
.sidebar-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 20px), transparent 100%);
  mask-image: linear-gradient(to right, black calc(100% - 20px), transparent 100%);
}
.sidebar-label-text {
  display: inline-block;
  white-space: nowrap;
}

.sidebar-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-item .count {
  margin-left: auto;
  background: var(--border-light);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-section {
  padding: 16px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

/* Einklappbare Sidebar-Sektion */
.sidebar-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 14px;
  cursor: pointer;
  user-select: none;
}
.sidebar-section-toggle svg { transition: transform 0.2s; flex-shrink: 0; }
.sidebar-section-toggle.open svg { transform: rotate(180deg); }
.sidebar-collapse {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}
.sidebar-collapse.open { max-height: 400px; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.sidebar-footer .go-live {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.sidebar-footer .go-live:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.sidebar-footer .powered {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  display: flex;
  width: calc(100% - var(--sidebar-width));
}

.content-area {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 28px 36px;
  overflow-x: hidden;
}

.right-sidebar {
  width: 320px;
  padding: 24px 24px 24px 0;
  flex-shrink: 0;
}
.right-sidebar:empty {
  display: none;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-bar h1 { font-size: 24px; font-weight: 700; }

.filter-bar-right { display: flex; align-items: center; gap: 8px; }

.filter-dropdown {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.btn-new-post {
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.btn-new-post:hover { background: var(--primary-dark); }

/* Post Composer */
.post-composer {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.post-composer:hover { box-shadow: var(--shadow-sm); }

.post-composer input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}

.post-composer .plus-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
}

/* Post Cards */
.post-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.post-card:hover { box-shadow: var(--shadow-sm); }

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 0;
}

.post-meta { flex: 1; }
.post-author {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-badge {
  display: inline-block;
  background: var(--bg-dark);
  color: #fff;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.post-date { font-size: 12px; color: var(--text-muted); }
.post-category { font-size: 12px; color: var(--text-muted); }

.post-actions-top { display: flex; gap: 8px; }
.post-actions-top button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}
.post-actions-top button:hover { color: var(--text-primary); }

.post-body {
  padding: 12px 16px;
  overflow-x: hidden;
  word-break: break-word;
}
.post-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.post-time { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }

.post-tags { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 16px; }
.post-tag {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  background: var(--border-light);
  color: var(--text-secondary);
}
.post-tag.green { background: #dcfce7; color: #16a34a; }
.post-tag.blue { background: #dbeafe; color: #2563eb; }

.going-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* Right Sidebar Widgets */
.widget {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  overflow: hidden;
}

.widget-header {
  padding: 16px;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.event-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.event-item:hover { background: var(--border-light); }

.event-date {
  text-align: center;
  min-width: 40px;
}
.event-date .day { font-size: 20px; font-weight: 700; color: var(--primary); }
.event-date .month { font-size: 11px; font-weight: 600; color: var(--primary); text-transform: uppercase; }

.event-info .event-title { font-size: 14px; font-weight: 500; line-height: 1.3; }
.event-info .event-time { font-size: 12px; color: var(--text-muted); }

.trending-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.trending-item:hover { background: var(--border-light); }
.trending-item .trending-title { font-size: 14px; font-weight: 500; }
.trending-item .trending-author { font-size: 12px; color: var(--text-muted); }

/* ========== KURSE PAGE ========== */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
  gap: 20px;
  max-width: 100%;
}

.course-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}
.course-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.course-cover-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.course-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-light);
  border-radius: 8px 8px 0 0;
}

.course-card-body {
  padding: 14px 16px 16px;
}
.course-card-body h4 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.course-card-body p { font-size: 13px; color: var(--text-secondary); margin: 0; line-height: 1.4; }

.course-icon {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.course-info {
  padding: 16px;
}
.course-info h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.course-info p { font-size: 13px; color: var(--text-secondary); }
.course-info .course-meta {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Course Category Colors */
.course-icon.red { background: linear-gradient(135deg, #fecaca, #fee2e2); }
.course-icon.blue { background: linear-gradient(135deg, #bfdbfe, #dbeafe); }
.course-icon.orange { background: linear-gradient(135deg, #fed7aa, #ffedd5); }
.course-icon.purple { background: linear-gradient(135deg, #c4b5fd, #ede9fe); }
.course-icon.yellow { background: linear-gradient(135deg, #fde68a, #fef3c7); }
.course-icon.green { background: linear-gradient(135deg, #bbf7d0, #dcfce7); }

/* ========== COURSE DETAIL ========== */
.cd-wrap { padding: 24px 20px 60px; }
.cd-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
}
.cd-header-left {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}
.cd-cover {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.cd-header-info { flex: 1; min-width: 0; }
.cd-title { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.cd-desc { font-size: 14px; color: var(--text-secondary); margin: 0 0 10px; line-height: 1.5; }
.cd-meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cd-badge-published {
  font-size: 12px; font-weight: 700; color: #16a34a;
  background: #dcfce7; padding: 3px 10px; border-radius: 4px;
}
.cd-meta-text { font-size: 13px; color: var(--text-muted); }
.cd-edit-lessons-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; font-size: 13px;
  font-weight: 600; color: var(--text-primary); cursor: pointer;
  white-space: nowrap; transition: background 0.15s;
}
.cd-edit-lessons-btn:hover { background: var(--bg-light); }

/* Chapters */
.cd-sections { display: flex; flex-direction: column; gap: 4px; }
.cd-chapter {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.cd-chapter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}
.cd-chapter-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cd-chapter-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.cd-chapter-count { font-size: 13px; color: var(--text-muted); white-space: nowrap; }

/* Lessons */
.cd-lessons { display: flex; flex-direction: column; }
.cd-lesson {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  cursor: default;
  transition: background 0.12s;
}
.cd-lesson:last-child { border-bottom: none; }
.cd-lesson:hover { background: #f0fdf4; }
.cd-lesson-active { cursor: pointer; }
.cd-lesson-active:hover { background: #ecfdf5; }
.cd-lesson-icon { flex-shrink: 0; display: flex; }
.cd-lesson-title { flex: 1; font-size: 14px; color: var(--text-primary); }
.cd-lesson-status {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.cd-status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
}
.cd-edit-btn {
  width: 28px; height: 28px; border-radius: 6px; border: none;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: background 0.15s;
}
.cd-edit-btn:hover { background: var(--bg-light); color: var(--text-primary); }

/* ========== LESSON PLAYER ========== */
.content-area.no-padding {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== GLOBAL SEARCH ===== */
.gs-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.gs-pill:hover { border-color: #9ca3af; color: #374151; }
.gs-pill.active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}
.gs-pill.active::before {
  content: '✓';
  font-size: 11px;
  font-weight: 700;
}

.gs-result-item {
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.12s;
  border-radius: 0;
}
.gs-result-item:hover { background: #f9fafb; }

/* Full-screen overlay */
.lp-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 9999;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lp-wrap {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

/* Left sidebar */
.lp-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s ease;
}
.lp-sidebar.hidden { width: 0; }
.lp-sidebar-head {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
}
.lp-sidebar-course-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Suche in der Sidebar */
.lp-search-wrap {
  position: relative;
  flex-shrink: 0;
}
.lp-search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}
.lp-search-input {
  width: 100%;
  padding: 7px 10px 7px 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: var(--bg-main);
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
}
.lp-search-input:focus {
  border-color: var(--primary);
  background: #fff;
}
.lp-search-input::placeholder { color: var(--text-muted); }

/* Kapitel-Gruppe für Suchfilter */
.lp-chapter-group { }
.lp-no-results {
  padding: 20px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.lp-sidebar-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.lp-chapter-header {
  padding: 10px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--bg-main);
  position: sticky;
  top: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lp-lesson-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 16px 9px 20px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary);
  border-left: 3px solid transparent;
  line-height: 1.4;
  transition: background 0.12s;
}
.lp-lesson-item:hover { background: #f0fdf4; }
.lp-lesson-item.active {
  background: #ecfdf5;
  border-left-color: var(--primary);
  font-weight: 600;
}
.lp-lesson-item.no-video { cursor: default; color: var(--text-muted); }
.lp-lesson-item.no-video:hover { background: transparent; }
.lp-lesson-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.lp-lesson-item.active .lp-lesson-icon {
  border-color: var(--primary);
  background: var(--primary);
}

/* Main area */
.lp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.lp-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.lp-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.lp-toggle-btn:hover { background: var(--border-light); color: var(--text-primary); }
.lp-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
  white-space: nowrap;
}
.lp-back-btn:hover { background: var(--border-light); color: var(--text-primary); }
.lp-topbar-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.lp-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.lp-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: background 0.12s;
}
.lp-nav-btn:hover:not(:disabled) { background: var(--border-light); }
.lp-nav-btn:disabled { opacity: 0.3; cursor: default; }
.lp-nav-counter { font-size: 13px; color: var(--text-muted); white-space: nowrap; }

.lp-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  margin-left: 12px;
  transition: background 0.15s;
}
.lp-edit-btn:hover { background: #e5e7eb; color: #111827; }

/* Content area */
.lp-content {
  flex: 1;
  overflow-y: auto;
  padding: 40px 60px;
  background: #fff;
}
.lp-content-inner {
  max-width: 740px;
  margin: 0 auto;
  width: 100%;
}
.lp-lesson-counter {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 8px;
  font-weight: 400;
}
.lp-lesson-title-main {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 22px;
  color: var(--text-primary);
  line-height: 1.3;
}
.lp-video-wrap {
  width: 100%;
  margin-bottom: 28px;
}
.lp-video-aspect {
  position: relative;
  padding-top: 56.25%;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}
.lp-video-aspect iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
/* Shared content typography → content-styles.css (gilt auch für Editor) */
.lp-desc {
  color: var(--text-secondary);
  max-width: 100%;
  font-size: 16px;
  line-height: 1.5;
}
.lp-desc p {
  margin: 0 0 16px;
  line-height: 1.5;
}
.lp-desc p:empty { display: none; }
.lp-desc h2, .lp-desc h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 25px 0 15px;
  line-height: 1.3;
}
.lp-desc h1, .lp-desc h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 20px 0 6px;
  line-height: 1.3;
}
.lp-desc ul, .lp-desc ol {
  margin: 0 0 16px;
  padding-left: 24px;
}
.lp-desc li { margin-bottom: 4px; line-height: 1.6; }
.lp-desc strong, .lp-desc b { color: var(--text-primary); }
.lp-timestamp {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 2px 0;
  font-family: monospace;
}
.lp-check {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 3px 0;
  padding-left: 4px;
}

/* ── Lesson Comments ─────────────────────────────────────────────────────── */
.lp-comments {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}
.lp-comments-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.lp-comments-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.lp-comments-count {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--border-light);
  border-radius: 20px;
  padding: 2px 10px;
}
.lp-comment-form {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  align-items: flex-start;
}
.lp-comment-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.lp-comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lp-comment-input-wrap {
  flex: 1;
}
.lp-comment-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  resize: none;
  outline: none;
  min-height: 40px;
  max-height: 160px;
  overflow-y: auto;
  transition: border-color 0.15s, min-height 0.15s;
  box-sizing: border-box;
  line-height: 1.5;
}
.lp-comment-input:focus {
  border-color: var(--primary);
  min-height: 80px;
}
.lp-comment-input-actions {
  display: none;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.lp-comment-input:focus ~ .lp-comment-input-actions,
.lp-comment-input-actions.show {
  display: flex;
}
.lp-comment-btn-cancel {
  padding: 7px 16px;
  border: none; border-radius: 6px;
  background: transparent; color: var(--text-secondary);
  font-size: 13px; cursor: pointer; font-family: inherit;
}
.lp-comment-btn-cancel:hover { background: var(--border-light); }
.lp-comment-btn-submit {
  padding: 7px 18px;
  border: none; border-radius: 6px;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.lp-comment-btn-submit:hover { background: var(--primary-dark); }
.lp-comment-btn-submit:disabled { opacity: 0.5; cursor: default; }

/* Comment list */
.lp-comment-item {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.lp-comment-body { flex: 1; min-width: 0; }
.lp-comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.lp-comment-author {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.lp-comment-author.is-admin { color: var(--primary); }
.lp-comment-time {
  font-size: 12px;
  color: var(--text-muted);
}
.lp-comment-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}
.lp-comment-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.lp-comment-action-btn {
  background: none; border: none;
  font-size: 12px; color: var(--text-muted);
  cursor: pointer; font-family: inherit; font-weight: 600;
  padding: 2px 0;
}
.lp-comment-action-btn:hover { color: var(--text-primary); }
.lp-comment-action-btn.danger:hover { color: var(--accent-red); }

/* Replies */
.lp-replies {
  margin-top: 14px;
  padding-left: 16px;
  border-left: 2px solid var(--border-light);
}
.lp-reply-form {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  align-items: flex-start;
}
.lp-reply-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.lp-reply-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  resize: none;
  outline: none;
  min-height: 36px;
  transition: border-color 0.15s;
}
.lp-reply-input:focus { border-color: var(--primary); }
.lp-reply-submit {
  padding: 7px 14px;
  border: none; border-radius: 6px;
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
  align-self: flex-end;
}
.lp-reply-submit:hover { background: var(--primary-dark); }
.lp-empty-comments {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 24px 0;
}

/* New comment form — column layout (no avatar) */
#lp-new-comment-form {
  flex-direction: column;
  align-items: stretch;
}
.lp-comment-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.lp-comment-submit-btn {
  padding: 7px 18px;
  border: none; border-radius: 6px;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background 0.15s;
}
.lp-comment-submit-btn:hover { background: var(--primary-dark); }
.lp-comment-submit-btn:disabled { opacity: 0.5; cursor: default; }

/* Admin badge in comment author line */
.lp-comment-admin-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  color: var(--primary); background: var(--primary)18;
  border: 1px solid var(--primary)30;
  border-radius: 4px; padding: 1px 5px;
  margin-left: 5px; vertical-align: middle;
  line-height: 1.4;
}
.lp-delete-btn { color: var(--text-muted); }
.lp-delete-btn:hover { color: #ef4444 !important; }

/* Reply items (indented, smaller avatar) */
.lp-reply-item { margin-bottom: 14px; }
.lp-reply-item .lp-comment-avatar {
  width: 28px; height: 28px;
  font-size: 12px;
}
.lp-reply-item .lp-comment-text { font-size: 13px; }

/* ========== Admin Comments Page ========== */
.ac-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ac-filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--border); border-radius: 20px;
  background: #fff; color: var(--text-secondary);
  font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.ac-filter-btn.active {
  background: var(--text-primary); color: #fff; border-color: var(--text-primary);
}
.ac-filter-btn:not(.active):hover { border-color: var(--text-muted); }
.ac-filter-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ac-loading, .ac-empty {
  text-align: center; color: var(--text-muted);
  padding: 48px 0; font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}

.ac-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 12px;
  transition: box-shadow 0.15s;
}
.ac-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.ac-card--highlight {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary)20;
  animation: acPulse 3s ease-out;
}
@keyframes acPulse {
  0%   { box-shadow: 0 0 0 3px var(--primary)40; }
  100% { box-shadow: 0 0 0 3px transparent; }
}
.ac-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.ac-breadcrumb {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-muted); flex-wrap: wrap;
}
.ac-breadcrumb-item { font-weight: 600; color: var(--text-secondary); }
.ac-breadcrumb-sep { color: var(--border); }
.ac-card-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* Status badges */
.ac-status-badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  border-radius: 20px; padding: 3px 10px; white-space: nowrap;
}
.ac-answered  { background: #d1fae5; color: #065f46; }
.ac-unanswered { background: #fee2e2; color: #991b1b; }

/* Comment row */
.ac-comment-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.ac-comment-avatar { flex-shrink: 0; }
.ac-comment-content { flex: 1; min-width: 0; }
.ac-comment-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.ac-comment-author { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.ac-comment-text {
  font-size: 14px; color: var(--text-secondary);
  line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}

/* Replies section in card */
.ac-replies {
  margin: 0 0 12px 46px;
  padding: 10px 14px;
  background: var(--bg-light);
  border-radius: 8px;
  border-left: 3px solid var(--border);
}
.ac-reply { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.ac-reply:last-child { margin-bottom: 0; }
.ac-reply-avatar { flex-shrink: 0; }
.ac-reply-body { flex: 1; min-width: 0; }
.ac-reply-meta { display: flex; align-items: baseline; gap: 7px; margin-bottom: 3px; }
.ac-reply-author { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.ac-reply-time { font-size: 11px; color: var(--text-muted); }
.ac-reply-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* Card action row */
.ac-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-action-btn {
  padding: 6px 14px;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--text-secondary);
  font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ac-action-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
.ac-btn-mark { border-color: var(--border); }
.ac-btn-mark--green { border-color: #10b981; color: #065f46; background: #f0fdf4; }
.ac-btn-mark--green:hover { background: #dcfce7; }
.ac-btn-reply { color: var(--primary); border-color: var(--primary)50; }
.ac-btn-reply:hover { background: var(--primary)08; }

/* Inline reply form inside card */
.ac-reply-form-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

/* Toggle switch (notification prefs) */
.lp-toggle-wrap { cursor: pointer; flex-shrink: 0; }
.lp-toggle-track {
  width: 36px; height: 20px;
  border-radius: 10px;
  background: #d1d5db;
  position: relative;
  transition: background 0.2s;
}
.lp-toggle-track.active { background: var(--primary); }
.lp-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: left 0.2s;
}
.lp-toggle-track.active .lp-toggle-thumb { left: 19px; }

/* Chat sidebar */
.chat-sidebar-details { padding: 0 4px; }
.chat-sidebar-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.chat-sidebar-header h3 { font-size: 16px; font-weight: 700; margin: 0; }
.chat-member-count {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--text-muted);
}
.chat-section-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.5px; margin-bottom: 10px; margin-top: 4px;
}
.chat-offline-section { margin-top: 20px; }
.chat-member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
}
.chat-member-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.chat-member-name { font-size: 14px; font-weight: 500; }

/* ========== MEMBERS PAGE ========== */
.members-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.members-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  width: 280px;
}
.members-search input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 14px;
}

/* ===== SHARED PAGE HEADINGS (unified across all content pages) ===== */
.page-h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}
.page-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 24px;
}
.section-h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px;
}

/* ===== KURSE PAGE ===== */
.kurse-view { padding: 0 0 40px; }
.kurse-view > h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 24px;
}
.kurse-section { margin-bottom: 40px; }
.kurse-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px;
}

/* ===== FORUM PAGE ===== */
.forum-view { max-width: 800px; padding-bottom: 40px; }
.forum-view h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px;
}

/* ===== ADMIN VIEW ===== */
.admin-view { max-width: 900px; padding: 0 0 40px; }
.admin-view h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* ===== EVENTS PAGE ===== */
.ev-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  padding: 24px 28px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}
.ev-calendar-col {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  min-height: 0;
}
.ev-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ev-section-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.ev-clear-btn { background: none; border: none; font-size: 12px; color: var(--primary); cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.ev-clear-btn:hover { background: var(--primary-light); }

.ev-calendar { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.ev-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ev-cal-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.ev-cal-arrow { width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: background 0.12s; }
.ev-cal-arrow:hover { background: var(--border-light); }
.ev-cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.ev-cal-weekdays div { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 4px 0; }
.ev-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.ev-cal-cell { position: relative; text-align: center; padding: 6px 2px 8px; font-size: 12px; color: var(--text-secondary); border-radius: 6px; cursor: pointer; transition: background 0.1s; line-height: 1; }
.ev-cal-cell:hover:not(.ev-cal-empty) { background: var(--border-light); }
.ev-cal-empty { cursor: default; }
.ev-today { font-weight: 700; color: var(--primary); }
.ev-selected { background: var(--primary) !important; color: #fff !important; }
.ev-selected .ev-dot { background: rgba(255,255,255,0.7) !important; }
.ev-dot { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }

/* Big grid calendar */
.ev-gcal-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height) - 80px);
}
.ev-gcal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.ev-gcal-weekdays div {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.ev-gcal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  flex: 1;
  min-height: 0;
}
.ev-gcal-cell {
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 6px 7px;
  cursor: pointer;
  transition: background 0.1s;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ev-gcal-cell:hover { background: #f9fafb; }
.ev-gcal-cell:nth-child(7n) { border-right: none; }
.ev-gcal-other { background: #fafafa; cursor: default; }
.ev-gcal-today .ev-gcal-num {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ev-gcal-selected { background: var(--primary-light) !important; }
.ev-gcal-num {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1;
  flex-shrink: 0;
}
.ev-gcal-events { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.ev-gcal-event {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  line-height: 1.4;
}
.ev-gcal-event:hover { filter: brightness(0.95); }

.ev-events-col { min-width: 0; }
.ev-next-card { background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%); border: 1px solid #bbf7d0; border-radius: 14px; padding: 20px 22px; margin-bottom: 20px; }
.ev-next-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #059669; margin-bottom: 10px; }
.ev-next-title { font-size: 18px; font-weight: 700; color: var(--text-primary); line-height: 1.3; margin-bottom: 10px; }
.ev-next-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); }
.ev-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.ev-join-btn { padding: 8px 20px; border-radius: 8px; border: none; background: #111827; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.ev-join-btn:hover { background: #1f2937; }
.ev-join-btn.ev-join-live { background: #dc2626; }
.ev-join-btn.ev-join-live:hover { background: #b91c1c; }
.ev-list-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; }
.ev-list-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.ev-list-item:last-child { border-bottom: none; }
.ev-list-datecol { flex-shrink: 0; width: 42px; text-align: center; background: var(--border-light); border-radius: 8px; padding: 6px 4px; }
.ev-list-day { font-size: 18px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.ev-list-mon { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; }
.ev-list-info { flex: 1; min-width: 0; }
.ev-list-title { font-size: 14px; font-weight: 500; color: var(--text-primary); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-list-sub { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.ev-list-btn { flex-shrink: 0; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border); background: #fff; color: var(--text-secondary); font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: all 0.12s; }
.ev-list-btn:hover { background: var(--border-light); color: var(--text-primary); }
.ev-reg-btn { padding: 7px 16px; border-radius: 8px; border: 1.5px solid var(--border); background: #fff; color: var(--text-secondary); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.ev-reg-btn:hover { border-color: #6366f1; color: #6366f1; background: #6366f108; }

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

.member-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  transition: box-shadow 0.2s;
}
.member-card:hover { box-shadow: var(--shadow-sm); }

.member-card .avatar { margin: 0 auto 12px; width: 56px; height: 56px; font-size: 22px; }
.member-card .member-name { font-weight: 600; margin-bottom: 2px; }
.member-card .member-role {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  margin-top: 4px;
}
.member-role.admin { background: var(--bg-dark); color: #fff; }
.member-role.premium { background: var(--primary-light); color: var(--primary); }
.member-role.free { background: var(--border-light); color: var(--text-muted); }

/* ========== COMING SOON ========== */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  color: var(--text-secondary);
}

.coming-soon svg { margin-bottom: 16px; color: var(--text-muted); }
.coming-soon h2 { font-size: 24px; margin-bottom: 8px; color: var(--text-primary); }
.coming-soon p { font-size: 15px; max-width: 400px; }

/* ========== LEADERBOARD ========== */
.leaderboard-list { max-width: 600px; }

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: box-shadow 0.2s;
}
.leaderboard-item:hover { box-shadow: var(--shadow-sm); }

.leaderboard-rank {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-muted);
}
.leaderboard-rank.gold { color: #f59e0b; }
.leaderboard-rank.silver { color: #9ca3af; }
.leaderboard-rank.bronze { color: #d97706; }

.leaderboard-info { flex: 1; }
.leaderboard-name { font-weight: 600; }
.leaderboard-points { font-size: 13px; color: var(--text-muted); }
.leaderboard-score { font-size: 18px; font-weight: 700; color: var(--primary); }

/* Mobile Menu Button and Sidebar Overlay */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-secondary);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 190;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
  .right-sidebar { display: none; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .sidebar.mobile-open { display: flex; z-index: 200; }
  .mobile-menu-btn { display: flex; }
  .sidebar-overlay { display: block; }
  .main-content { margin-left: 0; }
  .app-header { left: 0; }
  .header-right { gap: 6px; }
  .header-search { display: none; }
  .header-icon { width: 30px; height: 30px; }
  .content-area { padding: 16px; }
  .landing-nav { padding: 12px 16px; }
  .landing-nav-links { gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
  .landing-nav-links a { font-size: 9px; padding: 6px 6px; }
  .btn-cta-nav { font-size: 9px; padding: 6px 14px; }
  .hero { padding: 100px 20px 60px; }
  .hero h1 { font-size: clamp(28px, 10vw, 60px); }
  .hero-tagline { font-size: 10px; letter-spacing: 2px; }
  .hero-crown svg { width: 60px; height: 48px; }
  .cal-grid { grid-auto-rows: 80px; }
  .cal-event { font-size: 9px; padding: 2px 4px; }
  .cal-day-header { font-size: 10px; }
  .cal-day-num { font-size: 12px; width: 24px; height: 24px; }
  .features-section { padding: 60px 16px; }
  .features-grid { grid-template-columns: 1fr; gap: 20px; }
  .pricing-section { padding: 60px 20px; }
  .pricing-cards { flex-direction: column; align-items: stretch; }
  .pricing-card { max-width: 100%; }
  .pricing-card.featured { transform: none; }
  .case-studies-section { padding: 40px 16px; }
  .members-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ========== AUTH MODAL ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 400px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
}

.modal h2 { font-size: 24px; margin-bottom: 24px; text-align: center; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text-secondary); }
.form-group input, .form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary); }

.modal .btn { width: 100%; margin-top: 8px; padding: 12px; }

.modal-footer { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.modal-footer a { color: var(--primary); cursor: pointer; }

/* User menu dropdown */
.user-menu {
  position: absolute;
  top: 48px;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 200px;
  z-index: 100;
  display: none;
}
.user-menu.open { display: block; }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s;
}
.user-menu-item:hover { background: var(--border-light); }
.user-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ==================== CALENDAR ==================== */
.cal-container { max-width: 100%; }
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.cal-nav-btn:hover { background: var(--bg-light); }
.cal-month-label {
  font-size: 18px;
  font-weight: 700;
  min-width: 160px;
  text-align: center;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 140px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  gap: 0;
}
.cal-day-header {
  padding: 12px 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.cal-day-header:nth-child(7) { border-right: none; }
.cal-cell {
  padding: 6px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
  vertical-align: top;
  position: relative;
  overflow: hidden;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.cal-empty { background: #fafafa; }
.cal-cell.cal-today { background: #f0fdf4; }
.cal-day-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.cal-day-today {
  background: var(--primary);
  color: #fff !important;
}
.cal-event {
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 3px;
  margin-bottom: 2px;
  line-height: 1.2;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: opacity 0.2s;
}

/* ==================== CHAT ==================== */
/* ==================== CHAT (Circle.so Style) ==================== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height) - 48px);
  position: relative;
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--border);
}
.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-header-left h1 { font-size: 20px; font-weight: 700; margin: 0; }
.chat-header-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #fbbf24;
}
.chat-header-actions {
  display: flex; gap: 8px; align-items: center;
}
.chat-header-btn {
  width: 32px; height: 32px; border-radius: 6px; border: none; background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: background 0.15s;
}
.chat-header-btn:hover { background: var(--bg-light); }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-date-sep {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 0 8px;
  color: var(--text-muted); font-size: 12px; font-weight: 600; text-transform: uppercase;
}
.chat-date-sep::before, .chat-date-sep::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.chat-msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  position: relative;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.15s;
}
.chat-msg:hover { background: var(--bg-light); }
.chat-msg:hover .chat-admin-controls { opacity: 1; }
.chat-msg-hidden { opacity: 0.5; }
.chat-msg-private {
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  padding: 8px 8px 8px 12px;
}
.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.chat-bubble { flex: 1; min-width: 0; }
.chat-meta {
  display: flex; align-items: center; gap: 8px; margin-bottom: 2px;
}
.chat-author { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.chat-role-badge {
  font-size: 10px; background: #22c55e; color: #fff;
  padding: 2px 8px; border-radius: 10px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 3px;
}
.chat-private-badge {
  font-size: 10px; background: #fbbf24; color: #92400e;
  padding: 2px 8px; border-radius: 10px; font-weight: 700;
}
.chat-time { font-size: 12px; color: var(--text-muted); }
.chat-text { font-size: 14px; line-height: 1.6; color: var(--text-primary); }
.chat-text img.chat-gif { max-width: 250px; border-radius: 8px; margin-top: 4px; display: block; }
.chat-text .chat-audio-player {
  margin-top: 6px; display: flex; align-items: center; gap: 8px;
  background: var(--bg-light); padding: 8px 12px; border-radius: 20px; width: fit-content;
}
.chat-text .chat-audio-player audio { height: 28px; }
.chat-attachment {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-light); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; margin-top: 6px; font-size: 13px;
}
.chat-attachment-icon { color: var(--text-muted); }
.chat-attachment-name { font-weight: 600; color: var(--text-primary); }
.chat-attachment-size { color: var(--text-muted); font-size: 11px; }
.chat-admin-controls {
  position: absolute; right: 8px; top: 4px;
  display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 2px; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.chat-ctrl-btn {
  width: 28px; height: 28px; border-radius: 4px; border: none;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all 0.15s;
}
.chat-ctrl-btn:hover { background: var(--bg-light); color: var(--text-primary); }
/* Chat Input Area */
.chat-input-area {
  border: 1px solid var(--border); border-radius: 12px;
  margin-top: auto; background: #fff; overflow: hidden;
}
.chat-input-field {
  width: 100%; padding: 14px 16px 8px; border: none; outline: none;
  font-size: 14px; font-family: inherit; resize: none; min-height: 40px;
  background: transparent; color: var(--text-primary);
}
.chat-input-field::placeholder { color: var(--text-muted); }
.chat-input-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px 8px;
}
.chat-toolbar-left {
  display: flex; gap: 2px;
}
.chat-toolbar-btn {
  width: 34px; height: 34px; border-radius: 8px; border: none;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all 0.15s;
}
.chat-toolbar-btn:hover { background: var(--bg-light); color: var(--text-primary); }
.chat-toolbar-btn.recording { color: #ef4444; animation: pulse-rec 1.5s infinite; }

.chat-recording-indicator { display: flex; }
.audio-preview-content { display: flex; flex-direction: column; gap: 8px; }
.audio-player { background: #fff; border-radius: 6px; padding: 8px; }
.audio-player audio { width: 100%; height: 24px; }
.audio-preview-buttons { display: flex; gap: 8px; }
.btn-primary, .btn-secondary { padding: 8px 12px; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 14px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #f5f5f5; color: #333; border: 1px solid #e0e0e0; }
.btn-secondary:hover { background: #efefef; }

.chat-msg-recalled { opacity: 0.6; }
.chat-msg-recalled .chat-avatar { opacity: 0.5; }
.chat-msg-recalled .chat-bubble { background: #f9f9f9; }
.chat-msg-controls { display: none; position: absolute; right: -40px; top: 8px; background: #fff; border-radius: 6px; padding: 4px; box-shadow: var(--shadow-sm); }
.chat-msg:hover .chat-msg-controls { display: flex; }
.chat-msg-controls { gap: 4px; }

@keyframes pulse-rec { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.chat-send-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s; opacity: 0.4;
}
.chat-send-btn.active { opacity: 1; }
.chat-send-btn:hover { background: var(--primary-dark); }
/* GIF Picker */
.chat-gif-picker {
  position: absolute; bottom: 80px; left: 0;
  width: 340px; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  z-index: 100; overflow: hidden; display: none;
}
.chat-gif-picker.open { display: block; }
.chat-gif-picker input {
  width: 100%; padding: 12px 14px; border: none; border-bottom: 1px solid var(--border);
  font-size: 14px; outline: none;
}
.chat-gif-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px; padding: 4px; max-height: 300px; overflow-y: auto;
}
.chat-gif-grid img {
  width: 100%; border-radius: 6px; cursor: pointer;
  transition: transform 0.15s; aspect-ratio: 16/9; object-fit: cover;
}
.chat-gif-grid img:hover { transform: scale(1.03); }
/* Chat Details Sidebar */
.chat-details h3 {
  font-size: 16px; font-weight: 700; margin-bottom: 16px;
}
.chat-details-section {
  margin-bottom: 20px;
}
.chat-details-label {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}
.chat-member-item {
  display: flex; align-items: center; gap: 10px; padding: 6px 0;
}
.chat-member-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700;
}
.chat-member-name { font-size: 14px; font-weight: 500; }
.chat-member-badge {
  font-size: 9px; background: #22c55e; color: #fff;
  padding: 1px 6px; border-radius: 8px; font-weight: 700; margin-left: 4px;
}
/* Locked State */
.chat-locked {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; text-align: center; color: var(--text-muted);
}
.chat-locked h2 { font-size: 20px; color: var(--text-primary); }
.chat-locked p { font-size: 14px; max-width: 400px; }

/* ====== Dashboard ====== */
.dashboard-wrap { padding: 0 0 40px; max-width: 1340px; }
.ds-header { margin-bottom: 20px; }
.ds-header h1 { font-size: 22px; font-weight: 700; margin: 0; }

.ds-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

.ds-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ds-skeleton {
  min-height: 220px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

.ds-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.ds-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.ds-action-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.ds-action-btn:hover { background: var(--bg-light); color: var(--text-primary); }

.ds-card-body {
  flex: 1;
  padding: 4px 0;
  min-height: 160px;
}

.ds-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-muted);
}

.ds-arrow {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ds-arrow:hover:not(:disabled) { background: var(--bg-light); color: var(--text-primary); }
.ds-arrow:disabled { opacity: 0.35; cursor: default; }

/* Items inside cards */
.ds-item {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
}
.ds-item:last-child { border-bottom: none; }

.ds-item-clickable { cursor: pointer; transition: background 0.15s; }
.ds-item-clickable:hover { background: var(--bg-light); }

.ds-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.ds-item-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ds-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.ds-tag {
  background: var(--bg-light);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Event items */
.ds-item-event {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  cursor: pointer;
  transition: background 0.15s;
}
.ds-item-event:hover { background: var(--bg-light); }

.ds-item-date-badge {
  min-width: 44px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  text-align: center;
  padding: 6px 4px;
  line-height: 1.2;
  flex-shrink: 0;
}

.ds-item-event-body { flex: 1; min-width: 0; }

.ds-empty {
  padding: 32px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Ads News priority badges */
.ds-ads-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ds-ads-tag.high { background: #dcfce7; color: #166534; }
.ds-ads-tag.medium { background: #fef3c7; color: #92400e; }
.ds-ads-tag.low { background: #f1f5f9; color: #475569; }

.ds-ads-item { padding: 10px 18px; }
.ds-ads-item + .ds-ads-item { border-top: 1px solid var(--border); }
.ds-ads-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ds-ads-item-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.ds-ads-item-text { font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.ds-ads-item-footer { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.ds-ads-source {
  flex-shrink: 0;
  color: var(--text-muted);
  opacity: 0.45;
  transition: opacity 0.15s, color 0.15s;
  margin-top: 2px;
}
.ds-ads-source:hover { opacity: 1; color: var(--primary, #4f46e5); }

/* Fun Fact card */
.ds-funfact {
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
}
.ds-funfact-emoji { font-size: 42px; margin-bottom: 14px; }
.ds-funfact-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  max-width: 280px;
}
.ds-funfact-label {
  margin-top: 14px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

@media (max-width: 1100px) {
  .ds-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .ds-grid { grid-template-columns: 1fr; }
  .dashboard-wrap { padding: 16px; }
}

/* ── MASTERMINDS ─────────────────────────────────────────── */
.mm-wrap { width: 100%; padding: 24px 20px 60px; }
.mm-header { margin-bottom: 18px; }
.mm-header h2 { font-size: 22px; font-weight: 700; margin: 0 0 3px; }
.mm-subtitle  { font-size: 13px; color: var(--text-secondary); margin: 0; }
.mm-loading   { padding: 60px; text-align: center; color: var(--text-secondary); font-size: 14px; }

/* Filter buttons */
.mm-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* Tag filter row */
.mm-tag-filters {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px;
}
.mm-tag-filter-btn {
  padding: 4px 12px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text-secondary); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.mm-tag-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.mm-tag-filter-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.mm-filter-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid var(--border); background: var(--bg);
  color: var(--text-secondary); font-size: 13px; cursor: pointer; transition: all .15s;
}
.mm-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.mm-filter-btn.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.mm-filter-btn.active .mm-count { background: rgba(255,255,255,.22); color: #fff; }
.mm-count {
  font-size: 11px; font-weight: 700; background: var(--border-light);
  color: var(--text-secondary); border-radius: 10px; padding: 1px 6px;
}

/* Table */
.mm-table-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.mm-table { width: 100%; border-collapse: collapse; }
.mm-table thead tr { background: var(--bg-light); }
.mm-table th {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-secondary);
  padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border);
}
.mm-th-thumb  { width: 80px; }
.mm-th-main   { }
.mm-th-author { width: 130px; }
.mm-th-dur    { width: 80px; }
.mm-th-date   { width: 100px; }

/* Rows */
.mm-tr {
  cursor: pointer; transition: background .12s;
  border-bottom: 1px solid var(--border);
}
.mm-tr:last-child { border-bottom: none; }
.mm-tr:hover { background: var(--bg-light); }

.mm-td-thumb { padding: 10px 12px; vertical-align: middle; }
.mm-thumb-img {
  width: 80px; height: 45px; border-radius: 6px;
  object-fit: cover; display: block; background: var(--border-light);
}
.mm-thumb-ph  {
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-secondary);
}

.mm-td-main   { padding: 10px 14px 10px 4px; vertical-align: middle; }
.mm-short-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; line-height: 1.3; }
.mm-tags-row  { display: flex; flex-wrap: wrap; gap: 4px; }
.mm-tag-pill  {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: var(--bg-light); border: 1px solid var(--border);
  color: var(--text-secondary); white-space: nowrap;
}

.mm-td-author { padding: 10px 14px; vertical-align: middle; }
.mm-author-badge {
  font-size: 12px; font-weight: 600; padding: 3px 9px;
  border-radius: 12px; white-space: nowrap;
}
.mm-author-malte   { background: #e8f5f1; color: #1a7a5e; }
.mm-author-jonas   { background: #eef2ff; color: #4361c2; }
.mm-author-michael { background: #fff4e6; color: #c07010; }

.mm-td-dur  { padding: 10px 14px; font-size: 13px; color: var(--text-secondary); vertical-align: middle; white-space: nowrap; }
.mm-td-date { padding: 10px 14px; font-size: 12px; color: var(--text-secondary); vertical-align: middle; white-space: nowrap; }

/* Pagination */
.mm-pager {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-top: 20px;
}
.mm-pager-btn {
  padding: 7px 16px; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--bg); font-size: 13px; cursor: pointer; transition: all .15s;
}
.mm-pager-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.mm-pager-btn:disabled { opacity: .35; cursor: default; }
.mm-pager-info { font-size: 13px; color: var(--text-secondary); min-width: 120px; text-align: center; }

/* Lesson detail */
.mm-lesson-wrap { max-width: 860px; margin: 0 auto; padding: 24px 20px 60px; }
.mm-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--bg); font-size: 13px; cursor: pointer;
  margin-bottom: 20px; transition: all .15s;
}
.mm-back-btn:hover { border-color: var(--primary); color: var(--primary); }
.mm-lesson-author {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .7px; margin-bottom: 8px; display: inline-block;
  padding: 3px 9px; border-radius: 12px;
}
.mm-lesson-title  { font-size: 22px; font-weight: 700; line-height: 1.35; margin: 0 0 12px; }
.mm-lesson-tags   { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.mm-lesson-meta   { font-size: 13px; color: var(--text-secondary); margin-bottom: 22px; }
.mm-video-container {
  position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;
  border-radius: 12px; background: #000; margin-bottom: 32px;
}
.mm-video-container iframe,
.mm-video-container video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 12px; }
.mm-video-container > div { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.mm-video-soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; height: 100%; background: #0f1117; border-radius: 12px;
  text-align: center; padding: 24px;
}
.mm-video-soon-icon { font-size: 36px; margin-bottom: 12px; }
.mm-video-soon-title { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 8px; }
.mm-video-soon-text { font-size: 13px; color: #9ca3af; max-width: 320px; line-height: 1.6; }
.mm-description { border-top: 1px solid var(--border); padding-top: 24px; }
.mm-description h3 { font-size: 16px; font-weight: 600; margin: 0 0 14px; }
.mm-desc-body { font-size: 14px; line-height: 1.7; }
.mm-desc-body p  { margin: 0 0 10px; }
.mm-desc-body ul { margin: 0 0 10px; padding-left: 20px; }
.mm-desc-body li { margin-bottom: 6px; }
.mm-desc-body strong { font-weight: 600; }

/* Bulk select */
.mm-th-check  { width: 36px; padding: 8px 6px; text-align: center; }
.mm-td-check  { width: 36px; padding: 8px 6px; text-align: center; cursor: default; }
.mm-tr-selected { background: #eff6ff !important; }
.mm-tr-selected:hover { background: #dbeafe !important; }

.mm-bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #1e40af; color: #fff; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 14px;
}
.mm-bulk-info { font-size: 13px; font-weight: 600; flex: 1; }
.mm-bulk-btn {
  font-size: 12px; font-weight: 600; border: none; border-radius: 6px;
  padding: 5px 12px; cursor: pointer; transition: opacity .15s;
}
.mm-bulk-btn:hover { opacity: .85; }
.mm-bulk-publish { background: #059669; color: #fff; }
.mm-bulk-delete  { background: #dc2626; color: #fff; }
.mm-bulk-clear   { background: rgba(255,255,255,.18); color: #fff; }

@media (max-width: 680px) {
  .mm-th-author,.mm-th-date,.mm-td-author,.mm-td-date { display: none; }
  .mm-thumb-img { width: 60px; height: 34px; }
}

/* ── Frag KI Malte ─────────────────────────────────────────────────────────── */
.ai-malte-view {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  max-width: 860px;
  margin: 0;
  padding: 0;
  position: relative;
}

.ai-malte-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ai-malte-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.ai-malte-view h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 2px;
}

.ai-malte-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.ai-malte-chat {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.ai-msg {
  display: flex;
  max-width: 88%;
}

.ai-msg--user {
  align-self: flex-end;
}

.ai-msg--bot {
  align-self: flex-start;
  align-items: flex-end;
  gap: 8px;
}

.ai-msg-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  min-height: 32px;
  max-height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  overflow: hidden;
  margin-bottom: 2px;
}

.ai-msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.65;
}

.ai-msg--user .ai-msg-bubble {
  background: #6366f1;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ai-msg--bot .ai-msg-bubble {
  background: var(--bg-secondary, #f3f4f6);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.ai-msg--typing .ai-msg-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
}

.ai-dot {
  width: 7px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: ai-bounce 1.2s infinite ease-in-out;
}
.ai-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes ai-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

.ai-sources {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.ai-sources span, .ai-source-link {
  display: inline-block;
  background: var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  margin: 2px 2px 0 0;
  font-size: 11px;
}

.ai-source-link {
  color: #6366f1;
  text-decoration: none;
  transition: background 0.15s;
}

.ai-source-link:hover {
  background: #e0e7ff;
  color: #4338ca;
}

.ai-source-link--plain {
  color: var(--text-muted);
}

.ai-malte-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 16px;
  flex-shrink: 0;
}

.ai-suggestion-btn {
  font-size: 13px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.ai-suggestion-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.05);
}

.ai-malte-input-wrap {
  padding: 12px 0 20px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.ai-malte-input-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-secondary, #f9fafb);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 10px 10px 10px 16px;
  transition: border-color 0.15s;
}

.ai-malte-input-box:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ai-malte-textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  outline: none;
  min-height: 24px;
  max-height: 160px;
  font-family: inherit;
}

.ai-malte-textarea::placeholder { color: var(--text-muted); }

.ai-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #6366f1;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

.ai-send-btn:hover:not(:disabled) { background: #4f46e5; }
.ai-send-btn:active:not(:disabled) { transform: scale(0.95); }
.ai-send-btn:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }

.ai-malte-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin: 8px 0 0;
}

/* Header nav: KI Malte sparkle icon */
.header-nav a[data-nav="ai-malte"] svg circle {
  fill: #a78bfa;
}

/* ==================== NUTZERKONTO ====================  */
.account-card {
  background: var(--bg-secondary, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 24px;
}

.account-avatar-section {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 4px;
}

.account-role-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.account-role-badge.role-superadmin { background: #fef3c7; color: #92400e; }
.account-role-badge.role-admin      { background: #e0e7ff; color: #3730a3; }
.account-role-badge.role-premium    { background: #f3e8ff; color: #6d28d9; }
.account-role-badge.role-free       { background: #f3f4f6; color: #6b7280; }

/* Avatar picker dropdown */
.account-avatar-picker {
  display: none;
  margin-top: 16px;
  background: var(--bg-secondary, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 16px;
}
.account-avatar-picker.open { display: block; }

.account-avatar-picker-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.account-animal-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
@media (max-width: 480px) {
  .account-animal-grid { grid-template-columns: repeat(4, 1fr); }
}

.account-animal-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border: 2px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.account-animal-btn:hover {
  border-color: #6366f1;
  background: #eef2ff;
  transform: scale(1.05);
}
.account-animal-btn.selected {
  border-color: #6366f1;
  background: #eef2ff;
}

/* User menu: wider + avatar preview */
.user-menu {
  min-width: 220px;
}

/* ── Forum ─────────────────────────────────────────────────────────────── */
.forum-page { max-width: 900px; margin: 0; padding: 0 0 40px; }
.forum-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.forum-header h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); margin: 0; letter-spacing: -0.3px; }
.forum-new-btn { display: inline-flex; align-items: center; gap: 7px; background: var(--primary); color: #fff; border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s, transform 0.1s; }
.forum-new-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.forum-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; scrollbar-width: none; -ms-overflow-style: none; }
.forum-cats::-webkit-scrollbar { display: none; }
.forum-cat-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--bg-card); color: var(--text-secondary); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: all 0.15s; }
.forum-cat-btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.forum-cat-btn.active { border-color: transparent; background: var(--primary); color: #fff; }
.forum-cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.forum-sort-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.forum-sort-btn { padding: 5px 12px; border-radius: 7px; border: 1.5px solid var(--border); background: transparent; color: var(--text-secondary); font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.forum-sort-btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.forum-sort-btn.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.forum-card { background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 10px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s; position: relative; display: flex; gap: 16px; align-items: flex-start; }
.forum-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(26,138,110,0.08); transform: translateY(-1px); }
.forum-card.is-pinned { border-color: #f59e0b44; background: #fffdf0; }
.forum-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 7px; }
.forum-unread-dot.read { background: transparent; }
.forum-card-body { flex: 1; min-width: 0; }
.forum-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.forum-cat-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.forum-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-muted); background: var(--border-light); padding: 2px 7px; border-radius: 4px; }
.forum-badge--replied { background: #f0fdf4; color: #16a34a; }
.forum-card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; line-height: 1.4; word-break: break-word; }
.forum-card-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.forum-card-author { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.forum-card-stats { display: flex; align-items: center; gap: 14px; }
.forum-stat { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }
.forum-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.forum-bm-btn { background: none; border: none; cursor: pointer; padding: 4px; border-radius: 6px; color: var(--text-muted); transition: color 0.15s, background 0.15s; line-height: 1; }
.forum-bm-btn:hover { background: var(--border-light); color: var(--accent-yellow); }
.forum-bm-btn.active { color: var(--accent-yellow); }
.forum-empty { padding: 60px 0; text-align: center; color: var(--text-muted); }
.forum-empty svg { margin-bottom: 12px; opacity: 0.35; }
.forum-empty p { font-size: 15px; margin: 0; }
.forum-loading { padding: 40px 0; text-align: center; }
.forum-spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: forum-spin 0.7s linear infinite; display: inline-block; }
@keyframes forum-spin { to { transform: rotate(360deg); } }
.forum-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; }
.forum-pg-btn { padding: 7px 16px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--bg-card); color: var(--text-secondary); font-size: 13px; cursor: pointer; transition: all 0.15s; }
.forum-pg-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.forum-pg-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.forum-pg-info { font-size: 13px; color: var(--text-muted); }
.forum-detail-page { max-width: 900px; margin: 0; padding: 0 0 40px; }
.forum-back-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 13px; font-weight: 500; cursor: pointer; margin-bottom: 20px; padding: 6px 10px 6px 6px; border-radius: 8px; border: none; background: none; transition: background 0.15s, color 0.15s; }
.forum-back-btn:hover { background: var(--border-light); color: var(--text-primary); }
.forum-detail-header { margin-bottom: 20px; }
.forum-detail-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.forum-detail-title { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.35; margin: 0 0 16px; }
.forum-detail-author-row { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.forum-detail-author-info { display: flex; flex-direction: column; }
.forum-detail-author-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.forum-detail-meta { font-size: 12px; color: var(--text-muted); }
.forum-content { font-size: 15px; line-height: 1.7; color: var(--text-primary); word-break: break-word; margin-bottom: 20px; }
.forum-content p { margin: 0 0 12px; }
.forum-content p:last-child { margin-bottom: 0; }
.forum-content img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.forum-content a { color: var(--primary); }
.forum-content ul, .forum-content ol { padding-left: 20px; margin-bottom: 12px; }
.forum-content blockquote { border-left: 3px solid var(--primary); padding-left: 14px; margin: 12px 0; color: var(--text-secondary); }
.forum-content pre { background: var(--border-light); border-radius: 6px; padding: 12px; overflow-x: auto; font-size: 13px; }
.forum-content code { background: var(--border-light); padding: 1px 5px; border-radius: 3px; font-size: 13px; }
.forum-reactions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.forum-react-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--bg-card); font-size: 14px; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.forum-react-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.forum-react-btn.reacted { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.forum-react-btn .r-count { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.forum-react-btn.reacted .r-count { color: var(--primary); }
.forum-react-add { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 20px; border: 1.5px dashed var(--border); background: transparent; font-size: 14px; cursor: pointer; color: var(--text-muted); transition: all 0.15s; position: relative; }
.forum-react-add:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.forum-emoji-picker { position: absolute; bottom: calc(100% + 8px); left: 0; background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; gap: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 100; }
.forum-emoji-opt { font-size: 20px; cursor: pointer; border-radius: 6px; padding: 3px 5px; transition: background 0.1s; }
.forum-emoji-opt:hover { background: var(--border-light); }
.forum-action-bar { display: flex; align-items: center; gap: 10px; padding: 14px 0; border-top: 1.5px solid var(--border); border-bottom: 1.5px solid var(--border); margin-bottom: 28px; flex-wrap: wrap; }
.forum-action-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--bg-card); color: var(--text-secondary); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.forum-action-btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.forum-action-btn.active { border-color: var(--accent-yellow); background: #fffbeb; color: #b45309; }
.forum-action-btn.danger { border-color: var(--accent-red); color: var(--accent-red); }
.forum-action-btn.danger:hover { background: #fef2f2; }
.forum-action-btn.mod-active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.forum-replies-header { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.forum-replies-count { background: var(--border-light); color: var(--text-muted); padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.forum-reply-card { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--border-light); }
.forum-reply-card:last-child { border-bottom: none; }
.forum-reply-body { flex: 1; min-width: 0; }
.forum-reply-author-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.forum-reply-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.forum-reply-time { font-size: 12px; color: var(--text-muted); }
.forum-reply-role { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; }
.forum-role-admin { background: #fef3c7; color: #b45309; }
.forum-role-superadmin { background: #ede9fe; color: #7c3aed; }
.forum-role-premium { background: #d1fae5; color: #065f46; }
.forum-reply-reactions { display: flex; align-items: center; gap: 5px; margin-top: 10px; flex-wrap: wrap; }
.forum-reply-del-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 11px; padding: 3px 6px; border-radius: 4px; transition: all 0.1s; margin-left: auto; }
.forum-reply-del-btn:hover { background: #fef2f2; color: var(--accent-red); }
.forum-reply-form { margin-top: 28px; }
.forum-reply-form-label { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; display: block; }
.forum-reply-textarea { width: 100%; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; resize: vertical; min-height: 100px; color: var(--text-primary); outline: none; transition: border-color 0.15s; box-sizing: border-box; }
.forum-reply-textarea:focus { border-color: var(--primary); }
.forum-reply-submit { margin-top: 10px; background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.forum-reply-submit:hover { background: var(--primary-dark); }
.forum-reply-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.forum-locked-note { background: var(--border-light); border-radius: 8px; padding: 14px 18px; font-size: 14px; color: var(--text-muted); text-align: center; margin-top: 20px; }
.forum-editor-overlay { position: fixed; inset: 0; background: rgba(10,14,39,0.55); z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(3px); }
.forum-editor-modal { background: var(--bg-card); border-radius: 16px; width: 100%; max-width: 920px; height: 88vh; max-height: 720px; display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0,0,0,0.25); overflow: hidden; }
.forum-editor-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.forum-editor-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.forum-editor-heading { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0; }
.forum-editor-close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 6px; transition: background 0.1s, color 0.1s; }
.forum-editor-close:hover { background: var(--border-light); color: var(--text-primary); }
.forum-editor-fields { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.forum-editor-title-input { flex: 1; min-width: 200px; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 15px; font-weight: 600; font-family: inherit; color: var(--text-primary); outline: none; transition: border-color 0.15s; }
.forum-editor-title-input:focus { border-color: var(--primary); }
.forum-editor-title-input::placeholder { font-weight: 400; color: var(--text-muted); }
.forum-editor-cat-select { padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; color: var(--text-secondary); outline: none; transition: border-color 0.15s; background: var(--bg-card); cursor: pointer; min-width: 160px; }
.forum-editor-cat-select:focus { border-color: var(--primary); }
.forum-editor-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.forum-editor-body textarea { flex: 1; border: none; border-bottom: 1px solid var(--border); padding: 18px 24px; font-size: 15px; font-family: inherit; line-height: 1.7; resize: none; outline: none; color: var(--text-primary); background: var(--bg-card); }
.forum-editor-footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; background: var(--bg-card); }
.forum-editor-hint { font-size: 12px; color: var(--text-muted); }
.forum-editor-actions { display: flex; gap: 10px; }
.forum-editor-cancel { padding: 9px 18px; border: 1.5px solid var(--border); border-radius: 8px; background: transparent; color: var(--text-secondary); font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.forum-editor-cancel:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.forum-editor-publish { padding: 9px 22px; border: none; border-radius: 8px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.forum-editor-publish:hover { background: var(--primary-dark); }
.forum-editor-publish:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 600px) {
  .forum-page, .forum-detail-page { padding: 0 0 24px; }
  .forum-detail-title { font-size: 18px; }
  .forum-card { padding: 14px 14px; }
  .forum-editor-modal { height: 95vh; max-height: none; border-radius: 12px; }
  .forum-editor-fields { flex-direction: column; align-items: stretch; }
  .forum-editor-title-input, .forum-editor-cat-select { min-width: 0; width: 100%; }
}

/* ========== COURSE DETAIL MODALS ========== */
.cd-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 10000; display: flex; align-items: center; justify-content: center;
}
.cd-modal {
  background: #fff; border-radius: 14px; width: 440px; max-width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); display: flex; flex-direction: column;
  max-height: 90vh;
}
.cd-modal-wide { width: 560px; }
.cd-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0; flex-shrink: 0;
}
.cd-modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0; }
.cd-modal-close {
  width: 28px; height: 28px; border: none; background: var(--border-light);
  border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}
.cd-modal-close:hover { background: var(--border); }
.cd-modal-body { padding: 16px 24px; overflow-y: auto; flex: 1; }
.cd-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 16px 24px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.cd-field { margin-bottom: 14px; }
.cd-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 5px;
}
.cd-label-hint { font-weight: 400; color: var(--text-muted); }
.cd-input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--text-primary); outline: none;
  box-sizing: border-box; transition: border-color 0.15s;
}
.cd-input:focus { border-color: var(--primary); }
.cd-input-readonly { background: var(--bg-light); color: var(--text-muted); cursor: default; }
.cd-textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--text-primary); outline: none;
  box-sizing: border-box; resize: vertical; line-height: 1.5; transition: border-color 0.15s;
}
.cd-textarea:focus { border-color: var(--primary); }
.cd-select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--text-primary); outline: none;
  background: #fff; cursor: pointer; transition: border-color 0.15s;
}
.cd-select:focus { border-color: var(--primary); }
.cd-btn-primary {
  padding: 8px 20px; border: none; border-radius: 8px; background: var(--text-primary);
  color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background 0.15s;
}
.cd-btn-primary:hover { background: #374151; }
.cd-btn-primary:disabled { opacity: 0.5; cursor: default; }
.cd-btn-secondary {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text-secondary); font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit; transition: background 0.15s;
}
.cd-btn-secondary:hover { background: var(--border-light); }
.cd-error { font-size: 13px; color: var(--accent-red); margin-top: 8px; }
.cd-cover-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cd-cover-preview { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* ========== LESSON EDITOR (le-*) ========== */
.le-overlay {
  position: fixed; inset: 0; z-index: 9999; background: #fff;
  display: flex; flex-direction: column; overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.le-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px; border-bottom: 1px solid #e5e7eb;
  background: #fff; flex-shrink: 0; z-index: 100;
}
.le-topbar-left {
  display: flex; align-items: center; gap: 8px; color: #374151;
  font-size: 14px; font-weight: 500; cursor: pointer; background: none; border: none;
  font-family: inherit;
}
.le-topbar-left:hover { color: #111827; }
.le-topbar-center { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #9ca3af; }
.le-topbar-right { display: flex; align-items: center; gap: 10px; }
.le-btn-view {
  padding: 7px 16px; border: 1px solid #d1d5db; border-radius: 6px;
  background: #fff; color: #374151; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.15s; font-family: inherit;
}
.le-btn-view:hover { background: #f9fafb; }
.le-btn-save {
  padding: 7px 20px; border: none; border-radius: 6px; background: #111827;
  color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s; font-family: inherit;
}
.le-btn-save:hover { background: #1f2937; }
.le-btn-save.saved { background: #059669; }
.le-btn-nav {
  width: 28px; height: 28px; border: 1px solid #e5e7eb; border-radius: 6px;
  background: #fff; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; color: #374151; transition: background 0.12s;
}
.le-btn-nav:hover:not(:disabled) { background: #f3f4f6; }
.le-btn-nav:disabled { opacity: 0.3; cursor: default; }
.le-layout { display: flex; flex: 1; overflow: hidden; }
.le-tree {
  width: 240px; min-width: 240px; border-right: 1px solid #e5e7eb; background: #fafafa;
  overflow-y: auto; display: flex; flex-direction: column;
}
.le-tree-head {
  padding: 14px 16px 10px; border-bottom: 1px solid #e5e7eb; font-size: 12px;
  font-weight: 700; color: #374151; flex-shrink: 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; background: #fff;
}
.le-chapter {
  padding: 10px 16px 4px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: #9ca3af; background: #fafafa; position: sticky; top: 0;
}
.le-lesson-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 16px 7px 20px;
  font-size: 12.5px; color: #374151; cursor: pointer; border-left: 3px solid transparent;
  line-height: 1.4; transition: background 0.1s; text-decoration: none;
}
.le-lesson-item:hover { background: #f3f4f6; }
.le-lesson-item.active { background: #f0fdf4; border-left-color: #059669; color: #111827; font-weight: 600; }
.le-lesson-item.no-video { color: #9ca3af; }
.le-lesson-item.no-video .le-dot { background: #e5e7eb; }
.le-lesson-item.no-video.active { color: #374151; }
.le-dot { width: 6px; height: 6px; border-radius: 50%; background: #d1d5db; flex-shrink: 0; }
.le-lesson-item.active .le-dot { background: #059669; }
.le-settings {
  width: 220px; min-width: 220px; border-left: 1px solid #e5e7eb; background: #fff;
  overflow-y: auto; padding-bottom: 40px;
}
.le-sidebar-tabs { display: flex; border-bottom: 1px solid #e5e7eb; }
.le-sidebar-tab {
  flex: 1; padding: 12px; font-size: 13px; font-weight: 500; color: #6b7280;
  cursor: pointer; text-align: center; border-bottom: 2px solid transparent;
  transition: all 0.15s; background: none; border-top: none; border-left: none;
  border-right: none; font-family: inherit;
}
.le-sidebar-tab.active { color: #111827; border-bottom-color: #111827; }
.le-sidebar-section { padding: 16px; border-bottom: 1px solid #f3f4f6; }
.le-sidebar-section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: #9ca3af; margin-bottom: 12px;
}
.le-radio-group { display: flex; flex-direction: column; gap: 8px; }
.le-radio-option { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: #374151; }
.le-radio-option input[type=radio] { width: 15px; height: 15px; accent-color: #111827; cursor: pointer; }
.le-video-url-input {
  width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px;
  font-size: 12.5px; outline: none; font-family: inherit; box-sizing: border-box; color: #374151;
}
.le-video-url-input:focus { border-color: #111827; }
.le-sidebar-btn {
  width: 100%; padding: 8px 14px; border-radius: 6px; border: 1px solid #d1d5db;
  background: #fff; font-size: 13px; font-weight: 500; color: #374151; cursor: pointer;
  transition: all 0.15s; font-family: inherit; display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
}
.le-sidebar-btn:hover { background: #f9fafb; }
.le-sidebar-btn.danger { color: #dc2626; border-color: #fca5a5; }
.le-sidebar-btn.danger:hover { background: #fef2f2; }
.le-sidebar-btn.active-mode { background: #6366f1; color: #fff; border-color: #6366f1; }
.le-content { flex: 1; overflow-y: auto; background: #fff; }
.le-content-inner { max-width: 780px; margin: 0 auto; padding: 40px 40px 120px; }
.le-title-input {
  font-size: 22px; font-weight: 700; color: #111827; border: none; outline: none;
  width: 100%; margin-bottom: 24px; padding: 0; background: transparent; font-family: inherit;
}
.le-title-input::placeholder { color: #d1d5db; }
.le-video-area {
  background: #f9fafb; border: 2px dashed #e5e7eb; border-radius: 10px;
  margin-bottom: 0; overflow: hidden; position: relative;
}
.le-video-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; gap: 12px;
}
.le-video-placeholder h3 { font-size: 16px; font-weight: 600; color: #374151; margin: 0; }
.le-video-placeholder p { font-size: 13px; color: #9ca3af; text-align: center; margin: 0; }
.le-video-embed-wrapper { position: relative; padding-bottom: 56.25%; height: 0; }
.le-video-embed-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.le-video-remove-btn {
  position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.6); color: #fff;
  border: none; border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer;
  opacity: 0; transition: opacity 0.2s; z-index: 10; font-family: inherit;
}
.le-video-area:hover .le-video-remove-btn { opacity: 1; }
.le-desc-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: #9ca3af; margin: 24px 0 8px; display: block;
}
.le-desc-textarea {
  width: 100%; min-height: 220px; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 14px; font-size: 14px; font-family: inherit; color: #374151; outline: none;
  resize: vertical; line-height: 1.7; box-sizing: border-box; transition: border-color 0.15s;
}
.le-desc-textarea:focus { border-color: #111827; }
.le-toast {
  position: fixed; bottom: 24px; right: 24px; background: #059669; color: #fff;
  padding: 12px 20px; border-radius: 8px; font-size: 13px; font-weight: 500;
  z-index: 10000; opacity: 0; transform: translateY(10px); transition: all 0.3s; pointer-events: none;
}
.le-toast.show { opacity: 1; transform: translateY(0); }
.le-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 10001;
  display: flex; align-items: center; justify-content: center;
}
.le-modal {
  background: #fff; border-radius: 12px; padding: 28px; width: 400px; max-width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.le-modal h3 { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.le-modal p { font-size: 14px; color: #6b7280; margin: 0 0 20px; }
.le-modal-btns { display: flex; gap: 10px; justify-content: flex-end; }
.le-modal-cancel {
  padding: 8px 16px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff;
  font-size: 13px; cursor: pointer; font-family: inherit;
}
.le-modal-danger {
  padding: 8px 20px; border: none; border-radius: 6px; background: #dc2626;
  color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}

/* ── Lesson editor: video area state ── */
.le-video-area.has-video {
  border: none; background: transparent; padding: 0; border-radius: 0;
}

/* ── Lesson editor: contenteditable description ── */
.le-desc-editor { cursor: text; overflow-y: auto; }
.le-desc-editor:empty::before {
  content: attr(data-placeholder); color: #9ca3af; pointer-events: none;
}
.le-desc-editor:focus { border-color: #111827; }

/* ── Lesson editor: reorder mode ── */
.le-lesson-item.reorder-draggable { cursor: grab; }
.le-lesson-item.reorder-draggable:active { cursor: grabbing; opacity: 0.7; }
.le-lesson-item.reorder-draggable:hover { background: #eff6ff; }
.le-sidebar-btn { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; font-size: 13px;
  cursor: pointer; font-family: inherit; color: #374151; }
.le-sidebar-btn:hover { background: #f9fafb; }
.le-sidebar-btn.active { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.le-sidebar-btn.danger { color: #dc2626; border-color: #fecaca; }
.le-sidebar-btn.danger:hover { background: #fef2f2; }
.le-sidebar-section-title { font-size: 11px; font-weight: 600; color: #9ca3af;
  text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 8px; }

/* ══════════════════════════════════════════════════════════════════════════════
   RICH EDITOR (RichEditor.tsx) — ported from lesson-editor.html
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Editor content area ── */
.editor-content {
  outline: none;
  color: #374151;
  padding: 20px 0;
  min-height: 200px;
  font-size: 16px;
  line-height: 1.5;
}
.editor-content:empty::before {
  content: attr(data-placeholder);
  color: #d1d5db;
  pointer-events: none;
}
.editor-content p {
  margin: 0 0 16px;
  line-height: 1.5;
}
.editor-content p:empty { display: none; }
.editor-content h2, .editor-content h3 {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 25px 0 15px;
  line-height: 1.3;
}
.editor-content h1, .editor-content h4 {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 20px 0 6px;
  line-height: 1.3;
}
.editor-content ul, .editor-content ol {
  margin: 0 0 16px;
  padding-left: 24px;
}
.editor-content li { margin-bottom: 4px; line-height: 1.6; }

/* ── Floating toolbar ── */
.floating-toolbar {
  position: fixed;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 5px 7px;
  display: flex;
  gap: 2px;
  align-items: center;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.floating-toolbar.visible {
  opacity: 1;
  pointer-events: all;
}
.toolbar-btn {
  background: none;
  border: none;
  color: #374151;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}
.toolbar-btn:hover { background: #f3f4f6; color: #111827; }
.toolbar-btn.active { background: #eff6ff; color: #2563eb; }
.toolbar-divider {
  width: 1px;
  height: 18px;
  background: #e5e7eb;
  margin: 0 3px;
}

/* ── Slash menu ── */
.slash-menu {
  position: fixed;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  width: 260px;
  z-index: 9999;
  overflow: hidden;
  display: none;
  max-height: 360px;
  overflow-y: auto;
}
.slash-menu.visible { display: block; }
.slash-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.slash-menu-item:hover, .slash-menu-item.selected { background: #f3f4f6; }
.slash-menu-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.slash-menu-text strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}
.slash-menu-text span {
  font-size: 11px;
  color: #9ca3af;
}
.slash-menu-section {
  padding: 6px 12px 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
}
.slash-menu-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 4px 0;
}

/* ── Link tooltip ── */
.link-tooltip {
  position: fixed;
  display: none;
  align-items: center;
  gap: 6px;
  background: #1f2937;
  border-radius: 8px;
  padding: 5px 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 9999;
  max-width: 400px;
}
.link-tooltip.visible { display: flex; }
.link-tooltip-url {
  color: #93c5fd;
  font-size: 12px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: underline;
  cursor: pointer;
}
.link-tooltip-url:hover { color: #bfdbfe; }
.lt-divider {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,0.2);
}
.lt-btn {
  background: none;
  border: none;
  color: #d1d5db;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.lt-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.lt-btn.danger:hover { background: rgba(239,68,68,0.3); color: #fca5a5; }

/* ── Modal overlays (link / image / button / link-embed) ── */
.link-modal-overlay,
.image-modal-overlay,
.btn-modal-overlay,
.link-embed-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.link-modal-overlay.visible,
.image-modal-overlay.visible,
.btn-modal-overlay.visible,
.link-embed-modal-overlay.visible {
  display: flex;
}

/* ── Modal box (used inside rich editor overlays) ── */
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; }
.modal-cancel {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.modal-confirm {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ── Rich editor modal box: scoped overrides ── */
.link-modal-overlay .modal,
.image-modal-overlay .modal,
.btn-modal-overlay .modal,
.link-embed-modal-overlay .modal {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  width: 480px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
}
.link-modal-overlay .modal h3,
.image-modal-overlay .modal h3,
.btn-modal-overlay .modal h3,
.link-embed-modal-overlay .modal h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #111827;
}
.link-modal-overlay .modal p,
.image-modal-overlay .modal p,
.btn-modal-overlay .modal p,
.link-embed-modal-overlay .modal p {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 16px;
}
.link-modal-overlay .modal input,
.image-modal-overlay .modal input,
.btn-modal-overlay .modal input,
.link-embed-modal-overlay .modal input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  margin-bottom: 16px;
  font-family: inherit;
}
.link-modal-overlay .modal input:focus,
.image-modal-overlay .modal input:focus,
.btn-modal-overlay .modal input:focus,
.link-embed-modal-overlay .modal input:focus {
  border-color: #111827;
}

/* Image modal tabs */
.img-modal-tabs { display: flex; gap: 0; margin-bottom: 16px; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.img-modal-tab {
  flex: 1; padding: 8px; font-size: 13px; font-weight: 500;
  background: #fff; border: none; cursor: pointer; color: #6b7280;
  transition: background 0.12s, color 0.12s;
}
.img-modal-tab.active { background: #111827; color: #fff; }
.img-modal-drop {
  border: 2px dashed #e5e7eb; border-radius: 8px; padding: 28px;
  text-align: center; font-size: 13px; color: #9ca3af;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.img-modal-drop:hover { border-color: #9ca3af; background: #f9fafb; }
.img-preview { width: 100%; max-height: 160px; object-fit: cover; border-radius: 6px; margin-bottom: 12px; display: block; }

/* Button color swatches */
.btn-color-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.btn-color-swatch {
  width: 28px; height: 28px; border-radius: 6px; border: 2px solid transparent;
  cursor: pointer; transition: transform 0.1s, border-color 0.1s; padding: 0; flex-shrink: 0;
}
.btn-color-swatch:hover { transform: scale(1.15); }
.btn-color-swatch.selected { border-color: #111827; box-shadow: 0 0 0 2px #fff inset; }
.btn-preview-row { margin-bottom: 16px; }
.btn-preview-link {
  display: inline-block; padding: 9px 22px; border-radius: 7px;
  text-decoration: none; font-weight: 600; font-size: 14px;
}

/* ── Emoji picker ── */
.emoji-picker {
  position: fixed;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  width: 292px;
  z-index: 10001;
  display: none;
  padding: 10px;
}
.emoji-picker.visible { display: block; }
.emoji-picker-search {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  margin-bottom: 8px;
  font-family: inherit;
}
.emoji-picker-search:focus { border-color: #9ca3af; }
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
}
.emoji-btn {
  background: none;
  border: none;
  padding: 5px 2px;
  font-size: 19px;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  text-align: center;
}
.emoji-btn:hover { background: #f3f4f6; }

/* ── Editor images ── */
.editor-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
  display: block;
  cursor: grab;
  transition: opacity 0.15s;
}
.editor-content img:active { cursor: grabbing; }
.editor-content img.img-dragging { opacity: 0.35; }
.editor-content.drag-over {
  background: #eff6ff;
  outline: 2px dashed #3b82f6;
  outline-offset: -3px;
}

/* ── Upload spinner ── */
@keyframes editor-spin { to { transform: rotate(360deg); } }
.upload-spinner {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: editor-spin 0.7s linear infinite;
  vertical-align: middle;
  margin: 8px 0;
}

/* ── Content button (CTA block) ── */
.editor-content a.content-btn {
  display: inline-block;
  padding: 9px 22px;
  background: #111827;
  color: #fff !important;
  border-radius: 7px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 14px;
  margin: 8px 0;
  cursor: default;
}

/* ── Link-embed block ── */
.editor-content a.link-embed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #374151 !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 500;
  background: #f9fafb;
  margin: 6px 0;
}
.editor-content a.link-embed::before {
  content: '🔗';
  font-size: 14px;
}

/* ── Mentions ── */
.editor-content .mention {
  color: #2563eb;
  font-weight: 500;
  background: #eff6ff;
  border-radius: 4px;
  padding: 1px 4px;
}

/* ── Lesson editor: drag reorder insertion line ── */
.le-lesson-item.is-dragging { opacity: 0.4; }

/* ── Undo reorder toast ── */
.le-undo-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #1f2937;
  color: #e5e7eb;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.le-undo-toast.show {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}
.le-undo-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.12s;
}
.le-undo-btn:hover { background: rgba(255,255,255,0.1); color: #bfdbfe; }

/* ═══════════════════════════════════════════════════════════════════════
   Live-Raum — lv- prefix (Next.js React port of live.html)
   ═══════════════════════════════════════════════════════════════════════ */

@keyframes lv-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes lv-spin {
  to { transform: rotate(360deg); }
}

/* ── Root wrapper ─────────────────────────────────────────────────────── */
.lv-root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #fff;
  color: #111827;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ── Join Screen ──────────────────────────────────────────────────────── */
.lv-join-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 20px;
  padding: 24px;
}

.lv-logo {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.5px;
}
.lv-logo span { color: #6366f1; }

.lv-join-screen h1 { font-size: 26px; font-weight: 700; text-align: center; }

.lv-join-desc {
  color: #6b7280;
  font-size: 15px;
  text-align: center;
  max-width: 380px;
  line-height: 1.5;
}

.lv-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.lv-badge-live {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
}

.lv-badge-offline {
  background: rgba(156,163,175,0.1);
  color: #9ca3af;
  border: 1px solid rgba(156,163,175,0.2);
}

.lv-status-badge .lv-dot,
.lv-live-pill .lv-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lv-badge-live .lv-dot { background: #ef4444; }
.lv-badge-offline .lv-dot { background: #6b7280; }
.lv-dot-pulse { animation: lv-pulse 1.5s infinite; }

/* ── Join preview ─────────────────────────────────────────────────────── */
.lv-preview-box {
  width: 320px;
  height: 180px;
  background: #f3f4f6;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid #e5e7eb;
}

.lv-preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.lv-preview-label {
  position: absolute;
  bottom: 10px;
  left: 12px;
  font-size: 12px;
  color: #9ca3af;
}

.lv-preview-controls {
  display: flex;
  gap: 12px;
}

.lv-preview-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.lv-preview-toggle svg { width: 15px; height: 15px; flex-shrink: 0; }
.lv-preview-toggle:hover { background: #f3f4f6; border-color: #d1d5db; }
.lv-preview-toggle.lv-off { color: #6b7280; border-color: rgba(220,38,38,0.3); background: rgba(220,38,38,0.06); }

/* ── Join button & error ──────────────────────────────────────────────── */
.lv-join-btn {
  padding: 12px 32px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.lv-join-btn:hover { background: #4f46e5; }
.lv-join-btn:disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }

.lv-join-error {
  color: #f87171;
  font-size: 14px;
  text-align: center;
}

.lv-back-link {
  font-size: 14px;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s;
}
.lv-back-link:hover { color: #9ca3af; }

/* ── Device selects (pre-join) ────────────────────────────────────────── */
.lv-device-selects {
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lv-device-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lv-device-row label {
  font-size: 12px;
  color: #6b7280;
  width: 100px;
  flex-shrink: 0;
}
.lv-device-row select {
  flex: 1;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #374151;
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
  font-family: inherit;
}
.lv-device-row select:focus { border-color: #6366f1; }

/* ── Room Screen ──────────────────────────────────────────────────────── */
.lv-room-screen {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.lv-room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.lv-brand { font-weight: 700; font-size: 15px; color: #111827; }
.lv-brand span { color: #6366f1; }

.lv-live-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #f87171;
  letter-spacing: 0.5px;
}
.lv-live-pill .lv-dot { background: #ef4444; }

.lv-header-right { display: flex; align-items: center; gap: 10px; }

.lv-rec-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 7px; font-size: 12px; font-weight: 600;
  border: 1px solid #e5e7eb; background: #f9fafb; color: #6b7280;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.lv-rec-btn.lv-recording { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #f87171; }
.lv-rec-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.lv-rec-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.lv-end-btn {
  padding: 5px 14px; border-radius: 7px; background: #ef4444; color: #fff;
  border: none; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background 0.2s; font-family: inherit;
}
.lv-end-btn:hover { background: #dc2626; }

/* ── Room body & video grid ───────────────────────────────────────────── */
.lv-room-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.lv-video-grid {
  flex: 1;
  display: grid;
  gap: 6px;
  padding: 10px;
  background: #f9fafb;
  min-width: 0;
  overflow: hidden;
  align-content: center;
  transition: grid-template-columns 0.3s;
}

/* ── Participant tiles ────────────────────────────────────────────────── */
.lv-participant-tile {
  position: relative;
  background: #f3f4f6;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.2s;
  min-height: 0;
}
.lv-participant-tile.lv-speaking { border-color: #6366f1; }
.lv-participant-tile.lv-pinned   { border-color: #f59e0b; }
.lv-participant-tile video { width: 100%; height: 100%; object-fit: cover; }

.lv-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e5e7eb;
  font-size: 42px;
  font-weight: 700;
  color: #6366f1;
}

.lv-tile-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px 12px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lv-tile-name { font-size: 13px; font-weight: 600; }
.lv-tile-badges { display: flex; gap: 6px; }

.lv-tile-badge {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.lv-tile-badge svg { width: 13px; height: 13px; }
.lv-tile-badge.lv-muted { background: rgba(239,68,68,0.3); color: #fca5a5; }

.lv-screen-tile {
  aspect-ratio: unset;
  grid-column: 1 / -1;
  min-height: 300px;
}

.lv-pin-btn {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.lv-pin-btn svg { width: 14px; height: 14px; }
.lv-participant-tile:hover .lv-pin-btn { display: flex; }

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.lv-sidebar {
  width: 300px;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.lv-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.lv-sidebar-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.lv-sidebar-tab svg { width: 14px; height: 14px; flex-shrink: 0; }
.lv-sidebar-tab.lv-tab-active { color: #111827; border-bottom-color: #6366f1; }

/* ── Participants list ────────────────────────────────────────────────── */
.lv-participants-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.lv-participant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.15s;
}
.lv-participant-row:hover { background: #f3f4f6; }

.lv-p-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #6366f1;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}

.lv-p-name { font-size: 14px; flex: 1; color: #111827; }
.lv-p-role { font-size: 11px; color: #6366f1; font-weight: 600; }
.lv-p-badges { display: flex; gap: 4px; }
.lv-p-badge { font-size: 13px; opacity: 0.7; }

/* ── Chat panel ───────────────────────────────────────────────────────── */
.lv-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lv-chat-msg { display: flex; gap: 8px; }

.lv-chat-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #6366f1;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}

.lv-chat-body .lv-chat-sender { font-size: 12px; font-weight: 600; color: #6b7280; margin-bottom: 3px; }
.lv-chat-body .lv-chat-text   { font-size: 14px; line-height: 1.5; color: #374151; word-break: break-word; }

.lv-chat-input-area {
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.lv-chat-input {
  flex: 1;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 9px 12px;
  color: #111827;
  font-size: 14px;
  outline: none;
  resize: none;
  height: 40px;
  max-height: 120px;
  overflow-y: auto;
  font-family: inherit;
}
.lv-chat-input:focus { border-color: #6366f1; }

.lv-chat-send {
  width: 40px; height: 40px;
  background: #6366f1; border: none; border-radius: 8px;
  color: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; flex-shrink: 0;
}
.lv-chat-send:hover { background: #4f46e5; }

/* ── Device settings panel (in-room) ─────────────────────────────────── */
.lv-device-panel {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px 20px;
  z-index: 150;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.lv-device-panel h3 { font-size: 13px; font-weight: 700; color: #111827; margin-bottom: 2px; letter-spacing: 0.02em; }

.lv-dp-row { display: flex; flex-direction: column; gap: 4px; }
.lv-dp-row label { font-size: 11px; color: #6b7280; }
.lv-dp-row select {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #374151;
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
  width: 100%;
  font-family: inherit;
}
.lv-dp-row select:focus { border-color: #6366f1; }

/* ── Control bar ──────────────────────────────────────────────────────── */
.lv-control-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.lv-ctrl-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  position: relative;
  flex-shrink: 0;
}
.lv-ctrl-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.lv-ctrl-btn:hover { background: #f3f4f6; border-color: #d1d5db; }
.lv-ctrl-btn.lv-ctrl-active { background: #3730a3; border-color: #4f46e5; color: #fff; }
.lv-ctrl-btn.lv-ctrl-active:hover { background: #4338ca; }
.lv-ctrl-btn.lv-ctrl-muted  { background: #dc2626; border-color: #dc2626; color: #fff; }
.lv-ctrl-btn.lv-ctrl-muted:hover { background: #b91c1c; border-color: #b91c1c; }

.lv-ctrl-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  background: #ef4444; border-radius: 999px;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; color: #fff;
}

.lv-ctrl-sep { width: 1px; height: 28px; background: #e5e7eb; margin: 0 2px; }

.lv-leave-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 0 18px;
  height: 46px;
  border-radius: 23px;
  background: rgba(220,38,38,0.12);
  border: 1px solid rgba(220,38,38,0.3);
  color: #f87171;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  font-family: inherit;
}
.lv-leave-btn svg { width: 16px; height: 16px; }
.lv-leave-btn:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

/* ── Loading overlay ──────────────────────────────────────────────────── */
.lv-loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; z-index: 100;
}
.lv-loading-overlay p { color: #6b7280; font-size: 14px; }

.lv-spinner {
  width: 36px; height: 36px;
  border: 3px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: lv-spin 0.8s linear infinite;
}

/* ── Toast ────────────────────────────────────────────────────────────── */
.lv-toast {
  position: fixed;
  bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 10px 20px; font-size: 13px; color: #111827;
  opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 200;
  white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.lv-toast.lv-toast-show { opacity: 1; }

/* ── Scrollbar (lv-root scope) ────────────────────────────────────────── */
.lv-root ::-webkit-scrollbar { width: 5px; }
.lv-root ::-webkit-scrollbar-track { background: transparent; }
.lv-root ::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ── Leave confirm modal ──────────────────────────────────────────────── */
.lv-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
}

.lv-leave-modal {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 16px;
  padding: 32px 28px 24px; max-width: 380px; width: 90%; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.lv-leave-modal-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.lv-leave-modal-icon svg { width: 22px; height: 22px; stroke: #ef4444; }

.lv-leave-modal-title { font-size: 17px; font-weight: 700; color: #111827; margin-bottom: 10px; }
.lv-leave-modal-text  { font-size: 13px; color: #6b7280; line-height: 1.6; margin-bottom: 24px; }
.lv-leave-modal-actions { display: flex; gap: 10px; justify-content: center; }

.lv-leave-cancel {
  flex: 1; height: 42px; border-radius: 10px;
  border: 1px solid #e5e7eb; background: transparent;
  color: #6b7280; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.lv-leave-cancel:hover { border-color: #9ca3af; color: #111827; }

.lv-leave-confirm {
  flex: 1; height: 42px; border-radius: 10px;
  border: none; background: #ef4444;
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.15s; font-family: inherit;
}
.lv-leave-confirm:hover { background: #dc2626; }
