/* Auto-layout viewport fitting for exactly four streams on desktop landscape.
   This only adjusts visual sizing; manual layouts and focused-stream mode remain unchanged. */

@media (orientation: landscape) and (min-width: 1200px) and (min-height: 650px) {
  body:not(.layout-manual):not(:has(.stream-card.is-focused)):has(.stream-grid > .stream-card:nth-child(4):last-child) .topbar {
    min-height: 92px;
  }

  body:not(.layout-manual):not(:has(.stream-card.is-focused)):has(.stream-grid > .stream-card:nth-child(4):last-child) .input-error-wrap {
    min-height: 18px;
    margin-top: -14px;
    margin-bottom: 4px;
  }

  body:not(.layout-manual):not(:has(.stream-card.is-focused)):has(.stream-grid > .stream-card:nth-child(4):last-child) .app-shell {
    padding-bottom: 14px;
  }

  body:not(.layout-manual):not(:has(.stream-card.is-focused)):has(.stream-grid > .stream-card:nth-child(4):last-child) .stream-grid {
    gap: 10px;
  }

  body:not(.layout-manual):not(:has(.stream-card.is-focused)):has(.stream-grid > .stream-card:nth-child(4):last-child) .stream-toolbar {
    height: 42px;
    padding-inline: 9px;
  }

  body:not(.layout-manual):not(:has(.stream-card.is-focused)):has(.stream-grid > .stream-card:nth-child(4):last-child) .platform-badge {
    width: 26px;
    height: 26px;
  }

  body:not(.layout-manual):not(:has(.stream-card.is-focused)):has(.stream-grid > .stream-card:nth-child(4):last-child) .icon-button {
    width: 30px;
    height: 30px;
  }

  body:not(.layout-manual):not(:has(.stream-card.is-focused)):has(.stream-grid > .stream-card:nth-child(4):last-child) .player-shell {
    aspect-ratio: auto;
    height: clamp(205px, calc((100vh - 340px) / 2), 340px);
    height: clamp(205px, calc((100dvh - 340px) / 2), 340px);
  }

  body:not(.layout-manual):not(:has(.stream-card.is-focused)):has(.stream-grid > .stream-card:nth-child(4):last-child) .action-bar {
    min-height: 60px;
    margin-top: 10px;
    padding: 6px;
  }

  body:not(.layout-manual):not(:has(.stream-card.is-focused)):has(.stream-grid > .stream-card:nth-child(4):last-child) .stream-count-pill,
  body:not(.layout-manual):not(:has(.stream-card.is-focused)):has(.stream-grid > .stream-card:nth-child(4):last-child) .action-button {
    min-height: 42px;
    height: 42px;
  }
}
