/**
 * Mobile-friendly layout (v2.3+) — does not change desktop above breakpoints.
 */
@media (max-width: 768px) {
  .vip-content-inner {
    padding: max(0.75rem, env(safe-area-inset-left)) max(0.75rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .vip-topbar {
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: var(--top-h);
    height: auto;
    padding: 0.5rem 0.65rem;
  }

  .vip-topbar-actions {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }

  .vip-lang-picker select,
  .vip-theme-select {
    max-width: 100%;
    font-size: 16px;
  }

  .vip-btn,
  .vip-action-btn,
  .vf-input,
  select.vf-input {
    min-height: 44px;
    font-size: 16px;
  }

  .vip-pagehead-actions,
  .vip-streams-top-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.4rem;
  }

  .vip-pagehead-actions .vip-btn,
  .vip-streams-top-actions .vip-btn,
  .vip-pagehead-actions form,
  .vip-streams-top-actions form {
    width: 100%;
  }

  .vip-bulk-ffmpeg-form {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .vip-bulk-ffmpeg-select {
    max-width: none;
    width: 100%;
  }

  .vip-stream-stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .vip-table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .vip-table-toolbar .vip-search {
    width: 100%;
  }

  .vip-stream-legend {
    display: none;
  }

  .vip-table-streams .vip-stream-actions {
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 42vw;
    padding-bottom: 2px;
  }

  .vip-action-lbl {
    display: none;
  }

  .vip-action-btn {
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0.35rem;
  }

  .vip-license-enterprise-meta,
  .vip-license-enterprise-meta--wide {
    flex-direction: column;
    gap: 0.75rem;
  }

  .vip-license-stat {
    width: 100%;
  }

  .vip-license-form-card .vf-grid-2 {
    grid-template-columns: 1fr;
  }

  .vip-settings-quickhelp {
    grid-template-columns: 1fr;
  }

  .vip-theme-grid {
    grid-template-columns: 1fr;
  }

  .vip-stack-grid--status,
  .vip-monitor-grid,
  .vip-headend-grid {
    grid-template-columns: 1fr !important;
  }

  .vip-player-dialog {
    width: calc(100vw - 1.5rem);
    max-width: none;
    margin: 0.75rem;
  }

  .vip-detail-cmd pre {
    max-height: 40vh;
  }
}

@media (max-width: 480px) {
  .vip-stream-stats-bar {
    grid-template-columns: 1fr;
  }

  .vip-filter-chip {
    flex: 1 1 auto;
    text-align: center;
  }

  .vip-stat-card {
    padding: 0.65rem;
  }
}
