.knowledge-view {
  height: 100%;
  overflow: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-icon {
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 8px var(--accent-cyan));
}

.header-left h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  text-shadow: var(--glow-cyan);
}

.header-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.staged-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  position: relative;
  background: rgba(7, 12, 22, 0.4);
  border: 1px solid rgba(0, 245, 212, 0.1);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(10px);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(0, 245, 212, 0.08), transparent);
  border-bottom: 1px solid var(--border-dim);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  color: var(--accent-cyan);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-btn:not(:disabled):hover {
  background: rgba(0, 245, 212, 0.2);
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.3);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb-item {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.breadcrumb-item:hover {
  color: var(--accent-cyan);
  background: rgba(0, 245, 212, 0.05);
}

.breadcrumb-item.active {
  color: var(--accent-cyan);
  font-weight: 600;
}

.location-tag {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--accent-cyan);
  letter-spacing: 0.15em;
  padding: 4px 12px;
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid rgba(0, 245, 212, 0.2);
  border-radius: 999px;
}

.stage-container {
  flex: 1;
  display: flex;
  gap: 0;
  overflow: hidden;
  position: relative;
}

/* LEFT PANEL - FOLDER LIST */
.folder-column {
  width: 320px;
  height: 100%;
  border-right: 1px solid rgba(0, 245, 212, 0.15);
  display: flex;
  flex-direction: column;
  background: rgba(5, 10, 18, 0.4);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  z-index: 5;
}

.folder-column::-webkit-scrollbar {
  width: 4px;
}

.folder-column::-webkit-scrollbar-thumb {
  background: rgba(0, 245, 212, 0.2);
  border-radius: 2px;
}

.panel-header {
  padding: 20px;
  border-bottom: 1px solid rgba(0, 245, 212, 0.05);
}

.panel-kicker {
  font-family: var(--font-display);
  font-size: 9px;
  color: var(--accent-cyan);
  letter-spacing: 0.2em;
  margin-bottom: 4px;
}

.panel-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.folder-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.folder-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(10, 20, 30, 0.4);
  border: 1px solid rgba(0, 245, 212, 0.1);
  border-radius: 12px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.folder-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-cyan);
  opacity: 0;
  transition: opacity 0.3s;
}

.folder-item:hover {
  background: rgba(0, 245, 212, 0.08);
  border-color: rgba(0, 245, 212, 0.3);
  transform: translateX(4px);
}

.folder-item.active {
  background: linear-gradient(90deg, rgba(0, 245, 212, 0.12), transparent);
  border-color: rgba(0, 245, 212, 0.4);
  box-shadow: 0 0 20px rgba(0, 245, 212, 0.1);
}

.folder-item.active::before {
  opacity: 1;
}

.item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid rgba(0, 245, 212, 0.2);
  border-radius: 10px;
  color: var(--accent-cyan);
  flex-shrink: 0;
  transition: all 0.3s;
}

.folder-item.active .item-icon {
  background: var(--accent-cyan);
  color: var(--bg-dark);
  box-shadow: 0 0 15px var(--accent-cyan);
}

.item-content {
  flex: 1;
  min-width: 0;
}

.item-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

.item-arrow {
  color: var(--accent-cyan);
  opacity: 0.5;
  transition: transform 0.3s;
}

.folder-item.active .item-arrow {
  transform: rotate(90deg);
  opacity: 1;
}

/* RIGHT PANEL - CONTENT SLIDE OUT */
.content-view {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(4, 8, 16, 0.6);
  position: relative;
  overflow-y: auto;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-enter-active,
.content-leave-active {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-enter-from {
  transform: translateX(100%);
  opacity: 0;
}

.content-leave-to {
  transform: translateX(-20px);
  opacity: 0;
}

.content-header {
  padding: 24px;
  background: linear-gradient(180deg, rgba(0, 245, 212, 0.05), transparent);
  border-bottom: 1px solid rgba(0, 245, 212, 0.05);
}

.content-title-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.content-title-group h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.content-grid {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-label span:first-child {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--accent-cyan);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 245, 212, 0.4), transparent);
}

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

.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(10, 20, 30, 0.6);
  border: 1px solid rgba(0, 245, 212, 0.1);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.file-card:hover {
  background: rgba(0, 245, 212, 0.1);
  border-color: rgba(0, 245, 212, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.file-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(10, 15, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.file-details {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

.status-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  text-transform: uppercase;
  border: 1px solid currentColor;
  opacity: 0.8;
}

/* HUD OVERLAY */
.hud-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(0, 5, 10, 0.85);
  backdrop-filter: blur(20px);
}

.hud-container {
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  background: linear-gradient(135deg, rgba(10, 25, 40, 0.95), rgba(5, 10, 20, 0.98));
  border: 1px solid rgba(0, 245, 212, 0.3);
  border-radius: 32px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 100px rgba(0, 245, 212, 0.15), 0 40px 100px rgba(0, 0, 0, 0.8);
  position: relative;
}

.hud-container::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 32px;
  background: radial-gradient(circle at top right, rgba(0, 245, 212, 0.05), transparent 40%);
  pointer-events: none;
}

.hud-header {
  padding: 24px 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 245, 212, 0.1);
}

.hud-title-group h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text-primary);
  text-shadow: var(--glow-cyan);
}

.hud-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.hud-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1px;
  background: rgba(0, 245, 212, 0.1);
  overflow: hidden;
}

.hud-preview-panel,
.hud-chunks-panel {
  background: rgba(5, 10, 20, 0.8);
  padding: 32px;
  overflow-y: auto;
}

.panel-label {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--accent-cyan);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.preview-content {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.chunk-card {
  background: rgba(15, 25, 35, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  transition: all 0.3s;
}

.chunk-card:hover {
  border-color: rgba(0, 245, 212, 0.3);
  background: rgba(0, 245, 212, 0.05);
}

.chunk-index {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--accent-cyan);
  margin-bottom: 8px;
  display: block;
}

.chunk-content {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
}

.close-hud {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.3s;
}

.close-hud:hover {
  background: rgba(255, 71, 87, 0.2);
  border-color: rgba(255, 71, 87, 0.4);
  color: var(--accent-red);
}

/* UTILS */
.empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: var(--text-dim);
  text-align: center;
  padding: 40px;
}

.empty-icon {
  opacity: 0.2;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s;
}

.btn.primary {
  background: var(--accent-cyan);
  border: none;
  color: var(--bg-dark);
}

.btn.primary:hover {
  box-shadow: 0 0 20px rgba(0, 245, 212, 0.4);
  transform: translateY(-1px);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.spin {
  animation: spin 1s linear infinite;
}

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

@media (max-width: 1024px) {
  .hud-body {
    grid-template-columns: 1fr;
  }
  .hud-chunks-panel {
    display: none;
  }
}

@media (max-width: 768px) {
  .folder-column {
    width: 80px;
  }
  .item-content, .item-arrow, .panel-header h2, .panel-kicker {
    display: none;
  }
  .folder-list {
    align-items: center;
  }
  .folder-item {
    justify-content: center;
    padding: 12px;
  }
}
