/* Git Canvas - Premium Dark Theme v2 */
:root {
  --bg-primary: #08080e;
  --bg-secondary: #0e0e18;
  --bg-tertiary: #161622;
  --bg-elevated: #1e1e2e;
  --bg-card: linear-gradient(
    145deg,
    rgba(28, 28, 48, 0.92),
    rgba(16, 16, 28, 0.96)
  );
  --bg-glass: rgba(14, 14, 24, 0.7);

  --accent-primary: #7c3aed;
  --accent-secondary: #a855f7;
  --accent-tertiary: #c084fc;
  --accent-glow: rgba(124, 58, 237, 0.35);
  --accent-gradient: linear-gradient(135deg, #7c3aed, #a855f7, #6d28d9);
  --accent-gradient-3d: linear-gradient(
    180deg,
    #a855f7 0%,
    #7c3aed 40%,
    #5b21b6 100%
  );

  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  --text-primary: #eef2ff;
  --text-secondary: #a1a1b5;
  --text-muted: #5c5c72;

  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-default: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(124, 58, 237, 0.25);
  --border-glass: rgba(255, 255, 255, 0.06);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px var(--accent-glow);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  --sidebar-width: 300px;
}

/* Light Theme Override */
[data-theme="light"] {
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eef0f4;
  --bg-elevated: #e4e6ec;
  --bg-card: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(240, 242, 248, 0.98)
  );

  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #718096;

  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-default: rgba(0, 0, 0, 0.1);
  --border-accent: rgba(124, 58, 237, 0.25);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.15);
}

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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  touch-action: none;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.2);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 58, 237, 0.45);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* App Layout */
#app {
  display: flex;
  height: 100vh;
  background: var(--bg-primary);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(
    180deg,
    rgba(14, 14, 24, 0.98) 0%,
    rgba(10, 10, 16, 0.99) 100%
  );
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 10;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
}

.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(124, 58, 237, 0.15) 0%,
    transparent 30%,
    transparent 70%,
    rgba(124, 58, 237, 0.1) 100%
  );
  pointer-events: none;
}

.sidebar-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(
    180deg,
    rgba(124, 58, 237, 0.06) 0%,
    transparent 100%
  );
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo svg {
  color: var(--accent-secondary);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

/* Repository Selector */
.repo-selector {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.repo-dropdown {
  width: 100%;
  padding: 10px 12px;
  background: rgba(22, 22, 34, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e8a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  box-shadow:
    var(--shadow-inset),
    0 2px 6px rgba(0, 0, 0, 0.2);
}

.repo-dropdown:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow:
    var(--shadow-inset),
    0 0 0 2px rgba(124, 58, 237, 0.15),
    0 0 12px rgba(124, 58, 237, 0.1);
}

.repo-dropdown option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px;
}

/* Clone URL row */
.clone-url-row {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.clone-url-input {
  flex: 1;
  padding: 8px 10px;
  background: rgba(22, 22, 34, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  transition: all var(--transition-fast);
  min-width: 0;
  box-shadow: var(--shadow-inset);
}

.clone-url-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow:
    var(--shadow-inset),
    0 0 0 2px rgba(124, 58, 237, 0.15);
}

.clone-url-input::-moz-placeholder {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.clone-url-input::placeholder {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.clone-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  background: var(--accent-gradient-3d);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow:
    0 2px 8px rgba(124, 58, 237, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.clone-btn:hover {
  background: linear-gradient(180deg, #c084fc 0%, #a855f7 40%, #7c3aed 100%);
  box-shadow:
    0 4px 16px rgba(124, 58, 237, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.clone-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow:
    0 1px 4px rgba(124, 58, 237, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.clone-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.clone-status {
  margin-top: 6px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-family: var(--font-mono);
  animation: fadeIn 150ms ease;
}

.clone-status.cloning {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2);
  color: var(--accent-tertiary);
}

.clone-status.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.clone-status.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.clone-progress-text {
  font-size: 0.66rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clone-progress-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.clone-progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  border-radius: 2px;
  transition: width 300ms ease;
  box-shadow: 0 0 8px var(--accent-glow);
}

.input-group {
  display: flex;
  gap: 4px;
}

.input-group input[type="text"] {
  flex: 1;
  padding: 7px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  transition: all var(--transition-fast);
  min-width: 0;
}

.input-group input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.input-group input[type="text"]::-moz-placeholder {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.input-group input[type="text"]::placeholder {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

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

.btn-icon:active {
  transform: scale(0.95);
}

.btn-primary-sm {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-primary-sm:hover {
  background: var(--accent-secondary);
  box-shadow: 0 0 12px var(--accent-glow);
}

.btn-primary-sm:active {
  transform: scale(0.95);
}

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.btn-ghost:active {
  transform: scale(0.96);
}

.btn-xs {
  padding: 3px 5px !important;
  font-size: 0.65rem !important;
}

/* View Tabs (sidebar) — 3D gradient style */
.view-tabs {
  display: flex;
  padding: 8px 14px;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
}

.view-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  font-size: 0.72rem;
  font-weight: 500;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.view-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.view-tab.active {
  background: var(--accent-gradient-3d);
  color: white;
  box-shadow:
    0 2px 10px rgba(124, 58, 237, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-weight: 600;
}

.view-tab svg {
  flex-shrink: 0;
  opacity: 0.85;
}

/* All Files Toggle */
.view-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-left: auto;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.view-toggle input[type="checkbox"] {
  display: none;
}

.toggle-track {
  position: relative;
  width: 28px;
  height: 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  transition: all var(--transition-fast);
}

.toggle-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 10px;
  height: 10px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.view-toggle input:checked + .toggle-track {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.view-toggle input:checked + .toggle-track .toggle-thumb {
  left: 15px;
  background: white;
}

.toggle-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.view-toggle input:checked ~ .toggle-label {
  color: var(--accent-tertiary);
}

/* Commit Timeline */
.commit-timeline {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 8px;
}

.section-title {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.section-header h3 {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.badge {
  background: var(--bg-elevated);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.timeline-container {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.empty-state p {
  font-size: 0.875rem;
}

/* Commit Item */
.commit-item {
  position: relative;
  padding: 10px 14px;
  margin-bottom: 2px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.commit-item::before {
  display: none;
}

.commit-item:hover {
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--border-subtle);
}

.commit-item.active {
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.08),
    rgba(124, 58, 237, 0.03)
  );
  border-color: rgba(124, 58, 237, 0.2);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.06);
}

.commit-item.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent-gradient-3d);
  border-radius: 1px;
}

.commit-hash {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-tertiary);
  font-weight: 500;
}

.commit-message {
  font-size: 0.82rem;
  color: var(--text-primary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.commit-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.commit-refs {
  display: inline-flex;
  gap: 4px;
  margin-right: 6px;
  vertical-align: middle;
}

.commit-ref-badge {
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.18),
    rgba(124, 58, 237, 0.08)
  );
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: var(--accent-tertiary);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.commit-author {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Canvas Controls */
.sidebar-bottom {
  margin-top: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
}

.canvas-controls {
  padding: 0;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.zoom-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  margin-left: 4px;
}

.zoom-inline input[type="range"] {
  flex: 1;
  -moz-appearance: none;
       appearance: none;
  -webkit-appearance: none;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  cursor: pointer;
}

.zoom-inline input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent-primary);
  border-radius: 50%;
  cursor: pointer;
  -webkit-transition: all var(--transition-fast);
  transition: all var(--transition-fast);
}

.zoom-inline input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 8px var(--accent-glow);
}

#zoomValue {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}

/* Hotkey Legend */
/* ─── Hotkey toggle button + popup ────────────── */
.hotkey-toggle-wrapper {
  position: relative;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.hotkey-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
}

.hotkey-toggle:hover {
  color: var(--text-primary);
  border-color: rgba(147, 130, 255, 0.4);
  background: rgba(147, 130, 255, 0.1);
}

.hotkey-popup {
  display: none;
  position: absolute;
  bottom: 40px;
  left: 0;
  width: 320px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(13, 15, 28, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  z-index: 999;
}

.hotkey-toggle-wrapper:hover .hotkey-popup,
.hotkey-toggle:focus + .hotkey-popup {
  display: block;
}

.hotkey-popup-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(147, 130, 255, 0.7);
  margin-bottom: 10px;
}

.hotkey-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}

.hotkey-grid .hk {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.hotkey-grid .hk kbd {
  display: inline-block;
  padding: 1px 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 18px;
  text-align: center;
}

/* Canvas Area */
.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  background: linear-gradient(
    180deg,
    rgba(14, 14, 24, 0.95) 0%,
    rgba(10, 10, 16, 0.9) 100%
  );
  border-bottom: 1px solid var(--border-subtle);
  height: 38px;
  flex-shrink: 0;
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 5;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.current-commit {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.current-commit .commit-hash-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.current-commit .commit-hash {
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-tertiary);
}

.current-commit span[style] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.78rem;
}

.file-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.file-count svg {
  opacity: 0.5;
}

.btn-sm {
  padding: 4px 8px !important;
  font-size: 0.7rem !important;
  gap: 4px !important;
}

/* Changed Files Panel — Glassmorphism */
.changed-files-panel {
  position: absolute;
  top: 48px;
  right: 10px;
  width: 260px;
  max-height: calc(100% - 60px - 140px);
  background: rgba(14, 14, 24, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow:
    var(--shadow-lg),
    0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 200;
  display: flex;
  flex-direction: column;
  animation: fadeIn 150ms ease;
}

.connections-panel {
  position: absolute;
  top: 48px;
  right: 280px;
  width: 320px;
  max-height: calc(100% - 60px - 140px);
  background: rgba(14, 14, 24, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow:
    var(--shadow-lg),
    0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 200;
  display: flex;
  flex-direction: column;
  animation: fadeIn 150ms ease;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.changed-files-list {
  overflow-y: auto;
  padding: 4px 0;
  max-height: 400px;
}

.changed-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.changed-file-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.changed-file-item .file-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.changed-file-item .file-status.added {
  background: var(--success);
}

.changed-file-item .file-status.modified {
  background: var(--warning);
}

.changed-file-item .file-status.deleted {
  background: var(--error);
}

.changed-file-item .file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

/* Minimap Container */
.minimap-container {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.minimap-expand {
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.minimap-expand:hover {
  opacity: 1;
}

/* Minimap resize handle — invisible, just changes cursor */
.minimap-resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 20;
}

.minimap-resize-handle svg {
  display: none;
}

/* ── Sticky Zoom Controls ── */
body.repo-loading .sticky-zoom-pill,
body.landing-placeholder-visible .sticky-zoom-pill {
  display: none;
}

.sticky-zoom-pill {
  position: absolute;
  bottom: 16px;
  right: 170px;
  /* clear the minimap */
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(15, 12, 25, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 24px;
  z-index: 100;
  opacity: 0.6;
  transition:
    opacity 0.2s ease,
    box-shadow 0.2s ease;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.sticky-zoom-pill:hover {
  opacity: 1;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.15);
}

.sz-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  padding: 0;
}

.sz-btn:hover {
  background: rgba(124, 58, 237, 0.2);
  color: var(--text-primary);
}

.sz-btn:active {
  background: rgba(124, 58, 237, 0.35);
  transform: scale(0.92);
}

.sz-slider {
  width: 70px;
  height: 3px;
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.sz-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #a78bfa;
  cursor: pointer;
  -webkit-transition: transform 0.1s;
  transition: transform 0.1s;
}

.sz-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
  background: #c4b5fd;
}

.sz-value {
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
  line-height: 1;
}

.sz-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 2px;
}

.sz-fit {
  border-radius: 8px;
}

/* Canvas Viewport */
.canvas-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  cursor: default;
  background: radial-gradient(
    circle at center,
    rgba(124, 58, 237, 0.03) 0%,
    transparent 70%
  );
}

/* Spacebar held → canvas pan mode: make cards non-interactive so clicks hit viewport */
.canvas-viewport.space-panning {
  cursor: grab;
}

.canvas-viewport.space-panning .file-card {
  pointer-events: none;
}

.canvas,
.canvas-content {
  position: absolute;
  transform-origin: 0 0;
  min-width: 5000px;
  min-height: 5000px;
}

.canvas-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle,
    var(--border-subtle) 1px,
    transparent 1px
  );
  background-size: 40px 40px;
  pointer-events: none;
  opacity: 0.5;
}

/* File Card */
.file-card {
  position: absolute;
  width: 580px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition:
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    border-color var(--transition-fast);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  cursor: default;
  z-index: 2;
}

.file-card:hover {
  border-color: var(--border-accent);
  box-shadow:
    var(--shadow-md),
    0 0 20px rgba(124, 58, 237, 0.15);
  z-index: 10;
}

.file-card.dragging {
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: scale(1.02);
  z-index: 100;
  border-color: var(--accent-primary);
}

/* Pinned card — stays visible at any zoom */
.file-card[data-pinned="true"] {
  border-color: rgba(251, 146, 60, 0.5);
  box-shadow:
    var(--shadow-md),
    0 0 12px rgba(251, 146, 60, 0.15);
}

.file-card[data-pinned="true"]::before {
  content: "📌";
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 14px;
  z-index: 10;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

.file-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
}

/* Simple file cards (all-files mode) */
.file-card--simple {
  width: 220px;
  max-height: none;
}

.file-card--simple .file-card-header {
  border-bottom: none;
}

.file-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.file-icon.folder {
  color: var(--warning);
}

.file-icon.js {
  color: #f7df1e;
}

.file-icon.ts {
  color: #3178c6;
}

.file-icon.html {
  color: #e34f26;
}

.file-icon.css {
  color: #1572b6;
}

.file-icon.json {
  color: #5bc0de;
}

.file-icon.md {
  color: #083fa1;
}

.file-icon.py {
  color: #3776ab;
}

.file-icon.go {
  color: #00add8;
}

.file-icon.rs {
  color: #ce412b;
}

.file-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card-body {
  padding: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  overflow-y: auto;
  cursor: default;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  /* When card has explicit height from resize, body fills remaining space */
}

/* Styled scrollbar for file preview content (all-files mode) */
.file-content-preview pre::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.file-content-preview pre::-webkit-scrollbar-track {
  background: transparent;
}

.file-content-preview pre::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.18);
  border-radius: 3px;
}

.file-content-preview pre::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 58, 237, 0.4);
}

.file-path {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-card);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-shrink: 0;
}

.file-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.file-card-actions {
  display: flex;
  gap: 4px;
  padding: 6px 12px;
  border-top: 1px solid var(--border-subtle);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.file-card:hover .file-card-actions {
  opacity: 1;
}

/* ─── Diff marker strip (scrollbar annotations) ────── */
.diff-marker-strip {
  position: absolute;
  /* Start below header (36px) + file-path bar (~30px) = 66px */
  top: 66px;
  bottom: 0;
  right: 0;
  width: 18px;
  z-index: 5;
  pointer-events: none;
}

.diff-marker {
  position: absolute;
  right: 2px;
  width: 12px;
  min-height: 5px;
  border-radius: 2px;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0.9;
  transition:
    opacity 0.15s,
    width 0.15s,
    box-shadow 0.15s;
}

.diff-marker--add {
  background: #4ade80;
}

.diff-marker--del {
  background: #f87171;
  width: 6px;
  opacity: 0.75;
}

.diff-marker--add:hover {
  opacity: 1;
  width: 14px;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}

.diff-marker--del:hover {
  opacity: 1;
  width: 12px;
  box-shadow: 0 0 6px rgba(248, 113, 113, 0.6);
}

/* ─── Diff nav inline (▲▼ + count, inside .file-path) ─── */
.diff-nav-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  margin-left: 8px;
}

.diff-nav-btn {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.25);
  color: #4ade80;
  font-size: 8px;
  width: 16px;
  height: 15px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    border-color 0.15s;
  padding: 0;
  line-height: 1;
}

.diff-nav-btn:hover {
  background: rgba(74, 222, 128, 0.3);
  border-color: rgba(74, 222, 128, 0.5);
}

.diff-nav-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #4ade80;
  opacity: 0.7;
}

/* ─── Connection navigation (in file-path bar) ─── */
.conn-nav-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  margin-left: 6px;
}

.conn-nav-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  font-size: 8px;
  width: 16px;
  height: 15px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    border-color 0.15s;
  padding: 0;
  line-height: 1;
}

.conn-nav-btn:hover {
  background: rgba(56, 189, 248, 0.3);
  border-color: rgba(56, 189, 248, 0.5);
}

.conn-nav-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: #38bdf8;
  opacity: 0.8;
  white-space: nowrap;
}

/* ─── Deleted lines indicators ─── */
.has-deleted {
  border-left: 2px solid rgba(248, 113, 113, 0.5);
  position: relative;
}

.has-deleted .line-num {
  cursor: pointer;
  color: #f87171 !important;
  position: relative;
}

.has-deleted .line-num::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #f87171;
  opacity: 0;
  transition: opacity 0.15s;
}

.has-deleted .line-num:hover {
  background: rgba(248, 113, 113, 0.15);
  border-radius: 2px;
}

.has-deleted .line-num:hover::before {
  opacity: 1;
}

/* Deleted lines overlay popup */
.deleted-lines-overlay {
  position: absolute;
  z-index: 50;
  background: rgba(20, 5, 5, 0.95);
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 6px;
  max-width: 500px;
  max-height: 300px;
  overflow: auto;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.5),
    0 0 10px rgba(248, 113, 113, 0.15);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  animation: overlayFadeIn 0.15s ease-out;
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.deleted-overlay-header {
  font-size: 9px;
  color: #f87171;
  padding: 4px 8px;
  background: rgba(248, 113, 113, 0.1);
  border-bottom: 1px solid rgba(248, 113, 113, 0.2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.deleted-lines-overlay pre {
  margin: 0;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.3;
}

.deleted-lines-overlay code {
  font-family: inherit;
}

.del-line-num {
  color: rgba(248, 113, 113, 0.5) !important;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.file-card.resizing {
  transition: none !important;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.file-action {
  flex: 1;
  padding: 4px 8px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-action:hover {
  background: var(--accent-primary);
  color: white;
}

/* File Content Preview Styles */
.file-card-header {
  flex-wrap: wrap;
  gap: 6px;
}

.file-status {
  margin-left: auto;
  flex-shrink: 0;
}

.file-content-preview {
  margin-top: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Space-bar panning mode */
.canvas-viewport.space-panning {
  cursor: grab !important;
}

.canvas-viewport.space-panning:active {
  cursor: grabbing !important;
}

.canvas-viewport.space-panning .file-card {
  pointer-events: none !important;
}

.file-content-preview pre {
  margin: 0;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  line-height: 1.1;
  white-space: pre;
  max-height: 400px;
  overflow: auto;
  overscroll-behavior: contain;
}

.file-content-preview code {
  color: var(--text-secondary);
}

.file-content-preview .line-num {
  color: var(--text-muted);
  opacity: 0.5;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  display: inline-block;
  margin-right: 12px;
}

.file-content-preview .more-lines {
  color: var(--accent-tertiary);
  font-style: italic;
  opacity: 0.8;
}

.file-content-preview .deleted-notice {
  color: var(--error);
  font-style: italic;
  display: block;
  padding: 20px;
  text-align: center;
}

.file-content-preview .error-notice {
  color: var(--warning);
  font-style: italic;
  display: block;
  padding: 20px;
  text-align: center;
}

/* Status-specific card styling */
.file-card--added {
  border-color: rgba(34, 197, 94, 0.3);
}

.file-card--added:hover {
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow:
    var(--shadow-md),
    0 0 20px rgba(34, 197, 94, 0.15);
}

.file-card--modified {
  border-color: rgba(234, 179, 8, 0.3);
}

.file-card--modified:hover {
  border-color: rgba(234, 179, 8, 0.6);
  box-shadow:
    var(--shadow-md),
    0 0 20px rgba(234, 179, 8, 0.15);
}

.file-card--deleted {
  border-color: rgba(239, 68, 68, 0.3);
  opacity: 0.8;
}

.file-card--deleted:hover {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow:
    var(--shadow-md),
    0 0 20px rgba(239, 68, 68, 0.15);
}

.file-card--renamed {
  border-color: rgba(167, 139, 250, 0.3);
}

.file-card--renamed:hover {
  border-color: rgba(167, 139, 250, 0.6);
  box-shadow:
    var(--shadow-md),
    0 0 20px rgba(167, 139, 250, 0.15);
}

.file-card--copied {
  border-color: rgba(96, 165, 250, 0.3);
}

.file-card--copied:hover {
  border-color: rgba(96, 165, 250, 0.6);
  box-shadow:
    var(--shadow-md),
    0 0 20px rgba(96, 165, 250, 0.15);
}

/* ── Card corner status indicators ──
   Colored dots on the top-right corner of each card,
   visible even at low zoom levels. */
.file-card--added::after,
.file-card--modified::after,
.file-card--deleted::after,
.file-card--renamed::after,
.file-card--copied::after,
.file-card--changed::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 0 6px currentColor;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.file-card--added::after {
  background: rgb(34, 197, 94);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.file-card--modified::after {
  background: rgb(234, 179, 8);
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
}

.file-card--deleted::after {
  background: rgb(239, 68, 68);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.file-card--renamed::after {
  background: rgb(167, 139, 250);
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.6);
}

.file-card--copied::after {
  background: rgb(96, 165, 250);
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.6);
}

.file-card--changed::after {
  background: rgb(56, 189, 248);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* Enlarge indicator on card hover for emphasis */
.file-card:hover::after {
  transform: scale(1.4);
}

.file-rename-path {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #a78bfa;
  background: var(--bg-card);
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rename-similarity {
  color: var(--text-muted);
  font-size: 0.6rem;
  margin-left: 4px;
  opacity: 0.7;
}

.rename-notice {
  color: #a78bfa;
  font-style: italic;
  display: block;
  padding: 20px;
  text-align: center;
}

/* Side-by-side modified cards are wider */
.file-card--sidebyside {
  width: 960px;
}

/* Diff line styles */
.diff-line {
  display: block;
  line-height: 1.15;
  white-space: pre;
}

.diff-line.diff-add {
  color: #4ade80;
}

.diff-line.diff-del {
  color: #f87171;
}

.diff-line.diff-ctx {
  color: var(--text-muted);
}

/* Hunk container */
.diff-hunk {
  margin-bottom: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.diff-hunk:last-child {
  margin-bottom: 0;
}

.diff-hunk-header {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent-tertiary);
  background: rgba(124, 58, 237, 0.08);
  padding: 2px 8px;
  border-left: 2px solid var(--accent-primary);
  line-height: 1.2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hunk-range {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hunk-view-toggle {
  display: flex;
  gap: 1px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  padding: 1px;
  flex-shrink: 0;
}

.hunk-toggle-btn {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  padding: 1px 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.hunk-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.hunk-toggle-btn.active {
  background: var(--accent-primary);
  color: white;
}

.hunk-toggle-btn.active[data-view="previous"] {
  background: rgba(239, 68, 68, 0.6);
}

.diff-hunk-body {
  max-height: 300px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  overscroll-behavior: contain;
}

/* When card is resized (has explicit height), let hunks fill available space */
.file-card[style*="height"] .file-content-preview {
  flex: 1;
  overflow: hidden;
}

.file-card[style*="height"] .file-content-preview pre {
  max-height: none;
  flex: 1;
  min-height: 0;
}

.file-card[style*="height"] .diff-hunk-body {
  max-height: none;
  flex: 1;
  overflow: auto;
}

.file-card[style*="height"] .diff-hunk {
  flex: 1;
}

.hunk-pane {
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hunk-pane::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.hunk-pane::-webkit-scrollbar-track {
  background: transparent;
}

.hunk-pane::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.2);
  border-radius: 2px;
}

.diff-hunk pre {
  margin: 0;
  /* Override .file-content-preview pre: panes handle scrolling, not <pre> */
  max-height: none;
  overflow: visible;
  padding: 4px 8px;
}

.diff-hunk code {
  font-size: 0.65rem;
  line-height: 1.15;
}

/* Minimap */
.minimap {
  position: relative;
  width: 180px;
  height: 120px;
  min-width: 100px;
  min-height: 70px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition:
    width 0.05s,
    height 0.05s;
}

.minimap-viewport {
  position: absolute;
  border: 2px solid var(--accent-primary);
  background: rgba(124, 58, 237, 0.1);
  border-radius: 2px;
  pointer-events: none;
}

/* ─── Directory labels (world-space canvas elements) ─── */
.dir-label {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(30, 30, 50, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-secondary, #94a3b8);
  font-size: 11px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  z-index: 1;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  opacity: 0.85;
  transition:
    opacity 0.2s,
    background 0.2s,
    border-color 0.2s;
}

.dir-label:hover {
  opacity: 1;
  background: rgba(124, 58, 237, 0.2);
  border-color: rgba(124, 58, 237, 0.4);
}

.dir-label-icon {
  font-size: 12px;
  filter: grayscale(0.3);
}

.dir-label-count {
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(124, 58, 237, 0.25);
  border-radius: 8px;
  font-size: 10px;
  color: var(--accent-primary, #a78bfa);
  font-weight: 600;
}

/* ─── Group cards (collapsed directories) ─── */
.group-card {
  width: 320px !important;
  max-height: none !important;
  border-color: rgba(124, 58, 237, 0.25);
  background: linear-gradient(
    135deg,
    rgba(40, 30, 60, 0.95),
    rgba(25, 20, 40, 0.95)
  );
}

.group-card:hover {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow:
    var(--shadow-md),
    0 0 24px rgba(124, 58, 237, 0.2);
}

.group-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(124, 58, 237, 0.08);
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
  cursor: pointer;
}

.group-icon {
  font-size: 16px;
  filter: none;
}

.group-meta {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.group-changed {
  font-size: 10px;
  color: #eab308;
  font-weight: 500;
}

.group-expand-btn {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 4px;
  color: var(--accent-tertiary);
  font-size: 10px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.group-expand-btn:hover {
  background: rgba(124, 58, 237, 0.3);
  color: #fff;
}

.group-card-body {
  padding: 10px 14px;
}

.group-dir-path {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.group-file-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.group-file-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  padding: 2px 4px;
  border-radius: 3px;
  transition: background 0.1s;
}

.group-file-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.group-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-file-lines {
  color: var(--text-muted);
  font-size: 9px;
  flex-shrink: 0;
}

.group-more {
  font-size: 10px;
  color: var(--accent-tertiary);
  padding: 4px 4px 0;
  font-style: italic;
}

.minimap-dot {
  position: absolute;
  width: 4px;
  height: 3px;
  border-radius: 1px;
  pointer-events: auto;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.minimap-dot:hover {
  transform: scale(2);
  z-index: 10;
}

.minimap-dot:hover + .minimap-label,
.minimap-dot:hover ~ .minimap-label[data-for-hovered] {
  font-size: 11px !important;
  z-index: 100;
}

.minimap-dot--added {
  background: rgba(34, 197, 94, 0.7);
}

.minimap-dot--modified {
  background: rgba(234, 179, 8, 0.7);
}

.minimap-dot--deleted {
  background: rgba(239, 68, 68, 0.7);
}

.minimap-dot--renamed {
  background: rgba(167, 139, 250, 0.7);
}

.minimap-dot--copied {
  background: rgba(96, 165, 250, 0.7);
}

.minimap-dot--default {
  background: rgba(168, 85, 247, 0.5);
}

.minimap-label {
  position: absolute;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 1px;
  box-sizing: border-box;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Minimap hover tooltip for file names */
.minimap-tooltip {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 200;
  box-shadow: var(--shadow-md);
  transform: translateY(-100%) translateX(-50%);
  margin-top: -4px;
  animation: tooltipIn 0.12s ease-out;
}

@keyframes tooltipIn {
  from {
    opacity: 0;
    transform: translateY(-80%) translateX(-50%);
  }

  to {
    opacity: 1;
    transform: translateY(-100%) translateX(-50%);
  }
}

/* Changed files highlighting in minimap */
.minimap-dot--changed {
  background: rgba(56, 189, 248, 0.9) !important;
  box-shadow: 0 0 4px rgba(56, 189, 248, 0.6);
  animation: minimap-pulse 2s ease-in-out infinite;
}

@keyframes minimap-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* All-files mode: changed file card highlight */
.file-card--changed {
  border-color: rgba(56, 189, 248, 0.5) !important;
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.15),
    var(--shadow-sm);
  z-index: 5;
}

.file-card--changed:hover {
  border-color: rgba(56, 189, 248, 0.8) !important;
  box-shadow:
    0 0 20px rgba(56, 189, 248, 0.25),
    var(--shadow-md);
}

.file-card--changed .file-card-header {
  background: rgba(56, 189, 248, 0.12);
}

/* All-files mode: unchanged file cards stay fully visible —
   changed files are differentiated by diff content + minimap highlight */

/* File Preview Modal */
.file-preview-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.file-preview-modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 92%;
  max-width: 1100px;
  max-height: 85vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    var(--shadow-lg),
    0 0 60px rgba(124, 58, 237, 0.1);
  animation: modalIn 0.2s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
  flex-shrink: 0;
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.modal-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.modal-header .file-path {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0;
  border: none;
  background: none;
  position: static;
}

.modal-line-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-file-status {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Modal view toggle tabs */
.modal-view-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-primary);
  border-radius: 6px;
  padding: 2px;
  border: 1px solid var(--border-subtle);
}

.modal-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}

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

.modal-tab.active {
  color: var(--text-primary);
  background: var(--accent-primary);
  box-shadow: 0 1px 3px rgba(124, 58, 237, 0.3);
}

.modal-tab svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.modal-tab.active svg {
  opacity: 1;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.modal-body {
  padding: 20px;
  flex: 1;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-user-select: auto;
     -moz-user-select: auto;
          user-select: auto;
  cursor: text;
  min-height: 0;
}

.modal-body .line-num {
  color: var(--text-muted);
  opacity: 0.5;
  display: inline-block;
  margin-right: 16px;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  min-width: 3em;
  text-align: right;
}

.modal-body .diff-line.diff-add {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.08);
}

.modal-body .diff-line.diff-del {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
}

.modal-body .diff-line {
  display: block;
  padding: 1px 8px;
  line-height: 1.5;
}

.modal-body .diff-hunk-header-line {
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 3px;
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  padding: 12px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease-out;
}

.toast.error {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.toast.success {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }

  .sidebar.open {
    transform: translateX(0);
  }
}

/* ─── Canvas Mode Toolbar ─────────────────────────── */
.canvas-mode-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.canvas-mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 10px;
  font-family: var(--font-mono);
}

.canvas-mode-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border-default);
}

.canvas-mode-btn.active {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-tertiary);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.2);
}

.canvas-mode-btn span {
  font-size: 9px;
  opacity: 0.5;
  font-weight: 600;
}

.mode-indicator {
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}

.mode-indicator strong {
  color: var(--accent-tertiary);
  font-weight: 600;
}

.mode-indicator strong[data-mode="connect"] {
  color: var(--warning);
}

.mode-indicator strong[data-mode="select"] {
  color: var(--info);
}

.mode-indicator strong[data-mode="resize"] {
  color: var(--success);
}

/* ─── Card states ─────────────────────────────────── */
.file-card.selected {
  outline: 3px solid var(--accent-primary);
  outline-offset: 3px;
  box-shadow:
    0 0 24px rgba(124, 58, 237, 0.4),
    0 0 8px rgba(124, 58, 237, 0.3);
  z-index: 50 !important;
}

.file-card.resizing {
  outline: 2px dashed var(--success);
  outline-offset: 2px;
}

.file-card.resizing * {
  pointer-events: none;
}

/* Corner resize visual hint (bottom-right) */
.file-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  background: linear-gradient(
    135deg,
    transparent 50%,
    rgba(124, 58, 237, 0.25) 50%
  );
  border-radius: 0 0 var(--radius-md) 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 10;
}

.file-card:hover::after {
  opacity: 1;
}

/* No special cursor on header — card is draggable from everywhere */

/* ─── Line selection & connections ─────────────────── */
.diff-line.line-selected {
  background: rgba(124, 58, 237, 0.25) !important;
  border-left: 3px solid var(--accent-primary) !important;
  padding-left: 5px;
}

.diff-line.line-connected {
  background: rgba(124, 58, 237, 0.12) !important;
  cursor: pointer;
}

.diff-line.line-connected:hover {
  background: rgba(124, 58, 237, 0.25) !important;
}

.diff-line.line-flash {
  animation: lineFlash 1.5s ease-out;
}

@keyframes lineFlash {
  0% {
    background: rgba(124, 58, 237, 0.5);
  }

  100% {
    background: transparent;
  }
}

/* Connect mode cursor on lines */
[style*="cursor: crosshair"] .diff-line {
  cursor: crosshair;
}

/* More lines truncation notice — auto-loads on scroll */
.more-lines {
  display: block;
  text-align: center;
  color: var(--accent-tertiary);
  font-size: 11px;
  padding: 12px 8px;
  font-style: italic;
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(to bottom, transparent, rgba(124, 58, 237, 0.05));
  cursor: default;
}

/* ─── SVG connection overlay ──────────────────────── */
#connectionOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  overflow: visible;
}

#connectionOverlay path {
  pointer-events: stroke;
  cursor: pointer;
  transition:
    opacity var(--transition-fast),
    stroke-width var(--transition-fast);
}

#connectionOverlay path:hover {
  opacity: 1 !important;
  stroke-width: 3 !important;
  filter: drop-shadow(0 0 6px var(--accent-primary));
}

/* ─── Connect button in card header ──────────────── */
.connect-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: grab;
  transition: all var(--transition-fast);
  padding: 0;
  flex-shrink: 0;
  opacity: 0;
}

.file-card:hover .connect-btn {
  opacity: 1;
}

.connect-btn:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: scale(1.1);
}

.connect-btn:active {
  cursor: grabbing;
  transform: scale(0.95);
}

/* Card states for connection drag */
.file-card.connecting {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: 0 0 25px rgba(124, 58, 237, 0.3);
}

.file-card.connect-target {
  outline: 2px dashed var(--success);
  outline-offset: 3px;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.3);
  transform: scale(1.02);
  transition: all 0.15s ease;
}

/* ─── Connection Dialog ──────────────────────────── */
.connection-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.connection-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-width: 480px;
  max-width: 600px;
  box-shadow:
    var(--shadow-lg),
    0 0 40px rgba(124, 58, 237, 0.15);
}

.connection-dialog h3 {
  margin: 0 0 20px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-dialog h3::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 16px;
  background: var(--accent-primary);
  border-radius: 2px;
}

.conn-dialog-row {
  display: flex;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 16px;
}

.conn-dialog-file {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.conn-dialog-file > label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.conn-file-name {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
  margin-bottom: 10px;
}

.conn-line-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.conn-line-range label {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 32px;
}

.conn-line-range input {
  width: 60px;
  padding: 4px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font-mono);
  text-align: center;
}

.conn-line-range input:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.conn-line-range span {
  color: var(--text-muted);
  font-size: 12px;
}

.conn-dialog-arrow {
  display: flex;
  align-items: center;
  color: var(--accent-primary);
  padding: 0 4px;
}

.conn-dialog-comment {
  margin-bottom: 20px;
}

.conn-dialog-comment label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.conn-dialog-comment input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  box-sizing: border-box;
}

.conn-dialog-comment input:focus {
  border-color: var(--accent-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.conn-dialog-comment input::-moz-placeholder {
  color: var(--text-muted);
}

.conn-dialog-comment input::placeholder {
  color: var(--text-muted);
}

.conn-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-secondary {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.btn-primary {
  padding: 8px 16px;
  background: var(--accent-primary);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
}

/* ─── Loading Overlay ─────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

.loading-overlay.active {
  display: flex;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 20px var(--accent-glow);
}

.loading-message {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.loading-sub {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  max-width: 400px;
  word-break: break-all;
}

.loading-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 360px;
}

.loading-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.loading-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.loading-stat-value {
  font-size: 1rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-weight: 700;
}

.loading-progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  margin-top: 8px;
}

.loading-progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.loading-progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  border-radius: 3px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--accent-glow);
  position: relative;
}

.loading-progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

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

.loading-progress-text {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  font-weight: 600;
  min-width: 70px;
  text-align: right;
  white-space: nowrap;
}

.file-image-preview {
  background: radial-gradient(
    ellipse at center,
    rgba(124, 58, 237, 0.05) 0%,
    transparent 70%
  );
}

.file-image-preview img {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
  pointer-events: none;
}

.file-image-preview img:hover {
  transform: scale(1.02);
}

.file-image-preview img {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.file-image-preview img:hover {
  transform: scale(1.02);
}

.file-media-preview video,
.file-media-preview audio {
  pointer-events: none;
}

/* ─── Hidden Files Modal ─────────────────────────── */

/* ─── Sync Controls ───────────────────────────────── */
.sync-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-primary);
  font-size: 12px;
}

.sync-controls-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-server-select {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sync-server-select label {
  color: var(--text-muted);
  font-size: 11px;
}

.sync-server-select select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--text-primary);
  font-size: 11px;
  cursor: pointer;
  max-width: 180px;
}

.sync-btn-icon {
  background: var(--accent-primary);
  border: none;
  border-radius: 4px;
  width: 20px;
  height: 20px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.sync-btn-icon:hover {
  background: var(--accent-secondary);
}

.sync-auto-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sync-auto-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.sync-auto-toggle label {
  color: var(--text-primary);
  font-size: 11px;
  cursor: pointer;
}

.sync-buttons {
  display: flex;
  gap: 6px;
}

.sync-btn {
  padding: 4px 10px;
  border-radius: 4px;
  border: none;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sync-btn-push {
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  color: white;
}

.sync-btn-push:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.sync-btn-pull {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}

.sync-btn-pull:hover:not(:disabled) {
  background: var(--bg-card);
}

.sync-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--border-primary);
}

.sync-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.sync-status-dot.synced {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.sync-status-text {
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}

/* ─── Role Badge ──────────────────────────────────── */
.role-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  transition: all 0.2s ease;
  margin-right: 12px;
}

.role-badge--leader {
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.15),
    rgba(59, 130, 246, 0.15)
  );
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.role-badge--leader:hover {
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.25),
    rgba(59, 130, 246, 0.25)
  );
  box-shadow: 0 0 16px var(--accent-glow);
}

.role-badge--follower {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-primary);
  color: var(--text-muted);
}

.role-badge--follower:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-muted);
}

.role-badge-icon {
  font-size: 16px;
  line-height: 1;
}

.role-badge-text {
  font-size: 13px;
  font-weight: 700;
}

.role-badge-sub {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-badge--follower .clone-to-edit-btn {
  margin-left: 8px;
  padding: 4px 10px;
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.role-badge--follower .clone-to-edit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.5);
}

.hidden-files-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.hidden-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(4px);
}

.hidden-modal-content {
  position: relative;
  width: 500px;
  max-height: 70vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hidden-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.hidden-modal-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hidden-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hidden-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--transition-fast);
}

.hidden-modal-close:hover {
  color: var(--text-primary);
}

.hidden-modal-body {
  overflow-y: auto;
  padding: 8px;
  flex: 1;
}

.hidden-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.hidden-file-row:hover {
  background: var(--bg-tertiary);
}

.hidden-file-path {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.btn-restore {
  background: none;
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.btn-restore:hover {
  color: var(--accent-tertiary);
  border-color: var(--accent-primary);
  background: rgba(124, 58, 237, 0.1);
}

/* Folder bulk-hide section */
.hidden-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 12px 4px;
}

.hidden-folder-list {
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 4px;
}

.hidden-folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.hidden-folder-row:hover {
  background: var(--bg-tertiary);
}

.hidden-folder-path {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.hidden-folder-count {
  color: var(--text-muted);
  font-size: 0.68rem;
  margin-left: 6px;
}

.btn-hide-folder {
  background: none;
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.btn-hide-folder:hover:not(.btn-disabled) {
  color: var(--warning);
  border-color: var(--warning);
  background: rgba(234, 179, 8, 0.1);
}

.btn-hide-folder.btn-disabled {
  opacity: 0.4;
  cursor: default;
}

/* Selected card highlight */
.file-card.selected {
  border-color: var(--accent-primary);
  box-shadow:
    0 0 0 2px var(--accent-glow),
    var(--shadow-md);
}

/* Resizing card */
.file-card.resizing {
  opacity: 0.9;
  border-color: var(--accent-secondary);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Selection rectangle on canvas */
.selection-rect {
  position: absolute;
  border: 1.5px dashed var(--accent-primary);
  background: rgba(124, 58, 237, 0.08);
  pointer-events: none;
  z-index: 500;
  border-radius: 3px;
}

/* Arrange toolbar */
.arrange-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  animation: fadeIn 150ms ease;
}

.arrange-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 2px;
}

.arrange-toolbar .btn-ghost {
  padding: 3px 5px;
}

.arrange-toolbar .btn-ghost:hover {
  background: var(--accent-primary);
  color: white;
}

/* Card resize handle visual hint at bottom-right corner */
.file-card::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--border-subtle);
  border-bottom: 2px solid var(--border-subtle);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.file-card:hover::after {
  opacity: 0.5;
}

/* Right-click context menu */
.card-context-menu {
  position: fixed;
  z-index: 9999;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow:
    var(--shadow-lg),
    0 0 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  padding: 4px;
  animation: fadeIn 0.1s ease-out;
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

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

.ctx-item svg {
  opacity: 0.6;
  flex-shrink: 0;
}

.ctx-item:hover svg {
  opacity: 1;
}

.ctx-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 8px;
}

/* Nested dropdown submenu */
.ctx-dropdown {
  position: relative;
  cursor: default;
}

.ctx-dropdown-content {
  display: none;
  position: absolute;
  left: 100%;
  top: -4px;
  min-width: 160px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow:
    var(--shadow-lg),
    0 0 30px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  padding: 4px;
  z-index: 10000;
}

.ctx-dropdown:hover > .ctx-dropdown-content {
  display: block;
}

/* File history panel */
.file-history-panel {
  position: absolute;
  top: 44px;
  right: 8px;
  width: 320px;
  max-height: calc(100% - 56px - 140px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  animation: fadeIn 150ms ease;
}

.file-history-list {
  overflow-y: auto;
  padding: 4px 0;
  max-height: 500px;
}

.file-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
  font-size: 0.75rem;
}

.file-history-item:hover {
  background: var(--bg-tertiary);
}

.file-history-hash {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-tertiary);
  font-weight: 500;
  flex-shrink: 0;
}

.file-history-msg {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.file-history-date {
  color: var(--text-muted);
  font-size: 0.68rem;
  flex-shrink: 0;
}

/* Panel header utility */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.panel-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Changed files panel */
.changed-files-panel {
  position: absolute;
  top: 44px;
  left: 8px;
  width: 280px;
  max-height: calc(100% - 56px - 140px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  flex-direction: column;
  animation: fadeIn 150ms ease;
  overflow: hidden;
}

.changed-files-list {
  overflow-y: auto;
  max-height: 400px;
}

.changed-files-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.stat-add {
  color: #22c55e;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
}

.stat-del {
  color: #ef4444;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
}

.stat-files {
  color: var(--text-muted);
  font-size: 0.68rem;
  margin-left: auto;
}

.changed-file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
  font-size: 0.73rem;
}

.changed-file-item:hover {
  background: var(--bg-tertiary);
}

.changed-file-status {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.changed-file-name {
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.changed-file-dir {
  color: var(--text-muted);
  font-size: 0.65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.changed-file-stats {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.68rem;
}

/* Card flash animation for navigating */
@keyframes cardFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.6);
  }

  50% {
    box-shadow: 0 0 20px 4px rgba(168, 85, 247, 0.4);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(168, 85, 247, 0);
  }
}

.file-card.card-flash {
  animation: cardFlash 1.5s ease-out;
}

/* ─── Connection dialog ───────────────────────────────── */
.connection-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.connection-dialog {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 520px;
  max-width: 90vw;
  box-shadow:
    var(--shadow-lg),
    0 0 60px rgba(124, 58, 237, 0.15);
}

.connection-dialog h3 {
  margin: 0 0 16px;
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.conn-dialog-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.conn-dialog-file {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conn-dialog-file label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.conn-file-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-tertiary);
  font-weight: 500;
  word-break: break-all;
}

.conn-line-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.conn-line-range label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.conn-line-range input {
  width: 60px;
  padding: 4px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
}

.conn-line-range input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.conn-line-range span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.conn-dialog-arrow {
  color: var(--accent-primary);
  opacity: 0.7;
  flex-shrink: 0;
}

.conn-dialog-comment {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.conn-dialog-comment label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.conn-dialog-comment input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
}

.conn-dialog-comment input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.conn-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Connecting state on cards */
.file-card.connecting {
  box-shadow: 0 0 12px 3px rgba(124, 58, 237, 0.4);
  border-color: var(--accent-primary) !important;
}

.file-card.connect-target {
  box-shadow: 0 0 16px 4px rgba(34, 197, 94, 0.3);
  border-color: #22c55e !important;
}

/* Line flash animation for connection navigation */
@keyframes lineFlash {
  0% {
    background-color: rgba(124, 58, 237, 0.4);
  }

  100% {
    background-color: transparent;
  }
}

.diff-line.line-flash {
  animation: lineFlash 1.5s ease-out;
  border-left: 3px solid var(--accent-primary);
}

/* SVG overlay for connection lines — MUST cover entire canvas */
.connections-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  overflow: visible;
}

/* SVG overlay pointer events for connection paths */
#connectionsOverlay path,
#connectionsOverlay circle,
#connectionsOverlay g {
  pointer-events: all;
}

#connectionsOverlay path:hover {
  stroke-width: 4;
  opacity: 1 !important;
  filter: drop-shadow(0 0 4px rgba(124, 58, 237, 0.5));
}

/* ─── Connection marker strip (LEFT side of cards) ────── */
.conn-marker-strip {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  z-index: 5;
  pointer-events: auto;
}

.conn-marker {
  position: absolute;
  left: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
  transform: translateY(-50%);
  z-index: 6;
}

.conn-marker--source {
  background: #a78bfa;
  box-shadow: 0 0 4px rgba(167, 139, 250, 0.5);
}

.conn-marker--target {
  background: #60a5fa;
  box-shadow: 0 0 4px rgba(96, 165, 250, 0.5);
}

.conn-marker:hover {
  transform: translateY(-50%) scale(1.5);
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.8);
}

/* Click-to-connect visual states */
.diff-line.connection-source-line {
  background: rgba(167, 139, 250, 0.25) !important;
  border-left: 3px solid #a78bfa !important;
}

.file-card.connecting-source {
  border-color: #a78bfa !important;
  box-shadow: 0 0 12px 3px rgba(167, 139, 250, 0.3);
}

.file-card.connect-target-ready {
  border-color: rgba(96, 165, 250, 0.3) !important;
}

.file-card.connect-target-ready .diff-line:hover {
  background: rgba(96, 165, 250, 0.15) !important;
  cursor: crosshair;
}

/* ─── Connection status indicator (bottom bar, replaces toasts) ─── */
.conn-status-indicator {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  padding: 8px 20px;
  background: rgba(20, 15, 40, 0.92);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 8px;
  color: #a78bfa;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 500;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.conn-status-indicator.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── SVG connection group interaction ────────────────── */
.conn-group {
  cursor: pointer;
}

.conn-glow-path {
  transition: opacity 0.15s ease;
}

.conn-main-path {
  transition:
    stroke-width 0.15s ease,
    opacity 0.15s ease;
}

/* ─── File card dragging cursor ───────────────────────── */
.file-card.dragging {
  cursor: move !important;
}

/* ─── AI Chat Panels ──────────────────────────────────── */

/* Canvas sidebar chat */
#canvasChat {
  position: absolute;
  top: 44px;
  right: 8px;
  width: 380px;
  min-width: 240px;
  max-width: 600px;
  max-height: calc(100% - 56px - 140px);
  z-index: 300;
  animation: slideInRight 0.2s ease;
  resize: horizontal;
  overflow: auto;
  direction: rtl;
  /* resize handle on left side (toward canvas) */
}

#canvasChat > * {
  direction: ltr;
  /* restore normal text direction for children */
}

@keyframes slideInRight {
  from {
    transform: translateX(20px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Modal chat container */
.modal-chat-container {
  flex: 1;
  overflow: hidden;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  height: 100%;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.08),
    rgba(59, 130, 246, 0.05)
  );
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-primary);
}

.chat-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.chat-close {
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.chat-close:hover {
  opacity: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: 500px;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-message-role {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chat-user .chat-message-role {
  color: var(--accent-tertiary);
}

.chat-assistant .chat-message-role {
  color: var(--accent-primary);
}

.chat-message-content {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-primary);
  word-wrap: break-word;
}

.chat-user .chat-message-content {
  background: rgba(124, 58, 237, 0.08);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  border-left: 3px solid var(--accent-primary);
}

.chat-assistant .chat-message-content {
  padding: 4px 0;
}

/* Chat code blocks */
.chat-code-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 6px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.45;
  white-space: pre;
}

.chat-inline-code {
  background: var(--bg-tertiary);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: var(--accent-tertiary);
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px !important;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: typingBounce 1.2s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

/* Chat input area */
.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  resize: none;
  transition: border-color var(--transition-fast);
  line-height: 1.4;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

.chat-input::-moz-placeholder {
  color: var(--text-muted);
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-send {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  align-self: flex-end;
}

.chat-send:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}

.chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* AI button glow */
.ai-chat-btn {
  position: relative;
  color: var(--accent-primary) !important;
}

.ai-chat-btn::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.15), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.ai-chat-btn:hover::after {
  opacity: 1;
}

/* Modal with chat — adjust layout */
.modal-tab[data-view="chat"] {
  color: var(--accent-primary);
}

.modal-tab[data-view="chat"].active {
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-primary);
}

/* Chat inside modal fills available space */
.modal-chat-container .chat-panel {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.modal-chat-container .chat-messages {
  max-height: none;
  min-height: 400px;
}

/* ─── Edit tab styling ─────────────────────────────────── */
.modal-tab[data-view="edit"] {
  color: #22c55e;
}

.modal-tab[data-view="edit"].active {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

/* Edit container fills the modal body */
.modal-edit-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

.modal-edit-textarea {
  flex: 1;
  resize: none;
  background: transparent;
  color: var(--text-primary);
  border: none;
  outline: none;
  padding: 12px 16px;
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 13px;
  line-height: 1.6;
  -moz-tab-size: 4;
    -o-tab-size: 4;
       tab-size: 4;
  white-space: pre;
  overflow: auto;
}

/* CodeMirror editor mount */
.cm-editor-mount {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.cm-editor-mount .cm-editor {
  height: 100%;
}

.cm-editor-mount .cm-scroller {
  overflow: auto !important;
}

/* ─── Go-to-definition: clickable imports ─── */
.goto-import-link {
  cursor: pointer;
  text-decoration-line: underline;
  text-decoration-style: dashed;
  text-decoration-color: rgba(96, 165, 250, 0.4);
  text-underline-offset: 2px;
  border-radius: 2px;
  transition: all 0.15s ease;
}

.goto-import-link:hover {
  text-decoration-style: solid;
  text-decoration-color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
  color: #93c5fd !important;
}

/* Card highlight when navigating to it */
.goto-highlight {
  animation: goto-pulse 2s ease-out;
  z-index: 9999 !important;
}

@keyframes goto-pulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(34, 197, 94, 0.6),
      0 0 20px rgba(34, 197, 94, 0.3);
  }

  25% {
    box-shadow:
      0 0 0 8px rgba(34, 197, 94, 0.3),
      0 0 30px rgba(34, 197, 94, 0.2);
  }

  50% {
    box-shadow:
      0 0 0 4px rgba(34, 197, 94, 0.2),
      0 0 15px rgba(34, 197, 94, 0.1);
  }

  75% {
    box-shadow:
      0 0 0 8px rgba(34, 197, 94, 0.1),
      0 0 20px rgba(34, 197, 94, 0.05);
  }

  100% {
    box-shadow:
      0 0 0 0 rgba(34, 197, 94, 0),
      0 0 0 rgba(34, 197, 94, 0);
  }
}

/* ─── Multi-tab file bar ─── */
.modal-file-tab-bar {
  display: none;
  gap: 2px;
  padding: 4px 16px;
  background: rgba(15, 15, 30, 0.8);
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.3) transparent;
  flex-shrink: 0;
}

.file-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px 6px 0 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--text-muted, #9ca3af);
  font-size: 0.72rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  max-width: 180px;
  min-width: 80px;
  position: relative;
}

.file-tab:hover {
  background: rgba(124, 58, 237, 0.08);
  color: var(--text-primary, #e5e7eb);
}

.file-tab.active {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.3);
  color: #c4b5fd;
}

.file-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #7c3aed;
  border-radius: 2px 2px 0 0;
}

.file-tab-icon {
  font-size: 0.7rem;
  flex-shrink: 0;
}

.file-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-tab-modified {
  color: #eab308;
  font-size: 0.6rem;
  flex-shrink: 0;
}

.file-tab-close {
  opacity: 0;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  border-radius: 3px;
  flex-shrink: 0;
  transition: all 0.1s ease;
}

.file-tab:hover .file-tab-close {
  opacity: 0.6;
}

.file-tab-close:hover {
  opacity: 1 !important;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* ─── Blame view ─── */
.modal-blame-container {
  flex: 1;
  overflow: auto;
  background: var(--card-bg, #0f0f1e);
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.75rem;
  line-height: 1.6;
}

.blame-scroll {
  min-width: 100%;
}

.blame-table {
  border-collapse: collapse;
  width: 100%;
}

.blame-row {
  transition: background 0.1s ease;
}

.blame-row:hover {
  background: rgba(124, 58, 237, 0.06);
}

.blame-group-start {
  border-top: 1px solid rgba(124, 58, 237, 0.12);
}

.blame-gutter {
  padding: 1px 10px 1px 8px;
  white-space: nowrap;
  vertical-align: top;
  min-width: 200px;
  max-width: 240px;
}

.blame-gutter-empty {
  padding: 1px 10px 1px 8px;
}

.blame-hash {
  color: #7c3aed;
  font-size: 0.68rem;
  margin-right: 8px;
  cursor: default;
  opacity: 0.7;
}

.blame-hash:hover {
  opacity: 1;
  text-decoration: underline;
}

.blame-author {
  font-size: 0.68rem;
  margin-right: 6px;
  font-weight: 500;
}

.blame-age {
  color: var(--text-muted, #6b7280);
  font-size: 0.62rem;
  opacity: 0.7;
}

.blame-lineno {
  padding: 1px 12px 1px 8px;
  color: var(--text-muted, #6b7280);
  text-align: right;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  white-space: nowrap;
  opacity: 0.5;
  font-size: 0.68rem;
  min-width: 35px;
  border-right: 1px solid rgba(124, 58, 237, 0.08);
}

.blame-code {
  padding: 1px 16px 1px 12px;
  white-space: pre;
}

.blame-code code {
  color: var(--text-primary, #e5e7eb);
}

.blame-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 16px;
  border-top: 1px solid rgba(124, 58, 237, 0.15);
  background: rgba(15, 15, 30, 0.6);
  font-size: 0.68rem;
  color: var(--text-muted, #9ca3af);
}

.blame-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.blame-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.blame-loading,
.blame-error {
  padding: 24px;
  text-align: center;
  color: var(--text-muted, #9ca3af);
  font-size: 0.8rem;
}

.blame-error {
  color: var(--error, #ef4444);
}

/* ─── Breadcrumb navigation ─── */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

.breadcrumb-segment {
  background: none;
  border: none;
  color: var(--text-muted, #9ca3af);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.12s ease;
  font-family: inherit;
}

.breadcrumb-segment:hover {
  color: #c4b5fd;
  background: rgba(124, 58, 237, 0.12);
}

.breadcrumb-sep {
  color: rgba(124, 58, 237, 0.3);
  font-size: 0.75rem;
  margin: 0 1px;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.breadcrumb-file {
  color: var(--text-primary, #e5e7eb);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 4px;
}

/* Breadcrumb dropdown */
.breadcrumb-dropdown {
  position: fixed;
  z-index: 10001;
  background: rgba(15, 15, 30, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 8px;
  padding: 4px;
  min-width: 180px;
  max-width: 320px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(124, 58, 237, 0.1);
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.3) transparent;
}

.breadcrumb-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary, #e5e7eb);
  font-size: 0.72rem;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s ease;
  font-family: inherit;
}

.breadcrumb-dropdown-item:hover {
  background: rgba(124, 58, 237, 0.12);
}

.breadcrumb-dropdown-item.active {
  background: rgba(124, 58, 237, 0.15);
  border-left: 2px solid #7c3aed;
  color: #c4b5fd;
}

.breadcrumb-dropdown-icon {
  font-size: 0.7rem;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

/* ─── Symbol outline panel ─── */
.modal-body-wrapper {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-body-wrapper > .modal-body {
  flex: 1;
  min-width: 0;
}

.modal-outline-panel {
  width: 220px;
  min-width: 220px;
  background: rgba(10, 10, 22, 0.9);
  border-left: 1px solid rgba(124, 58, 237, 0.15);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.3) transparent;
  flex-shrink: 0;
}

.outline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 6px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.1);
  position: sticky;
  top: 0;
  background: rgba(10, 10, 22, 0.95);
  z-index: 1;
}

.outline-title {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.outline-count {
  font-size: 0.62rem;
  color: var(--text-muted, #6b7280);
  background: rgba(124, 58, 237, 0.1);
  padding: 1px 6px;
  border-radius: 8px;
}

.outline-list {
  padding: 4px 0;
}

.outline-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary, #e5e7eb);
  font-size: 0.7rem;
  padding: 3px 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s ease;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  white-space: nowrap;
  overflow: hidden;
}

.outline-item:hover {
  background: rgba(124, 58, 237, 0.1);
}

.outline-icon {
  font-size: 0.72rem;
  font-weight: 700;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.outline-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.outline-lineno {
  color: var(--text-muted, #6b7280);
  font-size: 0.6rem;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.5;
}

.outline-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-muted, #6b7280);
  font-size: 0.72rem;
  font-style: italic;
}

.modal-outline-toggle {
  opacity: 0.6;
  transition: opacity 0.15s;
}

.modal-outline-toggle:hover {
  opacity: 1;
}

.modal-edit-textarea:focus {
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.2);
}

.modal-edit-textarea::-moz-selection {
  background: rgba(124, 58, 237, 0.3);
}

.modal-edit-textarea::selection {
  background: rgba(124, 58, 237, 0.3);
}

.modal-edit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.04),
    rgba(124, 58, 237, 0.04)
  );
  flex-shrink: 0;
}

.edit-line-info {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.edit-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-save-btn {
  display: flex !important;
  align-items: center;
  gap: 5px;
  color: #22c55e !important;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 4px 12px !important;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.edit-save-btn:hover {
  background: rgba(34, 197, 94, 0.12) !important;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}

/* Save status indicator */
.modal-save-status {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
}

.modal-save-status.saving {
  color: #eab308;
  background: rgba(234, 179, 8, 0.1);
}

.modal-save-status.saved {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.modal-save-status.error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.modal-save-status.modified {
  color: #eab308;
  background: rgba(234, 179, 8, 0.08);
}

@keyframes savePulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

.modal-save-status.saving {
  animation: savePulse 0.8s ease infinite;
}

/* ─── Git commit section in edit toolbar ─────────────── */
.edit-commit-section {
  display: flex;
  align-items: center;
  gap: 6px;
  animation: slideInLeft 0.2s ease;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(12px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.edit-commit-input {
  width: 220px;
  padding: 4px 10px;
  background: var(--bg-tertiary, #1a1a2e);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 5px;
  color: var(--text-primary);
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.edit-commit-input:focus {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.1);
}

.edit-commit-input::-moz-placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.edit-commit-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.edit-commit-btn {
  display: flex !important;
  align-items: center;
  gap: 4px;
  color: #22c55e !important;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 3px 10px !important;
  border-radius: 5px;
  background: rgba(34, 197, 94, 0.08) !important;
  border: 1px solid rgba(34, 197, 94, 0.2) !important;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.edit-commit-btn:hover {
  background: rgba(34, 197, 94, 0.15) !important;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.4) !important;
}

.edit-commit-cancel {
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.edit-commit-cancel:hover {
  opacity: 1;
  color: #ef4444 !important;
}

/* Separator between commit section and save button */
.edit-commit-section + .edit-save-btn::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 16px;
  background: var(--border-default, rgba(255, 255, 255, 0.1));
  margin-right: 8px;
}

/* ─── New File Dialog ─────────────────────────────────── */
.new-file-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
  animation: fadeIn 0.15s ease;
}

.new-file-dialog {
  width: 480px;
  max-width: 90vw;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--shadow-lg),
    0 0 60px rgba(34, 197, 94, 0.1);
  overflow: hidden;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(16px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.new-file-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.08),
    rgba(124, 58, 237, 0.04)
  );
  color: #22c55e;
}

.new-file-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.new-file-body {
  padding: 16px 20px;
}

.new-file-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.new-file-label code {
  color: #22c55e;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: rgba(34, 197, 94, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
}

.new-file-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.new-file-input:focus {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.new-file-input::-moz-placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.new-file-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.new-file-hint {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.new-file-hint code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 3px;
  border-radius: 2px;
}

.new-file-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-subtle);
}

.new-file-create-btn {
  display: flex !important;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  color: white !important;
  font-weight: 600 !important;
  border: none !important;
  padding: 6px 16px !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.new-file-create-btn:hover {
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.3);
  transform: translateY(-1px);
}

.new-file-create-btn:disabled,
.new-file-create-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── File Search Overlay ─────────────────────────────── */
.file-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  padding-top: 15vh;
  animation: fadeIn 0.1s ease;
}

.file-search-container {
  width: 520px;
  max-width: 90vw;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--shadow-lg),
    0 0 60px rgba(124, 58, 237, 0.1);
  overflow: hidden;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
}

.file-search-input {
  width: 100%;
  padding: 14px 18px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font-mono);
  outline: none;
}

.file-search-input::-moz-placeholder {
  color: var(--text-muted);
}

.file-search-input::placeholder {
  color: var(--text-muted);
}

.file-search-results {
  overflow-y: auto;
  max-height: 50vh;
}

.file-search-item {
  padding: 10px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background var(--transition-fast);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.file-search-item:hover,
.file-search-item.selected {
  background: rgba(124, 58, 237, 0.1);
}

.file-search-item.selected {
  border-left: 3px solid var(--accent-primary);
}

.search-file-name {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-primary);
  word-break: break-all;
}

.search-file-dir {
  color: var(--text-muted);
}

.file-search-item mark {
  background: rgba(124, 58, 237, 0.3);
  color: var(--accent-primary);
  border-radius: 2px;
  padding: 0 1px;
}

.file-search-empty {
  padding: 20px 18px;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  font-style: italic;
}

/* ─── Connection picker header ───────────────── */
.conn-picker-header {
  padding: 12px 18px 8px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.conn-picker-from strong {
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

/* ─── Toggle button active state ─────────────── */
#toggleConnections.active {
  color: var(--accent-primary);
}

#toggleConnections:not(.active) {
  opacity: 0.4;
}

/* ─── Commit Progress Bar (non-blocking) ──────── */
.commit-progress-bar {
  display: none;
  position: absolute;
  top: 36px;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 4px 14px;
  background: rgba(124, 58, 237, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  min-height: 28px;
  animation: fadeIn 0.15s ease;
  pointer-events: none;
}

.commit-progress-track {
  flex: 1;
  max-width: 400px;
  height: 3px;
  background: rgba(124, 58, 237, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.commit-progress-fill {
  width: 40%;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  border-radius: 2px;
  animation: progressSlide 1s ease-in-out infinite;
}

@keyframes progressSlide {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(400%);
  }
}

.commit-progress-text {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 400px;
}

/* Bottom Layers Bar — auto-minimizes to avoid occluding cards */
#layersBarContainer {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  pointer-events: auto;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

/* When not hovered, hide non-active items but show active layer name */
#layersBarContainer:not(:hover) .layers-bar {
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

#layersBarContainer:not(:hover) .layers-bar-item:not(.active) {
  display: none;
}

#layersBarContainer:not(:hover) .layers-bar-add {
  display: none;
}

/* On hover, expand to full width */
#layersBarContainer:hover .layers-bar {
  opacity: 1;
  transition: opacity 0.15s ease;
}

.layers-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-default);
  padding: 6px 8px;
  border-radius: 999px;
  /* Pill shape */
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.layers-bar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.layers-bar-item:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.layers-bar-item.active {
  background: rgba(124, 58, 237, 0.15);
  /* Accent tint */
  color: var(--accent-primary);
  border-color: rgba(124, 58, 237, 0.3);
}

.layer-badge {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-family: var(--font-mono);
}

.layers-bar-item.active .layer-badge {
  background: rgba(124, 58, 237, 0.2);
  color: var(--accent-secondary);
}

.layers-bar-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: 1px dashed var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.75rem;
}

.layers-bar-add:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: var(--bg-tertiary);
}

.layers-bar-add.autogen {
  border-style: solid;
  border-color: rgba(124, 58, 237, 0.25);
  color: var(--accent-tertiary);
}

.layers-bar-add.autogen:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.4);
  color: var(--accent-secondary);
}

/* ═══════════════════════════════════════════════ */
/* ─── Landing Overlay v2 — Premium Design ─────  */
/* ═══════════════════════════════════════════════ */

.landing-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  animation: fadeIn 0.4s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Gradient mesh background */
.landing-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 80% 50% at 40% 20%,
      rgba(124, 58, 237, 0.08) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 60% 40% at 70% 60%,
      rgba(96, 165, 250, 0.06) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 50% 30% at 30% 80%,
      rgba(52, 211, 153, 0.04) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 40% 60% at 80% 10%,
      rgba(244, 114, 182, 0.03) 0%,
      transparent 50%
    );
  animation: meshShift 20s ease-in-out infinite alternate;
}

@keyframes meshShift {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }

  100% {
    opacity: 1;
  }
}

/* Floating particles */
.landing-bg-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat linear infinite;
}

.p1 {
  width: 3px;
  height: 3px;
  background: #a78bfa;
  left: 15%;
  animation-duration: 18s;
  animation-delay: 0s;
}

.p2 {
  width: 2px;
  height: 2px;
  background: #60a5fa;
  left: 35%;
  animation-duration: 22s;
  animation-delay: 3s;
}

.p3 {
  width: 4px;
  height: 4px;
  background: #34d399;
  left: 55%;
  animation-duration: 16s;
  animation-delay: 6s;
}

.p4 {
  width: 2px;
  height: 2px;
  background: #f472b6;
  left: 75%;
  animation-duration: 20s;
  animation-delay: 2s;
}

.p5 {
  width: 3px;
  height: 3px;
  background: #fbbf24;
  left: 25%;
  animation-duration: 24s;
  animation-delay: 8s;
}

.p6 {
  width: 2px;
  height: 2px;
  background: #818cf8;
  left: 65%;
  animation-duration: 19s;
  animation-delay: 4s;
}

.p7 {
  width: 3px;
  height: 3px;
  background: #c084fc;
  left: 85%;
  animation-duration: 21s;
  animation-delay: 7s;
}

.p8 {
  width: 2px;
  height: 2px;
  background: #a5b4fc;
  left: 45%;
  animation-duration: 17s;
  animation-delay: 1s;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }

  10% {
    opacity: 0.6;
  }

  50% {
    opacity: 0.3;
  }

  90% {
    opacity: 0;
  }

  100% {
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

/* Content wrapper */
.landing-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 860px;
  padding: 32px 24px 48px;
  animation: landingSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes landingSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero section */
.landing-hero {
  margin-bottom: 48px;
}

/* Badge */
.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  margin-bottom: 24px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 999px;
  animation: landingSlideUp 0.5s 0.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  animation: badgePulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
}

@keyframes badgePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* Landing icon */
.landing-icon {
  margin-bottom: 24px;
  animation: landingSlideUp 0.5s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
  filter: drop-shadow(0 0 30px rgba(124, 58, 237, 0.15));
}

.ring-outer {
  animation: ringRotate 30s linear infinite;
  transform-origin: 70px 70px;
}

.ring-mid {
  animation: ringRotate 20s linear infinite reverse;
  transform-origin: 70px 70px;
}

@keyframes ringRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.core-glow {
  animation: corePulse 3s ease-in-out infinite;
}

@keyframes corePulse {
  0%,
  100% {
    r: 8;
    opacity: 0.9;
  }

  50% {
    r: 10;
    opacity: 0.6;
  }
}

.node-orbit {
  animation: nodeGlow 4s ease-in-out infinite;
}

.n1 {
  animation-delay: 0s;
}

.n2 {
  animation-delay: 0.6s;
}

.n3 {
  animation-delay: 1.2s;
}

.n4 {
  animation-delay: 1.8s;
}

.n5 {
  animation-delay: 2.4s;
}

.n6 {
  animation-delay: 3s;
}

@keyframes nodeGlow {
  0%,
  100% {
    opacity: 0.85;
  }

  50% {
    opacity: 0.4;
  }
}

/* Title */
.landing-title {
  font-family: var(--font-display);
  font-size: 3.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 12px;
  line-height: 1.05;
  animation: landingSlideUp 0.5s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.title-git {
  color: var(--text-primary);
}

.title-maps {
  background: linear-gradient(135deg, #a78bfa 0%, #60a5fa 50%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Subtitle */
.landing-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.6;
  animation: landingSlideUp 0.5s 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.subtitle-accent {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Feature cards grid */
.landing-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 44px;
  animation: landingSlideUp 0.5s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.feature-card {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 22px 16px 18px;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  cursor: default;
}

.feature-glow {
  position: absolute;
  top: -40%;
  left: -40%;
  width: 180%;
  height: 180%;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.fc-1 .feature-glow {
  background: radial-gradient(
    circle,
    rgba(167, 139, 250, 0.08) 0%,
    transparent 60%
  );
}

.fc-2 .feature-glow {
  background: radial-gradient(
    circle,
    rgba(96, 165, 250, 0.08) 0%,
    transparent 60%
  );
}

.fc-3 .feature-glow {
  background: radial-gradient(
    circle,
    rgba(52, 211, 153, 0.08) 0%,
    transparent 60%
  );
}

.fc-4 .feature-glow {
  background: radial-gradient(
    circle,
    rgba(244, 114, 182, 0.08) 0%,
    transparent 60%
  );
}

.feature-card:hover .feature-glow {
  opacity: 1;
}

.feature-card:hover {
  border-color: rgba(124, 58, 237, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.fc-1:hover {
  border-color: rgba(167, 139, 250, 0.3);
}

.fc-2:hover {
  border-color: rgba(96, 165, 250, 0.3);
}

.fc-3:hover {
  border-color: rgba(52, 211, 153, 0.3);
}

.fc-4:hover {
  border-color: rgba(244, 114, 182, 0.3);
}

.feature-icon-wrap {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  margin-bottom: 14px;
  transition: all 0.3s ease;
}

.fc-1 .feature-icon-wrap {
  background: rgba(167, 139, 250, 0.1);
  color: #a78bfa;
}

.fc-2 .feature-icon-wrap {
  background: rgba(96, 165, 250, 0.1);
  color: #60a5fa;
}

.fc-3 .feature-icon-wrap {
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
}

.fc-4 .feature-icon-wrap {
  background: rgba(244, 114, 182, 0.1);
  color: #f472b6;
}

.feature-card:hover .feature-icon-wrap {
  transform: scale(1.1);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.feature-card p {
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

.feature-card code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: rgba(124, 58, 237, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent-secondary);
}

/* CTA section */
.landing-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 36px;
  animation: landingSlideUp 0.5s 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.cta-arrows {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.cta-arrow {
  display: inline-block;
  font-size: 1.1rem;
  color: var(--accent-primary);
  animation: ctaArrowBounce 1.5s ease-in-out infinite;
}

@keyframes ctaArrowBounce {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.5;
  }

  50% {
    transform: translateX(-6px);
    opacity: 1;
  }
}

.cta-text {
  color: var(--text-secondary);
}

.cta-or {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Feature pills (inline in hero) */
.landing-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  animation: landingSlideUp 0.5s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.feature-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.feature-pill:hover {
  border-color: rgba(124, 58, 237, 0.4);
  background: rgba(124, 58, 237, 0.15);
}

.feature-icon {
  font-size: 0.9rem;
}

/* Repo card as anchor link */
a.repo-card-btn {
  text-decoration: none;
  color: inherit;
}

/* ─── Dimensions Section ─── */
.landing-dimensions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
  animation: landingSlideUp 0.5s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dimension-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 8px;
  font-weight: 500;
}

.dimension-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 14px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 16px 20px;
  transition:
    border-color 0.3s,
    background 0.3s,
    transform 0.3s;
  position: relative;
  overflow: hidden;
}

.dimension-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 20% 50%,
    rgba(167, 139, 250, 0.04),
    transparent 60%
  );
  pointer-events: none;
}

.dimension-card:hover {
  border-color: rgba(167, 139, 250, 0.15);
  background: rgba(255, 255, 255, 0.025);
  transform: translateX(2px);
}

.dim-badge {
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 48px;
  gap: 2px;
}

.dim-num {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.dim-axis {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.dim-visual {
  display: none;
  /* Hidden on small screens, shown in wide layout */
}

.dim-svg {
  width: 100%;
  height: auto;
}

.dimension-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.dimension-card p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
  grid-column: 2;
}

.dimension-card em {
  color: #a78bfa;
  font-style: normal;
  font-weight: 600;
}

/* Specific dimension colors */
.dim-1d:hover {
  border-color: rgba(167, 139, 250, 0.2);
}

.dim-1d .dim-num {
  background: linear-gradient(135deg, #a78bfa, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
}

.dim-2d:hover {
  border-color: rgba(96, 165, 250, 0.2);
}

.dim-2d .dim-num {
  background: linear-gradient(135deg, #60a5fa, #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
}

.dim-3d:hover {
  border-color: rgba(52, 211, 153, 0.2);
}

.dim-3d .dim-num {
  background: linear-gradient(135deg, #34d399, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
}

.dim-conn:hover {
  border-color: rgba(167, 139, 250, 0.25);
}

.dim-conn .dim-num {
  background: linear-gradient(135deg, #f472b6, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 1.5rem;
}

.dim-4d:hover {
  border-color: rgba(124, 58, 237, 0.25);
}

.dim-4d .dim-num {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Connection pulse animation */
@keyframes connPulse {
  0%,
  100% {
    r: 6;
    opacity: 0.15;
  }

  50% {
    r: 10;
    opacity: 0.05;
  }
}

.conn-pulse {
  animation: connPulse 2s ease-in-out infinite;
}

/* ─── Pitch Section (AI code review) ─── */
.landing-pitch {
  text-align: center;
  margin-bottom: 40px;
  padding: 32px 24px;
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.05),
    rgba(96, 165, 250, 0.03)
  );
  border: 1px solid rgba(167, 139, 250, 0.08);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  animation: landingSlideUp 0.5s 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.landing-pitch::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    rgba(167, 139, 250, 0.03),
    transparent 50%
  );
  pointer-events: none;
}

.pitch-badge {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 16px;
  font-weight: 600;
}

.pitch-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0 0 12px;
}

.pitch-accent {
  background: linear-gradient(135deg, #a78bfa, #60a5fa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pitch-body {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 560px;
  margin: 0 auto;
}

/* ─── Wide layout: show visuals inline ─── */
@media (min-width: 900px) {
  .dimension-card {
    grid-template-columns: auto 200px 1fr;
    gap: 4px 20px;
  }

  .dim-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-row: 1 / 3;
  }

  .dimension-card h3 {
    grid-column: 3;
  }

  .dimension-card p {
    grid-column: 3;
  }
}

/* Stats row */
.landing-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding-top: 12px;
  animation: landingSlideUp 0.5s 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.landing-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
}

/* Responsive */
@media (max-width: 900px) {
  .landing-features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .landing-features {
    grid-template-columns: 1fr;
  }

  .landing-title {
    font-size: 2.4rem;
  }

  .landing-subtitle {
    font-size: 0.95rem;
  }

  .landing-stats {
    gap: 16px;
  }

  .stat-num {
    font-size: 1rem;
  }
}

/* ─── Landing Grid Background ─────────────────────────── */
.landing-grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.35;
}

.grid-line {
  position: absolute;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(124, 58, 237, 0.06) 20%,
    rgba(96, 165, 250, 0.04) 50%,
    rgba(124, 58, 237, 0.06) 80%,
    transparent 100%
  );
}

.gl-h1,
.gl-h2,
.gl-h3 {
  left: 0;
  right: 0;
  height: 1px;
}

.gl-v1,
.gl-v2,
.gl-v3 {
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(124, 58, 237, 0.06) 20%,
    rgba(96, 165, 250, 0.04) 50%,
    rgba(124, 58, 237, 0.06) 80%,
    transparent 100%
  );
}

.gl-h1 {
  top: 25%;
  animation: gridPulse 8s ease-in-out infinite;
}

.gl-h2 {
  top: 50%;
  animation: gridPulse 8s ease-in-out infinite 2s;
}

.gl-h3 {
  top: 75%;
  animation: gridPulse 8s ease-in-out infinite 4s;
}

.gl-v1 {
  left: 20%;
  animation: gridPulse 8s ease-in-out infinite 1s;
}

.gl-v2 {
  left: 50%;
  animation: gridPulse 8s ease-in-out infinite 3s;
}

.gl-v3 {
  left: 80%;
  animation: gridPulse 8s ease-in-out infinite 5s;
}

@keyframes gridPulse {
  0%,
  100% {
    opacity: 0.2;
  }

  50% {
    opacity: 0.8;
  }
}

/* ─── Featured Repos Quick Start ──────────────────────── */
.landing-repos {
  margin-bottom: 36px;
  animation: landingSlideUp 0.5s 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.repos-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.repos-header svg {
  opacity: 0.5;
}

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

.repo-card-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 14px 12px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  overflow: hidden;
}

.repo-card-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(124, 58, 237, 0.06) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.repo-card-btn:hover::before {
  opacity: 1;
}

.repo-card-btn:hover {
  border-color: rgba(124, 58, 237, 0.25);
  transform: translateY(-2px);
  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(124, 58, 237, 0.08) inset;
}

.repo-card-btn:active {
  transform: translateY(0);
}

.repo-card-name {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.repo-card-org {
  position: relative;
  z-index: 1;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.repo-card-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.repo-card-lang {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.repo-card-stars {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
}

@media (max-width: 900px) {
  .repos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .repos-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── GitHub Import Button ─────────────────────────────── */
.github-import-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 9px 12px;
  margin-top: 8px;
  background: rgba(22, 22, 34, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-inset);
}

.github-import-btn:hover {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.2);
  color: var(--text-primary);
  box-shadow:
    var(--shadow-inset),
    0 0 12px rgba(124, 58, 237, 0.08);
}

.github-import-btn:active {
  transform: scale(0.98);
}

/* ─── GitHub Modal ─────────────────────────────────────── */
.github-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.github-modal.active {
  pointer-events: auto;
  opacity: 1;
}

.github-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.github-modal-content {
  position: relative;
  width: 680px;
  max-width: 90vw;
  max-height: 85vh;
  background: linear-gradient(
    135deg,
    rgba(18, 18, 26, 0.98),
    rgba(10, 10, 15, 0.99)
  );
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--shadow-lg),
    0 0 60px rgba(124, 58, 237, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 250ms ease;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(16px);
    opacity: 0.5;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.github-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.github-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.github-modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.github-modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Search Row */
.github-search-row {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.github-user-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  transition: all var(--transition-fast);
  min-width: 0;
}

.github-user-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.github-user-input::-moz-placeholder {
  color: var(--text-muted);
}

.github-user-input::placeholder {
  color: var(--text-muted);
}

.github-sort-select {
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.github-sort-select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.github-search-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--accent-primary), #6d28d9);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.github-search-btn:hover {
  background: linear-gradient(
    135deg,
    var(--accent-secondary),
    var(--accent-primary)
  );
  box-shadow: 0 0 12px var(--accent-glow);
}

.github-search-btn:active {
  transform: scale(0.96);
}

/* URL Clone Row — shown when a GitHub URL is pasted */
.github-url-clone-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 20px;
  background: rgba(124, 58, 237, 0.06);
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
  animation: fadeSlideDown 200ms ease;
}

@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.github-url-detected {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--accent-tertiary);
  font-weight: 500;
}

.github-url-detected svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

.github-url-clone-btn {
  flex-shrink: 0;
  padding: 6px 16px !important;
  font-weight: 600 !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.02em;
}

/* Repo Filter Row */
.github-filter-row {
  display: flex;
  padding: 6px 20px 0;
}

.github-repo-filter {
  width: 100%;
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.github-repo-filter:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

.github-repo-filter::-moz-placeholder {
  color: var(--text-muted);
}

.github-repo-filter::placeholder {
  color: var(--text-muted);
}

/* Profile */
.github-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(124, 58, 237, 0.03);
}

.github-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-default);
}

.github-profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.github-profile-info strong {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.github-profile-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.github-profile-bio {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Repos Grid */
.github-repos-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
  min-height: 200px;
}

.github-repo-card {
  display: flex;
  flex-direction: column;
  padding: 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.github-repo-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-elevated);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.08);
}

.github-repo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.github-repo-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}

.github-repo-stars {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.github-repo-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.github-repo-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.github-repo-lang {
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.github-clone-btn {
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--accent-primary), #6d28d9);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: auto;
  text-align: center;
}

.github-clone-btn:hover {
  background: linear-gradient(
    135deg,
    var(--accent-secondary),
    var(--accent-primary)
  );
  box-shadow: 0 0 12px var(--accent-glow);
}

.github-clone-btn:active {
  transform: scale(0.96);
}

/* Empty / Loading / Error states */
.github-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.github-empty-state p {
  font-size: 0.82rem;
}

.github-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 12px;
  color: var(--text-secondary);
}

.github-loading p {
  font-size: 0.8rem;
}

.github-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.github-error {
  grid-column: 1 / -1;
  padding: 16px 20px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 0.78rem;
  text-align: center;
}

/* Pagination */
.github-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
}

.github-page-btn {
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.github-page-btn:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  color: var(--text-primary);
}

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

.github-page-info {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Responsive */
@media (max-width: 600px) {
  .github-repos-grid {
    grid-template-columns: 1fr;
  }

  .github-search-row {
    flex-wrap: wrap;
  }
}

/* ─── User Account ────────────────────────────────────────── */
.user-account {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.btn-github-login {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-github-login:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

.btn-github-login svg {
  flex-shrink: 0;
}

.user-logged-in {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.3);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.user-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.btn-fav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-fav-toggle:hover {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

.btn-fav-toggle.favorited {
  color: #fbbf24;
}

.btn-fav-toggle.favorited svg {
  fill: #fbbf24;
}

.btn-logout {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn-logout:hover {
  color: var(--error) !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

/* ─── Command Palette ─────────────────────────────────── */
#command-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: cpFadeIn 120ms ease-out;
}

@keyframes cpFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes cpSlideDown {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#command-palette {
  width: min(560px, 90vw);
  background: rgba(18, 18, 28, 0.92);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 16px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(139, 92, 246, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  animation: cpSlideDown 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.cp-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cp-search svg {
  color: rgba(139, 92, 246, 0.7);
  flex-shrink: 0;
}

#cp-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #f0f0f0;
  font-size: 15px;
  font-family: "Inter", "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
}

#cp-input::-moz-placeholder {
  color: rgba(255, 255, 255, 0.3);
}

#cp-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.cp-search kbd {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
  font-family: "Inter", sans-serif;
}

#cp-results {
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

.cp-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 80ms;
}

.cp-result:hover,
.cp-result--active {
  background: rgba(139, 92, 246, 0.12);
}

.cp-result--active {
  border-left: 2px solid rgba(139, 92, 246, 0.7);
  padding-left: 14px;
}

.cp-result-name {
  font-size: 13px;
  color: #e0e0e0;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  letter-spacing: 0.02em;
}

.cp-result-dir {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  font-family: "Inter", sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cp-result mark {
  background: none;
  color: #a78bfa;
  font-weight: 700;
}

.cp-empty {
  padding: 24px 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
}

#cp-footer {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
}

#cp-footer kbd {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
  font-family: "Inter", sans-serif;
  margin-right: 3px;
}

/* ─── Shortcuts Panel ─────────────────────────────────── */
#shortcuts-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: cpFadeIn 120ms ease-out;
}

#shortcuts-panel {
  width: min(680px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  background: rgba(18, 18, 28, 0.94);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 16px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: cpSlideDown 180ms cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

.sp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sp-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #f0f0f0;
  letter-spacing: 0.01em;
}

.sp-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 120ms;
}

.sp-close:hover {
  color: #f0f0f0;
  background: rgba(255, 255, 255, 0.08);
}

.sp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 8px 0;
}

.sp-category {
  padding: 12px 24px;
}

.sp-category h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(139, 92, 246, 0.7);
}

.sp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
}

.sp-keys {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 120px;
  justify-content: flex-end;
}

.sp-keys kbd {
  font-size: 11px;
  font-family: "Inter", sans-serif;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.4;
  min-width: 18px;
  text-align: center;
}

.sp-key--text {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-family: "Inter", sans-serif;
}

.sp-sep {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.2);
  margin: 0 1px;
}

.sp-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .sp-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Status Bar ─────────────────────────────────────── */
#status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: rgba(18, 18, 28, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 11px;
  color: var(--text-muted, #64748b);
  z-index: 9999;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.sb-left,
.sb-right {
  display: flex;
  align-items: center;
  gap: 0;
}

.sb-item {
  padding: 0 10px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}

button.sb-item {
  border: none;
  background: transparent;
  font: inherit;
}

.sb-item:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.7);
  outline-offset: -2px;
}

.sb-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #e2e8f0);
}

.sb-repo {
  color: var(--accent-tertiary, #10b981);
  font-weight: 600;
}

.sb-commit {
  color: var(--accent-primary, #a78bfa);
}

.sb-slug {
  color: #7dd3fc;
  max-width: min(46vw, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.sb-slug-popover {
  position: absolute;
  width: min(380px, calc(100vw - 16px));
  padding: 12px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 12px;
  background: rgba(10, 14, 22, 0.98);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  color: var(--text-primary, #e2e8f0);
  z-index: 10001;
}

.sb-slug-popover__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.sb-slug-popover__eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 4px;
}

.sb-slug-popover__slug {
  font-size: 12px;
  color: #7dd3fc;
  word-break: break-word;
}

.sb-slug-popover__close {
  border: none;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 6px;
}

.sb-slug-popover__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #e2e8f0);
}

.sb-slug-popover__meta {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.sb-slug-popover__row {
  display: grid;
  gap: 4px;
}

.sb-slug-popover__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #94a3b8);
}

.sb-slug-popover__value {
  font-size: 11px;
  color: var(--text-primary, #e2e8f0);
}

.sb-slug-popover__value--multiline {
  word-break: break-word;
  white-space: normal;
}

.sb-slug-popover__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sb-slug-popover__action {
  border: 1px solid rgba(125, 211, 252, 0.22);
  background: rgba(125, 211, 252, 0.08);
  color: #bae6fd;
  cursor: pointer;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-family: inherit;
}

.sb-slug-popover__action:hover:not(:disabled) {
  background: rgba(125, 211, 252, 0.14);
}

.sb-slug-popover__action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sb-mode--simple {
  color: var(--accent-tertiary, #10b981);
}

.sb-mode--advanced {
  color: var(--accent-secondary, #3b82f6);
}

.sb-selected {
  color: #eab308;
}

.sb-zoom {
  min-width: 72px;
  justify-content: center;
}

/* ─── Settings Modal ─────────────────────────────────── */
.settings-modal {
  background: linear-gradient(
    135deg,
    rgba(18, 18, 28, 0.97),
    rgba(12, 12, 20, 0.99)
  );
  border: 1px solid var(--border-default);
  border-radius: 16px;
  width: min(520px, 90vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow:
    var(--shadow-lg),
    0 0 60px rgba(124, 58, 237, 0.08);
  overflow: hidden;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.settings-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.settings-title svg {
  color: var(--accent-secondary);
}

.settings-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

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

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px 16px;
}

.settings-section {
  margin-bottom: 8px;
}

.settings-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-tertiary);
  margin: 16px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.15);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: 16px;
}

.settings-label {
  flex: 1;
  min-width: 0;
}

.settings-label-text {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.settings-label-desc {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toggle group (segmented control) */
.settings-toggle-group {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.settings-toggle-btn {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.settings-toggle-btn:hover {
  color: var(--text-secondary);
}

.settings-toggle-btn.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

/* Slider */
.settings-slider-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.settings-slider {
  width: 120px;
  height: 4px;
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
  background: var(--bg-tertiary);
  border-radius: 2px;
  outline: none;
}

.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.4);
  -webkit-transition: transform 0.1s ease;
  transition: transform 0.1s ease;
}

.settings-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.settings-slider-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-tertiary);
  min-width: 42px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* iOS-style switch */
.settings-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.settings-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-switch-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-tertiary);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.settings-switch-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.settings-switch input:checked + .settings-switch-slider {
  background: var(--accent-primary);
}

.settings-switch input:checked + .settings-switch-slider::before {
  transform: translateX(20px);
  background: white;
}

/* Footer */
.settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border-subtle);
}

.settings-reset-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  background: transparent;
  color: var(--error);
  cursor: pointer;
  transition: all 0.15s ease;
}

.settings-reset-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.5);
}

.settings-footer-note {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Global Search Panel ────────────────────────────── */
.global-search-panel {
  background: linear-gradient(
    180deg,
    rgba(14, 14, 22, 0.98),
    rgba(10, 10, 16, 0.99)
  );
  border-left: 1px solid var(--border-default);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-sans);
}

.global-search-panel.visible {
  transform: translateX(0);
}

.gs-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.gs-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 0 12px;
  transition: border-color 0.15s ease;
}

.gs-search-row:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

.gs-search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.gs-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  padding: 10px 0;
}

.gs-input::-moz-placeholder {
  color: var(--text-muted);
}

.gs-input::placeholder {
  color: var(--text-muted);
}

.gs-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.1s ease;
  flex-shrink: 0;
}

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

.gs-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 8px;
}

.gs-option {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.gs-option:hover {
  border-color: var(--border-default);
  color: var(--text-secondary);
}

.gs-option input {
  display: none;
}

.gs-option:has(input:checked) {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
}

.gs-info {
  font-size: 12px;
  color: var(--text-muted);
}

.gs-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.gs-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.gs-empty.gs-error {
  color: var(--error);
}

.gs-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.gs-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.gs-file-group {
  margin-bottom: 4px;
}

.gs-file-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s ease;
  position: sticky;
  top: 0;
  background: rgba(14, 14, 22, 0.95);
  backdrop-filter: blur(4px);
  z-index: 1;
}

.gs-file-header:hover {
  background: var(--bg-tertiary);
}

.gs-file-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.gs-file-name {
  font-weight: 600;
  color: var(--text-primary);
}

.gs-file-path {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 11px;
}

.gs-match-count {
  background: rgba(124, 58, 237, 0.2);
  color: var(--accent-tertiary);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}

.gs-match-line {
  display: flex;
  gap: 8px;
  padding: 3px 16px 3px 28px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  transition: background 0.1s ease;
}

.gs-match-line:hover {
  background: var(--bg-tertiary);
}

.gs-line-num {
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.gs-line-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.gs-highlight {
  background: rgba(250, 204, 21, 0.25);
  color: #fbbf24;
  border-radius: 2px;
  padding: 0 1px;
}

/* ─── Dependency Graph Toggle ─────────────────────────── */
#dep-graph-btn.active {
  background: rgba(168, 130, 255, 0.18);
  color: #a882ff;
  box-shadow: 0 0 8px rgba(168, 130, 255, 0.2);
}

.dependency-graph-edges line,
.dependency-graph-edges path {
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* ─── Tab Diff Overlay ─────────────────────────────── */
.tab-diff-overlay {
  position: fixed;
  inset: 0;
  z-index: 99997;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  animation: cpFadeIn 120ms ease-out;
}

.tab-diff-container {
  width: min(1200px, 95vw);
  height: 80vh;
  background: rgba(14, 14, 22, 0.96);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cpSlideDown 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-diff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-diff-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tab-diff-icon {
  font-size: 1.1rem;
}

.tab-diff-stats {
  display: flex;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 500;
}

.tab-diff-stat-add {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.tab-diff-stat-rm {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.tab-diff-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.15s;
}

.tab-diff-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.tab-diff-names {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-diff-name {
  padding: 8px 16px;
  font-size: 0.75rem;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-diff-name-left {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(248, 113, 113, 0.03);
}

.tab-diff-name-right {
  background: rgba(74, 222, 128, 0.03);
}

.tab-diff-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  overflow: hidden;
}

.tab-diff-pane {
  overflow-y: auto;
  overflow-x: auto;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 12px;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

.tab-diff-divider {
  background: rgba(255, 255, 255, 0.06);
}

.tab-diff-line {
  display: flex;
  min-height: 19px;
  white-space: pre;
}

.tab-diff-line.tab-diff-same {
  color: var(--text-secondary);
}

.tab-diff-line.tab-diff-add {
  background: rgba(74, 222, 128, 0.08);
  color: #86efac;
}

.tab-diff-line.tab-diff-remove {
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
}

.tab-diff-gutter {
  width: 42px;
  min-width: 42px;
  text-align: right;
  padding-right: 8px;
  color: rgba(255, 255, 255, 0.15);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  flex-shrink: 0;
}

.tab-diff-marker {
  width: 16px;
  min-width: 16px;
  text-align: center;
  font-weight: 700;
  flex-shrink: 0;
}

.tab-diff-add .tab-diff-marker {
  color: #4ade80;
}

.tab-diff-remove .tab-diff-marker {
  color: #f87171;
}

.tab-diff-code {
  padding-right: 12px;
}

/* ─── Tab Diff Picker ─────────────────────────────── */
.tab-diff-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.tab-diff-picker {
  background: rgba(18, 18, 28, 0.95);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  padding: 16px;
  min-width: 280px;
}

.tab-diff-picker-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-diff-picker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tab-diff-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.12s;
  text-align: left;
  width: 100%;
}

.tab-diff-picker-item:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.2);
  color: var(--text-primary);
}
