/* Header toggle: hit target fits scaled SVG; uniform scale keeps 34:32 proportions vs 32px radar (non-scaling-stroke). */
.sidebar-toggle--header {
  flex-shrink: 0;
  width: 46px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  transition: color 0.15s ease;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-toggle--header:hover {
  color: var(--accent);
  background: transparent;
}
.sidebar-toggle-tab-icon {
  display: block;
  overflow: visible;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  transform: scale(1.4);
  transform-origin: center center;
}
.sidebar-toggle-icon-outline,
.sidebar-toggle-icon-divider {
  fill: none;
}
.sidebar-toggle-icon-chevron {
  transition: opacity 0.2s ease, transform 0.22s ease;
}
.sidebar-toggle--header[aria-expanded="true"] .sidebar-toggle-icon-chevron--collapse {
  opacity: 1;
  transform: translateX(0);
}
.sidebar-toggle--header[aria-expanded="true"] .sidebar-toggle-icon-chevron--expand {
  opacity: 0;
  transform: translateX(5px);
}
.sidebar-toggle--header[aria-expanded="false"] .sidebar-toggle-icon-chevron--collapse {
  opacity: 0;
  transform: translateX(-5px);
}
.sidebar-toggle--header[aria-expanded="false"] .sidebar-toggle-icon-chevron--expand {
  opacity: 1;
  transform: translateX(0);
}
@media (prefers-reduced-motion: reduce) {
  .sidebar-toggle-icon-chevron {
    transition: opacity 0.1s ease;
  }
  .sidebar-toggle--header[aria-expanded="true"] .sidebar-toggle-icon-chevron--collapse,
  .sidebar-toggle--header[aria-expanded="false"] .sidebar-toggle-icon-chevron--expand {
    transform: none;
  }
  .sidebar-toggle--header[aria-expanded="true"] .sidebar-toggle-icon-chevron--expand,
  .sidebar-toggle--header[aria-expanded="false"] .sidebar-toggle-icon-chevron--collapse {
    transform: none;
  }
}

.info-box {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.6;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 8px 10px;
  margin-top: 4px;
}
.info-box strong { color: var(--accent); font-weight: 500; }
.info-box i {
  font-style: italic;
  color: var(--text-dim);
}
/* Same 1px color as .config-modal__vdivider between config columns */
.info-box hr {
  border: 0;
  height: 1px;
  margin: 10px 0;
  background: var(--border);
}

.slider-endpoints {
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Selection slot button in sidebar streamer cards */
.select-slot-btn {
  min-width: 26px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid var(--border-bright);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 6px;
  transition: all 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.select-slot-btn:hover:not(:disabled) { border-color: var(--accent-dim); color: var(--text-primary); background: rgba(126,200,232,0.06); }
.select-slot-btn.slot-selected:hover:not(:disabled) {
  color: #fff;
}
.select-slot-btn.slot-selected {
  border-color: var(--accent-dim);
  color: #fff;
  background: rgba(126, 200, 232, 0.08);
}
.select-slot-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Focused-stream selector button in focus mode (crosshair icon) */
.focus-slot-btn {
  min-width: 26px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 5px;
  transition: all 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.focus-slot-btn:hover { border-color: var(--accent-dim); color: var(--accent); }
.focus-slot-btn.slot-focused {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(126,200,232,0.15);
}

/* Enter / exit focus — square control tucked in the bar corner (32px bar → 24×24 + 4px inset). */
.exit-focus-btn,
.focus-swap-btn {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  margin: 0;
  border-radius: 3px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 0;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
  z-index: 1;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.exit-focus-btn svg,
.focus-swap-btn svg {
  display: block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
/* Stroke caps on the exit brackets read slightly left in the box; nudge for optical center. */
.exit-focus-btn svg {
  transform: translateX(1px);
}
.exit-focus-btn:hover,
.focus-swap-btn:hover {
  color: var(--accent);
  background: transparent;
}

/* Play-to-load overlay inside each selected stream cell */
.play-overlay {
  position: absolute;
  inset: 0;
  bottom: calc(32px * var(--ui-scale, 1.25)); /* above scaled cell-bar */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-card);
  z-index: 2;
  box-sizing: border-box;
  /* Tight 16×9 tiles (focus main): centered block can exceed height; without clip the Watch button’s
     accent border paints a thin line above the bar (bar z-index wins except the top edge). */
  padding: 6px 10px;
  overflow: hidden;
  zoom: var(--ui-scale, 1.25);
}

.stream-unified-layout.stream-unified--focused .stream-cells-plane > .stream-cell.focused:not(.side-stream) .play-overlay {
  zoom: calc(var(--ui-scale, 1.25) * var(--focus-main-paused-scale, 1));
}

.play-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-bright);
  opacity: 0.85;
}
.play-name {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}
.play-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.play-panel-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(9px, calc(10px * 1.25 / var(--ui-scale, 1.25)), 11px);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  text-align: center;
  width: 100%;
  max-width: 100%;
  line-height: 1.35;
  padding: 0 4px;
  box-sizing: border-box;
}
.play-panel-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
}
.play-panel-lead {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.play-panel-acc {
  color: #959eb0;
}
.play-panel-sep {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  opacity: 0.88;
  margin: 0 5px;
}
.play-panel-rank {
  font-weight: 400;
}
.play-panel-rank-pending {
  color: #8a93a6;
  font-weight: 400;
}
.play-panel-wr {
  flex-shrink: 0;
  font-weight: 400;
  font-size: 1em;
}
.play-panel-wr--wr-na {
  color: #6b7280;
  font-weight: 400;
}
.play-panel-wr--wr-bad {
  color: #b86b70;
}
.play-panel-wr--wr-near50 {
  color: #9aa3b2;
}
.play-panel-wr--wr-fiftys {
  color: #89b4e8;
}
.play-panel-wr--wr-green {
  color: #7dcea0;
}
.play-panel-wr--wr-yellow {
  color: #e8d55d;
}
.play-panel-wr--wr-gold {
  color: #d4a84b;
}
.play-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 22px;
  background: rgba(126,200,232,0.1);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}
.play-btn:hover { background: rgba(126,200,232,0.22); }

/* Paused overlay × — match sidebar + / ☆ / Edit */
.play-overlay-remove-btn,
.stream-cell-playing-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 5;
  /* Fallback when cqw unavailable — box unchanged; larger × via font-size only */
  width: 25px;
  height: 25px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  color: var(--text-secondary);
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, opacity 0.12s ease;
}
.play-overlay-remove-btn {
  background: rgba(255, 255, 255, 0.04);
}
.play-overlay-remove-btn:hover,
.stream-cell-playing-remove:hover {
  border-color: var(--accent);
  color: #fff;
  background: rgba(126, 200, 232, 0.28);
}
/* Tile-aware scaling — capped lower so wide focus / grid tiles don’t get an oversized × */
@supports (width: 1cqw) {
  .play-overlay-remove-btn,
  .stream-cell-playing-remove {
    width: clamp(24px, calc(3.6cqw + 6px), 30px);
    height: clamp(24px, calc(3.6cqw + 6px), 30px);
    font-size: clamp(20px, calc(2.85cqw + 8px), 24px);
    top: clamp(3px, calc(0.55cqw + 2px), 7px);
    right: clamp(3px, calc(0.55cqw + 2px), 7px);
    border-radius: clamp(3px, 0.65cqw, 5px);
  }
}

/* Compact overlay + bar chrome for mini side streams in focus layout. */
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-overlay {
  gap: 8px;
  padding: 6px 8px;
  zoom: calc(var(--ui-scale, 1.25) * var(--focus-mini-paused-scale, 0.82));
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-avatar {
  width: 56px;
  height: 56px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-name {
  font-size: 14px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-status {
  font-size: 9px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-panel-meta {
  font-size: 9px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-panel-sep {
  font-size: 10px;
  margin: 0 3px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-panel-wr {
  font-size: 9px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-btn {
  padding: 7px 14px;
  font-size: 11px;
  gap: 6px;
}
/* Minis: slightly smaller base + milder cqw (overlay zoom still shrinks the panel) */
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-overlay-remove-btn,
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .stream-cell-playing-remove {
  width: 26px;
  height: 26px;
  top: 3px;
  right: 3px;
  font-size: 22px;
  font-weight: 500;
  /* Zoom + Rajdhani × reads right/low in minis — optical center */
  line-height: 0;
  transform: translate(-0.65px, -0.45px);
}
@supports (width: 1cqw) {
  .stream-unified--focused .stream-cells-plane .stream-cell.side-stream .play-overlay-remove-btn,
  .stream-unified--focused .stream-cells-plane .stream-cell.side-stream .stream-cell-playing-remove {
    width: clamp(24px, calc(7.5cqw + 4px), 34px);
    height: clamp(24px, calc(7.5cqw + 4px), 34px);
    font-size: clamp(20px, calc(5.25cqw + 7px), 26px);
    top: clamp(3px, calc(0.95cqw + 1px), 7px);
    right: clamp(3px, calc(0.95cqw + 1px), 7px);
  }
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .stream-cell-playing-remove {
  zoom: calc(var(--ui-scale, 1.25) * var(--focus-mini-paused-scale, 0.82));
}

/* Live embed: hide × until cell hover or × itself :focus-visible (not :focus-within on .stream-cell — pause / bar controls would keep × stuck after click). */
.stream-cell-playing-remove {
  opacity: 0;
  pointer-events: none;
  /* Match visual size of .play-overlay-remove-btn (overlay uses zoom: var(--ui-scale)). */
  zoom: var(--ui-scale, 1.25);
  /* Opaque chip on video; :hover still uses sidebar-style accent above */
  background: rgba(10, 10, 14, 0.94);
  color: rgba(248, 248, 252, 0.96);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    opacity 0.12s ease,
    box-shadow 0.15s ease;
}
body:not(.stream-cell-dragging) .stream-cell:not(.focused):hover .stream-cell-playing-remove,
body:not(.stream-cell-dragging) .stream-cell:not(.focused) .stream-cell-playing-remove:focus-visible {
  opacity: 1;
  pointer-events: auto;
}
/* Focus main tile: outer cell is taller than the video (grid spacers); only body is the hover target */
body:not(.stream-cell-dragging) .stream-cell.focused .stream-cell-body:hover .stream-cell-playing-remove,
body:not(.stream-cell-dragging) .stream-cell.focused .stream-cell-playing-remove:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-bar {
  zoom: var(--cell-bar-zoom, 1);
  gap: 4px;
  --cell-bar-gap-hit: 4px;
  --cell-bar-pad-x: 8px;
  padding: 0 8px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-bar:has(.focus-swap-btn),
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-bar:has(.exit-focus-btn) {
  padding-right: 28px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-meta {
  font-size: 10px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-status {
  font-size: 10px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-bar:has(.focus-swap-btn) .cell-status,
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-bar:has(.exit-focus-btn) .cell-status {
  padding-right: 2px;
}
.stream-unified--focused .stream-cells-plane .stream-cell.side-stream .cell-pause-btn {
  font-size: 10px;
  padding: 0 1px;
  margin: 0;
}

