/* Modular Control Center screenshot replica. Loaded after the legacy rail CSS. */
:root {
  --navbar-expanded-width: 440px;
  --cc-bg: #07111e;
  --cc-bg-deep: #050c15;
  --cc-surface: #111c2a;
  --cc-surface-raised: #172333;
  --cc-surface-button: #182433;
  --cc-border: #2b3c50;
  --cc-border-soft: rgba(100, 123, 145, 0.42);
  --cc-text: #f4f7fb;
  --cc-muted: #b5bcc7;
  --cc-blue: #2e79f7;
  --cc-pink: #e51277;
  --cc-teal: #16a8ad;
  --cc-red: #d83b32;
  --cc-green: #268947;
}

/* Bulk streamer layer import ------------------------------------------------
   A compact review-first workflow layered above the main overlay editor. */
.stream-overlay-bulk-dialog {
  --stream-overlay-bulk-bg: #272727;
  --stream-overlay-bulk-surface: #303030;
  --stream-overlay-bulk-raised: #393939;
  --stream-overlay-bulk-control: #222222;
  --stream-overlay-bulk-border: #5d5d5d;
  --stream-overlay-bulk-border-soft: #484848;
  --stream-overlay-bulk-text: #f5f5f5;
  --stream-overlay-bulk-muted: #b9b9b9;
  box-sizing: border-box;
  width: min(980px, calc(100vw - 28px));
  max-width: 980px;
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: hidden;
  color: var(--stream-overlay-bulk-text);
  border: 1px solid var(--stream-overlay-bulk-border);
  border-radius: 14px;
  background: var(--stream-overlay-bulk-bg);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
}

.stream-overlay-bulk-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(5px);
}

.stream-overlay-bulk-form {
  display: flex;
  max-height: calc(100dvh - 30px);
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.stream-overlay-bulk-header,
.stream-overlay-bulk-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: #2d2d2d;
}

.stream-overlay-bulk-header {
  border-bottom: 1px solid var(--stream-overlay-bulk-border-soft);
}

.stream-overlay-bulk-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.stream-overlay-bulk-heading-icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #f4f4f4;
  border: 1px solid #696969;
  border-radius: 10px;
  background: #3a3a3a;
  font-size: 17px;
}

.stream-overlay-bulk-heading h2 {
  margin: 3px 0 0;
  color: #ffffff;
  font-size: 24px;
  line-height: 1.1;
}

.stream-overlay-bulk-help {
  flex: 0 0 auto;
  margin: 0;
  padding: 14px 18px 0;
  color: var(--stream-overlay-bulk-muted);
  font-size: 13px;
  line-height: 1.5;
}

.stream-overlay-bulk-template {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 14px 18px 0;
  padding: 13px 14px;
  border: 1px solid var(--stream-overlay-bulk-border-soft);
  border-radius: 10px;
  background: var(--stream-overlay-bulk-surface);
}

.stream-overlay-bulk-template > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.stream-overlay-bulk-template strong {
  color: #f5f5f5;
  font-size: 13px;
}

.stream-overlay-bulk-template span {
  color: var(--stream-overlay-bulk-muted);
  font-size: 11px;
  line-height: 1.4;
}

.stream-overlay-bulk-template-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.stream-overlay-bulk-template-actions a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  gap: 7px;
  color: #f1f1f1;
  border: 1px solid #6a6a6a;
  border-radius: 8px;
  background: #3a3a3a;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}

.stream-overlay-bulk-template-actions a:hover,
.stream-overlay-bulk-template-actions a:focus-visible {
  color: #ffffff;
  border-color: #b8b8b8;
  background: #4a4a4a;
}

.stream-overlay-bulk-pickers {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 18px 0;
}

.stream-overlay-bulk-picker {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 72px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  padding: 10px 11px;
  gap: 10px;
  overflow: hidden;
  color: var(--stream-overlay-bulk-text);
  border: 1px dashed #686868;
  border-radius: 10px;
  background: #242424;
  cursor: pointer;
}

.stream-overlay-bulk-picker:hover,
.stream-overlay-bulk-picker:focus-within {
  border-color: #c1c1c1;
  background: #2c2c2c;
}

.stream-overlay-bulk-picker-step {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #222222;
  border-radius: 50%;
  background: #dedede;
  font-size: 12px;
  font-weight: 850;
}

.stream-overlay-bulk-picker-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.stream-overlay-bulk-picker-copy strong {
  color: #f5f5f5;
  font-size: 12px;
}

.stream-overlay-bulk-picker-copy small {
  overflow: hidden;
  color: var(--stream-overlay-bulk-muted);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-overlay-bulk-picker-action {
  padding: 7px 9px;
  color: #eeeeee;
  border: 1px solid #5f5f5f;
  border-radius: 7px;
  background: #383838;
  font-size: 10px;
  font-weight: 800;
}

.stream-overlay-bulk-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.stream-overlay-bulk-status {
  flex: 0 0 auto;
  min-height: 18px;
  margin: 0;
  padding: 10px 18px 0;
  color: var(--stream-overlay-bulk-muted);
  font-size: 11px;
  line-height: 1.4;
}

.stream-overlay-bulk-status[data-state="error"] {
  color: #ffb7b7;
}

.stream-overlay-bulk-status[data-state="success"] {
  color: #bfe9b4;
}

.stream-overlay-bulk-preview {
  min-height: 0;
  margin: 12px 18px 14px;
  overflow: auto;
  border: 1px solid var(--stream-overlay-bulk-border-soft);
  border-radius: 10px;
  background: var(--stream-overlay-bulk-surface);
  scrollbar-color: #707070 #2a2a2a;
}

.stream-overlay-bulk-preview-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--stream-overlay-bulk-border-soft);
  background: #343434;
}

.stream-overlay-bulk-preview-header > div {
  display: grid;
  gap: 2px;
}

.stream-overlay-bulk-preview-header strong {
  color: #f7f7f7;
  font-size: 12px;
}

.stream-overlay-bulk-preview-header span {
  color: var(--stream-overlay-bulk-muted);
  font-size: 10px;
}

.stream-overlay-bulk-format {
  flex: 0 0 auto;
  padding: 4px 7px;
  color: #f5f5f5 !important;
  border: 1px solid #676767;
  border-radius: 999px;
  background: #262626;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.stream-overlay-bulk-row {
  display: grid;
  grid-template-columns: 52px minmax(130px, 0.85fr) minmax(180px, 1.3fr) minmax(130px, 0.9fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 11px;
  border-bottom: 1px solid #444444;
  font-size: 11px;
}

.stream-overlay-bulk-row--header {
  min-height: 34px;
  color: #bcbcbc;
  background: #292929;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stream-overlay-bulk-rows .stream-overlay-bulk-row:last-child {
  border-bottom: 0;
}

.stream-overlay-bulk-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stream-overlay-bulk-row-number {
  color: #a9a9a9;
  font-variant-numeric: tabular-nums;
}

.stream-overlay-bulk-row strong {
  display: block;
  color: #f1f1f1;
  font-size: 11px;
}

.stream-overlay-bulk-row small {
  display: block;
  margin-top: 2px;
  color: #a9a9a9;
  font-size: 9px;
  line-height: 1.3;
}

.stream-overlay-bulk-result {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 5px 8px;
  gap: 6px;
  border: 1px solid #666666;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.stream-overlay-bulk-row.is-ready .stream-overlay-bulk-result {
  color: #dff6d8;
  border-color: rgba(141, 221, 120, 0.58);
  background: rgba(58, 111, 45, 0.25);
}

.stream-overlay-bulk-row.has-errors .stream-overlay-bulk-result {
  color: #ffd1d1;
  border-color: rgba(226, 103, 103, 0.58);
  background: rgba(123, 41, 41, 0.25);
}

.stream-overlay-bulk-issues {
  padding: 11px 12px;
  color: #f0c3c3;
  border-top: 1px solid rgba(212, 103, 103, 0.38);
  background: rgba(111, 39, 39, 0.17);
}

.stream-overlay-bulk-issues strong {
  font-size: 11px;
}

.stream-overlay-bulk-issues ul {
  display: grid;
  margin: 7px 0 0;
  padding-left: 18px;
  gap: 4px;
  font-size: 10px;
  line-height: 1.4;
}

.stream-overlay-bulk-actions {
  border-top: 1px solid var(--stream-overlay-bulk-border-soft);
}

.stream-overlay-bulk-actions > p {
  max-width: 580px;
  margin: 0;
  color: var(--stream-overlay-bulk-muted);
  font-size: 10px;
  line-height: 1.4;
}

.stream-overlay-bulk-actions > div {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.stream-overlay-bulk-actions button {
  min-height: 38px;
}

.stream-overlay-bulk-actions button:disabled,
.stream-overlay-bulk-picker:has(input:disabled) {
  opacity: 0.48;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .stream-overlay-bulk-dialog {
    width: calc(100vw - 14px);
    max-height: calc(100dvh - 14px);
    border-radius: 11px;
  }

  .stream-overlay-bulk-form {
    max-height: calc(100dvh - 16px);
  }

  .stream-overlay-bulk-template,
  .stream-overlay-bulk-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .stream-overlay-bulk-template-actions,
  .stream-overlay-bulk-actions > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stream-overlay-bulk-pickers {
    grid-template-columns: minmax(0, 1fr);
  }

  .stream-overlay-bulk-row {
    grid-template-columns: 40px minmax(110px, 0.8fr) minmax(150px, 1.2fr) minmax(112px, 0.8fr);
  }

  .stream-overlay-bulk-table {
    min-width: 650px;
  }
}

.navbar {
  width: var(--navbar-collapsed-width);
  height: 100vh;
  padding: 0;
  background: linear-gradient(180deg, #091421 0%, #050c15 100%);
  border-right: 1px solid rgba(111, 130, 151, 0.55);
  box-shadow: 7px 0 20px rgba(0, 0, 0, 0.18), inset -1px 0 rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

body.menu-open {
  grid-template-columns: var(--navbar-expanded-width) 1fr;
}

.navbar.expanded,
.navbar:hover {
  width: var(--navbar-expanded-width);
  padding: 0;
  background: linear-gradient(180deg, #091421 0%, #050c15 100%);
  border-right-color: rgba(111, 130, 151, 0.55);
  box-shadow: 7px 0 20px rgba(0, 0, 0, 0.18), inset -1px 0 rgba(255, 255, 255, 0.035);
}

.navbar::before,
.navbar::after {
  display: none;
}

.navbar-header {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 48px;
  align-items: center;
  width: 100%;
  min-height: 102px;
  padding: 16px 24px;
  margin: 0;
  gap: 12px;
  border-bottom: 1px solid rgba(105, 126, 148, 0.28);
}

.navbar-header::after {
  display: none;
}

.control-center-mark,
.navbar:hover .control-center-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 2px solid #2d78f2;
  border-radius: 50%;
  background: #0a1625;
  box-shadow: 0 0 0 1px rgba(38, 105, 213, 0.18), 0 0 18px rgba(41, 111, 241, 0.12);
  color: #eef6ff;
  transform: none;
}

.control-center-mark i {
  color: #e8f1fd;
  font-size: 24px;
  line-height: 1;
}

.control-center-title {
  min-width: 0;
  color: var(--cc-text);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
  white-space: nowrap;
}

/* One-shot brand signal for the minimized rail. The light travels forward
   when the rail opens and reverses when it collapses, then disappears again. */
body.left-nav-layout .collapsed-rail-travel-light {
  position: absolute;
  top: 171px;
  left: calc(var(--left-nav-collapsed-width) / 2);
  z-index: 2;
  display: block;
  width: 4px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.16) 17%,
    rgba(255, 255, 255, 0.96) 42%,
    #ffffff 52%,
    rgba(255, 255, 255, 0.92) 62%,
    rgba(255, 255, 255, 0.14) 83%,
    transparent 100%
  );
  filter:
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.72))
    drop-shadow(0 0 6px rgba(255, 255, 255, 0.28))
    drop-shadow(0 0 11px rgba(255, 255, 255, 0.1));
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0) scaleY(0.58);
  transform-origin: center;
  will-change: top, transform, opacity;
}

@keyframes control-center-rail-light-forward {
  0% {
    top: 171px;
    opacity: 0;
    transform: translate(-50%, 0) scaleY(0.58);
  }

  12% {
    top: 171px;
    opacity: 1;
    transform: translate(-50%, 0) scaleY(1);
  }

  86% {
    top: calc(100dvh - 32px);
    opacity: 1;
    transform: translate(-50%, 0) scaleY(1);
  }

  100% {
    top: calc(100dvh - 32px);
    opacity: 0;
    transform: translate(-50%, 0) scaleY(0.58);
  }
}

@keyframes control-center-rail-light-reverse {
  0% {
    top: calc(100dvh - 32px);
    opacity: 0;
    transform: translate(-50%, 0) scaleY(0.58);
  }

  12% {
    top: calc(100dvh - 32px);
    opacity: 1;
    transform: translate(-50%, 0) scaleY(1);
  }

  86% {
    top: 171px;
    opacity: 1;
    transform: translate(-50%, 0) scaleY(1);
  }

  100% {
    top: 171px;
    opacity: 0;
    transform: translate(-50%, 0) scaleY(0.58);
  }
}

body.left-nav-layout .collapsed-rail-travel-light.is-traveling-forward {
  animation: control-center-rail-light-forward 900ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

body.left-nav-layout .collapsed-rail-travel-light.is-traveling-reverse {
  animation: control-center-rail-light-reverse 900ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  body.left-nav-layout .collapsed-rail-travel-light,
  body.left-nav-layout .collapsed-rail-travel-light.is-traveling-forward,
  body.left-nav-layout .collapsed-rail-travel-light.is-traveling-reverse {
    animation: none !important;
    opacity: 0 !important;
  }
}

/* Slow, liquid energy follows the collapsed rail. The side paths are the
   compact identity pill's rounded-rectangle perimeter, so the glow meets the
   actual top border, traces both rounded sides, reconnects at the actual
   bottom border, and exits onto the same center line. */
body.left-nav-layout .collapsed-rail-shimmer {
  /* One 23s cycle keeps the original downward speed while giving the light
     the same amount of time to return from the bottom. */
  --rail-energy-cycle: 23s;
  --rail-glow-length: 48px;
  --rail-glow-half: 24px;
  --rail-pill-top: calc(50% - 91px);
  --rail-pill-bottom: calc(50% + 91px);
  --rail-pill-path-top: var(--rail-pill-top);
  --rail-pill-path-bottom: var(--rail-pill-bottom);
  --rail-pill-span: 182px;
  position: absolute;
  inset: 0;
  z-index: 4;
  display: block;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
}

body.left-nav-layout .navbar.menu-collapsed .collapsed-rail-shimmer,
body.left-nav-layout .navbar.menu-collapsed:hover .collapsed-rail-shimmer {
  opacity: 1;
}

body.left-nav-layout .collapsed-rail-shimmer__lead,
body.left-nav-layout .collapsed-rail-shimmer__tail {
  position: absolute;
  left: calc(var(--left-nav-collapsed-width) / 2);
  display: block;
  width: 1px;
  height: var(--rail-glow-length);
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 18%,
    rgba(255, 255, 255, 0.94) 43%,
    rgba(255, 255, 255, 0.94) 58%,
    rgba(255, 255, 255, 0.12) 82%,
    transparent 100%
  );
  box-shadow: none;
  filter:
    drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.86))
    drop-shadow(0 0 5px rgba(255, 255, 255, 0.26))
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.09));
  mix-blend-mode: screen;
  opacity: 0;
  transform: translateX(-50%) scaleY(0.56);
  transform-origin: center;
  will-change: top, transform, opacity, clip-path;
}

body.left-nav-layout .collapsed-rail-shimmer__lead {
  top: 171px;
  /* Show the bright leading half of the glow. Its center can meet the SVG
     path exactly while the lower half stays clipped out of the pill. */
  clip-path: inset(-14px -14px var(--rail-glow-half) -14px);
}

body.left-nav-layout .collapsed-rail-shimmer__tail {
  top: calc(var(--rail-pill-path-bottom) - var(--rail-glow-half));
  /* Keep the upper half masked while the light is touching the pill. The
     animation expands from this exact contact point before the glow leaves
     the pill, instead of revealing a detached lower segment. */
  clip-path: inset(var(--rail-glow-half) -14px -14px -14px);
}

body.left-nav-layout .collapsed-rail-shimmer__split {
  position: absolute;
  top: var(--rail-pill-path-top);
  left: 0;
  display: block;
  width: var(--left-nav-collapsed-width);
  height: var(--rail-pill-span);
  overflow: visible;
  opacity: 0;
  pointer-events: none;
}

body.left-nav-layout .collapsed-rail-shimmer__branch,
body.left-nav-layout .collapsed-rail-shimmer__branch-core {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dashoffset: var(--rail-dash-start);
  mix-blend-mode: screen;
  opacity: 0;
  vector-effect: non-scaling-stroke;
  will-change: stroke-dashoffset, opacity;
}

/* Both perimeter layers carry the same white and three-stage halo as the
   vertical glow. They share one moving head, producing a single bright center
   and soft trailing falloff while the line follows the curved road. */
body.left-nav-layout .collapsed-rail-shimmer__branch {
  --rail-dash-start: 0.225;
  /* Let the moving dash clip down to the same tiny point at the bottom center
     that it uses at the top center. This makes the two paths genuinely merge
     before the single vertical glow takes over, and grow from that same point
     when the animation reverses. */
  --rail-dash-end: -0.995;
  --rail-layer-opacity: 0.76;
  stroke: rgba(255, 255, 255, 0.94);
  stroke-width: 1;
  stroke-dasharray: 0.23 1.77;
  filter:
    drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.86))
    drop-shadow(0 0 5px rgba(255, 255, 255, 0.26))
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.09));
}

body.left-nav-layout .collapsed-rail-shimmer__branch-core {
  /* Share the exact same dash pattern and halo as the soft layer. Keeping the
     head geometry identical prevents a second, offset streak after a corner. */
  --rail-dash-start: 0.225;
  --rail-dash-end: -0.995;
  --rail-layer-opacity: 0.9;
  stroke: rgba(255, 255, 255, 0.98);
  stroke-width: 1.1;
  stroke-dasharray: 0.23 1.77;
  filter:
    drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.86))
    drop-shadow(0 0 5px rgba(255, 255, 255, 0.26))
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.09));
}

body.left-nav-layout .navbar.menu-collapsed .collapsed-rail-shimmer__lead,
body.left-nav-layout .navbar.menu-collapsed:hover .collapsed-rail-shimmer__lead {
  animation: control-center-rail-energy-lead var(--rail-energy-cycle) linear infinite;
}

body.left-nav-layout .navbar.menu-collapsed .collapsed-rail-shimmer__split,
body.left-nav-layout .navbar.menu-collapsed:hover .collapsed-rail-shimmer__split {
  animation: control-center-rail-energy-split-shell var(--rail-energy-cycle) linear infinite;
}

body.left-nav-layout .navbar.menu-collapsed .collapsed-rail-shimmer__branch,
body.left-nav-layout .navbar.menu-collapsed:hover .collapsed-rail-shimmer__branch,
body.left-nav-layout .navbar.menu-collapsed .collapsed-rail-shimmer__branch-core,
body.left-nav-layout .navbar.menu-collapsed:hover .collapsed-rail-shimmer__branch-core {
  animation: control-center-rail-energy-branch var(--rail-energy-cycle) linear infinite;
}

body.left-nav-layout .navbar.menu-collapsed .collapsed-rail-shimmer__tail,
body.left-nav-layout .navbar.menu-collapsed:hover .collapsed-rail-shimmer__tail {
  animation: control-center-rail-energy-tail var(--rail-energy-cycle) linear infinite;
}

@keyframes control-center-rail-energy-lead {
  /* The light travels down the straight rail, hands off at the pill's top,
     then repeats the same route in reverse after the bottom turnaround. */
  0%,
  1.2% {
    top: 171px;
    opacity: 0;
    transform: translateX(-50%) scaleY(0.5);
  }

  2% {
    top: 171px;
    opacity: 0.72;
    transform: translateX(-50%) scaleY(0.9);
  }

  12.5% {
    top: calc(var(--rail-pill-path-top) - var(--rail-glow-half));
    opacity: 0.82;
    transform: translateX(-50%) scaleY(1);
  }

  13.8%,
  86.2% {
    top: calc(var(--rail-pill-path-top) - var(--rail-glow-half));
    opacity: 0;
    transform: translateX(-50%) scaleY(0.72);
  }

  87.5% {
    top: calc(var(--rail-pill-path-top) - var(--rail-glow-half));
    opacity: 0.82;
    transform: translateX(-50%) scaleY(1);
  }

  98.5% {
    top: 171px;
    opacity: 0.82;
    transform: translateX(-50%) scaleY(1);
  }

  100% {
    top: 171px;
    opacity: 0;
    transform: translateX(-50%) scaleY(0.5);
  }
}

@keyframes control-center-rail-energy-split-shell {
  0%,
  12.2%,
  31.4%,
  68.6%,
  87.8%,
  100% {
    opacity: 0;
  }

  13.5%,
  30.1%,
  69.9%,
  86.5% {
    opacity: 1;
  }
}

@keyframes control-center-rail-energy-branch {
  0%,
  12.2%,
  87.8%,
  100% {
    stroke-dashoffset: var(--rail-dash-start);
    opacity: 0;
  }

  31.4%,
  68.6% {
    stroke-dashoffset: var(--rail-dash-end);
    opacity: 0;
  }

  13.5% {
    stroke-dashoffset: var(--rail-dash-start);
    opacity: var(--rail-layer-opacity);
  }

  30.1% {
    stroke-dashoffset: var(--rail-dash-end);
    opacity: var(--rail-layer-opacity);
  }

  69.9% {
    stroke-dashoffset: var(--rail-dash-end);
    opacity: var(--rail-layer-opacity);
  }

  86.5% {
    stroke-dashoffset: var(--rail-dash-start);
    opacity: var(--rail-layer-opacity);
  }

  87.8% {
    stroke-dashoffset: var(--rail-dash-start);
    opacity: 0;
  }
}

@keyframes control-center-rail-energy-tail {
  /* The bottom handoffs mirror each other around the 50% turnaround. Going
     down, the two perimeter heads merge into this single outgoing glow.
     Coming back, the single glow reaches the same point and splits into the
     two reverse perimeter heads. */
  0%,
  29.8% {
    top: calc(var(--rail-pill-path-bottom) - var(--rail-glow-half));
    opacity: 0;
    clip-path: inset(var(--rail-glow-half) -14px -14px -14px);
    transform: translateX(-50%) scaleY(0.72);
  }

  31.1% {
    top: calc(var(--rail-pill-path-bottom) - var(--rail-glow-half));
    opacity: 0.82;
    clip-path: inset(var(--rail-glow-half) -14px -14px -14px);
    transform: translateX(-50%) scaleY(1);
  }

  49% {
    top: calc(100dvh - 56px);
    opacity: 0.82;
    clip-path: inset(-14px -14px -14px -14px);
    transform: translateX(-50%) scaleY(1);
  }

  50%,
  51% {
    top: calc(100dvh - 56px);
    opacity: 0.82;
    clip-path: inset(-14px -14px -14px -14px);
    transform: translateX(-50%) scaleY(1);
  }

  68.9% {
    top: calc(var(--rail-pill-path-bottom) - var(--rail-glow-half));
    opacity: 0.82;
    /* Keep the visible half outside the pill: its bright edge ends exactly at
       the lower border while the reverse perimeter paths begin to appear. */
    clip-path: inset(var(--rail-glow-half) -14px -14px -14px);
    transform: translateX(-50%) scaleY(1);
  }

  70.2%,
  100% {
    top: calc(var(--rail-pill-path-bottom) - var(--rail-glow-half));
    opacity: 0;
    clip-path: inset(var(--rail-glow-half) -14px -14px -14px);
    transform: translateX(-50%) scaleY(0.72);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.left-nav-layout .collapsed-rail-shimmer,
  body.left-nav-layout .collapsed-rail-shimmer__lead,
  body.left-nav-layout .collapsed-rail-shimmer__split,
  body.left-nav-layout .collapsed-rail-shimmer__branch,
  body.left-nav-layout .collapsed-rail-shimmer__branch-core,
  body.left-nav-layout .collapsed-rail-shimmer__tail {
    animation: none !important;
    opacity: 0 !important;
  }
}

.vertical-title {
  display: none;
}

#menuToggleButton {
  position: static;
  justify-self: end;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #3a4b5e;
  border-radius: 13px;
  clip-path: none;
  background: #172332;
  color: #f1f5fb;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

#menuToggleButton:hover {
  border-color: #6c8095;
  background: #1c2a3c;
  color: #fff;
}

#menuToggleButton i {
  font-size: 23px;
}

.nav-buttons,
.navbar.expanded .nav-buttons,
.navbar:hover .nav-buttons {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  gap: 10px;
  padding: 0 28px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  transform: none;
  scrollbar-color: #5d5a5b #0a0a0c;
  scrollbar-width: thin;
}

.navbar.menu-collapsed .nav-buttons,
.navbar.menu-collapsed:hover .nav-buttons {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-20px);
  padding-inline: 0;
}

.nav-buttons::-webkit-scrollbar {
  width: 6px;
}

.nav-buttons::-webkit-scrollbar-track {
  background: #0a0a0c;
}

.nav-buttons::-webkit-scrollbar-thumb {
  background: #5d5a5b;
  border-radius: 6px;
}

.control-section {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 22px 14px 20px;
  border: 1px solid var(--cc-border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 30, 44, 0.98), rgba(12, 23, 35, 0.98));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025), 0 3px 8px rgba(0, 0, 0, 0.16);
}

.control-section-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 16px;
  color: var(--cc-muted);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.35px;
  line-height: 1;
  text-transform: uppercase;
}

.control-section-rule {
  flex: 1 1 auto;
  height: 1px;
  background: rgba(112, 128, 143, 0.33);
}

.control-section-heading > .nav-section-toggle {
  flex: 0 0 auto;
}

.nav-button,
a.nav-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--cc-border-soft);
  border-radius: 11px;
  clip-path: none;
  background: linear-gradient(180deg, #1a2635 0%, #172230 100%);
  color: var(--cc-text);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.1;
  text-decoration: none;
  gap: 11px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035), 0 2px 5px rgba(0, 0, 0, 0.14);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.nav-button::before {
  display: none;
}

.nav-button:hover,
a.nav-button:hover {
  transform: translateY(-1px);
  border-color: #6b7e91;
  background: linear-gradient(180deg, #202f41 0%, #1a2939 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 4px 9px rgba(0, 0, 0, 0.2);
}

.nav-button:active,
a.nav-button:active {
  transform: translateY(0);
}

.nav-button:focus-visible,
a.nav-button:focus-visible {
  outline: 2px solid #5794ff;
  outline-offset: 2px;
}

.nav-button-label,
.party-panel-nav-button > span[data-party-panel-toggle-label] {
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

.nav-button > i:first-child {
  flex: 0 0 28px;
  width: 28px;
  color: #ecf4fc;
  font-size: 19px;
  text-align: center;
}

.control-row-button::after {
  content: "›";
  flex: 0 0 auto;
  color: #f4f7fb;
  font-family: Arial, sans-serif;
  font-size: 25px;
  font-weight: 300;
  line-height: 0.8;
}

.party-panel-nav-button::after {
  content: "›";
}

.party-panel-nav-button > i:first-child {
  color: #eef5ff;
}

.demo-mode-nav-button {
  min-height: 56px;
  border-color: rgba(255, 58, 155, 0.8);
  background: linear-gradient(180deg, #ef177f 0%, #c50f66 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), 0 3px 8px rgba(126, 0, 61, 0.24);
}

.demo-mode-nav-button:hover {
  border-color: #ff8fc7;
  background: linear-gradient(180deg, #f5278a 0%, #d11370 100%);
}

.demo-mode-nav-button > i:first-child {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 16px;
}

.status-chip {
  flex: 0 0 auto;
  min-width: 64px;
  padding: 8px 11px;
  border: 0;
  border-radius: 999px;
  background: rgba(129, 9, 75, 0.38);
  color: #fff;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1;
  text-align: center;
}

#volumeSliderContainer {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 6px 12px 6px 8px;
  gap: 11px;
  border: 1px solid var(--cc-border-soft);
  border-radius: 11px;
  clip-path: none;
  background: linear-gradient(180deg, #1b2838 0%, #162332 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

#volumeSliderContainer:hover {
  border-color: #6b7e91;
  background: linear-gradient(180deg, #202f40 0%, #1a2939 100%);
}

.volume-icon {
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(105, 129, 153, 0.28);
  border-radius: 50%;
  background: #101c2b;
  color: #edf4ff;
  font-size: 18px;
}

#volumeMuteButton {
  padding: 0;
  appearance: none;
  font: inherit;
  cursor: pointer;
}

#volumeMuteButton.muted {
  color: #d97878;
}

#volumeMuteButton.disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

#volumeMuteButton:focus-visible {
  outline: 2px solid var(--cc-blue);
  outline-offset: 2px;
}

#volumeSliderContainer label {
  flex: 0 0 auto;
  color: var(--cc-text);
  font-size: 17px;
  font-weight: 500;
}

#volumeSlider {
  --volume-fill: 33%;
  flex: 1 1 auto;
  width: auto;
  min-width: 42px;
  height: 6px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #2b78f7 0 var(--volume-fill), #aeb6c1 var(--volume-fill) 100%);
  accent-color: #2b78f7;
}

#volumeSlider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2b78f7 0 var(--volume-fill), #aeb6c1 var(--volume-fill) 100%);
}

#volumeSlider::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  margin-top: -5px;
  appearance: none;
  border: 1px solid #d5deeb;
  border-radius: 50%;
  background: #aebbd0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

#volumeSlider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #aeb6c1;
}

#volumeSlider::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: #2b78f7;
}

#volumeSlider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 1px solid #d5deeb;
  border-radius: 50%;
  background: #aebbd0;
}

#muteIconNav {
  flex: 0 0 29px;
  width: 29px;
  height: 29px;
}

.control-section-heading .nav-section-toggle {
  display: flex;
  align-items: center;
  min-height: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-transform: inherit;
  box-shadow: none;
}

.control-section-heading .nav-section-toggle:hover {
  transform: none;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.section-chevron {
  display: none;
}

.nav-section-toggle[aria-expanded="true"] .section-chevron {
  transform: rotate(180deg);
}

.control-section--shortcuts {
  gap: 12px;
}

#shortcutsDropdown {
  position: absolute;
  top: 51px;
  right: 16px;
  left: 16px;
  z-index: 20;
  max-height: min(60vh, 430px);
  overflow: auto;
  padding: 14px;
  border: 1px solid #405268;
  border-radius: 11px;
  background: #0c1725;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}

#shortcutsDropdown h2,
#shortcutsDropdown h3 {
  color: #eaf2fc;
}

.control-input-shell {
  display: flex;
  align-items: center;
  min-height: 54px;
  overflow: hidden;
  border: 1px solid var(--cc-border-soft);
  border-radius: 11px;
  clip-path: none;
  background: linear-gradient(180deg, #1a2635 0%, #172230 100%);
}

.control-input-shell > i {
  flex: 0 0 48px;
  color: #a8b4c1;
  font-size: 19px;
  text-align: center;
}

#newChannel {
  min-width: 0;
  flex: 1 1 auto;
  height: 52px;
  padding: 0 10px 0 0;
  border: 0;
  clip-path: none;
  outline: 0;
  background: transparent;
  color: var(--cc-text);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 16px;
}

#newChannel::placeholder {
  color: #969fac;
}

#addStreamForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
}

.control-accent-button {
  min-height: 54px;
  border-color: rgba(255, 79, 165, 0.8);
  background: linear-gradient(180deg, #ed177e 0%, #ca0e67 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), 0 3px 8px rgba(126, 0, 61, 0.2);
}

.control-accent-button:hover {
  background: linear-gradient(180deg, #f3268b 0%, #d41371 100%);
}

.control-accent-button > i:first-child {
  flex: 0 0 22px;
  color: #fff;
  font-size: 22px;
}

.control-section-divider {
  width: 100%;
  height: 1px;
  margin: 1px 0;
  background: rgba(103, 120, 137, 0.3);
}

.control-action-row {
  min-height: 52px;
  overflow: hidden;
  clip-path: none;
  padding: 0 12px 0 0;
  gap: 0;
  font-size: 16px;
}

.control-action-row > i:first-child {
  align-self: stretch;
  display: grid;
  flex: 0 0 50px;
  place-items: center;
  width: 50px;
  margin-right: 12px;
  color: #f4f7fb;
  font-size: 21px;
}

.control-action-row--backup > i:first-child {
  background: #1aa7ad;
}

.control-action-row--refresh > i:first-child {
  background: #2878db;
}

.control-action-row--remove > i:first-child {
  background: #d44135;
}

.control-action-row--neutral > i:first-child {
  background: #192536;
  border-right: 1px solid rgba(93, 113, 133, 0.48);
}

.control-action-row--backup {
  border-color: rgba(38, 136, 143, 0.75);
}

.control-action-row--refresh {
  border-color: rgba(57, 113, 187, 0.7);
}

.control-action-row--remove {
  border-color: rgba(171, 74, 67, 0.75);
}

.control-section--team .mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  gap: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--cc-border-soft);
  border-radius: 11px;
  clip-path: none;
  background: #172231;
  box-shadow: none;
}

.control-section--team #singleModeButton,
.control-section--team #dualModeButton {
  min-height: 52px;
  width: 100%;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  clip-path: none;
  background: transparent;
  color: var(--cc-text);
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
}

.control-section--team #singleModeButton > i:first-child,
.control-section--team #dualModeButton > i:first-child {
  flex: 0 0 auto;
  width: auto;
  color: #f3f7fd;
  font-size: 20px;
}

.control-section--team #singleModeButton.active-mode-button {
  background: linear-gradient(180deg, #2f7bf4 0%, #1d5ed2 100%);
  color: #fff;
  box-shadow: none;
}

.control-section--team #dualModeButton.active-mode-button {
  background: linear-gradient(180deg, #2f7bf4 0%, #1d5ed2 100%);
  color: #fff;
  box-shadow: none;
}

.control-section--team #singleModeButton::before,
.control-section--team #dualModeButton::before,
.control-section--team #singleModeButton::after,
.control-section--team #dualModeButton::after {
  display: none;
}

.control-section--system {
  gap: 10px;
}

#windowControlsButton {
  min-height: 52px;
  overflow: hidden;
  clip-path: none;
  padding: 0 12px 0 0;
  gap: 0;
  font-size: 16px;
}

#windowControlsButton > i:first-child {
  align-self: stretch;
  display: grid;
  flex: 0 0 50px;
  place-items: center;
  width: 50px;
  margin-right: 12px;
  color: #fff;
  font-size: 21px;
}

#windowControlsButton.active {
  border-color: #3cad61;
  background: linear-gradient(180deg, #2c9a50 0%, #20723c 100%);
}

#windowControlsButton.active > i:first-child {
  background: #36a65a;
}

#windowControlsButton:not(.active) {
  border-color: #dc493e;
  background: linear-gradient(180deg, #d9463d 0%, #b7322f 100%);
}

#windowControlsButton:not(.active) > i:first-child {
  background: #e95a4f;
}

#windowControlsButton .status-chip {
  min-width: 64px;
  padding: 8px 11px;
  margin-left: auto;
  background: rgba(23, 48, 35, 0.48);
}

#windowControlsButton:not(.active) .status-chip {
  background: rgba(93, 20, 20, 0.42);
}

/* ID-level corrections for legacy ControlCenter.css selectors. */
#demoModeTopButton {
  border-color: rgba(255, 58, 155, 0.8);
  background: linear-gradient(90deg, #dd0f70 0%, #e2187b 55%, #c60f66 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), 0 3px 8px rgba(126, 0, 61, 0.24);
  font-size: 18px;
  font-weight: 500;
}

#demoModeTopButton:hover {
  border-color: #ff8fc7;
  background: linear-gradient(90deg, #ed1c80 0%, #ef2689 55%, #d61772 100%);
}

#backUpStreamButton,
#refreshPageButton,
#removeOfflineStreamsButton {
  min-height: 52px;
  padding: 0 16px 0 0;
  border: 1px solid var(--cc-border-soft);
  border-radius: 11px;
  background: linear-gradient(180deg, #1a2635 0%, #172230 100%);
  color: var(--cc-text);
  font-size: 18px;
  font-weight: 500;
  gap: 0;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035), 0 2px 5px rgba(0, 0, 0, 0.14);
}

#backUpStreamButton:hover,
#refreshPageButton:hover,
#removeOfflineStreamsButton:hover {
  transform: translateY(-1px);
  border-color: #6b7e91;
  background: linear-gradient(180deg, #202f41 0%, #1a2939 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 4px 9px rgba(0, 0, 0, 0.2);
}

#backUpStreamButton > i:first-child,
#refreshPageButton > i:first-child,
#removeOfflineStreamsButton > i:first-child {
  align-self: stretch;
  display: grid;
  flex: 0 0 50px;
  place-items: center;
  width: 50px;
  margin-right: 12px;
  color: #fff;
  font-size: 21px;
}

#backUpStreamButton > i:first-child {
  background: #1aa7ad;
}

#refreshPageButton > i:first-child {
  background: #2878db;
}

#removeOfflineStreamsButton > i:first-child {
  background: #d44135;
}

.control-input-shell {
  width: 100%;
}

.party-panel-nav-button > i:first-child {
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(105, 129, 153, 0.28);
  border-radius: 50%;
  background: #101c2b;
  font-size: 18px;
}

#addStreamForm #newChannel {
  height: 52px;
  padding: 0 10px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--cc-text);
  font-size: 16px;
}

#addStreamForm #newChannel:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}

#addStreamForm .control-accent-button {
  min-height: 54px;
  border: 1px solid rgba(255, 79, 165, 0.8);
  border-radius: 11px;
  background: linear-gradient(90deg, #df1072 0%, #eb1b83 58%, #cf126c 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), 0 3px 8px rgba(126, 0, 61, 0.2);
}

#singleModeButton,
#dualModeButton {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0;
}

@media (max-width: 650px) {
  .navbar.expanded,
  .navbar:hover {
    width: min(var(--navbar-expanded-width), calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }

  .navbar-header {
    grid-template-columns: 48px minmax(0, 1fr) 40px;
    padding-inline: 12px;
    gap: 10px;
  }

  .control-center-mark,
  .navbar:hover .control-center-mark {
    width: 46px;
    height: 46px;
  }

  .control-center-title {
    font-size: 18px;
  }

  #menuToggleButton {
    width: 40px;
    height: 40px;
  }

  .nav-buttons {
    padding-inline: 10px;
  }

  .control-section {
    padding: 16px;
  }

  .nav-button,
  a.nav-button {
    min-height: 52px;
    padding-inline: 14px;
    font-size: 15px;
    gap: 10px;
  }

  .control-action-row > i:first-child,
  #windowControlsButton > i:first-child {
    flex-basis: 46px;
    width: 46px;
    margin-right: 10px;
    font-size: 19px;
  }
}

/* ========================================================================
   Burberry Midnight palette selection
   ======================================================================== */
.navbar,
.navbar.expanded,
.navbar.expanded:hover {
  border-right-color: rgba(157, 143, 138, 0.5);
}

.navbar-header {
  border-bottom-color: rgba(157, 143, 138, 0.28);
}

.control-center-mark,
.navbar:hover .control-center-mark {
  background: #171416;
  border-color: var(--cc-blue);
  box-shadow: 0 0 0 1px rgba(4, 4, 205, 0.24),
    0 0 20px rgba(4, 4, 205, 0.2);
}

#menuToggleButton {
  border-color: rgba(157, 143, 138, 0.5);
  background: var(--cc-surface-button);
  color: #f5f2ef;
}

#menuToggleButton:hover {
  border-color: var(--cc-border-strong);
  background: var(--cc-surface-raised);
}

.navbar .control-section {
  border-color: var(--cc-border);
  background: linear-gradient(180deg, #2b2422 0%, #1b1718 100%);
}

.navbar .control-section-rule,
.navbar .control-section-divider {
  background: rgba(157, 143, 138, 0.32);
}

.navbar .nav-button,
.navbar a.nav-button {
  border-color: var(--cc-border-soft);
  background: linear-gradient(180deg, #302726 0%, #231d1c 100%);
  color: var(--cc-text);
}

.navbar .nav-button:hover,
.navbar a.nav-button:hover {
  border-color: var(--cc-border-strong);
  background: linear-gradient(180deg, #3b302d 0%, #2b2321 100%);
}

.navbar .nav-button > i:first-child,
.navbar .control-row-button::after,
.navbar .party-panel-nav-button > i:first-child {
  color: #f1ebe8;
}

.navbar .demo-mode-nav-button,
#demoModeTopButton,
#addStreamForm .control-accent-button {
  border-color: rgba(157, 143, 138, 0.86);
  background: linear-gradient(135deg, #2525d9 0%, #0404cd 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.22),
    0 5px 12px rgba(4, 4, 205, 0.28);
}

.navbar .demo-mode-nav-button:hover,
#demoModeTopButton:hover,
#addStreamForm .control-accent-button:hover {
  border-color: #c7bbb7;
  background: linear-gradient(135deg, #3a3ae6 0%, #1111c8 100%);
}

.navbar .demo-mode-nav-button > i:first-child {
  background: rgba(245, 242, 239, 0.2);
}

.navbar .status-chip {
  border-color: rgba(157, 143, 138, 0.24);
  background: rgba(84, 48, 37, 0.68);
  color: #f7f2ef;
}

.navbar #volumeSliderContainer {
  border-color: var(--cc-border-soft);
  background: linear-gradient(180deg, #302726 0%, #231d1c 100%);
}

.navbar #volumeSliderContainer:hover {
  border-color: var(--cc-border-strong);
  background: linear-gradient(180deg, #3b302d 0%, #2b2321 100%);
}

.navbar .volume-icon,
.navbar .party-panel-nav-button > i:first-child {
  border-color: rgba(157, 143, 138, 0.38);
  background: #171416;
  color: #f5f2ef;
}

.navbar #volumeSliderContainer label {
  color: #eee8e4;
}

.navbar #volumeSlider {
  background: linear-gradient(90deg, var(--cc-blue) 0 var(--volume-fill), #b8ada8 var(--volume-fill) 100%);
  accent-color: var(--cc-blue);
}

.navbar #volumeSlider::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--cc-blue) 0 var(--volume-fill), #b8ada8 var(--volume-fill) 100%);
}

.navbar #volumeSlider::-webkit-slider-thumb {
  background: #e0d8d4;
}

.navbar #volumeSlider::-moz-range-progress {
  background: var(--cc-blue);
}

.navbar .control-input-shell {
  border-color: var(--cc-border-soft);
  background: linear-gradient(180deg, #302726 0%, #231d1c 100%);
}

.navbar .control-input-shell > i,
.navbar #newChannel::placeholder {
  color: #b8aaa5;
}

.navbar .control-action-row,
.navbar #windowControlsButton {
  border-color: var(--cc-border-soft);
  background: linear-gradient(180deg, #302726 0%, #231d1c 100%);
}

.navbar .control-action-row:hover,
.navbar #windowControlsButton:hover {
  border-color: var(--cc-border-strong);
  background: linear-gradient(180deg, #3b302d 0%, #2b2321 100%);
}

.navbar .control-action-row--backup > i:first-child {
  background: var(--cc-teal);
}

.navbar .control-action-row--refresh > i:first-child {
  background: var(--cc-blue);
}

.navbar .control-action-row--remove > i:first-child {
  background: var(--cc-red);
}

.navbar .control-action-row--neutral > i:first-child {
  background: var(--cc-border);
  border-right-color: rgba(157, 143, 138, 0.42);
}

.navbar #backUpStreamButton,
.navbar #refreshPageButton,
.navbar #removeOfflineStreamsButton {
  border-color: var(--cc-border-soft);
  background: linear-gradient(180deg, #302726 0%, #231d1c 100%);
}

.navbar #backUpStreamButton:hover,
.navbar #refreshPageButton:hover,
.navbar #removeOfflineStreamsButton:hover {
  border-color: var(--cc-border-strong);
  background: linear-gradient(180deg, #3b302d 0%, #2b2321 100%);
}

.navbar .control-section--team .mode-buttons {
  border-color: var(--cc-border-soft);
  background: #171416;
}

.navbar .control-section--team #singleModeButton,
.navbar .control-section--team #dualModeButton {
  color: #e2d9d5;
}

.navbar .control-section--team #singleModeButton.active-mode-button,
.navbar .control-section--team #dualModeButton.active-mode-button {
  background: linear-gradient(135deg, #2525d9 0%, #0404cd 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.2),
    0 4px 10px rgba(4, 4, 205, 0.26);
}

.navbar #windowControlsButton.active {
  border-color: rgba(98, 189, 120, 0.78);
  background: linear-gradient(180deg, #579f69 0%, #3d824f 100%);
}

.navbar #windowControlsButton:not(.active) {
  border-color: rgba(200, 91, 83, 0.76);
  background: linear-gradient(180deg, #b6534c 0%, #873b37 100%);
}

/* ========================================================================
   Left command navigation

   The Control Center uses one stable, full-height command surface. Controls
   are grouped by rhythm and separators rather than stacked section cards.
   ======================================================================== */
:root {
  --left-nav-expanded-width: 360px;
  --left-nav-collapsed-width: 66px;
}

body.left-nav-layout {
  grid-template-columns: var(--left-nav-collapsed-width) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

body.left-nav-layout.menu-open {
  grid-template-columns: var(--left-nav-expanded-width) minmax(0, 1fr);
}

body.left-nav-layout .navbar,
body.left-nav-layout .navbar:hover,
body.left-nav-layout .navbar.menu-collapsed,
body.left-nav-layout .navbar.menu-collapsed:hover {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  width: var(--left-nav-collapsed-width);
  max-width: none;
  height: 100dvh;
  min-height: 0;
  padding: 0;
  align-items: stretch;
  overflow: hidden;
  border: 0;
  border-right: 1px solid rgba(157, 143, 138, 0.46);
  border-radius: 0;
  background: linear-gradient(180deg, #121113 0%, #0a090b 100%);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3), inset -1px 0 rgba(255, 255, 255, 0.025);
  transition: width 0.26s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease;
}

body.left-nav-layout .navbar.expanded,
body.left-nav-layout .navbar.expanded:hover {
  width: var(--left-nav-expanded-width);
  max-width: none;
  height: 100dvh;
  padding: 0;
  align-items: stretch;
  overflow: hidden;
  border: 0;
  border-right: 1px solid rgba(157, 143, 138, 0.46);
  background: linear-gradient(180deg, #121113 0%, #0a090b 100%);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3), inset -1px 0 rgba(255, 255, 255, 0.025);
}

body.left-nav-layout .navbar-header,
body.left-nav-layout .navbar.menu-collapsed .navbar-header,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 42px;
  flex: 0 0 78px;
  width: 100%;
  min-height: 78px;
  height: 78px;
  padding: 14px 16px;
  gap: 10px;
  align-items: center;
  justify-content: initial;
  border: 0;
  border-bottom: 1px solid rgba(157, 143, 138, 0.22);
}

body.left-nav-layout .control-center-mark,
body.left-nav-layout .navbar:hover .control-center-mark,
body.left-nav-layout .navbar.menu-collapsed .control-center-mark,
body.left-nav-layout .navbar.menu-collapsed:hover .control-center-mark {
  width: 48px;
  height: 48px;
  border-width: 1px;
  border-color: rgba(157, 143, 138, 0.48);
  background: #171619;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
  transform: none;
}

body.left-nav-layout .control-center-mark i {
  color: #f2efed;
  font-size: 21px;
}

body.left-nav-layout .control-center-title {
  display: block;
  min-width: 0;
  width: auto;
  height: auto;
  margin: 0;
  overflow: hidden;
  color: #f5f2ef;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.45px;
  line-height: 1.05;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.left-nav-layout #menuToggleButton,
body.left-nav-layout .navbar.menu-collapsed #menuToggleButton,
body.left-nav-layout .navbar.menu-collapsed:hover #menuToggleButton {
  position: static;
  justify-self: end;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: #f5f2ef;
  background: #201d1e;
  border: 1px solid rgba(157, 143, 138, 0.42);
}

body.left-nav-layout #menuToggleButton i {
  font-size: 19px;
}

body.left-nav-layout .nav-buttons,
body.left-nav-layout .navbar.expanded .nav-buttons,
body.left-nav-layout .navbar:hover .nav-buttons {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  gap: 7px !important;
  padding: 12px 16px 16px !important;
  overflow-x: hidden;
  overflow-y: auto !important;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

body.left-nav-layout .control-section {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 0;
  gap: 6px;
  padding: 8px 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.left-nav-layout .control-section + .control-section {
  border-top: 1px solid rgba(157, 143, 138, 0.18);
}

body.left-nav-layout .control-section-heading {
  display: none;
}

body.left-nav-layout .nav-button,
body.left-nav-layout a.nav-button,
body.left-nav-layout #volumeSliderContainer,
body.left-nav-layout .control-input-shell,
body.left-nav-layout .control-action-row,
body.left-nav-layout #windowControlsButton,
body.left-nav-layout #backUpStreamButton,
body.left-nav-layout #refreshPageButton,
body.left-nav-layout #removeOfflineStreamsButton {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  margin: 0;
  padding: 0 11px;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(157, 143, 138, 0.28);
  border-radius: 9px;
  background: linear-gradient(180deg, #242021 0%, #1a1718 100%);
  color: #f2efed;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
}

body.left-nav-layout .nav-button:hover,
body.left-nav-layout a.nav-button:hover,
body.left-nav-layout #volumeSliderContainer:hover,
body.left-nav-layout .control-input-shell:hover,
body.left-nav-layout .control-action-row:hover,
body.left-nav-layout #windowControlsButton:hover,
body.left-nav-layout #backUpStreamButton:hover,
body.left-nav-layout #refreshPageButton:hover,
body.left-nav-layout #removeOfflineStreamsButton:hover {
  transform: none;
  border-color: rgba(199, 187, 183, 0.62);
  background: linear-gradient(180deg, #312b2a 0%, #211d1d 100%);
}

body.left-nav-layout .nav-button > i:first-child,
body.left-nav-layout .party-panel-nav-button > i:first-child,
body.left-nav-layout .volume-icon,
body.left-nav-layout .control-action-row > i:first-child,
body.left-nav-layout #backUpStreamButton > i:first-child,
body.left-nav-layout #refreshPageButton > i:first-child,
body.left-nav-layout #removeOfflineStreamsButton > i:first-child,
body.left-nav-layout #windowControlsButton > i:first-child {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  margin: 0 8px 0 0;
  border: 1px solid rgba(157, 143, 138, 0.26);
  border-radius: 8px;
  background: #343034;
  color: #f5f2ef;
  font-size: 17px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

body.left-nav-layout .nav-button-label,
body.left-nav-layout .nav-button > span:not(.status-chip) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.left-nav-layout .party-panel-nav-button::after,
body.left-nav-layout .control-action-row::after {
  margin-left: auto;
  color: #e8e3e0;
  font-size: 16px;
}

body.left-nav-layout .demo-mode-nav-button,
body.left-nav-layout #demoModeTopButton {
  border-color: rgba(157, 143, 138, 0.32);
  background: linear-gradient(180deg, #292627 0%, #1d1b1c 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

body.left-nav-layout .demo-mode-nav-button > i:first-child {
  flex-basis: 38px;
  width: 38px;
  height: 38px;
  background: #343034;
}

body.left-nav-layout .status-chip {
  min-width: 52px;
  padding: 6px 7px;
  border-color: rgba(157, 143, 138, 0.24);
  border-radius: 7px;
  background: #3a383c;
  color: #f5f2ef;
  font-size: 10px;
}

body.left-nav-layout #volumeSliderContainer {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 6px 10px 6px 6px;
}

body.left-nav-layout #volumeSliderContainer label {
  flex: 0 0 auto;
  font-size: 14px;
}

body.left-nav-layout .volume-icon {
  flex-basis: 38px;
  width: 38px;
  height: 38px;
}

body.left-nav-layout #volumeSlider,
body.left-nav-layout #volumeSlider::-webkit-slider-runnable-track {
  height: 5px;
}

body.left-nav-layout #muteIconNav {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}

body.left-nav-layout #addStreamForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  grid-auto-rows: 52px;
  align-items: stretch;
  gap: 5px;
}

body.left-nav-layout .control-input-shell {
  height: 52px;
  padding: 0;
}

body.left-nav-layout .control-input-shell > i {
  flex: 0 0 34px;
  width: 34px;
  color: #c8bfbb;
  font-size: 15px;
}

body.left-nav-layout #addStreamForm #newChannel {
  min-width: 0;
  height: 50px !important;
  min-height: 0;
  padding-right: 6px;
  font-size: 12px;
}

body.left-nav-layout #addStreamForm .control-accent-button {
  width: 120px;
  min-width: 120px;
  height: 52px !important;
  min-height: 52px !important;
  padding: 0 9px;
  gap: 7px;
  border-color: rgba(80, 101, 221, 0.8);
  background: linear-gradient(135deg, #315bc1 0%, #2448a3 100%);
  font-size: 13px;
}

body.left-nav-layout #addStreamForm .control-accent-button > i:first-child {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  box-shadow: none;
}

body.left-nav-layout .control-section-divider {
  display: none;
}

body.left-nav-layout .control-section--shortcuts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px;
}

body.left-nav-layout .control-section--shortcuts .control-section-heading,
body.left-nav-layout .control-section--shortcuts #shortcutsDropdown,
body.left-nav-layout .control-section--shortcuts #addStreamForm,
body.left-nav-layout .control-section--shortcuts #removeOfflineStreamsButton {
  grid-column: 1 / -1;
}

body.left-nav-layout .control-section--shortcuts .control-action-row,
body.left-nav-layout #backUpStreamButton,
body.left-nav-layout #refreshPageButton,
body.left-nav-layout #removeOfflineStreamsButton {
  min-height: 48px;
  padding: 0 7px 0 5px;
  font-size: 12px;
}

body.left-nav-layout .control-section--shortcuts .control-action-row > i:first-child,
body.left-nav-layout #backUpStreamButton > i:first-child,
body.left-nav-layout #refreshPageButton > i:first-child,
body.left-nav-layout #removeOfflineStreamsButton > i:first-child {
  flex-basis: 36px;
  width: 36px;
  height: 36px;
  margin-right: 6px;
  font-size: 16px;
}

body.left-nav-layout #removeOfflineStreamsButton {
  color: #ff817b;
  border-color: rgba(200, 91, 83, 0.38);
}

body.left-nav-layout .control-action-row--backup > i:first-child {
  background: #4d4a4c;
}

body.left-nav-layout .control-action-row--refresh > i:first-child {
  background: #4d4a4c;
}

body.left-nav-layout .control-action-row--remove > i:first-child {
  background: #b44d48;
}

body.left-nav-layout .control-action-row--neutral > i:first-child {
  background: #3d393b;
  border-right-color: rgba(157, 143, 138, 0.26);
}

body.left-nav-layout .control-section--team .mode-buttons {
  display: flex;
  flex-direction: row;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 3px;
  border: 1px solid rgba(157, 143, 138, 0.28);
  border-radius: 9px;
  background: #171416;
}

body.left-nav-layout .control-section--team #singleModeButton,
body.left-nav-layout .control-section--team #dualModeButton {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  height: 42px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #eee9e6;
  font-size: 13px;
  gap: 6px;
}

body.left-nav-layout .control-section--team #singleModeButton > i:first-child,
body.left-nav-layout .control-section--team #dualModeButton > i:first-child {
  flex-basis: 26px;
  width: 26px;
  height: 26px;
  margin: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  box-shadow: none;
}

body.left-nav-layout .control-section--team #singleModeButton.active-mode-button,
body.left-nav-layout .control-section--team #dualModeButton.active-mode-button {
  background: linear-gradient(135deg, #315bc1 0%, #2448a3 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14);
}

body.left-nav-layout .control-section--system {
  margin-top: 0;
}

body.left-nav-layout #windowControlsButton {
  min-height: 52px;
  padding: 0 7px 0 5px;
  font-size: 13px;
}

body.left-nav-layout #windowControlsButton.active {
  border-color: rgba(80, 156, 91, 0.56);
  background: linear-gradient(180deg, #18301f 0%, #122519 100%);
}

body.left-nav-layout #windowControlsButton.active > i:first-child {
  background: #4a9b5c;
}

body.left-nav-layout #windowControlsButton .status-chip {
  min-width: 44px;
  margin-left: auto;
  background: #4a9b5c;
}

body.left-nav-layout .navbar.menu-collapsed .navbar-header,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-header {
  grid-template-columns: 42px;
  justify-content: center;
  min-height: 112px;
  height: 112px;
  padding: 12px;
  gap: 8px;
}

body.left-nav-layout .navbar.menu-collapsed .control-center-title,
body.left-nav-layout .navbar.menu-collapsed:hover .control-center-title {
  display: none;
}

body.left-nav-layout .navbar.menu-collapsed .control-center-mark,
body.left-nav-layout .navbar.menu-collapsed:hover .control-center-mark,
body.left-nav-layout .navbar.menu-collapsed #menuToggleButton,
body.left-nav-layout .navbar.menu-collapsed:hover #menuToggleButton {
  justify-self: center;
  width: 40px;
  height: 40px;
}

body.left-nav-layout .navbar.menu-collapsed .nav-buttons,
body.left-nav-layout .navbar.menu-collapsed:hover .nav-buttons {
  width: 0;
  height: 0;
  padding: 0 !important;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-10px);
  pointer-events: none;
  overflow: hidden !important;
}

body.left-nav-layout .container,
body.left-nav-layout .navbar:hover ~ .container,
body.left-nav-layout .navbar.expanded ~ .container,
body.left-nav-layout .navbar.menu-collapsed ~ .container,
body.left-nav-layout .navbar.menu-collapsed:hover ~ .container {
  grid-column: 2;
  grid-row: 1;
  width: 100% !important;
  height: 100dvh !important;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  transition: none;
}

body.left-nav-layout #streamsGrid {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

body.left-nav-layout .stream-load-window {
  top: 12px;
  left: calc(var(--left-nav-expanded-width) + (100vw - var(--left-nav-expanded-width)) / 2);
  width: min(460px, calc(100vw - var(--left-nav-expanded-width) - 28px));
}

body.left-nav-layout:not(.menu-open) .stream-load-window {
  left: calc(var(--left-nav-collapsed-width) + (100vw - var(--left-nav-collapsed-width)) / 2);
  width: min(460px, calc(100vw - var(--left-nav-collapsed-width) - 28px));
}

@media (max-height: 760px) {
  body.left-nav-layout .navbar-header {
    flex-basis: 64px;
    min-height: 64px;
    height: 64px;
    padding-block: 9px;
  }

  body.left-nav-layout .nav-buttons,
  body.left-nav-layout .navbar.expanded .nav-buttons,
  body.left-nav-layout .navbar:hover .nav-buttons {
    gap: 3px !important;
    padding-block: 5px 7px !important;
  }

  body.left-nav-layout .control-section {
    gap: 3px;
    padding-block: 3px;
  }

  body.left-nav-layout .nav-button,
  body.left-nav-layout a.nav-button,
  body.left-nav-layout #volumeSliderContainer,
  body.left-nav-layout #windowControlsButton {
    min-height: 38px;
  }

  body.left-nav-layout #addStreamForm {
    grid-auto-rows: 38px;
  }

  body.left-nav-layout .control-input-shell,
  body.left-nav-layout #addStreamForm .control-accent-button {
    height: 38px !important;
    min-height: 38px !important;
  }

  body.left-nav-layout #addStreamForm #newChannel {
    height: 36px !important;
  }

  body.left-nav-layout .control-section--shortcuts .control-action-row,
  body.left-nav-layout #backUpStreamButton,
  body.left-nav-layout #refreshPageButton,
  body.left-nav-layout #removeOfflineStreamsButton {
    min-height: 34px;
  }

  body.left-nav-layout .control-section--team .mode-buttons {
    min-height: 38px;
  }

  body.left-nav-layout .control-section--team #singleModeButton,
  body.left-nav-layout .control-section--team #dualModeButton {
    min-height: 30px;
    height: 30px;
  }
}

/* ========================================================================
   Desktop grouped command rail

   A single 8px alignment system replaces the former mix of half-width and
   individually framed buttons. Phone-specific layout is intentionally out of
   scope; the rail is tuned for desktop and iPad-class browser widths.
   ======================================================================== */
:root {
  --left-nav-expanded-width: 380px;
  --left-nav-collapsed-width: 68px;
  --left-rail-gutter: 20px;
  --left-rail-icon: 34px;
  --left-rail-row: 48px;
  --left-rail-radius: 10px;
  --left-rail-bg: #0b0b0d;
  --left-rail-surface: #171719;
  --left-rail-surface-hover: #202023;
  --left-rail-border: rgba(198, 192, 188, 0.25);
  --left-rail-divider: rgba(198, 192, 188, 0.15);
  --left-rail-text: #f3f1ef;
  --left-rail-muted: #929095;
  --left-rail-blue: #315fc6;
  --left-rail-red: #ef655d;
  --left-rail-green: #63a66f;
}

body.left-nav-layout .navbar,
body.left-nav-layout .navbar:hover,
body.left-nav-layout .navbar.menu-collapsed,
body.left-nav-layout .navbar.menu-collapsed:hover,
body.left-nav-layout .navbar.expanded,
body.left-nav-layout .navbar.expanded:hover {
  border-right-color: rgba(198, 192, 188, 0.34);
  background: var(--left-rail-bg);
  box-shadow: 10px 0 28px rgba(0, 0, 0, 0.28);
}

body.left-nav-layout .navbar-header,
body.left-nav-layout .navbar.menu-collapsed .navbar-header,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-header {
  grid-template-columns: 44px minmax(0, 1fr) 42px;
  flex-basis: 72px;
  min-height: 72px;
  height: 72px;
  padding: 12px var(--left-rail-gutter);
  gap: 12px;
  border-bottom-color: var(--left-rail-divider);
}

body.left-nav-layout .control-center-mark,
body.left-nav-layout .navbar:hover .control-center-mark,
body.left-nav-layout .navbar.menu-collapsed .control-center-mark,
body.left-nav-layout .navbar.menu-collapsed:hover .control-center-mark {
  width: 44px;
  height: 44px;
  border-color: rgba(198, 192, 188, 0.43);
  background: #151517;
}

body.left-nav-layout .control-center-mark i {
  font-size: 19px;
}

body.left-nav-layout .control-center-title {
  font-size: 26px;
  letter-spacing: -0.5px;
}

body.left-nav-layout #menuToggleButton,
body.left-nav-layout .navbar.menu-collapsed #menuToggleButton,
body.left-nav-layout .navbar.menu-collapsed:hover #menuToggleButton {
  width: 42px;
  height: 42px;
  border-color: rgba(198, 192, 188, 0.38);
  background: #18181a;
}

body.left-nav-layout .nav-buttons,
body.left-nav-layout .navbar.expanded .nav-buttons,
body.left-nav-layout .navbar:hover .nav-buttons {
  gap: 12px !important;
  padding: 13px var(--left-rail-gutter) 18px !important;
  overflow-y: auto !important;
}

body.left-nav-layout .control-section {
  gap: 6px;
  padding: 0;
  border: 0 !important;
}

body.left-nav-layout .control-section + .control-section {
  border-top: 0;
}

body.left-nav-layout .control-section-heading {
  display: flex;
  min-height: 14px;
  padding: 0 3px;
  color: var(--left-rail-muted);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.05px;
  line-height: 14px;
  text-transform: uppercase;
}

body.left-nav-layout .control-section-heading .nav-section-toggle {
  width: auto;
  min-height: 14px;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
}

body.left-nav-layout .control-group-shell,
body.left-nav-layout .mode-buttons {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--left-rail-border);
  border-radius: var(--left-rail-radius);
  background: var(--left-rail-surface);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

body.left-nav-layout .control-group-shell > .nav-button,
body.left-nav-layout .control-group-shell > a.nav-button,
body.left-nav-layout .control-group-shell > #volumeSliderContainer,
body.left-nav-layout .control-row-group > .nav-button,
body.left-nav-layout .control-row-group > .control-action-row,
body.left-nav-layout .control-row-group > #backUpStreamButton,
body.left-nav-layout .control-row-group > #refreshPageButton,
body.left-nav-layout .control-row-group > #removeOfflineStreamsButton,
body.left-nav-layout .control-group-shell > #windowControlsButton {
  position: relative;
  width: 100%;
  min-height: var(--left-rail-row) !important;
  height: var(--left-rail-row);
  margin: 0;
  padding: 0 12px;
  gap: 12px !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--left-rail-text) !important;
  box-shadow: none !important;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
}

body.left-nav-layout .control-group-shell > .nav-button:hover,
body.left-nav-layout .control-group-shell > a.nav-button:hover,
body.left-nav-layout .control-group-shell > #volumeSliderContainer:hover,
body.left-nav-layout .control-row-group > .nav-button:hover,
body.left-nav-layout .control-group-shell > #windowControlsButton:hover {
  transform: none;
  background: var(--left-rail-surface-hover) !important;
}

body.left-nav-layout .control-group-shell > :is(.nav-button, a.nav-button, #volumeSliderContainer) + :is(.nav-button, a.nav-button, #volumeSliderContainer),
body.left-nav-layout .control-row-group > .nav-button + .nav-button,
body.left-nav-layout .control-group-shell--system > #windowControlsButton {
  border-top: 1px solid var(--left-rail-divider) !important;
}

body.left-nav-layout .control-row-group {
  width: 100%;
}

body.left-nav-layout .nav-button > i:first-child,
body.left-nav-layout .party-panel-nav-button > i:first-child,
body.left-nav-layout .volume-icon,
body.left-nav-layout .control-action-row > i:first-child,
body.left-nav-layout #backUpStreamButton > i:first-child,
body.left-nav-layout #refreshPageButton > i:first-child,
body.left-nav-layout #removeOfflineStreamsButton > i:first-child,
body.left-nav-layout #windowControlsButton > i:first-child {
  display: grid;
  place-items: center;
  flex: 0 0 var(--left-rail-icon);
  width: var(--left-rail-icon);
  height: var(--left-rail-icon);
  margin: 0;
  border: 1px solid rgba(198, 192, 188, 0.25);
  border-radius: 7px;
  background: #303033;
  color: var(--left-rail-text);
  font-size: 15px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

body.left-nav-layout .nav-button-label,
body.left-nav-layout .nav-button > span:not(.status-chip) {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
  color: inherit;
  font-size: inherit !important;
  line-height: inherit;
  text-align: left;
  text-overflow: clip;
  white-space: nowrap !important;
}

body.left-nav-layout .party-panel-nav-button::after,
body.left-nav-layout .control-action-row::after,
body.left-nav-layout .control-row-button::after {
  display: none !important;
  content: none !important;
}

body.left-nav-layout .control-row-chevron {
  display: block;
  flex: 0 0 14px;
  width: 14px;
  margin-left: auto;
  color: #c8c5c3;
  font-size: 11px;
  text-align: center;
}

body.left-nav-layout .demo-mode-nav-button,
body.left-nav-layout #demoModeTopButton {
  min-height: var(--left-rail-row) !important;
  height: var(--left-rail-row) !important;
  padding: 0 12px !important;
  gap: 12px !important;
  border: 0 !important;
  border-top: 1px solid var(--left-rail-divider) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--left-rail-text) !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

body.left-nav-layout .status-chip {
  flex: 0 0 auto;
  min-width: 52px;
  margin-left: auto;
  padding: 5px 8px;
  border: 1px solid rgba(198, 192, 188, 0.22);
  border-radius: 6px;
  background: #343438;
  color: #efedeb;
  font-size: 9px;
  line-height: 1;
}

body.left-nav-layout #volumeSliderContainer {
  display: grid;
  grid-template-columns: var(--left-rail-icon) 54px minmax(84px, 1fr) 22px;
  align-items: center;
}

body.left-nav-layout #volumeSliderContainer label {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
}

body.left-nav-layout #volumeSlider {
  width: 100%;
  min-width: 0;
  margin: 0;
}

body.left-nav-layout #muteIconNav {
  flex: none;
  width: 22px;
  height: 22px;
}

body.left-nav-layout .control-group-shell--streams {
  padding: 12px;
}

body.left-nav-layout #addStreamForm {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 8px;
}

body.left-nav-layout .control-input-shell {
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(198, 192, 188, 0.28);
  border-radius: 8px;
  background: #101012;
  box-shadow: none;
}

body.left-nav-layout .control-input-shell > i {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-right: 1px solid var(--left-rail-divider);
  color: #b7b4b3;
  font-size: 14px;
}

body.left-nav-layout #addStreamForm #newChannel {
  width: 100%;
  height: 42px !important;
  padding: 0 12px;
  color: var(--left-rail-text);
  font-size: 12px;
}

body.left-nav-layout #addStreamForm #newChannel::placeholder {
  color: #8e8c90;
  opacity: 1;
}

body.left-nav-layout #addStreamForm .control-accent-button {
  width: 100% !important;
  min-width: 0 !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 14px !important;
  justify-content: center;
  gap: 9px !important;
  border: 1px solid rgba(111, 151, 244, 0.78) !important;
  border-radius: 8px !important;
  background: var(--left-rail-blue) !important;
  color: #fff !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

body.left-nav-layout #addStreamForm .control-accent-button > i:first-child {
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: auto;
  margin: 0;
  border: 0;
  background: transparent;
  font-size: 15px;
  box-shadow: none;
}

body.left-nav-layout .control-row-group--stream-actions {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--left-rail-border);
  border-radius: 8px;
}

body.left-nav-layout #removeOfflineStreamsButton,
body.left-nav-layout #removeOfflineStreamsButton .nav-button-label,
body.left-nav-layout #removeOfflineStreamsButton .control-row-chevron {
  color: var(--left-rail-red) !important;
}

body.left-nav-layout #removeOfflineStreamsButton > i:first-child {
  border-color: rgba(239, 101, 93, 0.36);
  background: #552725;
}

body.left-nav-layout .control-section--team .mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 48px;
  padding: 4px;
  border-radius: var(--left-rail-radius);
  background: var(--left-rail-surface);
}

body.left-nav-layout .control-section--team #singleModeButton,
body.left-nav-layout .control-section--team #dualModeButton {
  width: 100%;
  min-height: 38px;
  height: 38px;
  padding: 0 12px;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--left-rail-text);
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
}

body.left-nav-layout .control-section--team #singleModeButton > i:first-child,
body.left-nav-layout .control-section--team #dualModeButton > i:first-child {
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: auto;
  margin: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  box-shadow: none;
}

body.left-nav-layout .control-section--team #singleModeButton.active-mode-button,
body.left-nav-layout .control-section--team #dualModeButton.active-mode-button {
  background: var(--left-rail-blue) !important;
  color: #fff !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.13) !important;
}

body.left-nav-layout #windowControlsButton.active {
  background: #17321e !important;
}

body.left-nav-layout #windowControlsButton.active > i:first-child {
  border-color: rgba(99, 166, 111, 0.46);
  background: #315e3a;
}

body.left-nav-layout #windowControlsButton .status-chip {
  min-width: 44px;
  background: var(--left-rail-green);
  color: #fff;
  font-size: 10px;
}

body.left-nav-layout .navbar.menu-collapsed .navbar-header,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-header {
  grid-template-columns: 42px;
  min-height: 110px;
  height: 110px;
  padding: 12px;
}

body.left-nav-layout .stream-load-window {
  left: calc(var(--left-nav-expanded-width) + (100vw - var(--left-nav-expanded-width)) / 2);
  width: min(460px, calc(100vw - var(--left-nav-expanded-width) - 28px));
}

@media (min-width: 721px) and (max-width: 1100px) {
  :root {
    --left-nav-expanded-width: 348px;
    --left-rail-gutter: 16px;
  }

  body.left-nav-layout .control-center-title {
    font-size: 21px;
  }
}

@media (max-height: 820px) {
  :root {
    --left-rail-row: 41px;
  }

  body.left-nav-layout .navbar-header {
    flex-basis: 64px;
    min-height: 64px;
    height: 64px;
    padding-block: 9px;
  }

  body.left-nav-layout .control-center-mark {
    width: 40px;
    height: 40px;
  }

  body.left-nav-layout .control-center-title {
    font-size: 21px;
  }

  body.left-nav-layout .nav-buttons,
  body.left-nav-layout .navbar.expanded .nav-buttons,
  body.left-nav-layout .navbar:hover .nav-buttons {
    gap: 7px !important;
    padding-block: 8px 10px !important;
  }

  body.left-nav-layout .control-section {
    gap: 3px;
  }

  body.left-nav-layout .control-section-heading,
  body.left-nav-layout .control-section-heading .nav-section-toggle {
    min-height: 11px;
    font-size: 9px;
    line-height: 11px;
  }

  body.left-nav-layout .control-group-shell > .nav-button,
  body.left-nav-layout .control-group-shell > a.nav-button,
  body.left-nav-layout .control-group-shell > #volumeSliderContainer,
  body.left-nav-layout .control-row-group > .nav-button,
  body.left-nav-layout .control-group-shell > #windowControlsButton,
  body.left-nav-layout .demo-mode-nav-button,
  body.left-nav-layout #demoModeTopButton {
    min-height: var(--left-rail-row) !important;
    height: var(--left-rail-row) !important;
  }

  body.left-nav-layout .nav-button > i:first-child,
  body.left-nav-layout .party-panel-nav-button > i:first-child,
  body.left-nav-layout .volume-icon,
  body.left-nav-layout .control-action-row > i:first-child,
  body.left-nav-layout #windowControlsButton > i:first-child {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
  }

  body.left-nav-layout #volumeSliderContainer {
    grid-template-columns: 30px 50px minmax(72px, 1fr) 22px;
  }

  body.left-nav-layout .control-group-shell--streams {
    padding: 8px;
  }

  body.left-nav-layout .control-input-shell,
  body.left-nav-layout #addStreamForm .control-accent-button {
    height: 37px !important;
    min-height: 37px !important;
  }

  body.left-nav-layout #addStreamForm #newChannel,
  body.left-nav-layout .control-input-shell > i {
    height: 35px !important;
  }

  body.left-nav-layout .control-row-group--stream-actions {
    margin-top: 8px;
  }

  body.left-nav-layout .control-section--team .mode-buttons {
    min-height: 42px;
  }

  body.left-nav-layout .control-section--team #singleModeButton,
  body.left-nav-layout .control-section--team #dualModeButton {
    min-height: 32px;
    height: 32px;
  }
}

/* Volume stabilization controls stay compact so they can live beside the
   existing master volume control without changing the stream rail layout. */
#volumeStabilizationContainer {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  gap: 7px;
  width: 100%;
  margin-top: 8px;
  padding: 9px 10px 10px;
  color: rgba(239, 244, 252, 0.86);
  background: rgba(8, 14, 23, 0.68);
  border: 1px solid rgba(140, 161, 190, 0.25);
  border-radius: 8px;
}

body.top-nav-layout #volumeStabilizationContainer {
  flex: 0 0 100%;
}

.volume-stabilization-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.volume-stabilization-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.volume-stabilization-title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.volume-stabilization-title i {
  color: rgba(205, 219, 238, 0.76);
  font-size: 10px;
}

.volume-stabilization-toggle {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 25px;
  padding: 3px 8px;
  color: rgba(230, 237, 246, 0.84);
  background: rgba(78, 88, 103, 0.46);
  border: 1px solid rgba(173, 188, 209, 0.34);
  border-radius: 6px;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.volume-stabilization-set {
  flex: 0 0 auto;
  min-width: 38px;
  min-height: 25px;
  padding: 3px 7px;
  color: rgba(208, 225, 245, 0.88);
  background: rgba(43, 77, 111, 0.46);
  border: 1px solid rgba(126, 176, 222, 0.36);
  border-radius: 6px;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.volume-stabilization-set:hover,
.volume-stabilization-set:focus-visible {
  color: #fff;
  border-color: rgba(173, 214, 250, 0.82);
  background: rgba(55, 101, 145, 0.72);
}

.volume-stabilization-set:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.volume-stabilization-toggle:hover,
.volume-stabilization-toggle:focus-visible {
  color: #fff;
  border-color: rgba(222, 232, 247, 0.72);
  background: rgba(104, 116, 133, 0.68);
}

.volume-stabilization-toggle.is-enabled {
  color: #09110b;
  background: #9ee6af;
  border-color: #c4ffd0;
}

.volume-stabilization-description {
  color: rgba(202, 214, 231, 0.68);
  font-size: 10px;
  line-height: 1.35;
}

.volume-stabilization-reference-status {
  color: rgba(179, 211, 238, 0.76);
  font-size: 9px;
  line-height: 1.3;
}

.volume-stabilization-reference-status[hidden] {
  display: none;
}

.volume-stabilization-streams {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow-y: auto;
  padding-top: 2px;
}

.volume-stabilization-stream {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  align-items: center;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(173, 188, 209, 0.16);
  border-radius: 6px;
}

.volume-stabilization-stream-name {
  min-width: 0;
  overflow: hidden;
  color: rgba(243, 247, 253, 0.9);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.volume-stabilization-stream-value {
  color: rgba(210, 222, 239, 0.74);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.volume-stabilization-stream input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: #b5c9e3;
}

.volume-stabilization-stream input[type="range"]:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.volume-stabilization-reset {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 0;
  color: rgba(197, 212, 232, 0.7);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}

.volume-stabilization-reset:hover,
.volume-stabilization-reset:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.volume-stabilization-reset:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  text-decoration: none;
}

@media (max-width: 620px) {
  #volumeStabilizationContainer {
    padding-inline: 8px;
  }
}

@media (max-width: 720px) {
  :root {
    --left-nav-expanded-width: min(360px, calc(100vw - 54px));
    --left-nav-collapsed-width: 58px;
  }

  body.left-nav-layout .navbar,
  body.left-nav-layout .navbar:hover,
  body.left-nav-layout .navbar.expanded,
  body.left-nav-layout .navbar.expanded:hover,
  body.left-nav-layout .navbar.menu-collapsed,
  body.left-nav-layout .navbar.menu-collapsed:hover {
    z-index: 1200;
  }

  body.left-nav-layout .navbar.expanded,
  body.left-nav-layout .navbar.expanded:hover {
    position: fixed;
    inset: 0 auto 0 0;
  }

  body.left-nav-layout.menu-open {
    grid-template-columns: var(--left-nav-collapsed-width) minmax(0, 1fr);
  }

  body.left-nav-layout .container,
  body.left-nav-layout .navbar:hover ~ .container,
  body.left-nav-layout .navbar.expanded ~ .container,
  body.left-nav-layout .navbar.menu-collapsed ~ .container,
  body.left-nav-layout .navbar.menu-collapsed:hover ~ .container {
    grid-column: 2;
  }
}

/* ========================================================================
   Top navigation layout

   Control Center is a full-page surface, so keep the navigation in the
   conventional top band and give the stream grid the remaining viewport.
   The existing section markup stays intact; only its layout changes here.
   ======================================================================== */
body.top-nav-layout,
body.top-nav-layout.menu-open {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
}

body.top-nav-layout .navbar,
body.top-nav-layout .navbar.expanded,
body.top-nav-layout .navbar.expanded:hover,
body.top-nav-layout .navbar:hover,
body.top-nav-layout .navbar.menu-collapsed,
body.top-nav-layout .navbar.menu-collapsed:hover {
  grid-column: 1;
  grid-row: 1;
  position: relative;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 0;
  padding: 0;
  align-items: stretch;
  overflow: visible;
  border-right: 0;
  border-bottom: 1px solid rgba(123, 151, 183, 0.48);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22), inset 0 -1px rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

body.top-nav-layout .navbar-header,
body.top-nav-layout .navbar.menu-collapsed .navbar-header,
body.top-nav-layout .navbar.menu-collapsed:hover .navbar-header {
  grid-template-columns: 52px minmax(0, 1fr) 44px;
  flex: 0 0 auto;
  width: 100%;
  min-height: 72px;
  height: 72px;
  padding: 12px 18px;
  gap: 12px;
  justify-content: initial;
  border-bottom: 1px solid rgba(123, 151, 183, 0.3);
}

body.top-nav-layout .control-center-mark,
body.top-nav-layout .navbar:hover .control-center-mark,
body.top-nav-layout .navbar.menu-collapsed .control-center-mark,
body.top-nav-layout .navbar.menu-collapsed:hover .control-center-mark {
  width: 52px;
  height: 52px;
  transform: none;
}

body.top-nav-layout .control-center-mark i {
  font-size: 22px;
}

body.top-nav-layout .control-center-title,
body.top-nav-layout .navbar.menu-collapsed .control-center-title,
body.top-nav-layout .navbar.menu-collapsed:hover .control-center-title {
  display: block;
  min-width: 0;
  width: auto;
  height: auto;
  margin: 0;
  overflow: hidden;
  color: var(--cc-text);
  font-size: 25px;
  line-height: 1.1;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.top-nav-layout #menuToggleButton,
body.top-nav-layout .navbar.menu-collapsed #menuToggleButton,
body.top-nav-layout .navbar.menu-collapsed:hover #menuToggleButton {
  position: static;
  justify-self: end;
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

body.top-nav-layout .nav-buttons,
body.top-nav-layout .navbar.expanded .nav-buttons,
body.top-nav-layout .navbar:hover .nav-buttons {
  display: grid;
  grid-column: 1;
  grid-row: 2;
  grid-template-columns: repeat(3, minmax(140px, 1fr)) minmax(300px, 2.2fr) repeat(3, minmax(140px, 1fr));
  grid-auto-flow: row;
  grid-auto-rows: auto;
  align-items: start;
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
  min-height: 0;
  max-height: 270px;
  gap: 8px;
  padding: 10px 16px 12px;
  overflow-x: auto;
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  scrollbar-color: #5d5a5b #0a0a0c;
  scrollbar-width: thin;
  transition: opacity 0.2s ease, max-height 0.25s ease, padding 0.25s ease;
}

body.top-nav-layout .nav-buttons::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

body.top-nav-layout .nav-buttons::-webkit-scrollbar-track {
  background: #0a0a0c;
}

body.top-nav-layout .nav-buttons::-webkit-scrollbar-thumb {
  background: #5d5a5b;
  border-radius: 999px;
}

body.top-nav-layout .control-section {
  width: auto;
  min-width: 0;
  min-height: 0;
  gap: 7px;
  padding: 10px 10px 9px;
  border-radius: 12px;
  overflow: hidden;
}

body.top-nav-layout .control-section-heading {
  min-height: 12px;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 0.45px;
}

body.top-nav-layout .nav-button,
body.top-nav-layout a.nav-button {
  min-width: 0;
  min-height: 40px;
  padding: 0 9px;
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.05;
  gap: 7px;
  white-space: nowrap;
}

body.top-nav-layout .nav-button > i:first-child {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 15px;
}

body.top-nav-layout .nav-button-label,
body.top-nav-layout .nav-button > span:not(.status-chip) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.top-nav-layout .control-section--shortcuts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-content: start;
  gap: 6px 8px;
}

body.top-nav-layout .control-section--shortcuts .control-section-heading,
body.top-nav-layout .control-section--shortcuts #shortcutsDropdown,
body.top-nav-layout .control-section--shortcuts #addStreamForm,
body.top-nav-layout .control-section--shortcuts .control-section-divider {
  grid-column: 1 / -1;
}

body.top-nav-layout .control-section--shortcuts #addStreamForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-auto-rows: 36px;
  align-items: stretch;
  gap: 5px;
}

body.top-nav-layout .control-section--shortcuts .control-action-row {
  min-width: 0;
  min-height: 36px;
  padding-right: 6px;
  font-size: 12px;
}

body.top-nav-layout .control-section--shortcuts .control-action-row > i:first-child,
body.top-nav-layout #windowControlsButton > i:first-child {
  flex-basis: 32px;
  width: 32px;
  height: 32px;
  margin-right: 6px;
  font-size: 15px;
}

body.top-nav-layout .control-section--shortcuts .control-input-shell {
  min-width: 0;
  min-height: 36px;
  height: 36px;
}

body.top-nav-layout .control-section--shortcuts #addStreamForm #newChannel {
  min-width: 0;
  height: 34px !important;
  min-height: 0;
  font-size: 12px;
}

body.top-nav-layout .control-section--shortcuts #addStreamForm .control-accent-button {
  min-width: 112px;
  height: 36px !important;
  min-height: 36px !important;
  padding-inline: 9px;
  font-size: 12px;
}

body.top-nav-layout .control-section--team .mode-buttons {
  display: flex;
  flex-direction: row;
  min-height: 36px;
  margin: 0;
  padding: 3px;
  border-radius: 9px;
}

body.top-nav-layout .control-section--team #singleModeButton,
body.top-nav-layout .control-section--team #dualModeButton {
  flex: 1 1 0;
  min-height: 30px;
  padding-inline: 6px;
  font-size: 12px;
  gap: 5px;
}

body.top-nav-layout .control-section--team #singleModeButton > i:first-child,
body.top-nav-layout .control-section--team #dualModeButton > i:first-child {
  flex-basis: 22px;
  width: 22px;
  height: 22px;
  font-size: 13px;
}

body.top-nav-layout #volumeSliderContainer {
  min-width: 0;
  min-height: 42px;
  padding: 4px 7px 4px 5px;
  gap: 7px;
}

body.top-nav-layout .volume-icon {
  flex-basis: 30px;
  width: 30px;
  height: 30px;
  font-size: 14px;
}

body.top-nav-layout #volumeSliderContainer label {
  font-size: 13px;
}

body.top-nav-layout #volumeSlider,
body.top-nav-layout #volumeSlider::-webkit-slider-runnable-track {
  height: 5px;
}

body.top-nav-layout .status-chip {
  min-width: 52px;
  padding: 6px 7px;
  font-size: 10px;
}

body.top-nav-layout .navbar.menu-collapsed .nav-buttons,
body.top-nav-layout .navbar.menu-collapsed:hover .nav-buttons {
  max-height: 0;
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  overflow: hidden;
}

body.top-nav-layout .container,
body.top-nav-layout .navbar:hover ~ .container,
body.top-nav-layout .navbar.expanded ~ .container,
body.top-nav-layout .navbar.menu-collapsed ~ .container,
body.top-nav-layout .navbar.menu-collapsed:hover ~ .container {
  grid-column: 1;
  grid-row: 2;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  transition: none;
}

body.top-nav-layout #streamsGrid {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

body.top-nav-layout .stream-load-window {
  top: 12px;
  left: 50%;
  width: min(460px, calc(100vw - 28px));
}

@media (max-width: 900px) {
  body.top-nav-layout .navbar-header,
  body.top-nav-layout .navbar.menu-collapsed .navbar-header,
  body.top-nav-layout .navbar.menu-collapsed:hover .navbar-header {
    grid-template-columns: 46px minmax(0, 1fr) 42px;
    min-height: 66px;
    height: 66px;
    padding: 10px 14px;
    gap: 10px;
  }

  body.top-nav-layout .control-center-mark,
  body.top-nav-layout .navbar:hover .control-center-mark,
  body.top-nav-layout .navbar.menu-collapsed .control-center-mark,
  body.top-nav-layout .navbar.menu-collapsed:hover .control-center-mark {
    width: 46px;
    height: 46px;
  }

  body.top-nav-layout .control-center-title {
    font-size: 22px;
  }

  body.top-nav-layout #menuToggleButton,
  body.top-nav-layout .navbar.menu-collapsed #menuToggleButton,
  body.top-nav-layout .navbar.menu-collapsed:hover #menuToggleButton {
    width: 42px;
    height: 42px;
  }

  body.top-nav-layout .nav-buttons,
  body.top-nav-layout .navbar.expanded .nav-buttons,
  body.top-nav-layout .navbar:hover .nav-buttons {
    grid-template-columns: repeat(3, minmax(132px, 1fr)) minmax(300px, 2fr) repeat(3, minmax(132px, 1fr));
    gap: 7px;
    padding: 8px 12px 10px;
  }
}

@media (max-width: 600px) {
  body.top-nav-layout .navbar-header,
  body.top-nav-layout .navbar.menu-collapsed .navbar-header,
  body.top-nav-layout .navbar.menu-collapsed:hover .navbar-header {
    grid-template-columns: 42px minmax(0, 1fr) 40px;
    min-height: 60px;
    height: 60px;
    padding: 8px 10px;
    gap: 8px;
  }

  body.top-nav-layout .control-center-mark,
  body.top-nav-layout .navbar:hover .control-center-mark,
  body.top-nav-layout .navbar.menu-collapsed .control-center-mark,
  body.top-nav-layout .navbar.menu-collapsed:hover .control-center-mark {
    width: 42px;
    height: 42px;
  }

  body.top-nav-layout .control-center-mark i {
    font-size: 19px;
  }

  body.top-nav-layout .control-center-title {
    font-size: 19px;
  }

  body.top-nav-layout #menuToggleButton,
  body.top-nav-layout .navbar.menu-collapsed #menuToggleButton,
  body.top-nav-layout .navbar.menu-collapsed:hover #menuToggleButton {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  body.top-nav-layout .nav-buttons,
  body.top-nav-layout .navbar.expanded .nav-buttons,
  body.top-nav-layout .navbar:hover .nav-buttons {
    grid-template-columns: repeat(3, minmax(128px, 1fr)) minmax(292px, 2fr) repeat(3, minmax(128px, 1fr));
    gap: 6px;
    padding: 7px 10px 9px;
  }
}

/* Final stream rail finish. Keep the compact close affordance authoritative
   after the legacy overview-density rules have set their rail dimensions. */
body.popup-mode #streamsGrid .stream .stream-name {
  background: #101a28 !important;
  border-color: rgba(164, 187, 220, 0.42) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .remove-button {
  flex-basis: 30px !important;
  width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
}

/* ========================================================================
   Stream grid clarity refinement
   Let the video canvas own the tile. Rails float over the media, with the
   secondary actions appearing only when a tile is being used. The existing
   buttons, labels, and runtime handlers remain unchanged.
   ======================================================================== */
body.popup-mode #streamsGrid.overview-fit {
  box-sizing: border-box;
  gap: 4px !important;
  padding: 4px !important;
}

body.popup-mode #streamsGrid.overview-fit.overview-compact {
  box-sizing: border-box;
  gap: 4px !important;
  padding: 4px !important;
}

body.popup-mode #streamsGrid.overview-fit > .stream.twitch-stream-card {
  position: relative !important;
  display: block !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box;
  border: 1px solid rgba(128, 148, 173, 0.3) !important;
  border-radius: 10px !important;
  background: #070b11 !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.26);
  isolation: isolate;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.popup-mode #streamsGrid.overview-fit > .stream.twitch-stream-card:hover {
  border-color: rgba(173, 196, 228, 0.54) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-player-host--direct {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  overflow: hidden !important;
  background: #000 !important;
}

/* Keep the Twitch host genuinely visible during its autoplay handshake. The
   embed rejects autoplay when an ancestor is hidden, clipped, or transformed;
   the card itself supplies the loading mask, so the player can stay mounted
   and interactive underneath it. */
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-playback-staging
  > .twitch-player-host--direct,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-playback-loading
  > .twitch-player-host--direct {
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  clip-path: none !important;
  overflow: visible !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 4 !important;
  display: flex !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  grid-column: auto !important;
  grid-row: auto !important;
  overflow: visible !important;
  border: 0 !important;
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none !important;
  transform: none !important;
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top {
  top: 0 !important;
  bottom: auto !important;
  height: 52px !important;
  min-height: 52px !important;
  padding: 7px 10px !important;
  align-items: flex-start;
  background: linear-gradient(180deg, rgba(4, 8, 14, 0.94) 0%, rgba(4, 8, 14, 0.58) 58%, transparent 100%) !important;
  opacity: 1 !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom {
  top: auto !important;
  bottom: 0 !important;
  height: 54px !important;
  min-height: 54px !important;
  padding: 8px 10px 10px !important;
  align-items: flex-end;
  background: linear-gradient(0deg, rgba(4, 8, 14, 0.94) 0%, rgba(4, 8, 14, 0.58) 58%, transparent 100%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(8px) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card:hover
  > .twitch-card-rail--bottom,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card:focus-within
  > .twitch-card-rail--bottom {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name {
  position: static !important;
  flex: 0 1 auto;
  width: auto !important;
  max-width: calc(100% - 54px) !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: none !important;
  padding: 0 10px !important;
  gap: 4px;
  color: #f1f5fb;
  background: #101a28 !important;
  border: 1px solid rgba(164, 187, 220, 0.42) !important;
  border-radius: 7px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.26) !important;
  font-size: clamp(11px, 0.95vw, 14px) !important;
  font-weight: 700;
  pointer-events: auto !important;
  transform: none !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name:focus-visible {
  max-width: calc(100% - 54px) !important;
  padding: 0 10px !important;
  color: #fff;
  background: #17263a !important;
  border-color: rgba(205, 226, 255, 0.72) !important;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.36) !important;
  transform: translateY(-1px) scale(1.01) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-index-label {
  color: rgba(190, 205, 224, 0.64);
  font-size: 0.78em;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .remove-button {
  position: absolute !important;
  top: 8px !important;
  right: 10px !important;
  bottom: auto !important;
  left: auto !important;
  flex: 0 0 30px;
  width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  max-height: none !important;
  margin: 0 !important;
  color: #fff;
  background: rgba(207, 66, 63, 0.92) !important;
  border: 1px solid rgba(255, 164, 164, 0.58) !important;
  border-radius: 7px !important;
  box-shadow: 0 4px 12px rgba(100, 22, 22, 0.28) !important;
  font-size: 12px !important;
  pointer-events: auto !important;
  transform: none !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .remove-button:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .remove-button:focus-visible {
  background: #e34a4a !important;
  border-color: #ffd0d0 !important;
  box-shadow: 0 7px 16px rgba(170, 30, 30, 0.44) !important;
  transform: translateY(-1px) scale(1.05) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .pip-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .clip-button {
  position: static !important;
  flex: 0 0 auto;
  width: auto !important;
  min-width: 76px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border-radius: 6px !important;
  font-size: clamp(10px, 0.85vw, 12px) !important;
  pointer-events: auto !important;
  transform: none !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .pip-button {
  background: rgba(44, 93, 169, 0.9) !important;
  border-color: rgba(123, 177, 255, 0.58) !important;
  box-shadow: 0 4px 12px rgba(18, 61, 130, 0.24) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .clip-button {
  margin-left: auto !important;
  background: rgba(91, 51, 159, 0.9) !important;
  border-color: rgba(184, 143, 255, 0.6) !important;
  box-shadow: 0 4px 12px rgba(73, 28, 153, 0.24) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .pip-button:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .pip-button:focus-visible {
  background: #347ee7 !important;
  border-color: #b6d6ff !important;
  box-shadow: 0 8px 18px rgba(27, 101, 218, 0.42) !important;
  transform: translateY(-2px) scale(1.02) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .clip-button:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .clip-button:focus-visible {
  background: #7d3ed9 !important;
  border-color: #ddc5ff !important;
  box-shadow: 0 8px 18px rgba(113, 49, 207, 0.44) !important;
  transform: translateY(-2px) scale(1.02) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .pip-button:active,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .clip-button:active,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .remove-button:active {
  transform: translateY(0) scale(0.97) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name:focus-visible,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .remove-button:focus-visible,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .pip-button:focus-visible,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .clip-button:focus-visible {
  outline: 2px solid #b9d7ff !important;
  outline-offset: 3px;
}

body.popup-mode #streamsGrid.overview-fit > .stream.twitch-stream-card.active {
  border-color: rgba(103, 211, 130, 0.82) !important;
  box-shadow: 0 0 0 1px rgba(103, 211, 130, 0.42), 0 8px 24px rgba(24, 104, 49, 0.24) !important;
}

@media (hover: none), (pointer: coarse) {
  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--bottom {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }
}

@media (max-width: 620px) {
  body.popup-mode #streamsGrid.overview-fit,
  body.popup-mode #streamsGrid.overview-fit.overview-compact {
    gap: 4px !important;
    padding: 4px !important;
  }

  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--top {
    height: 44px !important;
    min-height: 44px !important;
    padding: 5px 7px !important;
  }

  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--bottom {
    height: 48px !important;
    min-height: 48px !important;
    padding: 7px 7px 8px !important;
  }

  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .stream-name {
    max-width: calc(100% - 46px) !important;
    height: 30px !important;
    min-height: 30px !important;
    padding-inline: 8px !important;
    font-size: 11px !important;
  }

  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .remove-button {
    top: 5px !important;
    right: 7px !important;
    width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
  }

  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--bottom
    .pip-button,
  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--bottom
    .clip-button {
    min-width: 64px !important;
    height: 30px !important;
    min-height: 30px !important;
    padding-inline: 9px !important;
    font-size: 10px !important;
  }
}

/* Final compact rail pass. This lives after the palette cascade so the
   responsive density rules remain authoritative even when the legacy skin is
   loaded before this file. */
@media (max-width: 760px), (max-height: 1500px) {
  body.menu-open {
    grid-template-columns: min(400px, calc(100vw - 24px)) 1fr;
  }

  .navbar.expanded,
  .navbar.expanded:hover {
    width: min(400px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    height: 100vh;
    zoom: 1;
  }

  .navbar .navbar-header {
    grid-template-columns: 40px minmax(0, 1fr) 36px;
    min-height: 64px;
    padding: 9px 18px;
    gap: 8px;
  }

  .navbar .control-center-mark,
  .navbar:hover .control-center-mark {
    width: 40px;
    height: 40px;
    border-width: 1px;
  }

  .navbar .control-center-mark i {
    font-size: 18px;
  }

  .navbar .control-center-title {
    font-size: 20px;
    letter-spacing: -0.35px;
  }

  .navbar #menuToggleButton {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .navbar #menuToggleButton i {
    font-size: 18px;
  }

  .navbar .nav-buttons {
    gap: 3px;
    padding: 0 18px 4px;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .navbar .nav-buttons::-webkit-scrollbar {
    display: none;
  }

  .navbar .control-section {
    gap: 3px;
    padding: 6px 10px 5px;
    border-radius: 12px;
  }

  .navbar .control-section--shortcuts,
  .navbar .control-section--system {
    gap: 3px;
  }

  .navbar .control-section-heading {
    min-height: 11px;
    gap: 6px;
    font-size: 10px;
    letter-spacing: 0.5px;
  }

  .navbar .nav-button,
  .navbar a.nav-button {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 13px;
    gap: 7px;
    line-height: 1;
  }

  .navbar .nav-button > i:first-child {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: 14px;
  }

  .navbar .nav-button > i:first-child:not(.fa-link):not(.fa-plus):not(.fa-user):not(.fa-users) {
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
  }

  .navbar .control-row-button::after {
    font-size: 18px;
  }

  .navbar .party-panel-nav-button > i:first-child {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
  }

  .navbar .demo-mode-nav-button {
    min-height: 32px;
  }

  .navbar .demo-mode-nav-button > i:first-child {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .navbar .status-chip {
    min-width: 50px;
    padding: 5px 7px;
    font-size: 10px;
  }

  .navbar #volumeSliderContainer {
    min-height: 36px;
    padding: 3px 7px 3px 5px;
    gap: 7px;
    border-radius: 8px;
  }

  .navbar .volume-icon {
    flex-basis: 27px;
    width: 27px;
    height: 27px;
    font-size: 13px;
  }

  .navbar #volumeSliderContainer label {
    font-size: 13px;
  }

  .navbar #volumeSlider,
  .navbar #volumeSlider::-webkit-slider-runnable-track {
    height: 4px;
  }

  .navbar #volumeSlider::-webkit-slider-thumb {
    width: 13px;
    height: 13px;
    margin-top: -4px;
  }

  .navbar #muteIconNav {
    flex-basis: 22px;
    width: 22px;
    height: 22px;
  }

  .navbar #addStreamForm {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 4px;
  }

  .navbar .control-input-shell {
    min-height: 30px;
    border-radius: 8px;
  }

  .navbar .control-input-shell > i {
    flex-basis: 28px;
    font-size: 14px;
  }

  .navbar #newChannel {
    height: 28px;
    padding-right: 6px;
    font-size: 12px;
  }

  .navbar #addStreamForm .control-accent-button,
  .navbar .control-accent-button {
    min-height: 30px;
    min-width: 106px;
    padding: 0 9px;
    font-size: 12px;
  }

  .navbar #addStreamForm .control-accent-button > i:first-child {
    flex-basis: 17px;
    width: 17px;
    height: 17px;
    font-size: 15px;
  }

  .navbar .control-section-divider {
    margin: 0;
  }

  .navbar .control-action-row,
  .navbar #backUpStreamButton,
  .navbar #refreshPageButton,
  .navbar #removeOfflineStreamsButton,
  .navbar #windowControlsButton {
    min-height: 30px;
    padding-right: 7px;
    font-size: 12px;
  }

  .navbar .control-action-row > i:first-child,
  .navbar #backUpStreamButton > i:first-child,
  .navbar #refreshPageButton > i:first-child,
  .navbar #removeOfflineStreamsButton > i:first-child,
  .navbar #windowControlsButton > i:first-child {
    flex-basis: 30px;
    width: 30px;
    margin-right: 7px;
    font-size: 14px;
  }

  .navbar .control-section--team .mode-buttons {
    border-radius: 8px;
  }

  .navbar .control-section--team #singleModeButton,
  .navbar .control-section--team #dualModeButton {
    min-height: 30px;
    padding: 0 8px;
    font-size: 12px;
    gap: 5px;
  }

  .navbar .control-section--team #singleModeButton > i:first-child,
  .navbar .control-section--team #dualModeButton > i:first-child {
    font-size: 14px;
  }

  .navbar #windowControlsButton .status-chip {
    min-width: 44px;
    padding: 5px 7px;
    font-size: 10px;
  }
}

.navbar.menu-collapsed .navbar-header,
.navbar.menu-collapsed:hover .navbar-header {
  min-height: 80px;
  padding: 32px 5px 12px;
  display: flex;
  justify-content: center;
}

.navbar.menu-collapsed .control-center-title,
.navbar.menu-collapsed:hover .control-center-title {
  display: none;
}

.navbar.menu-collapsed .control-center-mark,
.navbar.menu-collapsed:hover .control-center-mark {
  width: 32px;
  height: 32px;
}

.navbar.menu-collapsed #menuToggleButton,
.navbar.menu-collapsed:hover #menuToggleButton {
  top: 5px;
  right: 5px;
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  clip-path: none;
}

.navbar.menu-collapsed #menuToggleButton i,
.navbar.menu-collapsed:hover #menuToggleButton i {
  font-size: 12px;
}

/* The in-app browser presents a shorter, narrower canvas than the reference
   capture. Use a true compact layout rather than scaling the whole rail: the
   labels stay readable while the complete navigation remains in one viewport. */
@media (max-width: 760px), (max-height: 1500px) {
  body.menu-open {
    grid-template-columns: min(400px, calc(100vw - 24px)) 1fr;
  }

  .navbar.expanded,
  .navbar.expanded:hover {
    width: min(400px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    height: 100vh;
    zoom: 1;
  }

  .navbar-header {
    grid-template-columns: 40px minmax(0, 1fr) 36px;
    min-height: 64px;
    padding: 9px 18px;
    gap: 8px;
  }

  .control-center-mark,
  .navbar:hover .control-center-mark {
    width: 40px;
    height: 40px;
    border-width: 1px;
  }

  .control-center-mark i {
    font-size: 18px;
  }

  .control-center-title {
    font-size: 20px;
    letter-spacing: -0.35px;
  }

  #menuToggleButton {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  #menuToggleButton i {
    font-size: 18px;
  }

  /* Keep the rail scrollbar-free at the compact breakpoint. The dimensions
     below are intentionally explicit so the fit is stable across reloads. */
  .nav-buttons {
    gap: 3px;
    padding: 0 18px 4px;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .nav-buttons::-webkit-scrollbar {
    display: none;
  }

  .control-section {
    gap: 3px;
    padding: 6px 10px 5px;
    border-radius: 12px;
  }

  .control-section--shortcuts {
    gap: 3px;
  }

  .control-section--system {
    gap: 3px;
  }

  .control-section-heading {
    min-height: 11px;
    gap: 6px;
    font-size: 10px;
    letter-spacing: 0.5px;
  }

  .control-section-rule {
    opacity: 0.85;
  }

  .nav-button,
  a.nav-button {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 13px;
    gap: 7px;
    line-height: 1;
  }

  .nav-button > i:first-child {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: 14px;
  }

  .nav-button > i:first-child:not(.fa-link):not(.fa-plus):not(.fa-user):not(.fa-users) {
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
  }

  .control-row-button::after {
    font-size: 18px;
  }

  .party-panel-nav-button > i:first-child {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
  }

  .demo-mode-nav-button {
    min-height: 32px;
  }

  .demo-mode-nav-button > i:first-child {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .status-chip {
    min-width: 50px;
    padding: 5px 7px;
    font-size: 10px;
  }

  #volumeSliderContainer {
    min-height: 36px;
    padding: 3px 7px 3px 5px;
    gap: 7px;
    border-radius: 8px;
  }

  .volume-icon {
    flex-basis: 27px;
    width: 27px;
    height: 27px;
    font-size: 13px;
  }

  #volumeSliderContainer label {
    font-size: 13px;
  }

  #volumeSlider,
  #volumeSlider::-webkit-slider-runnable-track {
    height: 4px;
  }

  #volumeSlider::-webkit-slider-thumb {
    width: 13px;
    height: 13px;
    margin-top: -4px;
  }

  #muteIconNav {
    flex-basis: 22px;
    width: 22px;
    height: 22px;
  }

  #addStreamForm {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 4px;
  }

  .control-input-shell {
    min-height: 30px;
    border-radius: 8px;
  }

  .control-input-shell > i {
    flex-basis: 28px;
    font-size: 14px;
  }

  #newChannel {
    height: 28px;
    padding-right: 6px;
    font-size: 12px;
  }

  #addStreamForm .control-accent-button,
  .control-accent-button {
    min-height: 30px;
    min-width: 106px;
    padding: 0 9px;
    font-size: 12px;
  }

  #addStreamForm .control-accent-button > i:first-child {
    flex-basis: 17px;
    width: 17px;
    height: 17px;
    font-size: 15px;
  }

  .control-section-divider {
    margin: 0;
  }

  .control-action-row,
  #backUpStreamButton,
  #refreshPageButton,
  #removeOfflineStreamsButton,
  #windowControlsButton {
    min-height: 30px;
    padding-right: 7px;
    font-size: 12px;
  }

  .control-action-row > i:first-child,
  #backUpStreamButton > i:first-child,
  #refreshPageButton > i:first-child,
  #removeOfflineStreamsButton > i:first-child,
  #windowControlsButton > i:first-child {
    flex-basis: 30px;
    width: 30px;
    margin-right: 7px;
    font-size: 14px;
  }

  .control-section--team .mode-buttons {
    border-radius: 8px;
  }

  .control-section--team #singleModeButton,
  .control-section--team #dualModeButton {
    min-height: 30px;
    padding: 0 8px;
    font-size: 12px;
    gap: 5px;
  }

  .control-section--team #singleModeButton > i:first-child,
  .control-section--team #dualModeButton > i:first-child {
    font-size: 14px;
  }

  #windowControlsButton .status-chip {
    min-width: 44px;
    padding: 5px 7px;
    font-size: 10px;
  }
}

/* ========================================================================== */
   Stream tile controls
   The stream runtime owns the tile markup and live state. These rules only
   skin the existing title, PIP, CLIP, and close controls in popup mode.
========================================================================== */
:root {
  --stream-control-surface: rgba(13, 17, 24, 0.96);
  --stream-control-border: rgba(125, 143, 164, 0.34);
  --stream-control-blue: #2f79e9;
  --stream-control-blue-bright: #66a5ff;
  --stream-control-purple: #7436dd;
  --stream-control-purple-bright: #a978ff;
  --stream-control-close: #ed2d2d;
  --stream-control-close-bright: #ff4b4b;
  --stream-control-live: #22e65b;
}

/* Operator-only OCR readout. It sits over the matching Control Center stream
   and is intentionally absent from the OBS-facing Live Window. */
body.popup-mode #streamsGrid .stream-ocr-kills-badge {
  appearance: none;
  position: absolute;
  top: 50%;
  left: clamp(8px, 0.9vw, 14px);
  z-index: 24;
  display: inline-flex;
  align-items: center;
  min-height: clamp(28px, 3vw, 38px);
  padding: clamp(6px, 0.65vw, 9px) clamp(9px, 0.9vw, 13px);
  gap: clamp(5px, 0.55vw, 8px);
  color: #f7fbff;
  border: 1px solid rgba(114, 167, 245, 0.74);
  border-radius: 8px;
  background: rgba(8, 14, 24, 0.9);
  box-shadow:
    0 7px 20px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(93, 151, 239, 0.12),
    inset 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(9px);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: clamp(9px, 0.78vw, 12px);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
  transition:
    color 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

body.popup-mode #streamsGrid .stream-ocr-kills-badge[hidden] {
  display: none !important;
}

body.popup-mode #streamsGrid .stream-ocr-kills-badge > i {
  color: #82b4ff;
  font-size: 1.05em;
}

body.popup-mode #streamsGrid .stream-ocr-kills-badge > strong {
  color: #ffffff;
  font-size: 1.25em;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

body.popup-mode #streamsGrid .stream-ocr-kills-badge > span {
  color: rgba(215, 230, 250, 0.82);
}

body.popup-mode #streamsGrid .stream-ocr-kills-badge:hover {
  border-color: rgba(151, 194, 255, 0.96);
  background: rgba(14, 26, 44, 0.96);
  box-shadow:
    0 9px 24px rgba(0, 0, 0, 0.46),
    0 0 0 2px rgba(93, 151, 239, 0.18),
    inset 0 1px rgba(255, 255, 255, 0.1);
}

body.popup-mode #streamsGrid .stream-ocr-kills-badge:focus-visible {
  outline: 2px solid #9bc4ff;
  outline-offset: 3px;
}

.ocr-evidence-dialog {
  position: fixed;
  inset: 0;
  width: min(620px, calc(100vw - 28px));
  max-width: none;
  max-height: min(760px, calc(100dvh - 28px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: #f4f8ff;
  border: 1px solid rgba(126, 169, 234, 0.46);
  border-radius: 16px;
  background: #111722;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(100, 157, 242, 0.12);
}

.ocr-evidence-dialog:not([open]) {
  display: none;
}

.ocr-evidence-dialog::backdrop {
  background: rgba(3, 7, 13, 0.76);
  backdrop-filter: blur(5px);
}

.ocr-evidence-dialog__shell {
  display: grid;
  gap: 0;
}

.ocr-evidence-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 18px 16px 20px;
  border-bottom: 1px solid rgba(151, 180, 224, 0.16);
  background:
    radial-gradient(circle at 8% 0%, rgba(75, 133, 222, 0.18), transparent 44%),
    rgba(20, 27, 40, 0.96);
}

.ocr-evidence-dialog__heading {
  min-width: 0;
}

.ocr-evidence-dialog__kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #8cb9ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.ocr-evidence-dialog__heading h2 {
  margin: 8px 0 0;
  overflow: hidden;
  color: #f6f9ff;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: clamp(20px, 3vw, 27px);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ocr-evidence-dialog__close {
  appearance: none;
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: #dbe7f8;
  border: 1px solid rgba(157, 181, 217, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.ocr-evidence-dialog__close:hover,
.ocr-evidence-dialog__close:focus-visible {
  color: #ffffff;
  border-color: rgba(156, 197, 255, 0.64);
  background: rgba(91, 145, 226, 0.16);
}

.ocr-evidence-dialog__close:focus-visible {
  outline: 2px solid #91bbfb;
  outline-offset: 2px;
}

.ocr-evidence-dialog__figure {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 20px;
}

.ocr-evidence-dialog__figure[hidden],
.ocr-evidence-dialog__empty[hidden] {
  display: none !important;
}

.ocr-evidence-dialog__image-frame {
  display: grid;
  min-height: clamp(210px, 42vh, 390px);
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(122, 160, 216, 0.29);
  border-radius: 12px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 25%, transparent 25%) 0 0 / 18px 18px,
    #070b12;
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.46);
}

.ocr-evidence-dialog__image-frame img {
  display: block;
  width: 100%;
  max-height: min(54vh, 450px);
  object-fit: contain;
}

.ocr-evidence-dialog__figure figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 2px 0;
  color: #aebbd0;
  font-size: 12px;
  line-height: 1.45;
}

.ocr-evidence-dialog__meta {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  color: #d7e4f8;
  font-variant-numeric: tabular-nums;
}

.ocr-evidence-dialog__meta > :not(:first-child)::before {
  content: "·";
  margin-right: 8px;
  color: #71819b;
}

.ocr-evidence-dialog__empty {
  display: grid;
  min-height: 290px;
  padding: 48px 24px;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #aebbd0;
  text-align: center;
}

.ocr-evidence-dialog__empty > i {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 4px;
  place-items: center;
  color: #8eb8f8;
  border: 1px solid rgba(123, 169, 239, 0.34);
  border-radius: 15px;
  background: rgba(83, 137, 219, 0.11);
  font-size: 21px;
}

.ocr-evidence-dialog__empty strong {
  color: #eef4ff;
  font-size: 16px;
}

.ocr-evidence-dialog__empty span {
  max-width: 390px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .ocr-evidence-dialog__header {
    padding: 15px;
  }

  .ocr-evidence-dialog__figure {
    padding: 14px;
  }

  .ocr-evidence-dialog__image-frame {
    min-height: 190px;
  }

  .ocr-evidence-dialog__figure figcaption {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

/* Offline cards keep their existing status node, but present it as a clear
   red state badge instead of the legacy dark pill. Scope it to settled offline
   cards so pending playback surfaces can still hide their transient controls. */
body.popup-mode .stream.offline .offline-message {
  display: block !important;
  min-width: 62px;
  padding: 6px 10px;
  color: #fff;
  background: var(--stream-control-close) !important;
  border: 1px solid var(--stream-control-close-border);
  border-radius: 6px;
  box-shadow:
    0 3px 9px rgba(72, 18, 22, 0.34),
    inset 0 1px rgba(255, 255, 255, 0.13);
  font-size: clamp(10px, 0.85vw, 12px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
  text-transform: none;
}

body.popup-mode .stream .stream-name,
body.popup-mode .stream .pip-button,
body.popup-mode .stream .clip-button,
body.popup-mode .stream .remove-button {
  font-family: "Inter", "Segoe UI", sans-serif;
  box-sizing: border-box;
  z-index: 22;
}

body.popup-mode .stream .stream-name {
  display: inline-flex !important;
  align-items: center;
  gap: 0;
  min-width: 0;
  max-width: min(72%, 260px);
  height: 40px;
  padding: 0 14px;
  overflow: hidden;
  color: #f6f8fb;
  background: var(--stream-control-surface);
  border: 1px solid var(--stream-control-border);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.26), inset 0 1px rgba(255, 255, 255, 0.06);
  font-size: clamp(12px, 1.1vw, 15px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  cursor: pointer;
  transition:
    max-width 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.24s ease,
    border-color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: max-width, transform;
}

body.popup-mode .stream .stream-name:hover {
  max-width: min(84%, 320px);
  padding: 0 15px;
  background: rgba(25, 31, 42, 0.98);
  border-color: rgba(174, 190, 211, 0.62);
  box-shadow:
    0 11px 26px rgba(0, 0, 0, 0.38),
    0 0 0 2px rgba(120, 171, 239, 0.14),
    inset 0 1px rgba(255, 255, 255, 0.08);
  transform: translateY(-2px) scale(1.01) !important;
}

body.popup-mode .stream .stream-name:active {
  transition-duration: 0.08s;
  transform: translateY(0) scale(0.985) !important;
}

body.popup-mode .stream .stream-name:focus-visible,
body.popup-mode .stream .pip-button:focus-visible,
body.popup-mode .stream .clip-button:focus-visible,
body.popup-mode .stream .remove-button:focus-visible {
  outline: 2px solid #b9d7ff;
  outline-offset: 3px;
}

body.popup-mode .stream .stream-name::before,
body.popup-mode .stream .stream-name.active::before {
  display: none !important;
  content: none !important;
}

/* The legacy stream-number control used a pseudo-element status dot. Keep the
   order/control node for keyboard and runtime behavior, but remove that old
   visual so only an authoritative live state can add an indicator. */
body.popup-mode .stream .stream-number,
body.popup-mode .stream .stream-number::before {
  display: none !important;
  content: none !important;
}

.stream-name-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Read-only feedback for the selected stream's stabilization trim. It stays
   compact enough to sit beside the title without looking like another action. */
.volume-stabilization-trim-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  margin-left: 6px;
  padding: 3px 5px;
  color: rgba(211, 225, 244, 0.78);
  border: 1px solid rgba(164, 187, 220, 0.32);
  border-radius: 4px;
  background: rgba(94, 119, 151, 0.16);
  font-size: 0.68em;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}

.volume-stabilization-trim-badge[data-state="positive"] {
  color: rgba(190, 239, 204, 0.86);
  border-color: rgba(123, 209, 147, 0.38);
  background: rgba(47, 143, 75, 0.14);
}

.volume-stabilization-trim-badge[data-state="negative"] {
  color: rgba(255, 204, 204, 0.86);
  border-color: rgba(230, 123, 123, 0.38);
  background: rgba(143, 47, 47, 0.14);
}

.volume-stabilization-trim-badge[data-state="unavailable"] {
  color: rgba(202, 211, 224, 0.56);
  border-color: rgba(164, 177, 198, 0.24);
  background: rgba(94, 105, 122, 0.12);
  font-size: 0.62em;
  text-transform: uppercase;
}

.stream-index-label {
  flex: 0 0 auto;
  color: rgba(190, 205, 224, 0.64);
  font-size: 0.78em;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.stream-channel-avatar {
  display: inline-grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  overflow: hidden;
  color: #f4f7fb;
  border: 1px solid rgba(214, 227, 246, 0.34);
  border-radius: 50%;
  background: rgba(79, 101, 132, 0.82);
  font-size: 0.58em;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.stream-channel-avatar.has-image {
  border-color: rgba(214, 227, 246, 0.24);
  background: transparent;
}

.stream-channel-avatar-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stream-live-indicator {
  display: none;
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--stream-control-live);
  box-shadow: 0 0 0 2px rgba(34, 230, 91, 0.2), 0 0 10px rgba(34, 230, 91, 0.92);
}

.stream.is-live .stream-live-indicator {
  display: inline-block;
}

/* The compact stream rail uses the card outline for live state. Keep the
   title visually clean by omitting the decorative status dot beside it. */
body.popup-mode .stream .stream-live-indicator {
  display: none !important;
}

body.popup-mode .stream.active .stream-name,
body.popup-mode .stream.active .stream-name:hover {
  color: #f6f8fb;
  background: var(--stream-control-surface);
  border-color: var(--stream-control-border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.26), inset 0 1px rgba(255, 255, 255, 0.06);
  text-transform: none;
  letter-spacing: -0.01em;
}

/* The green frame is a Live Window selection affordance. The compact rail does
   not add a separate live-status dot beside the stream title. */
body.popup-mode .stream.active,
body.popup-mode .stream.active:hover {
  box-sizing: border-box;
  border: 2px solid var(--stream-control-live) !important;
  outline: 2px solid var(--stream-control-live);
  outline-offset: -2px;
  box-shadow:
    0 0 0 1px rgba(34, 230, 91, 0.75),
    0 0 18px rgba(34, 230, 91, 0.7),
    0 0 42px rgba(34, 230, 91, 0.24) !important;
}

body.popup-mode .stream.active .stream-name {
  border-color: rgba(34, 230, 91, 0.72);
}

body.popup-mode .stream.active .stream-name:focus-visible {
  outline-color: #b9d7ff;
}

body.popup-mode .stream .pip-button,
body.popup-mode .stream .clip-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 88px;
  min-height: 36px;
  padding: 0 15px;
  overflow: hidden;
  color: #f8fbff;
  border: 1px solid transparent;
  border-radius: 8px !important;
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  opacity: 1 !important;
  pointer-events: auto !important;
  text-transform: uppercase;
  white-space: nowrap;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

body.popup-mode .stream .pip-button {
  background: linear-gradient(180deg, #255fb9 0%, #1d4789 100%);
  border-color: rgba(89, 157, 255, 0.72);
  box-shadow: 0 4px 12px rgba(18, 61, 130, 0.34), inset 0 1px rgba(255, 255, 255, 0.15);
}

body.popup-mode .stream .clip-button {
  background: linear-gradient(180deg, #6f2ed1 0%, #4e2099 100%);
  border-color: rgba(172, 111, 255, 0.76);
  box-shadow: 0 4px 12px rgba(73, 28, 153, 0.36), inset 0 1px rgba(255, 255, 255, 0.15);
}

body.popup-mode .stream .pip-button:hover {
  background: linear-gradient(180deg, #347ee7 0%, #245ab1 100%);
  border-color: #a5ccff;
  box-shadow:
    0 10px 22px rgba(27, 101, 218, 0.5),
    0 0 0 2px rgba(102, 165, 255, 0.16),
    inset 0 1px rgba(255, 255, 255, 0.2);
  transform: translateY(-2px) scale(1.025) !important;
}

body.popup-mode .stream .pip-button:active,
body.popup-mode .stream .clip-button:active {
  transition-duration: 0.08s;
  transform: translateY(0) scale(0.97) !important;
}

body.popup-mode .stream .clip-button:hover {
  background: linear-gradient(180deg, #8b4bed 0%, #622bb9 100%);
  border-color: #d3b7ff;
  box-shadow:
    0 10px 22px rgba(113, 49, 207, 0.54),
    0 0 0 2px rgba(169, 120, 255, 0.18),
    inset 0 1px rgba(255, 255, 255, 0.2);
  transform: translateY(-2px) scale(1.025) !important;
}

body.popup-mode .stream .pip-button .fas,
body.popup-mode .stream .clip-button .fas {
  flex: 0 0 auto;
  font-size: 14px;
}

.stream-control-label {
  min-width: 0;
}

body.popup-mode .stream .remove-button {
  display: inline-grid !important;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: #fff;
  background: var(--stream-control-close);
  border: 1px solid rgba(255, 140, 140, 0.72);
  border-radius: 7px;
  box-shadow: 0 4px 12px rgba(150, 20, 20, 0.36), inset 0 1px rgba(255, 255, 255, 0.2);
  font-size: 15px;
  line-height: 1;
  opacity: 1 !important;
  pointer-events: auto !important;
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

body.popup-mode .stream .remove-button:hover {
  background: var(--stream-control-close-bright);
  border-color: #ffd2d2;
  box-shadow:
    0 10px 22px rgba(191, 24, 24, 0.56),
    0 0 0 2px rgba(255, 75, 75, 0.18),
    inset 0 1px rgba(255, 255, 255, 0.25);
  transform: translateY(-2px) scale(1.06) !important;
}

body.popup-mode .stream .remove-button:active {
  transition-duration: 0.08s;
  transform: translateY(0) scale(0.94) !important;
}

body.popup-mode .stream .remove-button .fas {
  pointer-events: none;
}

/* The Twitch path places the same controls in dedicated rails. Keep those
   rails stable so adding the live outline never changes player geometry. */
body.popup-mode .stream.twitch-stream-card > .twitch-card-rail {
  background: #080b11;
}

body.popup-mode .stream.twitch-stream-card > .twitch-card-rail--top {
  gap: 10px;
  padding: 2px 10px;
}

body.popup-mode .stream.twitch-stream-card > .twitch-card-rail--bottom {
  gap: 8px;
  padding: 0 10px;
}

body.popup-mode .twitch-card-rail .stream-name {
  flex: 0 1 auto;
  width: auto;
  max-width: min(72%, 260px);
  height: 36px !important;
  max-height: none !important;
  padding: 0 13px;
  border-radius: 8px !important;
}

body.popup-mode .twitch-card-rail .remove-button {
  flex: 0 0 36px;
  width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: none !important;
  margin-left: auto;
}

body.popup-mode .twitch-card-rail .pip-button,
body.popup-mode .twitch-card-rail .clip-button {
  position: static !important;
  flex: 0 0 auto;
  height: 36px !important;
  min-height: 36px !important;
  max-height: none !important;
  padding-inline: 13px;
}

body.popup-mode .twitch-card-rail .clip-button {
  margin-left: auto;
}

/* The compact overview rules intentionally shrink the old text-only controls.
   Keep the new icon+label controls at the reference size while retaining the
   existing grid columns, rows, and player surface. */
body.popup-mode #streamsGrid.overview-fit.overview-compact
  > .stream.twitch-stream-card {
  grid-template-rows: 40px minmax(0, 1fr) 40px !important;
}

body.popup-mode #streamsGrid.overview-fit.overview-compact
  > .stream.twitch-stream-card
  > .twitch-card-rail--top,
body.popup-mode #streamsGrid.overview-fit.overview-compact
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom {
  height: 40px !important;
  min-height: 40px !important;
}

body.popup-mode #streamsGrid.overview-fit.overview-compact
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name {
  height: 36px !important;
  max-height: none !important;
  font-size: clamp(12px, 1.1vw, 15px) !important;
}

body.popup-mode #streamsGrid.overview-fit.overview-compact
  > .stream.twitch-stream-card
  > .twitch-card-rail
  .pip-button,
body.popup-mode #streamsGrid.overview-fit.overview-compact
  > .stream.twitch-stream-card
  > .twitch-card-rail
  .clip-button,
body.popup-mode #streamsGrid.overview-fit.overview-compact
  > .stream.twitch-stream-card
  > .twitch-card-rail
  .remove-button {
  min-height: 36px !important;
  max-height: none !important;
  font-size: clamp(11px, 1vw, 13px) !important;
  padding-block: 0 !important;
}

body.popup-mode #streamsGrid.overview-fit.overview-compact
  > .stream.twitch-stream-card
  > .twitch-card-rail
  .remove-button {
  width: 36px !important;
  height: 36px !important;
}

body.popup-mode .stream.stream-autoplay-pending .stream-name,
body.popup-mode .stream.stream-autoplay-pending .pip-button,
body.popup-mode .stream.stream-autoplay-pending .clip-button,
body.popup-mode .stream.stream-autoplay-pending .remove-button {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

body.popup-mode .stream.stream-autoplay-pending > .twitch-card-rail {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Give the global loading state enough presence to explain the staggered
   batches without turning it into a full-width browser-default bar. The tiles
   themselves remain visible and show their own loading surfaces underneath. */
body.popup-mode .stream-load-window {
  position: fixed !important;
  top: 48px;
  left: calc(50% + (var(--navbar-collapsed-width) / 2));
  z-index: 900;
  display: flex !important;
  align-items: center;
  gap: 14px;
  width: min(460px, calc(100vw - var(--navbar-collapsed-width) - 28px));
  min-height: 104px;
  padding: 15px 18px 14px;
  color: #eaf1ff;
  background: linear-gradient(
    180deg,
    rgba(14, 23, 36, 0.98),
    rgba(7, 13, 22, 0.97)
  );
  border: 1px solid rgba(106, 157, 232, 0.52);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.035) inset,
    0 0 30px rgba(64, 132, 231, 0.14);
  box-sizing: border-box;
  pointer-events: none;
  transform: translateX(-50%);
}

body.popup-mode .stream-load-window[hidden] {
  display: none !important;
}

body.popup-mode .stream-load-window__spinner {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(125, 173, 255, 0.24);
  border-top-color: #73aaff;
  border-radius: 50%;
  animation: stream-loading-spin 0.85s linear infinite;
}

body.popup-mode .stream-load-window[data-state="complete"]
  .stream-load-window__spinner {
  border-color: #22e65b;
  animation: none;
}

body.popup-mode .stream-load-window[data-state="complete"] {
  border-color: rgba(34, 230, 91, 0.48);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42),
    0 0 26px rgba(34, 230, 91, 0.12);
}

body.popup-mode .stream-load-window__content {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 5px;
  line-height: 1.25;
}

body.popup-mode #streamLoadTitle {
  color: #f7fbff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

body.popup-mode #streamLoadSummary {
  overflow: hidden;
  color: rgba(218, 229, 245, 0.78);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.popup-mode #streamLoadProgress {
  display: block !important;
  width: 100%;
  height: 8px;
  margin: 3px 0 0;
  overflow: hidden;
  appearance: none;
  border: 1px solid rgba(130, 165, 208, 0.28);
  border-radius: 999px;
  background: rgba(4, 9, 16, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  accent-color: #63a9ff;
}

body.popup-mode #streamLoadProgress::-webkit-progress-bar {
  border-radius: inherit;
  background: rgba(4, 9, 16, 0.92);
}

body.popup-mode #streamLoadProgress::-webkit-progress-value {
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #75b5ff);
  transition: width 260ms ease;
}

body.popup-mode #streamLoadProgress::-moz-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #75b5ff);
}

body.popup-mode #streamLoadDetail {
  display: block !important;
  overflow: hidden;
  color: rgba(188, 207, 232, 0.66);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The compact overlay replaces the old centered pseudo-loader and its
   reserved top padding, so loading batches do not make the grid jump. */
body.popup-mode #streamsGrid[data-streams-loading="true"]::before {
  display: none !important;
  content: none !important;
}

body.popup-mode.streams-loading #streamsGrid {
  padding-top: 0 !important;
}

@media (max-width: 620px) {
  body.popup-mode .stream-load-window {
    top: 42px;
    width: min(430px, calc(100vw - var(--navbar-collapsed-width) - 20px));
    min-height: 96px;
    padding: 13px 14px 12px;
    gap: 11px;
  }

  body.popup-mode .stream-load-window__spinner {
    width: 26px;
    height: 26px;
  }

  body.popup-mode #streamLoadTitle {
    font-size: 13px;
  }

  body.popup-mode #streamLoadSummary {
    font-size: 11px;
  }

  body.popup-mode .stream .stream-name {
    max-width: 62%;
    height: 34px;
    padding-inline: 11px;
    font-size: 11px;
  }

  body.popup-mode .stream .pip-button,
  body.popup-mode .stream .clip-button {
    min-width: 62px;
    min-height: 32px;
    padding-inline: 10px;
    gap: 6px;
    font-size: 10px;
  }

  body.popup-mode .stream .remove-button {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
}

/* ========================================================================
   Monochrome stream surface pass
   Keep semantic red states, but remove the blue/purple cast from the chrome.
   ======================================================================== */
:root {
  --stream-control-surface: #171717;
  --stream-control-border: rgba(205, 205, 205, 0.32);
  --stream-control-blue: #858585;
  --stream-control-blue-bright: #eeeeee;
  --stream-control-purple: #686868;
  --stream-control-purple-bright: #eeeeee;
  --stream-control-live: #c6c6c6;
  --cc-blue: #a7a7a7;
  --cc-blue-deep: #6f6f6f;
  --cc-teal: #8d8d8d;
}

body.popup-mode #streamsGrid.overview-fit > .stream.twitch-stream-card {
  background: #070707 !important;
  border-color: rgba(160, 160, 160, 0.36) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.34) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card:hover {
  border-color: rgba(220, 220, 220, 0.58) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.52) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-player-host--direct {
  background: #050505 !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .stream-preview,
body.popup-mode #streamsGrid.overview-fit .stream-preview {
  background:
    radial-gradient(circle at 20% 20%, rgba(190, 190, 190, 0.1), transparent 42%),
    #151515 !important;
}

body.popup-mode #streamsGrid.overview-fit .stream-preview-shade {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.92)) !important;
}

body.popup-mode #streamsGrid.overview-fit .stream-preview-play:hover:not(:disabled),
body.popup-mode #streamsGrid.overview-fit .stream-preview-play:focus-visible {
  background: #6d6d6d !important;
  border-color: #ffffff !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.46), 0 0 0 6px rgba(255, 255, 255, 0.08) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.96), transparent) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.96), transparent) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name {
  color: #f5f5f5 !important;
  background: #1b1b1b !important;
  border-color: rgba(218, 218, 218, 0.46) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.42) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name:focus-visible {
  background: #2b2b2b !important;
  border-color: rgba(245, 245, 245, 0.78) !important;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.52) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-index-label {
  color: rgba(220, 220, 220, 0.68) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .pip-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .clip-button {
  color: #f5f5f5 !important;
  background: linear-gradient(180deg, #656565 0%, #353535 100%) !important;
  border-color: rgba(220, 220, 220, 0.62) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.38), inset 0 1px rgba(255, 255, 255, 0.16) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .pip-button:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .pip-button:focus-visible,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .clip-button:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .clip-button:focus-visible {
  color: #111111 !important;
  background: #d0d0d0 !important;
  border-color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(255, 255, 255, 0.12) !important;
}

body.popup-mode #streamsGrid.overview-fit > .stream.twitch-stream-card.active {
  border-color: rgba(220, 220, 220, 0.82) !important;
  box-shadow: 0 0 0 1px rgba(220, 220, 220, 0.4), 0 8px 24px rgba(0, 0, 0, 0.46) !important;
}

body.popup-mode .stream-load-window {
  color: #f5f5f5 !important;
  background: linear-gradient(180deg, rgba(31, 31, 31, 0.98), rgba(8, 8, 8, 0.98)) !important;
  border-color: rgba(220, 220, 220, 0.48) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.05) inset !important;
}

body.popup-mode .stream-load-window__spinner {
  border-color: rgba(220, 220, 220, 0.24) !important;
  border-top-color: #f2f2f2 !important;
}

body.popup-mode .stream-load-window[data-state="complete"]
  .stream-load-window__spinner {
  border-color: #cfcfcf !important;
}

body.popup-mode #streamLoadProgress {
  accent-color: #bdbdbd !important;
  border-color: rgba(190, 190, 190, 0.3) !important;
}

body.popup-mode #streamLoadProgress::-webkit-progress-bar {
  background: #0d0d0d !important;
}

body.popup-mode #streamLoadProgress::-webkit-progress-value,
body.popup-mode #streamLoadProgress::-moz-progress-bar {
  background: linear-gradient(90deg, #8c8c8c, #ededed) !important;
}

body.popup-mode #streamLoadDetail,
body.popup-mode #streamLoadSummary {
  color: rgba(220, 220, 220, 0.72) !important;
}

/* The stream loader borrows the dotted, monochrome orb language from the
   thinking-orbs fork, but stays dependency-free for this vanilla-JS app. */
body.popup-mode #streamsGrid.overview-fit .loading-spinner {
  gap: 8px !important;
  color: #e8e8e8 !important;
  background: #080808 !important;
}

body.popup-mode #streamsGrid.overview-fit .loading-spinner__orb {
  --orb-radius: clamp(15px, 1.7vw, 21px);
  position: relative;
  display: block;
  width: clamp(38px, 4.2vw, 52px);
  height: clamp(38px, 4.2vw, 52px);
  border: 1px solid rgba(238, 238, 238, 0.2);
  border-radius: 50%;
  box-shadow: none;
  animation: stream-loading-orb-breathe 3.2s ease-in-out infinite;
}

body.popup-mode #streamsGrid.overview-fit .loading-spinner__orb::before,
body.popup-mode #streamsGrid.overview-fit .loading-spinner__orb::after {
  position: absolute;
  inset: 5px;
  content: "";
  border: 1px solid rgba(232, 232, 232, 0.18);
  border-radius: 50%;
}

body.popup-mode #streamsGrid.overview-fit .loading-spinner__orb::before {
  border-style: dotted;
  opacity: 0.85;
  animation: stream-loading-orb-spin 5.4s linear infinite;
}

body.popup-mode #streamsGrid.overview-fit .loading-spinner__orb::after {
  inset: 10px;
  border-color: rgba(232, 232, 232, 0.12);
  border-style: dashed;
  animation: stream-loading-orb-spin 7.2s linear infinite reverse;
}

body.popup-mode #streamsGrid.overview-fit .loading-spinner__dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(3px, 0.34vw, 5px);
  height: clamp(3px, 0.34vw, 5px);
  border-radius: 50%;
  background: #f1f1f1;
  box-shadow: none;
  transform: rotate(calc(var(--orb-index) * 45deg)) translateY(calc(-1 * var(--orb-radius))) scale(0.72);
  transform-origin: center;
  animation: stream-loading-orb-dot 1.8s ease-in-out calc(var(--orb-index) * -0.18s) infinite;
}

body.popup-mode #streamsGrid.overview-fit .loading-spinner__core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(7px, 0.7vw, 10px);
  height: clamp(7px, 0.7vw, 10px);
  border-radius: 50%;
  background: #f7f7f7;
  box-shadow: none;
  transform: translate(-50%, -50%);
  animation: stream-loading-orb-core 1.8s ease-in-out infinite;
}

body.popup-mode #streamsGrid.overview-fit .loading-spinner__label {
  color: rgba(238, 238, 238, 0.78) !important;
  font-size: clamp(10px, 0.9vw, 13px);
  letter-spacing: 0.04em;
}

@keyframes stream-loading-orb-breathe {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.76;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@keyframes stream-loading-orb-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes stream-loading-orb-dot {
  0%,
  100% {
    opacity: 0.3;
    transform: rotate(calc(var(--orb-index) * 45deg)) translateY(calc(-1 * var(--orb-radius))) scale(0.72);
  }
  50% {
    opacity: 1;
    transform: rotate(calc(var(--orb-index) * 45deg)) translateY(calc(-1 * var(--orb-radius))) scale(1.16);
  }
}

@keyframes stream-loading-orb-core {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.82);
    opacity: 0.68;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.popup-mode #streamsGrid.overview-fit .loading-spinner__orb,
  body.popup-mode #streamsGrid.overview-fit .loading-spinner__orb::before,
  body.popup-mode #streamsGrid.overview-fit .loading-spinner__orb::after,
  body.popup-mode #streamsGrid.overview-fit .loading-spinner__dot,
  body.popup-mode #streamsGrid.overview-fit .loading-spinner__core,
  body.popup-mode .stream-load-window .loading-spinner__orb,
  body.popup-mode .stream-load-window .loading-spinner__orb::before,
  body.popup-mode .stream-load-window .loading-spinner__orb::after,
  body.popup-mode .stream-load-window .loading-spinner__dot,
  body.popup-mode .stream-load-window .loading-spinner__core {
    animation: none !important;
  }
}

/* The global loading window reuses the same orb, with state-specific pacing
   borrowed from the fork's connecting, working, and breathing variants. */
body.popup-mode .stream-load-window .loading-spinner__orb {
  --orb-radius: 16px;
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(238, 238, 238, 0.2) !important;
  border-radius: 50%;
  box-shadow: none;
  animation: stream-loading-orb-breathe 3.2s ease-in-out infinite;
}

body.popup-mode .stream-load-window .loading-spinner__orb::before,
body.popup-mode .stream-load-window .loading-spinner__orb::after {
  position: absolute;
  inset: 5px;
  content: "";
  border: 1px solid rgba(232, 232, 232, 0.18);
  border-radius: 50%;
}

body.popup-mode .stream-load-window .loading-spinner__orb::before {
  border-style: dotted;
  opacity: 0.85;
  animation: stream-loading-orb-spin 5.4s linear infinite;
}

body.popup-mode .stream-load-window .loading-spinner__orb::after {
  inset: 10px;
  border-color: rgba(232, 232, 232, 0.12);
  border-style: dashed;
  animation: stream-loading-orb-spin 7.2s linear infinite reverse;
}

body.popup-mode .stream-load-window .loading-spinner__dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f1f1f1;
  box-shadow: none;
  transform: rotate(calc(var(--orb-index) * 45deg)) translateY(calc(-1 * var(--orb-radius))) scale(0.72);
  transform-origin: center;
  animation: stream-loading-orb-dot 1.8s ease-in-out calc(var(--orb-index) * -0.18s) infinite;
}

body.popup-mode .stream-load-window .loading-spinner__core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f7f7f7;
  box-shadow: none;
  transform: translate(-50%, -50%);
  animation: stream-loading-orb-core 1.8s ease-in-out infinite;
}

body.popup-mode .stream-load-window[data-orb-state="working"] .loading-spinner__orb {
  animation-duration: 2.5s;
}

body.popup-mode .stream-load-window[data-orb-state="working"] .loading-spinner__orb::before {
  animation-duration: 4.2s;
}

body.popup-mode .stream-load-window[data-orb-state="working"] .loading-spinner__orb::after {
  animation-duration: 5.6s;
}

body.popup-mode .stream-load-window[data-orb-state="breathing"] .loading-spinner__orb {
  animation-duration: 4.8s;
}

body.popup-mode .stream-load-window[data-state="complete"] .loading-spinner__orb,
body.popup-mode .stream-load-window[data-state="complete"] .loading-spinner__orb::before,
body.popup-mode .stream-load-window[data-state="complete"] .loading-spinner__orb::after,
body.popup-mode .stream-load-window[data-state="complete"] .loading-spinner__dot,
body.popup-mode .stream-load-window[data-state="complete"] .loading-spinner__core {
  animation: none !important;
}

.navbar .control-center-mark,
.navbar:hover .control-center-mark,
.navbar.menu-collapsed .control-center-mark,
.navbar.menu-collapsed:hover .control-center-mark,
.navbar #menuToggleButton {
  color: #f5f5f5 !important;
  background: #1a1a1a !important;
  border-color: rgba(220, 220, 220, 0.62) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 6px 18px rgba(0, 0, 0, 0.4) !important;
}

.navbar .demo-mode-nav-button,
#demoModeTopButton,
#addStreamForm .control-accent-button,
.navbar .control-section--team #singleModeButton.active-mode-button,
.navbar .control-section--team #dualModeButton.active-mode-button {
  color: #f5f5f5 !important;
  background: linear-gradient(180deg, #646464 0%, #343434 100%) !important;
  border-color: rgba(220, 220, 220, 0.6) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), 0 5px 12px rgba(0, 0, 0, 0.36) !important;
}

.navbar .demo-mode-nav-button:hover,
#demoModeTopButton:hover,
#addStreamForm .control-accent-button:hover,
.navbar .control-section--team #singleModeButton.active-mode-button:hover,
.navbar .control-section--team #dualModeButton.active-mode-button:hover {
  background: linear-gradient(180deg, #858585 0%, #4a4a4a 100%) !important;
  border-color: #ffffff !important;
}

.navbar .control-action-row--backup > i:first-child,
.navbar .control-action-row--refresh > i:first-child,
.navbar .control-action-row--neutral > i:first-child {
  background: #777777 !important;
}

.navbar .control-action-row--remove > i:first-child {
  background: #a74747 !important;
}

.navbar #volumeSlider,
.navbar #volumeSlider::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #b8b8b8 0 var(--volume-fill), #4a4a4a var(--volume-fill) 100%) !important;
  accent-color: #b8b8b8 !important;
}

.navbar #volumeSlider::-moz-range-progress {
  background: #b8b8b8 !important;
}

/* ========================================================================
   Sidebar palette and control sizing refinement
   ======================================================================== */
:root {
  --cc-bg: #100f12;
  --cc-bg-deep: #0a090b;
  --cc-surface: #211c1b;
  --cc-surface-raised: #2b2422;
  --cc-surface-button: #302726;
  --cc-border: #543025;
  --cc-border-soft: rgba(157, 143, 138, 0.34);
  --cc-border-strong: #9d8f8a;
  --cc-text: #f5f2ef;
  --cc-muted: #c3b7b2;
  --cc-blue: #0404cd;
  --cc-blue-deep: #03039f;
  --cc-accent: #9d8f8a;
  --cc-accent-deep: #6f5f59;
  --cc-teal: #8e827d;
  --cc-red: #c85b53;
  --cc-green: #62bd78;
  --cc-green-deep: #3d8d57;
}

.navbar,
.navbar.expanded,
.navbar.expanded:hover {
  background: linear-gradient(180deg, var(--cc-bg) 0%, var(--cc-bg-deep) 100%);
  border-right-color: rgba(123, 151, 183, 0.48);
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.24),
    inset -1px 0 rgba(255, 255, 255, 0.035);
}

.navbar-header {
  grid-template-columns: 58px minmax(0, 1fr) 50px;
  min-height: 108px;
  padding: 16px 24px;
  gap: 14px;
  border-bottom-color: rgba(122, 149, 179, 0.3);
}

.control-center-mark,
.navbar:hover .control-center-mark {
  width: 58px;
  height: 58px;
  border-color: var(--cc-blue);
  background: #0d1b2d;
  box-shadow: 0 0 0 1px rgba(91, 145, 245, 0.18),
    0 0 20px rgba(91, 145, 245, 0.16);
}

.control-center-mark i {
  color: #e5efff;
  font-size: 24px;
}

.control-center-title {
  color: var(--cc-text);
  font-size: 29px;
  letter-spacing: -0.55px;
}

#menuToggleButton {
  width: 50px;
  height: 50px;
  border-color: rgba(125, 153, 185, 0.42);
  border-radius: 14px;
  background: var(--cc-surface-button);
  color: #edf3fd;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.16);
}

#menuToggleButton:hover {
  border-color: var(--cc-border-strong);
  background: #1c3049;
  color: #fff;
}

.navbar .control-section {
  gap: 11px;
  padding: 20px 15px 18px;
  border-color: var(--cc-border);
  border-radius: 15px;
  background: linear-gradient(
    180deg,
    rgba(19, 33, 50, 0.98),
    rgba(12, 23, 36, 0.98)
  );
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03),
    0 5px 12px rgba(0, 0, 0, 0.18);
}

.navbar .control-section-heading {
  color: var(--cc-muted);
  font-size: 13px;
  letter-spacing: 0.45px;
}

.navbar .control-section-rule {
  background: rgba(134, 158, 187, 0.32);
}

.navbar .nav-button,
.navbar a.nav-button {
  min-height: 56px;
  padding: 0 15px;
  border-color: var(--cc-border-soft);
  border-radius: 12px;
  background: linear-gradient(180deg, #192a40 0%, #162438 100%);
  color: var(--cc-text);
  font-size: 17px;
  gap: 12px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04),
    0 3px 7px rgba(0, 0, 0, 0.16);
}

.navbar .nav-button:hover,
.navbar a.nav-button:hover {
  border-color: var(--cc-border-strong);
  background: linear-gradient(180deg, #203650 0%, #1a2d45 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07),
    0 5px 12px rgba(0, 0, 0, 0.22);
}

.navbar .nav-button:focus-visible,
.navbar a.nav-button:focus-visible,
#muteIconNav:focus-visible {
  outline: 2px solid var(--cc-blue);
  outline-offset: 2px;
}

.navbar .nav-button > i:first-child {
  flex-basis: 30px;
  width: 30px;
  color: #eaf2ff;
  font-size: 19px;
}

.navbar .control-row-button::after {
  color: #d9e5f5;
}

.navbar .demo-mode-nav-button,
#demoModeTopButton,
#addStreamForm .control-accent-button {
  border-color: rgba(190, 140, 239, 0.72);
  background: linear-gradient(
    135deg,
    #b27be6 0%,
    #9a68d4 55%,
    #8052c1 100%
  );
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.18),
    0 5px 12px rgba(74, 38, 120, 0.3);
}

.navbar .demo-mode-nav-button:hover,
#demoModeTopButton:hover,
#addStreamForm .control-accent-button:hover {
  border-color: #d7b6f7;
  background: linear-gradient(135deg, #c08bef 0%, #a976df 55%, #8c5bca 100%);
}

.navbar .demo-mode-nav-button > i:first-child {
  background: rgba(255, 255, 255, 0.18);
}

.navbar .status-chip {
  min-width: 66px;
  padding: 8px 11px;
  border: 1px solid rgba(224, 190, 255, 0.16);
  background: rgba(61, 29, 94, 0.56);
  color: #f7efff;
}

.navbar #volumeSliderContainer {
  min-height: 60px;
  padding: 7px 12px 7px 8px;
  gap: 12px;
  border-color: var(--cc-border-soft);
  border-radius: 12px;
  background: linear-gradient(180deg, #192b41 0%, #16263a 100%);
}

.navbar #volumeSliderContainer:hover {
  border-color: var(--cc-border-strong);
  background: linear-gradient(180deg, #203650 0%, #1a2d45 100%);
}

.navbar .volume-icon,
.navbar .party-panel-nav-button > i:first-child {
  border-color: rgba(143, 173, 208, 0.3);
  background: #0f1e31;
  color: #eaf2ff;
}

.navbar .volume-icon {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

.navbar #volumeSliderContainer label {
  color: #dce6f4;
  font-size: 17px;
  font-weight: 600;
}

.navbar #volumeSlider {
  background: linear-gradient(90deg, var(--cc-blue) 0 var(--volume-fill), #aebdd1 var(--volume-fill) 100%);
  accent-color: var(--cc-blue);
}

.navbar #volumeSlider::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--cc-blue) 0 var(--volume-fill), #aebdd1 var(--volume-fill) 100%);
}

.navbar #volumeSlider::-webkit-slider-thumb {
  background: #d2dceb;
}

.navbar #volumeSlider::-moz-range-progress {
  background: var(--cc-blue);
}

.navbar .control-input-shell {
  min-height: 56px;
  border-color: var(--cc-border-soft);
  border-radius: 12px;
  background: linear-gradient(180deg, #192a40 0%, #162438 100%);
}

.navbar .control-input-shell > i {
  color: #aebdd0;
}

.navbar #newChannel,
.navbar #addStreamForm #newChannel {
  font-size: 15.5px;
}

.navbar #newChannel::placeholder {
  color: #9aaac0;
}

.navbar #addStreamForm {
  gap: 9px;
}

.navbar #addStreamForm .control-accent-button {
  min-height: 56px;
  font-size: 17px;
  font-weight: 600;
}

.navbar .control-section-divider {
  background: rgba(125, 151, 180, 0.28);
}

.navbar .control-action-row,
.navbar #windowControlsButton {
  min-height: 54px;
  border-radius: 12px;
  font-size: 16px;
}

.navbar .control-action-row > i:first-child,
.navbar #windowControlsButton > i:first-child {
  flex-basis: 46px;
  width: 46px;
  margin-right: 11px;
  font-size: 20px;
}

.navbar .control-action-row--backup > i:first-child {
  background: var(--cc-teal);
}

.navbar .control-action-row--refresh > i:first-child {
  background: var(--cc-blue-deep);
}

.navbar .control-action-row--remove > i:first-child {
  background: var(--cc-red);
}

.navbar .control-action-row--neutral > i:first-child {
  background: #20334b;
  border-right-color: rgba(142, 169, 201, 0.34);
}

.navbar #backUpStreamButton,
.navbar #refreshPageButton,
.navbar #removeOfflineStreamsButton {
  min-height: 54px;
  font-size: 16px;
  border-color: var(--cc-border-soft);
  background: linear-gradient(180deg, #192a40 0%, #162438 100%);
  color: var(--cc-text);
}

.navbar #backUpStreamButton:hover,
.navbar #refreshPageButton:hover,
.navbar #removeOfflineStreamsButton:hover {
  border-color: var(--cc-border-strong);
  background: linear-gradient(180deg, #203650 0%, #1a2d45 100%);
}

.navbar .control-section--team .mode-buttons {
  border-color: var(--cc-border-soft);
  border-radius: 12px;
  background: #132238;
}

.navbar .control-section--team #singleModeButton,
.navbar .control-section--team #dualModeButton {
  min-height: 54px;
  color: #d8e3f2;
  font-size: 16px;
}

.navbar .control-section--team #singleModeButton.active-mode-button,
.navbar .control-section--team #dualModeButton.active-mode-button {
  background: linear-gradient(135deg, #5e95f3 0%, #3f70d0 100%);
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.18),
    0 4px 10px rgba(38, 83, 165, 0.28);
}

.navbar #windowControlsButton.active {
  border-color: rgba(98, 189, 120, 0.78);
  background: linear-gradient(180deg, #579f69 0%, #3d824f 100%);
}

.navbar #windowControlsButton.active > i:first-child {
  background: #62bd78;
}

.navbar #windowControlsButton .status-chip {
  background: rgba(24, 66, 39, 0.56);
}

.navbar #windowControlsButton:not(.active) {
  border-color: rgba(219, 107, 97, 0.76);
  background: linear-gradient(180deg, #c65d55 0%, #9f4641 100%);
}

.navbar #windowControlsButton:not(.active) > i:first-child {
  background: #db6b61;
}

.navbar #windowControlsButton:not(.active) .status-chip {
  background: rgba(91, 28, 28, 0.48);
}

@media (max-width: 760px), (max-height: 1500px) {
  body.menu-open {
    grid-template-columns: min(400px, calc(100vw - 24px)) 1fr;
  }

  .navbar.expanded,
  .navbar.expanded:hover {
    width: min(400px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    height: 100vh;
    zoom: 1;
  }

  .navbar .navbar-header {
    grid-template-columns: 48px minmax(0, 1fr) 40px;
    min-height: 76px;
    padding: 12px 18px;
    gap: 10px;
  }

  .navbar .control-center-mark,
  .navbar:hover .control-center-mark {
    width: 48px;
    height: 48px;
  }

  .navbar .control-center-mark i {
    font-size: 21px;
  }

  .navbar .control-center-title {
    font-size: 22px;
    letter-spacing: -0.4px;
  }

  .navbar #menuToggleButton {
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }

  .navbar #menuToggleButton i {
    font-size: 20px;
  }

  .navbar .nav-buttons {
    gap: 5px !important;
    padding: 0 18px 6px !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
  }

  .navbar .nav-buttons::-webkit-scrollbar {
    display: none;
  }

  .navbar .control-section {
    gap: 5px;
    padding: 8px 10px 7px;
    border-radius: 13px;
  }

  .navbar .nav-button,
  .navbar a.nav-button {
    min-height: 38px;
    padding: 0 11px;
    border-radius: 9px;
    font-size: 14px;
    gap: 8px;
    line-height: 1.05;
  }

  .navbar .demo-mode-nav-button,
  .navbar #addStreamForm .control-accent-button {
    min-height: 40px;
  }

  .navbar #volumeSliderContainer {
    min-height: 44px;
    padding: 4px 8px 4px 6px;
    gap: 8px;
  }

  .navbar .control-input-shell {
    min-height: 36px;
  }

  .navbar .control-action-row,
  .navbar #backUpStreamButton,
  .navbar #refreshPageButton,
  .navbar #removeOfflineStreamsButton,
  .navbar #windowControlsButton,
  .navbar .control-section--team #singleModeButton,
  .navbar .control-section--team #dualModeButton {
    min-height: 36px;
    font-size: 14px;
    padding-right: 8px;
  }

  .navbar .control-action-row > i:first-child,
  .navbar #windowControlsButton > i:first-child {
    flex-basis: 36px;
    width: 36px;
    margin-right: 8px;
    font-size: 16px;
  }

  .navbar .nav-button > i:first-child {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 16px;
  }

  .navbar .control-section-heading {
    min-height: 12px;
    gap: 7px;
    font-size: 11px;
    letter-spacing: 0.45px;
  }

  .navbar .party-panel-nav-button > i:first-child {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }

  .navbar .demo-mode-nav-button > i:first-child {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .navbar .status-chip {
    min-width: 56px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .navbar .volume-icon {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .navbar #volumeSliderContainer label {
    font-size: 14px;
  }

  .navbar #volumeSlider,
  .navbar #volumeSlider::-webkit-slider-runnable-track {
    height: 5px;
  }

  .navbar #volumeSlider::-webkit-slider-thumb {
    width: 15px;
    height: 15px;
    margin-top: -5px;
  }

  .navbar #addStreamForm {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 4px;
  }

  .navbar .control-input-shell > i {
    flex-basis: 32px;
    font-size: 16px;
  }

  .navbar #newChannel {
    height: 34px;
    font-size: 13px;
  }

  .navbar #addStreamForm .control-accent-button {
    min-width: 118px;
    padding: 0 10px;
    font-size: 13px;
  }

  .navbar .control-section-divider {
    margin: 0;
  }

  .navbar .control-section--team .mode-buttons {
    border-radius: 8px;
  }

  .navbar .control-section--team #singleModeButton,
  .navbar .control-section--team #dualModeButton {
    min-height: 36px;
    padding: 0 9px;
    font-size: 14px;
    gap: 6px;
  }

  .navbar #windowControlsButton .status-chip {
    min-width: 50px;
    padding: 6px 8px;
    font-size: 11px;
  }
}

@media (max-width: 650px) {
  .navbar .navbar-header {
    grid-template-columns: 48px minmax(0, 1fr) 44px;
    min-height: 80px;
    padding: 12px 12px;
    gap: 10px;
  }

  .navbar .control-center-mark,
  .navbar:hover .control-center-mark {
    width: 48px;
    height: 48px;
  }

  .navbar .control-center-title {
    font-size: 24px;
  }

  .navbar #menuToggleButton {
    width: 44px;
    height: 44px;
  }

  .navbar .nav-buttons {
    padding-inline: 12px !important;
  }

  .navbar .control-section {
    padding: 9px 8px 8px;
  }

  .navbar .nav-button,
  .navbar a.nav-button {
    min-height: 40px;
    padding: 0 10px;
    font-size: 14px;
    gap: 9px;
  }
}

/* At the short 720px browser height, use the dense variant only as a
   fallback. Taller phone/tablet and split-pane views keep the more readable
   medium compact treatment above. */
@media (max-height: 920px) {
  .navbar .navbar-header {
    grid-template-columns: 44px minmax(0, 1fr) 40px;
    min-height: 68px;
    padding: 10px 12px;
    gap: 9px;
  }

  .navbar .control-center-mark,
  .navbar:hover .control-center-mark {
    width: 44px;
    height: 44px;
  }

  .navbar .control-center-mark i {
    font-size: 20px;
  }

  .navbar .control-center-title {
    font-size: 22px;
  }

  .navbar #menuToggleButton {
    width: 40px;
    height: 40px;
  }

  .navbar .nav-buttons {
    gap: 4px !important;
    padding: 0 12px 4px !important;
    overflow-y: hidden !important;
  }

  .navbar .control-section {
    gap: 4px;
    padding: 7px 8px 6px;
  }

  .navbar .control-section-heading {
    min-height: 12px;
    gap: 7px;
    font-size: 11px;
  }

  .navbar .nav-button,
  .navbar a.nav-button {
    min-height: 34px;
    padding: 0 9px;
    border-radius: 9px;
    font-size: 14px;
    gap: 8px;
  }

  .navbar .nav-button > i:first-child,
  .navbar .party-panel-nav-button > i:first-child {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    font-size: 15px;
  }

  .navbar .demo-mode-nav-button,
  .navbar #addStreamForm .control-accent-button {
    min-height: 36px;
  }

  .navbar .demo-mode-nav-button > i:first-child {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .navbar .status-chip {
    min-width: 54px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .navbar #volumeSliderContainer {
    min-height: 40px;
    padding: 4px 7px 4px 5px;
    gap: 7px;
  }

  .navbar .volume-icon {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .navbar #volumeSliderContainer label {
    font-size: 14px;
  }

  .navbar #addStreamForm {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
  }

  .navbar .control-input-shell {
    min-height: 34px;
  }

  .navbar .control-input-shell > i {
    flex-basis: 30px;
    font-size: 15px;
  }

  .navbar #newChannel {
    height: 32px;
    font-size: 13px;
  }

  .navbar #addStreamForm .control-accent-button {
    min-width: 112px;
    padding: 0 9px;
    font-size: 14px;
  }

  .navbar .control-action-row,
  .navbar #backUpStreamButton,
  .navbar #refreshPageButton,
  .navbar #removeOfflineStreamsButton,
  .navbar #windowControlsButton,
  .navbar .control-section--team #singleModeButton,
  .navbar .control-section--team #dualModeButton {
    min-height: 34px;
    font-size: 14px;
    padding-right: 7px;
  }

  .navbar .control-action-row > i:first-child,
  .navbar #backUpStreamButton > i:first-child,
  .navbar #refreshPageButton > i:first-child,
  .navbar #removeOfflineStreamsButton > i:first-child,
  .navbar #windowControlsButton > i:first-child {
    flex-basis: 34px;
    width: 34px;
    margin-right: 7px;
    font-size: 15px;
  }

  .navbar .control-section--team #singleModeButton,
  .navbar .control-section--team #dualModeButton {
    min-height: 34px;
    padding: 0 8px;
    font-size: 14px;
  }

  .navbar #windowControlsButton .status-chip {
    min-width: 48px;
    padding: 6px 7px;
    font-size: 11px;
  }
}

/* ========================================================================
   Burberry Midnight final cascade
   ======================================================================== */
.navbar,
.navbar.expanded,
.navbar.expanded:hover {
  border-right-color: rgba(157, 143, 138, 0.5);
}

.navbar-header {
  border-bottom-color: rgba(157, 143, 138, 0.28);
}

.control-center-mark,
.navbar:hover .control-center-mark {
  background: #171416;
  border-color: var(--cc-blue);
  box-shadow: 0 0 0 1px rgba(4, 4, 205, 0.24),
    0 0 20px rgba(4, 4, 205, 0.2);
}

#menuToggleButton {
  border-color: rgba(157, 143, 138, 0.5);
  background: var(--cc-surface-button);
  color: #f5f2ef;
}

#menuToggleButton:hover {
  border-color: var(--cc-border-strong);
  background: var(--cc-surface-raised);
}

.navbar .control-section {
  border-color: var(--cc-border);
  background: linear-gradient(180deg, #2b2422 0%, #1b1718 100%);
}

.navbar .control-section-rule,
.navbar .control-section-divider {
  background: rgba(157, 143, 138, 0.32);
}

.navbar .nav-button,
.navbar a.nav-button {
  border-color: var(--cc-border-soft);
  background: linear-gradient(180deg, #302726 0%, #231d1c 100%);
  color: var(--cc-text);
}

.navbar .nav-button:hover,
.navbar a.nav-button:hover {
  border-color: var(--cc-border-strong);
  background: linear-gradient(180deg, #3b302d 0%, #2b2321 100%);
}

.navbar .nav-button > i:first-child,
.navbar .control-row-button::after,
.navbar .party-panel-nav-button > i:first-child {
  color: #f1ebe8;
}

.navbar .demo-mode-nav-button,
#demoModeTopButton,
#addStreamForm .control-accent-button {
  border-color: rgba(157, 143, 138, 0.86);
  background: linear-gradient(135deg, #2525d9 0%, #0404cd 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.22),
    0 5px 12px rgba(4, 4, 205, 0.28);
}

.navbar .demo-mode-nav-button:hover,
#demoModeTopButton:hover,
#addStreamForm .control-accent-button:hover {
  border-color: #c7bbb7;
  background: linear-gradient(135deg, #3a3ae6 0%, #1111c8 100%);
}

.navbar .demo-mode-nav-button > i:first-child {
  background: rgba(245, 242, 239, 0.2);
}

.navbar .status-chip {
  border-color: rgba(157, 143, 138, 0.24);
  background: rgba(84, 48, 37, 0.68);
  color: #f7f2ef;
}

.navbar #volumeSliderContainer,
.navbar .control-input-shell,
.navbar .control-action-row,
.navbar #windowControlsButton,
.navbar #backUpStreamButton,
.navbar #refreshPageButton,
.navbar #removeOfflineStreamsButton {
  border-color: var(--cc-border-soft);
  background: linear-gradient(180deg, #302726 0%, #231d1c 100%);
}

.navbar #volumeSliderContainer:hover,
.navbar .control-input-shell:hover,
.navbar .control-action-row:hover,
.navbar #windowControlsButton:hover,
.navbar #backUpStreamButton:hover,
.navbar #refreshPageButton:hover,
.navbar #removeOfflineStreamsButton:hover {
  border-color: var(--cc-border-strong);
  background: linear-gradient(180deg, #3b302d 0%, #2b2321 100%);
}

.navbar .volume-icon,
.navbar .party-panel-nav-button > i:first-child {
  border-color: rgba(157, 143, 138, 0.38);
  background: #171416;
  color: #f5f2ef;
}

.navbar #volumeSliderContainer label {
  color: #eee8e4;
}

.navbar #volumeSlider,
.navbar #volumeSlider::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--cc-blue) 0 var(--volume-fill), #b8ada8 var(--volume-fill) 100%);
  accent-color: var(--cc-blue);
}

.navbar #volumeSlider::-webkit-slider-thumb {
  background: #e0d8d4;
}

.navbar #volumeSlider::-moz-range-progress {
  background: var(--cc-blue);
}

.navbar .control-input-shell > i,
.navbar #newChannel::placeholder {
  color: #b8aaa5;
}

.navbar .control-action-row--backup > i:first-child {
  background: var(--cc-teal);
}

.navbar .control-action-row--refresh > i:first-child {
  background: var(--cc-blue);
}

.navbar .control-action-row--remove > i:first-child {
  background: var(--cc-red);
}

.navbar .control-action-row--neutral > i:first-child {
  background: var(--cc-border);
  border-right-color: rgba(157, 143, 138, 0.42);
}

.navbar .control-section--team .mode-buttons {
  border-color: var(--cc-border-soft);
  background: #171416;
}

.navbar .control-section--team #singleModeButton,
.navbar .control-section--team #dualModeButton {
  color: #e2d9d5;
}

.navbar .control-section--team #singleModeButton.active-mode-button,
.navbar .control-section--team #dualModeButton.active-mode-button {
  background: linear-gradient(135deg, #2525d9 0%, #0404cd 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.2),
    0 4px 10px rgba(4, 4, 205, 0.26);
}

.navbar #windowControlsButton:not(.active) {
  border-color: rgba(200, 91, 83, 0.76);
  background: linear-gradient(180deg, #b6534c 0%, #873b37 100%);
}

/* Left-rail color and label lock. This final scoped pass wins over legacy
   palette experiments that remain in the stylesheet for other layouts. */
body.left-nav-layout .demo-mode-nav-button,
body.left-nav-layout #demoModeTopButton {
  min-height: 52px !important;
  padding: 0 11px !important;
  gap: 10px !important;
  border-color: rgba(157, 143, 138, 0.32) !important;
  background: linear-gradient(180deg, #292627 0%, #1d1b1c 100%) !important;
  color: #f2efed !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

body.left-nav-layout #addStreamForm .control-accent-button {
  width: 120px !important;
  min-width: 120px !important;
  height: 52px !important;
  min-height: 52px !important;
  padding: 0 7px !important;
  gap: 4px !important;
  border-color: rgba(80, 101, 221, 0.8) !important;
  background: linear-gradient(135deg, #315bc1 0%, #2448a3 100%) !important;
  color: #fff !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  justify-content: center;
}

body.left-nav-layout #addStreamForm .control-accent-button > i:first-child {
  display: none;
}

body.left-nav-layout .control-section--team #singleModeButton.active-mode-button,
body.left-nav-layout .control-section--team #dualModeButton.active-mode-button {
  background: linear-gradient(135deg, #315bc1 0%, #2448a3 100%) !important;
  color: #fff !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14) !important;
}

body.left-nav-layout .control-section--shortcuts .control-row-button::after {
  display: none;
}

body.left-nav-layout .control-section--shortcuts .control-action-row,
body.left-nav-layout .control-section--shortcuts .control-action-row .nav-button-label {
  white-space: normal;
  line-height: 1.05;
  text-align: left;
}

body.left-nav-layout #backUpStreamButton,
body.left-nav-layout #refreshPageButton {
  gap: 4px;
}

body.left-nav-layout #backUpStreamButton .nav-button-label,
body.left-nav-layout #refreshPageButton .nav-button-label {
  font-size: 11.5px;
  white-space: nowrap;
}

body.left-nav-layout #backUpStreamButton > i:first-child,
body.left-nav-layout #refreshPageButton > i:first-child {
  margin-right: 3px;
}

@media (max-height: 760px) {
  body.left-nav-layout .demo-mode-nav-button,
  body.left-nav-layout #demoModeTopButton {
    min-height: 38px !important;
    padding-inline: 9px !important;
    gap: 8px !important;
  }

  body.left-nav-layout #addStreamForm .control-accent-button {
    height: 38px !important;
    min-height: 38px !important;
  }

  body.left-nav-layout #backUpStreamButton,
  body.left-nav-layout #refreshPageButton,
  body.left-nav-layout #backUpStreamButton .nav-button-label,
  body.left-nav-layout #refreshPageButton .nav-button-label {
    font-size: 11px;
  }
}

/* Grouped desktop rail: final cascade lock. */
body.left-nav-layout #shortcutsButton[hidden] {
  display: none !important;
}

@media (max-height: 940px) {
  body.left-nav-layout .nav-buttons,
  body.left-nav-layout .navbar.expanded .nav-buttons,
  body.left-nav-layout .navbar:hover .nav-buttons {
    padding-bottom: 14px !important;
  }
}

body.left-nav-layout .control-section--shortcuts {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  gap: 6px;
}

body.left-nav-layout .control-group-shell--streams,
body.left-nav-layout #addStreamForm,
body.left-nav-layout #addStreamForm .control-input-shell,
body.left-nav-layout #addStreamForm .control-accent-button {
  width: 100% !important;
  max-width: none !important;
}

body.left-nav-layout .control-group-shell--streams {
  padding: 12px 12px 0;
}

body.left-nav-layout .control-row-group--stream-actions {
  width: calc(100% + 24px);
  margin: 12px -12px 0;
  overflow: hidden;
  border: 0;
  border-top: 1px solid var(--left-rail-divider);
  border-radius: 0;
}

body.left-nav-layout .demo-mode-nav-button,
body.left-nav-layout #demoModeTopButton {
  min-height: var(--left-rail-row) !important;
  height: var(--left-rail-row) !important;
  padding: 0 12px !important;
  gap: 12px !important;
  border: 0 !important;
  border-top: 1px solid var(--left-rail-divider) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--left-rail-text) !important;
  box-shadow: none !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

body.left-nav-layout #addStreamForm .control-accent-button {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 14px !important;
  gap: 9px !important;
  border: 1px solid rgba(111, 151, 244, 0.78) !important;
  border-radius: 8px !important;
  background: var(--left-rail-blue) !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  justify-content: center;
}

body.left-nav-layout #addStreamForm .control-accent-button > i:first-child {
  display: block;
  position: absolute;
  left: 14px;
  flex: 0 0 16px;
  width: 16px;
  height: auto;
  margin: 0;
  border: 0;
  background: transparent;
  font-size: 15px;
  box-shadow: none;
}

body.left-nav-layout #addStreamForm .control-accent-button .nav-button-label {
  text-align: center;
}

body.left-nav-layout .control-section--shortcuts .control-action-row,
body.left-nav-layout .control-section--shortcuts .control-action-row .nav-button-label,
body.left-nav-layout #backUpStreamButton,
body.left-nav-layout #refreshPageButton,
body.left-nav-layout #backUpStreamButton .nav-button-label,
body.left-nav-layout #refreshPageButton .nav-button-label {
  gap: 12px !important;
  font-size: 14px !important;
  line-height: 1.15 !important;
  text-align: left;
  white-space: nowrap !important;
}

/* A settled player gets a restrained reveal after playback is confirmed. The
   host scales from just under its final size while a temporary black mask
   fades away, keeping startup surfaces and Twitch's autoplay checks untouched. */
body.popup-mode .stream.twitch-stream-card.stream-playback-active
  > .twitch-player-host--direct {
  position: relative;
  transform-origin: center;
  animation: stream-media-surface-reveal 380ms cubic-bezier(0.22, 1, 0.36, 1)
    both;
  will-change: transform;
}

body.popup-mode .stream.twitch-stream-card.stream-playback-active
  > .twitch-player-host--direct::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  content: "";
  background: #000;
  pointer-events: none;
  animation: stream-media-reveal-mask 380ms ease-out both;
}

@keyframes stream-media-surface-reveal {
  from {
    transform: scale(0.985);
  }
  to {
    transform: scale(1);
  }
}

@keyframes stream-media-reveal-mask {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.popup-mode .stream.twitch-stream-card.stream-playback-active
    > .twitch-player-host--direct {
    animation: none !important;
    transform: none !important;
    will-change: auto;
  }

  body.popup-mode .stream.twitch-stream-card.stream-playback-active
    > .twitch-player-host--direct::after {
    animation: none !important;
    opacity: 0 !important;
  }
}

/* Let a removed tile leave the grid with the same quiet, physical motion as
   the media reveal. Cleanup waits for this transition before reflowing the
   remaining cards, so the gap closes after the eye has followed the exit. */
body.popup-mode .stream.twitch-stream-card.stream-removing,
body.popup-mode .stream.twitch-stream-card.stream-removing:hover {
  opacity: 0 !important;
  transform: translateY(8px) scale(0.97) !important;
  pointer-events: none !important;
  transition:
    opacity 280ms ease-out,
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1) !important;
  will-change: opacity, transform;
}

@media (prefers-reduced-motion: reduce) {
  body.popup-mode .stream.twitch-stream-card.stream-removing,
  body.popup-mode .stream.twitch-stream-card.stream-removing:hover {
    opacity: 0 !important;
    transform: none !important;
    transition: none !important;
    will-change: auto;
  }
}

body.left-nav-layout #backUpStreamButton > i:first-child,
body.left-nav-layout #refreshPageButton > i:first-child {
  margin: 0;
}

@media (max-height: 940px) {
  :root {
    --left-rail-row: 46px;
  }
}

@media (max-height: 820px) {
  :root {
    --left-rail-row: 41px;
  }

  body.left-nav-layout .demo-mode-nav-button,
  body.left-nav-layout #demoModeTopButton {
    min-height: var(--left-rail-row) !important;
    height: var(--left-rail-row) !important;
  }

  body.left-nav-layout #addStreamForm .control-accent-button {
    height: 37px !important;
    min-height: 37px !important;
  }

  body.left-nav-layout .control-group-shell--streams {
    padding: 8px 8px 0;
  }

  body.left-nav-layout .control-row-group--stream-actions {
    width: calc(100% + 16px);
    margin: 8px -8px 0;
  }
}

/* ========================================================================
   Left rail geometry: optical icon alignment + 1–6 stream capacity
   ======================================================================== */
body.left-nav-layout :is(
  .control-group-shell > .nav-button,
  .control-group-shell > a.nav-button,
  .control-row-group > .nav-button,
  .control-group-shell > #windowControlsButton
) {
  display: grid;
  grid-template-columns: var(--left-rail-icon) minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: 12px !important;
  padding-inline: 12px !important;
}

body.left-nav-layout :is(
  .control-group-shell > .nav-button,
  .control-group-shell > a.nav-button,
  .control-row-group > .nav-button,
  .control-group-shell > #windowControlsButton
) > .nav-button-label {
  align-self: center;
  line-height: 1.15 !important;
}

body.left-nav-layout .control-row-chevron {
  align-self: center;
  width: 14px;
  margin: 0;
  line-height: 1;
}

body.left-nav-layout :is(
  .nav-button > i:first-child,
  .party-panel-nav-button > i:first-child,
  .volume-icon,
  .control-action-row > i:first-child,
  #backUpStreamButton > i:first-child,
  #refreshPageButton > i:first-child,
  #removeOfflineStreamsButton > i:first-child,
  #windowControlsButton > i:first-child,
  .control-input-shell > i:first-child
) {
  align-self: center;
  line-height: 1 !important;
}

body.left-nav-layout :is(
  .nav-button > i:first-child,
  .party-panel-nav-button > i:first-child,
  .volume-icon,
  .control-action-row > i:first-child,
  #backUpStreamButton > i:first-child,
  #refreshPageButton > i:first-child,
  #removeOfflineStreamsButton > i:first-child,
  #windowControlsButton > i:first-child,
  .control-input-shell > i:first-child
)::before {
  display: block;
  line-height: 1;
  transform: translateY(var(--left-rail-icon-optical-y, 0));
}

body.left-nav-layout .fa-users-viewfinder { --left-rail-icon-optical-y: 0.5px; }
body.left-nav-layout .fa-gamepad { --left-rail-icon-optical-y: -0.5px; }
body.left-nav-layout .fa-volume-high { --left-rail-icon-optical-y: 0.5px; }
body.left-nav-layout .fa-cloud-arrow-up { --left-rail-icon-optical-y: 1px; }
body.left-nav-layout .fa-arrows-rotate { --left-rail-icon-optical-y: 0.5px; }
body.left-nav-layout .fa-link { --left-rail-icon-optical-y: 0.5px; }
body.left-nav-layout .fa-graduation-cap { --left-rail-icon-optical-y: 1px; }
body.left-nav-layout .fa-circle-plus { --left-rail-icon-optical-y: 0.5px; }

body.left-nav-layout #volumeSliderContainer {
  column-gap: 12px !important;
  padding-inline: 12px !important;
}

body.left-nav-layout #volumeSliderContainer > :is(.volume-icon, label, input, #muteIconNav),
body.left-nav-layout .control-input-shell > :is(i, input),
body.left-nav-layout #addStreamForm .control-accent-button > :is(i, .nav-button-label) {
  align-self: center;
}

body.left-nav-layout #muteIconNav {
  background-position: center;
  background-repeat: no-repeat;
}

body.left-nav-layout .control-section--team .mode-buttons {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-rows: 30px;
  min-height: 70px;
  padding: 4px;
  gap: 2px;
}

body.left-nav-layout .control-section--team .team-mode-button,
body.left-nav-layout .control-section--team #singleModeButton,
body.left-nav-layout .control-section--team #dualModeButton {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  height: 30px;
  padding: 0 5px;
  gap: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #d9d6d4;
  box-shadow: none;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.25px;
  line-height: 1;
  text-transform: uppercase;
}

body.left-nav-layout .control-section--team .team-mode-button .nav-button-label {
  display: block;
  width: auto;
  overflow: visible;
  line-height: 1 !important;
  text-align: center;
}

body.left-nav-layout .control-section--team .team-mode-button:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.left-nav-layout .control-section--team .team-mode-button.active-mode-button {
  background: var(--left-rail-blue) !important;
  color: #fff !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14) !important;
}

@media (max-height: 940px) {
  body.left-nav-layout .control-section--team .mode-buttons {
    grid-auto-rows: 27px;
    min-height: 64px;
  }

  body.left-nav-layout .control-section--team .team-mode-button,
  body.left-nav-layout .control-section--team #singleModeButton,
  body.left-nav-layout .control-section--team #dualModeButton {
    min-height: 27px;
    height: 27px;
    font-size: 11px;
  }
}

@media (max-height: 820px) {
  body.left-nav-layout .control-section--team .mode-buttons {
    grid-auto-rows: 24px;
    min-height: 56px;
    padding: 3px;
  }

  body.left-nav-layout .control-section--team .team-mode-button,
  body.left-nav-layout .control-section--team #singleModeButton,
  body.left-nav-layout .control-section--team #dualModeButton {
    min-height: 24px;
    height: 24px;
    font-size: 10.5px;
  }
}

/* The optional loudness control shares the Session group. Keep its disabled
   state to one aligned row so the complete desktop command rail remains
   visible; its explanatory controls expand only while the feature is on. */
body.left-nav-layout #volumeStabilizationContainer {
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 0 12px;
  gap: 0;
  border: 0;
  border-top: 1px solid var(--left-rail-divider);
  border-radius: 0;
  background: transparent;
}

body.left-nav-layout #volumeStabilizationContainer .volume-stabilization-heading {
  min-height: 41px;
}

body.left-nav-layout #volumeStabilizationContainer .volume-stabilization-title {
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.45px;
}

body.left-nav-layout #volumeStabilizationContainer .volume-stabilization-title > i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: 0;
  line-height: 1;
}

body.left-nav-layout #volumeStabilizationContainer .volume-stabilization-toggle {
  min-width: 44px;
  height: 24px;
  padding: 0 8px;
  line-height: 22px;
}

body.left-nav-layout #volumeStabilizationContainer .volume-stabilization-set {
  min-width: 38px;
  height: 24px;
  padding: 0 7px;
  line-height: 22px;
}

body.left-nav-layout #volumeStabilizationContainer:not(:has(.volume-stabilization-toggle.is-enabled))
  .volume-stabilization-description,
body.left-nav-layout #volumeStabilizationContainer:not(:has(.volume-stabilization-toggle.is-enabled))
  .volume-stabilization-reference-status,
body.left-nav-layout #volumeStabilizationContainer:not(:has(.volume-stabilization-toggle.is-enabled))
  .volume-stabilization-streams {
  display: none;
}

body.left-nav-layout #volumeStabilizationContainer:has(.volume-stabilization-toggle.is-enabled) {
  padding-block: 0 9px;
  gap: 7px;
}

@media (max-height: 940px) {
  :root {
    --left-rail-row: 44px;
  }

  body.left-nav-layout .navbar-header {
    flex-basis: 64px;
    min-height: 64px;
    height: 64px;
    padding-block: 10px;
  }

  body.left-nav-layout .nav-buttons,
  body.left-nav-layout .navbar.expanded .nav-buttons,
  body.left-nav-layout .navbar:hover .nav-buttons {
    gap: 8px !important;
    padding-block: 10px 12px !important;
  }

  body.left-nav-layout .control-section {
    gap: 4px;
  }

  body.left-nav-layout .control-section-heading,
  body.left-nav-layout .control-section-heading .nav-section-toggle {
    min-height: 12px;
    line-height: 12px;
  }

  body.left-nav-layout .control-group-shell--streams {
    padding: 10px 10px 0;
  }

  body.left-nav-layout .control-input-shell,
  body.left-nav-layout #addStreamForm .control-accent-button {
    height: 40px !important;
    min-height: 40px !important;
  }

  body.left-nav-layout #addStreamForm #newChannel,
  body.left-nav-layout .control-input-shell > i {
    height: 38px !important;
  }

  body.left-nav-layout .control-row-group--stream-actions {
    width: calc(100% + 20px);
    margin: 10px -10px 0;
  }

  body.left-nav-layout .control-section--team .mode-buttons {
    grid-auto-rows: 26px;
    min-height: 62px;
  }

  body.left-nav-layout .control-section--team .team-mode-button,
  body.left-nav-layout .control-section--team #singleModeButton,
  body.left-nav-layout .control-section--team #dualModeButton {
    min-height: 26px;
    height: 26px;
  }

  body.left-nav-layout #volumeStabilizationContainer {
    min-height: 38px;
  }

  body.left-nav-layout #volumeStabilizationContainer .volume-stabilization-heading {
    min-height: 37px;
  }
}

@media (max-height: 820px) {
  :root {
    --left-rail-row: 40px;
  }

  body.left-nav-layout .navbar-header {
    flex-basis: 58px;
    min-height: 58px;
    height: 58px;
    padding-block: 7px;
  }

  body.left-nav-layout .nav-buttons,
  body.left-nav-layout .navbar.expanded .nav-buttons,
  body.left-nav-layout .navbar:hover .nav-buttons {
    gap: 4px !important;
    padding-block: 4px !important;
  }

  body.left-nav-layout .control-input-shell,
  body.left-nav-layout #addStreamForm .control-accent-button {
    height: 37px !important;
    min-height: 37px !important;
  }

  body.left-nav-layout #addStreamForm #newChannel,
  body.left-nav-layout .control-input-shell > i {
    height: 35px !important;
  }

  body.left-nav-layout .control-section--team .mode-buttons {
    grid-auto-rows: 24px;
    min-height: 56px;
    padding: 3px;
  }

  body.left-nav-layout .control-section--team .team-mode-button,
  body.left-nav-layout .control-section--team #singleModeButton,
  body.left-nav-layout .control-section--team #dualModeButton {
    min-height: 24px;
    height: 24px;
    font-size: 10.5px;
  }

  body.left-nav-layout #volumeStabilizationContainer {
    min-height: 35px;
    padding-inline: 9px;
  }

  body.left-nav-layout #volumeStabilizationContainer .volume-stabilization-heading {
    min-height: 34px;
  }

  body.left-nav-layout #volumeStabilizationContainer .volume-stabilization-title {
    font-size: 9px;
  }
}

/* Branded Control Center mark: use the transparent PNG directly so no badge
   border, radius, or clipping box is involved in rendering the artwork. */
body.left-nav-layout .control-center-logo-image {
  display: block;
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  align-self: center;
  width: 48px;
  height: 56px;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));
}

body.left-nav-layout .navbar.menu-collapsed .control-center-logo-image,
body.left-nav-layout .navbar.menu-collapsed:hover .control-center-logo-image {
  width: 40px;
  height: 48px;
  justify-self: center;
}

/* Primary stream activation stays in the middle of each card and only
   appears when the card is being inspected. This keeps normal browsing from
   turning a preview live accidentally. */
.stream > .live-button {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  z-index: 12 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 32px;
  padding: 0 13px;
  color: #f5f5f5;
  border: 1px solid rgba(220, 220, 220, 0.62);
  border-radius: 8px;
  background: linear-gradient(180deg, #656565 0%, #353535 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.48), 0 0 0 3px rgba(220, 220, 220, 0.14), inset 0 1px rgba(255, 255, 255, 0.16);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.9);
  transition:
    opacity 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 180ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.stream:hover > .live-button,
.stream:focus-within > .live-button,
.stream > .live-button:focus-visible,
.stream > .live-button.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.stream > .live-button:hover,
.stream > .live-button:focus-visible {
  color: #111111;
  border-color: #ffffff;
  background: #d0d0d0;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.56), 0 0 0 3px rgba(255, 255, 255, 0.18);
  outline: none;
  transform: translate(-50%, -50%) scale(1.04);
}

.stream > .live-button.is-active {
  color: #f7fff9;
  border-color: #eaffef;
  background: #2fcf6d;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.48), 0 0 0 3px rgba(53, 215, 117, 0.16);
}

.stream > .live-button.is-source-prepared:not(.is-output-preparing)::after {
  content: "\2713";
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #07150c;
  background: #62e897;
  border: 2px solid #111318;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.46);
}

.stream > .live-button.is-output-preparing {
  min-width: 106px;
  gap: 7px;
  color: #fff7dd;
  border-color: #f5c96b;
  background: #765417;
  font-size: 11px;
  letter-spacing: 0.035em;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.48), 0 0 0 3px rgba(245, 201, 107, 0.14);
}

.stream > .live-button.is-output-preparing::before {
  content: "";
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border: 2px solid rgba(255, 247, 221, 0.36);
  border-top-color: #fff7dd;
  border-radius: 999px;
  animation: live-output-preparing-spin 680ms linear infinite;
}

/* Multi-stream activation uses explicit Live Window slots. The menu stays
   quiet until the source card is hovered or focused, matching the existing
   centered LIVE affordance without making a preview easy to activate by
   accident. */
.stream > .live-slot-target-menu {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  z-index: 13 !important;
  display: grid;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: min(152px, calc(100% - 16px));
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 32px;
  grid-auto-rows: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 160ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Match the Live Window's left-to-right, row-by-row slot numbering. The
   target menu uses the same row shapes so choosing a slot feels identical
   to locating that slot in the output window. */
.stream > .live-slot-target-menu[data-slot-capacity="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stream > .live-slot-target-menu[data-slot-capacity="3"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, 32px);
}

.stream > .live-slot-target-menu[data-slot-capacity="3"] > [data-live-slot="1"] {
  grid-column: 1 / span 2;
  grid-row: 1;
}

.stream > .live-slot-target-menu[data-slot-capacity="3"] > [data-live-slot="2"] {
  grid-column: 3 / span 2;
  grid-row: 1;
}

.stream > .live-slot-target-menu[data-slot-capacity="3"] > [data-live-slot="3"] {
  grid-column: 2 / span 2;
  grid-row: 2;
}

.stream > .live-slot-target-menu[data-slot-capacity="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, 32px);
}

.stream > .live-slot-target-menu[data-slot-capacity="4"] > [data-live-slot="1"],
.stream > .live-slot-target-menu[data-slot-capacity="4"] > [data-live-slot="2"] {
  grid-row: 1;
}

.stream > .live-slot-target-menu[data-slot-capacity="4"] > [data-live-slot="3"],
.stream > .live-slot-target-menu[data-slot-capacity="4"] > [data-live-slot="4"] {
  grid-row: 2;
}

.stream > .live-slot-target-menu[data-slot-capacity="5"] {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(2, 32px);
}

.stream > .live-slot-target-menu[data-slot-capacity="5"] > [data-live-slot="1"] {
  grid-column: 1 / span 3;
  grid-row: 1;
}

.stream > .live-slot-target-menu[data-slot-capacity="5"] > [data-live-slot="2"] {
  grid-column: 4 / span 3;
  grid-row: 1;
}

.stream > .live-slot-target-menu[data-slot-capacity="5"] > [data-live-slot="3"] {
  grid-column: 1 / span 2;
  grid-row: 2;
}

.stream > .live-slot-target-menu[data-slot-capacity="5"] > [data-live-slot="4"] {
  grid-column: 3 / span 2;
  grid-row: 2;
}

.stream > .live-slot-target-menu[data-slot-capacity="5"] > [data-live-slot="5"] {
  grid-column: 5 / span 2;
  grid-row: 2;
}

.stream > .live-slot-target-menu[data-slot-capacity="6"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, 32px);
}

.stream > .live-slot-target-menu[data-slot-capacity="6"] > [data-live-slot="1"],
.stream > .live-slot-target-menu[data-slot-capacity="6"] > [data-live-slot="2"],
.stream > .live-slot-target-menu[data-slot-capacity="6"] > [data-live-slot="3"] {
  grid-row: 1;
}

.stream > .live-slot-target-menu[data-slot-capacity="6"] > [data-live-slot="4"],
.stream > .live-slot-target-menu[data-slot-capacity="6"] > [data-live-slot="5"],
.stream > .live-slot-target-menu[data-slot-capacity="6"] > [data-live-slot="6"] {
  grid-row: 2;
}

.stream > .live-slot-target-menu[hidden] {
  display: none !important;
}

.stream.has-live-slot-targets:hover > .live-slot-target-menu,
.stream.has-live-slot-targets:focus-within > .live-slot-target-menu,
.stream.has-live-slot-targets > .live-slot-target-menu:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.stream.has-live-slot-targets > .live-button {
  opacity: 0 !important;
  pointer-events: none !important;
}

.live-slot-target-button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 32px;
  padding: 0 13px;
  color: #f5f5f5;
  border: 1px solid rgba(220, 220, 220, 0.58);
  border-radius: 999px;
  background: linear-gradient(180deg, #656565 0%, #353535 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.14);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.stream > .live-slot-target-menu[data-slot-capacity="5"] > .live-slot-target-button,
.stream > .live-slot-target-menu[data-slot-capacity="6"] > .live-slot-target-button {
  padding-inline: 4px;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.live-slot-target-button:hover,
.live-slot-target-button:focus-visible {
  color: #111111;
  border-color: #ffffff;
  background: #d0d0d0;
  outline: none;
  transform: translateY(-1px);
}

.live-slot-target-button.is-active {
  color: #f7fff9;
  border-color: #eaffef;
  background: #2fcf6d;
}

.live-slot-target-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.live-slot-indicator {
  flex: 0 0 auto;
  margin-left: 8px;
  padding: 4px 6px;
  color: #dffff0;
  border: 1px solid rgba(98, 232, 151, 0.72);
  border-radius: 999px;
  background: rgba(25, 112, 59, 0.76);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
}

@keyframes live-output-preparing-spin {
  to { transform: rotate(360deg); }
}

.stream.offline > .live-button,
.stream.stream-autoplay-pending > .live-button,
.stream.stream-playback-staging > .live-button,
.stream.stream-playback-loading > .live-button,
.stream.stream-removing > .live-button {
  display: none !important;
}

@media (hover: none), (pointer: coarse) {
  .stream > .live-button:not(.stream-autoplay-pending) {
    opacity: 0.94;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
  }

  .stream.has-live-slot-targets > .live-slot-target-menu {
    opacity: 0.96;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stream > .live-button {
    transition: none !important;
  }

  .stream > .live-button.is-output-preparing::before {
    animation: none;
  }

  .stream > .live-slot-target-menu,
  .live-slot-target-button {
    transition: none !important;
  }
}

/* Stream order control: keep the affordance at the bottom-right of the card
   so it stays clear of the centered LIVE action. */
body.popup-mode .stream.twitch-stream-card > .movement-arrows {
  position: absolute !important;
  top: auto !important;
  right: 0 !important;
  left: auto !important;
  bottom: 0 !important;
  z-index: 8 !important;
  display: flex !important;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 4px;
  width: auto;
  height: auto;
  transform: translate(0, 0) !important;
  pointer-events: none;
}

body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 56px;
  height: 30px;
  padding: 0 8px;
  color: #201a06;
  background: #f2c94c;
  border: 1px solid #ffe58a;
  border-radius: 7px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.42), 0 0 0 2px rgba(242, 201, 76, 0.14), inset 0 1px rgba(255, 255, 255, 0.38);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transform: translateY(-4px) scale(0.94);
  transition:
    opacity 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 220ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.popup-mode .stream.twitch-stream-card:hover > .movement-arrows .move-toggle,
body.popup-mode .stream.twitch-stream-card > .movement-arrows:focus-within .move-toggle,
body.popup-mode .stream.twitch-stream-card > .movement-arrows.is-open .move-toggle {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-toggle:hover,
body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-toggle:focus-visible {
  color: #171305;
  background: #ffe27a;
  border-color: #fff4bf;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(255, 226, 122, 0.28);
  outline: none;
}

body.popup-mode .stream.twitch-stream-card > .movement-arrows.is-open .move-toggle {
  color: #111;
  background: #e0e0e0;
  border-color: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(255, 255, 255, 0.1);
}

body.popup-mode.stream-card-drag-active,
body.popup-mode.stream-card-drag-active .move-toggle {
  cursor: grabbing !important;
}

body.popup-mode.stream-card-drag-active #streamsGrid iframe,
body.popup-mode.stream-card-drag-active #streamsGrid video {
  pointer-events: none !important;
}

body.popup-mode .stream.twitch-stream-card.stream-card-dragging {
  opacity: 0.38 !important;
  outline: 2px solid rgba(255, 255, 255, 0.74);
  outline-offset: -2px;
}

body.popup-mode .stream.twitch-stream-card.stream-card-drop-target {
  border-color: rgba(255, 255, 255, 0.94) !important;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.18),
    0 0 26px rgba(255, 255, 255, 0.16),
    inset 0 0 0 2px rgba(255, 255, 255, 0.4) !important;
}

body.popup-mode .stream.twitch-stream-card > .stream-card-drop-placeholder {
  position: absolute !important;
  inset: 0 !important;
  z-index: 40 !important;
  display: grid !important;
  box-sizing: border-box;
  place-items: center;
  padding: 16px;
  color: #111;
  background:
    linear-gradient(145deg, rgba(244, 247, 251, 0.78), rgba(207, 216, 228, 0.68)),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.12) 0,
      rgba(255, 255, 255, 0.12) 10px,
      rgba(24, 31, 42, 0.08) 10px,
      rgba(24, 31, 42, 0.08) 20px
    );
  border: 3px dashed rgba(255, 255, 255, 0.98);
  border-radius: 10px;
  box-shadow:
    0 0 0 3px rgba(14, 18, 25, 0.72),
    0 0 0 7px rgba(255, 255, 255, 0.22),
    0 18px 38px rgba(0, 0, 0, 0.58),
    inset 0 0 42px rgba(255, 255, 255, 0.28);
  opacity: 0;
  pointer-events: none !important;
  transform: scale(0.965);
  transition:
    opacity 120ms ease,
    transform 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.popup-mode .stream.twitch-stream-card > .stream-card-drop-placeholder.is-visible {
  opacity: 1;
  transform: scale(1);
}

body.popup-mode #streamsGrid > .stream.empty-team-stream-card {
  order: 2147483647 !important;
}

body.popup-mode .stream-card-drop-placeholder-marker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  padding: 10px 14px;
  color: #10141a;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #fff;
  border-radius: 9px;
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.34);
}

body.popup-mode .stream-card-drop-placeholder-marker > i {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: #171b22;
  border-radius: 7px;
  font-size: 13px;
}

body.popup-mode .stream-card-drop-placeholder-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

body.popup-mode .stream-card-drop-placeholder-copy strong {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

body.popup-mode .stream-card-drop-placeholder-copy small {
  color: #4f5865;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1.1;
  text-transform: uppercase;
}

body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-menu {
  display: grid;
  grid-template-columns: repeat(3, 27px);
  grid-template-rows: repeat(2, 27px);
  gap: 3px;
  padding: 4px;
  background: rgba(18, 18, 18, 0.98);
  border: 1px solid rgba(210, 210, 210, 0.44);
  border-radius: 8px;
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.5), inset 0 1px rgba(255, 255, 255, 0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px) scale(0.96);
  transform-origin: bottom right;
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 220ms;
}

body.popup-mode .stream.twitch-stream-card > .movement-arrows.is-open .move-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-arrow {
  position: static !important;
  display: inline-grid !important;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  color: #f2f2f2;
  background: #292929;
  border: 1px solid rgba(210, 210, 210, 0.32);
  border-radius: 5px;
  box-shadow: none;
  font-size: 11px;
  opacity: 1;
  transform: none !important;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-arrow::before {
  content: none !important;
}

body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-up {
  grid-column: 2;
  grid-row: 1;
}

body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-left {
  grid-column: 1;
  grid-row: 2;
}

body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-down {
  grid-column: 2;
  grid-row: 2;
}

body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-right {
  grid-column: 3;
  grid-row: 2;
}

body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-arrow:hover,
body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-arrow:focus-visible {
  color: #111;
  background: #dedede;
  border-color: #fff;
  transform: translateY(-1px) scale(1.06) !important;
  outline: none;
}

body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-arrow:active {
  transform: translateY(0) scale(0.94) !important;
}

body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-arrow:disabled {
  color: rgba(245, 245, 245, 0.32);
  background: #1c1c1c;
  border-color: rgba(210, 210, 210, 0.16);
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

@media (hover: none), (pointer: coarse) {
  body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-toggle {
    opacity: 0.94;
    pointer-events: auto;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-toggle,
  body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-menu,
  body.popup-mode .stream.twitch-stream-card > .movement-arrows .move-arrow {
    transition: none !important;
  }
}

body.popup-mode .stream.twitch-stream-card.stream-autoplay-pending > .movement-arrows,
body.popup-mode .stream.twitch-stream-card.stream-playback-staging > .movement-arrows,
body.popup-mode .stream.twitch-stream-card.stream-playback-loading > .movement-arrows,
body.popup-mode .stream.twitch-stream-card.stream-removing > .movement-arrows {
  display: none !important;
}

/* Optically align the quiet index and channel label. The index keeps a fixed
   two-character column so every channel name begins at the same position. */
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name {
  align-items: center !important;
  column-gap: 4px !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-index-label {
  display: inline-flex;
  flex: 0 0 2ch;
  width: 2ch;
  align-items: center;
  justify-content: flex-start;
  line-height: 1 !important;
  transform: none !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name-label {
  display: inline-flex;
  align-items: center;
  line-height: 1 !important;
}

/* ========================================================================
   Guided Control Center tutorial
   ======================================================================== */
#tutorial-overlay[hidden],
#tutorial-offer-view[hidden],
#tutorial-step-view[hidden] {
  display: none !important;
}

#tutorial-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(3, 8, 14, 0.76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  pointer-events: auto;
}

#tutorial-overlay .tutorial-backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

#tutorial-overlay .tutorial-content {
  position: relative;
  inset: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  width: min(920px, calc(100vw - 56px));
  max-width: none;
  max-height: min(780px, calc(100vh - 56px));
  padding: 0;
  overflow: hidden;
  text-align: left;
  color: var(--cc-text);
  background:
    radial-gradient(circle at 84% 12%, rgba(46, 121, 247, 0.16), transparent 31%),
    linear-gradient(145deg, #111e2d 0%, #0b1420 62%, #07101a 100%);
  border: 1px solid rgba(128, 155, 185, 0.48);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.035) inset;
  pointer-events: auto;
  z-index: 2;
}

.tutorial-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px;
  border-bottom: 1px solid rgba(120, 145, 171, 0.28);
  background: rgba(10, 20, 32, 0.98);
}

.tutorial-brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.tutorial-brand-icon,
.tutorial-step-icon,
.tutorial-hero-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(145deg, #3d8cff 0%, #1e57c8 100%);
  box-shadow: 0 8px 20px rgba(25, 94, 224, 0.28), inset 0 1px rgba(255, 255, 255, 0.26);
}

.tutorial-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 16px;
}

.tutorial-overline,
.tutorial-rail-label,
.tutorial-kicker,
.tutorial-preference-label {
  display: block;
  color: #8fbaff;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.tutorial-header-caption {
  display: block;
  margin-top: 3px;
  color: #aab8c8;
  font-size: 12px;
  line-height: 1.35;
}

.tutorial-icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(154, 178, 204, 0.38);
  border-radius: 11px;
  color: #d6e2ef;
  background: rgba(18, 35, 53, 0.74);
  cursor: pointer;
  font-size: 15px;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.tutorial-icon-button:hover,
.tutorial-icon-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.68);
  background: rgba(31, 56, 82, 0.94);
  outline: none;
  transform: translateY(-1px);
}

.tutorial-body {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.tutorial-rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 26px 18px 22px;
  background: rgba(5, 12, 20, 0.34);
  border-right: 1px solid rgba(120, 145, 171, 0.24);
}

.tutorial-rail-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px 14px;
}

.tutorial-step-count {
  color: #8f9eae;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 600;
}

.tutorial-step-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tutorial-step-link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 12px;
  align-items: center;
  width: 100%;
  min-height: 39px;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #9caebe;
  background: transparent;
  cursor: pointer;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.tutorial-step-link-number {
  color: #64778c;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.tutorial-step-link > i {
  color: #52677d;
  font-size: 9px;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.tutorial-step-link:hover,
.tutorial-step-link:focus-visible,
.tutorial-step-link.is-current {
  border-color: rgba(65, 138, 255, 0.35);
  color: #edf5ff;
  background: rgba(38, 101, 203, 0.16);
  outline: none;
}

.tutorial-step-link.is-current .tutorial-step-link-number {
  color: #82b6ff;
}

.tutorial-step-link:hover > i,
.tutorial-step-link:focus-visible > i,
.tutorial-step-link.is-current > i {
  color: #82b6ff;
  opacity: 1;
  transform: translateX(0);
}

.tutorial-rail-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: auto 8px 0;
  padding-top: 22px;
  border-top: 1px solid rgba(120, 145, 171, 0.18);
  color: #75869a;
  font-size: 11px;
  line-height: 1.5;
}

.tutorial-rail-note i {
  margin-top: 2px;
  color: #e3a939;
}

.tutorial-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 42px 46px 26px;
  overflow: auto;
}

.tutorial-view {
  min-width: 0;
}

.tutorial-offer-view {
  max-width: 650px;
  margin: auto 0;
}

.tutorial-hero-mark {
  width: 58px;
  height: 58px;
  margin-bottom: 28px;
  border-radius: 18px;
  font-size: 24px;
}

.tutorial-kicker {
  margin-bottom: 11px;
}

.tutorial-main h1 {
  margin: 0;
  color: #f5f8fc;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: clamp(29px, 3.2vw, 42px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.tutorial-description {
  max-width: 650px;
  margin: 16px 0 0;
  color: #b4c0ce;
  font-size: 15px;
  line-height: 1.65;
}

.tutorial-offer-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.tutorial-offer-points span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(117, 150, 186, 0.3);
  border-radius: 10px;
  color: #c9d6e4;
  background: rgba(18, 37, 57, 0.58);
  font-size: 12px;
  font-weight: 600;
}

.tutorial-offer-points i {
  color: #76aaff;
}

.tutorial-step-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 25px;
}

.tutorial-step-number {
  color: #80b5ff;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}

.tutorial-step-category {
  color: #8092a7;
  font-size: 12px;
  font-weight: 600;
}

.tutorial-step-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  border-radius: 16px;
  font-size: 19px;
}

.tutorial-step-details {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.tutorial-step-details li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #c4d0dd;
  font-size: 13px;
  line-height: 1.5;
}

.tutorial-step-details i {
  flex: 0 0 auto;
  margin-top: 4px;
  color: #67b8a5;
  font-size: 11px;
}

.tutorial-focus-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 610px;
  margin-top: 28px;
  padding: 13px 15px;
  border: 1px solid rgba(80, 144, 234, 0.28);
  border-radius: 12px;
  color: #a9c9f6;
  background: rgba(25, 76, 149, 0.16);
  font-size: 12px;
  line-height: 1.45;
}

.tutorial-focus-callout i {
  margin-top: 2px;
  color: #77afff;
}

.tutorial-footer {
  margin-top: auto;
  padding-top: 34px;
}

.tutorial-progress {
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(104, 130, 157, 0.25);
}

#tutorial-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2e79f7, #6ca9ff);
  transition: width 0.25s ease;
}

.tutorial-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 17px;
}

.tutorial-navigation-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tutorial-secondary-button,
.tutorial-primary-button,
.tutorial-save-button {
  min-height: 38px;
  border-radius: 10px;
  cursor: pointer;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tutorial-secondary-button {
  padding: 8px 12px;
  border: 1px solid transparent;
  color: #93a5b8;
  background: transparent;
}

.tutorial-secondary-button:hover,
.tutorial-secondary-button:focus-visible {
  border-color: rgba(120, 149, 180, 0.32);
  color: #e2ecf8;
  background: rgba(64, 92, 122, 0.18);
  outline: none;
}

.tutorial-primary-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border: 1px solid rgba(118, 176, 255, 0.72);
  color: #fff;
  background: linear-gradient(135deg, #3d8cff 0%, #245bd1 100%);
  box-shadow: 0 8px 18px rgba(26, 100, 230, 0.23), inset 0 1px rgba(255, 255, 255, 0.2);
}

.tutorial-primary-button:hover,
.tutorial-primary-button:focus-visible {
  border-color: #c4ddff;
  background: linear-gradient(135deg, #579bff 0%, #2b69e4 100%);
  outline: none;
  transform: translateY(-1px);
}

.tutorial-preference-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 18px;
  margin-top: 24px;
  padding-top: 17px;
  border-top: 1px solid rgba(120, 145, 171, 0.2);
}

.tutorial-preference-copy {
  min-width: 0;
}

.tutorial-preference-help {
  display: block;
  margin-top: 4px;
  color: #8191a3;
  font-size: 11px;
  line-height: 1.45;
}

.tutorial-preference-entry {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: min(270px, 100%);
  gap: 6px;
}

.tutorial-save-button {
  min-width: 180px;
  padding: 8px 14px;
  border: 1px solid rgba(113, 145, 180, 0.32);
  color: #93a7bd;
  background: rgba(33, 55, 79, 0.64);
}

.tutorial-save-button:not(:disabled):hover,
.tutorial-save-button:not(:disabled):focus-visible {
  border-color: rgba(126, 181, 255, 0.82);
  color: #fff;
  background: rgba(42, 102, 198, 0.78);
  outline: none;
}

.tutorial-save-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

body.tutorial-active .highlight {
  position: relative;
  z-index: 10001;
  outline: 2px solid #65a5ff !important;
  outline-offset: 6px;
  box-shadow: 0 0 0 10px rgba(52, 126, 245, 0.2), 0 0 30px rgba(55, 133, 255, 0.58) !important;
  animation: tutorialFocusPulse 1.35s ease-in-out infinite alternate;
}

@keyframes tutorialFocusPulse {
  from {
    filter: brightness(1);
  }
  to {
    filter: brightness(1.18);
  }
}

@media (max-width: 760px) {
  #tutorial-overlay {
    padding: 12px;
  }

  #tutorial-overlay .tutorial-content {
    width: min(100%, 620px);
    max-height: calc(100vh - 24px);
    border-radius: 18px;
  }

  .tutorial-header {
    padding: 17px 18px;
  }

  .tutorial-body {
    display: flex;
    flex-direction: column;
    overflow: auto;
  }

  .tutorial-rail {
    display: block;
    padding: 16px 14px 13px;
    border-right: 0;
    border-bottom: 1px solid rgba(120, 145, 171, 0.24);
  }

  .tutorial-rail-heading {
    padding: 0 4px 10px;
  }

  .tutorial-step-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 1px 0 4px;
    scrollbar-width: thin;
  }

  .tutorial-step-list li {
    flex: 0 0 auto;
  }

  .tutorial-step-link {
    grid-template-columns: 24px auto;
    width: auto;
    min-height: 34px;
    padding: 6px 9px;
  }

  .tutorial-step-link > i {
    display: none;
  }

  .tutorial-step-link-label {
    white-space: nowrap;
  }

  .tutorial-rail-note {
    display: none;
  }

  .tutorial-main {
    padding: 28px 22px 20px;
    overflow: visible;
  }

  .tutorial-hero-mark {
    margin-bottom: 20px;
  }

  .tutorial-main h1 {
    font-size: clamp(27px, 8vw, 36px);
  }

  .tutorial-description {
    font-size: 14px;
  }

  .tutorial-footer-actions,
  .tutorial-preference-form {
    align-items: stretch;
  }

  .tutorial-footer-actions {
    flex-direction: column-reverse;
  }

  .tutorial-navigation-actions {
    justify-content: flex-end;
  }

  .tutorial-preference-form {
    grid-template-columns: 1fr;
  }

  .tutorial-preference-entry {
    min-width: 0;
  }

  .tutorial-preference-entry input {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #tutorial-progress-bar,
  .tutorial-icon-button,
  .tutorial-step-link,
  .tutorial-primary-button,
  .tutorial-secondary-button,
  .tutorial-save-button,
  body.tutorial-active .highlight {
    transition: none !important;
    animation: none !important;
  }
}

/* ========================================================================
   Compact tutorial widget

   The guide is intentionally non-modal: the command rail remains visible,
   the stream wall stays interactive outside the widget, and the walkthrough
   follows the rail instead of covering the workspace.
   ======================================================================== */
#tutorial-overlay {
  inset: 0;
  display: block;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
  z-index: 1300;
}

#tutorial-overlay .tutorial-backdrop {
  display: none;
}

#tutorial-overlay .tutorial-content {
  position: fixed;
  top: 92px;
  left: calc(var(--left-nav-expanded-width) + 14px);
  width: min(360px, calc(100vw - var(--left-nav-expanded-width) - 28px));
  max-height: min(620px, calc(100vh - 104px));
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.035) inset;
  pointer-events: auto;
  z-index: 1402;
}

body.left-nav-layout:not(.menu-open) #tutorial-overlay .tutorial-content {
  left: calc(var(--left-nav-collapsed-width) + 14px);
  width: min(360px, calc(100vw - var(--left-nav-collapsed-width) - 28px));
}

body.top-nav-layout #tutorial-overlay .tutorial-content {
  top: 82px;
  right: 16px;
  left: auto;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 98px);
}

.tutorial-header {
  gap: 10px;
  padding: 14px 16px;
}

.tutorial-brand-lockup {
  gap: 9px;
}

.tutorial-brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 13px;
}

.tutorial-overline {
  font-size: 9px;
  letter-spacing: 0.12em;
}

.tutorial-header-caption {
  font-size: 10px;
}

.tutorial-icon-button {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 12px;
}

.tutorial-body {
  display: block;
  overflow: visible;
}

.tutorial-rail {
  display: none;
}

.tutorial-main {
  padding: 20px 18px 16px;
  overflow: visible;
}

.tutorial-offer-view {
  max-width: none;
  margin: 0;
}

.tutorial-hero-mark {
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 13px;
  font-size: 17px;
}

.tutorial-kicker {
  margin-bottom: 8px;
  font-size: 9px;
}

.tutorial-main h1 {
  font-size: 24px;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.tutorial-description {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.tutorial-offer-points {
  gap: 6px;
  margin-top: 16px;
}

.tutorial-offer-points span {
  min-height: 27px;
  padding: 5px 7px;
  gap: 6px;
  border-radius: 8px;
  font-size: 10px;
}

.tutorial-step-meta {
  gap: 8px;
  margin-bottom: 14px;
}

.tutorial-step-number {
  font-size: 11px;
}

.tutorial-step-category {
  font-size: 10px;
}

.tutorial-step-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 12px;
  font-size: 16px;
}

.tutorial-step-details {
  gap: 7px;
  margin-top: 15px;
}

.tutorial-step-details li {
  gap: 7px;
  font-size: 11px;
  line-height: 1.42;
}

.tutorial-step-details i {
  margin-top: 3px;
  font-size: 9px;
}

.tutorial-focus-callout {
  gap: 8px;
  max-width: none;
  margin-top: 16px;
  padding: 10px 11px;
  border-radius: 10px;
  font-size: 10.5px;
  line-height: 1.4;
}

.tutorial-footer {
  padding-top: 22px;
}

.tutorial-progress {
  height: 2px;
}

.tutorial-footer-actions {
  gap: 8px;
  margin-top: 11px;
}

.tutorial-secondary-button,
.tutorial-primary-button,
.tutorial-save-button {
  min-height: 32px;
  border-radius: 8px;
  font-size: 11px;
}

.tutorial-secondary-button {
  padding: 6px 9px;
}

.tutorial-primary-button {
  gap: 6px;
  padding: 7px 11px;
}

.tutorial-preference-form {
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 15px;
  padding-top: 12px;
}

.tutorial-preference-help {
  margin-top: 3px;
  font-size: 10px;
}

.tutorial-preference-entry {
  min-width: 0;
  width: 100%;
}

.tutorial-save-button {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 7px 9px;
}

body.tutorial-active .highlight {
  z-index: 1401;
}

@media (max-width: 760px) {
  #tutorial-overlay .tutorial-content {
    top: auto;
    bottom: 12px;
    left: calc(var(--left-nav-collapsed-width) + 10px);
    width: min(300px, calc(100vw - var(--left-nav-collapsed-width) - 20px));
    max-height: min(560px, calc(100vh - 92px));
  }

  body.left-nav-layout.tutorial-active {
    grid-template-columns: var(--left-nav-collapsed-width) minmax(0, 1fr);
  }

  body.left-nav-layout.tutorial-active .navbar,
  body.left-nav-layout.tutorial-active .navbar.expanded,
  body.left-nav-layout.tutorial-active .navbar.expanded:hover {
    width: var(--left-nav-collapsed-width);
  }

  body.left-nav-layout.tutorial-active .navbar .nav-buttons,
  body.left-nav-layout.tutorial-active .navbar.expanded .nav-buttons {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
  }
}

/* ========================================================================
   Collapsed command rail dock

   Treat the initial compact state as a deliberate navigation dock instead of
   leaving two unrelated controls floating in an empty strip. Keep all effects
   inside the rail so Twitch surfaces in the adjacent column stay unobscured.
   ======================================================================== */
body.left-nav-layout .navbar.menu-collapsed,
body.left-nav-layout .navbar.menu-collapsed:hover {
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 56px, rgba(255, 255, 255, 0.075), transparent 86px),
    linear-gradient(180deg, #101012 0%, #09090b 42%, #060607 100%) !important;
  border-right: 1px solid rgba(218, 218, 218, 0.22) !important;
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.035) !important;
}

/* A small orientation label identifies the compact dock without changing any
   of the expanded navigation copy. In the collapsed header it owns a real
   two-line row above the logo so neither word can be clipped. */
body.left-nav-layout .collapsed-rail-title {
  position: absolute;
  top: -3px;
  left: 50%;
  z-index: 4;
  display: block;
  color: rgba(244, 244, 244, 0.72);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, 4px);
  transition:
    opacity 180ms ease,
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    color 180ms ease;
  visibility: hidden;
  white-space: nowrap;
}

/* ========================================================================
   Density-aware stream controls

   The grid already chooses each tile's rendered dimensions. Mirror those
   dimensions in the overlay controls so a large roster keeps more of every
   stream visible. Fine-pointer users get two restrained reductions; touch
   layouts retain the larger targets above.
   ======================================================================== */
@media (hover: hover) and (pointer: fine) {
  body.popup-mode #streamsGrid.overview-fit {
    --stream-tile-top-rail-height: 52px;
    --stream-tile-bottom-rail-height: 54px;
    --stream-tile-top-rail-padding: 7px 10px;
    --stream-tile-bottom-rail-padding: 8px 10px 10px;
    --stream-tile-title-height: 36px;
    --stream-tile-title-padding: 10px;
    --stream-tile-title-gap: 4px;
    --stream-tile-title-font-size: clamp(11px, 0.95vw, 14px);
    --stream-tile-title-end-space: 54px;
    --stream-tile-team-title-end-space: 92px;
    --stream-tile-close-size: 27px;
    --stream-tile-close-top: 8px;
    --stream-tile-close-right: 10px;
    --stream-tile-close-font-size: 12px;
    --stream-tile-team-action-right: 44px;
    --stream-tile-action-height: 34px;
    --stream-tile-action-min-width: 76px;
    --stream-tile-action-padding: 12px;
    --stream-tile-action-gap: 9px;
    --stream-tile-action-font-size: 12px;
    --stream-tile-label-line-height: 18px;
  }

  body.popup-mode #streamsGrid.overview-fit[data-stream-control-density="compact"] {
    --stream-tile-top-rail-height: 46px;
    --stream-tile-bottom-rail-height: 46px;
    --stream-tile-top-rail-padding: 5px 8px;
    --stream-tile-bottom-rail-padding: 6px 8px 8px;
    --stream-tile-title-height: 31px;
    --stream-tile-title-padding: 9px;
    --stream-tile-title-gap: 4px;
    --stream-tile-title-font-size: 13px;
    --stream-tile-title-end-space: 46px;
    --stream-tile-team-title-end-space: 76px;
    --stream-tile-close-size: 24px;
    --stream-tile-close-top: 6px;
    --stream-tile-close-right: 8px;
    --stream-tile-close-font-size: 11px;
    --stream-tile-team-action-right: 38px;
    --stream-tile-action-height: 30px;
    --stream-tile-action-min-width: 68px;
    --stream-tile-action-padding: 10px;
    --stream-tile-action-gap: 7px;
    --stream-tile-action-font-size: 10.5px;
    --stream-tile-label-line-height: 16px;
  }

  body.popup-mode #streamsGrid.overview-fit[data-stream-control-density="tight"] {
    --stream-tile-top-rail-height: 40px;
    --stream-tile-bottom-rail-height: 40px;
    --stream-tile-top-rail-padding: 4px 6px;
    --stream-tile-bottom-rail-padding: 5px 6px 6px;
    --stream-tile-title-height: 27px;
    --stream-tile-title-padding: 7px;
    --stream-tile-title-gap: 3px;
    --stream-tile-title-font-size: 11px;
    --stream-tile-title-end-space: 39px;
    --stream-tile-team-title-end-space: 64px;
    --stream-tile-close-size: 21px;
    --stream-tile-close-top: 5px;
    --stream-tile-close-right: 6px;
    --stream-tile-close-font-size: 10px;
    --stream-tile-team-action-right: 32px;
    --stream-tile-action-height: 26px;
    --stream-tile-action-min-width: 58px;
    --stream-tile-action-padding: 8px;
    --stream-tile-action-gap: 5px;
    --stream-tile-action-font-size: 9.5px;
    --stream-tile-label-line-height: 14px;
  }

  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--top {
    height: var(--stream-tile-top-rail-height) !important;
    min-height: var(--stream-tile-top-rail-height) !important;
    padding: var(--stream-tile-top-rail-padding) !important;
  }

  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--bottom {
    height: var(--stream-tile-bottom-rail-height) !important;
    min-height: var(--stream-tile-bottom-rail-height) !important;
    padding: var(--stream-tile-bottom-rail-padding) !important;
  }

  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .stream-name {
    max-width: calc(100% - var(--stream-tile-title-end-space)) !important;
    height: var(--stream-tile-title-height) !important;
    min-height: var(--stream-tile-title-height) !important;
    padding-inline: var(--stream-tile-title-padding) !important;
    column-gap: var(--stream-tile-title-gap) !important;
    font-size: var(--stream-tile-title-font-size) !important;
  }

  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card.team-stream-card
    > .twitch-card-rail--top
    .stream-name {
    max-width: calc(100% - var(--stream-tile-team-title-end-space)) !important;
  }

  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .stream-name-label {
    min-height: var(--stream-tile-label-line-height) !important;
    line-height: var(--stream-tile-label-line-height) !important;
  }

  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .remove-button {
    top: var(--stream-tile-close-top) !important;
    right: var(--stream-tile-close-right) !important;
    flex-basis: var(--stream-tile-close-size) !important;
    width: var(--stream-tile-close-size) !important;
    height: var(--stream-tile-close-size) !important;
    min-height: var(--stream-tile-close-size) !important;
    max-height: var(--stream-tile-close-size) !important;
    font-size: var(--stream-tile-close-font-size) !important;
  }

  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .team-edit-button {
    top: var(--stream-tile-close-top) !important;
    right: var(--stream-tile-team-action-right) !important;
    flex-basis: var(--stream-tile-close-size);
    width: var(--stream-tile-close-size);
    height: var(--stream-tile-close-size);
    min-height: var(--stream-tile-close-size);
    font-size: var(--stream-tile-close-font-size);
  }

  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--bottom
    .pip-button,
  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--bottom
    .clip-button {
    min-width: var(--stream-tile-action-min-width) !important;
    height: var(--stream-tile-action-height) !important;
    min-height: var(--stream-tile-action-height) !important;
    padding-inline: var(--stream-tile-action-padding) !important;
    gap: var(--stream-tile-action-gap) !important;
    font-size: var(--stream-tile-action-font-size) !important;
  }
}

/* Keep the selected PIP action available even after the pointer leaves its
   stream card. This is the controller's persistent indicator and close action
   for the PIP that is currently on the Live Window. */
body.popup-mode #streamsGrid .stream.has-active-pip .pip-button.active-pip {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

@media (hover: hover) and (pointer: fine) {
  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card.has-active-pip
    > .twitch-card-rail--bottom {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }
}

/* ========================================================================
   Cursor semantics

   The stream surface can still activate its player when clicked, but it is
   intentionally not presented as one giant button. Reserve the hand cursor
   for the controls and the small custom clickable labels inside the tile.
   ======================================================================== */
body.popup-mode #streamsGrid .stream,
body.popup-mode #streamsGrid .stream:hover {
  cursor: default;
}

body.popup-mode #streamsGrid .stream button:not(:disabled),
body.popup-mode #streamsGrid .stream [role="button"]:not([aria-disabled="true"]),
body.popup-mode #streamsGrid .stream .stream-number {
  cursor: pointer;
}

body.popup-mode #streamsGrid .stream button:disabled,
body.popup-mode #streamsGrid .stream [role="button"][aria-disabled="true"] {
  cursor: not-allowed;
}

/* ========================================================================
   Team stream composer placement and repeatable sources
   ======================================================================== */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.left-nav-layout .stream-composer-host,
body.left-nav-layout .stream-composer-host #addStreamForm {
  width: 100%;
  min-width: 0;
}

body.left-nav-layout .stream-composer-host[hidden],
body.left-nav-layout #individualStreamSourceField[hidden],
body.left-nav-layout .team-member-fields[hidden],
body.left-nav-layout .team-member-add-button[hidden] {
  display: none !important;
}

body.left-nav-layout .stream-composer-host--team {
  margin: 0;
  padding: 10px;
  overflow: visible;
  border-color: rgba(110, 153, 244, 0.34);
  background: linear-gradient(180deg, rgba(24, 31, 46, 0.92), rgba(15, 18, 26, 0.96));
}

body.left-nav-layout .control-group-shell--streams.stream-composer-away {
  padding-top: 0;
}

body.left-nav-layout
  .control-group-shell--streams.stream-composer-away
  .control-row-group--stream-actions {
  margin-top: 0;
  border-top: 0;
}

body.left-nav-layout #addStreamForm:has(.stream-type-chooser:not([hidden])) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
  gap: 7px;
}

body.left-nav-layout #addStreamForm .control-input-shell > input {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 0 11px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--left-rail-text);
  font: inherit;
  font-size: 12px;
}

body.left-nav-layout #addStreamForm .control-input-shell > input::placeholder {
  color: #8e8c90;
  opacity: 1;
}

body.left-nav-layout #addStreamForm .control-input-shell:focus-within {
  border-color: rgba(111, 151, 244, 0.9);
  box-shadow: 0 0 0 2px rgba(71, 111, 203, 0.2);
}

body.left-nav-layout .team-member-fields {
  display: grid;
  gap: 6px;
  min-width: 0;
}

body.left-nav-layout .team-member-fields-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
  color: rgba(229, 234, 244, 0.92);
  font-size: 10.5px;
  font-weight: 700;
}

body.left-nav-layout .team-member-fields-heading > :last-child {
  color: rgba(205, 215, 231, 0.58);
  font-size: 9.5px;
  font-weight: 500;
}

body.left-nav-layout .team-member-source-row,
body.left-nav-layout .team-member-source-shell {
  min-width: 0;
}

body.left-nav-layout .team-member-source-shell {
  height: 40px !important;
  min-height: 40px !important;
}

body.left-nav-layout .team-member-source-index {
  display: grid;
  place-items: center;
  align-self: stretch;
  flex: 0 0 34px;
  width: 34px;
  border-right: 1px solid var(--left-rail-divider);
  color: rgba(214, 220, 231, 0.72);
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

body.left-nav-layout #addStreamForm .team-member-source-input {
  height: 38px !important;
}

body.left-nav-layout #addStreamForm .team-member-source-remove {
  display: grid;
  place-items: center;
  align-self: stretch;
  flex: 0 0 38px;
  width: 38px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--left-rail-divider);
  background: rgba(91, 35, 39, 0.4);
  color: #f2b4b6;
  box-shadow: none;
  transform: none;
  cursor: pointer;
}

body.left-nav-layout
  #addStreamForm
  .team-member-source-remove:hover:not(:disabled) {
  background: rgba(143, 49, 55, 0.66);
  color: #fff;
  box-shadow: none;
  transform: none;
}

body.left-nav-layout #addStreamForm .team-member-source-remove:focus-visible,
body.left-nav-layout #addStreamForm .team-member-add-button:focus-visible {
  outline: 2px solid #b9d7ff;
  outline-offset: 2px;
}

body.left-nav-layout #addStreamForm .team-member-source-remove:disabled {
  opacity: 0.3;
  cursor: default;
}

body.left-nav-layout #addStreamForm .team-member-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 32px;
  gap: 7px;
  padding: 0 10px;
  border: 1px dashed rgba(132, 157, 205, 0.48);
  border-radius: 7px;
  background: rgba(42, 58, 87, 0.34);
  color: rgba(226, 234, 247, 0.9);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  box-shadow: none;
  transform: none;
  cursor: pointer;
}

body.left-nav-layout #addStreamForm .team-member-add-button:hover {
  border-color: rgba(139, 174, 241, 0.82);
  background: rgba(53, 82, 139, 0.46);
  color: #fff;
  box-shadow: none;
  transform: none;
}

body.left-nav-layout #addStreamForm .control-input-shell > input:focus {
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

/* Individual stream discovery stays inside the existing composer language:
   quiet blue surfaces, compact cards, and a clear Enter-to-add fast path. The
   Team composer never renders this section, so its layout remains unchanged. */
body.left-nav-layout .stream-discovery {
  display: grid;
  gap: 9px;
  min-width: 0;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(143, 171, 218, 0.2);
}

body.left-nav-layout .stream-discovery[hidden],
body.left-nav-layout .stream-discovery-panel[hidden],
body.left-nav-layout .stream-discovery-clear[hidden] {
  display: none !important;
}

body.left-nav-layout .stream-discovery-header,
body.left-nav-layout .stream-discovery-results-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

body.left-nav-layout .stream-discovery-kicker {
  color: #a9c6f5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.left-nav-layout .stream-discovery-copy {
  max-width: 290px;
  margin: 3px 0 0;
  color: rgba(207, 219, 238, 0.66);
  font-size: 10px;
  line-height: 1.35;
}

body.left-nav-layout .stream-discovery-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(143, 171, 218, 0.24);
  border-radius: 8px;
  background: rgba(6, 11, 19, 0.46);
}

body.left-nav-layout .stream-discovery-tab,
body.left-nav-layout .stream-discovery-refresh,
body.left-nav-layout .stream-discovery-clear {
  border: 1px solid transparent;
  background: transparent;
  color: rgba(210, 222, 242, 0.68);
  font: inherit;
  cursor: pointer;
}

body.left-nav-layout .stream-discovery-tab {
  min-height: 25px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

body.left-nav-layout .stream-discovery-tab:hover,
body.left-nav-layout .stream-discovery-tab:focus-visible,
body.left-nav-layout .stream-discovery-tab.is-active {
  color: #f4f8ff;
  border-color: rgba(123, 167, 239, 0.46);
  background: rgba(64, 102, 166, 0.48);
  outline: none;
}

body.left-nav-layout .stream-discovery-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
}

body.left-nav-layout .stream-discovery-search-shell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(139, 163, 200, 0.36);
  border-radius: 8px;
  background: rgba(5, 10, 18, 0.72);
}

body.left-nav-layout .stream-discovery-search-shell:focus-within {
  border-color: rgba(111, 151, 244, 0.84);
  box-shadow: 0 0 0 2px rgba(71, 111, 203, 0.18);
}

body.left-nav-layout .stream-discovery-search-shell > i {
  flex: 0 0 auto;
  color: rgba(177, 202, 241, 0.68);
  font-size: 11px;
}

body.left-nav-layout .stream-discovery-search-shell > input {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f2f6ff;
  font: inherit;
  font-size: 11px;
}

body.left-nav-layout .stream-discovery-search-shell > input::placeholder {
  color: rgba(169, 181, 201, 0.62);
}

body.left-nav-layout .stream-discovery-clear {
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  font-size: 11px;
}

body.left-nav-layout .stream-discovery-clear:hover,
body.left-nav-layout .stream-discovery-clear:focus-visible,
body.left-nav-layout .stream-discovery-refresh:hover,
body.left-nav-layout .stream-discovery-refresh:focus-visible {
  color: #fff;
  border-color: rgba(139, 174, 241, 0.56);
  background: rgba(53, 82, 139, 0.46);
  outline: none;
}

body.left-nav-layout .stream-discovery-category-grid,
body.left-nav-layout .stream-discovery-stream-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 258px;
  padding-right: 2px;
  overflow-y: auto;
  scrollbar-color: #4b6289 transparent;
  scrollbar-width: thin;
}

body.left-nav-layout .stream-discovery-category,
body.left-nav-layout .stream-discovery-stream {
  min-width: 0;
  border: 1px solid rgba(125, 153, 199, 0.24);
  border-radius: 8px;
  background: rgba(19, 29, 45, 0.76);
}

body.left-nav-layout .stream-discovery-category {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 51px;
  padding: 6px;
  color: #e9f1ff;
  text-align: left;
  cursor: pointer;
}

body.left-nav-layout .stream-discovery-category:hover,
body.left-nav-layout .stream-discovery-category:focus-visible {
  border-color: rgba(124, 170, 244, 0.7);
  background: rgba(39, 65, 105, 0.82);
  outline: none;
}

body.left-nav-layout .stream-discovery-category-art {
  display: block;
  width: 34px;
  height: 42px;
  overflow: hidden;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(96, 126, 183, 0.7), rgba(31, 41, 60, 0.8));
  object-fit: cover;
}

body.left-nav-layout .stream-discovery-category-copy,
body.left-nav-layout .stream-discovery-stream-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

body.left-nav-layout .stream-discovery-category-name,
body.left-nav-layout .stream-discovery-stream-name {
  overflow: hidden;
  color: #f1f6ff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.left-nav-layout .stream-discovery-category-meta,
body.left-nav-layout .stream-discovery-stream-meta {
  overflow: hidden;
  color: rgba(188, 207, 237, 0.66);
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.left-nav-layout .stream-discovery-results-heading {
  align-items: center;
  color: rgba(222, 233, 251, 0.84);
  font-size: 10.5px;
  font-weight: 800;
}

body.left-nav-layout .stream-discovery-refresh {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 750;
}

body.left-nav-layout .stream-discovery-stream {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 6px;
}

body.left-nav-layout .stream-discovery-stream-thumb {
  display: block;
  width: 74px;
  height: 42px;
  overflow: hidden;
  border-radius: 5px;
  background: #0a101c;
  object-fit: cover;
}

body.left-nav-layout .stream-discovery-stream-copy {
  gap: 4px;
}

body.left-nav-layout .stream-discovery-stream-title {
  overflow: hidden;
  color: rgba(217, 228, 246, 0.72);
  font-size: 9px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.left-nav-layout .stream-discovery-stream-viewers {
  color: #80eda9;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

body.left-nav-layout .stream-discovery-add {
  display: grid;
  flex: 0 0 27px;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid rgba(122, 174, 241, 0.56);
  border-radius: 7px;
  background: rgba(49, 91, 153, 0.7);
  color: #f4f8ff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

body.left-nav-layout .stream-discovery-add:hover,
body.left-nav-layout .stream-discovery-add:focus-visible {
  border-color: #d7e8ff;
  background: #4d83cd;
  outline: none;
  transform: translateY(-1px);
}

body.left-nav-layout .stream-discovery-status {
  min-height: 0;
  margin: 0;
  color: rgba(188, 207, 237, 0.68);
  font-size: 10px;
  line-height: 1.35;
}

body.left-nav-layout .stream-discovery-status[data-state="error"] {
  color: #ffc8c8;
}

body.left-nav-layout .stream-discovery-status[data-state="success"] {
  color: #9aefb7;
}

body.left-nav-layout .stream-discovery-state {
  grid-column: 1 / -1;
  padding: 12px 10px;
  color: rgba(188, 207, 237, 0.7);
  border: 1px dashed rgba(125, 153, 199, 0.28);
  border-radius: 8px;
  background: rgba(10, 17, 28, 0.48);
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
}

body.left-nav-layout .stream-discovery-state[data-state="error"] {
  color: #ffc8c8;
  border-color: rgba(215, 104, 104, 0.38);
  background: rgba(125, 37, 37, 0.18);
}

body.left-nav-layout .stream-discovery-retry {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 8px;
  color: #eaf3ff;
  border: 1px solid rgba(122, 174, 241, 0.56);
  border-radius: 6px;
  background: rgba(49, 91, 153, 0.7);
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

body.left-nav-layout .stream-discovery-retry:hover,
body.left-nav-layout .stream-discovery-retry:focus-visible {
  border-color: #d7e8ff;
  background: #4d83cd;
  outline: none;
}

/* The legacy Control Center stylesheet styles every button inside
   #addStreamForm with the old pink secondary color. Keep discovery controls
   on the active blue rail palette and give them back their compact geometry
   after that broad rule has been applied. */
body.left-nav-layout #addStreamForm .stream-discovery-tab,
body.left-nav-layout #addStreamForm .stream-discovery-refresh,
body.left-nav-layout #addStreamForm .stream-discovery-clear,
body.left-nav-layout #addStreamForm .stream-discovery-add,
body.left-nav-layout #addStreamForm .stream-discovery-retry {
  appearance: none;
  box-sizing: border-box;
  border: 1px solid rgba(122, 174, 241, 0.56);
  background: rgba(49, 91, 153, 0.7);
  color: #f4f8ff;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: none;
  transform: none;
}

body.left-nav-layout #addStreamForm .stream-discovery-tab:hover,
body.left-nav-layout #addStreamForm .stream-discovery-tab:focus-visible,
body.left-nav-layout #addStreamForm .stream-discovery-tab.is-active,
body.left-nav-layout #addStreamForm .stream-discovery-refresh:hover,
body.left-nav-layout #addStreamForm .stream-discovery-refresh:focus-visible,
body.left-nav-layout #addStreamForm .stream-discovery-clear:hover,
body.left-nav-layout #addStreamForm .stream-discovery-clear:focus-visible,
body.left-nav-layout #addStreamForm .stream-discovery-retry:hover,
body.left-nav-layout #addStreamForm .stream-discovery-retry:focus-visible {
  border-color: rgba(215, 232, 255, 0.9);
  background: linear-gradient(180deg, #3d82de 0%, #285eaf 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(30, 86, 172, 0.22);
  outline: none;
  transform: none;
}

body.left-nav-layout #addStreamForm .stream-discovery-tab.is-active {
  background: linear-gradient(180deg, var(--cc-blue, #2e79f7) 0%, #2558b4 100%);
}

body.left-nav-layout #addStreamForm .stream-discovery-tab {
  display: inline-flex;
  min-height: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

body.left-nav-layout #addStreamForm .stream-discovery-refresh {
  display: inline-flex;
  min-height: 25px;
  height: 25px;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

body.left-nav-layout #addStreamForm .stream-discovery-clear {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  place-items: center;
  padding: 0;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}

body.left-nav-layout #addStreamForm .stream-discovery-retry {
  display: inline-flex;
  min-height: 23px;
  height: 23px;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

body.left-nav-layout #addStreamForm .stream-discovery-add {
  display: grid;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  min-height: 27px;
  place-items: center;
  padding: 0;
  border-radius: 7px;
  background: linear-gradient(180deg, var(--cc-blue, #2e79f7) 0%, #2558b4 100%);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

body.left-nav-layout #addStreamForm .stream-discovery-add:hover,
body.left-nav-layout #addStreamForm .stream-discovery-add:focus-visible {
  border-color: #ffffff;
  background: linear-gradient(180deg, #4e93f2 0%, #2d6ac5 100%);
  box-shadow: 0 4px 12px rgba(30, 86, 172, 0.28);
  outline: none;
  transform: translateY(-1px);
}

body.left-nav-layout #addStreamForm .stream-discovery-add:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

@media (max-width: 720px) {
  body.left-nav-layout .stream-discovery-header {
    display: grid;
  }

  body.left-nav-layout .stream-discovery-tabs {
    justify-self: start;
  }
}

@media (max-height: 820px) {
  body.left-nav-layout .stream-discovery-category-grid,
  body.left-nav-layout .stream-discovery-stream-grid {
    max-height: 190px;
  }
}

@media (max-height: 820px) {
  body.left-nav-layout .stream-composer-host--team {
    padding: 8px;
  }

  body.left-nav-layout .team-member-source-shell {
    height: 36px !important;
    min-height: 36px !important;
  }

  body.left-nav-layout #addStreamForm .team-member-source-input {
    height: 34px !important;
  }

  body.left-nav-layout #addStreamForm .team-member-add-button {
    min-height: 29px;
  }
}

/* ========================================================================
   Team Streams
   ======================================================================== */

body.left-nav-layout .stream-type-chooser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 3px;
  border: 1px solid rgba(142, 159, 188, 0.26);
  border-radius: 7px;
  background: rgba(4, 8, 14, 0.42);
}

body.left-nav-layout .stream-type-chooser[hidden],
body.left-nav-layout .team-name-field[hidden] {
  display: none !important;
}

body.left-nav-layout .stream-type-chooser legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.left-nav-layout .stream-type-chooser label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 27px;
  padding: 0 6px;
  color: rgba(222, 230, 242, 0.72);
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

body.left-nav-layout .stream-type-chooser input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

body.left-nav-layout .stream-type-chooser label:has(input:checked) {
  color: #fff;
  border-color: rgba(110, 153, 244, 0.64);
  background: rgba(55, 95, 178, 0.7);
}

body.left-nav-layout .stream-type-chooser label:has(input:focus-visible) {
  outline: 2px solid #b9d7ff;
  outline-offset: 2px;
}

body.left-nav-layout #addStreamForm:has(.stream-type-chooser:not([hidden])) {
  display: grid;
  gap: 6px;
}

.team-stream-card {
  isolation: isolate;
}

.team-stream-card.team-menu-open {
  z-index: 120 !important;
  overflow: visible !important;
}

/* Team pickers are direct children of their stream card. The compact overview
   intentionally clips settled cards and large-roster playback enables paint
   containment, so an open picker needs to opt out of both for its popout to
   remain visible over the neighboring stream tiles. */
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.team-stream-card.team-menu-open {
  z-index: 1000 !important;
  overflow: visible !important;
  contain: none !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.team-stream-card
  > .twitch-card-rail--top
  .stream-name {
  max-width: calc(100% - 92px) !important;
}

.team-member-picker .team-stream-labels {
  display: grid;
  min-width: 0;
  line-height: 1;
  text-align: left;
}

.team-member-picker .team-name-label {
  overflow: hidden;
  color: rgba(189, 207, 235, 0.66);
  font-size: 0.67em;
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.team-member-picker .stream-name-label {
  min-height: 0 !important;
  line-height: 1.12 !important;
}

.team-picker-chevron {
  flex: 0 0 auto;
  margin-left: 2px;
  color: rgba(201, 216, 239, 0.66);
  font-size: 9px;
  transition: transform 160ms ease;
}

.team-menu-open .team-picker-chevron {
  transform: rotate(180deg);
}

.team-member-menu {
  position: absolute;
  z-index: 180;
  top: 48px;
  left: 10px;
  display: grid;
  /* The picker belongs to a compact stream card, but its menu should still
     have enough room to show complete Twitch channel names. */
  width: min(320px, calc(100vw - 24px));
  max-height: min(330px, calc(100vh - 120px));
  padding: 6px;
  overflow-y: auto;
  color: #eef4ff;
  border: 1px solid rgba(153, 181, 224, 0.52);
  border-radius: 9px;
  background: rgba(10, 17, 28, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(14px);
}

.team-member-menu.is-flipped {
  left: auto;
  right: 10px;
}

.team-member-menu[hidden] {
  display: none !important;
}

.team-member-menu-heading {
  padding: 6px 8px 7px;
  color: rgba(178, 198, 229, 0.7);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.team-member-option {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 38px;
  padding: 7px 9px;
  color: #e8eef8;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.team-member-option:hover,
.team-member-option:focus-visible {
  color: #fff;
  border-color: rgba(120, 168, 239, 0.48);
  background: rgba(57, 91, 147, 0.42);
  outline: none;
}

.team-member-option-indicator {
  width: 7px;
  height: 7px;
  border: 1px solid rgba(183, 203, 232, 0.55);
  border-radius: 50%;
}

.team-member-option[data-live-state="live"] .team-member-option-indicator {
  border-color: #7ff0a8;
  background: #35d775;
  box-shadow: 0 0 8px rgba(53, 215, 117, 0.68);
}

.team-member-option[data-live-state="offline"] .team-member-option-indicator {
  border-color: #ff9b9b;
  background: #ef5963;
  box-shadow: 0 0 8px rgba(239, 89, 99, 0.58);
}

.team-member-option[data-live-state="unknown"] .team-member-option-indicator {
  border-color: rgba(183, 203, 232, 0.55);
  background: transparent;
  box-shadow: none;
}

.team-member-option-label {
  min-width: 0;
  overflow: visible;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

/* ========================================================================
   Corner-docked stream controls
   Anchor each primary control to its matching tile corner. The shared radius
   keeps the controls visually aligned with the stream window at every grid
   density, while corner-based transform origins keep hover motion in-bounds.
   ======================================================================== */
body.popup-mode #streamsGrid.overview-fit > .stream.twitch-stream-card {
  --stream-card-corner-radius: 10px;
  --stream-tile-top-rail-padding: 0;
  --stream-tile-bottom-rail-padding: 0;
  --stream-tile-close-top: 0;
  --stream-tile-close-right: 0;
  border-radius: var(--stream-card-corner-radius) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom {
  padding: 0 !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name {
  position: absolute !important;
  inset: 0 auto auto 0 !important;
  margin: 0 !important;
  border-radius: var(--stream-card-corner-radius) !important;
  transform-origin: top left;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .remove-button {
  inset: 0 0 auto auto !important;
  margin: 0 !important;
  border-radius: var(--stream-card-corner-radius) !important;
  transform-origin: top right;
}

/* The settled Twitch card marker adds enough specificity for the shared
   corner radius to survive later legacy close-button color refinements. */
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-overview-card
  > .twitch-card-rail.twitch-card-rail--top
  .remove-button {
  border-radius: var(--stream-card-corner-radius) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .pip-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .clip-button {
  position: absolute !important;
  top: auto !important;
  bottom: 0 !important;
  margin: 0 !important;
  border-radius: var(--stream-card-corner-radius) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .pip-button {
  right: auto !important;
  left: 0 !important;
  transform-origin: bottom left;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .clip-button {
  right: 0 !important;
  left: auto !important;
  transform-origin: bottom right;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name:focus-visible {
  transform: scale(1.01) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .remove-button:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .remove-button:focus-visible {
  transform: scale(1.04) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-overview-card
  > .twitch-card-rail.twitch-card-rail--top
  .remove-button:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-overview-card
  > .twitch-card-rail.twitch-card-rail--top
  .remove-button:focus-visible {
  transform: scale(1.04) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .pip-button:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .pip-button:focus-visible,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .clip-button:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  .clip-button:focus-visible {
  transform: scale(1.025) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  .stream-name:focus-visible,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  .remove-button:focus-visible,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  .pip-button:focus-visible,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  .clip-button:focus-visible {
  outline-offset: -3px;
}

.team-member-option-state {
  color: rgba(190, 205, 226, 0.58);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.team-edit-button {
  display: inline-grid;
  flex: 0 0 27px;
  place-items: center;
  width: 27px;
  height: 27px;
  min-height: 27px;
  padding: 0;
  color: #dce9ff;
  border: 1px solid rgba(126, 162, 219, 0.5);
  border-radius: 6px;
  background: rgba(41, 71, 118, 0.88);
  box-shadow: 0 3px 9px rgba(10, 27, 55, 0.34);
  opacity: 1 !important;
  pointer-events: auto !important;
  cursor: pointer;
}

body.popup-mode .twitch-card-rail--top .team-edit-button {
  position: absolute;
  z-index: 24;
  top: 8px;
  right: 44px;
}

body.popup-mode .team-stream-card:not(.twitch-stream-card) > .team-edit-button {
  position: absolute;
  z-index: 24;
  top: 10px;
  right: 52px;
}

.team-edit-button .stream-control-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.team-edit-button:hover,
.team-edit-button:focus-visible {
  color: #fff;
  border-color: #b9d7ff;
  background: #365f9f;
  outline: 2px solid rgba(185, 215, 255, 0.28);
  outline-offset: 2px;
}

.stream-autoplay-pending .team-edit-button,
.stream-playback-staging .team-edit-button,
.stream-playback-loading .team-edit-button,
.stream-removing .team-edit-button {
  opacity: 0 !important;
  pointer-events: none !important;
}

.team-editor-dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  color: #eef4ff;
  border: 1px solid rgba(135, 165, 211, 0.5);
  border-radius: 14px;
  background: #101722;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.68);
}

.team-editor-dialog::backdrop {
  background: rgba(1, 4, 9, 0.74);
  backdrop-filter: blur(5px);
}

.team-editor-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.team-editor-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.team-editor-kicker {
  color: #83aef3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.team-editor-header h2 {
  margin: 4px 0 0;
  font-size: 22px;
}

.team-editor-icon-button {
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #dfe8f6;
  border: 1px solid rgba(146, 166, 197, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.team-editor-help,
.team-editor-status {
  margin: 0;
  color: rgba(207, 219, 238, 0.7);
  font-size: 12px;
  line-height: 1.5;
}

.team-editor-field {
  display: grid;
  gap: 7px;
  color: #dfe8f6;
  font-size: 12px;
  font-weight: 700;
}

.team-editor-field input,
.team-editor-field textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 11px;
  color: #fff;
  border: 1px solid rgba(139, 163, 200, 0.42);
  border-radius: 8px;
  background: #090f18;
  font: inherit;
  font-weight: 500;
  resize: vertical;
}

.team-editor-field input:focus-visible,
.team-editor-field textarea:focus-visible {
  border-color: #7aa9f5;
  outline: 2px solid rgba(93, 148, 235, 0.24);
  outline-offset: 2px;
}

.team-editor-status:not(:empty) {
  padding: 9px 10px;
  color: #ffd7d7;
  border: 1px solid rgba(215, 104, 104, 0.38);
  border-radius: 7px;
  background: rgba(125, 37, 37, 0.18);
}

.team-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.team-editor-action-spacer {
  flex: 1 1 auto;
}

.team-editor-actions button {
  min-height: 36px;
  padding: 0 13px;
  color: #edf4ff;
  border: 1px solid rgba(139, 163, 200, 0.4);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.team-editor-actions .team-editor-primary {
  border-color: rgba(102, 151, 231, 0.72);
  background: #315da7;
}

.team-editor-actions .team-editor-delete,
.team-editor-actions .team-editor-delete[data-confirming="true"] {
  color: #ffdede;
  border-color: rgba(211, 92, 92, 0.5);
  background: rgba(139, 39, 39, 0.3);
}

.team-editor-actions .team-editor-delete[data-confirming="true"] {
  background: #a52d35;
}

@media (max-width: 620px) {
  .team-editor-form {
    padding: 17px;
  }

  .team-editor-action-spacer {
    display: none;
  }

  .team-editor-actions button {
    flex: 1 1 42%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-picker-chevron {
    transition: none;
  }
}

body.left-nav-layout .navbar.menu-collapsed .collapsed-rail-title,
body.left-nav-layout .navbar.menu-collapsed:hover .collapsed-rail-title {
  position: static;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  width: 42px;
  color: rgba(249, 249, 249, 0.82);
  line-height: 1.15;
  opacity: 1;
  transform: none;
  visibility: visible;
  white-space: normal;
}

body.left-nav-layout .navbar.menu-collapsed::before,
body.left-nav-layout .navbar.menu-collapsed:hover::before {
  content: "";
  position: absolute;
  top: 171px;
  bottom: 8px;
  left: 50%;
  z-index: 0;
  display: block;
  width: 1px;
  background: linear-gradient(
    180deg,
    rgba(232, 232, 232, 0.34),
    rgba(232, 232, 232, 0.24) 55%,
    rgba(232, 232, 232, 0.18) 82%,
    rgba(232, 232, 232, 0.14) 100%
  );
  transform: translateX(-50%);
  pointer-events: none;
}

body.left-nav-layout .navbar.menu-collapsed::after,
body.left-nav-layout .navbar.menu-collapsed:hover::after {
  content: "";
  position: absolute;
  top: 168px;
  left: 50%;
  z-index: 1;
  display: block;
  width: 5px;
  height: 5px;
  border: 1px solid rgba(230, 230, 230, 0.34);
  border-radius: 50%;
  background: #111113;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Mirror the top rail cap at the lower endpoint. Keep this decorative cap
   separate from the animated shimmer so the existing glow handoff is unchanged. */
body.left-nav-layout .navbar .collapsed-rail-endpoint {
  display: none;
}

body.left-nav-layout .navbar.menu-collapsed .collapsed-rail-endpoint,
body.left-nav-layout .navbar.menu-collapsed:hover .collapsed-rail-endpoint {
  position: absolute;
  bottom: 5px;
  left: 50%;
  z-index: 1;
  display: block;
  width: 5px;
  height: 5px;
  border: 1px solid rgba(230, 230, 230, 0.34);
  border-radius: 50%;
  background: #111113;
  transform: translateX(-50%);
  pointer-events: none;
}

body.left-nav-layout .navbar.menu-collapsed .navbar-header,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 18px 50px 40px;
  place-items: center;
  align-content: start;
  box-sizing: border-box;
  width: 54px;
  min-height: 146px;
  height: 146px;
  margin: 10px auto 0;
  padding: 8px 6px 10px;
  gap: 6px;
  overflow: visible;
  border: 1px solid rgba(218, 218, 218, 0.22);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(31, 31, 34, 0.96), rgba(14, 14, 16, 0.98));
  color: #fff;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.065),
    0 8px 22px rgba(0, 0, 0, 0.3);
}

body.left-nav-layout .navbar.menu-collapsed .navbar-header::after,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-header::after {
  display: none !important;
}

body.left-nav-layout .navbar.menu-collapsed .control-center-logo-image,
body.left-nav-layout .navbar.menu-collapsed:hover .control-center-logo-image {
  grid-column: 1;
  grid-row: 2;
  justify-self: center;
  width: 40px;
  height: 50px;
  object-fit: contain;
  filter:
    saturate(0.92)
    contrast(1.04)
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.46));
}

body.left-nav-layout .navbar.menu-collapsed #menuToggleButton,
body.left-nav-layout .navbar.menu-collapsed:hover #menuToggleButton {
  position: static !important;
  grid-column: 1;
  grid-row: 3;
  justify-self: center;
  width: 40px;
  height: 40px;
  margin: 0;
  color: #f4f4f4 !important;
  border: 1px solid rgba(226, 226, 226, 0.36) !important;
  border-radius: 12px;
  background: linear-gradient(180deg, #29292c, #1a1a1d) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 5px 12px rgba(0, 0, 0, 0.32) !important;
  transform: none !important;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 180ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.left-nav-layout .navbar.menu-collapsed #menuToggleButton i,
body.left-nav-layout .navbar.menu-collapsed:hover #menuToggleButton i {
  font-size: 14px;
}

body.left-nav-layout .navbar.menu-collapsed #menuToggleButton:hover,
body.left-nav-layout .navbar.menu-collapsed #menuToggleButton:focus-visible {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.68) !important;
  background: linear-gradient(180deg, #36363a, #222226) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 8px 18px rgba(0, 0, 0, 0.38) !important;
  transform: translateY(-1px) !important;
}

body.left-nav-layout .navbar.menu-collapsed #menuToggleButton:focus-visible {
  outline: 2px solid rgba(246, 246, 246, 0.9);
  outline-offset: 3px;
}

body.left-nav-layout .navbar.menu-collapsed .nav-buttons,
body.left-nav-layout .navbar.menu-collapsed:hover .nav-buttons {
  display: none !important;
  width: 0;
  height: 0;
  min-height: 0;
  overflow: hidden !important;
}

@media (prefers-reduced-motion: reduce) {
  body.left-nav-layout .navbar.menu-collapsed #menuToggleButton,
  body.left-nav-layout .navbar.menu-collapsed:hover #menuToggleButton {
    transition: none !important;
  }
}

/* ========================================================================
   Rail motion and social identity

   Let the rail breathe open and closed long enough for the layout change to
   feel intentional. The social link remains a real, keyboard-accessible link
   while changing from a quiet footer in the full menu to a compact horizontal
   identity marker rotated onto the collapsed rail divider.
   ======================================================================== */
body.left-nav-layout {
  transition: grid-template-columns 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.left-nav-layout .navbar,
body.left-nav-layout .navbar.expanded,
body.left-nav-layout .navbar.expanded:hover,
body.left-nav-layout .navbar.menu-collapsed,
body.left-nav-layout .navbar.menu-collapsed:hover {
  transition:
    width 420ms cubic-bezier(0.22, 1, 0.36, 1),
    background 300ms ease,
    border-color 260ms ease,
    box-shadow 320ms ease;
}

body.left-nav-layout .navbar-header,
body.left-nav-layout .navbar.menu-collapsed .navbar-header,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-header {
  transition:
    width 420ms cubic-bezier(0.22, 1, 0.36, 1),
    height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    min-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    padding 380ms cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 360ms ease,
    background 300ms ease,
    box-shadow 320ms ease;
}

body.left-nav-layout .navbar .nav-buttons,
body.left-nav-layout .navbar.expanded .nav-buttons,
body.left-nav-layout .navbar.expanded:hover .nav-buttons {
  display: flex !important;
  max-height: 1800px;
  transition:
    max-height 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 240ms ease 70ms,
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1) 50ms,
    visibility 0s linear 0s;
}

body.left-nav-layout .navbar .nav-buttons > .control-section {
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 180ms ease 90ms,
    transform 300ms cubic-bezier(0.22, 1, 0.36, 1) 40ms;
}

body.left-nav-layout .navbar .nav-buttons > .control-section:nth-child(2) {
  transition-delay: 115ms;
}

body.left-nav-layout .navbar .nav-buttons > .control-section:nth-child(3) {
  transition-delay: 140ms;
}

body.left-nav-layout .navbar .nav-buttons > .control-section:nth-child(n + 4) {
  transition-delay: 165ms;
}

body.left-nav-layout .navbar.menu-collapsed .nav-buttons,
body.left-nav-layout .navbar.menu-collapsed:hover .nav-buttons {
  display: flex !important;
  flex: 0 0 0 !important;
  width: 100%;
  height: 0;
  max-height: 0;
  min-height: 0;
  margin: 0;
  padding: 0 !important;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-16px);
  pointer-events: none;
  overflow: hidden !important;
  transition-delay: 0s, 0s, 0s, 420ms;
}

body.left-nav-layout .navbar.menu-collapsed .nav-buttons > .control-section,
body.left-nav-layout .navbar.menu-collapsed:hover .nav-buttons > .control-section {
  opacity: 0;
  transform: translateX(-12px);
  transition-delay: 0ms;
}

body.left-nav-layout .navbar-social-link {
  position: relative;
  z-index: 3;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  margin: 0 20px 14px;
  padding: 5px 10px;
  overflow: hidden;
  border: 1px solid rgba(198, 192, 188, 0.22);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(30, 30, 32, 0.96), rgba(17, 17, 19, 0.96));
  color: #f1efed;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15px;
  line-height: 1;
  text-decoration: none;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 220ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.left-nav-layout .navbar-social-link:hover,
body.left-nav-layout .navbar-social-link:focus-visible {
  border-color: rgba(242, 240, 238, 0.62);
  background: linear-gradient(180deg, rgba(46, 46, 49, 0.98), rgba(24, 24, 27, 0.98));
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

body.left-nav-layout .navbar-social-link:focus-visible {
  outline: 2px solid rgba(246, 246, 246, 0.88);
  outline-offset: 3px;
}

body.left-nav-layout .navbar-social-link-icon {
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(198, 192, 188, 0.26);
  border-radius: 7px;
  background: #242426;
  color: #f7f5f3;
  font-size: 12px;
}

body.left-nav-layout .navbar-social-link-x-mark {
  display: block;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

body.left-nav-layout .navbar-social-link-credit {
  flex: 0 0 auto;
  color: rgba(216, 213, 210, 0.64);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

body.left-nav-layout .navbar-social-link-handle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.left-nav-layout .navbar.menu-collapsed .navbar-social-link,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-social-link {
  position: absolute;
  /* Center the compact identity in the lower third of the viewport. The
     shimmer geometry is rebuilt from this element's live bounds. */
  top: 66.6667%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 62px;
  min-height: 68px;
  margin: 0;
  padding: 7px 2px;
  gap: 5px;
  border-color: rgba(218, 218, 218, 0.2);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(31, 31, 34, 0.92), rgba(14, 14, 16, 0.94));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.055),
    0 7px 16px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
}

body.left-nav-layout .navbar.menu-collapsed .navbar-social-link:hover,
body.left-nav-layout .navbar.menu-collapsed .navbar-social-link:focus-visible,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-social-link:hover,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-social-link:focus-visible {
  transform: translate(-50%, calc(-50% - 1px));
}

body.left-nav-layout .navbar.menu-collapsed .navbar-social-link-icon,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-social-link-icon {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}

body.left-nav-layout .navbar.menu-collapsed .navbar-social-link-handle,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-social-link-handle {
  display: block;
  max-width: none;
  max-height: none;
  overflow: visible;
  color: #d8d5d2;
  font-size: 8px;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-orientation: initial;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  body.left-nav-layout,
  body.left-nav-layout .navbar,
  body.left-nav-layout .navbar.expanded,
  body.left-nav-layout .navbar.expanded:hover,
  body.left-nav-layout .navbar.menu-collapsed,
  body.left-nav-layout .navbar.menu-collapsed:hover,
  body.left-nav-layout .navbar-header,
  body.left-nav-layout .navbar.menu-collapsed .navbar-header,
  body.left-nav-layout .navbar.menu-collapsed:hover .navbar-header,
  body.left-nav-layout .navbar .nav-buttons,
  body.left-nav-layout .navbar-social-link,
  body.left-nav-layout .collapsed-rail-title,
  body.left-nav-layout .navbar .nav-buttons > .control-section {
    transition: none !important;
  }
}

/* Match the compact social control to the horizontal identity pill used in
   the full rail: credit on the left, X in the middle, handle on the right. */
body.left-nav-layout .navbar.menu-collapsed,
body.left-nav-layout .navbar.menu-collapsed:hover {
  overflow: visible;
}

body.left-nav-layout .navbar.menu-collapsed .navbar-social-link,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-social-link {
  box-sizing: border-box;
  left: calc(var(--left-nav-collapsed-width) / 2);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: max-content;
  min-width: 162px;
  /* Scale the complete collapsed identity treatment down by roughly five
     percent while keeping its spacing and contents visually proportional. */
  min-height: 50px;
  height: 50px;
  padding: 5px 10px;
  gap: 9px;
  overflow: hidden;
  border-color: rgba(198, 192, 188, 0.28);
  border-radius: 8.5px;
  background: linear-gradient(180deg, rgba(30, 30, 32, 0.98), rgba(17, 17, 19, 0.98));
  color: #f1efed;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.055),
    0 7px 16px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center;
}

body.left-nav-layout .navbar.menu-collapsed .navbar-social-link:hover,
body.left-nav-layout .navbar.menu-collapsed .navbar-social-link:focus-visible,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-social-link:hover,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-social-link:focus-visible {
  transform: translate(-50%, -50%) rotate(-90deg);
}

/* When the short rail can scroll, keep a small plain-language cue between
   the command list and the identity pill. It stays in the layout while the
   user reaches the end so the rail does not resize as the hint fades. */
body.left-nav-layout .navigation-scroll-hint {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  margin: 0 20px 8px;
  padding: 7px 11px;
  border: 1px solid rgba(198, 192, 188, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(38, 36, 38, 0.96), rgba(19, 19, 21, 0.96));
  color: rgba(226, 222, 219, 0.82);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.035),
    0 0 0 1px rgba(255, 255, 255, 0),
    0 0 0 rgba(255, 255, 255, 0),
    0 0 0 rgba(255, 255, 255, 0);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 220ms ease;
}

body.left-nav-layout .navigation-scroll-hint[hidden],
body.left-nav-layout .navbar.menu-collapsed .navigation-scroll-hint,
body.left-nav-layout .navbar.menu-collapsed:hover .navigation-scroll-hint {
  display: none !important;
}

body.left-nav-layout .navigation-scroll-hint.is-visible {
  border-color: rgba(238, 238, 238, 0.32);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.055),
    0 0 0 1px rgba(255, 255, 255, 0.035),
    0 0 10px rgba(255, 255, 255, 0.075),
    0 0 18px rgba(255, 255, 255, 0.028);
  opacity: 1;
  transform: none;
}

body.left-nav-layout .navigation-scroll-hint i {
  color: #bcb6b2;
  font-size: 11px;
}

@media (prefers-reduced-motion: reduce) {
  body.left-nav-layout .navigation-scroll-hint {
    transition: none;
  }
}

/* Expanded command rails scroll based on actual content overflow at every
   viewport height. Dynamic forms can outgrow a tall rail too, so a fixed
   height breakpoint is not a reliable accessibility boundary. */
body.left-nav-layout .navbar.expanded .nav-buttons,
body.left-nav-layout .navbar.expanded:hover .nav-buttons {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  scrollbar-color: #5d5a5b #0a0a0c;
  scrollbar-width: thin;
}

body.left-nav-layout .navbar.expanded .nav-buttons::-webkit-scrollbar,
body.left-nav-layout .navbar.expanded:hover .nav-buttons::-webkit-scrollbar {
  display: block;
  width: 7px;
}

body.left-nav-layout .navbar.expanded .nav-buttons::-webkit-scrollbar-track,
body.left-nav-layout .navbar.expanded:hover .nav-buttons::-webkit-scrollbar-track {
  background: #0a0a0c;
}

body.left-nav-layout .navbar.expanded .nav-buttons::-webkit-scrollbar-thumb,
body.left-nav-layout .navbar.expanded:hover .nav-buttons::-webkit-scrollbar-thumb {
  border: 1px solid rgba(230, 226, 224, 0.18);
  border-radius: 999px;
  background: #5d5a5b;
}

body.left-nav-layout .navbar.menu-collapsed .navbar-social-link-credit,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-social-link-credit {
  position: static;
  order: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  color: rgba(216, 213, 210, 0.64);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-orientation: initial;
  transform: none;
}

body.left-nav-layout .navbar.menu-collapsed .navbar-social-link-icon,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-social-link-icon {
  box-sizing: border-box;
  order: 2;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin: 0;
  border: 1px solid rgba(226, 226, 226, 0.36);
  border-radius: 7px;
  background: linear-gradient(180deg, #29292c, #1a1a1d);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 5px 12px rgba(0, 0, 0, 0.32);
  color: #f4f4f4;
}

body.left-nav-layout .navbar.menu-collapsed .navbar-social-link:hover .navbar-social-link-icon,
body.left-nav-layout .navbar.menu-collapsed .navbar-social-link:focus-visible .navbar-social-link-icon,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-social-link:hover .navbar-social-link-icon,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-social-link:focus-visible .navbar-social-link-icon {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.68);
  background: linear-gradient(180deg, #36363a, #222226);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 8px 18px rgba(0, 0, 0, 0.38);
  transform: translateY(-1px);
}

body.left-nav-layout .navbar.menu-collapsed .navbar-social-link-x-mark,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-social-link-x-mark {
  width: 20px;
  height: 20px;
  transform: none;
}

body.left-nav-layout .navbar.menu-collapsed .navbar-social-link-handle,
body.left-nav-layout .navbar.menu-collapsed:hover .navbar-social-link-handle {
  box-sizing: border-box;
  order: 3;
  display: block;
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  overflow: visible;
  color: #f4f4f4;
  font-size: 13.5px;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: left;
  text-overflow: clip;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-orientation: initial;
  transform: none;
}

/* ========================================================================
   Live selection and close-control refinement
   Keep the existing card geometry and control placement, while making the
   selected Live Window easy to spot and matching close controls to the dark
   OFF state used elsewhere in the app.
   ======================================================================== */
:root {
  --stream-control-live: #45c875;
  --stream-control-live-surface: #173b27;
  --stream-control-live-text: #c3f1cf;
  --stream-control-live-border: rgba(86, 207, 123, 0.82);
  --stream-control-close: #542326;
  --stream-control-close-bright: #693035;
  --stream-control-close-border: rgba(181, 106, 113, 0.66);
}

body.popup-mode .stream.active,
body.popup-mode .stream.active:hover {
  border: 2px solid var(--stream-control-live) !important;
  outline: 2px solid var(--stream-control-live);
  outline-offset: -2px;
  box-shadow:
    0 0 0 1px rgba(69, 200, 117, 0.72),
    0 0 18px rgba(69, 200, 117, 0.46),
    0 0 42px rgba(69, 200, 117, 0.18) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.active,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.active:hover {
  border: 2px solid var(--stream-control-live) !important;
  outline: 2px solid var(--stream-control-live);
  outline-offset: -2px;
  box-shadow:
    0 0 0 1px rgba(69, 200, 117, 0.72),
    0 0 18px rgba(69, 200, 117, 0.46),
    0 0 42px rgba(69, 200, 117, 0.18) !important;
}

body.popup-mode .stream.active .stream-name,
body.popup-mode .stream.active .stream-name:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.active .stream-name,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.active .stream-name:hover {
  color: var(--stream-control-live-text) !important;
  background: var(--stream-control-live-surface) !important;
  border-color: var(--stream-control-live-border) !important;
  box-shadow:
    0 5px 14px rgba(22, 92, 48, 0.3),
    inset 0 1px rgba(255, 255, 255, 0.07) !important;
}

body.popup-mode .stream .remove-button,
body.popup-mode .twitch-card-rail .remove-button,
body.popup-mode #streamsGrid.overview-fit.overview-compact
  > .stream.twitch-stream-card
  > .twitch-card-rail
  .remove-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail
  .remove-button {
  flex: 0 0 27px !important;
  width: 27px !important;
  height: 27px !important;
  min-height: 27px !important;
  max-height: 27px !important;
  padding: 0 !important;
  color: #fff !important;
  background: var(--stream-control-close) !important;
  border-color: var(--stream-control-close-border) !important;
  border-radius: 6px !important;
  box-shadow:
    0 3px 9px rgba(72, 18, 22, 0.34),
    inset 0 1px rgba(255, 255, 255, 0.13) !important;
  font-size: 12px !important;
}

body.popup-mode .stream .remove-button:hover,
body.popup-mode .twitch-card-rail .remove-button:hover,
body.popup-mode #streamsGrid.overview-fit.overview-compact
  > .stream.twitch-stream-card
  > .twitch-card-rail
  .remove-button:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail
  .remove-button:hover {
  background: var(--stream-control-close-bright) !important;
  border-color: rgba(209, 139, 145, 0.78) !important;
  box-shadow:
    0 7px 15px rgba(82, 22, 27, 0.44),
    0 0 0 2px rgba(165, 73, 80, 0.16),
    inset 0 1px rgba(255, 255, 255, 0.18) !important;
    transform: translateY(-1px) scale(1.04) !important;
}

/* ========================================================================
   Neutral tutorial surface and scrollbar-free pass
   Keep the widget compact and readable without introducing a second visual
   language or a nested scroll container inside the Control Center.
   ======================================================================== */
:root {
  --tutorial-surface: #141414;
  --tutorial-surface-deep: #0b0b0b;
  --tutorial-surface-raised: #1d1d1d;
  --tutorial-border: rgba(190, 190, 190, 0.24);
  --tutorial-border-strong: rgba(214, 214, 214, 0.46);
  --tutorial-text: #eeeeee;
  --tutorial-muted: #b6b6b6;
  --tutorial-subtle: #8f8f8f;
  --tutorial-icon: #d7d7d7;
  --tutorial-accent: #a6a6a6;
  --tutorial-accent-bright: #dddddd;
}

#tutorial-overlay .tutorial-content {
  max-height: min(620px, calc(100vh - 28px));
  overflow: hidden;
  color: var(--tutorial-text);
  background: linear-gradient(
    145deg,
    var(--tutorial-surface) 0%,
    #101010 64%,
    var(--tutorial-surface-deep) 100%
  );
  border-color: var(--tutorial-border-strong);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(255, 255, 255, 0.035) inset;
  scrollbar-width: none;
}

#tutorial-overlay .tutorial-content::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

#tutorial-overlay .tutorial-backdrop {
  background: transparent;
}

.tutorial-header {
  padding: 12px 14px;
  border-bottom-color: var(--tutorial-border);
  background: rgba(12, 12, 12, 0.98);
}

.tutorial-brand-icon,
.tutorial-step-icon,
.tutorial-hero-mark {
  color: #f4f4f4;
  background: linear-gradient(180deg, #6d6d6d 0%, #3e3e3e 100%);
  border: 1px solid rgba(236, 236, 236, 0.22);
  box-shadow:
    0 7px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px rgba(255, 255, 255, 0.22);
}

.tutorial-overline,
.tutorial-rail-label,
.tutorial-kicker,
.tutorial-preference-label {
  color: #bdbdbd;
}

.tutorial-header-caption,
.tutorial-step-category,
.tutorial-preference-help {
  color: var(--tutorial-subtle);
}

.tutorial-icon-button {
  color: #e1e1e1;
  background: #252525;
  border-color: rgba(201, 201, 201, 0.38);
}

.tutorial-icon-button:hover,
.tutorial-icon-button:focus-visible {
  color: #fff;
  background: #373737;
  border-color: rgba(238, 238, 238, 0.72);
}

.tutorial-body {
  overflow: hidden;
}

.tutorial-main {
  padding: 16px 18px 0;
  overflow: hidden;
}

.tutorial-main h1 {
  color: var(--tutorial-text);
}

.tutorial-description {
  color: #c2c2c2;
  line-height: 1.42;
}

.tutorial-kicker {
  margin-bottom: 6px;
}

.tutorial-hero-mark {
  margin-bottom: 11px;
}

.tutorial-offer-points {
  margin-top: 12px;
}

.tutorial-offer-points span {
  color: #c7c7c7;
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--tutorial-border);
}

.tutorial-offer-points i,
.tutorial-step-number,
.tutorial-step-link.is-current .tutorial-step-link-number {
  color: var(--tutorial-accent-bright);
}

.tutorial-step-meta {
  margin-bottom: 12px;
}

.tutorial-step-icon {
  margin-bottom: 11px;
}

.tutorial-step-details {
  gap: 5px;
  margin-top: 11px;
}

.tutorial-step-details li {
  color: #bdbdbd;
  line-height: 1.36;
}

.tutorial-step-details i,
.tutorial-focus-callout i,
.tutorial-rail-note i {
  color: var(--tutorial-accent);
}

.tutorial-focus-callout {
  margin-top: 11px;
  padding: 8px 10px;
  color: #c6c6c6;
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--tutorial-border);
  line-height: 1.36;
}

.tutorial-footer {
  padding-top: 14px;
}

.tutorial-progress {
  background: rgba(190, 190, 190, 0.2);
}

#tutorial-progress-bar {
  background: linear-gradient(90deg, #8f8f8f, #d7d7d7);
}

.tutorial-footer-actions {
  margin-top: 9px;
}

.tutorial-secondary-button {
  color: #a9a9a9;
}

.tutorial-secondary-button:hover,
.tutorial-secondary-button:focus-visible {
  color: #ededed;
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--tutorial-border);
}

.tutorial-primary-button {
  color: #fff;
  background: linear-gradient(135deg, #717171 0%, #3f3f3f 100%);
  border-color: rgba(231, 231, 231, 0.52);
  box-shadow:
    0 7px 15px rgba(0, 0, 0, 0.3),
    inset 0 1px rgba(255, 255, 255, 0.2);
}

.tutorial-primary-button:hover,
.tutorial-primary-button:focus-visible {
  background: linear-gradient(135deg, #8b8b8b 0%, #505050 100%);
  border-color: #f0f0f0;
}

.tutorial-preference-form {
  margin-top: 10px;
  padding-top: 9px;
  border-top-color: var(--tutorial-border);
}

.tutorial-save-button {
  color: #a6a6a6;
  background: rgba(66, 66, 66, 0.64);
  border-color: rgba(169, 169, 169, 0.3);
}

.tutorial-save-button:not(:disabled):hover,
.tutorial-save-button:not(:disabled):focus-visible {
  color: #fff;
  background: #5c5c5c;
  border-color: rgba(230, 230, 230, 0.7);
}

body.tutorial-active .highlight {
  outline-color: #bcbcbc !important;
  box-shadow:
    0 0 0 10px rgba(190, 190, 190, 0.12),
    0 0 30px rgba(216, 216, 216, 0.32) !important;
}

@media (max-width: 760px) {
  #tutorial-overlay .tutorial-content {
    max-height: calc(100vh - 24px);
  }

  .tutorial-main {
    padding-inline: 14px;
  }

  .tutorial-main h1 {
    font-size: 22px;
  }

  .tutorial-description {
    font-size: 11px;
  }

  .tutorial-step-details li {
    font-size: 10.5px;
  }
}

/* Navigation auto-hide uses the same compact system row as Window Controls. */
body.left-nav-layout #navigationAutoHideButton {
  min-height: 52px;
  padding: 0 7px 0 5px;
  font-size: 13px;
}

body.left-nav-layout #navigationAutoHideButton.active {
  border-color: rgba(98, 189, 120, 0.64);
  background: #17321e !important;
}

body.left-nav-layout #navigationAutoHideButton.active > i:first-child {
  border-color: rgba(99, 166, 111, 0.46);
  background: #315e3a;
}

body.left-nav-layout #navigationAutoHideButton .status-chip {
  min-width: 44px;
  margin-left: auto;
  background: var(--left-rail-green);
  color: #fff;
  font-size: 10px;
}

body.left-nav-layout #navigationAutoHideButton:not(.active) .status-chip {
  background: #3a383c;
}

/* Window Controls uses a green status chip to communicate ON. Keep the row
   itself in the neutral command-rail palette so the state accent stays local
   to the control, matching the compact auto-hide row below it. */
body.left-nav-layout .navbar #windowControlsButton.active,
body.left-nav-layout .navbar #windowControlsButton.active:hover {
  border-color: rgba(157, 143, 138, 0.28) !important;
  background: linear-gradient(180deg, #242021 0%, #1a1718 100%) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035) !important;
}

body.left-nav-layout .navbar #windowControlsButton.active > i:first-child {
  border-color: rgba(157, 143, 138, 0.26) !important;
  background: #343034 !important;
}

body.left-nav-layout .navbar #windowControlsButton.active .status-chip {
  border-color: rgba(98, 189, 120, 0.78);
  background: #4a9b5c !important;
  color: #fff;
}

/* Keep every binary Control Center status optically identical. Rows retain
   their grayscale surfaces while ON always uses one shared positive green. */
:root {
  --control-on-chip-background: #4a9b5c;
  --control-on-chip-border: rgba(98, 189, 120, 0.78);
  --control-on-chip-text: #ffffff;
  --control-on-chip-shadow: inset 0 1px rgba(255, 255, 255, 0.14);
}

body.left-nav-layout :is(
  #windowControlsButton,
  #navigationAutoHideButton
) .status-chip {
  display: grid !important;
  flex: 0 0 50px !important;
  place-items: center !important;
  box-sizing: border-box !important;
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  height: 24px !important;
  min-height: 24px !important;
  margin-left: auto !important;
  padding: 0 !important;
  border-radius: 6px !important;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  line-height: 1 !important;
  text-align: center !important;
}

body.left-nav-layout :is(
  #windowControlsButton,
  #navigationAutoHideButton
).active .status-chip {
  color: var(--control-on-chip-text) !important;
  border: 1px solid var(--control-on-chip-border) !important;
  background: var(--control-on-chip-background) !important;
  box-shadow: var(--control-on-chip-shadow) !important;
}

body.left-nav-layout #volumeStabilizationToggle {
  box-sizing: border-box;
  width: 50px;
  min-width: 50px;
  height: 24px;
  min-height: 24px;
  padding: 0;
}

body.left-nav-layout #volumeStabilizationToggle.is-enabled {
  color: var(--control-on-chip-text) !important;
  border: 1px solid var(--control-on-chip-border) !important;
  background: var(--control-on-chip-background) !important;
  box-shadow: var(--control-on-chip-shadow) !important;
}

/* Keep System command rows visually consistent. Tutorial, Window Controls,
   and Navigation Auto-Hide share one transparent grouped-row
   surface; only the compact status chips communicate ON/OFF state. */
body.left-nav-layout .navbar :is(
  #windowControlsButton,
  #navigationAutoHideButton
),
body.left-nav-layout .navbar :is(
  #windowControlsButton,
  #navigationAutoHideButton
).active,
body.left-nav-layout .navbar :is(
  #windowControlsButton,
  #navigationAutoHideButton
):not(.active) {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.left-nav-layout .navbar :is(
  #windowControlsButton,
  #navigationAutoHideButton
) {
  border-top: 1px solid var(--left-rail-divider) !important;
}

body.left-nav-layout .navbar :is(
  #windowControlsButton,
  #navigationAutoHideButton
):hover {
  background: var(--left-rail-surface-hover) !important;
}

body.left-nav-layout .navbar :is(
  #windowControlsButton,
  #navigationAutoHideButton
).active > i:first-child,
body.left-nav-layout .navbar :is(
  #windowControlsButton,
  #navigationAutoHideButton
):not(.active) > i:first-child {
  border-color: rgba(198, 192, 188, 0.25) !important;
  background: #777 !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08) !important;
}

body.left-nav-layout :is(
  #windowControlsButton,
  #navigationAutoHideButton
):not(.active) .status-chip {
  border-color: rgba(200, 91, 83, 0.58);
  background: linear-gradient(180deg, #6a302d 0%, #4a211f 100%);
  color: #fff4f2;
}

/* ========================================================================
   Team capacity segmented control

   Each capacity reads as a discrete toggle while the six choices retain the
   compact 3-by-2 footprint needed by short Control Center viewports.
   ======================================================================== */
body.left-nav-layout .control-section--team .mode-buttons {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-rows: 32px;
  min-height: 76px;
  padding: 5px;
  gap: 4px;
  overflow: hidden;
  border: 1px solid rgba(198, 192, 188, 0.28);
  border-radius: 10px;
  background: linear-gradient(180deg, #131315 0%, #0f0f11 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.035),
    0 4px 10px rgba(0, 0, 0, 0.16);
}

body.left-nav-layout .control-section--team .team-mode-button,
body.left-nav-layout .control-section--team #singleModeButton,
body.left-nav-layout .control-section--team #dualModeButton {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  height: 32px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid rgba(198, 192, 188, 0.2) !important;
  border-radius: 6px;
  background: linear-gradient(180deg, #262528 0%, #1d1c1f 100%) !important;
  color: #d9d6d4 !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045) !important;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.38px;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  transform: none;
  transition:
    color 150ms ease,
    border-color 160ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.left-nav-layout .control-section--team .team-mode-button .nav-button-label {
  display: block;
  width: 100%;
  margin: 0;
  overflow: visible;
  line-height: 1 !important;
  text-align: center;
  text-overflow: clip;
}

body.left-nav-layout .control-section--team .team-mode-button:hover {
  border-color: rgba(226, 223, 220, 0.48) !important;
  background: linear-gradient(180deg, #353438 0%, #27262a 100%) !important;
  color: #fff !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.07),
    0 3px 8px rgba(0, 0, 0, 0.2) !important;
  transform: translateY(-1px);
}

body.left-nav-layout .control-section--team .team-mode-button:active {
  transform: translateY(0) scale(0.985);
}

body.left-nav-layout .control-section--team .team-mode-button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid rgba(139, 177, 255, 0.88);
  outline-offset: 1px;
}

body.left-nav-layout .control-section--team .team-mode-button.active-mode-button,
body.left-nav-layout .control-section--team #singleModeButton.active-mode-button,
body.left-nav-layout .control-section--team #dualModeButton.active-mode-button {
  border-color: rgba(110, 153, 244, 0.82) !important;
  background: linear-gradient(180deg, #3a67cb 0%, #294fae 100%) !important;
  color: #fff !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.18),
    0 4px 10px rgba(31, 67, 150, 0.28) !important;
}

@media (max-height: 940px) {
  body.left-nav-layout .control-section--team .mode-buttons {
    grid-auto-rows: 28px;
    min-height: 68px;
    padding: 4px;
  }

  body.left-nav-layout .control-section--team .team-mode-button,
  body.left-nav-layout .control-section--team #singleModeButton,
  body.left-nav-layout .control-section--team #dualModeButton {
    min-height: 28px;
    height: 28px;
    font-size: 10.5px;
  }
}

@media (max-height: 820px) {
  body.left-nav-layout .control-section--team .mode-buttons {
    grid-auto-rows: 24px;
    min-height: 58px;
    padding: 3px;
    gap: 3px;
  }

  body.left-nav-layout .control-section--team .team-mode-button,
  body.left-nav-layout .control-section--team #singleModeButton,
  body.left-nav-layout .control-section--team #dualModeButton {
    min-height: 24px;
    height: 24px;
    padding-inline: 5px;
    border-radius: 5px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.left-nav-layout .control-section--team .team-mode-button {
    transition: none !important;
  }
}

/* Keep every capacity label centered, including the four buttons that can be
   overridden by the older two-option rules earlier in this stylesheet. */
body.left-nav-layout .control-section--team .team-mode-button,
body.left-nav-layout .control-section--team #singleModeButton,
body.left-nav-layout .control-section--team #dualModeButton {
  align-items: center !important;
  justify-items: center !important;
  justify-content: center !important;
  place-items: center !important;
  text-align: center !important;
}

body.left-nav-layout .control-section--team .team-mode-button .nav-button-label {
  width: 100% !important;
  text-align: center !important;
}

/* Keep stream-title glyphs inside their compact rail pill.  The title rail
   deliberately uses a fixed height so the grid stays stable, but a 1:1 line
   box at the card font size can clip descenders at the bottom of the label.
   Give both the pill and its text a real line box while retaining the
   single-line ellipsis for long channel names. */
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name {
  box-sizing: border-box;
  align-items: center !important;
  height: 36px !important;
  min-height: 36px !important;
  padding-block: 0 !important;
  line-height: 1.2 !important;
  overflow: hidden !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name-label {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  line-height: 18px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* This final cascade layer applies the density tokens after the legacy fixed
   stream-control dimensions immediately above. */
@media (hover: hover) and (pointer: fine) {
  body.popup-mode #streamsGrid.overview-fit[data-stream-control-density]:not([data-stream-control-density="comfortable"])
    > .stream.twitch-stream-card
    > .twitch-card-rail--top {
    height: var(--stream-tile-top-rail-height) !important;
    min-height: var(--stream-tile-top-rail-height) !important;
    padding: var(--stream-tile-top-rail-padding) !important;
  }

  body.popup-mode #streamsGrid.overview-fit[data-stream-control-density]:not([data-stream-control-density="comfortable"])
    > .stream.twitch-stream-card
    > .twitch-card-rail--bottom {
    height: var(--stream-tile-bottom-rail-height) !important;
    min-height: var(--stream-tile-bottom-rail-height) !important;
    padding: var(--stream-tile-bottom-rail-padding) !important;
  }

  body.popup-mode #streamsGrid.overview-fit[data-stream-control-density]:not([data-stream-control-density="comfortable"])
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .stream-name {
    max-width: calc(100% - var(--stream-tile-title-end-space)) !important;
    height: var(--stream-tile-title-height) !important;
    min-height: var(--stream-tile-title-height) !important;
    padding-inline: var(--stream-tile-title-padding) !important;
    column-gap: var(--stream-tile-title-gap) !important;
    font-size: var(--stream-tile-title-font-size) !important;
  }

  body.popup-mode #streamsGrid.overview-fit[data-stream-control-density]:not([data-stream-control-density="comfortable"])
    > .stream.twitch-stream-card.team-stream-card
    > .twitch-card-rail--top
    .stream-name {
    max-width: calc(100% - var(--stream-tile-team-title-end-space)) !important;
  }

  body.popup-mode #streamsGrid.overview-fit[data-stream-control-density]:not([data-stream-control-density="comfortable"])
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .stream-name-label {
    min-height: var(--stream-tile-label-line-height) !important;
    line-height: var(--stream-tile-label-line-height) !important;
  }

  body.popup-mode #streamsGrid.overview-fit[data-stream-control-density]:not([data-stream-control-density="comfortable"])
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .remove-button {
    top: var(--stream-tile-close-top) !important;
    right: var(--stream-tile-close-right) !important;
    flex-basis: var(--stream-tile-close-size) !important;
    width: var(--stream-tile-close-size) !important;
    height: var(--stream-tile-close-size) !important;
    min-height: var(--stream-tile-close-size) !important;
    max-height: var(--stream-tile-close-size) !important;
    font-size: var(--stream-tile-close-font-size) !important;
  }

  body.popup-mode #streamsGrid.overview-fit[data-stream-control-density]:not([data-stream-control-density="comfortable"])
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .team-edit-button {
    top: var(--stream-tile-close-top) !important;
    right: var(--stream-tile-team-action-right) !important;
    flex-basis: var(--stream-tile-close-size);
    width: var(--stream-tile-close-size);
    height: var(--stream-tile-close-size);
    min-height: var(--stream-tile-close-size);
    font-size: var(--stream-tile-close-font-size);
  }

  body.popup-mode #streamsGrid.overview-fit[data-stream-control-density]:not([data-stream-control-density="comfortable"])
    > .stream.twitch-stream-card
    > .twitch-card-rail--bottom
    .pip-button,
  body.popup-mode #streamsGrid.overview-fit[data-stream-control-density]:not([data-stream-control-density="comfortable"])
    > .stream.twitch-stream-card
    > .twitch-card-rail--bottom
    .clip-button {
    min-width: var(--stream-tile-action-min-width) !important;
    height: var(--stream-tile-action-height) !important;
    min-height: var(--stream-tile-action-height) !important;
    padding-inline: var(--stream-tile-action-padding) !important;
    gap: var(--stream-tile-action-gap) !important;
    font-size: var(--stream-tile-action-font-size) !important;
  }
}

/* ========================================================================
   Team controls: grayscale palette and centered remove glyphs

   Keep Team Streams in the Control Center's neutral visual language. This
   final scoped layer also shields the repeatable source buttons from the
   legacy pink combined-input rules loaded by the original stylesheet.
   ======================================================================== */
:root {
  --team-neutral-surface: #181818;
  --team-neutral-surface-raised: #262626;
  --team-neutral-surface-active: #484848;
  --team-neutral-surface-active-hover: #5a5a5a;
  --team-neutral-border: rgba(198, 198, 198, 0.3);
  --team-neutral-border-strong: rgba(232, 232, 232, 0.58);
  --team-neutral-text: #f2f2f2;
  --team-neutral-muted: #a6a6a6;
  --team-neutral-focus: #dedede;
}

body.left-nav-layout .stream-composer-host--team {
  border-color: var(--team-neutral-border) !important;
  background: linear-gradient(180deg, #1b1b1b 0%, #111111 100%) !important;
}

body.left-nav-layout .team-member-fields-heading > :last-child {
  color: var(--team-neutral-muted);
}

body.left-nav-layout .stream-type-chooser {
  border-color: var(--team-neutral-border);
  background: #111111;
}

body.left-nav-layout .stream-type-chooser label {
  color: #bdbdbd;
}

body.left-nav-layout .stream-type-chooser label:has(input:checked) {
  color: var(--team-neutral-text) !important;
  border-color: var(--team-neutral-border-strong) !important;
  background: linear-gradient(180deg, #505050 0%, #393939 100%) !important;
}

body.left-nav-layout .stream-type-chooser label:has(input:focus-visible),
body.left-nav-layout #addStreamForm .team-member-source-remove:focus-visible,
body.left-nav-layout #addStreamForm .team-member-add-button:focus-visible,
body.left-nav-layout .control-section--team .team-mode-button:focus-visible {
  outline-color: var(--team-neutral-focus) !important;
}

body.left-nav-layout #addStreamForm .control-input-shell:focus-within {
  border-color: var(--team-neutral-border-strong) !important;
  box-shadow: 0 0 0 2px rgba(222, 222, 222, 0.14) !important;
}

body.left-nav-layout .team-member-fields-heading {
  color: #dddddd;
}

body.left-nav-layout .team-member-source-index {
  color: #b9b9b9;
  background: rgba(255, 255, 255, 0.035);
}

body.left-nav-layout #addStreamForm .team-member-source-remove {
  display: inline-grid !important;
  align-content: center !important;
  align-items: center !important;
  justify-content: center !important;
  justify-items: center !important;
  place-items: center !important;
  align-self: stretch;
  box-sizing: border-box !important;
  flex: 0 0 38px;
  width: 38px;
  min-width: 38px;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  color: #d8d8d8 !important;
  border: 0 !important;
  border-left: 0 !important;
  border-radius: 0 7px 7px 0 !important;
  background: linear-gradient(180deg, #353535 0%, #262626 100%) !important;
  box-shadow: inset 1px 0 0 var(--team-neutral-border) !important;
  font-size: 14px !important;
  line-height: 1 !important;
  text-align: center !important;
  transform: none !important;
}

body.left-nav-layout
  #addStreamForm
  .team-member-source-remove:hover:not(:disabled) {
  color: #ffffff !important;
  background: linear-gradient(180deg, #505050 0%, #393939 100%) !important;
  box-shadow: inset 1px 0 0 var(--team-neutral-border-strong) !important;
  transform: none !important;
}

body.left-nav-layout #addStreamForm .team-member-source-remove:disabled {
  color: #9b9b9b !important;
  background: linear-gradient(180deg, #2d2d2d 0%, #232323 100%) !important;
  box-shadow: inset 1px 0 0 var(--team-neutral-border) !important;
  opacity: 0.58;
}

body.left-nav-layout #addStreamForm .team-member-add-button {
  color: #e8e8e8 !important;
  border-color: var(--team-neutral-border) !important;
  background: linear-gradient(180deg, #2a2a2a 0%, #202020 100%) !important;
  box-shadow: none !important;
  transform: none !important;
}

body.left-nav-layout #addStreamForm .team-member-add-button:hover {
  color: #ffffff !important;
  border-color: var(--team-neutral-border-strong) !important;
  background: linear-gradient(180deg, #3c3c3c 0%, #2c2c2c 100%) !important;
  box-shadow: none !important;
  transform: none !important;
}

body.left-nav-layout
  .stream-composer-host--team
  #addStreamForm
  .control-accent-button,
body.left-nav-layout
  .stream-composer-host--team
  #addStreamForm
  .control-accent-button:hover {
  color: var(--team-neutral-text) !important;
  border-color: var(--team-neutral-border-strong) !important;
  background: linear-gradient(180deg, #565656 0%, #393939 100%) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 4px 10px rgba(0, 0, 0, 0.24) !important;
}

body.left-nav-layout
  .stream-composer-host--team
  #addStreamForm
  .control-accent-button:hover {
  background: linear-gradient(180deg, #686868 0%, #484848 100%) !important;
}

body.left-nav-layout .control-section--team .team-mode-button.active-mode-button,
body.left-nav-layout .control-section--team #singleModeButton.active-mode-button,
body.left-nav-layout .control-section--team #dualModeButton.active-mode-button {
  color: var(--team-neutral-text) !important;
  border-color: var(--team-neutral-border-strong) !important;
  background: linear-gradient(180deg, #565656 0%, #393939 100%) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 4px 10px rgba(0, 0, 0, 0.24) !important;
}

.team-member-picker .team-name-label,
.team-picker-chevron,
.team-member-menu-heading,
.team-member-option-state {
  color: #a8a8a8;
}

.team-member-menu {
  color: #eeeeee;
  border-color: rgba(202, 202, 202, 0.42);
  background: rgba(17, 17, 17, 0.98);
}

.team-member-option {
  color: #e5e5e5;
}

.team-member-option:hover,
.team-member-option:focus-visible {
  color: #ffffff;
  border-color: var(--team-neutral-border-strong);
  background: rgba(255, 255, 255, 0.09);
}

.team-edit-button {
  color: #e7e7e7;
  border-color: var(--team-neutral-border);
  background: rgba(58, 58, 58, 0.94);
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.34);
}

.team-edit-button:hover,
.team-edit-button:focus-visible {
  color: #ffffff;
  border-color: var(--team-neutral-border-strong);
  background: #505050;
  outline-color: rgba(222, 222, 222, 0.24);
}

.team-editor-dialog {
  color: #eeeeee;
  border-color: rgba(202, 202, 202, 0.42);
  background: #151515;
}

.team-editor-kicker,
.team-editor-help,
.team-editor-field,
.team-editor-status {
  color: #bdbdbd;
}

.team-editor-field input,
.team-editor-field textarea {
  border-color: var(--team-neutral-border);
  background: #0c0c0c;
}

.team-editor-field input:focus-visible,
.team-editor-field textarea:focus-visible {
  border-color: var(--team-neutral-border-strong);
  outline-color: rgba(222, 222, 222, 0.18);
}

.team-editor-actions button,
.team-editor-actions .team-editor-primary {
  color: #eeeeee;
  border-color: var(--team-neutral-border);
  background: #303030;
}

/* Font Awesome's intrinsic side bearing can expose inherited button padding.
   Give every stream-removal glyph its own centered square instead. */
body.left-nav-layout #addStreamForm .team-member-source-remove > i,
body.popup-mode .stream .remove-button > i,
body.popup-mode .twitch-card-rail .remove-button > i {
  position: static !important;
  display: grid !important;
  place-items: center !important;
  box-sizing: border-box !important;
  width: 1em !important;
  height: 1em !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
  transform: none !important;
  pointer-events: none;
}

body.left-nav-layout #addStreamForm .team-member-source-remove > i::before,
body.popup-mode .stream .remove-button > i::before,
body.popup-mode .twitch-card-rail .remove-button > i::before {
  display: block;
  line-height: 1;
  transform: none !important;
}

body.popup-mode .stream .remove-button,
body.popup-mode .twitch-card-rail .remove-button {
  display: grid !important;
  align-content: center !important;
  align-items: center !important;
  justify-content: center !important;
  justify-items: center !important;
  place-items: center !important;
  padding: 0 !important;
  gap: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
}

/* ========================================================================
   Team editor: navigation-rail layout and larger grayscale typography

   The editor mirrors the Control Center rail with labeled sections, grouped
   row surfaces, compact icon tiles, and neutral interaction states.
   ======================================================================== */
.team-editor-dialog {
  box-sizing: border-box;
  width: min(680px, calc(100vw - 40px));
  max-height: min(780px, calc(100dvh - 32px));
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--team-neutral-text);
  border: 1px solid var(--team-neutral-border-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, #181818 0%, #101010 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.055),
    0 28px 80px rgba(0, 0, 0, 0.72);
  scrollbar-color: #5b5b5b #171717;
}

.team-editor-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(5px);
}

.team-editor-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.team-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--team-neutral-border);
}

.team-editor-heading,
.team-editor-field-heading {
  display: flex;
  align-items: center;
  min-width: 0;
}

.team-editor-heading {
  gap: 13px;
}

.team-editor-heading-icon,
.team-editor-field-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #f2f2f2;
  border: 1px solid var(--team-neutral-border);
  background: linear-gradient(180deg, #555555 0%, #383838 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.1);
}

.team-editor-heading-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 19px;
}

.team-editor-heading-copy,
.team-editor-field-copy {
  display: grid;
  min-width: 0;
}

.team-editor-heading-copy {
  gap: 4px;
}

.team-editor-kicker {
  color: #a9a9a9;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.team-editor-header h2 {
  margin: 0;
  color: #f4f4f4;
  font-size: 28px;
  font-weight: 780;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.team-editor-icon-button {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #e7e7e7;
  border: 1px solid var(--team-neutral-border);
  border-radius: 11px;
  background: linear-gradient(180deg, #303030 0%, #242424 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.055);
  font-size: 18px;
  cursor: pointer;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.team-editor-icon-button:hover {
  color: #ffffff;
  border-color: var(--team-neutral-border-strong);
  background: linear-gradient(180deg, #474747 0%, #343434 100%);
}

.team-editor-help {
  margin: 0;
  color: #c5c5c5;
  font-size: 15px;
  line-height: 1.55;
}

.team-editor-sections {
  display: grid;
  gap: 15px;
}

.team-editor-section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.team-editor-section-heading {
  padding-inline: 3px;
  color: #ababab;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.075em;
  line-height: 1.2;
  text-transform: uppercase;
}

.team-editor-group-shell {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--team-neutral-border);
  border-radius: 13px;
  background: linear-gradient(180deg, #1e1e1e 0%, #171717 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.045),
    0 4px 10px rgba(0, 0, 0, 0.18);
}

.team-editor-field {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  color: #eeeeee;
  font-size: 16px;
  font-weight: 600;
}

.team-editor-field-heading {
  gap: 11px;
}

.team-editor-field-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 16px;
}

.team-editor-field-copy {
  gap: 3px;
}

.team-editor-field-label {
  color: #f0f0f0;
  font-size: 16px;
  font-weight: 760;
  line-height: 1.2;
}

.team-editor-field-hint {
  color: #aaaaaa;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
}

.team-editor-field input,
.team-editor-field textarea {
  box-sizing: border-box;
  width: 100%;
  color: #f5f5f5;
  border: 1px solid var(--team-neutral-border);
  border-radius: 10px;
  outline: 0;
  background: #0d0d0d;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.team-editor-field input {
  min-height: 48px;
  padding: 0 14px;
}

.team-editor-field textarea {
  min-height: 128px;
  padding: 13px 14px;
  resize: vertical;
}

.team-editor-field input:hover,
.team-editor-field textarea:hover {
  border-color: rgba(224, 224, 224, 0.43);
  background: #111111;
}

.team-editor-field input:focus-visible,
.team-editor-field textarea:focus-visible {
  border-color: var(--team-neutral-border-strong);
  outline: 0;
  background: #111111;
  box-shadow: 0 0 0 3px rgba(222, 222, 222, 0.14);
}

.team-editor-status {
  margin: 0;
  color: #c8c8c8;
  font-size: 14.5px;
  line-height: 1.5;
}

.team-editor-status:empty {
  display: none;
}

.team-editor-status:not(:empty) {
  padding: 11px 13px;
  color: #ffdada;
  border: 1px solid rgba(211, 92, 92, 0.5);
  border-radius: 10px;
  background: rgba(116, 35, 35, 0.25);
}

.team-editor-actions {
  display: grid;
  grid-template-columns: auto minmax(18px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--team-neutral-border);
}

.team-editor-action-spacer {
  min-width: 18px;
}

.team-editor-action-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, auto));
  gap: 10px;
}

.team-editor-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  gap: 9px;
  color: #eeeeee;
  border: 1px solid var(--team-neutral-border);
  border-radius: 10px;
  background: linear-gradient(180deg, #303030 0%, #242424 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.055);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 760;
  line-height: 1;
  cursor: pointer;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.team-editor-actions button:hover {
  color: #ffffff;
  border-color: var(--team-neutral-border-strong);
  background: linear-gradient(180deg, #474747 0%, #343434 100%);
  transform: translateY(-1px);
}

.team-editor-actions button:active {
  transform: translateY(0) scale(0.985);
}

.team-editor-icon-button:focus-visible,
.team-editor-actions button:focus-visible {
  outline: 2px solid var(--team-neutral-focus);
  outline-offset: 2px;
}

.team-editor-actions .team-editor-primary,
.team-editor-actions .team-editor-primary:hover {
  color: #ffffff;
  border-color: var(--team-neutral-border-strong);
  background: linear-gradient(180deg, #5a5a5a 0%, #3e3e3e 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 4px 10px rgba(0, 0, 0, 0.22);
}

.team-editor-actions .team-editor-primary:hover {
  background: linear-gradient(180deg, #696969 0%, #4a4a4a 100%);
}

.team-editor-actions .team-editor-delete,
.team-editor-actions .team-editor-delete:hover {
  color: #dedede;
  border-color: var(--team-neutral-border);
  background: linear-gradient(180deg, #292929 0%, #202020 100%);
}

.team-editor-actions .team-editor-delete:hover {
  color: #ffffff;
  border-color: var(--team-neutral-border-strong);
  background: linear-gradient(180deg, #3d3d3d 0%, #2d2d2d 100%);
}

.team-editor-actions .team-editor-delete[data-confirming="true"],
.team-editor-actions .team-editor-delete[data-confirming="true"]:hover {
  color: #fff1f1;
  border-color: rgba(222, 103, 103, 0.72);
  background: linear-gradient(180deg, #8f3339 0%, #6f252b 100%);
}

@media (max-width: 620px) {
  .team-editor-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }

  .team-editor-form {
    gap: 14px;
    padding: 16px;
  }

  .team-editor-header {
    gap: 12px;
    padding-bottom: 14px;
  }

  .team-editor-heading {
    gap: 10px;
  }

  .team-editor-heading-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 17px;
  }

  .team-editor-header h2 {
    font-size: 24px;
  }

  .team-editor-icon-button {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }

  .team-editor-help {
    font-size: 14.5px;
  }

  .team-editor-sections {
    gap: 13px;
  }

  .team-editor-field {
    gap: 11px;
    padding: 12px;
  }

  .team-editor-field-label {
    font-size: 15.5px;
  }

  .team-editor-field-hint {
    font-size: 13px;
  }

  .team-editor-actions {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 14px;
  }

  .team-editor-action-spacer {
    display: none;
  }

  .team-editor-action-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-editor-actions .team-editor-delete {
    width: 100%;
  }

  .team-editor-actions button {
    min-height: 44px;
    padding-inline: 12px;
  }
}

@media (max-width: 390px) {
  .team-editor-action-group {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-height: 720px) and (min-width: 621px) {
  .team-editor-form {
    gap: 14px;
    padding: 20px;
  }

  .team-editor-header {
    padding-bottom: 14px;
  }

  .team-editor-field textarea {
    min-height: 100px;
  }

  .team-editor-actions {
    padding-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-editor-icon-button,
  .team-editor-field input,
  .team-editor-field textarea,
  .team-editor-actions button {
    transition: none;
  }
}

/* ========================================================================
   Empty Team stream and live-stream combiner
   ======================================================================== */
body.popup-mode #streamsGrid.overview-fit > .stream.empty-team-stream-card,
#streamsGrid > .stream.empty-team-stream-card {
  position: relative !important;
  order: -1 !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: grid !important;
  place-items: center !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: clamp(12px, 2.2vw, 28px) !important;
  overflow: hidden !important;
  cursor: default;
  border: 1px dashed rgba(207, 207, 207, 0.44) !important;
  border-radius: 10px !important;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.075), transparent 45%),
    linear-gradient(145deg, #181818 0%, #0c0c0c 100%) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.045),
    0 4px 18px rgba(0, 0, 0, 0.24) !important;
  aspect-ratio: auto;
  isolation: isolate;
  container-type: size;
}

body.popup-mode #streamsGrid.overview-fit > .stream.empty-team-stream-card:hover,
#streamsGrid > .stream.empty-team-stream-card:hover {
  border-color: rgba(232, 232, 232, 0.65) !important;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.1), transparent 48%),
    linear-gradient(145deg, #1c1c1c 0%, #101010 100%) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.34) !important;
  backdrop-filter: none;
}

body.popup-mode #streamsGrid > .stream.empty-team-stream-card
  > .empty-team-stream-close-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #f8dfe1;
  border: 1px solid rgba(181, 106, 113, 0.66);
  border-radius: 8px;
  background: #542326;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition:
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

body.popup-mode #streamsGrid > .stream.empty-team-stream-card
  > .empty-team-stream-close-button:hover,
body.popup-mode #streamsGrid > .stream.empty-team-stream-card
  > .empty-team-stream-close-button:focus-visible {
  color: #ffffff;
  border-color: #f3b4b9;
  background: #7a343b;
  transform: translateY(-1px);
}

body.popup-mode #streamsGrid > .stream.empty-team-stream-card
  > .empty-team-stream-close-button:focus-visible {
  outline: 2px solid rgba(255, 224, 227, 0.9);
  outline-offset: 2px;
}

/* The compact rail gives action rows an important display value. Preserve
   the native hidden contract for the wall restore action so it only occupies
   rail space after the wall has been closed. */
#showEmptyTeamStreamButton[hidden] {
  display: none !important;
}

.empty-team-stream-content {
  display: grid;
  justify-items: center;
  width: min(100%, 360px);
  gap: clamp(5px, 1.5cqh, 10px);
  color: #f2f2f2;
  text-align: center;
}

.empty-team-stream-icon {
  display: grid;
  place-items: center;
  width: clamp(38px, 10cqh, 58px);
  height: clamp(38px, 10cqh, 58px);
  margin-bottom: 2px;
  color: #f0f0f0;
  border: 1px solid rgba(220, 220, 220, 0.38);
  border-radius: 15px;
  background: linear-gradient(180deg, #4c4c4c 0%, #303030 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    0 6px 18px rgba(0, 0, 0, 0.3);
  font-size: clamp(16px, 4cqh, 23px);
}

.empty-team-stream-kicker {
  color: #a9a9a9;
  font-size: clamp(9px, 2.1cqh, 12px);
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.empty-team-stream-content h2 {
  margin: 0;
  color: #f5f5f5;
  font-size: clamp(17px, 5cqh, 26px);
  font-weight: 780;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.empty-team-stream-content p {
  margin: 0;
  color: #b8b8b8;
  font-size: clamp(11px, 2.7cqh, 14px);
  line-height: 1.4;
}

.empty-team-stream-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 330px);
  margin-top: clamp(2px, 1cqh, 6px);
  gap: 8px;
}

.empty-team-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(34px, 8cqh, 44px);
  min-width: 0;
  padding: 0 clamp(9px, 2.5cqw, 15px);
  gap: 8px;
  color: #f7f7f7;
  border: 1px solid rgba(224, 224, 224, 0.48);
  border-radius: 10px;
  background: linear-gradient(180deg, #585858 0%, #393939 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.13),
    0 5px 14px rgba(0, 0, 0, 0.28);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: clamp(11px, 2.8cqh, 15px);
  font-weight: 780;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.empty-team-action-button:hover,
.empty-team-action-button:focus-visible {
  border-color: rgba(245, 245, 245, 0.76);
  background: linear-gradient(180deg, #696969 0%, #494949 100%);
  transform: translateY(-1px);
}

.empty-team-action-button:focus-visible {
  outline: 2px solid var(--team-neutral-focus);
  outline-offset: 3px;
}

.empty-team-create-button {
  background: linear-gradient(180deg, #4b4b4b 0%, #303030 100%);
}

#streamsGrid[data-stream-control-density="tight"] .empty-team-stream-content {
  gap: 4px;
}

#streamsGrid[data-stream-control-density="tight"] .empty-team-stream-icon {
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 9px;
  font-size: 14px;
}

#streamsGrid[data-stream-control-density="tight"] .empty-team-stream-content p {
  display: none;
}

#streamsGrid[data-stream-control-density="tight"] .empty-team-stream-actions {
  gap: 5px;
}

#streamsGrid[data-stream-control-density="tight"] .empty-team-action-button {
  min-height: 28px;
  padding-inline: 11px;
  border-radius: 7px;
  font-size: 10px;
}

.stream-composer-dialog {
  box-sizing: border-box;
  width: min(75vw, calc(100vw - 40px));
  height: min(75dvh, calc(100dvh - 32px));
  max-width: none;
  max-height: min(75dvh, calc(100dvh - 32px));
  margin: auto;
  overflow-y: auto;
}

.stream-composer-dialog-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.stream-composer-dialog-body {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--team-neutral-border);
  border-radius: 12px;
  background: #1a1a1a;
}

.stream-composer-dialog-body .stream-composer-host {
  width: 100%;
}

.stream-composer-dialog-body #addStreamForm {
  gap: 12px;
}

.stream-composer-dialog #addStreamForm .control-accent-button {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 44px !important;
  height: 44px !important;
  justify-content: center;
  border-color: var(--team-neutral-border-strong) !important;
  border-radius: 9px !important;
  background: linear-gradient(180deg, #555555 0%, #393939 100%) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12) !important;
  font-size: 14px !important;
}

.stream-composer-dialog #addStreamForm .control-accent-button:hover {
  background: linear-gradient(180deg, #666666 0%, #484848 100%) !important;
}

.stream-composer-dialog-actions {
  padding-top: 0;
}

.team-builder-dialog {
  width: min(760px, calc(100vw - 40px));
}

@media (max-width: 520px) {
  .empty-team-stream-actions {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 220px);
  }

  .stream-composer-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .stream-composer-dialog-form {
    gap: 14px;
    padding: 16px;
  }
}

.team-editor-manage-dialog {
  width: min(760px, calc(100vw - 40px));
}

.team-builder-live-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.team-builder-live-list {
  display: grid;
  max-height: min(310px, 38dvh);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: #5b5b5b #171717;
}

.team-builder-stream-option {
  position: relative;
  display: grid;
  grid-template-columns: 34px 34px minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  min-height: 62px;
  padding: 10px 13px;
  gap: 11px;
  color: #eeeeee;
  border-bottom: 1px solid var(--team-neutral-border);
  background: transparent;
  cursor: pointer;
  transition:
    background 150ms ease,
    box-shadow 150ms ease;
}

.team-builder-stream-option:last-child {
  border-bottom: 0;
}

.team-builder-stream-option:hover,
.team-builder-stream-option:has(input:focus-visible) {
  background: rgba(255, 255, 255, 0.055);
}

.team-builder-stream-option:has(input:checked) {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 3px 0 #bdbdbd;
}

.team-builder-stream-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.team-builder-stream-check {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: transparent;
  border: 1px solid rgba(205, 205, 205, 0.42);
  border-radius: 9px;
  background: #101010;
  font-size: 13px;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.team-builder-stream-option input:checked + .team-builder-stream-check {
  color: #ffffff;
  border-color: rgba(238, 238, 238, 0.7);
  background: linear-gradient(180deg, #606060 0%, #414141 100%);
}

.team-builder-stream-option input:focus-visible + .team-builder-stream-check {
  outline: 2px solid var(--team-neutral-focus);
  outline-offset: 2px;
}

.team-builder-stream-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  overflow: hidden;
  color: #d9d9d9;
  border: 1px solid rgba(205, 205, 205, 0.42);
  border-radius: 9px;
  background: #101010;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.team-builder-stream-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-builder-stream-details {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.team-builder-stream-details strong,
.team-builder-stream-details span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-builder-stream-details strong {
  color: #f2f2f2;
  font-size: 16px;
  font-weight: 760;
}

.team-builder-stream-details span {
  color: #a9a9a9;
  font-size: 13px;
  font-weight: 550;
}

.team-builder-live-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  gap: 6px;
  color: #d5d5d5;
  border: 1px solid rgba(204, 204, 204, 0.3);
  border-radius: 999px;
  background: #282828;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.team-builder-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #43d77d;
  box-shadow: 0 0 0 3px rgba(67, 215, 125, 0.12);
}

.team-editor-member-badge.is-removing {
  color: #b7b7b7;
  border-color: rgba(187, 187, 187, 0.24);
  background: #202020;
}

.team-editor-member-badge.is-removing .team-builder-live-dot {
  background: #777777;
  box-shadow: none;
}

.team-builder-empty-message {
  margin: 0;
  padding: 22px 16px;
  color: #adadad;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.team-builder-actions {
  grid-template-columns: minmax(0, 1fr) auto;
}

.team-editor-management-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-editor-actions .team-editor-ungroup,
.team-editor-actions .team-editor-ungroup:hover {
  color: #f0f0f0;
  border-color: rgba(213, 213, 213, 0.4);
  background: linear-gradient(180deg, #444444 0%, #303030 100%);
}

.team-editor-actions .team-editor-ungroup:hover {
  color: #ffffff;
  border-color: rgba(236, 236, 236, 0.62);
  background: linear-gradient(180deg, #565656 0%, #3c3c3c 100%);
}

@media (max-width: 620px) {
  .team-builder-dialog {
    width: calc(100vw - 16px);
  }

  .team-editor-manage-dialog {
    width: calc(100vw - 16px);
  }

  .team-builder-stream-option {
    grid-template-columns: 32px 32px minmax(0, 1fr);
    min-height: 58px;
    padding: 9px 11px;
    gap: 9px;
  }

  .team-builder-live-badge {
    display: none;
  }

  .team-builder-stream-avatar {
    width: 30px;
    height: 30px;
  }

  .team-builder-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .team-builder-actions .team-editor-action-group {
    width: 100%;
  }

  .team-editor-management-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .team-editor-management-actions button {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .team-editor-management-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .empty-team-add-button,
  .team-builder-stream-option,
  .team-builder-stream-check {
    transition: none;
  }
}

/* ========================================================================
   Embedded Watch Party control hierarchy and navigation cues
   ======================================================================== */
body.left-nav-layout .dashboard-navigation-cue {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  margin-left: auto;
  color: #f5f5f5;
  border: 1px solid rgba(218, 218, 218, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, #474747 0%, #303030 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.1);
  font-size: 12px;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

body.left-nav-layout .top-return-dashboard-button:hover .dashboard-navigation-cue,
body.left-nav-layout .top-return-dashboard-button:focus-visible .dashboard-navigation-cue {
  border-color: rgba(245, 245, 245, 0.7);
  background: linear-gradient(180deg, #5b5b5b 0%, #3d3d3d 100%);
  transform: translateX(2px);
}

body.left-nav-layout .control-section--watch-party {
  order: -1;
  gap: 0;
}

body.left-nav-layout .watch-party-control-menu {
  position: relative;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(218, 218, 218, 0.46);
  border-radius: 12px;
  background: linear-gradient(180deg, #242424 0%, #151515 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 7px 18px rgba(0, 0, 0, 0.22);
}

body.left-nav-layout #watchPartyPanelButton {
  position: relative;
  width: 100%;
  min-height: 64px !important;
  height: auto !important;
  padding: 9px 10px !important;
  gap: 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: linear-gradient(180deg, #333333 0%, #242424 100%) !important;
  box-shadow: none !important;
}

body.left-nav-layout #watchPartyPanelButton::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #bcbcbc;
  content: "";
}

body.left-nav-layout #watchPartyPanelButton:hover,
body.left-nav-layout #watchPartyPanelButton:focus-visible,
body.left-nav-layout #watchPartyPanelButton[aria-expanded="true"] {
  background: linear-gradient(180deg, #414141 0%, #2d2d2d 100%) !important;
}

body.left-nav-layout #watchPartyPanelButton[aria-expanded="true"]::before {
  background: #f1f1f1;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

body.left-nav-layout #watchPartyPanelButton > i:first-child {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 42px !important;
  width: 42px !important;
  height: 42px !important;
  color: #ffffff !important;
  border: 1px solid rgba(226, 226, 226, 0.42) !important;
  border-radius: 11px !important;
  background: linear-gradient(180deg, #5a5a5a 0%, #3e3e3e 100%) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
  font-size: 18px !important;
}

body.left-nav-layout .watch-party-control-copy {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 3px;
  text-align: left;
}

body.left-nav-layout .watch-party-control-copy .nav-button-label {
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 760 !important;
  letter-spacing: -0.01em;
  line-height: 1.15 !important;
  white-space: normal !important;
}

body.left-nav-layout .watch-party-control-description {
  overflow: hidden;
  color: #a9a9a9;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.left-nav-layout .watch-party-control-disclosure {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  color: #f2f2f2;
  border: 1px solid rgba(218, 218, 218, 0.3);
  border-radius: 8px;
  background: #303030;
  font-size: 11px;
  transition:
    border-color 150ms ease,
    background 150ms ease;
}

body.left-nav-layout .watch-party-control-disclosure > i {
  transition: transform 180ms ease;
}

body.left-nav-layout
  #watchPartyPanelButton[aria-expanded="true"]
  .watch-party-control-disclosure {
  border-color: rgba(245, 245, 245, 0.62);
  background: #505050;
}

body.left-nav-layout
  #watchPartyPanelButton[aria-expanded="true"]
  .watch-party-control-disclosure
  > i {
  transform: rotate(180deg);
}

body.left-nav-layout .watch-party-control-panel {
  position: static;
  inset: auto;
  z-index: auto;
  width: 100%;
  max-width: none;
  padding: 9px 10px 10px;
  color: #f4f4f4;
  border: 0;
  border-top: 1px solid rgba(218, 218, 218, 0.2);
  border-radius: 0;
  background: #191919;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.left-nav-layout .watch-party-control-panel[hidden] {
  display: none;
}

body.left-nav-layout .watch-party-control-panel:focus {
  outline: none;
}

body.left-nav-layout .watch-party-control-panel .party-session-heading {
  gap: 8px;
  margin-bottom: 7px;
}

body.left-nav-layout .watch-party-control-panel .party-session-title {
  color: #cfcfcf;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.09em;
}

body.left-nav-layout .watch-party-control-panel .party-session-heading-actions {
  gap: 6px;
}

body.left-nav-layout .watch-party-control-panel .party-session-status {
  gap: 5px;
  font-size: 12px;
  font-weight: 650;
}

body.left-nav-layout .watch-party-control-panel .party-session-status::before {
  width: 6px;
  height: 6px;
}

body.left-nav-layout .watch-party-control-panel .party-session-close {
  width: 24px;
  height: 24px;
  color: #d7d7d7;
  border-color: rgba(218, 218, 218, 0.22);
  background: #292929;
}

body.left-nav-layout .watch-party-control-panel .party-session-close:hover {
  border-color: rgba(245, 245, 245, 0.5);
  background: #3a3a3a;
}

body.left-nav-layout .watch-party-control-panel .party-session-source-row {
  min-height: 44px;
  padding: 6px 8px;
  gap: 8px;
  color: #dddddd;
  border-color: rgba(218, 218, 218, 0.2);
  border-radius: 8px;
  background: #222222;
  box-shadow: none;
}

body.left-nav-layout .watch-party-control-panel .party-session-source-row:hover,
body.left-nav-layout .watch-party-control-panel .party-session-source-row:focus-visible {
  color: #ffffff;
  border-color: rgba(245, 245, 245, 0.45);
  background: #2d2d2d;
}

body.left-nav-layout .watch-party-control-panel .party-session-source-icon {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  color: #ededed;
  border: 1px solid rgba(205, 205, 205, 0.26);
  border-radius: 7px;
  background: #303030;
  font-size: 12px;
}

body.left-nav-layout .watch-party-control-panel .party-session-source-label {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.left-nav-layout .watch-party-control-panel .party-session-source-copy-cue {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  color: #bcbcbc;
  border: 1px solid rgba(205, 205, 205, 0.2);
  border-radius: 6px;
  background: #272727;
  font-size: 10px;
}

body.left-nav-layout .watch-party-control-panel .party-session-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}

body.left-nav-layout .watch-party-control-panel .party-session-button {
  width: 100%;
  min-height: 34px;
  padding: 6px 7px;
  color: #ededed;
  border-color: rgba(218, 218, 218, 0.22);
  border-radius: 7px;
  background: linear-gradient(180deg, #303030 0%, #252525 100%);
  font-size: 12px;
  font-weight: 680;
}

body.left-nav-layout
  .watch-party-control-panel
  .party-session-button:hover:not(:disabled) {
  border-color: rgba(245, 245, 245, 0.5);
  background: linear-gradient(180deg, #414141 0%, #303030 100%);
}

body.left-nav-layout
  .watch-party-control-panel
  .party-session-button-accent,
body.left-nav-layout
  .watch-party-control-panel
  .party-session-button-accent:hover:not(:disabled) {
  color: #ffffff;
  border-color: rgba(245, 245, 245, 0.46);
  background: linear-gradient(180deg, #5a5a5a 0%, #3d3d3d 100%);
}

/* Watch Party live-window capacity

   Capacity controls the Live Window rather than stream creation, so it stays
   visible as its own high-priority subsection inside the Watch Party card.
   */
body.left-nav-layout .watch-party-capacity-control {
  padding: 9px 8px 8px;
  border-top: 1px solid rgba(218, 218, 218, 0.2);
  background: #171717;
}

body.left-nav-layout .watch-party-capacity-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  padding: 0 2px 7px;
}

body.left-nav-layout .watch-party-capacity-icon {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  color: #f0f0f0;
  border: 1px solid rgba(218, 218, 218, 0.3);
  border-radius: 8px;
  background: linear-gradient(180deg, #4b4b4b 0%, #323232 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

body.left-nav-layout .watch-party-capacity-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

body.left-nav-layout .watch-party-capacity-title {
  color: #f1f1f1;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.035em;
  line-height: 1.1;
}

body.left-nav-layout .watch-party-capacity-description {
  color: #9f9f9f;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
}

body.left-nav-layout .watch-party-capacity-control .mode-buttons {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-rows: 30px;
  width: 100%;
  min-height: 70px;
  margin: 0;
  padding: 4px;
  gap: 2px;
  overflow: hidden;
  border: 1px solid rgba(218, 218, 218, 0.25);
  border-radius: 9px;
  background: linear-gradient(180deg, #111111 0%, #0d0d0d 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

body.left-nav-layout .watch-party-capacity-control .team-mode-button,
body.left-nav-layout .watch-party-capacity-control #singleModeButton,
body.left-nav-layout .watch-party-capacity-control #dualModeButton {
  display: grid !important;
  position: relative;
  grid-template-columns: minmax(0, 1fr) !important;
  align-content: center !important;
  align-items: center !important;
  justify-content: stretch !important;
  justify-items: stretch !important;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  height: 30px;
  margin: 0;
  padding: 0 5px;
  gap: 0;
  color: #d9d9d9 !important;
  border: 1px solid rgba(218, 218, 218, 0.18) !important;
  border-radius: 5px;
  background: linear-gradient(180deg, #292929 0%, #202020 100%) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04) !important;
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.32px;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  transform: none;
  transition:
    color 150ms ease,
    border-color 160ms ease,
    background 180ms ease,
    transform 160ms ease;
}

body.left-nav-layout
  .watch-party-capacity-control
  .team-mode-button
  .nav-button-label {
  display: block !important;
  flex: none !important;
  justify-self: stretch !important;
  min-width: 0;
  width: 100% !important;
  max-width: none !important;
  margin: 0;
  overflow: visible;
  line-height: 1 !important;
  text-align: center !important;
  text-overflow: clip;
}

body.left-nav-layout .watch-party-capacity-control .team-mode-button:hover {
  color: #ffffff !important;
  border-color: rgba(238, 238, 238, 0.46) !important;
  background: linear-gradient(180deg, #3b3b3b 0%, #2b2b2b 100%) !important;
  transform: translateY(-1px);
}

body.left-nav-layout .watch-party-capacity-control .team-mode-button:active {
  transform: translateY(0) scale(0.985);
}

body.left-nav-layout .watch-party-capacity-control .team-mode-button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid rgba(238, 238, 238, 0.82);
  outline-offset: 1px;
}

body.left-nav-layout
  #liveWindowCapacityControl
  .team-mode-button.active-mode-button,
body.left-nav-layout
  #liveWindowCapacityControl
  .team-mode-button[aria-pressed="true"] {
  color: #ffffff !important;
  border-color: #9bbcff !important;
  background: linear-gradient(180deg, #3478ff 0%, #1747bd 100%) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    0 0 0 1px rgba(73, 132, 255, 0.34),
    0 4px 12px rgba(18, 73, 190, 0.42) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.44);
}

body.left-nav-layout
  #liveWindowCapacityControl
  .team-mode-button.active-mode-button::after,
body.left-nav-layout
  #liveWindowCapacityControl
  .team-mode-button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #eaf1ff;
  box-shadow: 0 0 0 2px rgba(234, 241, 255, 0.22);
}

body.left-nav-layout .watch-party-control-tools {
  padding: 0 8px;
  border-top: 1px solid rgba(218, 218, 218, 0.18);
  background: #171717;
}

body.left-nav-layout #multipleLobbiesToggle[hidden],
body.left-nav-layout .lobby-switcher[hidden] {
  display: none !important;
}

body.left-nav-layout .browser-source-code-badge {
  display: inline-grid;
  place-items: center;
  flex: 0 0 56px;
  min-width: 56px;
  height: 25px;
  margin-left: auto;
  padding: 0 6px;
  color: #dbe8ff;
  border: 1px solid rgba(127, 169, 255, 0.5);
  border-radius: 6px;
  background: rgba(45, 76, 132, 0.36);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
}

body.left-nav-layout #ocrKillsToggle.watch-party-control-tool {
  width: 100%;
  min-height: 48px !important;
  height: 48px !important;
  padding: 0 9px !important;
  gap: 9px !important;
  color: #dddddd !important;
  border: 0 !important;
  border-top: 1px solid rgba(218, 218, 218, 0.14) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 14px !important;
}

body.left-nav-layout #ocrKillsToggle.watch-party-control-tool:hover,
body.left-nav-layout #ocrKillsToggle.watch-party-control-tool:focus-visible {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.045) !important;
}

body.left-nav-layout
  #ocrKillsToggle.watch-party-control-tool
  > i:first-child {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 34px !important;
  width: 34px !important;
  height: 34px !important;
  color: #ededed !important;
  border: 1px solid rgba(205, 205, 205, 0.26) !important;
  border-radius: 8px !important;
  background: #303030 !important;
  font-size: 14px !important;
}

body.left-nav-layout
  #ocrKillsToggle.watch-party-control-tool
  .nav-button-label {
  color: inherit !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

body.left-nav-layout #ocrKillsToggle .status-chip {
  display: grid !important;
  flex: 0 0 50px !important;
  width: 50px !important;
  min-width: 50px !important;
  height: 24px !important;
  min-height: 24px !important;
  margin-left: auto !important;
  padding: 0 !important;
  place-items: center !important;
  border: 1px solid rgba(200, 91, 83, 0.58) !important;
  border-radius: 6px !important;
  background: linear-gradient(180deg, #6a302d 0%, #4a211f 100%) !important;
  color: #fff4f2 !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  line-height: 1 !important;
}

body.left-nav-layout #ocrKillsToggle.active .status-chip {
  color: var(--control-on-chip-text) !important;
  border-color: var(--control-on-chip-border) !important;
  background: var(--control-on-chip-background) !important;
  box-shadow: var(--control-on-chip-shadow) !important;
}

body.left-nav-layout #multipleLobbiesToggle.watch-party-control-tool {
  width: 100%;
  min-height: 48px !important;
  height: 48px !important;
  padding: 0 9px !important;
  gap: 9px !important;
  color: #dddddd !important;
  border: 0 !important;
  border-top: 1px solid rgba(218, 218, 218, 0.14) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 14px !important;
}

body.left-nav-layout #multipleLobbiesToggle.watch-party-control-tool:hover,
body.left-nav-layout #multipleLobbiesToggle.watch-party-control-tool:focus-visible {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.045) !important;
}

body.left-nav-layout
  #multipleLobbiesToggle.watch-party-control-tool
  > i:first-child {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 34px !important;
  width: 34px !important;
  height: 34px !important;
  color: #ededed !important;
  border: 1px solid rgba(205, 205, 205, 0.26) !important;
  border-radius: 8px !important;
  background: #303030 !important;
  font-size: 14px !important;
}

body.left-nav-layout
  #multipleLobbiesToggle.watch-party-control-tool
  .nav-button-label {
  color: inherit !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

body.left-nav-layout #multipleLobbiesToggle .status-chip {
  display: grid !important;
  flex: 0 0 50px !important;
  width: 50px !important;
  min-width: 50px !important;
  height: 24px !important;
  min-height: 24px !important;
  margin-left: auto !important;
  padding: 0 !important;
  place-items: center !important;
  border: 1px solid rgba(200, 91, 83, 0.58) !important;
  border-radius: 6px !important;
  background: linear-gradient(180deg, #6a302d 0%, #4a211f 100%) !important;
  color: #fff4f2 !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  line-height: 1 !important;
}

body.left-nav-layout #multipleLobbiesToggle.active .status-chip {
  color: var(--control-on-chip-text) !important;
  border-color: var(--control-on-chip-border) !important;
  background: var(--control-on-chip-background) !important;
  box-shadow: var(--control-on-chip-shadow) !important;
}

@media (max-height: 940px) {
  body.left-nav-layout #watchPartyPanelButton {
    min-height: 56px !important;
    padding-block: 7px !important;
  }

  body.left-nav-layout #watchPartyPanelButton > i:first-child {
    flex-basis: 38px !important;
    width: 38px !important;
    height: 38px !important;
  }

  body.left-nav-layout #ocrKillsToggle.watch-party-control-tool {
    min-height: 44px !important;
    height: 44px !important;
  }

  body.left-nav-layout #multipleLobbiesToggle.watch-party-control-tool {
    min-height: 44px !important;
    height: 44px !important;
  }

  body.left-nav-layout .watch-party-control-panel {
    padding: 7px 8px 8px;
  }

  body.left-nav-layout .watch-party-control-panel .party-session-button {
    min-height: 31px;
  }

  body.left-nav-layout .watch-party-capacity-control {
    padding: 7px 8px;
  }

  body.left-nav-layout .watch-party-capacity-heading {
    min-height: 28px;
    padding-bottom: 6px;
  }

  body.left-nav-layout .watch-party-capacity-control .mode-buttons {
    grid-auto-rows: 27px;
    min-height: 64px;
  }

  body.left-nav-layout .watch-party-capacity-control .team-mode-button,
  body.left-nav-layout .watch-party-capacity-control #singleModeButton,
  body.left-nav-layout .watch-party-capacity-control #dualModeButton {
    min-height: 27px;
    height: 27px;
    font-size: 10.5px;
  }
}

@media (max-height: 820px) {
  body.left-nav-layout .watch-party-capacity-control {
    padding-block: 6px;
  }

  body.left-nav-layout .watch-party-capacity-heading {
    min-height: 26px;
    padding-bottom: 5px;
  }

  body.left-nav-layout .watch-party-capacity-icon {
    flex-basis: 27px;
    width: 27px;
    height: 27px;
  }

  body.left-nav-layout .watch-party-capacity-control .mode-buttons {
    grid-auto-rows: 24px;
    min-height: 56px;
    padding: 3px;
  }

  body.left-nav-layout .watch-party-capacity-control .team-mode-button,
  body.left-nav-layout .watch-party-capacity-control #singleModeButton,
  body.left-nav-layout .watch-party-capacity-control #dualModeButton {
    min-height: 24px;
    height: 24px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.left-nav-layout .dashboard-navigation-cue,
  body.left-nav-layout .watch-party-control-disclosure,
  body.left-nav-layout .watch-party-control-disclosure > i,
  body.left-nav-layout .watch-party-capacity-control .team-mode-button {
    transition: none;
  }
}

/* ========================================================================
   Coming soon caution-tape lockouts

   Keep unfinished settings visible in the navigation while making their
   unavailable state unmistakable and genuinely non-interactive.
   ======================================================================== */
.coming-soon-setting {
  position: relative;
  isolation: isolate;
}

.coming-soon-sticker {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  width: 154px;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  padding: 5px 32px;
  overflow: hidden;
  color: #181818;
  border: 2px solid #171717;
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(-2.5deg);
  transform-origin: center;
  background: #b9b9b9;
  box-shadow:
    inset 0 2px rgba(255, 255, 255, 0.62),
    inset 0 -2px rgba(45, 45, 45, 0.24),
    0 5px 10px rgba(0, 0, 0, 0.42);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.11em;
  line-height: 1;
  pointer-events: none;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 6;
}

.coming-soon-sticker::before,
.coming-soon-sticker::after {
  content: "";
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 28px;
  background: repeating-linear-gradient(
    135deg,
    #171717 0 6px,
    #b9b9b9 6px 12px
  );
}

.coming-soon-sticker::before {
  left: -4px;
}

.coming-soon-sticker::after {
  right: -4px;
}

.coming-soon-controls {
  opacity: 0.42;
  filter: grayscale(0.5) saturate(0.3);
  pointer-events: none;
  user-select: none;
}

.coming-soon-setting button:disabled {
  cursor: not-allowed !important;
}

body.left-nav-layout
  #volumeStabilizationContainer
  .coming-soon-sticker {
  top: 50%;
  right: 9px;
  left: auto;
  width: 154px;
  transform: translateY(-50%) rotate(-2.5deg);
}

/* ========================================================================
   Stream action row dividers

   Keep these three actions visually grouped like the other stacked command
   rows, even when later theme layers reset the buttons' borders.
   ======================================================================== */
body.left-nav-layout
  .control-row-group--stream-actions
  > :is(#refreshPageButton, #removeOfflineStreamsButton) {
  border-top: 1px solid var(--left-rail-divider) !important;
}

/* ========================================================================
   Team builder: centered viewport-fit workspace

   The dialog itself stays fixed inside the viewport. Only the live-stream
   picker scrolls, so the header, fields, and actions remain visible.
   ======================================================================== */
.team-builder-dialog {
  inset: 0;
  width: min(1040px, calc(100vw - 32px));
  height: min(900px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  overflow: hidden;
}

.team-builder-form {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  height: 100%;
  min-height: 0;
  padding: 18px;
  gap: 12px;
  overflow: hidden;
}

.team-builder-form > .team-editor-header {
  padding-bottom: 12px;
}

.team-builder-form > .team-editor-help {
  line-height: 1.4;
}

.team-builder-form > .team-editor-sections {
  display: grid;
  grid-template-areas:
    "details"
    "live"
    "additional";
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(96px, 1fr) auto;
  min-height: 0;
  gap: 12px;
}

.team-builder-details-section {
  grid-area: details;
}

.team-builder-live-section {
  grid-area: live;
  min-height: 0;
}

.team-builder-additional-section {
  grid-area: additional;
}

.team-builder-live-section > .team-editor-group-shell,
.team-builder-live-fieldset,
.team-builder-live-list {
  height: 100%;
  min-height: 0;
}

.team-builder-live-list {
  max-height: none;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.team-builder-live-list::-webkit-scrollbar {
  width: 10px;
}

.team-builder-live-list::-webkit-scrollbar-track {
  background: #171717;
}

.team-builder-live-list::-webkit-scrollbar-thumb {
  border: 2px solid #171717;
  border-radius: 999px;
  background: #666666;
  background-clip: padding-box;
}

.team-builder-live-list::-webkit-scrollbar-button,
.team-builder-live-list::-webkit-scrollbar-corner {
  display: none;
  width: 0;
  height: 0;
}

.team-builder-form .team-editor-field {
  padding: 12px;
  gap: 10px;
}

.team-builder-form .team-editor-field input {
  min-height: 44px;
}

.team-builder-form > .team-editor-actions {
  padding-top: 12px;
}

@media (min-width: 840px) {
  .team-builder-form > .team-editor-sections {
    grid-template-areas:
      "details additional"
      "live live";
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto minmax(160px, 1fr);
  }

  .team-builder-live-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
  }

  .team-builder-stream-option {
    min-height: 48px;
    padding-block: 3px;
  }

  .team-builder-stream-option:nth-child(odd) {
    border-right: 1px solid var(--team-neutral-border);
  }

  .team-builder-stream-option:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .team-builder-stream-option:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    border-right: 0;
  }
}

@media (max-width: 620px) {
  .team-builder-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .team-builder-form {
    padding: 14px;
    gap: 10px;
  }

  .team-builder-form > .team-editor-sections {
    gap: 10px;
  }

  .team-builder-actions .team-editor-action-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-height: 720px) {
  .team-builder-form {
    padding: 12px 14px;
    gap: 8px;
  }

  .team-builder-form > .team-editor-header,
  .team-builder-form > .team-editor-actions {
    padding-block: 8px;
  }

  .team-builder-form .team-editor-field {
    padding: 9px 10px;
    gap: 7px;
  }

  .team-builder-form .team-editor-field-icon {
    width: 34px;
    height: 34px;
  }

  .team-builder-form .team-editor-field input {
    min-height: 38px;
  }

  .team-builder-form .team-editor-actions button {
    min-height: 40px;
  }
}

/* ========================================================================
   Team logo picker and Team-card identity
   ======================================================================== */
.team-logo-picker {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  gap: 11px;
  border-top: 1px solid var(--team-neutral-border);
}

.team-logo-preview {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  overflow: hidden;
  place-items: center;
  color: #d7d7d7;
  border: 1px solid rgba(220, 220, 220, 0.38);
  border-radius: 12px;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.12), transparent 42%),
    linear-gradient(145deg, #4a4a4a 0%, #272727 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 4px 10px rgba(0, 0, 0, 0.22);
  font-size: 18px;
  isolation: isolate;
}

.team-logo-placement-stage.has-logo {
  cursor: grab;
}

.team-logo-placement-stage.has-logo.is-dragging {
  cursor: grabbing;
}

.team-logo-placement-stage:focus-visible {
  border-color: rgba(245, 245, 245, 0.82);
  outline: 3px solid rgba(222, 222, 222, 0.16);
  outline-offset: 2px;
}

.team-logo-placement-stage.has-logo::after {
  position: absolute;
  inset: 7px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 7px;
  background:
    linear-gradient(
      90deg,
      transparent calc(50% - 0.5px),
      rgba(255, 255, 255, 0.46) calc(50% - 0.5px),
      rgba(255, 255, 255, 0.46) calc(50% + 0.5px),
      transparent calc(50% + 0.5px)
    ),
    linear-gradient(
      transparent calc(50% - 0.5px),
      rgba(255, 255, 255, 0.46) calc(50% - 0.5px),
      rgba(255, 255, 255, 0.46) calc(50% + 0.5px),
      transparent calc(50% + 0.5px)
    );
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.team-logo-placement-stage.has-logo:hover::after,
.team-logo-placement-stage.has-logo:focus-visible::after,
.team-logo-placement-stage.has-logo.is-dragging::after {
  opacity: 1;
}

.team-logo-placeholder,
.team-logo-preview-image {
  width: 100%;
  height: 100%;
}

.team-logo-placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.team-logo-preview-image,
.team-card-logo-image,
.team-member-menu-logo-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: translate3d(
      var(--team-logo-x, 0%),
      var(--team-logo-y, 0%),
      0
    )
    scale(var(--team-logo-scale, 0.9));
  transform-origin: center;
  will-change: transform;
}

.team-logo-placeholder[hidden],
.team-logo-preview-image[hidden],
.team-logo-adjust[hidden],
.team-logo-remove[hidden],
.team-logo-adjustments[hidden] {
  display: none !important;
}

.team-logo-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.team-logo-copy .team-editor-field-hint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-logo-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.team-logo-size-control {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr) 42px;
  align-items: center;
  min-width: 0;
  gap: 9px;
  color: #d7d7d7;
  font-size: 11.5px;
  font-weight: 720;
}

.team-logo-adjustment-label,
.team-logo-drag-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.team-logo-adjustment-label i,
.team-logo-drag-hint i {
  color: #aaaaaa;
  font-size: 10px;
}

.team-logo-size-control input[type="range"] {
  width: 100%;
  min-width: 90px;
  height: 18px;
  margin: 0;
  accent-color: #c7c7c7;
  cursor: ew-resize;
}

.team-logo-size-control output,
.team-logo-position-value {
  color: #ededed;
  font-size: 11px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.team-logo-size-control output {
  text-align: right;
}

.team-logo-position-control {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  gap: 9px;
}

.team-logo-drag-hint {
  color: #adadad;
  font-size: 11px;
  font-weight: 650;
}

.team-logo-position-value {
  flex: 1 1 auto;
  min-width: 76px;
  overflow: hidden;
  color: #bdbdbd;
  text-align: left;
  text-overflow: ellipsis;
}

.team-logo-choose,
.team-logo-adjust,
.team-logo-remove,
.team-logo-center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 11px;
  gap: 7px;
  color: #eeeeee;
  border: 1px solid var(--team-neutral-border);
  border-radius: 9px;
  background: linear-gradient(180deg, #3b3b3b 0%, #292929 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 12.5px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.team-logo-remove,
.team-logo-adjust,
.team-logo-center {
  color: #cccccc;
  background: linear-gradient(180deg, #2b2b2b 0%, #202020 100%);
}

.team-logo-center {
  min-height: 30px;
  padding-inline: 9px;
  font-size: 11px;
}

.team-logo-choose:hover,
.team-logo-choose:focus-visible,
.team-logo-adjust:hover,
.team-logo-adjust:focus-visible,
.team-logo-remove:hover,
.team-logo-remove:focus-visible,
.team-logo-center:hover,
.team-logo-center:focus-visible {
  color: #ffffff;
  border-color: var(--team-neutral-border-strong);
  outline: 0;
  background: linear-gradient(180deg, #555555 0%, #393939 100%);
  transform: translateY(-1px);
}

.team-logo-choose:focus-visible,
.team-logo-adjust:focus-visible,
.team-logo-remove:focus-visible,
.team-logo-center:focus-visible {
  box-shadow: 0 0 0 3px rgba(222, 222, 222, 0.14);
}

.team-logo-placement-dialog {
  width: min(680px, calc(100vw - 24px));
  max-width: 680px;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: #f3f3f3;
  border: 1px solid rgba(224, 224, 224, 0.46);
  border-radius: 18px;
  background: linear-gradient(155deg, #1f1f1f 0%, #111111 72%);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.72),
    inset 0 1px rgba(255, 255, 255, 0.07);
}

.team-logo-placement-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.team-logo-placement-form {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  max-height: calc(100dvh - 26px);
  overflow: hidden;
}

.team-logo-placement-header {
  padding: 17px 20px 14px;
  border-bottom: 1px solid rgba(218, 218, 218, 0.18);
}

.team-logo-placement-help {
  margin: 0;
  padding: 11px 20px 0;
  color: #b5b5b5;
  font-size: 13px;
  font-weight: 560;
  line-height: 1.45;
}

.team-logo-placement-workspace {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(240px, 0.88fr);
  align-items: center;
  min-height: 0;
  padding: 18px 20px;
  gap: 20px;
}

.team-logo-placement-canvas-shell {
  display: grid;
  min-width: 0;
  place-items: center;
  gap: 10px;
}

.team-logo-placement-stage {
  position: relative;
  display: grid;
  width: min(280px, 100%);
  aspect-ratio: 1;
  overflow: hidden;
  place-items: center;
  color: #dedede;
  border: 1px solid rgba(232, 232, 232, 0.54);
  border-radius: 24px;
  background-color: #151515;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%);
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
  box-shadow:
    inset 0 0 0 8px rgba(255, 255, 255, 0.025),
    0 16px 34px rgba(0, 0, 0, 0.4);
  isolation: isolate;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.team-logo-placement-stage.has-logo::after {
  inset: 18px;
  border-radius: 14px;
}

.team-logo-placement-caption {
  color: #8f8f8f;
  font-size: 10.5px;
  font-weight: 760;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.team-logo-placement-controls {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 18px;
  gap: 18px;
  border: 1px solid rgba(218, 218, 218, 0.24);
  border-radius: 14px;
  background: linear-gradient(180deg, #252525 0%, #191919 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045);
}

.team-logo-placement-size {
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 7px 10px;
}

.team-logo-placement-size .team-logo-adjustment-label {
  grid-column: 1 / -1;
  color: #f0f0f0;
  font-size: 13px;
}

.team-logo-placement-size input[type="range"] {
  min-width: 0;
}

.team-logo-placement-position {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
}

.team-logo-placement-position .team-logo-drag-hint {
  grid-column: 1 / -1;
  color: #e0e0e0;
  font-size: 12.5px;
}

.team-logo-placement-position .team-logo-position-value {
  align-self: center;
  font-size: 12px;
}

.team-logo-placement-position .team-logo-center {
  min-height: 34px;
}

.team-logo-placement-keyboard-hint {
  margin: -4px 0 0;
  color: #949494;
  font-size: 10.5px;
  font-weight: 590;
  line-height: 1.4;
}

.team-logo-placement-dialog > .team-editor-status,
.team-logo-placement-form > .team-editor-status {
  min-height: 0;
  margin: 0;
  padding: 0 20px;
}

.team-logo-placement-actions {
  padding: 13px 20px 17px;
  border-top: 1px solid rgba(218, 218, 218, 0.18);
}

@media (max-width: 620px) {
  .team-logo-placement-workspace {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
  }

  .team-logo-placement-stage {
    width: min(210px, 70vw);
    border-radius: 18px;
  }
}

@media (max-height: 680px) and (min-width: 621px) {
  .team-logo-placement-stage {
    width: min(210px, 100%);
  }

  .team-logo-placement-workspace {
    padding-block: 12px;
  }
}

.team-card-logo {
  position: relative;
  display: block;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.team-member-picker .team-stream-labels {
  flex: 1 1 auto;
}

.team-member-menu-heading {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.team-member-menu-heading > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member-menu-logo {
  position: relative;
  display: block;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#streamsGrid[data-stream-control-density="tight"] .team-card-logo {
  flex-basis: 18px;
  width: 18px;
  height: 18px;
  border-radius: 0;
}

#streamsGrid[data-stream-control-density="compact"] .stream-channel-avatar {
  flex-basis: 18px;
  width: 18px;
  height: 18px;
}

#streamsGrid[data-stream-control-density="tight"] .stream-channel-avatar {
  flex-basis: 16px;
  width: 16px;
  height: 16px;
}

@media (max-width: 620px) {
  .team-logo-picker {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 9px 11px;
    gap: 8px 10px;
  }

  .team-logo-preview {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .team-logo-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .team-logo-copy .team-editor-field-hint {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-logo-choose,
  .team-logo-adjust,
  .team-logo-remove,
  .team-logo-center,
  .team-logo-placement-stage.has-logo::after {
    transition: none;
  }
}

/* ========================================================================
   Lobby switcher

   A lobby owns the entire stream wall beneath this rail. The live renderer
   remains a separate destination, so moving between tabs never creates a
   second output surface.
   ======================================================================== */
body.left-nav-layout {
  grid-template-rows: 58px minmax(0, 1fr);
}

body.left-nav-layout .navbar,
body.left-nav-layout .navbar:hover,
body.left-nav-layout .navbar.expanded,
body.left-nav-layout .navbar.expanded:hover,
body.left-nav-layout .navbar.menu-collapsed,
body.left-nav-layout .navbar.menu-collapsed:hover {
  grid-row: 1 / -1;
}

body.left-nav-layout .lobby-switcher {
  position: relative;
  z-index: 90;
  display: grid;
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid #333337;
  background: linear-gradient(180deg, #171719 0%, #111113 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

body.left-nav-layout .lobby-switcher-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #aaa9ae;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

body.left-nav-layout .lobby-switcher-label > i {
  color: #e2e1e5;
  font-size: 13px;
}

body.left-nav-layout .lobby-tabs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

body.left-nav-layout .lobby-tabs::-webkit-scrollbar {
  display: none;
}

body.left-nav-layout .lobby-tab {
  display: inline-grid;
  grid-template-columns: auto auto;
  flex: 0 0 auto;
  min-width: 126px;
  min-height: 40px;
  align-items: center;
  justify-content: start;
  column-gap: 8px;
  padding: 6px 11px;
  border: 1px solid #3c3c40;
  border-radius: 8px;
  background: #202023;
  color: #d1d0d4;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease,
    transform 150ms ease;
}

body.left-nav-layout .lobby-tab:hover {
  border-color: #66666c;
  background: #29292d;
  color: #ffffff;
  transform: translateY(-1px);
}

body.left-nav-layout .lobby-tab[aria-selected="true"] {
  border-color: #b7b7bc;
  background: linear-gradient(180deg, #515156 0%, #3b3b40 100%);
  color: #ffffff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.15), 0 4px 12px rgba(0, 0, 0, 0.25);
}

body.left-nav-layout .lobby-tab:focus-visible,
body.left-nav-layout .lobby-switcher-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.94);
  outline-offset: 2px;
}

body.left-nav-layout .lobby-tab-name {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 720;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.left-nav-layout .lobby-tab-meta {
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #aaa9ae;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

body.left-nav-layout .lobby-tab[aria-selected="true"] .lobby-tab-meta {
  background: rgba(255, 255, 255, 0.14);
  color: #f2f2f3;
}

body.left-nav-layout .lobby-switcher-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

body.left-nav-layout .lobby-switcher-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #4a4a4f;
  border-radius: 8px;
  background: #252529;
  color: #e7e7e9;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 720;
  white-space: nowrap;
  cursor: pointer;
}

body.left-nav-layout .lobby-switcher-button:hover {
  border-color: #77777d;
  background: #303034;
  color: #ffffff;
}

body.left-nav-layout .lobby-switcher-button--icon {
  width: 40px;
  padding: 0;
}

body.left-nav-layout .lobby-switcher-button--primary {
  border-color: #77777c;
  background: linear-gradient(180deg, #55555a, #404045);
}

body.left-nav-layout .container,
body.left-nav-layout .navbar:hover ~ .container,
body.left-nav-layout .navbar.expanded ~ .container,
body.left-nav-layout .navbar.menu-collapsed ~ .container,
body.left-nav-layout .navbar.menu-collapsed:hover ~ .container {
  grid-row: 2 !important;
  height: 100% !important;
}

body.left-nav-layout .stream-load-window {
  top: 70px;
}

body.left-nav-layout.lobbies-disabled {
  grid-template-rows: minmax(0, 1fr);
}

/* The expanded/hovered navbar selectors above carry more class specificity
   than the generic disabled-state rule. Target the wall directly so removing
   the lobby row always promotes it into the remaining viewport row. */
body.left-nav-layout.lobbies-disabled #streamsGrid {
  grid-row: 1 !important;
}

body.left-nav-layout.lobbies-disabled .stream-load-window {
  top: 12px;
}

.lobby-editor-dialog {
  width: min(540px, calc(100vw - 28px));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #4a4a4f;
  border-radius: 14px;
  background: #151517;
  color: #f2f2f3;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62);
}

.lobby-editor-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.lobby-editor-form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.lobby-editor-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 38px;
  align-items: start;
  gap: 12px;
}

.lobby-editor-icon,
.lobby-editor-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #45454a;
  border-radius: 8px;
  background: #242427;
  color: #d9d9dc;
}

.lobby-editor-icon {
  width: 42px;
  height: 42px;
}

.lobby-editor-close {
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.lobby-editor-close:hover,
.lobby-editor-close:focus-visible {
  border-color: #77777d;
  background: #303034;
  color: #ffffff;
}

.lobby-editor-heading h2 {
  margin: 0;
  color: #ffffff;
  font-size: 21px;
  font-weight: 740;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.lobby-editor-heading p {
  margin: 5px 0 0;
  color: #a7a7ac;
  font-size: 12px;
  line-height: 1.45;
}

.lobby-editor-field {
  display: grid;
  gap: 7px;
  color: #d8d8dc;
  font-size: 12px;
  font-weight: 700;
}

.lobby-editor-field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #4c4c51;
  border-radius: 8px;
  outline: 0;
  background: #202023;
  color: #ffffff;
  font: inherit;
  font-size: 15px;
}

.lobby-editor-field input:focus {
  border-color: #a4a4aa;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.lobby-duplicate-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #3c3c40;
  border-radius: 9px;
  background: #1d1d20;
  cursor: pointer;
}

.lobby-duplicate-option[hidden] {
  display: none;
}

.lobby-duplicate-option input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #74747a;
}

.lobby-duplicate-option span,
.lobby-duplicate-option strong,
.lobby-duplicate-option small {
  display: block;
}

.lobby-duplicate-option strong {
  color: #ececef;
  font-size: 12.5px;
}

.lobby-duplicate-option small {
  margin-top: 3px;
  color: #9d9da3;
  font-size: 11px;
  font-weight: 500;
}

.lobby-editor-status {
  min-height: 16px;
  margin: -6px 0 0;
  color: #d3a7a7;
  font-size: 11.5px;
}

.lobby-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.lobby-editor-spacer {
  flex: 1 1 auto;
}

.lobby-editor-actions button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 0 13px;
  border: 1px solid #4b4b50;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lobby-editor-secondary {
  background: #242427;
  color: #dedee1;
}

.lobby-editor-primary {
  border-color: #77777d !important;
  background: linear-gradient(180deg, #5a5a60, #414146);
  color: #ffffff;
}

.lobby-editor-delete {
  border-color: #6a4145 !important;
  background: #2c1d1f;
  color: #efb0b5;
}

.lobby-editor-actions button:hover,
.lobby-editor-actions button:focus-visible {
  border-color: #8b8b91;
  filter: brightness(1.12);
}

.lobby-editor-actions button:disabled {
  cursor: not-allowed;
  filter: none;
  opacity: 0.42;
}

.lobby-editor-actions button[hidden] {
  display: none;
}

body.lobby-switching .lobby-switcher,
body.lobby-switching #streamsGrid {
  pointer-events: none;
}

body.lobby-switching .lobby-switcher::after {
  position: absolute;
  inset: auto 12px 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
  content: "";
  animation: lobby-switch-progress 700ms ease-in-out infinite;
}

@keyframes lobby-switch-progress {
  0% {
    opacity: 0.25;
    transform: scaleX(0.2) translateX(-120%);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.25;
    transform: scaleX(0.2) translateX(120%);
  }
}

@media (max-width: 760px) {
  body.left-nav-layout .lobby-switcher {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding-inline: 8px;
  }

  body.left-nav-layout .lobby-switcher-label {
    display: none;
  }

  body.left-nav-layout .lobby-tab {
    min-width: 112px;
  }
}

@media (max-width: 520px) {
  body.left-nav-layout
    #ocrKillsToggle.watch-party-control-tool
    .nav-button-label {
    font-size: 13px !important;
  }

  body.left-nav-layout {
    grid-template-rows: 54px minmax(0, 1fr);
  }

  body.left-nav-layout .lobby-switcher {
    min-height: 54px;
    padding-block: 7px;
  }

  body.left-nav-layout .lobby-switcher-button {
    min-height: 38px;
  }

  body.left-nav-layout .lobby-switcher-button--primary {
    width: 38px;
    padding: 0;
  }

  body.left-nav-layout .lobby-switcher-button--primary > span {
    display: none;
  }

  body.left-nav-layout .stream-load-window {
    top: 66px;
  }

  .lobby-editor-form {
    gap: 15px;
    padding: 18px;
  }

  .lobby-editor-actions {
    flex-wrap: wrap;
  }

  .lobby-editor-delete {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.left-nav-layout .lobby-tab,
  body.lobby-switching .lobby-switcher::after {
    transition: none;
    animation: none;
  }
}

/* ========================================================================
   Hover-reveal stream actions

   Keep the red close control and team edit control out of the quiet card
   surface until the pointer is over that stream card. Keyboard focus still
   reveals them, and coarse-pointer layouts retain their touch targets.
   ======================================================================== */
@media (hover: hover) and (pointer: fine) {
  body.popup-mode #streamsGrid .stream .remove-button,
  body.popup-mode #streamsGrid .stream .team-edit-button,
  body.popup-mode #streamsGrid .stream .stream-visibility-button,
  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .remove-button,
  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .team-edit-button {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 160ms ease;
  }

  body.popup-mode #streamsGrid .stream:hover .remove-button,
  body.popup-mode #streamsGrid .stream:focus-within .remove-button,
  body.popup-mode #streamsGrid .stream .remove-button:focus-visible,
  body.popup-mode #streamsGrid .stream:hover .team-edit-button,
  body.popup-mode #streamsGrid .stream:focus-within .team-edit-button,
  body.popup-mode #streamsGrid .stream .team-edit-button:focus-visible,
  body.popup-mode #streamsGrid .stream:hover .stream-visibility-button,
  body.popup-mode #streamsGrid .stream:focus-within .stream-visibility-button,
  body.popup-mode #streamsGrid .stream .stream-visibility-button:focus-visible,
  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card:hover
    > .twitch-card-rail--top
    .remove-button,
  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card:focus-within
    > .twitch-card-rail--top
    .remove-button,
  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .remove-button:focus-visible,
  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card:hover
    > .twitch-card-rail--top
    .team-edit-button,
  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card:focus-within
    > .twitch-card-rail--top
    .team-edit-button,
  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .team-edit-button:focus-visible {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* ========================================================================
   Per-stream refresh glyph

   The refresh affordance is part of the same native streamer-name button.
   Its click handler stops at the glyph so the rest of the name keeps its
   existing activate/select behavior without nesting another button.
   ======================================================================== */
.stream-name > .stream-name-refresh-icon {
  display: inline-grid;
  flex: 0 0 30px;
  align-self: stretch;
  place-items: center;
  width: 30px;
  min-width: 30px;
  min-height: 0;
  margin: 0 -10px 0 0;
  padding: 0;
  color: #d4d4d4;
  border-left: 1px solid rgba(198, 198, 198, 0.38);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(180deg, #4a4a4a 0%, #2f2f2f 100%);
  box-shadow: inset 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: pointer;
  transition:
    opacity 160ms ease,
    visibility 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

#streamsGrid .stream:hover .stream-name > .stream-name-refresh-icon,
#streamsGrid .stream:focus-within .stream-name > .stream-name-refresh-icon {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (hover: none), (pointer: coarse) {
  #streamsGrid .stream .stream-name > .stream-name-refresh-icon {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

.stream-name > .stream-name-refresh-icon > i {
  pointer-events: none;
}

.stream-name > .stream-name-refresh-icon:hover {
  color: #ffffff;
  border-color: rgba(238, 238, 238, 0.72);
  background: linear-gradient(180deg, #626262 0%, #414141 100%);
}

.stream-name > .stream-name-refresh-icon:active {
  transform: scale(0.94);
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name > .stream-name-refresh-icon {
  flex-basis: var(--stream-tile-close-size, 30px);
  width: var(--stream-tile-close-size, 30px);
  min-width: var(--stream-tile-close-size, 30px);
  height: 100%;
  min-height: 0;
  margin-right: calc(-1 * var(--stream-tile-title-padding, 10px));
  font-size: var(--stream-tile-close-font-size, 12px);
}

@media (prefers-reduced-motion: reduce) {
  .stream-name > .stream-name-refresh-icon {
    transition: none;
  }
}

/* Keep the resting streamer-name pill tight. The refresh affordance should
   add its own right-hand segment only when the stream is being inspected. */
body.popup-mode #streamsGrid .stream .stream-name > .stream-name-refresh-icon,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name > .stream-name-refresh-icon {
  flex: 0 0 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  margin-right: 0 !important;
  overflow: hidden;
  border-left-width: 0;
  border-left-color: transparent;
  box-shadow: none;
  transition:
    flex-basis 180ms ease,
    width 180ms ease,
    min-width 180ms ease,
    margin-right 180ms ease,
    opacity 160ms ease,
    visibility 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

body.popup-mode #streamsGrid .stream:hover .stream-name > .stream-name-refresh-icon,
body.popup-mode #streamsGrid .stream:focus-within .stream-name > .stream-name-refresh-icon,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card:hover
  > .twitch-card-rail--top
  .stream-name > .stream-name-refresh-icon,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card:focus-within
  > .twitch-card-rail--top
  .stream-name > .stream-name-refresh-icon {
  flex-basis: var(--stream-tile-close-size, 30px) !important;
  width: var(--stream-tile-close-size, 30px) !important;
  min-width: var(--stream-tile-close-size, 30px) !important;
  margin-right: calc(-1 * var(--stream-tile-title-padding, 10px)) !important;
  overflow: hidden;
  border-left-width: 1px;
  border-left-color: rgba(198, 198, 198, 0.38);
  box-shadow: inset 1px 0 rgba(255, 255, 255, 0.08);
}

@media (hover: none), (pointer: coarse) {
  body.popup-mode #streamsGrid .stream .stream-name > .stream-name-refresh-icon,
  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .stream-name > .stream-name-refresh-icon {
    flex-basis: var(--stream-tile-close-size, 30px) !important;
    width: var(--stream-tile-close-size, 30px) !important;
    min-width: var(--stream-tile-close-size, 30px) !important;
    margin-right: calc(-1 * var(--stream-tile-title-padding, 10px)) !important;
    overflow: hidden;
    border-left-width: 1px;
    border-left-color: rgba(198, 198, 198, 0.38);
    box-shadow: inset 1px 0 rgba(255, 255, 255, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.popup-mode #streamsGrid .stream .stream-name > .stream-name-refresh-icon,
  body.popup-mode #streamsGrid.overview-fit
    > .stream.twitch-stream-card
    > .twitch-card-rail--top
    .stream-name > .stream-name-refresh-icon {
    transition: none;
  }
}

/* Keep the editor entry point's keyboard focus visible without introducing a
   one-off blue accent beneath an otherwise neutral navigation group. */
body.left-nav-layout #streamOverlayButton.stream-overlay-nav-button:focus-visible {
  outline: 2px solid rgba(226, 226, 226, 0.82);
  outline-offset: -2px;
}

.stream-overlay-dialog {
  width: min(920px, calc(100vw - 32px));
  max-width: 920px;
  padding: 0;
  border: 1px solid rgba(139, 171, 222, 0.24);
  border-radius: 18px;
  color: #e8eef9;
  background: #0c1421;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.stream-overlay-dialog::backdrop {
  background: rgba(4, 8, 14, 0.78);
  backdrop-filter: blur(8px);
}

.stream-overlay-form {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stream-overlay-header,
.stream-overlay-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-color: rgba(139, 171, 222, 0.16);
}

.stream-overlay-header {
  border-bottom: 1px solid rgba(139, 171, 222, 0.16);
}

.stream-overlay-heading {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.stream-overlay-heading-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid rgba(119, 168, 255, 0.34);
  border-radius: 10px;
  color: #9cc3ff;
  background: rgba(48, 101, 183, 0.18);
}

.stream-overlay-kicker,
.stream-overlay-field-label {
  display: block;
  color: rgba(181, 205, 240, 0.66);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stream-overlay-heading h2 {
  margin: 3px 0 0;
  color: #f3f7ff;
  font-size: 20px;
  line-height: 1.1;
}

.stream-overlay-icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  margin-left: auto;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgba(175, 196, 229, 0.24);
  border-radius: 9px;
  color: rgba(232, 240, 253, 0.82);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.stream-overlay-icon-button:hover,
.stream-overlay-icon-button:focus-visible {
  color: #ffffff;
  border-color: rgba(142, 187, 255, 0.72);
  background: rgba(74, 132, 221, 0.22);
}

.stream-overlay-help {
  margin: 0;
  padding: 16px 22px 0;
  color: rgba(200, 214, 237, 0.75);
  font-size: 12px;
  line-height: 1.55;
}

.stream-overlay-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(270px, 0.92fr);
  gap: 20px;
  padding: 18px 22px 20px;
}

.stream-overlay-stage-shell {
  min-width: 0;
}

.stream-overlay-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: clip;
  border: 1px solid rgba(129, 162, 214, 0.3);
  /* The editor mirrors the square corners of the real video frame. */
  border-radius: 0;
  outline: none;
  background: #070c14;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), inset 0 0 40px rgba(0, 0, 0, 0.45);
  cursor: grab;
  touch-action: none;
}

.stream-overlay-stage:focus-visible {
  border-color: #76adff;
  box-shadow: 0 0 0 3px rgba(71, 133, 235, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.stream-overlay-stage.is-dragging {
  cursor: grabbing;
}

.stream-overlay-stage-grid {
  position: absolute;
  inset: 0;
  opacity: 0.44;
  background-image:
    linear-gradient(rgba(151, 184, 237, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(151, 184, 237, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, rgba(33, 75, 129, 0.32), rgba(7, 12, 21, 0.92));
  background-size: 12.5% 25%, 12.5% 25%, 100% 100%;
}

.stream-overlay-stage-grid::before,
.stream-overlay-stage-grid::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.stream-overlay-stage-grid::before {
  inset: 12% 8%;
  border: 1px solid rgba(196, 218, 255, 0.17);
  border-radius: 0;
}

.stream-overlay-stage-grid::after {
  top: 50%;
  left: 50%;
  width: 1px;
  height: 100%;
  background: rgba(214, 231, 255, 0.12);
  transform: translate(-50%, -50%);
}

.stream-overlay-stage-label {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 3;
  color: rgba(208, 226, 255, 0.72);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.stream-overlay-stage-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  display: grid;
  gap: 8px;
  justify-items: center;
  max-width: 190px;
  color: rgba(188, 211, 244, 0.62);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  transform: translate(-50%, -50%);
}

.stream-overlay-stage-empty i {
  color: rgba(151, 190, 255, 0.82);
  font-size: 22px;
}

.stream-overlay-preview-image {
  position: absolute;
  top: calc(50% + var(--stream-overlay-y, 0%));
  left: calc(50% + var(--stream-overlay-x, 0%));
  z-index: 3;
  display: block;
  width: var(--stream-overlay-scale, 24%);
  max-width: none;
  height: auto;
  pointer-events: none;
  user-select: none;
  transform: translate(-50%, -50%);
}

.stream-overlay-stage-caption {
  display: block;
  margin-top: 8px;
  color: rgba(176, 197, 228, 0.58);
  font-size: 10px;
  text-align: right;
}

.stream-overlay-controls {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.stream-overlay-file-picker,
.stream-overlay-scope-fieldset,
.stream-overlay-target-field,
.stream-overlay-toggle,
.stream-overlay-size-control,
.stream-overlay-position-control,
.stream-overlay-crop-control {
  padding: 12px;
  border: 1px solid rgba(139, 171, 222, 0.16);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
}

.stream-overlay-field-heading,
.stream-overlay-adjustment-label,
.stream-overlay-drag-hint,
.stream-overlay-crop-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stream-overlay-field-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 8px;
  color: #9cc3ff;
  background: rgba(68, 123, 211, 0.18);
}

.stream-overlay-field-hint,
.stream-overlay-scope-option small,
.stream-overlay-toggle small {
  display: block;
  margin-top: 3px;
  color: rgba(184, 202, 230, 0.6);
  font-size: 10px;
  line-height: 1.4;
}

.stream-overlay-file-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin-top: 10px;
}

.stream-overlay-secondary-button,
.stream-overlay-primary-button,
.stream-overlay-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  font: 600 11px/1.1 Inter, Roboto, sans-serif;
  cursor: pointer;
}

.stream-overlay-secondary-button {
  border: 1px solid rgba(169, 196, 235, 0.24);
  color: #d9e7ff;
  background: rgba(255, 255, 255, 0.06);
}

.stream-overlay-secondary-button:hover,
.stream-overlay-secondary-button:focus-visible {
  border-color: rgba(135, 183, 255, 0.7);
  background: rgba(77, 132, 214, 0.2);
}

.stream-overlay-primary-button {
  border: 1px solid #5ba5ff;
  color: #07101e;
  background: #a5ccff;
}

.stream-overlay-primary-button:hover,
.stream-overlay-primary-button:focus-visible {
  background: #c2ddff;
}

.stream-overlay-danger-button {
  border: 1px solid rgba(255, 119, 119, 0.32);
  color: #ffb0b0;
  background: rgba(117, 26, 35, 0.22);
}

.stream-overlay-danger-button:hover,
.stream-overlay-danger-button:focus-visible {
  border-color: rgba(255, 138, 138, 0.72);
  background: rgba(148, 34, 45, 0.34);
}

.stream-overlay-file-name {
  overflow: hidden;
  min-width: 0;
  color: rgba(201, 218, 243, 0.68);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-overlay-scope-fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
}

.stream-overlay-scope-fieldset legend {
  padding: 0 3px;
  color: rgba(181, 205, 240, 0.66);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stream-overlay-scope-option,
.stream-overlay-toggle {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
}

.stream-overlay-scope-option input,
.stream-overlay-toggle input {
  margin: 2px 0 0;
  accent-color: #7eb4ff;
}

.stream-overlay-scope-option strong,
.stream-overlay-toggle strong {
  color: #ecf3ff;
  font-size: 11px;
}

.stream-overlay-target-field {
  display: grid;
  gap: 7px;
}

.stream-overlay-target-field select {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(169, 196, 235, 0.24);
  border-radius: 8px;
  color: #e9f1ff;
  background: #121f32;
  font: 500 11px/1 Inter, Roboto, sans-serif;
}

.stream-overlay-target-field select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stream-overlay-adjustment-label {
  justify-content: space-between;
  color: #dceaff;
  font-size: 11px;
  font-weight: 600;
}

.stream-overlay-adjustment-label i {
  color: #9cc3ff;
}

.stream-overlay-adjustment-label output {
  margin-left: auto;
  color: rgba(205, 224, 251, 0.72);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.stream-overlay-size-control input[type="range"] {
  width: 100%;
  margin: 10px 0 0;
  accent-color: #82b7ff;
}

.stream-overlay-crop-control {
  display: grid;
  gap: 0;
  min-width: 0;
  margin: 0;
}

.stream-overlay-crop-control legend {
  width: 100%;
  padding: 0;
}

.stream-overlay-crop-heading {
  min-width: 0;
}

.stream-overlay-crop-heading i {
  color: #9cc3ff;
}

.stream-overlay-crop-control legend output {
  margin-left: auto;
  color: rgba(205, 224, 251, 0.72);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.stream-overlay-crop-help {
  margin: 5px 0 0;
  color: rgba(184, 202, 230, 0.6);
  font-size: 10px;
  line-height: 1.4;
}

.stream-overlay-crop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
  margin-top: 10px;
}

.stream-overlay-crop-field {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: rgba(221, 235, 255, 0.84);
  font-size: 10px;
  font-weight: 600;
}

.stream-overlay-crop-field > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stream-overlay-crop-field output {
  color: rgba(205, 224, 251, 0.72);
  font-variant-numeric: tabular-nums;
}

.stream-overlay-crop-field input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: #82b7ff;
}

.stream-overlay-crop-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.stream-overlay-crop-actions .stream-overlay-secondary-button {
  min-height: 30px;
  padding: 6px 9px;
}

.stream-overlay-position-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.stream-overlay-axis-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stream-overlay-axis-actions .stream-overlay-secondary-button {
  width: 100%;
  min-width: 0;
  padding-inline: 9px;
}

.stream-overlay-drag-hint {
  min-width: 0;
  color: rgba(191, 211, 241, 0.7);
  font-size: 10px;
}

.stream-overlay-drag-hint span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-overlay-drag-hint i {
  color: #9cc3ff;
}

.stream-overlay-position-value {
  grid-column: 1 / -1;
  color: rgba(221, 235, 255, 0.84);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.stream-overlay-keyboard-hint,
.stream-overlay-status-message {
  margin: 0;
  color: rgba(180, 202, 232, 0.64);
  font-size: 10px;
  line-height: 1.45;
}

.stream-overlay-status-message {
  min-height: 15px;
  padding: 0 22px 14px;
}

.stream-overlay-status-message[data-state="error"] {
  color: #ffb5b5;
}

.stream-overlay-actions {
  flex-wrap: wrap;
  border-top: 1px solid rgba(139, 171, 222, 0.16);
}

.stream-overlay-action-spacer {
  flex: 1 1 auto;
}

.stream-overlay-dialog[open] .stream-overlay-form {
  animation: stream-overlay-dialog-in 180ms ease-out both;
}

@keyframes stream-overlay-dialog-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* The PNG stays above provider pixels but below the card's title/actions. */
.stream-overlay-layer {
  position: absolute;
  top: var(--stream-overlay-frame-top, 0px);
  left: var(--stream-overlay-frame-left, 0px);
  width: var(--stream-overlay-frame-width, 100%) !important;
  height: var(--stream-overlay-frame-height, 100%) !important;
  z-index: 12;
  overflow: clip;
  pointer-events: none;
}

.stream-overlay-layer[hidden] {
  display: none !important;
}

.stream-overlay-image {
  position: absolute;
  top: calc(50% + var(--stream-overlay-y, 0%));
  left: calc(50% + var(--stream-overlay-x, 0%));
  display: block;
  width: var(--stream-overlay-scale, 24%);
  max-width: none;
  height: auto;
  user-select: none;
  transform: translate(-50%, -50%);
}

@media (max-width: 760px) {
  .stream-overlay-workspace {
    grid-template-columns: 1fr;
  }

  .stream-overlay-stage-shell {
    order: 0;
  }

  .stream-overlay-controls {
    order: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stream-overlay-dialog[open] .stream-overlay-form {
    animation: none;
  }
}

/* Layered media editor: neutral grayscale controls keep the preview readable
   while the video surface remains the visual focus. */
.stream-overlay-dialog,
.stream-overlay-form,
.stream-overlay-controls,
.stream-overlay-layer-panel,
.stream-overlay-selected-layer {
  color: #f1f1f1;
  background: #141414;
  border-color: #454545;
}

.stream-overlay-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-width: 1120px;
  padding: 0;
  border: 1px solid #4a4a4a;
  border-radius: 14px;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.68);
}

.stream-overlay-dialog::backdrop {
  background: rgba(0, 0, 0, 0.76);
}

.stream-overlay-form {
  background: #151515;
}

.stream-overlay-header,
.stream-overlay-actions {
  border-color: #3d3d3d;
}

.stream-overlay-kicker,
.stream-overlay-field-label,
.stream-overlay-adjustment-label,
.stream-overlay-layer-panel-heading,
.stream-overlay-selected-layer-heading {
  color: #f1f1f1;
}

.stream-overlay-heading-icon,
.stream-overlay-field-icon,
.stream-overlay-adjustment-label i,
.stream-overlay-drag-hint i {
  color: #d5d5d5;
}

.stream-overlay-heading-icon,
.stream-overlay-field-icon {
  background: #292929;
  border-color: #5b5b5b;
}

.stream-overlay-help,
.stream-overlay-field-hint,
.stream-overlay-keyboard-hint,
.stream-overlay-status-message,
.stream-overlay-drag-hint,
.stream-overlay-stage-caption {
  color: #9f9f9f;
}

.stream-overlay-stage {
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #303030 0%, #171717 58%, #0e0e0e 100%);
  border-color: #5a5a5a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 14px 36px rgba(0, 0, 0, 0.34);
}

.stream-overlay-stage:focus-visible {
  border-color: #bdbdbd;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.13), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.stream-overlay-stage-grid {
  border-color: rgba(255, 255, 255, 0.1);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.45));
}

.stream-overlay-stage-grid::before {
  border-color: rgba(255, 255, 255, 0.16);
}

.stream-overlay-stage-grid::after {
  background: rgba(255, 255, 255, 0.12);
}

.stream-overlay-stage-label {
  color: rgba(255, 255, 255, 0.6);
}

.stream-overlay-stage-empty {
  color: #c6c6c6;
}

.stream-overlay-stage-empty[hidden],
.stream-overlay-preview-stack[hidden] {
  display: none !important;
}

.stream-overlay-stage-empty i {
  color: #d3d3d3;
}

.stream-overlay-secondary-button,
.stream-overlay-small-button,
.stream-overlay-icon-button {
  color: #eeeeee;
  background: #252525;
  border-color: #555555;
}

.stream-overlay-secondary-button:hover,
.stream-overlay-secondary-button:focus-visible,
.stream-overlay-small-button:hover,
.stream-overlay-small-button:focus-visible,
.stream-overlay-icon-button:hover,
.stream-overlay-icon-button:focus-visible {
  color: #ffffff;
  background: #383838;
  border-color: #8a8a8a;
}

.stream-overlay-primary-button {
  color: #151515;
  background: #eeeeee;
  border-color: #eeeeee;
}

.stream-overlay-primary-button:hover,
.stream-overlay-primary-button:focus-visible {
  color: #000000;
  background: #ffffff;
  border-color: #ffffff;
}

.stream-overlay-danger-button {
  color: #e0e0e0;
  background: #242424;
  border-color: #656565;
}

.stream-overlay-danger-button:hover,
.stream-overlay-danger-button:focus-visible {
  color: #ffffff;
  background: #3c3c3c;
  border-color: #a0a0a0;
}

.stream-overlay-layer-panel,
.stream-overlay-selected-layer {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #3d3d3d;
  border-radius: 10px;
}

.stream-overlay-layer-panel-heading,
.stream-overlay-selected-layer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stream-overlay-small-button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
}

.stream-overlay-layer-list {
  display: grid;
  gap: 6px;
  max-height: 176px;
  overflow: auto;
}

.stream-overlay-layer-list-empty {
  margin: 0;
  padding: 12px 6px;
  color: #969696;
  font-size: 10px;
  line-height: 1.45;
}

.stream-overlay-layer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
  min-width: 0;
}

.stream-overlay-layer-select {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  color: #d1d1d1;
  text-align: left;
  background: #202020;
  border: 1px solid #3d3d3d;
  border-radius: 7px;
}

.stream-overlay-layer-row.is-selected .stream-overlay-layer-select,
.stream-overlay-layer-select:hover,
.stream-overlay-layer-select:focus-visible {
  color: #ffffff;
  background: #353535;
  border-color: #969696;
}

.stream-overlay-layer-number {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: #161616;
  background: #cfcfcf;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.stream-overlay-layer-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.stream-overlay-layer-copy strong,
.stream-overlay-layer-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-overlay-layer-copy strong {
  font-size: 10px;
}

.stream-overlay-layer-copy small {
  color: #9d9d9d;
  font-size: 9px;
}

.stream-overlay-layer-state,
.stream-overlay-type-badge {
  color: #bcbcbc;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stream-overlay-layer-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.stream-overlay-layer-move {
  width: 26px;
  min-height: 28px;
  padding: 0;
  border-radius: 6px;
}

.stream-overlay-text-field {
  display: grid;
  gap: 6px;
}

.stream-overlay-text-field input,
.stream-overlay-text-field textarea,
.stream-overlay-target-field select {
  width: 100%;
  color: #eeeeee;
  background: #202020;
  border: 1px solid #4c4c4c;
  border-radius: 7px;
  outline: none;
}

.stream-overlay-text-field input,
.stream-overlay-target-field select {
  min-height: 34px;
  padding: 0 9px;
}

.stream-overlay-text-field textarea {
  padding: 8px 9px;
  resize: vertical;
}

.stream-overlay-text-field input:focus,
.stream-overlay-text-field textarea:focus,
.stream-overlay-target-field select:focus {
  border-color: #bdbdbd;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.stream-overlay-scope-fieldset {
  border-color: #444444;
  background: #191919;
}

.stream-overlay-scope-fieldset legend {
  color: #f1f1f1;
}

.stream-overlay-scope-option {
  padding: 9px;
  border: 1px solid #3d3d3d;
  border-radius: 7px;
  background: #202020;
}

.stream-overlay-scope-option:has(input:checked) {
  background: #363636;
  border-color: #969696;
}

.stream-overlay-scope-option input,
.stream-overlay-toggle input {
  accent-color: #eeeeee;
}

.stream-overlay-scope-option strong,
.stream-overlay-toggle strong {
  color: #eeeeee;
}

.stream-overlay-scope-option small,
.stream-overlay-toggle small {
  color: #a2a2a2;
}

.stream-overlay-target-field select:disabled,
.stream-overlay-text-field input:disabled,
.stream-overlay-text-field textarea:disabled,
.stream-overlay-loop-toggle input:disabled {
  opacity: 0.48;
}

.stream-overlay-size-control input[type="range"] {
  accent-color: #eeeeee;
}

.stream-overlay-adjustment-label output,
.stream-overlay-position-value {
  color: #c4c4c4;
}

.stream-overlay-status-message[data-state="error"] {
  color: #f0bcbc;
}

.stream-overlay-preview-stack {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: clip;
  pointer-events: none;
}

.stream-overlay-preview-item {
  position: absolute;
  top: calc(50% + var(--stream-overlay-y, 0%));
  left: calc(50% + var(--stream-overlay-x, 0%));
  width: var(--stream-overlay-scale, 24%);
  max-width: none;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: grab;
  outline: 1px solid transparent;
}

.stream-overlay-preview-item.is-selected {
  outline: 1px dashed rgba(255, 255, 255, 0.9);
  outline-offset: 4px;
}

.stream-overlay-preview-item:active {
  cursor: grabbing;
}

.stream-overlay-preview-media,
.stream-overlay-item > .stream-overlay-media {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  user-select: none;
}

.stream-overlay-preview-media,
.stream-overlay-item > .stream-overlay-media {
  clip-path: inset(
    var(--stream-overlay-crop-top, 0%)
    var(--stream-overlay-crop-right, 0%)
    var(--stream-overlay-crop-bottom, 0%)
    var(--stream-overlay-crop-left, 0%)
  ) !important;
}

.stream-overlay-item {
  position: absolute;
  top: calc(50% + var(--stream-overlay-y, 0%));
  left: calc(50% + var(--stream-overlay-x, 0%));
  width: var(--stream-overlay-scale, 24%) !important;
  height: auto !important;
  max-width: none;
  transform: translate(-50%, -50%);
}

/* Stream overlay editor workspace: a lighter grayscale surface with layer
   management beside the preview instead of crowding the inspector. */
.stream-overlay-dialog {
  --stream-overlay-editor-bg: #272727;
  --stream-overlay-editor-surface: #303030;
  --stream-overlay-editor-raised: #393939;
  --stream-overlay-editor-control: #242424;
  --stream-overlay-editor-border: #5d5d5d;
  --stream-overlay-editor-border-soft: #484848;
  --stream-overlay-editor-text: #f5f5f5;
  --stream-overlay-editor-muted: #b9b9b9;
  --stream-overlay-editor-green: #8ddd78;
  width: min(1480px, calc(100vw - 28px));
  max-width: 1480px;
  max-height: calc(100dvh - 28px);
  color: var(--stream-overlay-editor-text);
  background: var(--stream-overlay-editor-bg);
  border-color: var(--stream-overlay-editor-border);
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.5);
}

.stream-overlay-dialog::backdrop {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(5px);
}

.stream-overlay-dialog .stream-overlay-form {
  max-height: calc(100dvh - 30px);
  min-height: 0;
  overflow: hidden;
  background: var(--stream-overlay-editor-bg);
}

.stream-overlay-dialog .stream-overlay-header,
.stream-overlay-dialog .stream-overlay-actions {
  flex: 0 0 auto;
  padding: 14px 20px;
  background: #2d2d2d;
  border-color: var(--stream-overlay-editor-border-soft);
}

.stream-overlay-dialog .stream-overlay-help {
  flex: 0 0 auto;
  padding: 12px 20px 0;
  color: var(--stream-overlay-editor-muted);
}

.stream-overlay-workspace {
  grid-template-columns: minmax(0, 1.55fr) minmax(420px, 0.75fr);
  gap: 16px;
  min-height: 0;
  padding: 14px 20px 16px;
  overflow-y: auto;
  scrollbar-color: #707070 #2a2a2a;
}

.stream-overlay-canvas-column,
.stream-overlay-controls {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  color: var(--stream-overlay-editor-text);
  background: transparent;
}

.stream-overlay-stage-toolbar {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.stream-overlay-preview-picker {
  display: grid;
  min-width: min(360px, 62%);
  gap: 4px;
  color: var(--stream-overlay-editor-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stream-overlay-preview-picker-control {
  position: relative;
  display: block;
}

.stream-overlay-preview-picker-control i {
  position: absolute;
  top: 50%;
  left: 10px;
  z-index: 1;
  color: #bdbdbd;
  font-size: 10px;
  pointer-events: none;
  transform: translateY(-50%);
}

.stream-overlay-preview-picker select {
  width: 100%;
  min-height: 32px;
  padding: 0 30px 0 29px;
  color: var(--stream-overlay-editor-text);
  background: var(--stream-overlay-editor-control);
  border: 1px solid var(--stream-overlay-editor-border);
  border-radius: 7px;
  outline: none;
}

.stream-overlay-preview-picker select:focus-visible {
  border-color: #bdbdbd;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.stream-overlay-preview-picker select:disabled {
  opacity: 0.5;
}

.stream-overlay-stream-preview-status {
  overflow: hidden;
  color: var(--stream-overlay-editor-muted);
  font-size: 9px;
  line-height: 1.3;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-overlay-stream-preview-status[data-state="live"] {
  color: var(--stream-overlay-editor-green);
}

.stream-overlay-stream-preview-status[data-state="error"] {
  color: #f0bcbc;
}

.stream-overlay-stage {
  border-color: #686868;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #3b3b3b 0%, #292929 60%, #202020 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045), 0 10px 28px rgba(0, 0, 0, 0.24);
}

.stream-overlay-stream-preview {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #d6d6d6;
  background: #090909;
  pointer-events: none;
}

.stream-overlay-stream-preview[hidden] {
  display: none !important;
}

.stream-overlay-stream-preview-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stream-overlay-stream-preview-placeholder {
  display: grid;
  gap: 8px;
  place-items: center;
  color: #c9c9c9;
  font-size: 10px;
  text-align: center;
}

.stream-overlay-stream-preview-placeholder i {
  color: #9f9f9f;
  font-size: 20px;
}

.stream-overlay-stage-grid {
  z-index: 1;
  opacity: 0.58;
  border-color: rgba(255, 255, 255, 0.12);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.18));
}

.stream-overlay-stage:focus-visible {
  border-color: #c9c9c9;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.stream-overlay-stage-caption,
.stream-overlay-reorder-hint,
.stream-overlay-target-hint {
  color: var(--stream-overlay-editor-muted);
}

.stream-overlay-file-picker,
.stream-overlay-layer-panel,
.stream-overlay-selected-layer,
.stream-overlay-scope-fieldset,
.stream-overlay-target-field,
.stream-overlay-loop-toggle,
.stream-overlay-size-control,
.stream-overlay-position-control,
.stream-overlay-crop-control {
  color: var(--stream-overlay-editor-text);
  background: var(--stream-overlay-editor-surface);
  border: 1px solid var(--stream-overlay-editor-border-soft);
  border-radius: 10px;
}

.stream-overlay-file-picker,
.stream-overlay-layer-panel,
.stream-overlay-selected-layer,
.stream-overlay-target-field {
  padding: 12px;
}

.stream-overlay-layer-panel {
  min-height: 154px;
}

.stream-overlay-layer-list {
  gap: 7px;
  max-height: 248px;
  padding: 1px;
  align-content: start;
  grid-auto-rows: max-content;
  overflow: auto;
  scrollbar-color: #707070 #2f2f2f;
}

.stream-overlay-reorder-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 10px;
  line-height: 1.35;
}

.stream-overlay-layer-row {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 0;
  min-height: 44px;
  align-items: stretch;
  overflow: visible;
  color: #e6e6e6;
  background: var(--stream-overlay-editor-control);
  border: 1px solid #4f4f4f;
  border-radius: 8px;
  transition: border-color 120ms ease, background 120ms ease, opacity 120ms ease;
}

.stream-overlay-layer-row:hover,
.stream-overlay-layer-row:focus-within {
  background: #2b2b2b;
  border-color: #777777;
}

.stream-overlay-layer-row.is-selected {
  background: var(--stream-overlay-editor-raised);
  border-color: #b0b0b0;
  box-shadow: inset 3px 0 0 #e6e6e6;
}

.stream-overlay-layer-row.is-dragging {
  opacity: 0.42;
}

.stream-overlay-layer-row.is-drop-before::before,
.stream-overlay-layer-row.is-drop-after::after {
  position: absolute;
  right: 2px;
  left: 2px;
  z-index: 3;
  height: 3px;
  border-radius: 999px;
  background: #eeeeee;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
  content: "";
}

.stream-overlay-layer-row.is-drop-before::before {
  top: -5px;
}

.stream-overlay-layer-row.is-drop-after::after {
  bottom: -5px;
}

.stream-overlay-layer-grip {
  display: grid;
  min-width: 0;
  place-items: center;
  color: #a9a9a9;
  border-right: 1px solid #484848;
  border-radius: 7px 0 0 7px;
  cursor: grab;
  touch-action: none;
}

.stream-overlay-layer-grip:active {
  cursor: grabbing;
}

.stream-overlay-layer-grip:focus-visible {
  color: #ffffff;
  outline: 2px solid #d5d5d5;
  outline-offset: -3px;
}

.stream-overlay-layer-select {
  grid-template-columns: 19px 28px minmax(0, 1fr);
  gap: 7px;
  padding: 4px 7px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.stream-overlay-layer-row.is-selected .stream-overlay-layer-select,
.stream-overlay-layer-select:hover,
.stream-overlay-layer-select:focus-visible {
  color: #ffffff;
  background: transparent;
  border-color: transparent;
  outline: none;
}

.stream-overlay-layer-select:focus-visible {
  box-shadow: inset 0 0 0 2px #bdbdbd;
}

.stream-overlay-layer-number {
  width: 18px;
  height: 18px;
  color: #222222;
  background: #dddddd;
}

/* Let the editor own the viewport height. The Layers card fills the left
   column's remaining space, while only its rows scroll so the panel chrome
   and reorder hint stay anchored at the viewport edge. */
.stream-overlay-dialog .stream-overlay-form {
  height: calc(100dvh - 30px);
}

.stream-overlay-dialog .stream-overlay-workspace {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.stream-overlay-dialog .stream-overlay-canvas-column {
  min-height: min-content;
  grid-template-rows: auto auto auto;
  overflow: visible;
}

.stream-overlay-dialog .stream-overlay-layer-panel {
  height: clamp(190px, 28dvh, 300px);
  min-height: 190px;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.stream-overlay-dialog .stream-overlay-layer-panel-heading {
  grid-row: 1;
}

.stream-overlay-dialog .stream-overlay-add-menu {
  grid-row: 2;
}

.stream-overlay-dialog .stream-overlay-layer-list {
  grid-row: 3;
}

.stream-overlay-dialog .stream-overlay-reorder-hint {
  grid-row: 4;
}

.stream-overlay-dialog .stream-overlay-layer-list {
  min-height: 0;
  max-height: none;
  align-content: start;
  grid-auto-rows: max-content;
  overflow-y: auto;
}

.stream-overlay-dialog .stream-overlay-controls {
  min-height: min-content;
  overflow: visible;
}

.stream-overlay-layer-thumbnail {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  overflow: hidden;
  color: #d5d5d5;
  background: #1d1d1d;
  border: 1px solid #565656;
  border-radius: 6px;
}

.stream-overlay-layer-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stream-overlay-layer-copy strong {
  font-size: 10px;
}

.stream-overlay-layer-copy small {
  color: #b1b1b1;
}

.stream-overlay-layer-actions {
  gap: 5px;
  padding: 4px;
  border-left: 1px solid #484848;
}

.stream-overlay-layer-visibility,
.stream-overlay-layer-delete {
  min-height: 28px;
  border: 1px solid #5a5a5a;
  border-radius: 7px;
  color: #c9c9c9;
  background: #292929;
  cursor: pointer;
}

.stream-overlay-layer-visibility {
  display: inline-flex;
  min-width: 70px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  font-size: 9px;
  font-weight: 750;
}

.stream-overlay-layer-visibility.is-visible {
  color: var(--stream-overlay-editor-green);
  border-color: rgba(141, 221, 120, 0.55);
  background: rgba(68, 104, 59, 0.28);
}

.stream-overlay-layer-visibility:hover,
.stream-overlay-layer-visibility:focus-visible,
.stream-overlay-layer-delete:hover,
.stream-overlay-layer-delete:focus-visible {
  color: #ffffff;
  background: #414141;
  border-color: #9b9b9b;
  outline: none;
}

.stream-overlay-layer-delete {
  width: 32px;
  padding: 0;
}

.stream-overlay-field-label,
.stream-overlay-scope-fieldset legend {
  color: var(--stream-overlay-editor-text);
}

.stream-overlay-field-hint,
.stream-overlay-scope-option small,
.stream-overlay-toggle small,
.stream-overlay-keyboard-hint,
.stream-overlay-status-message {
  color: var(--stream-overlay-editor-muted);
}

.stream-overlay-text-field input,
.stream-overlay-text-field textarea,
.stream-overlay-team-member-picker select {
  color: #f3f3f3;
  background: var(--stream-overlay-editor-control);
  border-color: var(--stream-overlay-editor-border);
}

.stream-overlay-scope-fieldset {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
}

.stream-overlay-scope-fieldset legend {
  grid-column: 1 / -1;
}

.stream-overlay-scope-option {
  min-height: 58px;
  background: var(--stream-overlay-editor-control);
  border-color: #555555;
}

.stream-overlay-scope-option:has(input:checked) {
  background: var(--stream-overlay-editor-raised);
  border-color: #adadad;
}

.stream-overlay-target-field {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  overflow: visible;
}

.stream-overlay-target-hint {
  margin: -4px 0 0;
  font-size: 10px;
  line-height: 1.4;
}

#streamOverlayTarget.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.stream-overlay-target-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stream-overlay-target-tile {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 88px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 8px;
  color: #e6e6e6;
  text-align: center;
  background: linear-gradient(145deg, #343434, #292929);
  border: 1px solid #5e5e5e;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.stream-overlay-target-tile--team {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-content: center;
  justify-content: stretch;
  gap: 9px;
  padding: 10px;
  text-align: left;
}

.stream-overlay-target-tile:hover:not(:disabled),
.stream-overlay-target-tile:focus-visible {
  color: #ffffff;
  background: linear-gradient(145deg, #414141, #333333);
  outline: none;
}

.stream-overlay-target-tile.is-selected {
  color: #ffffff;
  background: linear-gradient(145deg, #3b4038, #2c312a);
  border-color: var(--stream-overlay-editor-green);
  box-shadow: 0 0 0 1px rgba(141, 221, 120, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  outline: none;
}

.stream-overlay-target-tile:hover:not(:disabled),
.stream-overlay-target-tile:focus-visible {
  transform: translateY(-2px);
  border-color: #9b9b9b;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.stream-overlay-target-tile.is-selected:hover:not(:disabled),
.stream-overlay-target-tile.is-selected:focus-visible {
  border-color: #a7ef94;
}

.stream-overlay-target-selected-indicator {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  width: 22px;
  height: 22px;
  z-index: 3;
  place-items: center;
  color: #1e2a1b;
  background: #a7e890;
  border: 2px solid var(--stream-overlay-editor-surface);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.32);
  font-size: 9px;
}

.stream-overlay-target-avatar {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  overflow: hidden;
  color: #ededed;
  background: #424242;
  border: 1px solid #747474;
  border-radius: 50%;
  box-shadow: 0 4px 11px rgba(0, 0, 0, 0.2);
  font-size: 11px;
  font-weight: 800;
}

.stream-overlay-target-avatar img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.stream-overlay-target-tile--team .stream-overlay-target-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 9px;
  box-shadow: none;
}

.stream-overlay-target-tile > strong,
.stream-overlay-target-copy strong,
.stream-overlay-target-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-overlay-target-tile > strong,
.stream-overlay-target-copy strong {
  font-size: 11px;
  font-weight: 750;
  line-height: 1.15;
}

.stream-overlay-target-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.stream-overlay-target-copy small {
  color: #c0c0c0;
  font-size: 10px;
}

.stream-overlay-target-chevron {
  color: #bdbdbd;
  font-size: 9px;
}

.stream-overlay-team-member-picker {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: min(260px, calc(100% - 18px));
  z-index: 20;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
  padding: 11px;
  color: #eeeeee;
  background: #3a3a3a;
  border: 1px solid #727272;
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42);
  font-size: 10px;
}

.stream-overlay-team-member-picker select {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #777777;
  border-radius: 8px;
}

.stream-overlay-target-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px;
  color: var(--stream-overlay-editor-muted);
  background: #292929;
  border: 1px dashed #5b5b5b;
  border-radius: 8px;
  font-size: 10px;
  text-align: center;
}

.stream-overlay-target-field.is-disabled .stream-overlay-target-grid {
  opacity: 0.48;
}

.stream-overlay-target-tile:disabled {
  cursor: not-allowed;
  transform: none;
}

.stream-overlay-loop-toggle,
.stream-overlay-size-control,
.stream-overlay-position-control,
.stream-overlay-crop-control {
  padding: 11px 12px;
}

.stream-overlay-dialog .stream-overlay-status-message {
  flex: 0 0 auto;
  min-height: 14px;
  padding: 0 20px 10px;
}

.stream-overlay-add-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 9px;
  background: #292929;
  border: 1px solid #5b5b5b;
  border-radius: 9px;
}

.stream-overlay-add-menu[hidden],
.stream-overlay-browser-form[hidden] {
  display: none !important;
}

.stream-overlay-add-menu-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 9px;
  color: #e8e8e8;
  text-align: left;
  background: #202020;
  border: 1px solid #4e4e4e;
  border-radius: 8px;
  cursor: pointer;
}

.stream-overlay-add-menu-option:hover,
.stream-overlay-add-menu-option:focus-visible {
  color: #ffffff;
  background: #383838;
  border-color: #9a9a9a;
  outline: none;
}

.stream-overlay-add-menu-option > i {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  color: #dddddd;
  background: #353535;
  border: 1px solid #5b5b5b;
  border-radius: 7px;
}

.stream-overlay-add-menu-option > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.stream-overlay-add-menu-option strong {
  font-size: 10px;
}

.stream-overlay-add-menu-option small {
  color: #a9a9a9;
  font-size: 9px;
  line-height: 1.3;
}

.stream-overlay-browser-form {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  padding: 10px;
  background: #242424;
  border: 1px solid #5b5b5b;
  border-radius: 9px;
}

.stream-overlay-browser-form-heading {
  display: grid;
  gap: 3px;
}

.stream-overlay-browser-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.stream-overlay-preview-item--browser > .stream-overlay-preview-media,
.stream-overlay-item--browser > .stream-overlay-media {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 1920px !important;
  height: 1080px !important;
  min-width: 0;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto;
  background: transparent !important;
  background-color: transparent !important;
  color-scheme: normal;
  border: 0;
  pointer-events: none;
  transform: scale(var(--stream-overlay-browser-scale, 1)) !important;
  transform-origin: top left !important;
}

.stream-overlay-preview-item--browser.is-interactive {
  cursor: default;
}

.stream-overlay-preview-item--browser {
  aspect-ratio: 16 / 9;
  height: auto;
  overflow: clip;
  background: transparent !important;
}

.stream-overlay-item--browser {
  aspect-ratio: 16 / 9;
  height: auto !important;
  overflow: clip;
}

/* A direct cross-origin iframe may arrive as an opaque black canvas. The
   fallback removes that black canvas, but it is intentionally skipped for a
   rewritten document whose alpha channel is available natively. */
.stream-overlay-preview-item--browser:not(:has(> .stream-overlay-preview-media[data-browser-source-mode="transparent-document"])) {
  mix-blend-mode: screen;
  filter: saturate(1.2) brightness(1.65) contrast(1.2);
}

/* CORS-enabled pages are rewritten into an opaque-origin document with a real
   transparent canvas. Preserve its native colors and alpha. */
.stream-overlay-preview-item--browser:has(> .stream-overlay-preview-media[data-browser-source-mode="transparent-document"]) {
  mix-blend-mode: normal;
  filter: none;
}

.stream-overlay-preview-item--browser.is-interactive > .stream-overlay-preview-media {
  pointer-events: auto;
  cursor: auto;
}


@media (max-width: 1080px) {
  .stream-overlay-dialog {
    width: min(920px, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
  }

  .stream-overlay-dialog .stream-overlay-form {
    max-height: calc(100dvh - 22px);
  }

  .stream-overlay-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: max-content max-content;
  }
}

@media (max-width: 560px) {
  .stream-overlay-dialog .stream-overlay-header,
  .stream-overlay-dialog .stream-overlay-actions {
    padding: 12px;
  }

  .stream-overlay-dialog .stream-overlay-help {
    padding: 10px 12px 0;
  }

  .stream-overlay-workspace {
    padding: 12px;
  }

  .stream-overlay-scope-fieldset {
    grid-template-columns: 1fr;
  }

  .stream-overlay-layer-visibility {
    min-width: 34px;
    width: 34px;
    padding: 0;
  }

  .stream-overlay-layer-visibility span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .stream-overlay-team-member-picker {
    position: static;
    width: auto;
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }

  .stream-overlay-target-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stream-overlay-target-tile {
    min-height: 80px;
  }

  .stream-overlay-add-menu {
    grid-template-columns: 1fr;
  }

  .stream-overlay-browser-form-actions {
    justify-content: stretch;
  }

  .stream-overlay-browser-form-actions > button {
    flex: 1;
  }
}

/* Sliding capacity pill: one calm control, one moving active state. */
body.left-nav-layout .watch-party-capacity-control .mode-buttons {
  position: relative;
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  grid-template-rows: minmax(34px, 1fr);
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 4px;
  gap: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(218, 218, 218, 0.3);
  border-radius: 999px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.08), transparent 38%),
    linear-gradient(180deg, #1c1c1c 0%, #101010 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -8px 16px rgba(0, 0, 0, 0.2),
    0 8px 18px rgba(0, 0, 0, 0.2);
}

body.left-nav-layout .watch-party-capacity-control .mode-buttons-active-pill {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: var(--mode-pill-width, 0px);
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background:
    radial-gradient(circle at 27% 12%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(135deg, #f6f9ff 0%, #cddcff 30%, #7598ff 70%, #4468e6 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.8),
    0 0 0 1px rgba(99, 143, 255, 0.48),
    0 4px 14px rgba(55, 100, 230, 0.46);
  transform: translate3d(var(--mode-pill-left, 4px), 0, 0);
  transition:
    transform 380ms cubic-bezier(0.22, 1, 0.36, 1),
    width 180ms ease;
}

body.left-nav-layout .watch-party-capacity-control .mode-buttons-active-pill::after {
  position: absolute;
  inset: 1px;
  content: "";
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 24%, rgba(255, 255, 255, 0.24) 50%, transparent 76%);
  opacity: 0.75;
}

body.left-nav-layout .watch-party-capacity-control .team-mode-button,
body.left-nav-layout .watch-party-capacity-control #singleModeButton,
body.left-nav-layout .watch-party-capacity-control #dualModeButton {
  display: grid !important;
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(0, 1fr) !important;
  align-content: center !important;
  align-items: center !important;
  justify-content: stretch !important;
  justify-items: stretch !important;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  height: 34px;
  margin: 0;
  padding: 0 4px;
  color: #9c9c9c !important;
  border: 1px solid transparent !important;
  border-radius: 999px;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.26px;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  transform: none;
  transition:
    color 180ms ease,
    text-shadow 180ms ease,
    transform 160ms ease;
}

body.left-nav-layout .watch-party-capacity-control .team-mode-button .nav-button-label {
  display: block !important;
  flex: none !important;
  justify-self: stretch !important;
  min-width: 0;
  width: 100% !important;
  max-width: none !important;
  margin: 0;
  overflow: visible;
  line-height: 1 !important;
  text-align: center !important;
  text-overflow: clip;
}

body.left-nav-layout .watch-party-capacity-control .team-mode-button::before,
body.left-nav-layout .watch-party-capacity-control .team-mode-button::after {
  display: none !important;
  content: none !important;
}

body.left-nav-layout .watch-party-capacity-control .team-mode-button:hover {
  color: #ffffff !important;
  background: transparent !important;
  transform: translateY(-1px);
}

body.left-nav-layout .watch-party-capacity-control .team-mode-button:active {
  transform: translateY(0) scale(0.965);
}

body.left-nav-layout .watch-party-capacity-control .team-mode-button:focus-visible {
  z-index: 2;
  outline: 2px solid rgba(238, 238, 238, 0.9);
  outline-offset: -2px;
}

body.left-nav-layout #liveWindowCapacityControl .team-mode-button.active-mode-button,
body.left-nav-layout #liveWindowCapacityControl .team-mode-button[aria-pressed="true"] {
  color: #111a35 !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

body.left-nav-layout #liveWindowCapacityControl .team-mode-button.active-mode-button:hover,
body.left-nav-layout #liveWindowCapacityControl .team-mode-button[aria-pressed="true"]:hover {
  color: #0b1330 !important;
}

@media (prefers-reduced-motion: reduce) {
  body.left-nav-layout .watch-party-capacity-control .mode-buttons-active-pill,
  body.left-nav-layout .watch-party-capacity-control .team-mode-button {
    transition: none;
  }
}

/* ========================================================================
   Single-monitor Watch Party view

   The selected live stream stays mounted in the Control Center and begins in
   the top-left grid cell. The remaining cards densely wrap around it as it is
   enlarged, so this presentation mode never hands playback or overlay
   ownership to a second window.
   ======================================================================== */
body.left-nav-layout .single-monitor-layout-toggle {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  padding: 7px 8px;
  gap: 9px;
  color: #d5d5d5;
  border: 1px solid rgba(218, 218, 218, 0.2);
  border-radius: 9px;
  background: linear-gradient(180deg, #252525 0%, #1b1b1b 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
  text-align: left;
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 180ms ease,
    transform 160ms ease;
}

body.left-nav-layout .single-monitor-layout-toggle:hover,
body.left-nav-layout .single-monitor-layout-toggle:focus-visible {
  color: #ffffff;
  border-color: rgba(213, 227, 255, 0.56);
  background: linear-gradient(180deg, #303b50 0%, #202938 100%);
  transform: translateY(-1px);
}

body.left-nav-layout .single-monitor-layout-toggle:focus-visible {
  outline: 2px solid rgba(185, 215, 255, 0.84);
  outline-offset: 2px;
}

body.left-nav-layout .single-monitor-layout-toggle.is-active,
body.left-nav-layout .single-monitor-layout-toggle[aria-pressed="true"] {
  color: #ffffff;
  border-color: rgba(155, 188, 255, 0.78);
  background: linear-gradient(180deg, #263b70 0%, #18274c 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(73, 132, 255, 0.16);
}

body.left-nav-layout .single-monitor-layout-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #d9e7ff;
  border: 1px solid rgba(174, 204, 255, 0.36);
  border-radius: 7px;
  background: #182645;
  font-size: 12px;
}

body.left-nav-layout .single-monitor-layout-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

body.left-nav-layout .single-monitor-layout-title {
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.left-nav-layout .single-monitor-layout-description {
  overflow: hidden;
  color: #9fa9bb;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.left-nav-layout .single-monitor-layout-toggle .status-chip {
  min-width: 34px;
  padding: 5px 6px;
  color: #aeb6c3;
  border-color: rgba(184, 195, 214, 0.28);
  background: rgba(8, 12, 20, 0.5);
  font-size: 9px;
  text-align: center;
}

body.left-nav-layout
  .single-monitor-layout-toggle[aria-pressed="true"]
  .status-chip {
  color: #eaf1ff;
  border-color: rgba(178, 205, 255, 0.62);
  background: #2e61c6;
}

#streamsGrid.single-monitor-layout {
  box-sizing: border-box;
  align-content: start !important;
  grid-auto-flow: dense !important;
  grid-auto-rows: minmax(0, 1fr) !important;
  gap: 4px !important;
  padding: 4px !important;
  overflow: hidden !important;
}

#streamsGrid.single-monitor-layout[data-single-monitor-grid="solo"] {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

#streamsGrid.single-monitor-layout[data-single-monitor-grid="two-by-two"] {
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
}

#streamsGrid.single-monitor-layout[data-single-monitor-grid="four-by-four"] {
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
}

#streamsGrid.single-monitor-layout > .stream {
  min-width: 0 !important;
  min-height: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  aspect-ratio: auto !important;
  overflow: hidden !important;
  border-radius: 12px !important;
}

#streamsGrid.single-monitor-layout > .stream.single-monitor-active {
  grid-column: 1 / span var(--single-monitor-featured-span, 3) !important;
  grid-row: 1 / span var(--single-monitor-featured-rows, 1) !important;
  aspect-ratio: 16 / 9 !important;
  background: #000 !important;
}

#streamsGrid.single-monitor-layout[data-single-monitor-grid="solo"]
  > .stream.single-monitor-active {
  grid-area: 1 / 1 / -1 / -1 !important;
}

#streamsGrid.single-monitor-layout[data-single-monitor-grid="two-by-two"]
  > .stream.single-monitor-active,
#streamsGrid.single-monitor-layout[data-single-monitor-grid="four-by-four"]
  > .stream.single-monitor-active {
  z-index: 3;
  border-color: rgba(170, 205, 255, 0.82) !important;
  box-shadow: inset 0 0 0 2px rgba(121, 171, 255, 0.52) !important;
}

#streamsGrid.single-monitor-layout > .stream:not(.single-monitor-active) {
  z-index: 1;
  grid-column: span var(--single-monitor-inactive-span, 3) !important;
  grid-row: auto !important;
}

@media (max-width: 720px) {
  #streamsGrid.single-monitor-layout > .stream {
    border-radius: 10px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.left-nav-layout .single-monitor-layout-toggle {
    transition: none;
  }
}

/* ========================================================================
   Featured single-monitor stream finish

   The featured card starts at the same footprint as a neighboring tile and
   scales through twelve grid segments. JavaScript grows its row span with its
   width, and dense grid placement fills the available cells beside and below
   it; the featured video remains contain-fitted inside its card.
   ======================================================================== */
#streamsGrid.single-monitor-layout > .stream.single-monitor-active {
  z-index: 3 !important;
  border-color: rgba(220, 220, 220, 0.88) !important;
  box-shadow:
    0 0 0 2px rgba(220, 220, 220, 0.24),
    0 12px 28px rgba(0, 0, 0, 0.48),
    inset 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
}

/* The featured card is already the active Live output. Keep its video clear
   while leaving the Live controls on the remaining preview cards available. */
#streamsGrid.single-monitor-layout
  > .stream.single-monitor-active
  > .live-button {
  display: none !important;
}

/* Single-monitor view keeps the live card anchored and replaces its Move menu
   with an invisible corner resize grip. Other cards retain their Move action. */
body.popup-mode
  #streamsGrid.single-monitor-layout
  > .stream.single-monitor-active
  > .movement-arrows {
  display: none !important;
}

.single-monitor-resize-handle[hidden] {
  display: none !important;
}

body.popup-mode .stream > .single-monitor-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 18;
  display: block;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0 0 12px 0;
  background: transparent;
  opacity: 0;
  cursor: nwse-resize;
  touch-action: none;
  user-select: none;
}

body.popup-mode .stream > .single-monitor-resize-handle:focus-visible {
  opacity: 0;
  outline: none;
  box-shadow: none;
}

body.single-monitor-resize-active,
body.single-monitor-resize-active * {
  cursor: nwse-resize !important;
  user-select: none !important;
}

body.single-monitor-mode #streamsGrid .pip-button:disabled {
  color: rgba(255, 255, 255, 0.42) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  background: #252528 !important;
  box-shadow: none !important;
  opacity: 0.62 !important;
  filter: grayscale(1);
  cursor: not-allowed !important;
  transform: none !important;
}

body.popup-mode #streamsGrid.single-monitor-layout.overview-fit
  > .stream.empty-team-stream-card {
  order: 2147483647 !important;
  grid-column: span var(--single-monitor-inactive-span, 3) !important;
  grid-row: auto !important;
}

body.popup-mode
  #streamsGrid.single-monitor-layout.overview-fit[data-single-monitor-grid="four-by-four"]
  > .stream.empty-team-stream-card {
  grid-column: span var(--single-monitor-inactive-span, 3) !important;
  padding: 8px 12px !important;
}

body.popup-mode
  #streamsGrid.single-monitor-layout[data-single-monitor-grid="four-by-four"]
  > .stream.empty-team-stream-card
  .empty-team-stream-content {
  gap: 4px;
}

body.popup-mode
  #streamsGrid.single-monitor-layout[data-single-monitor-grid="four-by-four"]
  > .stream.empty-team-stream-card
  .empty-team-stream-icon {
  width: 34px;
  height: 34px;
  margin: 0;
  font-size: 14px;
}

body.popup-mode
  #streamsGrid.single-monitor-layout[data-single-monitor-grid="four-by-four"]
  > .stream.empty-team-stream-card
  .empty-team-stream-content h2 {
  font-size: 17px;
  line-height: 1.05;
}

body.popup-mode
  #streamsGrid.single-monitor-layout[data-single-monitor-grid="four-by-four"]
  > .stream.empty-team-stream-card
  .empty-team-stream-content p {
  font-size: 10px;
  line-height: 1.2;
}

body.popup-mode
  #streamsGrid.single-monitor-layout[data-single-monitor-grid="four-by-four"]
  > .stream.empty-team-stream-card
  .empty-team-stream-actions {
  gap: 6px;
  margin-top: 2px;
}

body.popup-mode
  #streamsGrid.single-monitor-layout[data-single-monitor-grid="four-by-four"]
  > .stream.empty-team-stream-card
  .empty-team-action-button {
  min-height: 30px;
  padding-inline: 10px;
  font-size: 10px;
}

#streamsGrid.single-monitor-layout
  > .stream.single-monitor-active
  > .twitch-player-host--direct,
#streamsGrid.single-monitor-layout
  > .stream.single-monitor-active
  > .twitch-player-host,
#streamsGrid.single-monitor-layout
  > .stream.single-monitor-active
  > .player,
#streamsGrid.single-monitor-layout
  > .stream.single-monitor-active
  .twitch-direct-video {
  min-width: 0 !important;
  min-height: 0 !important;
}

#streamsGrid.single-monitor-layout
  > .stream.single-monitor-active
  .twitch-direct-video,
#streamsGrid.single-monitor-layout
  > .stream.single-monitor-active
  .player {
  object-fit: contain !important;
  object-position: center !important;
}

/* Single-monitor view owns the capacity choice and locks it to Solo. */
body.left-nav-layout
  #liveWindowCapacityControl
  .mode-buttons.is-capacity-locked {
  cursor: not-allowed;
  border-color: rgba(155, 188, 255, 0.42);
  background:
    radial-gradient(circle at 18% 0%, rgba(155, 188, 255, 0.1), transparent 38%),
    linear-gradient(180deg, #1b1f2a 0%, #101116 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -8px 16px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(73, 132, 255, 0.12);
}

body.left-nav-layout
  #liveWindowCapacityControl
  .mode-buttons.is-capacity-locked
  .team-mode-button:disabled {
  cursor: not-allowed;
}

body.left-nav-layout
  #liveWindowCapacityControl
  .mode-buttons.is-capacity-locked
  .team-mode-button:disabled:not([aria-pressed="true"]) {
  color: #626875 !important;
  opacity: 0.58;
}

body.left-nav-layout
  #liveWindowCapacityControl
  .mode-buttons.is-capacity-locked
  .team-mode-button[aria-pressed="true"]:disabled {
  opacity: 1;
}

/* ========================================================================
   Stream visibility state

   The card stays in its grid slot so the tournament order remains stable,
   while the actual player surface contracts to 50% inside a near-black
   marker. The top rail and the overlay action both expose the same hide/unhide
   state.
   ======================================================================== */
.stream-visibility-overlay {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  padding: clamp(12px, 2.1vw, 28px);
  color: #f3efe8;
  background:
    radial-gradient(
      ellipse at 50% 42%,
      rgba(215, 175, 122, 0.13) 0%,
      rgba(215, 175, 122, 0.045) 25%,
      rgba(3, 4, 5, 0) 56%
    ),
    rgba(3, 4, 5, 0.78);
  border: 1px solid rgba(224, 219, 210, 0.28);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -44px 82px rgba(0, 0, 0, 0.42);
  backdrop-filter: brightness(0.38) saturate(0.28) blur(0.7px);
  isolation: isolate;
  pointer-events: auto;
  transition:
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    opacity 220ms ease;
}

.stream-visibility-overlay[hidden] {
  display: none !important;
}

.stream-visibility-overlay:hover,
.stream-visibility-overlay:focus-within {
  background:
    radial-gradient(
      ellipse at 50% 42%,
      rgba(226, 187, 133, 0.17) 0%,
      rgba(226, 187, 133, 0.06) 26%,
      rgba(3, 4, 5, 0) 58%
    ),
    rgba(3, 4, 5, 0.72);
  border-color: rgba(234, 216, 190, 0.58);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.12),
    inset 0 -44px 82px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(218, 180, 130, 0.08);
}

.stream-visibility-mark {
  position: relative;
  z-index: 2;
  display: grid;
  width: auto;
  height: auto;
  min-height: 0;
  place-items: center;
  margin: 0 0 14px;
  color: rgba(244, 241, 234, 0.88);
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1;
  opacity: 0.9;
  transform: translateY(0);
  transition:
    color 240ms ease,
    opacity 240ms ease,
    transform 240ms ease;
}

.stream-visibility-mark i {
  color: currentColor;
  filter:
    drop-shadow(0 6px 12px rgba(0, 0, 0, 0.56))
    drop-shadow(0 0 18px rgba(218, 178, 125, 0.14));
  opacity: 1;
  transform: none;
}

.stream-visibility-label {
  position: relative;
  z-index: 3;
  margin: 0 0 22px;
  color: rgba(241, 237, 230, 0.78);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: clamp(10px, 0.95vw, 14px);
  font-weight: 850;
  letter-spacing: 0.22em;
  line-height: 1;
  text-transform: uppercase;
  transition:
    color 240ms ease,
    opacity 240ms ease;
}

.stream-visibility-unhide-button {
  position: relative;
  z-index: 4;
  display: inline-flex;
  width: min(220px, 72%);
  height: 48px;
  min-width: 150px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  color: rgba(243, 239, 232, 0.78);
  background: rgba(30, 30, 30, 0.78);
  border: 1px solid rgba(224, 222, 217, 0.34);
  border-radius: 999px;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.48),
    inset 0 1px rgba(255, 255, 255, 0.12);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.16em;
  line-height: 1;
  cursor: pointer;
  transform: translateY(0);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.stream-visibility-unhide-button:hover,
.stream-visibility-unhide-button:focus-visible {
  color: #f5eee3;
  background: rgba(79, 64, 48, 0.54);
  border-color: rgba(242, 222, 193, 0.9);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.54),
    0 0 0 3px rgba(218, 178, 125, 0.12),
    0 0 26px rgba(218, 178, 125, 0.14),
    inset 0 1px rgba(255, 247, 232, 0.38);
  transform: translateY(-1px) scale(1.01);
}

.stream-visibility-unhide-button:focus-visible {
  outline: 2px solid #ead7ba;
  outline-offset: 3px;
}

.stream-visibility-overlay:hover .stream-visibility-mark,
.stream-visibility-overlay:focus-within .stream-visibility-mark {
  color: rgba(249, 244, 235, 0.98);
  opacity: 1;
  transform: translateY(-2px) scale(1.02);
}

.stream-visibility-overlay:hover .stream-visibility-label,
.stream-visibility-overlay:focus-within .stream-visibility-label {
  color: rgba(250, 244, 235, 0.98);
}

.stream-visibility-button {
  position: absolute;
  z-index: 30;
  top: 8px;
  right: 48px;
  display: inline-grid !important;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0 !important;
  place-items: center;
  color: #f5f6f8;
  background: rgba(26, 29, 35, 0.92);
  border: 1px solid rgba(220, 226, 236, 0.42);
  border-radius: 7px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px rgba(255, 255, 255, 0.12);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.stream-visibility-button .stream-control-label {
  display: none;
}

.stream-visibility-button:hover,
.stream-visibility-button:focus-visible {
  color: #fff;
  background: #3b414c;
  border-color: rgba(255, 255, 255, 0.76);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.4),
    0 0 0 2px rgba(255, 255, 255, 0.08);
  transform: translateY(-1px) scale(1.04);
}

.stream-visibility-button:focus-visible {
  outline: 2px solid #d9e7ff;
  outline-offset: 3px;
}

.stream-visibility-button[data-state="hidden"] {
  color: #e2edff;
  background: rgba(47, 59, 78, 0.92);
  border-color: rgba(184, 207, 240, 0.62);
  box-shadow:
    0 5px 14px rgba(22, 31, 48, 0.36),
    inset 0 1px rgba(255, 255, 255, 0.18);
}

.stream.stream-hidden > .live-button,
.stream.stream-hidden > .live-button:disabled {
  opacity: 0 !important;
  filter: grayscale(1);
  cursor: not-allowed !important;
  pointer-events: none !important;
  visibility: hidden !important;
  box-shadow: none !important;
}

body.popup-mode .stream.stream-hidden > .twitch-card-rail {
  z-index: 24 !important;
}

body.popup-mode .stream.twitch-stream-card.stream-hidden
  > .twitch-player-host--direct,
#streamsGrid.single-monitor-layout
  > .stream.stream-hidden
  > .twitch-player-host--direct,
.stream.stream-hidden > .twitch-player-host--direct {
  top: 25% !important;
  right: 25% !important;
  bottom: 25% !important;
  left: 25% !important;
  width: 50% !important;
  height: 50% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  overflow: hidden !important;
  border: 1px solid rgba(224, 231, 243, 0.24);
  border-radius: 10px;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transition:
    top 260ms cubic-bezier(0.22, 1, 0.36, 1),
    right 260ms cubic-bezier(0.22, 1, 0.36, 1),
    bottom 260ms cubic-bezier(0.22, 1, 0.36, 1),
    left 260ms cubic-bezier(0.22, 1, 0.36, 1),
    width 260ms cubic-bezier(0.22, 1, 0.36, 1),
  height 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* The overview-fit host rule carries the grid ID, so match its specificity
   when a hidden card contracts the direct Twitch surface. */
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-hidden
  > .twitch-player-host--direct {
  position: absolute !important;
  top: 25% !important;
  right: 25% !important;
  bottom: 25% !important;
  left: 25% !important;
  width: 50% !important;
  height: 50% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.stream-hidden
  > .player,
body.popup-mode #streamsGrid.overview-fit
  > .stream.stream-hidden
  > iframe.twitch-player,
body.popup-mode #streamsGrid.overview-fit
  > .stream.stream-hidden
  > [id$="-inner"] {
  top: 25% !important;
  right: 25% !important;
  bottom: 25% !important;
  left: 25% !important;
  width: 50% !important;
  height: 50% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
}

.stream.stream-hidden > .player,
.stream.stream-hidden > iframe.twitch-player,
.stream.stream-hidden > [id$="-inner"] {
  top: 25% !important;
  right: 25% !important;
  bottom: 25% !important;
  left: 25% !important;
  width: 50% !important;
  height: 50% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
}

body.popup-mode #streamsGrid .stream.stream-hidden,
body.popup-mode #streamsGrid .stream.stream-hidden:hover,
body.popup-mode #streamsGrid .stream.stream-hidden:focus-within,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-hidden,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-hidden:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-hidden:focus-within {
  border: 1px solid rgba(219, 204, 183, 0.42) !important;
  outline: none !important;
  outline-offset: 0;
  box-shadow:
    0 0 0 1px rgba(218, 178, 125, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.38) !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .stream-visibility-overlay,
  .stream-visibility-mark,
  .stream-visibility-button,
  .stream-visibility-unhide-button,
  .stream.stream-hidden > .twitch-player-host--direct {
    transition: none !important;
  }

  .stream-visibility-overlay:hover .stream-visibility-mark,
  .stream-visibility-overlay:focus-within .stream-visibility-mark {
    transform: none !important;
  }
}

@media (max-width: 720px) {
  .stream-visibility-overlay {
    padding: 7px;
  }

  .stream-visibility-mark {
    margin-bottom: 4px;
    font-size: 22px;
  }

  .stream-visibility-label {
    margin-bottom: 6px;
    font-size: 8px;
    letter-spacing: 0.16em;
  }

  .stream-visibility-unhide-button {
    width: 84%;
    height: 26px;
    min-width: 0;
    padding: 0 8px;
    font-size: 8px;
    letter-spacing: 0.1em;
  }

}

/* --------------------------------------------------------------------------
   Add Stream discovery: dashboard lookbook treatment

   The dashboard uses quiet charcoal surfaces, full-bleed media, generous
   gutters, and one scroll surface. Mirror that language here instead of the
   legacy pink form buttons and nested result rail.
   -------------------------------------------------------------------------- */
body.left-nav-layout .stream-composer-dialog:has(#streamDiscovery:not([hidden])) {
  --stream-discovery-ink: #f4f5f5;
  --stream-discovery-muted: #a7acad;
  --stream-discovery-dim: #727a7c;
  --stream-discovery-surface: #0e1112;
  --stream-discovery-surface-raised: #111415;
  --stream-discovery-border: #343839;
  --stream-discovery-border-soft: #292d2e;
  --stream-discovery-focus: #7bd8e8;
  --stream-discovery-online: #19b77c;
}

body.left-nav-layout
  .stream-composer-dialog:has(#streamDiscovery:not([hidden]))
  .stream-composer-dialog-form {
  gap: 16px;
  padding: 26px;
}

body.left-nav-layout
  .stream-composer-dialog:has(#streamDiscovery:not([hidden]))
  .stream-composer-dialog-body {
  padding: 18px;
  border: 0;
  background: transparent;
}

body.left-nav-layout
  .stream-composer-dialog:has(#streamDiscovery:not([hidden]))
  #addStreamForm,
body.left-nav-layout
  .stream-composer-dialog:has(#streamDiscovery:not([hidden]))
  #addStreamForm:hover {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
  align-items: stretch;
  gap: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.left-nav-layout .stream-discovery {
  display: grid;
  gap: 16px;
  min-width: 0;
  margin: 0;
  padding: 0 2px 2px;
  border: 0;
  background: transparent;
}

body.left-nav-layout .stream-discovery-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  min-width: 0;
  padding: 0 2px;
}

body.left-nav-layout .stream-discovery-kicker {
  color: var(--stream-discovery-ink, #f4f5f5);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
}

body.left-nav-layout .stream-discovery-copy {
  max-width: 420px;
  margin: 4px 0 0;
  color: var(--stream-discovery-muted, #a7acad);
  font-size: 12px;
  line-height: 1.4;
}

body.left-nav-layout .stream-discovery-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--stream-discovery-border, #343839);
  border-radius: 9px;
  background: var(--stream-discovery-surface, #0e1112);
}

body.left-nav-layout #addStreamForm .stream-discovery-tab {
  display: inline-flex;
  min-height: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--stream-discovery-muted, #a7acad);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

body.left-nav-layout #addStreamForm .stream-discovery-tab:hover,
body.left-nav-layout #addStreamForm .stream-discovery-tab:focus-visible {
  border-color: var(--stream-discovery-border, #343839);
  background: var(--stream-discovery-surface-raised, #111415);
  color: var(--stream-discovery-ink, #f4f5f5);
  outline: none;
}

body.left-nav-layout #addStreamForm .stream-discovery-tab.is-active {
  border-color: var(--stream-discovery-border, #343839);
  background: var(--stream-discovery-surface-raised, #111415);
  color: var(--stream-discovery-ink, #f4f5f5);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

body.left-nav-layout .stream-discovery-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
}

body.left-nav-layout .stream-discovery-search-shell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--stream-discovery-border, #343839);
  border-radius: 9px;
  background: var(--stream-discovery-surface, #0e1112);
  color: var(--stream-discovery-muted, #a7acad);
}

body.left-nav-layout .stream-discovery-search-shell:focus-within {
  border-color: var(--stream-discovery-focus, #7bd8e8);
  background: var(--stream-discovery-surface-raised, #111415);
  box-shadow: 0 0 0 3px rgba(123, 216, 232, 0.12);
}

body.left-nav-layout .stream-discovery-search-shell > i {
  flex: 0 0 auto;
  color: var(--stream-discovery-muted, #a7acad);
  font-size: 13px;
}

body.left-nav-layout .stream-discovery-search-shell > input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--stream-discovery-ink, #f4f5f5);
  font: inherit;
  font-size: 13px;
}

body.left-nav-layout .stream-discovery-search-shell > input::placeholder {
  color: var(--stream-discovery-dim, #727a7c);
}

body.left-nav-layout #addStreamForm .stream-discovery-clear {
  display: grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  min-height: 26px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--stream-discovery-muted, #a7acad);
  cursor: pointer;
}

body.left-nav-layout #addStreamForm .stream-discovery-clear:hover,
body.left-nav-layout #addStreamForm .stream-discovery-clear:focus-visible {
  background: var(--stream-discovery-surface-raised, #111415);
  color: var(--stream-discovery-ink, #f4f5f5);
  outline: none;
}

body.left-nav-layout .stream-discovery-category-grid,
body.left-nav-layout .stream-discovery-stream-grid {
  display: grid;
  gap: 12px;
  max-height: none;
  padding: 0;
  overflow: visible;
  scrollbar-width: none;
}

body.left-nav-layout .stream-discovery-category-grid::-webkit-scrollbar,
body.left-nav-layout .stream-discovery-stream-grid::-webkit-scrollbar {
  display: none;
}

body.left-nav-layout .stream-discovery-category-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.left-nav-layout .stream-discovery-stream-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.left-nav-layout .stream-discovery-category,
body.left-nav-layout .stream-discovery-stream {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--stream-discovery-border, #343839);
  border-radius: 9px;
  background: var(--stream-discovery-surface, #0e1112);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
  transition: border-color 160ms ease, background 160ms ease,
    box-shadow 160ms ease, transform 160ms ease;
}

body.left-nav-layout .stream-discovery-category:hover,
body.left-nav-layout .stream-discovery-category:focus-visible,
body.left-nav-layout .stream-discovery-stream:hover,
body.left-nav-layout .stream-discovery-stream:focus-within {
  border-color: #797f80;
  background: var(--stream-discovery-surface-raised, #111415);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.36);
  outline: none;
  transform: translateY(-1px);
}

body.left-nav-layout .stream-discovery-category {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 98px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-height: 188px;
  padding: 0;
  color: var(--stream-discovery-ink, #f4f5f5);
  text-align: left;
  cursor: pointer;
}

body.left-nav-layout .stream-discovery-category-media,
body.left-nav-layout .stream-discovery-stream-media {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  background: var(--stream-discovery-surface-raised, #111415);
  color: var(--stream-discovery-dim, #727a7c);
}

body.left-nav-layout .stream-discovery-category-media {
  border-bottom: 1px solid var(--stream-discovery-border-soft, #292d2e);
}

body.left-nav-layout .stream-discovery-category-art,
body.left-nav-layout .stream-discovery-stream-thumb {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
}

body.left-nav-layout .stream-discovery-category-copy,
body.left-nav-layout .stream-discovery-stream-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

body.left-nav-layout .stream-discovery-category-copy {
  gap: 4px;
  min-height: 0;
  padding: 11px 12px 12px;
}

body.left-nav-layout .stream-discovery-category-name,
body.left-nav-layout .stream-discovery-stream-name {
  overflow: hidden;
  color: var(--stream-discovery-ink, #f4f5f5);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.left-nav-layout .stream-discovery-category-meta,
body.left-nav-layout .stream-discovery-stream-title {
  overflow: hidden;
  color: var(--stream-discovery-muted, #a7acad);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.left-nav-layout .stream-discovery-category-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  color: var(--stream-discovery-ink, #f4f5f5);
  font-size: 11px;
  font-weight: 650;
}

body.left-nav-layout .stream-discovery-category-cta i {
  color: var(--stream-discovery-muted, #a7acad);
  font-size: 10px;
}

body.left-nav-layout .stream-discovery-results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  color: var(--stream-discovery-ink, #f4f5f5);
  font-size: 14px;
  font-weight: 650;
}

body.left-nav-layout #addStreamForm .stream-discovery-refresh {
  display: inline-flex;
  min-height: 32px;
  height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid var(--stream-discovery-border, #343839);
  border-radius: 7px;
  background: var(--stream-discovery-surface, #0e1112);
  color: var(--stream-discovery-ink, #f4f5f5);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

body.left-nav-layout #addStreamForm .stream-discovery-refresh:hover,
body.left-nav-layout #addStreamForm .stream-discovery-refresh:focus-visible {
  border-color: #797f80;
  background: var(--stream-discovery-surface-raised, #111415);
  outline: none;
}

body.left-nav-layout .stream-discovery-stream {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 126px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  min-height: 218px;
  padding: 0;
}

body.left-nav-layout .stream-discovery-stream-media {
  border-bottom: 1px solid var(--stream-discovery-border-soft, #292d2e);
}

body.left-nav-layout .stream-discovery-stream-media::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 38px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.42));
  content: "";
  pointer-events: none;
}

body.left-nav-layout .stream-discovery-stream-body {
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px 12px;
}

body.left-nav-layout .stream-discovery-stream-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

body.left-nav-layout .stream-discovery-stream-title {
  color: var(--stream-discovery-muted, #a7acad);
  font-size: 11px;
}

body.left-nav-layout .stream-discovery-stream-viewers {
  color: var(--stream-discovery-online, #19b77c);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

body.left-nav-layout #addStreamForm .stream-discovery-add {
  align-self: flex-end;
  flex: 0 0 auto;
  min-width: 54px;
  width: auto;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--stream-discovery-border, #343839);
  border-radius: 7px;
  background: var(--stream-discovery-surface-raised, #111415);
  color: var(--stream-discovery-ink, #f4f5f5);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

body.left-nav-layout #addStreamForm .stream-discovery-add:hover,
body.left-nav-layout #addStreamForm .stream-discovery-add:focus-visible {
  border-color: #797f80;
  background: #242829;
  color: #ffffff;
  outline: none;
  transform: translateY(-1px);
}

body.left-nav-layout #addStreamForm .stream-discovery-add:disabled {
  border-color: var(--stream-discovery-online, #19b77c);
  background: rgba(25, 183, 124, 0.13);
  color: var(--stream-discovery-online, #19b77c);
  cursor: default;
  transform: none;
}

body.left-nav-layout .stream-discovery-status {
  min-height: 0;
  margin: -3px 2px 0;
  color: var(--stream-discovery-muted, #a7acad);
  font-size: 11px;
  line-height: 1.35;
}

body.left-nav-layout .stream-discovery-status:empty {
  display: none;
}

body.left-nav-layout .stream-discovery-status[data-state="error"] {
  color: #e59a9a;
}

body.left-nav-layout .stream-discovery-status[data-state="success"] {
  color: var(--stream-discovery-online, #19b77c);
}

body.left-nav-layout .stream-discovery-state {
  grid-column: 1 / -1;
  display: grid;
  min-height: 56px;
  place-items: center;
  padding: 14px;
  border: 1px dashed var(--stream-discovery-border, #343839);
  border-radius: 9px;
  background: var(--stream-discovery-surface, #0e1112);
  color: var(--stream-discovery-muted, #a7acad);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

body.left-nav-layout .stream-discovery-state[data-state="error"] {
  border-color: #704b4b;
  background: #171010;
  color: #e59a9a;
}

body.left-nav-layout #addStreamForm .stream-discovery-retry {
  display: inline-flex;
  min-height: 28px;
  height: 28px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--stream-discovery-border, #343839);
  border-radius: 7px;
  background: var(--stream-discovery-surface-raised, #111415);
  color: var(--stream-discovery-ink, #f4f5f5);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

body.left-nav-layout #addStreamForm .stream-discovery-retry:hover,
body.left-nav-layout #addStreamForm .stream-discovery-retry:focus-visible {
  border-color: #797f80;
  background: #242829;
  outline: none;
}

@media (max-width: 1100px) {
  body.left-nav-layout .stream-discovery-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.left-nav-layout .stream-discovery-stream-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body.left-nav-layout .stream-discovery-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  body.left-nav-layout .stream-discovery-tabs {
    justify-self: start;
  }

  body.left-nav-layout .stream-discovery-category-grid,
  body.left-nav-layout .stream-discovery-stream-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body.left-nav-layout .stream-composer-dialog:has(#streamDiscovery:not([hidden])) {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }

  body.left-nav-layout
    .stream-composer-dialog:has(#streamDiscovery:not([hidden]))
    .stream-composer-dialog-form {
    gap: 14px;
    padding: 16px;
  }

  body.left-nav-layout
    .stream-composer-dialog:has(#streamDiscovery:not([hidden]))
    .stream-composer-dialog-body {
    padding: 12px;
  }

  body.left-nav-layout .stream-discovery-category-grid,
  body.left-nav-layout .stream-discovery-stream-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.left-nav-layout .stream-discovery-category,
  body.left-nav-layout .stream-discovery-stream,
  body.left-nav-layout #addStreamForm .stream-discovery-add {
    transition: none !important;
  }
}

/* The category itself is a button, so reset the legacy #addStreamForm button
   contract at the component boundary as well. */
body.left-nav-layout #addStreamForm .stream-discovery-category {
  appearance: none;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 98px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-height: 188px;
  padding: 0;
  border: 1px solid var(--stream-discovery-border, #343839);
  border-radius: 9px;
  background: var(--stream-discovery-surface, #0e1112);
  color: var(--stream-discovery-ink, #f4f5f5);
  font: inherit;
  letter-spacing: normal;
  text-align: left;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
  transform: none;
}

body.left-nav-layout #addStreamForm .stream-discovery-category:hover,
body.left-nav-layout #addStreamForm .stream-discovery-category:focus-visible {
  border-color: #797f80;
  background: var(--stream-discovery-surface-raised, #111415);
  color: var(--stream-discovery-ink, #f4f5f5);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.36);
  outline: none;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Add Stream discovery: preserve Twitch artwork and use dashboard-style
   channel rows for live results.
   -------------------------------------------------------------------------- */
body.left-nav-layout #addStreamForm .stream-discovery-category {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

body.left-nav-layout #addStreamForm .stream-discovery-category-media {
  aspect-ratio: 3 / 4;
  height: auto;
  min-height: 0;
}

body.left-nav-layout #addStreamForm .stream-discovery-category-art {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

body.left-nav-layout .stream-discovery-stream-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.left-nav-layout .stream-discovery-stream {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-rows: minmax(72px, auto);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px;
}

body.left-nav-layout .stream-discovery-stream-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--stream-discovery-border, #343839);
  border-radius: 50%;
  background: #1b2021;
  color: var(--stream-discovery-muted, #a7acad);
}

body.left-nav-layout .stream-discovery-stream-avatar-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.left-nav-layout .stream-discovery-stream-avatar-fallback {
  color: var(--stream-discovery-ink, #f4f5f5);
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
}

body.left-nav-layout .stream-discovery-stream-body {
  min-width: 0;
  justify-content: center;
  gap: 0;
  padding: 0;
}

body.left-nav-layout .stream-discovery-stream-copy {
  min-width: 0;
  gap: 3px;
}

body.left-nav-layout .stream-discovery-stream-name {
  font-size: 13px;
}

body.left-nav-layout .stream-discovery-stream-title {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.left-nav-layout #addStreamForm .stream-discovery-add {
  align-self: center;
  justify-self: end;
}

@media (max-width: 1100px) {
  body.left-nav-layout .stream-discovery-category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.left-nav-layout .stream-discovery-stream-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body.left-nav-layout .stream-discovery-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.left-nav-layout .stream-discovery-stream-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body.left-nav-layout .stream-discovery-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Compact category browsing: keep the poster art readable without letting it
   dominate the picker. The wider modal can comfortably carry six categories
   per row, then steps down as the available width tightens. */
body.left-nav-layout .stream-discovery-category-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

body.left-nav-layout #addStreamForm .stream-discovery-category {
  grid-template-rows: 148px minmax(0, auto);
  min-height: 0;
}

body.left-nav-layout #addStreamForm .stream-discovery-category-media {
  display: flex;
  height: 148px;
  aspect-ratio: auto;
  align-items: center;
  justify-content: center;
  background: #0a0d0e;
}

body.left-nav-layout #addStreamForm .stream-discovery-category-art {
  width: auto;
  max-width: 100%;
  height: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
}

body.left-nav-layout #addStreamForm .stream-discovery-category-copy {
  gap: 3px;
  padding: 8px 10px 9px;
}

body.left-nav-layout #addStreamForm .stream-discovery-category-name {
  font-size: 12px;
}

body.left-nav-layout #addStreamForm .stream-discovery-category-meta,
body.left-nav-layout #addStreamForm .stream-discovery-category-cta {
  font-size: 10px;
}

@media (max-width: 1500px) {
  body.left-nav-layout .stream-discovery-category-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  body.left-nav-layout .stream-discovery-category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body.left-nav-layout .stream-discovery-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.left-nav-layout #addStreamForm .stream-discovery-category {
    grid-template-rows: 128px minmax(0, auto);
  }

  body.left-nav-layout #addStreamForm .stream-discovery-category-media {
    height: 128px;
  }
}

@media (max-width: 520px) {
  body.left-nav-layout .stream-discovery-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.left-nav-layout #addStreamForm .stream-discovery-category {
    grid-template-rows: 112px minmax(0, auto);
  }

  body.left-nav-layout #addStreamForm .stream-discovery-category-media {
    height: 112px;
  }
}

/* Center the stream identity inside the title pill while keeping the index
   visually separate and the refresh glyph attached to the pill's right edge. */
.stream-name-identity {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  text-align: center;
}

.stream-name-identity .stream-name-label {
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-name-identity .team-stream-labels {
  min-width: 0;
  overflow: hidden;
  text-align: center;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center !important;
  column-gap: 0 !important;
}

body.popup-mode #streamsGrid .stream .stream-name > .stream-index-label {
  grid-column: 1;
  align-self: stretch;
  align-items: center;
  justify-content: flex-start;
  padding-right: 9px;
  margin-right: 9px;
  border-right: 1px solid rgba(200, 214, 235, 0.28);
}

body.popup-mode #streamsGrid .stream .stream-name > .stream-name-identity {
  grid-column: 2;
  width: 100%;
}

body.popup-mode #streamsGrid .stream .stream-name > .stream-name-refresh-icon {
  grid-column: 3;
  justify-self: stretch;
}

/* The eye is a card-level action. On hover/focus it sits at the visual
   bottom center, clear of the title rail and the corner actions. */
body.popup-mode #streamsGrid .stream > .stream-visibility-button {
  top: auto !important;
  right: auto !important;
  bottom: 8px !important;
  left: 50% !important;
  margin: 0 !important;
  transform: translateX(-50%) !important;
  transform-origin: center bottom;
}

body.popup-mode #streamsGrid .stream > .stream-visibility-button:hover,
body.popup-mode #streamsGrid .stream > .stream-visibility-button:focus-visible {
  transform: translateX(-50%) translateY(-1px) scale(1.04) !important;
}

/* Stream-rail controls sit flush against the card's outer edge. Keep the
   corners facing the video rounded, but make the outside edge a clean,
   uninterrupted line when a card reaches the window boundary. */
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  > .stream-name,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  > .pip-button {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-overview-card
  > .twitch-card-rail.twitch-card-rail--top
  > .remove-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.team-stream-card
  > .twitch-card-rail.twitch-card-rail--top
  > .remove-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .movement-arrows
  .move-toggle {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* Keep the channel index close to the avatar without the divider that made
   the title pill read like two separate controls. */
body.popup-mode #streamsGrid .stream .stream-name > .stream-index-label {
  padding-right: 4px !important;
  margin-right: 4px !important;
  border-right: 0 !important;
  font-size: 0.95em !important;
}

/* The hidden-card action is an icon affordance; keep its accessible name and
   title in the DOM while removing the redundant visible UNHIDE copy. */
.stream-visibility-unhide-button {
  display: inline-grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  gap: 0;
  border-radius: 7px;
  font-size: 14px;
  letter-spacing: 0;
}

.stream-visibility-unhide-button > span {
  display: none;
}

/* Hidden cards keep the same top chrome as active cards. Lift the rail above
   the hidden-state overlay and keep the close action available at rest; its
   existing hover/focus styling still supplies the interaction feedback. */
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-hidden
  > .twitch-card-rail--top,
body.popup-mode #streamsGrid .stream.stream-hidden
  > .twitch-card-rail--top {
  z-index: 24 !important;
}

body.popup-mode #streamsGrid .stream.stream-hidden
  > .twitch-card-rail--top
  .remove-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-hidden
  > .twitch-card-rail--top
  .remove-button {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Edge controls share the card's perimeter color. Their inner corners stay
   soft, while the side that meets the screen/card boundary becomes one
   uninterrupted straight line. */
body.popup-mode #streamsGrid.overview-fit > .stream.twitch-stream-card {
  --stream-card-edge-border: rgba(160, 160, 160, 0.36);
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card:hover {
  --stream-card-edge-border: rgba(220, 220, 220, 0.58);
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.active,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.active:hover {
  --stream-card-edge-border: var(--stream-control-live);
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-hidden,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-hidden:hover,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-hidden:focus-within {
  --stream-card-edge-border: rgba(219, 204, 183, 0.42);
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name {
  border-color: var(--stream-card-edge-border) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  .stream-name > .stream-name-refresh-icon {
  /* This is the title pill's screen-facing end. Keep both joins straight
     where the segment meets the card edge, and give the final glyph one tiny
     breathing space from the channel name. */
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  margin-left: 2px !important;
  border-left-color: var(--stream-card-edge-border) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  > .pip-button {
  border-left-color: var(--stream-card-edge-border) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  > .clip-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .movement-arrows
  .move-toggle {
  border-right-color: var(--stream-card-edge-border) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-overview-card
  > .twitch-card-rail.twitch-card-rail--top
  > .remove-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.team-stream-card
  > .twitch-card-rail.twitch-card-rail--top
  > .remove-button {
  border-right-color: var(--stream-card-edge-border) !important;
}

body.popup-mode #streamsGrid .stream > .stream-visibility-button {
  bottom: 0 !important;
  left: 50% !important;
  border-radius: 7px 7px 0 0 !important;
  border-bottom-color: var(--stream-card-edge-border) !important;
  transform: translateX(-50%) !important;
  transform-origin: center bottom;
}

body.popup-mode #streamsGrid .stream.stream-hidden
  > .stream-visibility-overlay
  > .stream-visibility-unhide-button {
  position: absolute;
  bottom: 0;
  left: 50%;
  margin: 0;
  border-radius: 7px 7px 0 0;
  border-bottom-color: var(--stream-card-edge-border);
  transform: translateX(-50%);
}

body.popup-mode #streamsGrid .stream.stream-hidden
  > .stream-visibility-overlay
  > .stream-visibility-unhide-button:hover,
body.popup-mode #streamsGrid .stream.stream-hidden
  > .stream-visibility-overlay
  > .stream-visibility-unhide-button:focus-visible {
  transform: translateX(-50%) translateY(-1px) scale(1.01);
}

/* The corner actions use the same density-aware square as their rail. Keep
   the Move affordance icon-only while preserving its accessible label/title,
   and make the close control the same footprint as the title pill height. */
body.popup-mode #streamsGrid.overview-fit[data-stream-control-density]:not([data-stream-control-density="__never__"])
  > .stream.twitch-stream-card
  > .twitch-card-rail.twitch-card-rail--top
  > .remove-button {
  flex-basis: var(--stream-tile-title-height, 36px) !important;
  width: var(--stream-tile-title-height, 36px) !important;
  min-width: var(--stream-tile-title-height, 36px) !important;
  height: var(--stream-tile-title-height, 36px) !important;
  min-height: var(--stream-tile-title-height, 36px) !important;
  max-height: var(--stream-tile-title-height, 36px) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .movement-arrows
  > .move-toggle {
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  height: var(--stream-tile-action-height, 36px) !important;
  min-height: var(--stream-tile-action-height, 36px) !important;
  max-height: var(--stream-tile-action-height, 36px) !important;
  padding: 0 !important;
  gap: 0 !important;
  transform-origin: bottom right;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .movement-arrows
  > .move-toggle
  > .move-toggle-label {
  display: none !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .movement-arrows
  > .move-toggle
  > i {
  font-size: 16px !important;
  line-height: 1 !important;
}

/* Final stream-control geometry: PIP, Hide/Unhide, and Move use one shared
   density-aware height. The outer top/bottom edges are square where a control
   meets the stream frame; only the corners facing the video keep a radius. */
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  > .pip-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  > .clip-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .movement-arrows
  > .move-toggle,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .stream-visibility-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-hidden
  > .stream-visibility-overlay
  > .stream-visibility-unhide-button {
  box-sizing: border-box;
  height: var(--stream-tile-action-height, 36px) !important;
  min-height: var(--stream-tile-action-height, 36px) !important;
  max-height: var(--stream-tile-action-height, 36px) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .movement-arrows
  > .move-toggle,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .stream-visibility-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-hidden
  > .stream-visibility-overlay
  > .stream-visibility-unhide-button {
  width: var(--stream-tile-action-height, 36px) !important;
  min-width: var(--stream-tile-action-height, 36px) !important;
  max-width: var(--stream-tile-action-height, 36px) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  > .stream-name {
  border-radius: 0 0 var(--stream-card-corner-radius, 10px) 0 !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--top
  > .remove-button {
  border-radius: 0 0 0 var(--stream-card-corner-radius, 10px) !important;
}

/* Settled overview/team cards carry a more specific legacy radius rule. Keep
   the close control's top edge square at that specificity too, while leaving
   only its inward lower-left corner rounded. */
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-overview-card
  > .twitch-card-rail.twitch-card-rail--top
  > .remove-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.team-stream-card
  > .twitch-card-rail.twitch-card-rail--top
  > .remove-button {
  border-radius: 0 0 0 var(--stream-card-corner-radius, 10px) !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  > .pip-button {
  border-radius: 0 var(--stream-card-corner-radius, 10px) 0 0 !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .twitch-card-rail--bottom
  > .clip-button {
  border-radius: var(--stream-card-corner-radius, 10px) 0 0 0 !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .movement-arrows
  > .move-toggle {
  border-radius: var(--stream-card-corner-radius, 10px) 0 0 0 !important;
}

body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card
  > .stream-visibility-button,
body.popup-mode #streamsGrid.overview-fit
  > .stream.twitch-stream-card.stream-hidden
  > .stream-visibility-overlay
  > .stream-visibility-unhide-button {
  border-radius: var(--stream-card-corner-radius, 7px)
    var(--stream-card-corner-radius, 7px) 0 0 !important;
}
