/* ── CS_basics & Terminal-inspired Study Design System ── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root, [data-theme="paper"], [data-theme="light"] {
  /* 1. Vintage Old Paper / Warm Parchment Yellow-Brownish Theme (Default) */
  --bg: #f7f1e3;            /* Warm antique paper / parchment background */
  --surface: #ede3cc;       /* Rich parchment card surface */
  --surface-hover: #e4d8be; /* Deepened parchment on hover */
  --surface-active: #dccfb2;/* Pressed vintage card */
  --border: #d4c4a4;        /* Vintage aged edge / sepia ink line */
  --border-subtle: #dfd0b5;
  --border-focus: #9a3412;  /* Terracotta leather focus ring */
  
  --text: #2a2018;          /* Antique espresso typewriter ink */
  --text-muted: #695341;    /* Faded sepia / aged brown ink */
  --text-dim: #947b66;      /* Soft graphite / warm pencil */
  
  --accent: #b45309;        /* Warm antique amber leather */
  --accent-hover: #92400e;  /* Deep saddle brown */
  --accent-dim: rgba(180, 83, 9, 0.12);
  --accent-border: rgba(180, 83, 9, 0.35);
  
  --blue: #1e40af;          /* Classic fountain pen blue */
  --blue-dim: rgba(30, 64, 175, 0.12);
  --amber: #b45309;         /* Antique brass */
  --amber-dim: rgba(180, 83, 9, 0.14);
  --red: #b91c1c;           /* Wax seal crimson */
  --red-dim: rgba(185, 28, 28, 0.12);
  --purple: #7e22ce;
  
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --transition: all 0.15s ease;
}

[data-theme="white"] {
  /* 2. Clean Modern Light White Theme */
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-hover: #f1f5f9;
  --surface-active: #e2e8f0;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: #2563eb;
  
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  
  --accent: #16a34a;
  --accent-hover: #15803d;
  --accent-dim: rgba(22, 163, 74, 0.1);
  --accent-border: rgba(22, 163, 74, 0.3);
  
  --blue: #2563eb;
  --blue-dim: rgba(37, 99, 235, 0.1);
  --amber: #d97706;
  --amber-dim: rgba(217, 119, 6, 0.1);
  --red: #dc2626;
  --red-dim: rgba(220, 38, 38, 0.1);
  --purple: #9333ea;
  
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --transition: all 0.15s ease;
}

[data-theme="dark"] {
  /* 3. Dark Terminal Theme */
  --bg: #0a0a0c;
  --surface: #111116;
  --surface-hover: #181820;
  --surface-active: #20202c;
  --border: #22222c;
  --border-subtle: #191922;
  --border-focus: #3b82f6;
  
  --text: #eaeaea;
  --text-muted: #888899;
  --text-dim: #555566;
  
  --accent: #22c55e;
  --accent-hover: #16a34a;
  --accent-dim: rgba(34, 197, 94, 0.12);
  --accent-border: rgba(34, 197, 94, 0.35);
  
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.12);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --purple: #a855f7;
  
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --transition: all 0.15s ease;
}

/* ── Base Reset ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  background-color: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.2s, color 0.2s;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button {
  font-family: inherit;
  cursor: pointer;
}

::selection {
  background: var(--accent);
  color: #000;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ── Progress Bar ── */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2.5px;
  z-index: 1000;
  background: transparent;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s ease-out;
}

/* ── Layout ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  flex: 1;
}

/* ── Hero Section ── */
.hero {
  text-align: center;
  padding: 3.5rem 1rem 2.5rem;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  margin-bottom: 1.25rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 0.8rem;
  line-height: 1.15;
}

.hero-lede {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 68ch;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: var(--transition);
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #000000;
  border-color: var(--accent);
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #000000;
}

/* ── Stat Strip (from CS_basics) ── */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 2rem 0 3rem;
}

.stat-cell {
  background: var(--surface);
  padding: 1.4rem 1.2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.stat-n {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
  font-feature-settings: 'tnum';
}

.stat-l {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin: 2.5rem 0 1.25rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-link {
  font-size: 0.75rem;
  color: var(--accent);
}
.section-link:hover {
  text-decoration: underline;
}

/* ── Domain Grid ── */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.domain-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.domain-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-color, var(--accent));
  opacity: 0.8;
}

.domain-card:hover {
  border-color: var(--card-color, var(--accent));
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.domain-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.domain-card-icon {
  font-size: 1.6rem;
}

.domain-card-badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--card-color, var(--accent));
  background: var(--surface-active);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.domain-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.domain-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 1.25rem;
}

.domain-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.domain-card-foot strong {
  color: var(--text);
}

/* ── Topic Browser Grid ── */
.topic-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.filter-btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: var(--transition);
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.filter-btn.active {
  background: var(--surface-active);
  color: var(--accent);
  border-color: var(--accent-border);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.1rem;
}

.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.topic-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.topic-card-domain {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.topic-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.topic-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topic-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--surface-active);
  font-size: 0.68rem;
  font-weight: 600;
}
.chip-md { color: #60a5fa; }
.chip-java { color: #f59e0b; }
.chip-sql { color: #ec4899; }
.chip-rs { color: #f97316; }

/* ── Level Selector & Level Badges ── */
.level-selector-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.level-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.level-selector-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.level-pills-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.level-btn {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: inherit;
  user-select: none;
}

.level-btn:hover {
  border-color: var(--text-dim);
  color: var(--text);
  transform: translateY(-1px);
}

.level-btn.active {
  background: var(--surface-active);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.level-btn-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(180, 83, 9, 0.12);
  color: var(--accent);
  font-weight: 700;
}

/* Individual level button accents when active */
.level-btn[data-level="L1"].active {
  border-color: #16a34a;
  box-shadow: 0 0 0 1px #16a34a;
  color: #16a34a;
}
.level-btn[data-level="L1"].active .level-btn-tag {
  background: rgba(22, 163, 74, 0.15);
  color: #16a34a;
}

.level-btn[data-level="L2"].active {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
  color: #2563eb;
}
.level-btn[data-level="L2"].active .level-btn-tag {
  background: rgba(37, 99, 235, 0.15);
  color: #2563eb;
}

.level-btn[data-level="L3"].active {
  border-color: #d97706;
  box-shadow: 0 0 0 1px #d97706;
  color: #d97706;
}
.level-btn[data-level="L3"].active .level-btn-tag {
  background: rgba(217, 119, 6, 0.15);
  color: #d97706;
}

.level-btn[data-level="L4"].active {
  border-color: #b45309;
  box-shadow: 0 0 0 1px #b45309;
  color: #b45309;
}
.level-btn[data-level="L4"].active .level-btn-tag {
  background: rgba(180, 83, 9, 0.15);
  color: #b45309;
}

.level-btn[data-level="Architect"].active {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px #dc2626;
  color: #dc2626;
}
.level-btn[data-level="Architect"].active .level-btn-tag {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
}

/* Level Overview Box */
.level-overview-box {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  margin-top: 1rem;
  animation: fadeIn 0.25s ease-in-out;
}

.level-overview-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.level-overview-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.level-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.level-info-block {
  font-size: 0.8rem;
}

.level-info-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.level-info-value {
  color: var(--text);
  line-height: 1.5;
}

/* Level Badges & Pills */
.level-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  line-height: 1.2;
  border: 1px solid transparent;
}

.level-pill.level-L1 {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.25);
}

.level-pill.level-L2 {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.25);
}

.level-pill.level-L3 {
  background: rgba(217, 119, 6, 0.12);
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.25);
}

.level-pill.level-L4 {
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.25);
}

.level-pill.level-Architect {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
}

.week-level-tags {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-left: auto;
  flex-wrap: wrap;
}

.level-card-link:hover {
  border-color: var(--accent) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ── Language Path Selector & Badges ── */
.lang-btn {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: inherit;
  user-select: none;
}

.lang-btn:hover {
  border-color: var(--text-dim);
  color: var(--text);
  transform: translateY(-1px);
}

.lang-btn.active {
  background: var(--surface-active);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.lang-btn[data-lang="java"].active {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px #f59e0b;
  color: #f59e0b;
}

.lang-btn[data-lang="cpp"].active {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
  color: #3b82f6;
}

.lang-btn[data-lang="rust"].active {
  border-color: #ea580c;
  box-shadow: 0 0 0 1px #ea580c;
  color: #ea580c;
}

/* Language Pill Badges */
.lang-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  line-height: 1.2;
  border: 1px solid transparent;
}

.lang-pill.lang-java {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.25);
}

.lang-pill.lang-cpp {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.25);
}

.lang-pill.lang-rust {
  background: rgba(234, 88, 12, 0.12);
  color: #ea580c;
  border-color: rgba(234, 88, 12, 0.25);
}

.lang-pill.lang-universal {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.25);
}

.week-elective-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-dim);
  border: 1px dashed var(--border);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ── Roadmap View ── */
.roadmap-summary-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
}

.overall-progress-bar {
  height: 9px;
  background: var(--surface-active);
  border-radius: 999px;
  overflow: hidden;
  margin: 1rem 0 0.5rem;
  border: 1px solid var(--border);
}

.overall-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.overall-stats-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.phase-container {
  margin-bottom: 2.5rem;
}

.phase-title-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.phase-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.phase-title {
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1;
}

.phase-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface-active);
  color: var(--text-muted);
}

.week-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-left: 0.75rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--border);
}

.week-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.week-card:hover {
  border-color: var(--text-dim);
}

.week-card.completed {
  border-color: var(--accent-border);
  background: rgba(34, 197, 94, 0.03);
}

.week-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  user-select: none;
}

.week-number-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--surface-active);
  color: var(--accent);
}

.week-card.completed .week-number-pill {
  background: var(--accent);
  color: #000;
}

.week-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
}

.week-toggle-arrow {
  color: var(--text-dim);
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.week-card.open .week-toggle-arrow {
  transform: rotate(90deg);
}

.week-card-body {
  display: none;
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--border);
  background: var(--surface-hover);
  font-size: 0.83rem;
}

.week-card.open .week-card-body {
  display: block;
}

.focus-list {
  list-style: none;
  margin: 0.75rem 0 1rem;
}

.focus-list li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.focus-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.module-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.module-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text);
}

.module-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.week-complete-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
}

.week-complete-checkbox input {
  accent-color: var(--accent);
  cursor: pointer;
  width: 15px;
  height: 15px;
}

/* ── Topic / Doc Viewer (Two Column) ── */
.viewer-layout {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  position: relative;
}

.viewer-sidebar {
  width: 290px;
  flex-shrink: 0;
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.viewer-content-pane {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-muted);
}
.breadcrumb a:hover {
  color: var(--accent);
}

.sidebar-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.tree-list {
  list-style: none;
}

.tree-node {
  margin-bottom: 0.35rem;
}

.tree-folder {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text);
  padding: 0.3rem 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.tree-folder:hover {
  background: var(--surface-hover);
}

.tree-file {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.3rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border-left: 2px solid transparent;
}

.tree-file:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.tree-file.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
  font-weight: 600;
}

.tree-subgroup {
  margin-left: 0.85rem;
  padding-left: 0.65rem;
  border-left: 1px solid var(--border);
  margin-top: 0.25rem;
}

/* ── Markdown & Code Rendering ── */
.doc-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
}

.doc-file-path {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  font-family: inherit;
}

.doc-title {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.rendered-md {
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text);
}

.rendered-md h1, .rendered-md h2, .rendered-md h3, .rendered-md h4 {
  font-weight: 700;
  line-height: 1.35;
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  letter-spacing: -0.02em;
}

.rendered-md h1 { font-size: 1.6rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.rendered-md h2 { font-size: 1.3rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 0.4rem; }
.rendered-md h3 { font-size: 1.1rem; }
.rendered-md h4 { font-size: 0.95rem; }

.rendered-md p {
  margin-bottom: 1.25rem;
  color: var(--text);
}

.rendered-md code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.15em 0.45em;
  border-radius: var(--radius-sm);
  background: var(--surface-active);
  color: var(--accent);
  border: 1px solid var(--border);
}

.rendered-md pre {
  margin: 1.5rem 0;
  padding: 1.2rem;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text);
}

.rendered-md pre code, .code-viewer-body code {
  color: var(--text);
  background: transparent;
}

/* Vintage Old Paper Syntax Highlighting */
:root:not([data-theme="dark"]) .hljs-keyword, [data-theme="light"] .hljs-keyword { color: #9a3412; font-weight: 600; }
:root:not([data-theme="dark"]) .hljs-string, [data-theme="light"] .hljs-string { color: #166534; }
:root:not([data-theme="dark"]) .hljs-title, [data-theme="light"] .hljs-title { color: #1e40af; font-weight: 600; }
:root:not([data-theme="dark"]) .hljs-comment, [data-theme="light"] .hljs-comment { color: #786657; font-style: italic; }
:root:not([data-theme="dark"]) .hljs-number, [data-theme="light"] .hljs-number { color: #b45309; }
:root:not([data-theme="dark"]) .hljs-type, [data-theme="light"] .hljs-type { color: #854d0e; font-weight: 600; }
:root:not([data-theme="dark"]) .hljs-attr, [data-theme="light"] .hljs-attr { color: #1e3a8a; }

.rendered-md table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.83rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.rendered-md th, .rendered-md td {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  text-align: left;
}

.rendered-md th {
  background: var(--surface-active);
  font-weight: 700;
}

.rendered-md tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.rendered-md blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.2rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text);
}

.rendered-md ul, .rendered-md ol {
  margin: 1rem 0 1.25rem 1.6rem;
}

.rendered-md li {
  margin-bottom: 0.4rem;
}

.rendered-md hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.rendered-md img {
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.mermaid {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
  overflow-x: auto;
}

/* ── Search Page ── */
.search-box-wrap {
  max-width: 700px;
  margin: 1rem auto 2.5rem;
}

.search-input-field {
  width: 100%;
  padding: 1rem 1.3rem;
  font-size: 1.05rem;
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.search-input-field:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem 0 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.search-result-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.3rem;
  transition: var(--transition);
}

.search-result-item:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.search-result-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

.search-result-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.search-result-path {
  font-size: 0.78rem;
  color: var(--text-muted);
  word-break: break-all;
}

/* ── About Section (Kartik Chauhan) ── */
.about-section {
  margin: 3.5rem 0 2rem;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  position: relative;
  overflow: hidden;
}

.about-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent) 0%, var(--blue) 50%, var(--purple) 100%);
}

.about-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.about-avatar {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--surface-active);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.12);
  flex-shrink: 0;
}

.about-identity {
  flex: 1;
}

.about-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.about-role {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.about-bio {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.75;
  margin-bottom: 1.75rem;
}

.about-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.about-pillar {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.about-pillar-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.about-pillar-desc {
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.about-tag {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface-active);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.about-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* ── Interactive 3D Flashcards ── */
.flashcards-container {
  max-width: 820px;
  margin: 0 auto;
}

.flashcard-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.flashcard-stat-pill {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.flashcard-stat-pill strong {
  color: var(--text);
}

.flashcard-viewport {
  perspective: 1200px;
  min-height: 420px;
  margin-bottom: 1.5rem;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  min-height: 420px;
  text-align: left;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flashcard-viewport.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.flashcard-back {
  transform: rotateY(180deg);
  background: var(--surface-hover);
  border-color: var(--accent-border);
}

.flashcard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.flashcard-category-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface-active);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.flashcard-difficulty-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.flashcard-question-text {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
  margin: auto 0;
}

.flashcard-answer-text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  margin: 0.5rem 0 auto;
  overflow-y: auto;
  max-height: 280px;
}

.flashcard-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.flashcard-flip-prompt {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  font-weight: 600;
}

.flashcard-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.flashcard-keyboard-hints {
  text-align: center;
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
}

.flashcard-keyboard-hints kbd {
  background: var(--surface-active);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Projects Showcase ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.project-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.project-type-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-active);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.project-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text);
}

.project-card-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.1rem;
  flex: 1;
}

.project-metrics-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: var(--surface-active);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.75rem;
  flex-wrap: wrap;
}

.project-metric {
  color: var(--text-dim);
}
.project-metric strong {
  color: var(--text);
}

.project-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.project-links {
  display: flex;
  gap: 0.6rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

/* ── Engineering Blogs Section ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.blog-card:hover {
  border-color: var(--blue);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.blog-meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.blog-domain-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--blue-dim);
  color: var(--blue);
}

.blog-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
  line-height: 1.35;
}

.blog-card-excerpt {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.1rem;
  flex: 1;
}

.blog-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  font-size: 0.78rem;
}

/* ── Interactive CV / Resume Section ── */
.cv-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
}

.cv-top-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.cv-name {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.cv-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.cv-contact-strip {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.cv-section-block {
  margin-bottom: 2rem;
}

.cv-heading {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cv-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.cv-timeline-item {
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
  position: relative;
}

.cv-timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.cv-role-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.cv-company-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0.6rem;
  display: flex;
  justify-content: space-between;
}

.cv-bullets {
  list-style: none;
  font-size: 0.83rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.cv-bullets li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.4rem;
}

.cv-bullets li::before {
  content: '▪';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.cv-bullets strong {
  color: var(--text);
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: auto;
}

.site-footer a {
  color: var(--text-muted);
}
.site-footer a:hover {
  color: var(--accent);
}

/* ── Bookshelf & Canonical Reading Ecosystem ── */
.bookshelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.book-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.book-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.book-cover-icon {
  font-size: 2.2rem;
  line-height: 1;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.book-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin: 0 0 0.25rem 0;
}

.book-author {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.book-rating {
  font-size: 0.78rem;
  color: var(--amber);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.book-status-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-top: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-read {
  background: rgba(22, 163, 74, 0.15);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.35);
}

[data-theme="paper"] .status-read {
  background: rgba(46, 125, 50, 0.12);
  color: #1b5e20;
  border-color: rgba(46, 125, 50, 0.3);
}

.status-currently_reading {
  background: rgba(180, 83, 9, 0.15);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.status-recommended {
  background: rgba(126, 34, 206, 0.12);
  color: var(--purple);
  border: 1px solid rgba(126, 34, 206, 0.3);
}

.book-progress-wrap {
  margin: 0.75rem 0;
}

.book-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.book-progress-bar {
  height: 6px;
  background: var(--surface-active);
  border-radius: 999px;
  overflow: hidden;
}

.book-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.book-oneliner {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.45;
  margin-bottom: 0.85rem;
  border-left: 2px solid var(--accent-border);
  padding-left: 0.6rem;
}

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

.book-learnings-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem 0;
  flex-grow: 1;
}

.book-learnings-list li {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.45;
  padding: 0.3rem 0;
  border-bottom: 1px dashed var(--border-subtle);
  position: relative;
  padding-left: 1.1rem;
}

.book-learnings-list li:last-child {
  border-bottom: none;
}

.book-learnings-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.book-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

/* ── Thoughts & Tweet-Styled Posts Feed ── */
.thoughts-container {
  max-width: 760px;
  margin: 0 auto;
}

.thought-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
  position: relative;
}

.thought-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.thought-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.thought-author-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.thought-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.thought-author-info {
  display: flex;
  flex-direction: column;
}

.thought-name-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.thought-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.thought-handle {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.thought-role-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--surface-active);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}

.thought-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.thought-body {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.thought-body code {
  background: var(--surface-active);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  color: var(--accent);
}

.thought-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.thought-tag-pill {
  font-size: 0.75rem;
  color: var(--blue);
  background: var(--blue-dim);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.thought-tag-pill:hover {
  background: var(--blue);
  color: #fff;
}

.thought-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.thought-action-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.thought-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-family: inherit;
}

.thought-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.thought-btn.liked {
  color: #e11d48;
}

.thought-btn.active-comments {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── Interactive Comment Thread ── */
.thought-comments-thread {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  display: none;
}

.thought-comments-thread.open {
  display: block;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.comment-bubble {
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  font-size: 0.85rem;
}

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

.comment-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text-dim);
  color: var(--bg);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-author {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
}

.comment-handle {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.comment-time {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-left: auto;
}

.comment-text {
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.comment-form-wrap {
  background: var(--surface-active);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-top: 0.75rem;
  border: 1px solid var(--border);
}

.comment-form-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.comment-input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.comment-input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  outline: none;
  flex: 1;
}

.comment-input:focus {
  border-color: var(--accent);
}

.comment-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  outline: none;
  min-height: 64px;
  resize: vertical;
  margin-bottom: 0.5rem;
}

.comment-textarea:focus {
  border-color: var(--accent);
}

.comment-submit-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

/* ── Toast notification ── */
.toast-msg {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--text);
  color: var(--bg);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.toast-msg.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Spaced Repetition Notification Banner ── */
.spaced-repetition-banner {
  background: var(--surface);
  border: 1px solid var(--accent-border);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  transition: var(--transition);
  position: relative;
}

[data-theme="paper"] .spaced-repetition-banner {
  background: #f1e7d0;
  border-color: #d8c49e;
  border-left-color: var(--accent);
}

.spaced-repetition-banner.reviewed-today {
  border-left-color: #16a34a;
  background: var(--surface);
}

[data-theme="paper"] .spaced-repetition-banner.reviewed-today {
  background: #f1e7d0;
  border-left-color: #16a34a;
}

.spaced-repetition-banner-mini {
  margin: 0.5rem 0 1rem;
}

.spaced-banner-left {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  flex: 1;
  min-width: 280px;
}

.spaced-banner-icon {
  font-size: 1.6rem;
  line-height: 1;
  background: var(--accent-dim);
  padding: 0.45rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.spaced-banner-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.spaced-banner-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.spaced-banner-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.spaced-banner-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.spaced-banner-items {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.spaced-item-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition);
}

.spaced-item-pill:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.spaced-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ── Interactive Study Tracker ── */
.study-tracker-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.tracker-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.tracker-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.tracker-metric-card {
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  text-align: center;
  transition: var(--transition);
}

.tracker-metric-card:hover {
  border-color: var(--accent-border);
}

.tracker-metric-val {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.2rem;
  font-family: var(--font-mono);
}

.tracker-metric-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.phase-progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.phase-progress-item {
  background: var(--surface-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.phase-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
}

.phase-progress-title {
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.phase-progress-percent {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
}

.phase-progress-bar-track {
  height: 7px;
  background: var(--surface-active);
  border-radius: 999px;
  overflow: hidden;
}

.phase-progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.tracker-checklist-wrap {
  margin-top: 1.25rem;
  border-top: 1px dashed var(--border);
  padding-top: 1.25rem;
}

.checklist-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.checklist-filter-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.checklist-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.checklist-items-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  background: var(--surface-hover);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.checklist-items-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.checklist-items-table tr:hover {
  background: var(--surface-hover);
}

.status-badge-btn {
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.status-badge-btn:hover {
  background: var(--surface-active);
}

.status-badge-mastered {
  background: rgba(22, 163, 74, 0.15);
  border-color: rgba(22, 163, 74, 0.4);
  color: #15803d;
}

.status-badge-review {
  background: rgba(180, 83, 9, 0.15);
  border-color: var(--accent-border);
  color: var(--accent);
}

.status-badge-progress {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--blue);
}

.status-badge-unstarted {
  background: var(--surface);
  color: var(--text-dim);
}

/* Session Logger Form */
.session-log-form {
  background: var(--surface-active);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-top: 1rem;
  display: none;
}

.session-log-form.open {
  display: block;
}

/* ── Database Cloud Sync Modal & Badges ── */
.db-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.db-modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalSlideIn 0.2s ease-out;
}

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

.db-modal-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-hover);
}

.db-modal-body {
  padding: 1.4rem;
}

.cloud-status-btn {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
  font-family: inherit;
}

.cloud-status-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.cloud-status-btn.connected {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.35);
  color: #15803d;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .hero h1 { font-size: 2.1rem; }
  .viewer-layout { flex-direction: column; }
  .viewer-sidebar { width: 100%; position: static; max-height: 280px; }
  .viewer-content-pane { padding: 1.4rem; }
  .bookshelf-grid { grid-template-columns: 1fr; }
  .spaced-repetition-banner { flex-direction: column; align-items: stretch; }
  .spaced-banner-actions { justify-content: flex-start; }
}

@media (max-width: 600px) {
  .hero { padding: 2rem 0; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .domain-grid { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: 1fr; }
  .thought-card { padding: 1rem; }
  .tracker-metrics-grid { grid-template-columns: 1fr 1fr; }
}

