/* Tabs strip — sits between the header and main content. Warm-carbon
 * styled, browser-like behavior with horizontal overflow when many tabs. */

/* Wrapper sits in the column flow under the header. Always visible —
 * the hide-toggle was removed because users were hitting it accidentally
 * and losing access to their tabs. To "hide" tabs, close them
 * individually with the X. */
.rvt-tabs-wrapper {
  flex-shrink: 0;
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 6;
}

.rvt-tabs {
  background: var(--bg-0);
}

.rvt-tabs-inner {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 40px;
}

.rvt-tabs-track {
  flex: 1;
  display: flex;
  align-items: stretch;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  /* Reserve bottom-padding for the horizontal scrollbar so it doesn't
   * eat into the tab height when many tabs are open. */
  padding: 4px 0 6px 8px;
  scrollbar-width: thin;
}
.rvt-tabs-track::-webkit-scrollbar { height: 4px; }
.rvt-tabs-track::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.rvt-tabs-track::-webkit-scrollbar-track  { background: transparent; }

/* Drag-and-drop hint — track tints subtly while a tab is hovered over
 * it. Uses a neutral surface tone (not the warm accent) so the highlight
 * reads as "drop here" without looking like a notification. */
.rvt-tabs-track.is-drop-target {
  background: var(--bg-3);
  border-radius: 6px;
}

/* Individual tab. Browser-like trapezoid with rounded top corners.
 * Active tab gets a top accent stripe + slightly brighter surface. */
.rvt-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 28px;
  max-width: 220px;
  min-width: 80px;
  padding: 0 6px 0 8px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  position: relative;
  user-select: none;
}
.rvt-tab:hover {
  background: var(--bg-2);
  color: var(--text-0);
}
.rvt-tab.is-active {
  background: var(--bg-1);
  color: var(--text-0);
  border-color: var(--border-strong);
}
.rvt-tab.is-active::before {
  /* Top orange accent line — same visual idiom as the section headers. */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 6px 6px 0 0;
}
.rvt-tab.is-dragging {
  opacity: 0.5;
}
.rvt-tab.is-drop-before { box-shadow: -2px 0 0 0 var(--accent); }
.rvt-tab.is-drop-after  { box-shadow:  2px 0 0 0 var(--accent); }

.rvt-tab .type-icon {
  width: 14px;
  height: 14px;
  font-size: 9px;
  flex-shrink: 0;
  pointer-events: none;
}

/* Tab-strip-only type icons for non-doc routes (snippet / profile /
 * community / home / version-landing). They share the warm-accent
 * palette so they read as "site features" rather than API-doc types. */
.rvt-tab .type-icon.snip,
.rvt-tab .type-icon.prof,
.rvt-tab .type-icon.comm,
.rvt-tab .type-icon.home,
.rvt-tab .type-icon.ver {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-weight: 700;
  font-size: 10px;
  font-family: var(--font-mono);
  background: var(--bg-2);
  color: var(--accent);
  border: 1px solid var(--accent-glow, rgba(184, 116, 26, 0.3));
}
/* Home glyph (⌂) renders better a couple px larger than the letter icons. */
.rvt-tab .type-icon.home { font-size: 12px; }

/* Year badge — small RVT-year stamp on each tab. Two-digit form ("25"
 * for 2025, "25.3" for 2025.3). Sits at the LEFT edge of the tab, before
 * the type icon. Stays muted regardless of active state — the active tab
 * already signals itself via background + the orange top accent line. */
.rvt-tab-year {
  flex-shrink: 0;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  letter-spacing: 0.02em;
  line-height: 1.45;
}

/* Empty-state placeholder shown inside the strip when the tab list is
 * cleared. Keeps the strip visible so the user always has access to the
 * action buttons (reopen / hide). */
.rvt-tabs-empty {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  font-size: 11.5px;
  color: var(--text-3);
  font-style: italic;
}
.rvt-tabs-empty-text { white-space: nowrap; }

/* Ghost "+" tab — sits at the end of the tab list with a dashed border
 * + faint fill. Click duplicates the active tab. Visually reads as
 * "click here to add a tab" rather than just an action button. Small
 * left margin separates it from the last real tab. */
.rvt-tab-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 24px;
  width: 30px;
  margin: 2px 0 0 6px;       /* small gap from the last real tab */
  padding: 0;
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: 6px;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.12s;
}
.rvt-tab-ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-glow);
}

.rvt-tab-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1;
  color: inherit;
  text-decoration: none;
}

.rvt-tab-bookmark,
.rvt-tab-close {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 3px;
  color: var(--text-3);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  opacity: 0;            /* hidden until hover, browser-style */
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.rvt-tab:hover .rvt-tab-close,
.rvt-tab.is-active .rvt-tab-close,
.rvt-tab.is-bookmarked .rvt-tab-bookmark {
  opacity: 1;
}
.rvt-tab:hover .rvt-tab-bookmark { opacity: 0.6; }
.rvt-tab-close:hover {
  background: rgba(184, 57, 90, 0.20);
  color: var(--danger);
}
.rvt-tab-bookmark:hover {
  background: var(--bg-3);
  color: var(--accent);
}
.rvt-tab.is-bookmarked .rvt-tab-bookmark {
  color: var(--accent);
}
.rvt-tab.is-bookmarked .rvt-tab-bookmark svg {
  fill: currentColor;
}

/* Action buttons on the right edge of the strip. */
.rvt-tabs-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px 0 4px;
  border-left: 1px solid var(--border);
  background: var(--bg-0);
  flex-shrink: 0;
}
.rvt-tabs-action {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s;
  padding: 0;
}
.rvt-tabs-action:hover {
  color: var(--accent);
  background: var(--bg-2);
  border-color: var(--border);
}

/* Show button — thin bar that takes the strip's place when collapsed.
 * Spans the full column width so the user can always click it back open. */
.rvt-tabs-show {
  width: 100%;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-1);
  border: 0;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.rvt-tabs-show:hover {
  color: var(--accent);
  background: var(--bg-2);
}
.rvt-tabs-show-label { color: inherit; }
