:root {
  /* Design Tokens - Dark Theme Default */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-elevated: #243044;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.75);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  --border-hover: rgba(255, 255, 255, 0.15);

  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-inverse: #111827;

  --accent-blue: #3b82f6;
  --accent-blue-subtle: rgba(59, 130, 246, 0.12);
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-purple-subtle: rgba(139, 92, 246, 0.12);
  --accent-green: #10b981;
  --accent-green-subtle: rgba(16, 185, 129, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-subtle: rgba(245, 158, 11, 0.12);
  --accent-red: #ef4444;
  --accent-red-subtle: rgba(239, 68, 68, 0.12);

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.4);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
body.theme-light {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-elevated: #e2e8f0;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);

  --border-color: #e2e8f0;
  --border-focus: #2563eb;
  --border-hover: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --accent-blue: #2563eb;
  --accent-blue-subtle: #eff6ff;
  --accent-purple: #7c3aed;
  --accent-purple-subtle: #f5f3ff;
  --accent-green: #059669;
  --accent-green-subtle: #ecfdf5;
  --accent-amber: #d97706;
  --accent-amber-subtle: #fffbeb;
  --accent-red: #dc2626;
  --accent-red-subtle: #fef2f2;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header & Filter Bar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

.header-content {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-badge {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.pulse-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.9; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.9; }
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Stats Pill Group */
.stats-pill-group {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.4rem;
  gap: 0.25rem;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-value {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.stat-dot.green { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.stat-dot.yellow { background: var(--accent-amber); box-shadow: 0 0 6px var(--accent-amber); }
.stat-dot.purple { background: var(--accent-purple); box-shadow: 0 0 6px var(--accent-purple); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}

.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-xs:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.btn-icon:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 2px;
  cursor: pointer;
  user-select: none;
}

.lang-btn {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.lang-btn:hover {
  color: var(--text-primary);
}

.lang-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 1px 6px rgba(59, 130, 246, 0.4);
}

/* Parent Category Selector */
.parent-category-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-right: 0.6rem;
  border-right: 1px solid var(--border-color);
}

.parent-pill {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.parent-pill:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.parent-pill.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(124, 58, 237, 0.2));
  border-color: rgba(59, 130, 246, 0.6);
  color: #60a5fa;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.theme-dark .icon-moon { display: none; }
.theme-dark .icon-sun { display: block; color: var(--accent-amber); }
.theme-light .icon-moon { display: block; color: var(--accent-purple); }
.theme-light .icon-sun { display: none; }

/* Filter Bar */
.filter-bar {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.4rem 1.5rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.tab-btn.active {
  background: var(--accent-blue-subtle);
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--accent-blue);
}

.tab-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.tab-btn.active .tab-badge {
  background: var(--accent-blue);
  color: white;
}

.search-and-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 0.65rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  padding: 0.4rem 1.8rem 0.4rem 2rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  width: 260px;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  width: 300px;
}

.clear-search {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.status-select-filter {
  padding: 0.4rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}

/* Main Layout */
.main-layout {
  max-width: 1600px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 1.75rem;
  align-items: start;
  flex: 1;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 130px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  padding-right: 0.35rem;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

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

.sidebar-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.toc-group {
  margin-top: 0.5rem;
}

.toc-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.5rem;
}

.toc-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: var(--transition);
}

.toc-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.toc-link.active {
  background: var(--accent-blue-subtle);
  color: var(--accent-blue);
  font-weight: 600;
}

.toc-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.toc-status-indicator.pending { background: #8b5cf6; }
.toc-status-indicator.poc { background: #f59e0b; }
.toc-status-indicator.approved { background: #10b981; }
.toc-status-indicator.discarded { background: #ef4444; }

.quick-summary-card {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.08));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  font-size: 0.78rem;
}

.summary-card-title {
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.summary-card-text {
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.summary-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  border-top: 1px dashed var(--border-color);
  padding-top: 0.4rem;
}

/* Content Area */
.content-area {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Topic Card */
.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  scroll-margin-top: 130px;
}

.topic-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.topic-header {
  padding: 1.5rem;
  background: linear-gradient(to bottom, var(--bg-tertiary), transparent);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.topic-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.topic-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent-blue-subtle);
  color: var(--accent-blue);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.topic-category-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topic-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.topic-question {
  font-size: 1rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Decision Status Selector */
.decision-control {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.decision-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.decision-select {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.decision-select.pending {
  background: var(--accent-purple-subtle);
  color: var(--accent-purple);
  border-color: rgba(139, 92, 246, 0.4);
}
.decision-select.poc {
  background: var(--accent-amber-subtle);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.4);
}
.decision-select.approved {
  background: var(--accent-green-subtle);
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.4);
}
.decision-select.discarded {
  background: var(--accent-red-subtle);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Topic Body Sections */
.topic-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Context / Dilemma Box */
.dilemma-box {
  background: rgba(15, 23, 42, 0.5);
  border-left: 4px solid var(--accent-blue);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.dilemma-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-blue);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dilemma-text {
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.55;
}

/* Section Subheaders */
.sub-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

/* Comparison / Trade-offs Matrix */
.tradeoffs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.tradeoff-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: var(--transition);
}

.tradeoff-card.recommended {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, var(--bg-tertiary) 100%);
}

.tradeoff-badge-rec {
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--accent-green);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.tradeoff-header {
  margin-bottom: 0.75rem;
}

.tradeoff-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.tradeoff-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.tradeoff-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  font-size: 0.78rem;
}

.tradeoff-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tradeoff-row-label {
  color: var(--text-muted);
}

.tradeoff-row-val {
  font-weight: 600;
  font-family: var(--font-mono);
}

.tradeoff-row-val.low { color: var(--accent-green); }
.tradeoff-row-val.medium { color: var(--accent-amber); }
.tradeoff-row-val.high { color: var(--accent-red); }

.tradeoff-pros-cons {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.pro-item {
  color: #34d399;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.con-item {
  color: #f87171;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

/* Diagram Container */
.diagram-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.diagram-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.diagram-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.diagram-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.diagram-viewport {
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, rgba(59, 130, 246, 0.03) 0%, transparent 70%);
  min-height: 280px;
  overflow-x: auto;
}

.diagram-viewport svg {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.diagram-explanation {
  padding: 0.85rem 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* Snippets / Code Tabs */
.code-preview-box {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.code-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.code-preview-body {
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #e2e8f0;
}

/* Team Recommendation Stance Box (Collapsible for Open Discussion) */
.proposal-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-toggle-proposal {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-green);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.btn-toggle-proposal:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(6, 182, 212, 0.15));
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.btn-toggle-proposal svg.chevron-icon {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-toggle-proposal.open svg.chevron-icon {
  transform: rotate(180deg);
}

.recommendation-collapsible {
  display: none;
}

.recommendation-collapsible.open {
  display: flex;
  animation: slideProposal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideProposal {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.recommendation-box {
  width: 100%;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  gap: 1rem;
}

.rec-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.rec-content {
  flex: 1;
}

.rec-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-green);
  margin-bottom: 0.25rem;
}

.rec-text {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* Live Meeting Notes Area */
.meeting-notes-section {
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.meeting-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.notes-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.notes-save-indicator {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.meeting-notes-textarea {
  width: 100%;
  min-height: 64px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  line-height: 1.45;
  resize: vertical;
  transition: var(--transition);
}

.meeting-notes-textarea:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 850px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.diagram-modal-container {
  max-width: 1200px;
  height: 90vh;
}

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

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-title-group p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.btn-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.export-actions-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.export-textarea {
  width: 100%;
  height: 350px;
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  resize: none;
}

.diagram-modal-body {
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}
.diagram-modal-body svg {
  max-width: 100%;
  max-height: 100%;
}

/* Presentation Mode Overlay Styling */
body.presentation-mode {
  --bg-primary: #05070d;
  --bg-card: #0e1422;
}

body.presentation-mode .app-header {
  position: relative;
}

body.presentation-mode .sidebar {
  display: none;
}

body.presentation-mode .main-layout {
  grid-template-columns: 1fr;
  max-width: 1200px;
}

body.presentation-mode .topic-card {
  border-width: 2px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

body.presentation-mode .topic-title {
  font-size: 1.75rem;
}

body.presentation-mode .topic-question {
  font-size: 1.25rem;
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: auto;
}

.footer-shortcuts {
  display: flex;
  gap: 1rem;
}

kbd {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Print Stylesheet */
@media print {
  .app-header, .sidebar, .header-actions, .filter-bar, .decision-control, .meeting-notes-section, .diagram-actions, .app-footer, .btn-xs {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
  .main-layout {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .topic-card {
    page-break-after: always;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    background: white !important;
  }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}

/* Storage Sync Indicator Pill */
.storage-sync-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}

.storage-sync-pill .sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: syncPulse 2.5s infinite ease-in-out;
}

@keyframes syncPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px rgba(16, 185, 129, 0.9); }
}

.storage-sync-pill.saving .sync-dot {
  background-color: var(--accent-amber);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
  animation: syncFastPulse 0.6s infinite alternate;
}

@keyframes syncFastPulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* Hidden Dilemmas Button & Badge */
.btn-hidden-dilemmas {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-hidden-dilemmas.has-hidden {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--accent-amber);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  font-family: var(--font-mono);
  margin-left: 0.35rem;
}

/* Topic Header Actions & Hide Button */
.topic-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  flex-shrink: 0;
}

.btn-hide-dilemma {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.65rem;
  font-size: 0.73rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-hide-dilemma:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Outline Buttons */
.btn-outline-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.btn-outline-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

/* Hidden Dilemmas Modal */
.hidden-modal-container {
  max-width: 900px;
  max-height: 80vh;
}

.hidden-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}

.select-all-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.hidden-btns-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hidden-dilemmas-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.hidden-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}

.hidden-item-row:hover {
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
}

.hidden-item-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.hidden-item-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-blue);
}

.hidden-item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.hidden-item-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hidden-item-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-blue);
}

.hidden-item-cat {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.hidden-item-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hidden-item-status-pill {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.hidden-empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--text-secondary);
}
.hidden-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-lg);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 320px;
  max-width: 480px;
}

.toast.toast-exit {
  animation: toastOut 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

.toast-btn-undo {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #60a5fa;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.toast-btn-undo:hover {
  background: rgba(96, 165, 250, 0.25);
  color: #93c5fd;
}
