/* Torrents lanes — the one bar over both views behind the Torrents tab
 * (renderer/torrents/lanes.js): Find / Top / Tracked / Downloads / Raw search /
 * Lamp room. #view-torrents and #view-pharos each hold a `.tor-lanes`, and the
 * rules below seat it at the SAME place in both (full width, same inset, same
 * height), so the pills hold still while a lane swaps the room under them.
 *
 * The pills are the shared .vlane-btn; the look is the lamp room's own
 * (glass, one beacon-orange light for the lit lane), carried as local tokens
 * because the torrents view does not define the --ph-* set.
 */
.tor-lanes {
  --tl-glass:  rgba(255, 255, 255, .035);
  --tl-line:   rgba(255, 255, 255, .075);
  --tl-line-2: rgba(255, 255, 255, .14);
  --tl-ink:    #f3efe9;
  --tl-dim:    #a69f95;
  --tl-beacon: 255, 140, 26;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin: 0;
  padding: 16px 30px 14px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--tl-line);
  position: relative;
  z-index: 2;
}
.tor-lanes::-webkit-scrollbar { display: none; }
.tor-lanes[hidden] { display: none; }
.tor-lanes .vlane-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  background: var(--tl-glass);
  border-color: var(--tl-line);
  color: var(--tl-dim);
}
.tor-lanes .vlane-btn:hover { border-color: var(--tl-line-2); color: var(--tl-ink); }
.tor-lanes .vlane-btn.active {
  color: var(--tl-ink);
  border-color: rgba(var(--tl-beacon), .55);
  background: linear-gradient(180deg, rgba(var(--tl-beacon), .18), rgba(var(--tl-beacon), .07));
  box-shadow: 0 0 0 1px rgba(var(--tl-beacon), .18), 0 6px 22px rgba(var(--tl-beacon), .14);
}
.tor-lanes .vlane-btn:focus-visible { outline: 2px solid rgb(var(--tl-beacon)); outline-offset: 2px; }
/* A live number rides the pill: downloads in flight, raw results found. */
.tor-lanes .glane-n {
  min-width: 20px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: var(--tl-dim);
  font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}
.tor-lanes .glane-n:empty { display: none; }
.tor-lanes .vlane-btn.active .glane-n { color: #1a1009; background: rgb(var(--tl-beacon)); }

/* ── #view-torrents: the bar is a row of its own above sidebar + main ── */
#view-torrents.layout { grid-template-rows: auto minmax(0, 1fr); }
#view-torrents > .tor-lanes { grid-column: 1 / -1; }
/* Find is the Pharos search bundle: a full-width room like Top and Tracked,
   so the torrent manager's sidebar (meter, queue filters, settings, VPN)
   steps aside and comes back with Downloads and Raw search. */
#view-torrents[data-lane="find"] > .sidebar { display: none; }
#view-torrents[data-lane="find"] > .tor-main { grid-column: 1 / -1; }

/* ── #view-pharos: the bar sits above the scrolling room, not inside it ── */
.pharos { flex-direction: column; }
.pharos > .tor-lanes { border-bottom-color: var(--ph-line); }

@media (max-width: 880px) {
  .tor-lanes { padding: 12px 12px 10px; gap: 6px; }
}
/* Narrow: every pill but the lit one is its icon (the dock's own step-down),
   so six lanes hold one row without scrolling; a live count rides the corner. */
@media (max-width: 640px) {
  .tor-lanes { gap: 4px; }
  .tor-lanes .vlane-btn { position: relative; }
  .tor-lanes .vlane-btn:not(.active) { width: 40px; padding: 0; justify-content: center; }
  .tor-lanes .vlane-btn:not(.active) > span { display: none; }
  .tor-lanes .vlane-btn:not(.active) > .glane-n {
    position: absolute; top: -5px; right: -5px;
    min-width: 16px; padding: 2px 4px; font-size: 10px;
    color: #1a1009; background: rgb(var(--tl-beacon));
  }
  .tor-lanes .vlane-btn.active { padding: 0 12px 0 6px; }
}
/* Narrow: the torrents view stacks (torrents.css), so the bar is its first row. */
@media (max-width: 760px) {
  #view-torrents.layout { grid-template-rows: auto auto auto; }
  #view-torrents[data-lane="find"].layout { grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .tor-lanes .vlane-btn { transition: none; }
}
