/* =========================================================
   RepoPilot AI — Design System
   Terminal-meets-dashboard aesthetic for repo intelligence
   ========================================================= */

:root {
  --bg: #0D1117;
  --panel: #161B22;
  --panel-raised: #1C2333;
  --border: #2B3245;
  --paper: #F5F1E8;
  --text-dim: #8B8FA3;
  --text-faint: #5C6378;
  --accent: #FF6B35;
  --accent-dim: #C9512A;
  --good: #5EE6C8;
  --warn: #FFD166;
  --bad: #FF6B6B;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 6px;
  --max-width: 1400px;
}
 

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--bg);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(255, 107, 53, 0.07), transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(94, 230, 200, 0.05), transparent 45%);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ---------- Scan line signature element ---------- */
.scanline {
  position: fixed;
  top: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--good), transparent);
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.6);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
}
.scanline.active {
  opacity: 1;
  animation: sweep 1.6s linear infinite;
}
@keyframes sweep {
  0%   { top: -2px; }
  100% { top: 100vh; }
}

/* ---------- Layout shell ---------- */
.shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / Nav ---------- */
.topbar {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--good));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--bg);
}
.brand-tag {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
}
.nav-links {
  display: flex;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
}
.nav-links a:hover { color: var(--paper); text-decoration: none; }

@media (max-width: 640px) {
  .nav-links { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 80px 0 64px;
  text-align: center;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--good);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeUp 0.6s ease both;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  animation: fadeUp 0.6s ease both 0.1s;
}
.hero-title .accent { color: var(--accent); }
.hero-sub {
  color: var(--text-dim);
  font-size: 1.08rem;
  max-width: 580px;
  margin: 0 auto 48px;
  line-height: 1.7;
  animation: fadeUp 0.6s ease both 0.2s;
}

/* ---------- Command prompt input ---------- */
.prompt-box {
  max-width: 680px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.5);
  text-align: left;
}
.prompt-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-raised);
}
.prompt-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.prompt-dot.r { background: #FF5F57; }
.prompt-dot.y { background: #FEBC2E; }
.prompt-dot.g { background: #28C840; }
.prompt-bar-label {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}
.prompt-input-row {
  display: flex;
  align-items: center;
  padding: 18px 18px;
  gap: 10px;
  flex-wrap: wrap;
}
.prompt-prefix {
  font-family: var(--font-mono);
  color: var(--good);
  font-size: 1rem;
  white-space: nowrap;
}
#repo-input {
  flex: 1;
  min-width: 200px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 8px 0;
}
#repo-input::placeholder { color: var(--text-faint); }

.btn-analyze {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-analyze:hover { background: #ff7f52; }
.btn-analyze:active { transform: scale(0.98); }
.btn-analyze:disabled { opacity: 0.5; cursor: not-allowed; }

.prompt-hint {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
  text-align: center;
  margin-top: 16px;
}
.prompt-hint button.example {
  background: none;
  border: none;
  color: var(--good);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* ---------- Status / error ---------- */
.status-line {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 18px;
  min-height: 1.2em;
}
.status-line.error { color: var(--bad); }
.status-line.success { color: var(--good); }

/* ---------- Results ---------- */
#results {
  display: none;
  padding: 24px 0 100px;
}
#results.visible { display: block; animation: fadeUp 0.5s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.repo-banner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.repo-banner h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
}
.repo-banner h2 .owner { color: var(--text-dim); font-weight: 400; }
.repo-banner .repo-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ---------- Section heading ---------- */
.section {
  margin-bottom: 56px;
  animation: fadeUp 0.6s ease both;
}

.section:nth-child(2) { animation-delay: 0.1s; }
.section:nth-child(3) { animation-delay: 0.2s; }
.section:nth-child(4) { animation-delay: 0.3s; }
.section:nth-child(5) { animation-delay: 0.4s; }
.section:nth-child(6) { animation-delay: 0.5s; }
.section:nth-child(7) { animation-delay: 0.6s; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 12px;
}

.section-head::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #ff7b54;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
  background: rgba(255,107,53,0.08);
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255,107,53,0.16);
  flex-shrink: 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--paper);
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  display: none;
}

/* ---------- Stat grid ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 800px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
}

.stat-card {
  background: linear-gradient(135deg, rgba(20,28,52,0.95), rgba(11,18,38,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 28px 24px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,107,53,0.02), rgba(94,230,200,0.01));
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 12px;
  font-weight: 500;
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-sub {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: rgba(245,241,232,0.65);
  margin-top: 12px;
}

/* progress bar for contribution score */
.score-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 16px;
}

.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff7b54, #ffd166, #62f5a6);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(98,245,166,0.2);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Summary / markdown panel ---------- */
.panel {
  background: linear-gradient(135deg, rgba(20,28,52,0.95), rgba(11,18,38,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 32px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,107,53,0.02), rgba(94,230,200,0.01));
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.panel:hover {
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}

.panel:hover::before {
  opacity: 1;
}

.panel.markdown h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 24px 0 16px;
  color: #62f5a6;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.panel.markdown h2:first-child { margin-top: 0; }

.panel.markdown h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 18px 0 12px;
  color: #ff7b54;
  font-weight: 700;
}

.panel.markdown p {
  margin-bottom: 14px;
  color: rgba(245,241,232,0.85);
  line-height: 1.8;
}

.panel.markdown ul {
  margin: 12px 0 16px 24px;
}

.panel.markdown li {
  margin-bottom: 10px;
  line-height: 1.7;
  color: rgba(245,241,232,0.8);
}

.panel.markdown strong {
  color: #62f5a6;
  font-weight: 700;
}

.panel.markdown code {
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.04);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.9em;
  color: #ff7b54;
  border: 1px solid rgba(255,107,53,0.2);
}

/* ---------- Tech stack chart ---------- */
.tech-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tech-bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 70px;
  align-items: center;
  gap: 12px;
}
.tech-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--paper);
}
.tech-track {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 5px;
  overflow: hidden;
}
.tech-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, #ff7b54, #ffd166, #62f5a6);
  box-shadow: 0 0 12px rgba(98,245,166,0.15);
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tech-pct {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: right;
}

/* ---------- Health grid ---------- */
.health-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: start;
}
.health-grid > * {
  min-width: 0;
}
@media (max-width: 1200px) {
  .health-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .health-grid { grid-template-columns: 1fr; }
}

/* ---------- Beginner areas ---------- */
.area-card {
  background: linear-gradient(135deg, rgba(20,28,52,0.95), rgba(11,18,38,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 14px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
}

.area-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.area-card h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #ff7b54;
  margin-bottom: 10px;
  font-weight: 700;
}

.area-files {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #62f5a6;
  margin-bottom: 8px;
}

.area-focus {
  color: rgba(245,241,232,0.7);
  font-size: 0.92rem;
}

.issue-list {
  list-style: none;
  margin-top: 8px;
}
.issue-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.issue-list li:last-child { border-bottom: none; }

/* ---------- Activity bar chart ---------- */
.activity-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 180px;
  margin-bottom: 6px;
  padding: 0 2px;
}
.activity-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}
.activity-bar {
  width: 100%;
  max-width: 20px;
  min-height: 4px;
  flex-shrink: 0;
  border-radius: 3px 3px 0 0;
  background: rgba(255,255,255,0.06);
  transition: height 0.6s ease, background 0.3s ease;
  position: relative;
  cursor: default;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.activity-bar.has-activity {
  background: linear-gradient(180deg, #ff7b54, #ff6b35);
  box-shadow: 0 0 8px rgba(255,123,84,0.3);
}

.activity-bar.peak {
  background: linear-gradient(180deg, #62f5a6, #4ae89d);
  box-shadow: 0 0 14px rgba(98,245,166,0.4);
}
.activity-bar-count {
  position: absolute;
  bottom: 100%;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.activity-bar-col:hover .activity-bar-count { opacity: 1; }
.activity-bar-col:hover .activity-bar { background: var(--good); }

.activity-labels {
  display: flex;
  gap: 4px;
  padding: 0 2px;
  margin-bottom: 18px;
}
.activity-label {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-faint);
}
.activity-label.peak { color: var(--good); font-weight: 700; }

.top-hours {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.top-hours span { color: var(--good); }
.activity-empty {
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 40px 0;
}

/* ---------- Folder explanation (NEW: Interactive Cards) ---------- */
.folder-explanation {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--paper);
}

/* Folder Tree Visualizer */
.folder-tree {
  background: linear-gradient(180deg, rgba(15,22,39,0.94), rgba(12,17,28,0.96));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
}

.folder-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.folder-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(94,230,200,0.12);
  color: var(--good);
  font-size: 0.82rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.tree-path {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.tree-path span {
  display: inline-block;
}

.tree-path .separator {
  color: var(--text-faint);
}

.folder-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.folder-card {
  background: linear-gradient(135deg, rgba(24,35,57,0.96), rgba(12,18,30,0.96));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
}

.folder-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(94,230,200,0.16);
  transition: all 0.25s ease;
}

.folder-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 18px 45px rgba(0,0,0,0.35);
}

.folder-card:hover::before {
  background: #5ee6c8;
  box-shadow: 0 0 18px rgba(94,230,200,0.32);
}

.folder-card-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.folder-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.folder-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--paper);
}

.folder-card-subtitle {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

.folder-description {
  font-family: var(--font-body);
  font-size: 0.86rem;
  color: var(--text-dim);
  line-height: 1.65;
  min-height: 3rem;
}

.folder-badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.folder-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.folder-badge.easy {
  background: rgba(98,245,166,0.12);
  color: #70e38a;
  border: 1px solid rgba(98,245,166,0.24);
}

.folder-badge.medium {
  background: rgba(255,196,61,0.12);
  color: #ffd166;
  border: 1px solid rgba(255,196,61,0.24);
}

.folder-badge.hard {
  background: rgba(255,70,70,0.12);
  color: #ff7373;
  border: 1px solid rgba(255,70,70,0.24);
}

.folder-badge.important {
  background: rgba(255,107,53,0.12);
  color: #ff7b54;
  border: 1px solid rgba(255,107,53,0.24);
}

.folder-details-raw {
  margin-top: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
  padding: 16px 0 16px 0;
}

.folder-details-raw pre {
  margin: 0;
  padding: 18px 20px 20px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-dim);
  background: transparent;
}

/* ---------- Contribution Roadmap (NEW) ---------- */
.roadmap-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.roadmap-timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 30px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--good));
  opacity: 0.3;
}

.roadmap-step {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  padding-left: 60px;
  position: relative;
}

.roadmap-step-indicator {
  position: absolute;
  left: 0;
  top: 20px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
  font-size: 0.85rem;
}

.roadmap-step.done .roadmap-step-indicator {
  background: var(--good);
  border-color: var(--good);
  color: var(--bg);
}

.roadmap-content {
  flex: 1;
  background: linear-gradient(135deg, rgba(20,28,52,0.95), rgba(11,18,38,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 18px 20px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.roadmap-step:hover .roadmap-content {
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 8px 24px rgba(255,107,53,0.15);
}

.roadmap-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--paper);
  margin-bottom: 6px;
}

.roadmap-description {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ---------- Difficulty Meter (NEW) ---------- */
.difficulty-section {
  background: linear-gradient(135deg, rgba(20,28,52,0.95), rgba(11,18,38,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
}

.difficulty-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.difficulty-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--paper);
}

.difficulty-score-display {
  margin-left: auto;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
}

.difficulty-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 16px;
}

.difficulty-fill {
  height: 100%;
  background: linear-gradient(90deg, #62f5a6, #ffd166, #ff7b54);
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(98,245,166,0.2);
  transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.difficulty-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

.difficulty-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.difficulty-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.difficulty-cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.65rem;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.difficulty-cat.possible .difficulty-cat-badge {
  background: rgba(94, 230, 200, 0.1);
  border-color: var(--good);
  color: var(--good);
}

.difficulty-cat.recommended .difficulty-cat-badge {
  background: rgba(255, 107, 53, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.difficulty-cat.advanced .difficulty-cat-badge {
  background: rgba(255, 107, 107, 0.1);
  border-color: var(--bad);
  color: var(--bad);
}

/* ---------- AI Insight Cards (NEW) ---------- */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.insight-card {
  background: linear-gradient(135deg, rgba(20,28,52,0.95), rgba(11,18,38,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.insight-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(135deg, rgba(255,107,53,0.02), rgba(94,230,200,0.01));
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: -1;
}

.insight-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.insight-card:hover::before {
  opacity: 1;
}

.insight-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.insight-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #ff7b54;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  font-weight: 600;
}

.insight-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--paper);
  margin-bottom: 10px;
}

.insight-content {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: rgba(245,241,232,0.7);
  line-height: 1.6;
}

.insight-content strong {
  color: #62f5a6;
}

.insight-card.warning {
  border-color: rgba(255, 107, 107, 0.3);
}

.insight-card.warning .insight-label {
  color: var(--bad);
}

.insight-card.success {
  border-color: rgba(94, 230, 200, 0.3);
}

.insight-card.success .insight-label {
  color: var(--good);
}

/* ---------- Health Dashboard Grid (ENHANCED) ---------- */
.health-dashboard {
  background: linear-gradient(180deg, rgba(20,28,52,0.98), rgba(11,18,38,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
  width: 100%;
  max-width: none;
  margin: 0;
}

.health-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.health-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--paper);
  letter-spacing: -0.01em;
}

.health-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 8px 16px;
  background: rgba(255,107,53,0.08);
  border: 1px solid rgba(255,107,53,0.16);
  border-radius: 999px;
  color: #ff7b54;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---------- Health Sidebar (Right Column) ---------- */
.health-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.ai-insight-panel {
  background: linear-gradient(180deg, rgba(20,28,52,0.98), rgba(11,18,38,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ai-insight-panel h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--paper);
  letter-spacing: -0.01em;
  margin: 0;
}

.ai-insight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,107,53,0.08);
  border: 1px solid rgba(255,107,53,0.16);
  color: #ff7b54;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: fit-content;
}

.ai-insight-summary {
  font-family: var(--font-body);
  color: rgba(245,241,232,0.9);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
}

.ai-insight-section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  font-weight: 500;
  margin-bottom: 12px;
}

.ai-insight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.ai-insight-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  color: rgba(245,241,232,0.75);
  font-size: 0.92rem;
  line-height: 1.5;
}

.ai-insight-list li::before {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(94,230,200,0.12);
  border: 1px solid rgba(94,230,200,0.24);
  border-radius: 50%;
  color: #70e38a;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ai-insight-footer {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.ai-insight-footer > div {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px;
}

.ai-insight-footer .label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
  display: block;
  margin-bottom: 8px;
}

.ai-insight-footer strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--paper);
  letter-spacing: -0.01em;
}

/* ---------- Analytics Mini Card ---------- */
.analytics-mini-card {
  background: linear-gradient(180deg, rgba(20,28,52,0.98), rgba(11,18,38,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.analytics-mini-card:hover {
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}

.analytics-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--paper);
  letter-spacing: -0.01em;
}

.analytics-period {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.analytics-trend {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  text-align: center;
  min-width: 60px;
}

.analytics-trend.positive {
  background: rgba(98,245,166,0.12);
  color: #70e38a;
  border: 1px solid rgba(98,245,166,0.24);
}

.analytics-trend.neutral {
  background: rgba(255,196,61,0.12);
  color: #ffd166;
  border: 1px solid rgba(255,196,61,0.24);
}

.analytics-chart {
  width: 100%;
  height: 56px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.analytics-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.analytics-stat-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.analytics-stat-value {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(245,241,232,0.85);
}

.health-metrics-compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  grid-auto-rows: auto;
}

.health-metric {
  background: linear-gradient(135deg, rgba(20,28,52,0.95), rgba(11,18,38,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
}

.health-metric::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,107,53,0.02), rgba(94,230,200,0.01));
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.health-metric:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}

.health-metric:hover::before {
  opacity: 1;
}

.health-metric.large {
  grid-column: 1 / -1;
  min-height: 160px;
}

.health-metric-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 500;
  margin-bottom: 4px;
}

.health-metric-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3.5vw, 48px);
  color: var(--paper);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.health-metric-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: auto;
}

.health-metric-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff7b54, #ffd166, #62f5a6);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(98,245,166,0.2);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  width: fit-content;
}

.status-chip.low {
  background: rgba(94,230,200,0.12);
  color: #70e38a;
  border-color: rgba(94,230,200,0.24);
}

.status-chip.medium {
  background: rgba(255,196,61,0.12);
  color: #ffd166;
  border-color: rgba(255,196,61,0.24);
}

.status-chip.high {
  background: rgba(255,70,70,0.12);
  color: #ff7373;
  border-color: rgba(255,70,70,0.24);
}



@media (max-width: 1200px) {
  .health-dashboard { padding: 20px; }
}

@media (max-width: 800px) {
  .health-dashboard { padding: 18px; }
}

.health-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--paper);
}

.health-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 6px 12px;
  background: var(--panel-raised);
  border-radius: 12px;
  border: 1px solid var(--border);
}



@media (max-width: 980px) {
  .health-metrics-compact {
    grid-template-columns: 1fr;
  }
  .health-metric.large {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .health-grid {
    grid-template-columns: 1fr;
  }
  .health-grid > * {
    min-width: 0;
  }
}

/* ---------- Loading skeleton ---------- */
.loading-block {
  text-align: center;
  padding: 60px 0;
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 0.9rem;
}
.loading-block .spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* ---------- Foundry IQ Reasoning Trace ---------- */
.trace-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.trace-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(20,28,52,0.95), rgba(11,18,38,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 16px 18px;
  animation: fadeUp 0.4s ease both;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.trace-step.done { 
  border-left: 3px solid #62f5a6;
}
.trace-step:hover {
  border-color: rgba(255,255,255,0.12);
  transform: translateX(4px);
}
.trace-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #62f5a6;
  background: rgba(98,245,166,0.12);
  border: 1px solid rgba(98,245,166,0.24);
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
  margin-top: 2px;
  font-weight: 600;
}

.trace-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--paper);
  margin-bottom: 4px;
}
.trace-detail {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.foundry-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--good);
  background: rgba(94,230,200,0.08);
  border: 1px solid rgba(94,230,200,0.2);
  border-radius: 4px;
  padding: 4px 10px;
  margin-bottom: 14px;
}
.citation-list {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}
.citation-list span {
  display: inline-block;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 8px;
  margin: 3px 4px 3px 0;
  color: var(--accent);
}

/* ---------- Floating recommendation card (premium look) ---------- */
.health-floating-rec {
  --floating-rec-width: 380px;
  --rec-bg: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
  /* Pin to viewport top-right to avoid overlapping dashboard-relative elements */
  position: fixed;
  top: 20px;
  right: 24px;
  width: var(--floating-rec-width);
  max-width: calc(100% - 48px);
  background: var(--rec-bg);
  border: 1px solid rgba(255,255,255,0.03);
  backdrop-filter: blur(6px) saturate(120%);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 10px 40px rgba(2,6,23,0.65);
  z-index: 120;
  transition: transform 180ms ease, opacity 180ms ease;
  opacity: 1;
  transform: none;
}
.health-floating-rec .rec-meta {
  display:flex; justify-content:space-between; gap:8px; align-items:center;
}
.health-floating-rec button {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.health-floating-rec button.primary {
  background: var(--accent);
  color: #fff;
  border: none;
}
.health-floating-rec button.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.04);
  color: var(--paper);
}
.health-floating-rec .rec-timestamp {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Right-side subtle pro tip */
.health-side-note {
  position: absolute;
  top: 72px;
  /* place to left of floating card (uses card width variable) */
  right: calc(var(--floating-rec-width, 380px) + 48px);
  width: 300px;
  z-index: 50;
}
.health-side-note > div {
  background: rgba(255,255,255,0.01);
  border: 1px solid rgba(255,255,255,0.02);
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(2,6,23,0.45);
  color: var(--text-dim);
  font-size: 0.92rem;
}
.health-side-note .pro-title { font-weight:700; color:var(--paper); margin-bottom:6px; }

@media (max-width: 1200px) {
  .health-side-note { display: none; }
  .health-floating-rec { right: 16px; left: auto; width: 320px; }
}
@media (max-width: 760px) {
  .health-floating-rec { position: static; transform: none; opacity:1; width:100%; box-shadow:none; margin-top:12px; }
}

/* Overrides: remove floating UI and make dashboard full-width */
.health-floating-rec, .health-side-note { display: none !important; }
.health-dashboard { width: 100% !important; max-width: none !important; }
/* ─────────────────────────────────────────────────────────────────────────────
   folderTree.css  —  RepoPilot AI Foundry
   Paste this block into your static/css/style.css
   ─────────────────────────────────────────────────────────────────────────────*/

/* ── Container ────────────────────────────────────────────────────────────── */
#folder-explanation {
  font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1;
  padding: 0.25rem 0;
}

/* ── Node wrapper ─────────────────────────────────────────────────────────── */
.ftn-node {
  display: block;
}

/* ── Row (one file/dir line) ──────────────────────────────────────────────── */
.ftn-row {
  display: flex;
  align-items: flex-start;
  padding: 3px 8px 3px 4px;
  border-radius: 6px;
  cursor: default;
  transition: background 0.12s ease;
  outline: none;
}
.ftn-row:hover {
  background: rgba(255, 255, 255, 0.05);
}
.ftn-clickable {
  cursor: pointer;
}
.ftn-row:focus-visible {
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.5);
}

/* ── Indent pipes (vertical connection lines) ─────────────────────────────── */
.ftn-pipe {
  display: inline-block;
  width: 20px;
  flex-shrink: 0;
  position: relative;
  align-self: stretch;
}
.ftn-pipe::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.10);
}

/* ── Horizontal connector (├── / └──) ────────────────────────────────────── */
.ftn-connector {
  display: inline-block;
  width: 20px;
  flex-shrink: 0;
  position: relative;
  align-self: stretch;
}
.ftn-connector::before {
  /* horizontal arm */
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 14px;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}
.ftn-connector::after {
  /* vertical arm going up */
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.10);
}
.ftn-connector.ftn-last::after {
  /* last child: vertical arm stops at mid-row, not full height */
  bottom: auto;
  height: 14px;
}

/* ── Toggle chevron ───────────────────────────────────────────────────────── */
.ftn-toggle {
  width: 14px;
  flex-shrink: 0;
  margin-top: 5px;
  margin-right: 5px;
  font-size: 10px;
  color: #8b9cb0;
  user-select: none;
  font-family: sans-serif;
}

/* ── Icon ─────────────────────────────────────────────────────────────────── */
.ftn-icon {
  width: 20px;
  flex-shrink: 0;
  margin-top: 3px;
  margin-right: 6px;
  font-size: 14px;
  line-height: 1;
  user-select: none;
}

/* ── Label area ───────────────────────────────────────────────────────────── */
.ftn-label {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 6px;
  padding: 3px 0;
  min-width: 0;
}

/* ── File / dir name ──────────────────────────────────────────────────────── */
.ftn-name {
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
}
.ftn-name.ftn-dir {
  color: #60a5fa;        /* blue for directories */
}
.ftn-name.ftn-hidden {
  color: #8b9cb0;        /* muted for dotfiles */
}

/* ── Description text ─────────────────────────────────────────────────────── */
.ftn-desc {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 11.5px;
  color: #8b9cb0;
  white-space: normal;
  word-break: break-word;
}

/* ── Children collapse animation ──────────────────────────────────────────── */
.ftn-children {
  overflow: hidden;
  max-height: 4000px;
  transition: max-height 0.22s ease;
}
.ftn-children.ftn-collapsed {
  max-height: 0 !important;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.ftn-badge {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  vertical-align: middle;
  flex-shrink: 0;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.ftn-badge-entry  { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.ftn-badge-config { background: rgba(251, 191, 36,  0.15); color: #fbbf24; }
.ftn-badge-core   { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.ftn-badge-ai     { background: rgba(251, 113, 133, 0.15); color: #fb7185; }
.ftn-badge-docs   { background: rgba(96,  165, 250, 0.15); color: #60a5fa; }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.ftn-empty {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #8b9cb0;
  padding: 0.5rem 0;
}

/* Give the tree breathing room inside the .panel wrapper */
.folder-panel {
  padding: 20px 24px;
}

/* Folder panel header — item count label */
.ftn-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ftn-header-label {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #8b9cb0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
