/* The tab strip (#tabStrip, --tabs-h; its slot, stickiness and phone rules are in style.css) and the drawer's
   tab list. Owner: tabs (js/features/tabs.js). Tokens from style.css only. */

/* ---------- desktop strip ---------- */
.tabstrip { align-items: flex-end; gap: 4px; padding: 0 10px 0 8px; user-select: none; -webkit-user-select: none; }
.tabs-list { display: flex; align-items: flex-end; flex: 0 1 auto; min-width: 0; height: 100%; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; }
.tabs-list::-webkit-scrollbar { display: none; }
.tabs-fill { flex: 1 1 0; align-self: stretch; min-width: 24px; }
.tabs-add { flex: none; align-self: center; width: 26px; height: 26px; border-radius: 7px; color: var(--faint); }

.tabs-tab {
  position: relative; flex: 0 1 196px; width: 196px; min-width: 64px; height: calc(var(--tabs-h) - 6px);
  display: flex; align-items: center; gap: 7px; padding: 0 5px 0 10px; margin-bottom: -1px;
  border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0;
  color: var(--muted); font-size: 12.5px; line-height: 1; cursor: default; outline: none;
  container: tabs-tab / inline-size;
}
/* many tabs: a narrow tab shows its icon only (the name is in its tooltip) */
@container tabs-tab (max-width: 88px) {
  .tabs-name { display: none; }
  .tabs-ic { margin-right: auto; }
}
.tabs-tab:hover { color: var(--text-2); }
.tabs-tab::before { content: ""; position: absolute; inset: 2px 2px 3px; border-radius: 7px; background: transparent; transition: background .12s; z-index: -1; }
.tabs-tab:hover:not(.on)::before { background: var(--hover); }
/* separators between the tabs that are not active nor hovered */
.tabs-tab::after { content: ""; position: absolute; right: -1px; top: 50%; width: 1px; height: 14px; margin-top: -8px; background: var(--line-2); }
.tabs-tab.on::after, .tabs-tab:hover::after, .tabs-tab:has(+ .tabs-tab.on)::after, .tabs-tab:has(+ .tabs-tab:hover)::after,
.tabs-tab:last-child::after { background: transparent; }
.tabs-tab.on { z-index: 1; background: var(--bg); border-color: var(--line); color: var(--text); height: calc(var(--tabs-h) - 5px); }
.tabs-tab:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }

.tabs-ic { display: grid; place-items: center; flex: none; color: var(--faint); }
.tabs-tab.on .tabs-ic { color: var(--accent-icon); }
.tabs-name { flex: 1; min-width: 0; padding: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs-tab.on .tabs-name { font-weight: 500; }
.tabs-x { display: grid; place-items: center; flex: none; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 5px;
  background: none; color: var(--faint); cursor: pointer; opacity: 0; transition: opacity .12s, background .12s, color .12s; }
.tabs-tab.on .tabs-x, .tabs-tab:hover .tabs-x, .tabs-tab:focus-visible .tabs-x { opacity: 1; }
.tabs-x:hover { background: var(--raised-2); color: var(--text); }

/* drag to reorder */
.tabstrip.tabs-dragging .tabs-tab:not(.drag) { transition: translate .16s ease; }
.tabs-tab.drag { z-index: 3; cursor: grabbing; }
.tabs-tab.drag:not(.on)::before { background: var(--raised); }
.tabs-tab.drag::after { background: transparent; }

/* ---------- phones: the drawer's tab list (sidebar section "Tabs") ---------- */
.tabs-row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tabs-go { flex: 1; min-width: 0; min-height: 44px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.tabs-go .ic { color: var(--faint); }
.tabs-go.on .ic { color: var(--accent-icon); }
.tabs-rx { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px;
  background: none; color: var(--faint); cursor: pointer; }
.tabs-rx:hover, .tabs-rx:active { background: var(--raised); color: var(--text); }
