/* --------------------------------------------------------------------------
   Center Pane: Main Content & Reading View
   -------------------------------------------------------------------------- */
#main-pane {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-content);
  min-width: 300px;
  overflow: hidden;
  position: relative;
}

/* Restore Buttons for Collapsed Side Panels */
.panel-restore-btn {
  position: absolute;
  top: 5px;
  z-index: 25;
  width: 28px;
  height: 28px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: all var(--transition-fast);
}

.panel-restore-btn.left {
  left: 6px;
}

.panel-restore-btn.right {
  right: 6px;
}

.panel-restore-btn.hidden {
  display: none !important;
}

.panel-restore-btn:hover {
  color: var(--text-accent);
  border-color: var(--accent);
  background: var(--bg-active);
}

#main-pane.left-collapsed #tab-bar {
  padding-left: 38px;
}

#main-pane.right-collapsed #tab-bar {
  padding-right: 38px;
}

.inspector-collapse-btn {
  margin: auto 6px auto 2px;
  flex-shrink: 0;
}

/* Tab Bar */
#tab-bar {
  height: var(--tab-height);
  background: var(--bg-inactive-tab);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  flex-shrink: 0;
  padding: 0 4px;
  gap: 2px;
  position: relative;
}

.tab-strip {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.tab-strip::-webkit-scrollbar {
  display: none;
}

.tab-nav-arrow {
  display: none;
  width: 26px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-normal);
  flex-shrink: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  z-index: 2;
}

.tab-nav-arrow.visible {
  display: inline-flex;
}

.tab-nav-arrow:hover:not(:disabled) {
  background: var(--bg-active);
  color: var(--text-accent);
  border-color: var(--accent);
}

.tab-nav-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.tab {
  height: 32px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-inactive-tab);
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
  max-width: 220px;
  min-width: 110px;
  flex-shrink: 0;
  user-select: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.tab:hover {
  color: var(--text-normal);
  background: var(--bg-hover);
}

.tab.active {
  background: var(--bg-content);
  color: var(--text-normal);
  border-color: var(--border-subtle);
  border-bottom: 1px solid var(--bg-content);
  font-weight: 500;
}

.tab.tab-group {
  background: rgba(234, 179, 8, 0.07);
  border-color: rgba(234, 179, 8, 0.22);
  color: var(--text-normal);
}

.tab.tab-group:hover {
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.4);
}

.tab.tab-group.active {
  background: var(--bg-content);
  border-color: #eab308;
  border-bottom: 1px solid var(--bg-content);
  color: var(--text-normal);
}

.tab-folder-icon {
  color: #eab308;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tab-group-count-badge {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
  font-size: 10.5px;
  font-weight: 600;
  padding: 0 5px;
  border-radius: 10px;
  line-height: 16px;
  flex-shrink: 0;
}

.tab-break-icon,
.tab-regroup-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.tab-break-icon:hover,
.tab-regroup-icon:hover {
  color: var(--text-accent);
  background: rgba(124, 58, 237, 0.2);
}

.tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.tab-close {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-faint);
  flex-shrink: 0;
}

.tab-close:hover {
  color: var(--text-normal);
  background: rgba(255, 255, 255, 0.15);
}

