@media (max-width: 768px) {
  body {
    justify-content: flex-start;
    padding-top: 48px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* Ocultar remote sidebar — los botones del TV hacen lo mismo */
  .remote { display: none; }

  /* Reordenar flex: tv-wrapper arriba, channel-list abajo */
  .tv-wrapper { order: 2; width: 100%; }
  .channel-list { order: 3; }

  /* TV body full width */
  .tv-body:not(.sch-card-thumb) {
    width: 100%;
    border-radius: 0;
    padding: 8px 8px 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .screen-bezel {
    padding: 6px !important;
    border-radius: 6px;
    width: 100%;
  }

  .guide-container {
    display: none !important;
  }

  /* Pantalla: ancho total, ratio 4:3 */
  .screen {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    margin-bottom: 10px;
  }

  /* TV controls: touch friendly */
  .tv-controls {
    padding: 10px 12px;
    gap: 10px;
    width: 100%;
    order: 4;
    margin-top: auto;
    background: rgba(10, 0, 7, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .ch-btn {
    min-width: 48px;
    min-height: 44px;
    font-size: 14px;
  }

  .power-btn {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }

  /* Ocultar patas en móvil */
  .tv-stand { display: none; }

  /* Channel list: franja horizontal scrollable */
  .channel-list {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    width: 100%;
    transform: none;
    padding: 8px;
    gap: 6px;
    background: rgba(22, 13, 19, 0.98);
    scrollbar-width: none;
  }
  .channel-list::-webkit-scrollbar { display: none; }

  .channel-btn {
    flex-shrink: 0;
    min-width: 82px;
    text-align: center;
  }

  /* Header compacto */
  .header {
    padding: 0 10px;
    height: 48px;
  }

  .logo {
    font-size: 18px;
  }

  .signal-info {
    font-size: 13px;
  }
}

/* =================================
   MOBILE PORTRAIT ORIENTATION RULES
   ================================= */
@media (max-width: 768px) and (orientation: portrait) {
  .tv-body:not(.sch-card-thumb) {
    padding: 8px !important;
    border-radius: 0 0 28px 28px !important;
    margin-bottom: 0;
  }

  .tv-controls {
    border-radius: 0 0 12px 12px;
    padding: 12px;
    gap: 12px;
    margin-top: 0;
    order: 3;
  }

  .channel-list {
    order: 4;
    padding: 8px 12px;
    margin-top: 0;
  }

  /* Asegurar que el screen no se solape */
  .screen {
    margin-bottom: 12px;
  }

  /* Ajustar padding para que el bezel no se corte */
  .screen-bezel {
    padding: 8px !important;
  }
}