.git-history-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ============================================================
   SHADOW VARIABLES for better depth perception
   ============================================================ */
.git-history-layout {
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-elevated: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-floating: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] .git-history-layout {
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-elevated: 0 4px 12px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.15);
  --shadow-floating: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   FILE NAVIGATION SIDEBAR - Quick jump to files
   ============================================================ */
.file-nav-toggle {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: 7px;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-nav-toggle:hover {
  background: var(--color-surface);
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(var(--color-accent-rgb), 0.12);
}

.file-nav-toggle:active {
  transform: scale(0.98);
}

.file-nav-toggle:disabled,
.file-nav-toggle[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.file-nav-toggle:disabled:hover,
.file-nav-toggle[aria-disabled="true"]:hover {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}

.file-nav-toggle::before {
  content: '';
  width: 14px;
  height: 14px;
  background: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
}

.file-nav-sidebar {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 100;
  width: 340px;
  max-height: 420px;
  margin-top: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-floating);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.file-nav-sidebar.open {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: fileNavSlideIn 0.2s ease forwards;
}

@keyframes fileNavSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.file-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-muted);
}

.file-nav-header h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-nav-header h4::before {
  content: '';
  width: 14px;
  height: 14px;
  background: var(--color-accent);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
}

.file-nav-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.file-nav-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 340px;
  overflow-y: auto;
}

.file-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.file-nav-item:hover {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
  transform: translateX(2px);
}

.file-nav-item:active {
  transform: translateX(2px) scale(0.99);
}

.file-nav-item.active {
  background: rgba(var(--color-accent-rgb), 0.08);
  border-color: rgba(var(--color-accent-rgb), 0.2);
}

.file-nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-nav-icon.added {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
}

.file-nav-icon.modified {
  background: rgba(251, 191, 36, 0.15);
  color: #f59e0b;
}

.file-nav-icon.deleted {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

.file-nav-icon svg {
  width: 10px;
  height: 10px;
}

.file-nav-name {
  flex: 1;
  min-width: 0;
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 11px;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-nav-stats {
  display: flex;
  gap: 6px;
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 10px;
  flex-shrink: 0;
}

.file-nav-stats .add {
  color: var(--color-success);
}

.file-nav-stats .del {
  color: var(--color-danger);
}

/* ============================================================
   CONTROL BAR - Enhanced with icon indicators and better grouping
   ============================================================ */
.git-history-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 22px;
  border-radius: var(--radius-medium);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-elevated);
  align-items: flex-end;
  position: relative;
}

/* Subtle gradient overlay for depth */
.git-history-controls::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.5) 0%, transparent 100%);
  pointer-events: none;
  opacity: 0.3;
}

:root[data-theme="dark"] .git-history-controls::before {
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
  flex: 1 1 160px;
}

.control-group label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-group label::before {
  content: '';
  width: 12px;
  height: 12px;
  background: currentColor;
  opacity: 0.5;
  mask-size: contain;
  mask-repeat: no-repeat;
  flex-shrink: 0;
}

/* Environment icon */
.control-group:has(#env-select) label::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E");
}

/* Repository icon */
.control-group:has(#repo-select) label::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}

/* Branch icon */
.control-group:has(#branch-select) label::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='6' y1='3' x2='6' y2='15'/%3E%3Ccircle cx='18' cy='6' r='3'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Cpath d='M18 9a9 9 0 0 1-9 9'/%3E%3C/svg%3E");
}

/* Native select styling (hidden when CustomSelect is active) */
.control-group select {
  padding: 10px 14px;
  padding-right: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  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='%235a6480' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.control-group select:hover {
  border-color: var(--color-accent);
  background-color: var(--color-surface-muted);
}

.control-group select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.15);
}

.control-group select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background-color: var(--color-surface-muted);
}

/* ============================================================
   CUSTOM SELECT OVERRIDES - HTML-based dropdown styling
   ============================================================ */
.control-group .custom-select {
  width: 100%;
}

.control-group .custom-select-trigger {
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
}

.control-group .custom-select-trigger:hover {
  border-color: var(--color-accent);
  background-color: var(--color-surface-muted);
}

.control-group .custom-select-trigger.open {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.15);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.control-group .custom-select-trigger.placeholder {
  color: var(--color-text-muted);
}

.control-group .custom-select.disabled .custom-select-trigger {
  opacity: 0.4;
  cursor: not-allowed;
  background-color: var(--color-surface-muted);
}

.control-group .custom-select-arrow {
  font-size: 10px;
  color: var(--color-text-muted);
  transition: transform var(--transition-fast);
  margin-left: 8px;
}

.control-group .custom-select-trigger.open .custom-select-arrow {
  transform: rotate(180deg);
}

.control-group .custom-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-surface);
  border: 1px solid var(--color-accent);
  border-top: none;
  border-radius: 0 0 var(--radius-small) var(--radius-small);
  box-shadow: var(--shadow-floating);
  max-height: 280px;
  overflow: hidden;
  display: none;
}

.control-group .custom-select-dropdown.open {
  display: block;
  animation: dropdownSlideIn 0.15s ease-out;
}

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

.control-group .custom-select-search {
  padding: 8px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  position: sticky;
  top: 0;
  z-index: 1;
}

.control-group .custom-select-search-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  font-size: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition-fast);
}

.control-group .custom-select-search-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.control-group .custom-select-search-input::placeholder {
  color: var(--color-text-muted);
}

.control-group .custom-select-options {
  max-height: 220px;
  overflow-y: auto;
}

.control-group .custom-select-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: background var(--transition-fast);
  border-left: 3px solid transparent;
}

.control-group .custom-select-option:hover {
  background: rgba(var(--color-accent-rgb), 0.08);
  border-left-color: var(--color-accent);
}

.control-group .custom-select-option.selected {
  background: rgba(var(--color-accent-rgb), 0.12);
  font-weight: 600;
  color: var(--color-accent);
  border-left-color: var(--color-accent);
}

.control-group .custom-select-option.disabled {
  color: var(--color-text-muted);
  cursor: not-allowed;
  font-style: italic;
}

.control-group .custom-select-option.disabled:hover {
  background: transparent;
  border-left-color: transparent;
}

/* Branch-specific styling - monospace font for branch names */
.control-group:has(#branch-select) .custom-select-option {
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 12px;
}

.control-group:has(#branch-select) .custom-select-trigger-text {
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 12px;
}

.control-group:has(#branch-select) .custom-select-search-input {
  font-family: "JetBrains Mono", "SF Mono", monospace;
}

.search-group {
  flex: 2 1 240px;
}

.search-group label::before {
  display: none;
}

.search-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-small);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.search-input:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.15);
  background: var(--color-surface);
}

.search-input::before {
  content: '';
  width: 16px;
  height: 16px;
  background: currentColor;
  opacity: 0.4;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.search-input:focus-within::before {
  opacity: 0.7;
}

.search-input input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 13px;
  color: var(--color-text);
  min-width: 0;
}

.search-input input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-input input[type="search"]::-ms-clear {
  display: none;
  width: 0;
  height: 0;
}

.search-input input:focus-visible {
  outline: none;
}

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

#clear-search-btn {
  padding: 4px 8px;
  font-size: 11px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

#clear-search-btn:hover {
  opacity: 1;
}

.view-group {
  flex: 0 0 auto;
  min-width: auto;
}

.view-group label::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15V6'/%3E%3Cpath d='M18.5 18a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z'/%3E%3Cpath d='M12 12H3'/%3E%3Cpath d='M16 6H3'/%3E%3Cpath d='M12 18H3'/%3E%3C/svg%3E");
}

.segmented-control {
  display: inline-flex;
  border-radius: var(--radius-small);
  border: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  padding: 3px;
  gap: 2px;
}

.segmented-btn {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.segmented-btn::before {
  content: '';
  width: 14px;
  height: 14px;
  background: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  flex-shrink: 0;
  opacity: 0.7;
}

.segmented-btn[data-view="unified"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cline x1='3' y1='12' x2='21' y2='12'/%3E%3Cline x1='3' y1='18' x2='21' y2='18'/%3E%3C/svg%3E");
}

.segmented-btn[data-view="split"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cline x1='12' y1='3' x2='12' y2='21'/%3E%3C/svg%3E");
}

.segmented-btn:hover:not(.active) {
  color: var(--color-text);
  background: rgba(var(--color-accent-rgb), 0.08);
}

.segmented-btn.active {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 2px 8px rgba(var(--color-accent-rgb), 0.25);
}

.segmented-btn.active::before {
  opacity: 1;
}

/* ============================================================
   MAIN BODY LAYOUT - Improved grid with better proportions
   ============================================================ */
.git-history-body {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  min-height: 0;
}

.commit-list-panel,
.commit-detail-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  transition: box-shadow var(--transition-normal);
}

.commit-list-panel:hover,
.commit-detail-panel:hover {
  box-shadow: var(--shadow-floating);
}

/* ============================================================
   COMMIT LIST PANEL - Enhanced timeline design
   ============================================================ */
.commit-list-panel {
  display: flex;
  flex-direction: column;
  min-height: 480px;
  max-height: calc(100vh - 280px);
}

.commit-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.commit-list-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
}

.commit-list-header h2::before {
  content: '';
  width: 16px;
  height: 16px;
  background: var(--color-accent);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cline x1='1.05' y1='12' x2='7' y2='12'/%3E%3Cline x1='17.01' y1='12' x2='22.96' y2='12'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  flex-shrink: 0;
}

#commit-count {
  font-size: 11px;
  margin-top: 2px;
}

.pagination-controls {
  display: flex;
  gap: 4px;
}

.pagination-controls button {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
}

.commit-list {
  list-style: none;
  padding: 8px 12px 12px 12px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
  scroll-behavior: smooth;
}

/* Custom scrollbar for commit list */
.commit-list::-webkit-scrollbar {
  width: 5px;
}

.commit-list::-webkit-scrollbar-track {
  background: transparent;
}

.commit-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.commit-list::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ============================================================
   COMMIT ITEMS - Refined timeline with better visual hierarchy
   ============================================================ */
.commit-item {
  position: relative;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  padding: 14px 16px;
  padding-left: 36px;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  will-change: transform, background-color;
}

/* Timeline connector - refined dot style */
.commit-item::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-surface-muted);
  border: 2px solid var(--color-border);
  transition: all var(--transition-fast);
  z-index: 1;
}

/* Vertical timeline line */
.commit-item::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
  opacity: 0.4;
  border-radius: 1px;
}

.commit-item:first-child::after {
  top: 50%;
  background: linear-gradient(180deg, transparent 0%, var(--color-border) 30%);
}

.commit-item:last-child::after {
  bottom: 50%;
  background: linear-gradient(180deg, var(--color-border) 70%, transparent 100%);
}

.commit-item:only-child::after {
  display: none;
}

.commit-item:hover {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
  transform: translateX(3px);
}

.commit-item:hover::before {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 0 0 4px rgba(var(--color-accent-rgb), 0.12);
}

.commit-item.selected {
  background: rgba(var(--color-accent-rgb), 0.06);
  border-color: rgba(var(--color-accent-rgb), 0.25);
  transform: translateX(3px);
}

.commit-item.selected::before {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 5px rgba(var(--color-accent-rgb), 0.15), 0 0 12px rgba(var(--color-accent-rgb), 0.2);
  transform: translateY(-50%) scale(1.25);
}

/* Pulse animation for selected commit */
.commit-item.selected::before {
  animation: commitPulse 2s ease-in-out infinite;
}

@keyframes commitPulse {
  0%, 100% {
    box-shadow: 0 0 0 5px rgba(var(--color-accent-rgb), 0.15), 0 0 12px rgba(var(--color-accent-rgb), 0.2);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(var(--color-accent-rgb), 0.1), 0 0 16px rgba(var(--color-accent-rgb), 0.15);
  }
}

.commit-message {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--color-text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-fast);
}

.commit-item:hover .commit-message {
  color: var(--color-text);
}

.commit-item.selected .commit-message {
  font-weight: 600;
  color: var(--color-accent);
}

.commit-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--color-text-muted);
}

.commit-meta-row span:not(.commit-tag) {
  display: flex;
  align-items: center;
  gap: 4px;
}

.commit-meta-row span:not(:last-child):not(.commit-tag)::after {
  content: '';
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  margin-left: 4px;
  opacity: 0.4;
}

.commit-tag {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

:root[data-theme="dark"] .commit-tag {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

/* Author chip with avatar */
.commit-author-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.author-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--avatar-color, var(--color-accent));
  color: white;
  font-size: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.commit-short-hash {
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 10px;
  background: var(--color-surface-muted);
  padding: 3px 7px;
  border-radius: 5px;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.commit-item:hover .commit-short-hash {
  background: rgba(var(--color-accent-rgb), 0.1);
  border-color: rgba(var(--color-accent-rgb), 0.2);
  color: var(--color-accent);
}

.commit-item.selected .commit-short-hash {
  background: rgba(var(--color-accent-rgb), 0.12);
  border-color: rgba(var(--color-accent-rgb), 0.25);
  color: var(--color-accent);
  font-weight: 600;
}

.commit-time {
  opacity: 0.8;
}

/* Commit type indicators */
.commit-type-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.commit-type-indicator.feat {
  background: rgba(34, 197, 94, 0.12);
  color: var(--color-success);
}

.commit-type-indicator.fix {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-danger);
}

.commit-type-indicator.refactor {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.commit-type-indicator.docs {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

.commit-type-indicator.chore {
  background: rgba(107, 114, 128, 0.12);
  color: var(--color-text-muted);
}

.commit-type-indicator.test {
  background: rgba(251, 191, 36, 0.12);
  color: #f59e0b;
}

/* Empty state in commit list */
.commit-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
  color: var(--color-text-muted);
}

.commit-list-empty .empty-state-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  opacity: 0.4;
}

.commit-list-empty p {
  margin: 0;
  font-size: 12px;
}

/* Commit item entrance animation - subtle */
@keyframes commitSlideIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.commit-item {
  animation: commitSlideIn 0.2s ease forwards;
  opacity: 0;
}

/* Loading skeleton styles */
.commit-item-skeleton {
  pointer-events: none;
  animation: none;
  opacity: 1;
}

.commit-item-skeleton::before,
.commit-item-skeleton::after {
  display: none;
}

.skeleton-message {
  height: 16px;
  width: 85%;
  margin-bottom: 12px;
}

.skeleton-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skeleton-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.skeleton-text {
  height: 12px;
  width: 80px;
}

.skeleton-text-short {
  height: 12px;
  width: 50px;
}

/* ============================================================
   COMMIT DETAIL PANEL - Better header and improved organization
   ============================================================ */
.commit-detail-panel {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.commit-detail {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  flex: 1;
  overflow: hidden;
}

.commit-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.commit-title {
  flex: 1;
  min-width: 0;
}

.commit-title h2 {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--color-text);
}

.commit-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.commit-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Author avatar placeholder */
#commit-author::before {
  content: '';
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, var(--color-accent) 0%, #8b5cf6 100%);
  border-radius: 50%;
  flex-shrink: 0;
}

#commit-date::before {
  content: '';
  width: 13px;
  height: 13px;
  background: currentColor;
  opacity: 0.5;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  flex-shrink: 0;
}

#commit-hash {
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 11px;
  background: var(--color-surface-muted);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  letter-spacing: 0.02em;
}

.meta-separator {
  display: none;
}

.commit-actions {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
}

.commit-actions-dropdown {
  position: relative;
}

.commit-actions-menu-btn {
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 7px;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: relative;
  overflow: hidden;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.commit-actions-menu-btn::before {
  content: '';
  width: 14px;
  height: 14px;
  background: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.commit-actions-menu-btn::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/svg%3E");
}

.commit-actions-menu-btn:hover::before {
  transform: scale(1.1);
}

.commit-actions-menu-btn:hover,
.commit-actions-menu-btn[aria-expanded="true"] {
  background: var(--color-surface);
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(var(--color-accent-rgb), 0.15);
}

.commit-actions-menu-btn:active {
  transform: scale(0.98);
}

.commit-actions-menu {
  min-width: 220px;
}

.commit-actions-menu .dropdown-item {
  font-size: 13px;
}

.commit-actions-menu .dropdown-item[hidden] {
  display: none;
}

.commit-actions-menu .dropdown-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: auto;
}

.commit-actions-menu .dropdown-item:disabled:hover {
  background: none;
  color: var(--color-text-secondary);
  transform: none;
  box-shadow: none;
}

.commit-action-danger {
  color: var(--color-danger);
}

#merge-branch-btn {
  display: flex;
  align-items: center;
  gap: 7px;
}

#merge-branch-btn::before {
  content: '';
  width: 13px;
  height: 13px;
  background: currentColor;
  opacity: 0.6;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3v12'/%3E%3Ccircle cx='18' cy='6' r='3'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Cpath d='M18 9a9 9 0 0 1-9 9'/%3E%3Cpath d='M13 3h8'/%3E%3C/svg%3E");
}

#merge-branch-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   DIFF SUBHEADER - Stats and controls
   ============================================================ */
.commit-detail-subheader {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.file-nav-container {
  position: relative;
}

.merge-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.merge-controls label {
  font-weight: 500;
}

.merge-controls select {
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 12px;
  cursor: pointer;
}

.diff-stats {
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.diff-stats::before {
  content: '';
  width: 14px;
  height: 14px;
  background: currentColor;
  opacity: 0.5;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cpolyline points='10 9 9 9 8 9'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  flex-shrink: 0;
}

.diff-stat-files {
  color: var(--color-text);
}

.diff-stat-separator {
  opacity: 0.4;
}

.diff-stat-add {
  color: var(--color-success);
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 11px;
}

.diff-stat-del {
  color: var(--color-danger);
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 11px;
}

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

.diff-actions button {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 5px;
}

.diff-actions .file-nav-toggle {
  display: flex;
}

/* ============================================================
   DIFF CONTAINER - File cards and content
   ============================================================ */
.commit-diff {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.diff-truncated-banner {
  border: 1px solid rgba(244, 183, 64, 0.45);
  background: rgba(244, 183, 64, 0.12);
  color: var(--color-text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}

.diff-large-commit-banner {
  border: 1px solid rgba(var(--color-accent-rgb), 0.32);
  background: rgba(var(--color-accent-rgb), 0.1);
  color: var(--color-text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}

.diff-files-host {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.diff-load-more-control {
  display: flex;
  justify-content: center;
  padding: 4px 0 12px;
}

.diff-load-more-btn {
  min-width: 240px;
}

.diff-load-complete {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Custom scrollbar for diff area */
.commit-diff::-webkit-scrollbar {
  width: 6px;
}

.commit-diff::-webkit-scrollbar-track {
  background: transparent;
}

.commit-diff::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.commit-diff::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* File diff card styling - refined */
.file-diff {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  background: var(--color-surface);
  overflow: hidden;
  transition: all var(--transition-normal);
  scroll-margin-top: 20px;
  box-shadow: var(--shadow-subtle);
}

.file-diff:hover {
  border-color: rgba(var(--color-accent-rgb), 0.35);
  box-shadow: var(--shadow-elevated);
}

.file-diff:target,
.file-diff.highlighted {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.2), var(--shadow-elevated);
  animation: fileHighlight 0.6s ease;
}

@keyframes fileHighlight {
  0% {
    box-shadow: 0 0 0 8px rgba(var(--color-accent-rgb), 0.35);
    transform: scale(1.005);
  }
  100% {
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.2), var(--shadow-elevated);
    transform: scale(1);
  }
}

/* File status badge */
.file-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.file-diff-header:hover .file-status-badge {
  transform: scale(1.1);
}

.file-status-badge.added {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.file-status-badge.modified {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(251, 191, 36, 0.1) 100%);
  color: #f59e0b;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.file-status-badge.deleted {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.file-status-badge.renamed {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
  color: #8b5cf6;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.file-diff-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.file-diff-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background var(--transition-fast);
}

.file-diff-header:hover {
  background: rgba(var(--color-accent-rgb), 0.05);
}

.file-diff-header:hover::before {
  background: var(--color-accent);
}

.file-diff-header:active {
  background: rgba(var(--color-accent-rgb), 0.08);
}

.file-diff-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.file-diff-name {
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-diff-stat {
  font-size: 11px;
  color: var(--color-text-muted);
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  font-family: "JetBrains Mono", "SF Mono", monospace;
}

.file-diff-stat .diff-add {
  color: var(--color-success);
  font-weight: 600;
}

.file-diff-stat .diff-del {
  color: var(--color-danger);
  font-weight: 600;
}

.file-diff-toggle-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  padding: 0;
}

.file-diff-toggle-btn:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(var(--color-accent-rgb), 0.25);
}

.file-diff-toggle-btn:active {
  transform: scale(0.95);
}

.file-diff-toggle-btn::before {
  content: '';
  width: 12px;
  height: 12px;
  background: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  transition: transform var(--transition-normal);
}

.file-diff-toggle-btn[data-collapsed="false"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.file-diff-toggle-btn[data-collapsed="true"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
}

/* Rotate animation when state changes */
.file-diff-toggle-btn[data-collapsed="true"]::before {
  transform: rotate(0deg);
}

.file-diff-toggle-btn[data-collapsed="false"]::before {
  transform: rotate(0deg);
}

.file-diff-content {
  max-height: 600px;
  overflow-y: auto;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.file-diff-content.collapsed {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}

/* Scroll shadow indicator for diff content */
.file-diff-content::before {
  content: '';
  position: sticky;
  top: 0;
  display: block;
  height: 0;
  box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.1);
  z-index: 4;
  pointer-events: none;
}

/* Diff hunk styling - refined */
.diff-hunk {
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 12px;
}

.diff-hunk-header {
  background: rgba(var(--color-accent-rgb), 0.04);
  color: var(--color-text-muted);
  padding: 6px 14px;
  font-size: 11px;
  border-top: 1px solid var(--color-border);
  font-style: normal;
  opacity: 0.8;
}

.diff-hunk:first-child .diff-hunk-header {
  border-top: none;
}

/* ============================================================
   BRANCH PILL - Hero area indicator
   ============================================================ */
.git-branch-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(var(--color-accent-rgb), 0.1);
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(var(--color-accent-rgb), 0.2);
}

.git-branch-pill::before {
  content: '';
  width: 12px;
  height: 12px;
  background: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='6' y1='3' x2='6' y2='15'/%3E%3Ccircle cx='18' cy='6' r='3'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Cpath d='M18 9a9 9 0 0 1-9 9'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  flex-shrink: 0;
}

#repo-branch-name {
  font-family: "JetBrains Mono", "SF Mono", monospace;
}

.branch-label {
  display: none;
}

/* ============================================================
   SPLIT DIFF VIEW - Side-by-side comparison
   ============================================================ */
.split-diff-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.split-diff-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

:root[data-theme="dark"] .split-diff-row {
  border-bottom-color: rgba(255, 255, 255, 0.04);
}

.split-diff-row:last-child {
  border-bottom: none;
}

.split-diff-cell {
  display: flex;
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  border-right: 1px solid var(--color-border);
}

.split-diff-cell:last-child {
  border-right: none;
}

.split-line-num {
  min-width: 48px;
  padding: 3px 8px;
  text-align: right;
  user-select: none;
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  border-right: 1px solid var(--color-border);
  font-size: 10px;
  opacity: 0.8;
}

.split-line-content {
  flex: 1;
  padding: 3px 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

.split-add {
  background: rgba(34, 197, 94, 0.08);
  border-left: 2px solid rgba(34, 197, 94, 0.4);
}

.split-add .split-line-num {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
  opacity: 1;
}

.split-add .split-line-content {
  color: #166534;
}

:root[data-theme="dark"] .split-add .split-line-content {
  color: #4ade80;
}

.split-remove {
  background: rgba(239, 68, 68, 0.08);
  border-left: 2px solid rgba(239, 68, 68, 0.4);
}

.split-remove .split-line-num {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
  opacity: 1;
}

.split-remove .split-line-content {
  color: #991b1b;
}

:root[data-theme="dark"] .split-remove .split-line-content {
  color: #f87171;
}

/* Hover effect on split diff cells */
.split-diff-cell:hover:not(.split-empty) {
  filter: brightness(0.97);
}

:root[data-theme="dark"] .split-diff-cell:hover:not(.split-empty) {
  filter: brightness(1.1);
}

.split-context .split-line-content {
  color: var(--color-text-muted);
}

.split-empty {
  background: var(--color-surface-muted);
  opacity: 0.5;
}

.split-meta {
  color: var(--color-text-muted);
  font-style: italic;
  font-size: 10px;
}

/* ============================================================
   UNIFIED DIFF VIEW - Enhanced line styling
   ============================================================ */
.git-history-layout .diff-line {
  display: flex;
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.git-history-layout .diff-line-num {
  min-width: 48px;
  padding: 3px 8px;
  text-align: right;
  user-select: none;
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  border-right: 1px solid var(--color-border);
  font-size: 10px;
  opacity: 0.8;
}

.git-history-layout .diff-line-content {
  flex: 1;
  padding: 3px 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

.git-history-layout .diff-line.diff-add {
  background: rgba(34, 197, 94, 0.08);
  border-left: 3px solid rgba(34, 197, 94, 0.4);
}

.git-history-layout .diff-line.diff-add .diff-line-num {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
  opacity: 1;
}

.git-history-layout .diff-line.diff-add .diff-line-content {
  color: #166534;
}

:root[data-theme="dark"] .git-history-layout .diff-line.diff-add .diff-line-content {
  color: #4ade80;
}

.git-history-layout .diff-line.diff-remove {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid rgba(239, 68, 68, 0.4);
}

.git-history-layout .diff-line.diff-remove .diff-line-num {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
  opacity: 1;
}

.git-history-layout .diff-line.diff-remove .diff-line-content {
  color: #991b1b;
}

:root[data-theme="dark"] .git-history-layout .diff-line.diff-remove .diff-line-content {
  color: #f87171;
}

/* Hover effect on diff lines */
.git-history-layout .diff-line:hover {
  filter: brightness(0.97);
}

:root[data-theme="dark"] .git-history-layout .diff-line:hover {
  filter: brightness(1.1);
}

.git-history-layout .diff-line.diff-context .diff-line-content {
  color: var(--color-text-muted);
}

.git-history-layout .diff-line.diff-meta .diff-line-content {
  color: var(--color-text-muted);
  font-style: italic;
  font-size: 11px;
}

/* Word-level diff highlighting */
.diff-word-add {
  background: rgba(34, 197, 94, 0.25);
  border-radius: 2px;
  padding: 0 1px;
}

.diff-word-remove {
  background: rgba(239, 68, 68, 0.25);
  border-radius: 2px;
  padding: 0 1px;
}

/* Diff prefix (+/-) styling */
.git-history-layout .diff-prefix {
  user-select: none;
  margin-right: 6px;
  font-weight: 600;
  opacity: 0.7;
}

/* ============================================================
   EMPTY STATE - Placeholder and loading states
   ============================================================ */
.empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 28px;
  text-align: center;
  color: var(--color-text-muted);
  min-height: 320px;
  animation: fadeInUp 0.5s ease;
  background: linear-gradient(180deg, transparent 0%, rgba(var(--color-accent-rgb), 0.02) 100%);
}

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

.empty-state-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--color-surface) 0%, var(--color-surface-muted) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 24px;
  color: var(--color-accent);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 16px rgba(var(--color-accent-rgb), 0.08), inset 0 1px 0 rgba(255,255,255,0.5);
  animation: iconFloat 4s ease-in-out infinite;
  position: relative;
}

.empty-state-icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px dashed var(--color-border);
  opacity: 0.4;
  animation: iconSpin 20s linear infinite;
}

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

@keyframes iconFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.empty-state-icon svg {
  opacity: 0.8;
}

.empty-state-card h2 {
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

.empty-state-card p {
  margin: 0;
  font-size: 13px;
  max-width: 300px;
  line-height: 1.65;
  opacity: 0.85;
}

/* Keyboard hints */
.keyboard-hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  font-size: 11px;
  color: var(--color-text-muted);
}

.keyboard-hints .hint {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.75;
  transition: all var(--transition-fast);
  padding: 6px 10px;
  border-radius: 6px;
}

.keyboard-hints .hint:hover {
  opacity: 1;
  background: var(--color-surface-muted);
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface-muted) 100%);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text);
  box-shadow: 0 2px 0 var(--color-border), 0 2px 4px rgba(0, 0, 0, 0.06);
  transition: all var(--transition-fast);
}

kbd:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 0 var(--color-border), 0 4px 8px rgba(0, 0, 0, 0.1);
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface) 100%);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Add a subtle key press animation */
kbd:active {
  transform: translateY(1px);
  box-shadow: 0 0 0 var(--color-border);
}

/* Loading state */
.commit-item.loading {
  pointer-events: none;
  opacity: 0.7;
}

/* Keyboard navigation focus styles */
.commit-item:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.2);
  background: rgba(var(--color-accent-rgb), 0.04);
}

.commit-item:focus::before {
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(var(--color-accent-rgb), 0.15);
}

/* Focus visible for keyboard-only navigation */
.commit-item:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Global focus-visible styles for accessibility */
.git-history-layout button:focus-visible,
.git-history-layout select:focus-visible,
.git-history-layout input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.git-history-layout .search-input input:focus-visible {
  outline: none;
}

/* Skip to content pattern */
.git-history-layout [tabindex="-1"]:focus {
  outline: none;
}

/* Animation for loading */
@keyframes shimmer {
  0% {
    background-position: -300px 0;
  }
  100% {
    background-position: 300px 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-muted) 0%,
    rgba(var(--color-accent-rgb), 0.05) 25%,
    var(--color-surface) 50%,
    rgba(var(--color-accent-rgb), 0.05) 75%,
    var(--color-surface-muted) 100%
  );
  background-size: 600px 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: var(--radius-small);
}

/* Loading skeleton pulse effect */
.commit-item-skeleton {
  opacity: 0.7;
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

/* ============================================================
   RESPONSIVE DESIGN - Improved breakpoints and mobile layout
   ============================================================ */
@media (max-width: 1100px) {
  .git-history-body {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 16px;
  }
}

@media (max-width: 960px) {
  .git-history-body {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .commit-list-panel {
    max-height: 360px;
    min-height: auto;
  }

  .commit-detail-panel {
    min-height: 400px;
  }

  .commit-diff {
    padding: 14px;
  }

  .split-diff-row {
    grid-template-columns: 1fr;
  }

  .split-diff-cell:first-child {
    border-bottom: 1px solid var(--color-border);
    border-right: none;
  }
}

@media (max-width: 720px) {
  .git-history-layout {
    gap: 14px;
  }

  .git-history-controls {
    padding: 14px;
    gap: 10px;
  }

  .control-group {
    min-width: calc(50% - 5px);
    flex: 1 1 calc(50% - 5px);
  }

  .search-group {
    flex: 1 1 100%;
    order: 3;
  }

  .view-group {
    flex: 1 1 100%;
    order: 4;
  }

  .control-group label {
    font-size: 9px;
  }
}

@media (max-width: 540px) {
  .git-history-controls {
    padding: 12px;
    gap: 8px;
  }

  .control-group {
    min-width: 100%;
    flex: 1 1 100%;
  }

  .control-group select {
    padding: 10px 12px;
    font-size: 14px;
  }

  .search-input {
    padding: 10px 12px;
  }

  .commit-list-header {
    padding: 12px 14px;
    flex-wrap: wrap;
  }

  .commit-list-header h2 {
    font-size: 12px;
  }

  .commit-list {
    padding: 6px 10px 10px 10px;
    gap: 2px;
  }

  .commit-item {
    padding: 12px 12px 12px 26px;
  }

  .commit-item::before {
    left: 8px;
  }

  .commit-item::after {
    left: 12px;
  }

  .commit-item:hover {
    transform: none;
  }

  .commit-message {
    font-size: 13px;
    -webkit-line-clamp: 3;
  }

  .commit-meta-row {
    font-size: 11px;
    gap: 6px;
    flex-wrap: wrap;
  }

  .commit-type-indicator {
    font-size: 8px;
    padding: 2px 5px;
  }

  .commit-detail-header {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    gap: 12px;
  }

  .commit-title h2 {
    font-size: 15px;
    line-height: 1.4;
  }

  .commit-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
  }

  .commit-actions {
    width: 100%;
  }

  .commit-actions-dropdown,
  .commit-actions-menu-btn {
    width: 100%;
  }

  .commit-actions-menu-btn {
    justify-content: center;
  }

  .commit-detail-subheader {
    padding: 10px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .diff-stats {
    justify-content: flex-start;
    font-size: 11px;
  }

  .diff-actions {
    justify-content: space-between;
    width: 100%;
  }

  .diff-actions .file-nav-toggle {
    flex: 1;
    justify-content: center;
  }

  .file-nav-sidebar {
    width: calc(100vw - 40px);
    max-width: 320px;
    right: -14px;
  }

  .commit-diff {
    padding: 10px;
    gap: 10px;
  }

  .file-diff-header {
    padding: 10px 12px;
  }

  .file-status-badge {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }

  .file-diff-name {
    font-size: 11px;
  }

  .file-diff-stat {
    font-size: 10px;
  }

  .file-diff-toggle-btn {
    width: 28px;
    height: 28px;
  }

  .split-line-num {
    min-width: 36px;
    padding: 3px 5px;
    font-size: 9px;
  }

  .split-line-content {
    padding: 3px 8px;
    font-size: 10px;
  }

  .diff-hunk-header {
    padding: 6px 10px;
    font-size: 10px;
  }

  .git-history-layout .diff-line {
    font-size: 11px;
  }

  .git-history-layout .diff-line-num {
    min-width: 40px;
    font-size: 9px;
  }

  .git-history-layout .diff-line-content {
    padding: 3px 8px;
  }

  .keyboard-hints {
    display: none;
  }

  .empty-state-card {
    padding: 32px 20px;
    min-height: 220px;
  }

  .empty-state-icon {
    width: 52px;
    height: 52px;
  }

  .empty-state-card h2 {
    font-size: 15px;
  }
}

/* ============================================================
   SOURCE INDICATOR - Shows when data is from remote provider
   ============================================================ */
.source-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #7c3aed;
  margin-left: 8px;
  cursor: help;
  transition: all var(--transition-fast);
}

.source-indicator:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.15));
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.source-indicator .source-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

:root[data-theme="dark"] .source-indicator {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.15));
  border-color: rgba(139, 92, 246, 0.35);
  color: #a78bfa;
}

:root[data-theme="dark"] .source-indicator:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(99, 102, 241, 0.2));
  border-color: rgba(139, 92, 246, 0.5);
}

/* ============================================================
   GIT ACTION MODAL
   ============================================================ */
.git-action-modal-content {
  max-width: 560px;
}

.git-action-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.git-action-description {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.git-action-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
}

.git-action-summary > div,
.git-action-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.git-action-summary-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.git-action-row code,
.git-action-summary strong {
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 12px;
  color: var(--color-text);
}

.git-action-form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.git-action-form-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}

.git-action-form-row select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
}

.git-action-form-row select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.15);
}

.git-action-hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.git-action-note {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(var(--color-accent-rgb), 0.08);
  border: 1px solid rgba(var(--color-accent-rgb), 0.18);
  color: var(--color-text);
  font-size: 12px;
  line-height: 1.5;
}

:root[data-theme="dark"] .git-action-note {
  background: rgba(var(--color-accent-rgb), 0.12);
  border-color: rgba(var(--color-accent-rgb), 0.24);
}

/* ============================================================
   MAXIMIZE/RESTORE DIFF PANEL
   ============================================================ */
.maximize-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.maximize-btn:hover {
  background: var(--color-surface);
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(var(--color-accent-rgb), 0.12);
}

.maximize-btn .maximize-icon,
.maximize-btn .restore-icon {
  flex-shrink: 0;
}

/* Maximized state */
.git-history-body.maximized {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--color-background);
  padding: 0;
  display: flex;
  overflow: hidden;
}

.git-history-body.maximized .commit-list-panel {
  display: none;
}

.git-history-body.maximized .commit-detail-panel {
  position: relative;
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.git-history-body.maximized .commit-detail {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.git-history-body.maximized .commit-diff {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

/* In maximized mode, file-diff elements shouldn't shrink */
.git-history-body.maximized .file-diff {
  flex-shrink: 0;
}

/* In maximized mode, file-diff-content expands fully (no max-height constraint) */
/* The outer commit-diff container handles scrolling */
.git-history-body.maximized .file-diff-content {
  max-height: none;
  overflow-y: visible;
}

.git-history-body.maximized .file-diff-content.collapsed {
  max-height: 0;
  overflow: hidden;
}

/* Update button appearance when maximized */
.git-history-body.maximized .maximize-btn {
  background: rgba(var(--color-accent-rgb), 0.1);
  border-color: rgba(var(--color-accent-rgb), 0.3);
  color: var(--color-accent);
}

.git-history-body.maximized .maximize-btn:hover {
  background: rgba(var(--color-accent-rgb), 0.15);
  box-shadow: 0 2px 8px rgba(var(--color-accent-rgb), 0.2);
}

.git-history-body.maximized .maximize-btn .maximize-icon {
  display: none;
}

.git-history-body.maximized .maximize-btn .restore-icon {
  display: block;
}

.git-history-body.maximized .maximize-btn .maximize-text {
  display: none;
}

.git-history-body.maximized .maximize-btn::after {
  content: 'Restore';
}

/* Hide maximize button text on small screens */
@media (max-width: 720px) {
  .maximize-btn .maximize-text {
    display: none;
  }

  .git-history-body.maximized .maximize-btn::after {
    display: none;
  }
}

/* Ensure proper stacking when maximized */
body:has(.git-history-body.maximized) {
  overflow: hidden;
}

/* Animation for maximize/restore */
.git-history-body {
  transition: none;
}

.git-history-body.maximized .commit-detail-panel {
  animation: maximizeIn 0.2s ease-out;
}

@keyframes maximizeIn {
  from {
    opacity: 0.8;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Print styles */
@media print {
  .git-history-controls,
  .commit-actions,
  .diff-actions,
  .pagination-controls,
  .source-indicator {
    display: none;
  }

  .commit-list-panel {
    page-break-after: always;
  }

  .file-diff-content {
    max-height: none;
  }

  .file-diff-content.collapsed {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .git-action-summary {
    grid-template-columns: 1fr;
  }
}
