/* Lo propio de la versión web (theme de WordPress): la barra de arriba sin los botones de la ventana de Windows,
   los enlaces a WordPress y el panel de subida al hosting. */
#toolbar { padding: 0 14px 0 12px; }
.omm-tb-link { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; margin-left: 4px; border-radius: var(--radius);
  color: var(--text-2); font-size: 12px; font-weight: 500; text-decoration: none; }
.omm-tb-link:hover { background: var(--bg-3); color: var(--text); }

/* Videos subiendo al hosting (antes de entrar en la lista) */
.omm-upfiles { position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 340px; max-width: calc(100vw - 32px); padding: 12px 14px 12px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); }
.omm-upfiles .h { display: flex; align-items: center; gap: 8px; }
.omm-upfiles .h b { flex: 1; font-size: 12.5px; font-weight: 650; }
.omm-upfiles .h .btn { height: 26px; padding: 0 10px; font-size: 12px; }
.omm-upfiles .n { margin: 8px 0 8px; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.omm-upfiles .bar { height: 5px; border-radius: 3px; background: var(--bg-4); overflow: hidden; }
.omm-upfiles .bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.omm-upfiles small { display: block; margin-top: 6px; color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }

/* /admin: entrar */
body.omm-login-page { display: flex; align-items: center; justify-content: center; min-height: 100%; overflow: auto; padding: 24px 16px;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(91, 141, 239, .10), transparent 70%), var(--bg-0); }
.omm-login { width: 380px; max-width: 100%; padding: 30px 30px 28px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.omm-login-brand { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.omm-login-brand img { width: 26px; height: 26px; object-fit: contain; }
.omm-login-brand b { color: var(--text-2); font-weight: 500; }
.omm-login h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
.omm-login .sub { margin: -8px 0 4px; color: var(--text-3); font-size: 13px; }
.omm-login label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.omm-login input[type=text], .omm-login input[type=password] { height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--field); color: var(--text); font: 14px var(--font); outline: none; }
.omm-login input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.omm-login .omm-login-rem { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; color: var(--text-3); }
.omm-login .btn.primary { height: 42px; margin-top: 4px; justify-content: center; font-size: 14px; font-weight: 600; border-radius: 8px; }
.omm-login-err { padding: 10px 12px; border-radius: 8px; background: var(--danger-bg); border: 1px solid rgba(239, 90, 90, .35); color: #ff9b9b; font-size: 12.5px; }

/* Espacio del hosting (barra lateral y su ventana) */
.omm-space { display: flex; flex-direction: column; gap: 7px; width: 100%; margin: 0 0 12px; padding: 10px 11px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; color: var(--text); }
.omm-space .t { display: flex; flex-direction: column; gap: 2px; }
.omm-space .t small { color: var(--text-3); font-size: 10.5px; letter-spacing: .3px; }
.omm-space .t b { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.omm-space-bar { height: 5px; border-radius: 3px; background: var(--bg-4); overflow: hidden; }
.omm-space-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .4s; }
.omm-space-bar.warn i { background: #f5b400; }
.omm-space-bar.danger i { background: var(--danger); }
.omm-space-bar.nolimit { opacity: .45; }

/* Pantalla de carga del panel (hasta que tiene sus datos) */
.omm-boot { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse 60% 45% at 50% 40%, rgba(91, 141, 239, .10), transparent 70%), var(--bg-0);
  transition: opacity .4s ease, visibility .4s; }
.omm-boot.out { opacity: 0; visibility: hidden; pointer-events: none; }   /* mientras se desvanece no se come los clics */
.omm-boot-in { display: flex; flex-direction: column; align-items: center; gap: 14px; animation: omm-boot-in .5s ease-out both; }
.omm-boot-logo { width: 64px; height: 64px; object-fit: contain; animation: omm-boot-pulse 1.8s ease-in-out infinite; filter: drop-shadow(0 8px 24px rgba(91, 141, 239, .35)); }
.omm-boot-in > b { font-size: 16px; font-weight: 650; letter-spacing: .2px; }
.omm-boot-in > b span { color: var(--text-2); font-weight: 500; }
.omm-boot-bar { position: relative; display: block; width: 160px; height: 3px; border-radius: 2px; background: var(--bg-3); overflow: hidden; }
.omm-boot-bar i { position: absolute; top: 0; left: -40%; width: 40%; height: 100%; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--accent-hi), transparent);
  animation: omm-boot-slide 1.1s ease-in-out infinite; }
.omm-boot-in > small { color: var(--text-3); font-size: 12px; }
@keyframes omm-boot-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes omm-boot-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes omm-boot-slide { to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .omm-boot-logo, .omm-boot-bar i { animation: none; } }

/* Toques en pantallas táctiles: sin el retraso del doble toque ni el recuadro gris al tocar */
button, a, select, input, label, .omm-row, .omm-tag { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* Prueba de velocidad */
.home-foot-btns { flex-wrap: wrap; }

/* ============================================================ Teléfonos (hasta 760 px de ancho) */
@media (max-width: 760px) {
  /* Campos con letra de 16 px: el iPhone no hace zoom al tocarlos */
  input, textarea, select, .omm-fld input, .omm-fld textarea, .omm-tags input { font-size: 16px !important; }

  /* Barra de arriba */
  #toolbar { padding: 0 8px 0 12px; }
  .brand { margin-right: 4px; font-size: 12.5px; }
  .brand span { white-space: nowrap; }
  .omm-busy { max-width: 46vw; height: 28px; padding: 0 10px; font-size: 11px; }
  .omm-tb-link { padding: 0 8px; }

  /* Menú abajo (como las apps) y, encima, una franja con el espacio y la clave */
  #home { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 0; }
  .home-main { grid-row: 1; }
  .home-side { grid-row: 2; flex-direction: column-reverse; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0); }
  /* Muchas secciones: la barra se desliza de lado (cada botón con su tamaño; la sección abierta, siempre a la vista) */
  .home-nav { flex: none; flex-direction: row; gap: 4px; padding: 6px 8px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); }
  .home-nav::-webkit-scrollbar { display: none; }
  .home-nav .lbl, .home-nav .sep { display: none; }
  .home-nav button { flex: 1 0 68px; min-width: 68px; max-width: 96px; flex-direction: column; justify-content: center; gap: 3px; height: 52px; padding: 4px 4px; position: relative; text-align: center; border-radius: 10px; scroll-snap-align: center; }
  .home-nav button svg { width: 20px; height: 20px; }
  .home-nav button .nm { flex: none; font-size: 11px; white-space: nowrap; }
  .home-nav button.sel { box-shadow: none; background: var(--accent-bg); color: var(--accent-hi); }
  /* Tocar con el dedo: sin el gris de «pasar el ratón» (en el teléfono se quedaba pegado en el botón que quedaba bajo el dedo) */
  .home-nav button:not(.sel):hover, .home-nav button:not(.sel):focus { background: transparent; color: var(--text-2); }
  .home-nav button:focus-visible { outline: none; }
  .home-nav button .ct { position: absolute; top: 5px; left: calc(50% + 10px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 9.5px; line-height: 16px; font-weight: 700; background: var(--bg-4); color: var(--text-2); }
  .home-nav button .ct:empty { display: none; }
  .home-nav button .ct.on { background: var(--accent); color: #fff; }
  .home-side-foot { flex-direction: row; align-items: center; gap: 8px; padding: 6px 12px; border-top: 0; border-bottom: 1px solid var(--line); }
  .home-side-foot > small, .home-side-foot .path { display: none; }
  .omm-space { flex: 1; min-width: 0; margin: 0; padding: 0; flex-direction: row; align-items: center; gap: 10px; background: none; border: 0; }
  .omm-space .t { flex-direction: row; align-items: baseline; gap: 6px; white-space: nowrap; }
  .omm-space .t small { display: none; }
  .omm-space .omm-space-bar { flex: 1; min-width: 40px; }
  .home-foot-btns { margin: 0; flex: none; }
  .home-foot-btns .btn { height: 30px; width: 38px; padding: 0; font-size: 0; justify-content: center; }
  .home-foot-btns .btn svg { margin: 0; width: 16px; height: 16px; }

  /* Toda la página se desplaza (no solo la lista): en un teléfono la cabecera no puede quedarse fija */
  .omm-view { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .omm-view > .omm-scroll { flex: none; overflow: visible; }
  .omm-view > .omm-foot { position: sticky; bottom: 0; z-index: 3; margin-top: auto; }

  /* Cabecera de cada página */
  .home-head { flex-wrap: wrap; gap: 10px; padding: 14px 14px 12px; }
  .home-title h1 { font-size: 18px; }
  .home-title p { white-space: normal; font-size: 12px; }
  .home-actions { width: 100%; flex-wrap: wrap; }
  .home-actions .btn { flex: 1 1 auto; height: 36px; justify-content: center; }
  .home-actions .omm-plan, .home-actions .omm-count { flex: none; }

  /* Cuentas */
  .omm-accounts { grid-template-columns: minmax(0, 1fr); padding: 4px 12px 16px; gap: 10px; }
  .omm-acard { padding: 14px; }
  .omm-acard-foot .btn { height: 36px; }

  /* Upload: cuenta, redes y publicación, uno debajo del otro */
  .omm-setup { margin: 0 12px; flex-direction: column; align-items: stretch; gap: 14px; padding: 12px; }
  .omm-field { width: 100%; }
  .omm-acc-pick select { min-width: 0; width: 100%; height: 42px; }
  .omm-netpick { width: 100%; }
  .omm-netpick button { flex: 1 1 0; justify-content: center; height: 42px; padding: 0 26px 0 8px; }
  .omm-netpick .nm { display: none; }
  .omm-sched-btn { width: 100%; height: 42px; justify-content: flex-start; }
  .omm-sched-btn .chev { margin-left: auto; }
  .omm-sched-btn .sw { display: inline !important; }
  .omm-setup-note { margin-top: 0; }
  .omm-banner { margin: 12px 12px 0; flex-wrap: wrap; }
  .omm-banner.warn span { flex: 1 1 200px; }
  .omm-sec { padding: 14px 14px 8px; align-items: center; flex-wrap: wrap; }
  .omm-sec small { display: none; }
  .omm-addblock { margin-left: auto; }

  /* Lista: cada video como una tarjeta */
  .omm-table { margin: 0 12px 16px; border: 0; background: transparent; overflow: visible; display: flex; flex-direction: column; gap: 10px; }
  .omm-cols { display: none; }
  .omm-row { grid-template-columns: 22px 104px minmax(0, 1fr); grid-template-areas: "ord thumb file" "texts texts texts" "state state acts";
    gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-1); }
  .omm-row:last-child { border-bottom: 1px solid var(--line); }
  .omm-ord { grid-area: ord; align-self: start; justify-content: flex-start; padding-top: 2px; }
  .omm-ord .grip { display: none; }
  .omm-thumb { grid-area: thumb; width: 104px; height: 59px; }
  .omm-file { grid-area: file; align-self: center; }
  .omm-file b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .omm-texts { grid-area: texts; padding: 10px 0 0; border-top: 1px solid var(--line); }
  .omm-state { grid-area: state; align-self: center; }
  .omm-acts { grid-area: acts; align-self: center; }
  .omm-acts .btn.edit { height: 36px; padding: 0 14px; }
  .omm-acts .ib { width: 36px; height: 36px; }
  .omm-block-h { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
  .omm-block-empty { border: 1px dashed var(--line-2); border-radius: 10px; }
  .omm-queue-empty, .omm-empty { margin: 12px; }
  .omm-empty { padding: 32px 16px; }
  .omm-empty .row { flex-direction: column; width: 100%; }

  /* Video subiendo */
  .omm-now { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; margin: 12px 12px 0; padding: 12px; }
  .omm-now-thumb { width: 96px; height: 54px; }
  .omm-now-acts { grid-column: 1 / -1; flex-direction: row; }
  .omm-now-acts .btn { flex: 1; height: 38px; }
  .omm-steps { flex-wrap: wrap; }
  .omm-step:not(:last-child)::after { width: 12px; }

  /* Barra de abajo de Upload: resumen arriba y botones debajo */
  .omm-foot { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .omm-foot .omm-stats { flex: 1 1 100%; gap: 12px; }
  .omm-foot .omm-stat { flex-direction: row; align-items: baseline; gap: 5px; }
  .omm-foot .omm-stat b { font-size: 13px; }
  .omm-foot .omm-stat small { font-size: 9.5px; }
  .omm-stat + .omm-stat { padding-left: 12px; }
  .omm-foot .btn { flex: 1; height: 40px; justify-content: center; }
  .omm-foot .btn.ghost { flex: 0 0 auto; padding: 0 12px; }
  .omm-foot-note { flex: 1 1 100%; }

  /* Rutina */
  .omm-rt-stats { padding: 0 14px 12px; }
  .omm-rt-stats.omm-stats { flex: none; flex-wrap: wrap; gap: 8px 16px; }
  .omm-rt-stats .omm-stat + .omm-stat { padding-left: 16px; }
  .omm-rt-list { padding: 12px 12px 16px; }
  .omm-rt { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; }
  .omm-rt-body { flex-wrap: wrap; }
  .omm-rt-acts { justify-content: stretch; flex-wrap: wrap; }
  .omm-rt-acts .btn { flex: 1; height: 38px; justify-content: center; }
  .omm-conc { margin-right: 0; }
  .omm-rt-blocks { flex-wrap: wrap; }

  /* Ventanas: desde abajo, a todo el ancho; la de edición, a pantalla completa */
  .modal { align-items: flex-end; }
  .dialog.omm-dlg { width: 100% !important; max-width: 100%; max-height: 92dvh; border-radius: 16px 16px 0 0; }
  .omm-dlg-head { padding: 16px 14px 12px 16px; gap: 12px; }
  .omm-dlg-body { padding: 0 16px 16px; }
  .omm-dlg-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0)); flex-wrap: wrap; }
  .omm-dlg-foot .btn { height: 42px; flex: 1; justify-content: center; }
  .omm-dlg-foot.split > div:empty { display: none; }
  .omm-dlg-foot.split > div { flex: 1; }
  .omm-dlg-foot .btn kbd { display: none; }
  .modal:has(.omm-edit) { align-items: stretch; }
  .dialog.omm-dlg.omm-edit { height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .omm-edit-pos { display: none; }
  .omm-dlg-body.omm-edit-body { display: block; overflow-y: auto; padding-bottom: 16px; }
  .omm-edit-video { overflow: visible; padding-bottom: 14px; }
  .omm-player { max-height: 46dvh; }
  .omm-player.tall { width: auto; max-width: 100%; margin: 0 auto; height: 46dvh; }
  .omm-edit-fields { overflow: visible; padding: 0; }
  .omm-cat-btn { max-width: none; height: 44px; }
  .omm-tags { max-height: none; }

  /* Programación */
  .omm-seg { display: flex; width: 100%; }
  .omm-seg button { flex: 1; padding: 0 6px; }
  .omm-frow { flex-wrap: wrap; row-gap: 6px; }
  .omm-frow > span { width: 100%; }
  .omm-frow select { flex: 1; min-width: 0; height: 40px; }
  .omm-sc-opts select.omm-time { flex: 1; width: auto; height: 40px; }
  .omm-days { display: flex; width: 100%; }
  .omm-days button { flex: 1; height: 38px; }
  .omm-check:not(:has(select)) { flex-wrap: nowrap; align-items: flex-start; }
  .omm-check:not(:has(select)) > span { flex: 1; min-width: 0; }
  .omm-check input[type="checkbox"] { flex: none; margin-top: 2px; width: 18px; height: 18px; }

  /* Avisos y panel de subida: encima del menú de abajo */
  #toast { bottom: calc(132px + env(safe-area-inset-bottom, 0)); max-width: calc(100vw - 24px); }
  .omm-upfiles { right: 12px; left: 12px; width: auto; bottom: calc(126px + env(safe-area-inset-bottom, 0)); }
  #tooltip { display: none; }

  /* Entrar (/admin) */
  .omm-login { padding: 24px 20px; }
}
/* iPhone y iPad no dejan elegir carpetas desde el navegador: el botón no haría nada */
@supports (-webkit-touch-callout: none) { #impFolder, #emFolder { display: none !important; } }
