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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Roboto', system-ui, sans-serif;
  line-height: 1.6;
  color: #1e293b;
}

.glass-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.glass-card-accent {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 8px 32px 0 rgba(99, 102, 241, 0.1);
}

.tldr-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
  backdrop-filter: blur(10px);
  border-left: 4px solid #10b981;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0.5rem;
}

.fact-highlight {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.2) 100%);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-weight: 600;
}

.citation-box {
  background: rgba(241, 245, 249, 0.9);
  backdrop-filter: blur(5px);
  border-left: 3px solid #3b82f6;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0.375rem;
}

.entity-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0.25rem;
  transition: all 0.2s;
}

.entity-tag:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  transform: translateY(-1px);
}

article {
  max-width: 100%;
  margin: 0 auto;
}

article h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #0f172a;
}

article h2 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #1e293b;
}

article h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #334155;
}

article p {
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  color: #475569;
}

article ul, article ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

article li {
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: 0.5rem;
  color: #475569;
}

article img {
  max-width: 100%;
  height: auto;
  display: block;
}

article a {
  color: #3b82f6;
  text-decoration: underline;
  transition: color 0.2s;
}

article a:hover {
  color: #2563eb;
}

article blockquote {
  border-left: 4px solid #e2e8f0;
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #64748b;
}

article code {
  background: #f1f5f9;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

article pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 2rem 0;
}

article pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.editor-toolbar {
  position: sticky;
  top: 80px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 1rem;
  z-index: 40;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.editor-btn {
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  font-weight: 500;
}

.editor-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.editor-btn.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.fact-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: #10b981;
  color: white;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

.sidebar-panel {
  position: sticky;
  top: 140px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

.transition-smooth {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
  article h1 {
    font-size: 2rem;
  }

  article h2 {
    font-size: 1.5rem;
  }

  article h3 {
    font-size: 1.25rem;
  }

  article p, article li {
    font-size: 1rem;
  }

  .sidebar-panel {
    position: static;
    max-height: none;
  }
}

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

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

.loading-spinner {
  border: 3px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  animation: spin 0.8s linear infinite;
}

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

/* YouTube responsive embed */
.youtube-embed {
  position: relative;
  max-width: 640px;
  margin: 1.5rem auto;
}

.youtube-embed::before {
  content: '';
  display: block;
  padding-top: 56.25%; /* 9/16 — relative to .youtube-embed's own width */
}

.youtube-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0.5rem;
}
