@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;700&display=swap');

/* ============================================================
 * Grizat — Workspace Dashboard (lista "Your grizats")
 *
 * Reescrito completo. El archivo anterior tenía 46 líneas, todas
 * para un modal (.ps-modal / .ps-modal-box) que ningún JS usa —
 * ninguna clase real del dashboard (.ps-dash-title, .ps-plan-badge,
 * .ps-workspace-card, etc.) tenía una sola regla acá.
 *
 * Esas clases SÍ estaban definidas en el HTML legacy de la página
 * (bloque "Dashboard: control-room dark, unified with the rest of
 * the site"), y ese es el diseño que se portó acá — con una
 * diferencia importante: se agrega la regla de FONDO que faltaba
 * en el original (ver el comentario en workspace.php sobre
 * body.ps-workspace-page). Sin esa regla, todo este bloque asumía
 * un fondo oscuro que en realidad nunca estaba declarado en
 * ningún lado — esa fue la causa real del título invisible.
 *
 * Variables con prefijo --grizat- (no --gz-, que ya usa el CSS
 * legacy para OTRA cosa: la capa "Open Workspace Brand Migration"
 * con verde lima, pensada solo para la vista abierta de un grizat,
 * no para este dashboard). Prefijo distinto a propósito, para que
 * el día que ambos CSS convivan en la misma página no choquen.
 * ============================================================ */

:root {
  --grizat-bg:        #0B1220; /* fondo del shell — el mismo "ink" de la landing */
  --grizat-panel:     #111A2B; /* cards, input de crear, badge */
  --grizat-panel-2:   #0F1826; /* empty state */
  --grizat-border:    #1E2A3D;
  --grizat-cyan:      #3AB6E8;
  --grizat-cyan-dark: #2A9DD1;
  --grizat-text:      #fff;
  --grizat-text-dim:  #E4ECF7;
  --grizat-muted:     #8FA0BC;
  --grizat-muted-2:   #7C8CA8;
  --grizat-danger:    #FF4500;
  --grizat-font:      Sora, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --grizat-font-mono: 'JetBrains Mono', monospace;
}

/* ------------------------------------------------------------
 * Shell: la pieza que faltaba. Pinta todo el fondo de la página
 * del dashboard, no solo el contenedor de la lista, para que no
 * quede un borde blanco alrededor en pantallas altas o angostas.
 * ------------------------------------------------------------ */
body.ps-workspace-page {
  background: var(--grizat-bg);
}

body.ps-workspace-page .site-content,
body.ps-workspace-page #content,
body.ps-workspace-page .ast-container {
  background: var(--grizat-bg);
}

/* Astra envuelve el contenido en su propio contenedor "boxed" con
 * fondo blanco propio cuando el layout de la página es Boxed/Content
 * Boxed — es una capa DISTINTA de .ast-container (que ya cubríamos
 * arriba) y quedaba fuera, dejando esas dos franjas blancas a los
 * costados que se ven en producción. */
body.ps-workspace-page #page,
body.ps-workspace-page .hfeed,
body.ps-workspace-page .ast-separate-container {
  background: var(--grizat-bg);
}

/* Confirmado con el inspector: existe una fila "Above Header" de
 * Astra (arriba de la barra principal del nav) con fondo blanco
 * propio, que no tenía cubierta. */
body.ps-workspace-page .ast-above-header-wrap,
body.ps-workspace-page .ast-above-header-bar,
body.ps-workspace-page .ast-above-header {
  background: var(--grizat-bg);
}

/* Estas 4 reglas vivían en el HTML legacy de la página (el bloque
 * "Dashboard de workspaces — Grizat v4", ya eliminado de ahí) y
 * nunca se migraron para acá — eran justo la pieza de layout que
 * faltaba, no de color: sin el max-width:none, Astra le sigue
 * aplicando su ancho de contenido "boxed" a esta página aunque el
 * fondo ya esté pintado oscuro alrededor, y ESO es lo que se ve
 * como blanco a los costados. */
body.ps-workspace-page .site-content .ast-container,
body.ps-workspace-page #content .ast-container {
  max-width: none;
  padding-top: 0;
}

body.ps-workspace-page .entry-content {
  margin-top: 0 !important;
}

body.ps-workspace-page .site-main > article {
  padding-top: 0 !important;
}

#ps-grillas-list {
  color: var(--grizat-text-dim);
  font-family: var(--grizat-font);
  padding: 24px 0 40px;
}

/* ------------------------------------------------------------
 * Cabecera: título + badge de plan + copy + botón "New grizat"
 * ------------------------------------------------------------ */
.ps-dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 30px;
}

.ps-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ps-dash-title {
  margin: 0;
  color: var(--grizat-text);
  font-family: var(--grizat-font);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.ps-plan-badge {
  display: inline-flex;
  align-items: center;
  margin: 2px 0 0;
  padding: 3px 8px;
  border: 1px solid var(--grizat-border);
  border-radius: 5px;
  background: var(--grizat-panel);
  color: var(--grizat-muted-2);
  font-family: var(--grizat-font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1.2;
}

.ps-dash-copy {
  margin: 8px 0 0;
  color: var(--grizat-muted);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

/* Botón "+ New grizat" — blanco sólido: mismo patrón que usan
 * Linear/Vercel/Raycast para la acción primaria sobre fondo oscuro.
 * (Ver el override de .ps-head-primary más abajo — mismo botón,
 * mismo criterio, en la vista abierta de un grizat.) */
.ps-new-grizat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #fff;
  color: #0B1220;
  font-family: var(--grizat-font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.ps-new-grizat-btn span {
  font-size: 16px;
  line-height: 1;
}

.ps-new-grizat-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 255, 255, .18);
}

.ps-dash-limit {
  margin: 20px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--grizat-border);
  border-radius: 10px;
  background: var(--grizat-panel);
  color: var(--grizat-muted);
  font-size: 14px;
}

.ps-dash-limit a {
  color: var(--grizat-text);
  text-decoration: underline;
  text-decoration-color: var(--grizat-cyan);
  text-decoration-thickness: 2px;
}

/* ------------------------------------------------------------
 * Estado vacío (sin grizats todavía)
 * ------------------------------------------------------------ */
.ps-empty-state {
  padding: 48px 24px;
  border: 1px dashed var(--grizat-border);
  border-radius: 16px;
  background: var(--grizat-panel-2);
  text-align: center;
}

.ps-empty-icon {
  margin: 0 0 10px;
  color: var(--grizat-cyan);
  font-size: 28px;
  line-height: 1;
}

.ps-empty-state h3 {
  margin: 0;
  color: var(--grizat-text);
  font-family: var(--grizat-font);
  font-size: 20px;
  font-weight: 800;
}

.ps-empty-state p {
  max-width: 420px;
  margin: 10px auto 0;
  color: var(--grizat-muted);
  font-size: 14px;
  line-height: 1.55;
}

.ps-empty-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 20px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  background: var(--grizat-cyan);
  color: #0B1220;
  font-family: var(--grizat-font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.ps-empty-create:hover {
  background: var(--grizat-cyan-dark);
}

/* ------------------------------------------------------------
 * Grilla de tarjetas
 * ------------------------------------------------------------ */
.ps-workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.ps-workspace-card {
  position: relative;
  min-height: 224px;
  max-width: 340px;
  padding: 0 13px 13px;
  border: 1px solid var(--grizat-border);
  border-radius: 14px;
  background: var(--grizat-panel);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.ps-workspace-card:hover {
  transform: translateY(-2px);
  border-color: var(--grizat-cyan);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
}

/* La franja de arriba: no es decoración, es el/los color(es) de marca
 * real de las plataformas que tiene ese grizat adentro (YouTube,
 * Twitch, Kick...). Recortada como una "pestaña" en vez de ocupar
 * todo el ancho — el guiño a carpeta que pediste, sin ir al ícono de
 * carpeta literal (ver la respuesta sobre cards vs. carpetas). */
.ps-card-strip {
  height: 6px;
  margin: 0 22px 0 14px;
  border-radius: 0 0 5px 5px;
  background: var(--grizat-border);
}

.ps-card-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  height: 112px;
  margin: 13px 0 14px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #0d1520;
}

.ps-card-preview span {
  position: relative;
  background: linear-gradient(155deg, #17364a, #0d2638);
}

.ps-card-preview-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  color: #fff;
  font-family: var(--grizat-font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .03em;
  font-style: normal;
}

.ps-card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ps-card-main {
  min-width: 0;
  cursor: pointer;
}

.ps-card-name {
  display: block;
  overflow: hidden;
  color: var(--grizat-text);
  font-family: var(--grizat-font);
  font-size: 17px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ps-card-meta {
  display: block;
  margin-top: 5px;
  color: var(--grizat-muted-2);
  font-family: var(--grizat-font-mono);
  font-size: 12px;
}

.ps-card-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 6px 0 0;
  color: var(--grizat-muted);
  font-size: 12px;
  line-height: 1.4;
}

.ps-card-menu-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  border: 1px solid var(--grizat-border);
  border-radius: 8px;
  background: var(--grizat-panel);
  color: var(--grizat-muted-2);
  font-size: 14px;
  cursor: pointer;
}

.ps-card-menu-btn:hover,
.ps-card-menu-btn[aria-expanded="true"] {
  border-color: var(--grizat-cyan);
  background: #16233A;
  color: var(--grizat-text);
}

/* Menú de acciones de la card (renombrar / descripción / compartir / duplicar / borrar) */
.ps-card-actions {
  display: none;
  position: absolute;
  z-index: 20;
  top: 44px;
  right: 13px;
  left: 13px;
  flex-direction: column;
  padding: 6px;
  border: 1px solid var(--grizat-border);
  border-radius: 12px;
  background: var(--grizat-bg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}

.ps-card-actions.open {
  display: flex;
}

.ps-card-actions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 8px;
  color: var(--grizat-muted-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ps-card-actions-close {
  border: 0;
  background: transparent;
  color: var(--grizat-muted-2);
  font-size: 16px;
  cursor: pointer;
}

.ps-card-actions-close:hover {
  color: var(--grizat-text);
}

.ps-card-actions button {
  display: block;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--grizat-text-dim);
  font-family: var(--grizat-font);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.ps-card-actions button:hover {
  background: rgba(58, 182, 232, .12);
  color: var(--grizat-text);
}

.ps-card-actions button.ps-delete {
  color: var(--grizat-danger);
}

.ps-card-actions button.ps-delete:hover {
  background: rgba(255, 69, 0, .12);
  color: var(--grizat-danger);
}

@media (max-width: 900px) {
  .ps-dash-head {
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: stretch;
  }
}

@media (max-width: 600px) {
  #ps-grillas-list {
    padding-top: 16px;
  }

  .ps-dash-title {
    font-size: 26px;
  }

  .ps-dash-head {
    flex-direction: column;
    align-items: stretch;
  }

  .ps-new-grizat-btn {
    justify-content: center;
  }

  .ps-workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------
 * Override de la vista ABIERTA de un grizat (legacy, no astra-
 * child): la capa "Open Workspace Brand Migration" del CSS viejo
 * pinta el botón principal y el estado activo del "..." de cyan/
 * blanco con verde lima, vía !important. Acá se reclama con más
 * especificidad — la misma solución que el resto del sitio, no
 * un !important suelto más peleando con el anterior.
 * ------------------------------------------------------------ */
body.ps-workspace-page .ps-head-primary {
  border-color: transparent !important;
  background: #fff !important;
  color: #0B1220 !important;
}

body.ps-workspace-page .ps-head-primary:hover {
  background: #E4ECF7 !important;
}

body.ps-workspace-page .ps-card-menu-btn[aria-expanded="true"] {
  border-color: var(--grizat-cyan) !important;
  background: #16233A !important;
  color: var(--grizat-text) !important;
}


/* ============================================================
 * Grizat /grizat page styles
 * Migrated from WordPress page HTML during consolidation step 1.
 * Intentionally preserves the existing cascade to avoid changing UI.
 * Next cleanup should remove obsolete v7/v10 overrides only after
 * visual regression testing.
 * ============================================================ */
#ps-grilla-view button[onclick="grizatCloseGrizat()"],
  .ps-custom-back-btn {
    background: #000000 !important; color: #ffffff !important;
    border: 2px solid #444444 !important; padding: 8px 18px !important;
    border-radius: 20px !important; font-size: 14px !important;
    font-weight: bold !important; text-transform: uppercase !important;
    letter-spacing: 0.5px !important; cursor: pointer !important;
    display: inline-block !important; margin-bottom: 0 !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3) !important;
  }
  #ps-grilla-view button[onclick="grizatCloseGrizat()"]:hover {
    background: #222222 !important; border-color: #3AB6E8 !important; color: #3AB6E8 !important;
  }
  .ps-share-btn {
    background: #111111 !important; border-color: #3AB6E8 !important; color: #3AB6E8 !important;
  }
  .ps-share-btn:hover { background: #3AB6E8 !important; color: #111111 !important; }
#ps-grilla-view:fullscreen,
#ps-grilla-view:-webkit-full-screen {
  background: #0a0a0a;
  padding: 20px;
  overflow-y: auto;
}
#ps-grilla-view.ps-expand-mode {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #0a0a0a;
  padding: 20px;
  overflow-y: auto;
}
  .ps-remove-btn-highlight {
    background: #FF4500 !important; color: #ffffff !important; border: none !important;
    padding: 8px 16px !important; border-radius: 6px !important; font-size: 12px !important;
    font-weight: bold !important; text-transform: uppercase !important;
    letter-spacing: 0.5px !important; cursor: pointer !important; transition: background 0.2s !important;
  }
  .ps-remove-btn-highlight:hover { background: #cc3700 !important; }
  .ps-open-page-highlight {
    color: #3AB6E8 !important; font-size: 13px !important; font-weight: 800 !important;
    text-transform: uppercase !important; letter-spacing: 0.5px !important;
    text-decoration: none !important; transition: color 0.2s !important; display: inline-block !important;
  }
  .ps-open-page-highlight:hover { color: #ffffff !important; text-decoration: underline !important; }
  .ps-desk-chat-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 12px; background: #1e1e1e; color: #aaa;
    border: 1px solid #333; border-radius: 4px; font-size: 11px;
    font-weight: 700; cursor: pointer; text-transform: uppercase;
    transition: color .2s, border-color .2s;
  }
  .ps-desk-chat-btn.active { color: #3AB6E8 !important; border-color: #3AB6E8 !important; }
.ps-focus-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #1e1e1e;
  color: #aaa;
  border: 1px solid #333;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition: color .2s, border-color .2s;
}

.ps-focus-card-btn:hover {
  color: #3AB6E8;
  border-color: #3AB6E8;
}

#ps-grilla-channels > div:fullscreen,
#ps-grilla-channels > div:-webkit-full-screen {
  background: #000;
  display: flex;
  flex-direction: column;
}

#ps-grilla-channels > div:fullscreen > div:first-child,
#ps-grilla-channels > div:-webkit-full-screen > div:first-child {
  flex: 1;
  padding-bottom: 0 !important;
  height: auto !important;
}
.ps-spotlight-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #1e1e1e;
  color: #aaa;
  border: 1px solid #333;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition: color .2s, border-color .2s;
}

.ps-spotlight-card-btn:hover {
  color: #FFD700;
  border-color: #FFD700;
}
#ps-grilla-channels > div {
  position: relative;
}

#ps-grilla-view.ps-expand-mode #ps-grilla-tabs,
#ps-grilla-view.ps-expand-mode #ps-layout-selector,
#ps-grilla-view.ps-expand-mode #ps-add-channel-row,
#ps-grilla-view:fullscreen #ps-grilla-tabs,
#ps-grilla-view:fullscreen #ps-layout-selector,
#ps-grilla-view:fullscreen #ps-add-channel-row {
  display: none !important;
}

#ps-grilla-view.ps-expand-mode #ps-grilla-channels > div > div:last-child,
#ps-grilla-view:fullscreen #ps-grilla-channels > div > div:last-child {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.85);
  z-index: 5;
}

#ps-grilla-view.ps-expand-mode #ps-grilla-channels > div:hover > div:last-child,
#ps-hover-zone {
  display: none;
}
#ps-grilla-view.ps-expand-mode #ps-hover-zone,
#ps-grilla-view:fullscreen #ps-hover-zone {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 9;
}

#ps-grilla-view.ps-expand-mode #ps-top-controls,
#ps-grilla-view:fullscreen #ps-top-controls {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: rgba(0,0,0,0.85);
  padding: 10px 20px;
  margin: 0 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
#ps-grilla-view.ps-expand-mode #ps-grilla-title,
#ps-grilla-view:fullscreen #ps-grilla-title {
  position: absolute;
  top: 56px;
  left: 20px;
  right: 20px;
  z-index: 10;
  background: rgba(0,0,0,0.85);
  padding: 6px 0;
  margin: 0 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}

#ps-grilla-view.ps-expand-mode #ps-hover-zone:hover ~ #ps-top-controls,
#ps-grilla-view.ps-expand-mode #ps-top-controls:hover,
#ps-grilla-view:fullscreen #ps-hover-zone:hover ~ #ps-top-controls,
#ps-grilla-view:fullscreen #ps-top-controls:hover {
  opacity: 1;
  pointer-events: auto;
}
#ps-grilla-view.ps-expand-mode #ps-hover-zone:hover ~ #ps-grilla-title,
#ps-grilla-view.ps-expand-mode #ps-grilla-title:hover,
#ps-grilla-view:fullscreen #ps-hover-zone:hover ~ #ps-grilla-title,
#ps-grilla-view:fullscreen #ps-grilla-title:hover {
  opacity: 1;
  pointer-events: auto;
}
#ps-grilla-view:fullscreen #ps-grilla-channels > div:hover > div:last-child {
  display: block;
}

#ps-grilla-channels.ps-spotlight-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

#ps-grilla-channels.ps-spotlight-mode > div.ps-spotlighted {
  order: -1;
  flex: 1 1 100%;
}

#ps-grilla-channels.ps-spotlight-mode > div:not(.ps-spotlighted) {
  flex: 1 1 180px;

}
  .ps-desk-chat-box {
    display: none; width: 100%; height: 380px;
    border-radius: 0 0 6px 6px; overflow: hidden; background: #0f0f0f;
  }
  #ps-custom-channel-input:disabled,
  #ps-add-channel-btn:disabled {
    opacity: 0.6 !important; cursor: not-allowed !important;
  }

  /* ---- Pestañas de grillas ---- */
.ps-grilla-tab {
  background: #1a1a1a; color: #ddd; border: 2px solid #333; border-radius: 24px;
  padding: 10px 22px; font-size: 16px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.5px; cursor: pointer; white-space: nowrap;
  transition: color .2s, border-color .2s, background .2s, transform .15s;
}
.ps-grilla-tab:hover { color: #fff; border-color: #555; transform: translateY(-1px); }
.ps-grilla-tab.active { background: #3AB6E8; color: #111; border-color: #3AB6E8; box-shadow: 0 2px 10px rgba(0,242,254,0.4); }
  .ps-grilla-tab-add {
    background: #111; color: #3AB6E8; border: 1px dashed #3AB6E8; font-size: 14px; padding: 6px 12px;
  }
  .ps-grilla-tab-add:hover { background: #3AB6E8; color: #111; }
.ps-dragging-ghost {
  opacity: 0.4;
  border: 2px dashed #3AB6E8 !important;
}
.ps-more-wrap { position: relative; display: inline-block; }
.ps-more-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 10px; background: #1e1e1e; color: #aaa;
  border: 1px solid #333; border-radius: 4px; font-size: 13px;
  font-weight: 700; cursor: pointer;
}
.ps-more-btn:hover { color: #3AB6E8; border-color: #3AB6E8; }
.ps-more-menu {
  display: none; position: absolute; bottom: 100%; right: 0; margin-bottom: 6px;
  background: #1a1a1a; border: 1px solid #333; border-radius: 6px;
  min-width: 160px; z-index: 20; overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.ps-more-menu.open { display: block; }
.ps-more-menu button {
  display: block; width: 100%; text-align: left; padding: 10px 14px;
  background: none; border: none; color: #ddd; font-size: 15px;
  cursor: pointer; border-bottom: 1px solid #262626;
}
.ps-more-menu button:last-child { border-bottom: none; }
.ps-more-menu button:hover { background: #262626; color: #3AB6E8; }
.ps-more-menu button.ps-danger:hover { color: #FF4500; }
.ps-submenu-toggle {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; text-align: left; padding: 10px 14px;
  background: none; border: none; color: #ddd; font-size: 15px;
  font-weight: 700; cursor: pointer; border-bottom: 1px solid #262626;
}
.ps-submenu-toggle:hover { background: #262626; color: #3AB6E8; }
.ps-submenu-arrow { transition: transform .2s; font-size: 10px; }
.ps-submenu-wrap.open .ps-submenu-arrow { transform: rotate(180deg); }
.ps-submenu-content { display: none; background: #151515; }
.ps-submenu-wrap.open .ps-submenu-content { display: block; }
.ps-more-menu-down {
  top: 100%;
  bottom: auto;
  margin-top: 6px;
  margin-bottom: 0;
}

   Workspace abierto — Grizat v7
   Experiencia app-first, pestañas claras y móvil sin desborde
   ========================================================== */
#ps-grilla-view { color:#fff; font-family:Sora,Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
#ps-top-controls.ps-open-head { display:grid !important; grid-template-columns:minmax(0,1fr) auto; gap:24px; align-items:end; margin:2px 0 14px !important; }
.ps-open-identity { min-width:0; }
.ps-open-back { display:inline-flex; align-items:center; min-height:40px; padding:0; border:0; background:transparent; color:#a3a3a3; font-size:14px; font-weight:650; cursor:pointer; }
.ps-open-back:hover { color:#3AB6E8; }
.ps-open-title-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:2px; }
#ps-grilla-title.ps-open-title { margin:0 !important; color:#fff; font-size:clamp(25px,2.5vw,34px); line-height:1.12; letter-spacing:-.65px; }
.ps-open-description { display:none; margin:7px 0 0 !important; color:#8d8d8d !important; font-size:14px !important; line-height:1.5 !important; max-width:680px !important; }
.ps-open-actions { display:flex; align-items:center; gap:9px; padding-top:2px; }
.ps-head-btn { display:inline-flex; align-items:center; justify-content:center; min-height:42px; padding:0 15px; border:1px solid #333; border-radius:10px; background:#171717; color:#e5e5e5; font-size:14px; font-weight:700; cursor:pointer; }
.ps-head-btn:hover,.ps-head-btn[aria-expanded="true"] { border-color:#666; color:#fff; }
.ps-head-primary { border-color:#FF4500; background:#FF4500; color:#fff; }
.ps-head-primary:hover,.ps-head-primary[aria-expanded="true"] { border-color:#ff6a33; background:#ff5722; color:#fff; }
.ps-head-more { width:42px; padding:0; font-size:20px; letter-spacing:1px; }
.ps-head-menu { min-width:280px; padding:8px; border-radius:12px; background:#171717; }
.ps-menu-label { padding:9px 10px 5px; color:#737373; font-size:10px; font-weight:800; letter-spacing:1.2px; text-transform:uppercase; }
.ps-menu-divider { height:1px; margin:7px 4px; background:#303030; }
.ps-head-menu button,.ps-head-menu .ps-submenu-toggle { min-height:44px; border:0; border-radius:7px; color:#e0e0e0; font-size:14px; font-weight:550; }
.ps-head-menu button:hover,.ps-head-menu .ps-submenu-toggle:hover { background:#242424; color:#3AB6E8; }
.ps-head-menu .ps-menu-danger { color:#ff7a59; }
.ps-head-menu .ps-menu-danger:hover { background:rgba(255,69,0,.1); color:#ff8a6c; }
.ps-head-menu .ps-submenu-content { margin:0 0 5px; border-radius:8px; background:#101010; }
.ps-add-fields { padding:10px; }
.ps-add-fields input { display:block; width:100%; min-height:40px; box-sizing:border-box; margin-bottom:8px; padding:8px 10px; border:1px solid #3a3a3a; border-radius:7px; background:#202020; color:#fff; font-size:13px; }
.ps-add-fields #ps-add-channel-btn { min-height:40px; background:#3AB6E8; color:#101010; font-weight:800; text-align:center; }
.ps-workspace-switcher { display:flex; align-items:center; gap:12px; min-width:0; margin:0 0 13px; }
.ps-workspace-switcher-label { flex:0 0 auto; color:#686868; font-size:11px; font-weight:750; letter-spacing:.75px; text-transform:uppercase; }
#ps-grilla-tabs.ps-open-tabs { display:flex; flex:1; gap:4px; overflow-x:auto; margin:0; padding:0 0 5px; scrollbar-width:thin; }
#ps-grilla-tabs .ps-grilla-tab { min-height:34px; padding:0 11px; border:0; border-bottom:2px solid transparent; border-radius:0; background:transparent; color:#888; font-size:13px; font-weight:600; letter-spacing:0; text-transform:none; box-shadow:none; white-space:nowrap; }
#ps-grilla-tabs .ps-grilla-tab:hover { color:#fff; transform:none; }
#ps-grilla-tabs .ps-grilla-tab.active { border-color:#3AB6E8; background:transparent; color:#fff; }
#ps-grilla-tabs .ps-grilla-tab-add { min-width:62px; color:#aaa; }
.ps-featured-track { display:flex; gap:10px; overflow-x:auto; padding-bottom:2px; scroll-snap-type:x proximity; scrollbar-width:thin; }
.ps-featured-card { display:flex; align-items:center; gap:11px; flex:0 0 270px; min-height:64px; padding:10px 12px; border:1px solid #292929; border-radius:10px; background:#191919; color:#fff; text-align:left; cursor:pointer; scroll-snap-align:start; }
.ps-featured-card:hover { border-color:#555; background:#1d1d1d; transform:translateY(-1px); }
.ps-featured-live { flex:0 0 auto; padding:4px 6px; border-radius:5px; background:#FF4500; color:#fff; font-size:9px; font-weight:850; letter-spacing:.6px; }
.ps-featured-copy { min-width:0; flex:1; }
.ps-featured-copy strong { display:block; overflow:hidden; color:#fff; font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.ps-featured-copy span { display:block; margin-top:4px; color:#828282; font-size:11px; }
.ps-featured-arrow { color:#777; font-size:17px; }
.ps-stream-card { position:relative; overflow:visible !important; border:1px solid #272727 !important; border-radius:12px !important; background:#111; box-shadow:0 7px 22px rgba(0,0,0,.16); }
.ps-stream-footer { display:flex; align-items:center; gap:12px; min-height:58px; padding:10px 10px 10px 13px; background:#151515; border-radius:0 0 12px 12px; }
.ps-stream-name { min-width:0; flex:1; overflow:hidden; color:#fff; font-size:14px; font-weight:650; line-height:1.35; text-overflow:ellipsis; white-space:nowrap; }
.ps-stream-menu-btn { display:grid; place-items:center; flex:0 0 42px; width:42px; height:42px; padding:0; border:1px solid #333; border-radius:9px; background:#1d1d1d; color:#aaa; font-size:19px; font-weight:800; cursor:pointer; }
.ps-stream-menu-btn:hover,.ps-stream-menu-btn[aria-expanded="true"] { border-color:#3AB6E8; color:#3AB6E8; }
.ps-stream-menu { min-width:210px; padding:7px; border-radius:11px; overflow:visible; }
.ps-stream-menu button { min-height:42px; padding:9px 11px; border:0; border-radius:7px; font-size:14px; }
.ps-stream-menu .ps-menu-divider { display:block; }
.ps-stream-menu button.ps-danger { margin-top:5px; color:#ff7a59; border-top:1px solid #393939; border-radius:0 0 7px 7px; }
.ps-stream-menu button.ps-danger:hover { background:rgba(255,69,0,.1); color:#ff8a6c; }
.ps-card-menu-btn[aria-expanded="true"] { color:#3AB6E8; background:rgba(0,242,254,.08); }

@media (max-width:700px) {
  #ps-top-controls.ps-open-head {
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
    align-items:start;
  }
  .ps-open-actions {
    width:auto;
    padding:0;
    align-self:start;
  }
  .ps-head-btn { flex:0 0 auto; }
  #ps-grilla-title.ps-open-title { font-size:27px; }
  .ps-open-actions { gap:8px; }
  .ps-head-primary { flex:0 0 auto; }
  .ps-head-more { flex:0 0 42px; width:42px; }
  .ps-workspace-switcher { display:block; margin-bottom:10px; }
  .ps-workspace-switcher-label { display:block; margin:0 0 5px 4px; }
  .ps-featured-card { flex-basis:238px; }
  .ps-head-menu,.ps-stream-menu { position:fixed !important; left:14px !important; right:14px !important; top:auto !important; bottom:14px !important; width:auto !important; max-width:none !important; max-height:75vh !important; z-index:10002 !important; padding:10px; border-radius:16px; box-shadow:0 0 0 9999px rgba(0,0,0,.66),0 20px 48px rgba(0,0,0,.55); }
  .ps-head-menu button,.ps-head-menu .ps-submenu-toggle,.ps-stream-menu button { min-height:48px; font-size:16px; }
  .ps-stream-footer { min-height:62px; }
  .ps-stream-name { font-size:15px; }
}

/* Grizat v7 — final UI overrides */
#ps-workspace { width:100%; box-sizing:border-box; }
#ps-grilla-view { min-width:0; }
.ps-open-nav { display:flex; align-items:center; gap:8px; margin:0 0 6px; }
.ps-open-nav .ps-open-back,
.ps-open-nav .ps-open-back:hover,
#ps-top-controls.ps-open-head {
  align-items:end;
  gap:20px;
  margin:0 0 12px !important;
}
.ps-open-back {
  min-height:32px !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  color:#687085 !important;
  box-shadow:none !important;
  font-size:13px !important;
  font-weight:650 !important;
  text-transform:none !important;
}
.ps-open-back:hover { color:#172033 !important; }
.ps-open-title-row { margin-top:0; }
#ps-grilla-title.ps-open-title {
  display:block !important;
  margin:0 !important;
  color:#fff !important;
  font-size:clamp(24px,2.25vw,31px) !important;
  font-weight:800 !important;
  line-height:1.12 !important;
}
.ps-open-description {
  margin:5px 0 0 !important;
  color:#687085 !important;
  font-size:16px !important;
  line-height:1.4 !important;
}
.ps-head-more[aria-expanded="true"],
.ps-stream-menu-btn[aria-expanded="true"],
.ps-card-menu-btn[aria-expanded="true"] {
  border-color:#3AB6E8 !important;
  background:#3AB6E8 !important;
  color:#102033 !important;
}
.ps-workspace-switcher {
  display:block;
  min-width:0;
  margin:0 0 12px;
  border-bottom:1px solid #dfe3ea;
}
.ps-workspace-switcher-label { display:none; }
#ps-grilla-tabs.ps-open-tabs {
  display:flex;
  gap:3px;
  overflow-x:auto;
  overflow-y:hidden;
  margin:0;
  padding:0 3px;
  scrollbar-width:none;
}
#ps-grilla-tabs.ps-open-tabs::-webkit-scrollbar { display:none; }
#ps-grilla-tabs .ps-grilla-tab {
  position:relative;
  min-height:42px;
  margin-bottom:-1px;
  padding:0 18px;
  border:1px solid #dfe3ea;
  border-bottom-color:#dfe3ea;
  border-radius:10px 10px 0 0;
  background:#f1f3f6 !important;
  color:#596174 !important;
  font-size:14px;
  font-weight:650;
  text-transform:none;
  box-shadow:none;
  white-space:nowrap;
}
#ps-grilla-tabs .ps-grilla-tab:hover {
  border-color:#c9d0db;
  background:#e7ebf0 !important;
  color:#172033 !important;
  transform:none;
}
#ps-grilla-tabs .ps-grilla-tab.active {
  z-index:1;
  border-color:#cbd2dc;
  border-bottom-color:#fff;
  background:#fff !important;
  color:#172033 !important;
}
#ps-grilla-tabs .ps-grilla-tab.active::after {
  content:"";
  position:absolute;
  left:12px;
  right:12px;
  bottom:3px;
  height:2px;
  border-radius:2px;
  background:#3AB6E8;
}
#ps-grilla-tabs .ps-grilla-tab-add {
  min-width:auto;
  padding:0 16px;
  color:#596174 !important;
}
.ps-add-workspace-short { display:none; }
.ps-featured-track {
  display:flex;
  gap:8px;
  min-width:0;
  overflow-x:auto;
  padding:0;
}
.ps-featured-card {
  flex:0 0 245px;
  min-height:48px;
  padding:7px 10px;
  border:1px solid #dfe3e9;
  border-radius:8px;
  background:#fff !important;
  color:#172033 !important;
}
.ps-featured-card:hover {
  border-color:#bfc7d2;
  background:#fff !important;
  color:#172033 !important;
  transform:none;
}
.ps-featured-copy strong { color:#172033; font-size:12px; }
.ps-featured-copy span { margin-top:2px; color:#7a8292; font-size:10px; }
/* Grizat brand states: no generic blue focus/active residue. */
#ps-grilla-view button:focus-visible,
#ps-grilla-view a:focus-visible { outline:2px solid #3AB6E8 !important; outline-offset:2px; }
#ps-grilla-view button:not(.ps-head-primary):hover { border-color:#3AB6E8; }

/* Hide third-party “Ask AI” launchers inside the WordPress page. */
button[aria-label*="Ask AI" i], button[title*="Ask AI" i],
a[aria-label*="Ask AI" i], a[title*="Ask AI" i],
[data-testid*="ask-ai" i], [id*="ask-ai" i], [class*="ask-ai" i] { display:none !important; }
#ps-grilla-channels {
  width:100%;
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
}
#ps-grilla-channels > * {
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
}

@media (max-width:700px) {
  #ps-workspace {
    padding:4px 0 12px !important;
    overflow-x:hidden;
  }
  /* El video va borde a borde (como YouTube/Instagram). Todo lo demás
     recupera su margen lateral acá, elemento por elemento. */
  #ps-featured-row,
  #ps-top-controls.ps-open-head,
  #ps-grilla-tabs.ps-open-tabs,
  #ps-addstream-panel-wrap {
    padding-left:6px !important;
    padding-right:6px !important;
    box-sizing:border-box;
  }
  #ps-top-controls.ps-open-head {
    grid-template-columns:minmax(0,1fr) auto;
    gap:9px;
    align-items:start;
    margin-bottom:9px !important;
  }
  #ps-grilla-title.ps-open-title { font-size:24px !important; }
  .ps-open-nav { gap:7px; overflow-x:auto; scrollbar-width:none; }
  .ps-open-nav::-webkit-scrollbar { display:none; }
  .ps-open-nav .ps-open-back { flex:0 0 auto; min-height:40px !important; font-size:12px !important; }
  .ps-open-description { font-size:15px !important; line-height:1.45 !important; }
  .ps-head-primary { flex:0 1 auto; min-width:132px; }
  .ps-workspace-switcher { margin-bottom:9px; }
  #ps-grilla-tabs.ps-open-tabs { padding-left:6px; }
  #ps-grilla-tabs .ps-grilla-tab {
    min-height:39px;
    padding:0 15px;
    font-size:13px;
  }
  #ps-grilla-tabs .ps-grilla-tab-add {
    flex:0 0 44px;
    width:44px;
    min-width:44px;
    padding:0;
  }
  .ps-add-workspace-full { display:none; }
  .ps-add-workspace-short { display:inline; font-size:20px; line-height:1; }
  .ps-featured-card {
    flex-basis:210px;
    min-height:44px;
  }
  #ps-grilla-channels {
    grid-template-columns:minmax(0,1fr) !important;
    gap:14px !important;
    padding-left:0 !important;
    padding-right:0 !important;
  }
  .ps-stream-card {
    width:100% !important;
    max-width:100% !important;
    margin:0 !important;
    border-radius:0 !important;
  }
  .ps-stream-card > div:first-child,
  .ps-stream-card iframe,
  .ps-stream-card video {
    width:100% !important;
    max-width:100% !important;
  }
}

/* ==========================================================
   Grizat v10 — unified product system
   Light organization surfaces, dark media previews, compact app chrome
   ========================================================== */
body.ps-workspace-page .site-header,
body.ps-workspace-page .ast-primary-header-bar { min-height:68px !important; }
body.ps-workspace-page .site-branding img,
body.ps-workspace-page .custom-logo { max-height:42px !important; width:auto !important; }

/* Open workspace navigation: equal hierarchy, lighter visual weight. */
.ps-open-nav { gap:8px; margin-bottom:10px; }
.ps-open-nav .ps-open-back,
.ps-open-nav .ps-open-back:hover,
#ps-top-controls.ps-open-head { gap:18px; margin-bottom:10px !important; }
.ps-head-btn { min-height:40px; }
.ps-head-primary { padding:0 14px; }
.ps-head-more { width:40px; }
#ps-grilla-tabs .ps-grilla-tab-add {
  border-style:dashed;
  background:#fafbfc !important;
  color:#4f586b !important;
}
#ps-grilla-tabs .ps-grilla-tab-add:hover {
  border-color:#8e98aa;
  background:#f2f4f7 !important;
}


/* ==========================================================
   Ajustes mobile de la vista ABIERTA (antes vivían mezclados
   dentro del bloque de dashboard y dentro de la capa lima —
   se preservan acá, en su lugar correcto, al limpiar ambos).
   ========================================================== */
@media (max-width:700px) {
  .ps-open-nav .ps-open-back,
  .ps-open-nav .ps-spotlight-nav {
    flex:1 1 0;
    min-height:38px !important;
    padding:0 9px !important;
    font-size:10.5px !important;
  }
  .ps-head-primary { min-width:118px; min-height: 42px !important; }
  #ps-grilla-tabs .ps-grilla-tab-add {
    border-style:dashed;
    border-radius:9px 9px 0 0;
  }
}
.ps-mute-btn {
  display: none;
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 6;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
.ps-mute-btn:hover { background: rgba(0,0,0,.88); }

/* ============================================================
 * Grizat — open view final product polish (Step 4)
 * No logic changes. Optimizes the open workspace for up to 12
 * sources and normalizes visual hierarchy/copy.
 * ============================================================ */
#ps-workspace {
  width: min(100%, 1440px);
}

/* Keep the primary action visually dominant; secondary menu stays quiet. */
.ps-open-actions {
  align-self: end;
}

.ps-head-primary {
  min-width: 126px;
  box-shadow: 0 6px 18px rgba(255, 69, 0, .16);
}

.ps-head-primary:hover {
  box-shadow: 0 8px 22px rgba(255, 69, 0, .22);
}

/* The title/description belong to the media shell, so keep them readable
 * on the dark workspace rather than inheriting light-surface text colors. */
#ps-grilla-title.ps-open-title {
  max-width: 900px;
}

#ps-grilla-description.ps-open-description,
#ps-grilla-author.ps-open-description {
  max-width: 820px !important;
}

/* Stream cards can become dense at 8–12 sources; reduce ornamental weight. */
.ps-stream-card {
  box-shadow: 0 5px 16px rgba(0, 0, 0, .14);
}

.ps-stream-footer {
  min-height: 54px;
}

.ps-stream-menu-btn {
  flex-basis: 40px;
  width: 40px;
  height: 40px;
}

@media (max-width: 700px) {
  #ps-workspace {
    width: 100%;
  }

  .ps-head-primary {
    min-width: 118px;
    box-shadow: none;
  }

  .ps-stream-footer {
    min-height: 60px;
  }
}


/* ============================================================
 * Source Picker — canonical unified UI
 * One real FacetWP field: search the Grizat directory or paste a URL.
 * FacetWP owns text search; Grizat only detects URL input.
 * ============================================================ */
.ps-source-picker {
  width:100%;
}

.ps-source-discover-search {
  margin-bottom:12px;
}

.ps-source-discover-search .facetwp-facet {
  margin-bottom:0 !important;
}

.ps-source-discover-search .facetwp-facet-search input,
.ps-source-discover-search .facetwp-type-search input {
  width:100%;
  max-width:none;
  min-height:44px;
  box-sizing:border-box;
  border:1px solid #3a404b;
  border-radius:9px;
  background:#1b1f27;
  color:#fff;
  padding:9px 12px;
  font-size:14px;
}

.ps-source-discover-search .facetwp-facet-search input:focus,
.ps-source-discover-search .facetwp-type-search input:focus {
  outline:none;
  border-color:#00F2FE;
  box-shadow:0 0 0 2px rgba(0,242,254,.12);
}

.ps-source-url-actions {
  display:none;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  margin:0 0 12px;
}

.ps-source-picker.has-url-entry .ps-source-url-actions {
  display:grid;
}

.ps-source-picker.has-url-entry .ps-source-directory-filters,
.ps-source-picker.has-url-entry .ps-source-discover-empty,
.ps-source-picker.has-url-entry .ps-source-discover-results {
  display:none !important;
}

.ps-source-url-actions #ps-custom-channel-name {
  min-height:40px;
  box-sizing:border-box;
}

.ps-source-url-actions #ps-add-channel-btn {
  min-height:40px;
  white-space:nowrap;
}

.ps-source-picker-fallback {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
}

/* Desktop: let the workspace page own scrolling. */
.ps-source-discover {
  max-height:none;
  overflow:visible;
  padding:2px 2px 8px;
}


.ps-source-filter-row {
  display:flex;
  align-items:flex-start;
  flex-wrap:wrap;
  gap:7px;
  margin:9px 0;
}

.ps-source-filter-label {
  flex:0 0 72px;
  padding-top:8px;
  color:#8e96a6;
  font-size:11px;
  font-weight:800;
  letter-spacing:.55px;
  text-transform:uppercase;
}

.ps-source-filter-row .facetwp-facet {
  flex:1;
  min-width:0;
  margin-bottom:0 !important;
}


.ps-source-discover .facetwp-checkbox {
  display:inline-block;
  margin:2px 4px 2px 0;
  padding:6px 10px;
  border:1px solid #3b414b;
  border-radius:999px;
  background:#1b1f27;
  color:#d7dbe2;
  font-size:12px;
}

.ps-source-discover .facetwp-checkbox.checked {
  border-color:#3AB6E8 !important;
  background:rgba(58,182,232,.12) !important;
  color:#fff !important;
}

.ps-source-discover .facetwp-counter {
  display:none;
}

.ps-source-picker-unavailable {
  margin:4px 0 0;
  color:#9aa1ad;
  font-size:13px;
}

/* Empty state is shown until the user searches or selects a facet. */
.ps-source-discover-empty {
  display:flex;
  min-height:150px;
  margin-top:14px;
  padding:28px 20px;
  box-sizing:border-box;
  border:1px dashed #343a45;
  border-radius:12px;
  background:#15191f;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  text-align:center;
}

.ps-source-discover-empty strong {
  display:block;
  margin-bottom:5px;
  color:#f2f4f7;
  font-size:15px;
  font-weight:750;
}

.ps-source-discover-empty span {
  color:#8f97a6;
  font-size:13px;
  line-height:1.45;
}

.ps-source-discover-results {
  display:none;
  width:100%;
  margin-top:14px;
}

.ps-source-discover.has-query .ps-source-discover-empty {
  display:none;
}

.ps-source-discover.has-query .ps-source-discover-results {
  display:block;
}

/*
 * Desktop result grid.
 * Cards keep a controlled width instead of stretching into tall empty columns.
 */
.ps-source-discover-results .facetwp-template {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(420px,1fr));
  justify-content:start;
  align-items:start;
  gap:12px;
  width:100%;
  max-width:960px;
}

/*
 * FacetWP result structure:
 * .ps-custom-card
 *   .ps-clean-card-container
 *     .ps-lazy-player
 *     .ps-channel-card-title
 *     .ps-channel-card-actions
 *   .grizat-discover-add-btn
 *
 * display:contents lets thumbnail, title and Add button participate in one
 * compact grid without duplicating or rewriting the FacetWP template.
 */
.ps-source-discover-results .ps-custom-card {
  display:grid !important;
  grid-template-columns:104px minmax(0,1fr) auto;
  grid-template-rows:auto;
  align-items:center;
  gap:12px;
  width:100% !important;
  min-width:0 !important;
  min-height:0 !important;
  height:auto !important;
  margin:0 !important;
  padding:10px !important;
  box-sizing:border-box;
  border:1px solid #303641 !important;
  border-radius:11px !important;
  background:#171b21 !important;
}

.ps-source-discover-results .ps-custom-card:hover {
  border-color:#495160 !important;
  background:#1a1f26 !important;
}

.ps-source-discover-results .ps-clean-card-container {
  display:contents !important;
}

.ps-source-discover-results .ps-lazy-player {
  grid-column:1;
  grid-row:1;
  width:104px !important;
  height:64px !important;
  min-height:64px !important;
  margin:0 !important;
  padding:0 !important;
  border-radius:8px !important;
  overflow:hidden !important;
  pointer-events:none;
}

.ps-source-discover-results .ps-lazy-player img {
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
}

.ps-source-discover-results .ps-lazy-player .ps-play-icon,
.ps-source-discover-results .ps-lazy-player .ps-tap-overlay,
.ps-source-discover-results .ps-channel-card-chat,
.ps-source-discover-results .ps-channel-card-actions {
  display:none !important;
}

.ps-source-discover-results .ps-channel-card-title {
  display:-webkit-box !important;
  grid-column:2;
  grid-row:1;
  min-width:0;
  max-width:100%;
  margin:0 !important;
  color:#f5f6f8 !important;
  font-size:14px !important;
  font-weight:700 !important;
  line-height:1.35 !important;
  overflow:hidden;
  text-overflow:ellipsis;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}

.ps-source-discover-results .grizat-discover-add-btn {
  grid-column:3;
  grid-row:1;
  justify-self:end;
  width:88px !important;
  min-width:88px !important;
  height:38px !important;
  margin:0 !important;
  padding:0 10px !important;
  box-sizing:border-box;
  border:1px solid #FF4500 !important;
  border-radius:8px !important;
  background:#FF4500 !important;
  color:#fff !important;
  font-size:12px !important;
  font-weight:800 !important;
  white-space:nowrap;
}

.ps-source-discover-results .grizat-discover-add-btn:hover:not(:disabled) {
  background:#ff5a1f !important;
  border-color:#ff5a1f !important;
}

.ps-source-discover-results .grizat-discover-add-btn:disabled {
  background:#202630 !important;
  border-color:#3b4655 !important;
  color:#9ca5b4 !important;
  cursor:default !important;
}

@media (min-width:701px) and (max-width:980px) {
  .ps-source-discover-results .facetwp-template {
    grid-template-columns:1fr;
    max-width:620px;
  }
}

/* Mobile keeps the approved thumbnail / title / action hierarchy. */
@media (max-width:700px) {
  .ps-source-filter-label {
    flex:0 0 100%;
    padding-top:0;
  }

  .ps-source-discover {
    max-height:70vh;
    overflow:auto;
  }

  .ps-source-discover-empty {
    min-height:120px;
    padding:22px 16px;
  }

  .ps-source-discover-results .facetwp-template {
    grid-template-columns:1fr;
    gap:10px;
  }

  .ps-source-discover-results .ps-custom-card {
    grid-template-columns:88px minmax(0,1fr);
    grid-template-rows:auto auto;
    gap:8px 10px;
    padding:10px !important;
  }

  .ps-source-discover-results .ps-lazy-player {
    grid-column:1;
    grid-row:1 / span 2;
    width:88px !important;
    height:58px !important;
    min-height:58px !important;
  }

  .ps-source-discover-results .ps-channel-card-title {
    grid-column:2;
    grid-row:1;
    align-self:end;
  }

  .ps-source-discover-results .grizat-discover-add-btn {
    grid-column:2;
    grid-row:2;
    justify-self:start;
    align-self:start;
    width:86px !important;
    min-width:86px !important;
  }
}


/* ============================================================
 * Grizat Workspace — canonical mobile shell
 * Workspace-specific rules are scoped to ps-workspace-page.
 * Generic app chrome remains in app-navigation.css.
 * ============================================================ */

/* Open Grizat — quick actions */
.ps-grizat-quick-actions {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,220px));
  gap:10px;
  margin:0 0 14px;
}

.ps-grizat-quick-action {
  min-height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 13px;
  border:1px solid #2a3948;
  border-radius:9px;
  background:#111923;
  color:#e8eef4;
  box-shadow:none;
  font-size:13px;
  font-weight:650;
  line-height:1;
  text-transform:none;
  letter-spacing:0;
  cursor:pointer;
  transition:border-color .16s ease, background .16s ease, color .16s ease;
}

.ps-grizat-quick-action:hover {
  border-color:#536273;
  background:#15202b;
  color:#fff;
}

.ps-grizat-quick-action.is-primary {
  border-color:#2a3948;
  background:#111923;
  color:#e8eef4;
}

.ps-grizat-quick-action.is-primary:hover {
  border-color:rgba(0,242,254,.42);
  background:#15202b;
}

.ps-grizat-quick-action svg {
  width:18px;
  height:18px;
  flex:0 0 18px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

@media (max-width:700px) {
  /* Dashboard: compact first screen */
  body.ps-workspace-page #ps-grillas-list {
    padding:12px 0 22px;
  }

  body.ps-workspace-page .ps-dash-head {
    gap:10px;
    margin-bottom:14px;
  }

  body.ps-workspace-page .ps-title-line {
    gap:7px;
  }

  body.ps-workspace-page .ps-dash-title {
    font-size:25px;
    line-height:1.05;
  }

  body.ps-workspace-page .ps-plan-badge {
    margin-top:1px;
    padding:2px 6px;
    font-size:8px;
    opacity:.55;
  }

  body.ps-workspace-page .ps-dash-copy {
    display:none !important;
  }

  body.ps-workspace-page .ps-new-grizat-btn {
    min-height:44px;
    padding:0 15px;
    border-radius:9px;
    font-size:14px;
  }

  body.ps-workspace-page .ps-workspace-grid {
    gap:12px;
  }

  body.ps-workspace-page .ps-workspace-card {
    min-height:0;
    max-width:none;
    padding:0 11px 11px;
    border-radius:12px;
  }

  body.ps-workspace-page .ps-card-strip {
    height:5px;
    margin:0 18px 0 12px;
  }

  body.ps-workspace-page .ps-card-preview {
    height:88px;
    margin:10px 0 10px;
    border-radius:8px;
  }

  body.ps-workspace-page .ps-card-name {
    font-size:15px;
  }

  body.ps-workspace-page .ps-card-meta {
    display:inline-block;
    margin-top:3px;
    font-size:10.5px;
  }

  body.ps-workspace-page .ps-card-description {
    -webkit-line-clamp:1;
    margin-top:4px;
    font-size:11px;
  }

  body.ps-workspace-page .ps-card-menu-btn {
    width:38px;
    height:38px;
    flex-basis:38px;
  }
  /* Inside a grizat, Back to My grizats remains the only top navigation action. */

  body.ps-workspace-page .ps-open-nav {
    display:none !important;
  }

  /* Quick actions stay quiet and horizontal. */
  body.ps-workspace-page .ps-grizat-quick-actions {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    margin:8px 0 12px;
  }

  body.ps-workspace-page button.ps-grizat-quick-action,
  body.ps-workspace-page button.ps-grizat-quick-action.is-primary {
    min-height:42px !important;
    height:42px !important;
    padding:0 12px !important;
    border:1px solid rgba(255,255,255,.12) !important;
    border-radius:9px !important;
    background:#111923 !important;
    color:#e8eef4 !important;
    box-shadow:none !important;
    font-size:13px !important;
    font-weight:650 !important;
  }

  body.ps-workspace-page button.ps-grizat-quick-action:hover,
  body.ps-workspace-page button.ps-grizat-quick-action.is-primary:hover {
    border-color:rgba(0,242,254,.4) !important;
    background:#15202b !important;
    color:#fff !important;
  }

  body.ps-workspace-page button.ps-grizat-quick-action svg {
    width:18px !important;
    height:18px !important;
    flex:0 0 18px !important;
  }

  /* Grizat tabs: readable labels and true horizontal overflow. */
  body.ps-workspace-page #ps-grilla-tabs.ps-open-tabs {
    display:flex !important;
    flex-wrap:nowrap !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    width:100% !important;
    max-width:100% !important;
    gap:4px !important;
    padding:0 18px 5px 0 !important;
    scroll-padding-right:18px;
    scrollbar-width:none !important;
    -webkit-overflow-scrolling:touch;
  }

  body.ps-workspace-page #ps-grilla-tabs.ps-open-tabs::-webkit-scrollbar {
    display:none !important;
  }

  body.ps-workspace-page #ps-grilla-tabs .ps-grilla-tab {
    flex:0 0 auto !important;
    min-width:max-content !important;
    max-width:none !important;
    white-space:nowrap !important;
  }
}


/* Save status: transient server-confirmed feedback beside the open grizat title. */
.ps-grizat-save-status {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
  opacity: .72;
}

.ps-grizat-save-status[hidden] {
  display: none !important;
}

.ps-grizat-save-status--error {
  opacity: 1;
}

@media (max-width: 767px) {
  .ps-grizat-save-status {
    margin-left: 6px;
    font-size: 11px;
  }
}


@media (max-width:700px) {
  .ps-source-picker.has-url-entry .ps-source-url-actions,
  .ps-source-picker-fallback {
    grid-template-columns:1fr;
  }
}


/* ============================================================
 * Menu usability hardening — dashboard + open grizat
 * ============================================================ */
body.ps-workspace-page .ps-workspace-card.menu-open {
  z-index: 120;
}

body.ps-workspace-page .ps-card-menu-btn {
  border-color: #3a4658;
  background: #172131;
  color: #d9e2ef;
}

body.ps-workspace-page .ps-card-menu-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

body.ps-workspace-page .ps-card-menu-btn:hover,
body.ps-workspace-page .ps-card-menu-btn[aria-expanded="true"] {
  border-color: var(--grizat-cyan) !important;
  color: var(--grizat-cyan) !important;
  background: #16233A !important;
}

.ps-mobile-menu-head {
  display: none;
}

@media (max-width:700px) {
  /* Dashboard card actions behave like the other mobile action menus:
     a bottom sheet, not an absolutely-positioned panel between cards. */
  body.ps-workspace-page .ps-card-actions.open {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: 82px !important;
    width: auto !important;
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
    z-index: 100200 !important;
    padding: 10px !important;
    border-radius: 16px !important;
    box-shadow: 0 0 0 9999px rgba(0,0,0,.66), 0 20px 48px rgba(0,0,0,.55) !important;
  }

  body.ps-workspace-page .ps-card-actions-head {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 2px 4px 8px 8px;
    background: var(--grizat-bg);
  }

  body.ps-workspace-page .ps-card-actions-close {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #344056;
    border-radius: 9px;
    background: #182131;
    color: #fff;
    font-size: 26px;
    line-height: 1;
  }

  /* Open-grizat / stream menus must sit above the persistent bottom nav
     (bottom nav is z-index 99990). */
  body.ps-workspace-page .ps-head-menu,
  body.ps-workspace-page .ps-stream-menu {
    bottom: 82px !important;
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
    z-index: 100200 !important;
  }

  .ps-mobile-menu-head {
    display: flex;
    position: sticky;
    top: -10px;
    z-index: 3;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -2px -2px 7px;
    padding: 4px 4px 9px 7px;
    border-bottom: 1px solid #303a49;
    background: #171717;
    color: #aeb8c7;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .ps-mobile-menu-close {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #3a4658 !important;
    border-radius: 9px !important;
    background: #202834 !important;
    color: #fff !important;
    font-size: 26px !important;
    line-height: 1 !important;
    cursor: pointer;
  }

  body.ps-workspace-page .ps-stream-menu-btn,
  body.ps-workspace-page .ps-head-more {
    border-color: #3a4658 !important;
    background: #172131 !important;
    color: #d9e2ef !important;
  }
}


/* ============================================================
 * Mobile action menus — final geometry / clarity pass
 * ============================================================ */
@media (max-width:700px) {
  /* A transformed ancestor changes the containing block of position:fixed.
     Disable the desktop hover lift on touch layouts so card menus truly
     attach to the viewport instead of to the card. */
  body.ps-workspace-page .ps-workspace-card:hover {
    transform:none !important;
  }

  /* Make every ellipsis affordance readable before it is tapped. */
  body.ps-workspace-page .ps-card-menu-btn,
  body.ps-workspace-page .ps-stream-menu-btn,
  body.ps-workspace-page .ps-head-more {
    width:40px !important;
    min-width:40px !important;
    height:40px !important;
    min-height:40px !important;
    padding:0 !important;
    border:1px solid #31536a !important;
    border-radius:10px !important;
    background:#162332 !important;
    color:#00F2FE !important;
    opacity:1 !important;
  }

  body.ps-workspace-page .ps-card-menu-btn svg,
  body.ps-workspace-page .ps-card-menu-btn svg circle {
    display:block !important;
    fill:currentColor !important;
    color:#00F2FE !important;
    opacity:1 !important;
  }

  /* Dashboard actions are a viewport bottom sheet, never a card dropdown. */
  body.ps-workspace-page .ps-card-actions.open {
    position:fixed !important;
    left:12px !important;
    right:12px !important;
    top:auto !important;
    bottom:82px !important;
    width:auto !important;
    max-height:calc(100dvh - 112px) !important;
    overflow-y:auto !important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    z-index:100200 !important;
  }

  body.ps-workspace-page .ps-card-actions-head {
    position:sticky;
    top:0;
    z-index:4;
    min-height:40px;
    background:var(--grizat-bg) !important;
  }

  /* Delicate close control: no oversized rectangle. */
  body.ps-workspace-page .ps-card-actions-close,
  body.ps-workspace-page .ps-mobile-menu-close {
    display:grid !important;
    place-items:center !important;
    flex:0 0 32px !important;
    width:32px !important;
    min-width:32px !important;
    max-width:32px !important;
    height:32px !important;
    min-height:32px !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    border-radius:50% !important;
    background:transparent !important;
    color:#d9e2ef !important;
    box-shadow:none !important;
    font-size:24px !important;
    font-weight:400 !important;
    line-height:1 !important;
    text-align:center !important;
  }

  body.ps-workspace-page .ps-card-actions-close:hover,
  body.ps-workspace-page .ps-mobile-menu-close:hover {
    background:rgba(0,242,254,.08) !important;
    color:#00F2FE !important;
  }

  body.ps-workspace-page .ps-head-menu,
  body.ps-workspace-page .ps-stream-menu {
    position:fixed !important;
    left:12px !important;
    right:12px !important;
    top:auto !important;
    bottom:82px !important;
    width:auto !important;
    max-width:none !important;
    max-height:calc(100dvh - 112px) !important;
    overflow-y:auto !important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    z-index:100200 !important;
  }

  body.ps-workspace-page .ps-mobile-menu-head {
    position:sticky;
    top:-10px;
    z-index:5;
    min-height:42px;
    margin:-2px -2px 7px;
    padding:4px 5px 8px 8px;
    background:#171717;
  }

  body.ps-workspace-page .ps-mobile-menu-head > span {
    white-space:nowrap;
    line-height:1.2;
  }
}


/* ============================================================
 * Mobile dashboard width containment
 * Prevent cards / kebab trigger from exceeding the viewport.
 * ============================================================ */
@media (max-width:700px) {
  body.ps-workspace-page #ps-grillas-list,
  body.ps-workspace-page .ps-workspace-grid,
  body.ps-workspace-page .ps-workspace-card,
  body.ps-workspace-page .ps-card-row,
  body.ps-workspace-page .ps-card-main,
  body.ps-workspace-page .ps-card-preview {
    min-width:0 !important;
    max-width:100% !important;
    box-sizing:border-box !important;
  }

  body.ps-workspace-page #ps-grillas-list,
  body.ps-workspace-page .ps-workspace-grid,
  body.ps-workspace-page .ps-workspace-card {
    width:100% !important;
  }

  body.ps-workspace-page .ps-workspace-grid {
    grid-template-columns:minmax(0,1fr) !important;
  }

  body.ps-workspace-page .ps-card-row {
    width:100% !important;
    overflow:visible !important;
  }

  body.ps-workspace-page .ps-card-main {
    flex:1 1 auto !important;
    width:auto !important;
    overflow:hidden !important;
  }

  body.ps-workspace-page .ps-card-menu-btn {
    position:static !important;
    flex:0 0 40px !important;
    margin-left:auto !important;
    transform:none !important;
  }

  /* Keep the page itself from acquiring horizontal overflow from
     any legacy Astra/content width rule. */
  body.ps-workspace-page .site-main,
  body.ps-workspace-page .entry-content,
  body.ps-workspace-page article.page,
  body.ps-workspace-page #primary {
    min-width:0 !important;
    max-width:100% !important;
    box-sizing:border-box !important;
  }
}


/* ============================================================
 * Share grizat chooser
 * ============================================================ */
body.grizat-share-open{overflow:hidden}
.ps-share-chooser{display:none;position:fixed;inset:0;z-index:100300;align-items:center;justify-content:center;padding:18px;background:rgba(3,7,14,.72);backdrop-filter:blur(4px)}
.ps-share-chooser.is-open{display:flex}
.ps-share-chooser-card{width:min(420px,100%);overflow:hidden;border:1px solid #2d3747;border-radius:15px;background:#111827;box-shadow:0 24px 70px rgba(0,0,0,.48);color:#fff}
.ps-share-chooser-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:18px 18px 14px;border-bottom:1px solid #253044}
.ps-share-chooser-eyebrow{margin:0 0 3px;color:#00F2FE;font-size:10px;font-weight:800;letter-spacing:.09em}
.ps-share-chooser-head h2{margin:0;color:#fff;font-size:20px;font-weight:800;letter-spacing:-.02em}
.ps-share-chooser-close{display:grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:50%;background:transparent;color:#d9e2ef;font-size:24px;line-height:1;cursor:pointer}
.ps-share-chooser-close:hover{background:rgba(0,242,254,.08);color:#00F2FE}
.ps-share-chooser-actions{display:flex;flex-direction:column;padding:8px}
.ps-share-choice{display:flex;align-items:center;gap:13px;width:100%;padding:13px 12px;border:0;border-radius:10px;background:transparent;color:#fff;text-align:left;cursor:pointer}
.ps-share-choice:hover{background:#192334}
.ps-share-choice-icon{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;border:1px solid #344056;border-radius:10px;background:#182131;color:#00F2FE;font-size:17px;font-weight:800}
.ps-share-choice>span:last-child{display:flex;min-width:0;flex-direction:column;gap:2px}
.ps-share-choice strong{color:#fff;font-size:14px;font-weight:800}
.ps-share-choice small{color:#9aa6b6;font-size:11px;line-height:1.35}
.ps-share-choice[hidden]{display:none!important}
@media(max-width:600px){.ps-share-chooser{align-items:flex-end;padding:10px}.ps-share-chooser-card{width:100%;border-radius:15px}}

/* Mobile workspace width: 16px app gutter */
@media (max-width:700px){
  body.grizat-app-shell #primary,
  body.grizat-app-shell .site-main,
  body.grizat-app-shell article,
  body.grizat-app-shell .entry-content{
    width:100%!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
  }
  body.grizat-app-shell .entry-content{
    padding-left:16px!important;
    padding-right:16px!important;
  }
  body.grizat-app-shell #ps-grillas-list,
  body.grizat-app-shell .ps-workspace-grid,
  body.grizat-app-shell .ps-workspace-card{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
}
@media (max-width:380px){
  body.grizat-app-shell .entry-content{
    padding-left:12px!important;
    padding-right:12px!important;
  }
}


/* ============================================================
 * Grizat Radio Player
 * ============================================================ */
.ps-platform-badge{
  position:absolute;top:6px;left:6px;z-index:4;
  padding:2px 6px;border-radius:3px;
  background:rgba(0,0,0,.78);color:#00F2FE;
  font-size:9px;font-weight:800;letter-spacing:.55px;text-transform:uppercase;
}
.ps-radio-player{
  position:absolute;inset:0;
  flex-direction:column;align-items:center;justify-content:center;
  gap:8px;overflow:hidden;
  background:
    radial-gradient(circle at 50% 45%,rgba(0,242,254,.10),transparent 32%),
    linear-gradient(180deg,#0b1118 0%,#080b10 100%);
}
.ps-radio-kicker{
  position:relative;z-index:2;
  color:#00F2FE;font-size:9px;font-weight:900;letter-spacing:.12em;
}
.ps-radio-playbtn{
  position:relative;z-index:3;
  display:grid;place-items:center;
  width:58px;height:58px;padding:0;
  border:1px solid rgba(0,242,254,.42);border-radius:50%;
  background:#121b26;color:#fff;
  box-shadow:0 0 0 7px rgba(0,242,254,.05);
  font-size:17px;cursor:pointer;
  transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease;
}
.ps-radio-playbtn:hover:not(:disabled){
  transform:scale(1.04);border-color:#00F2FE;
  box-shadow:0 0 0 8px rgba(0,242,254,.09);
}
.ps-radio-playbtn:disabled{opacity:.42;cursor:not-allowed}
.ps-radio-playicon{margin-left:2px}
.ps-radio-player.is-playing .ps-radio-playicon{margin-left:0}
.ps-radio-state{
  position:relative;z-index:2;
  min-height:16px;color:#8f9cad;font-size:10px;font-weight:700;
}
.ps-radio-state[data-state="playing"]{color:#d6fbff}
.ps-radio-state[data-state="error"]{color:#ff8c78}
.ps-radio-orbit{
  position:absolute;inset:auto auto 50% 50%;
  width:180px;height:92px;transform:translate(-50%,50%);
  display:flex;align-items:center;justify-content:center;gap:5px;
  opacity:.42;pointer-events:none;
}
.ps-radio-orbit span{
  display:block;width:4px;height:18px;border-radius:999px;
  background:#00F2FE;transform-origin:center;
}
.ps-radio-orbit span:nth-child(2),.ps-radio-orbit span:nth-child(4){height:32px}
.ps-radio-orbit span:nth-child(3){height:46px}
.ps-radio-player.is-playing .ps-radio-orbit span{
  animation:grizatRadioBars .85s ease-in-out infinite alternate;
}
.ps-radio-player.is-playing .ps-radio-orbit span:nth-child(2){animation-delay:.12s}
.ps-radio-player.is-playing .ps-radio-orbit span:nth-child(3){animation-delay:.24s}
.ps-radio-player.is-playing .ps-radio-orbit span:nth-child(4){animation-delay:.36s}
.ps-radio-player.is-playing .ps-radio-orbit span:nth-child(5){animation-delay:.48s}
@keyframes grizatRadioBars{
  from{transform:scaleY(.55);opacity:.42}
  to{transform:scaleY(1.15);opacity:.92}
}
@media (prefers-reduced-motion:reduce){
  .ps-radio-player.is-playing .ps-radio-orbit span{animation:none}
}

/* ============================================================
 * Source Picker — search guidance + media type facet
 * ============================================================ */
.ps-source-search-help {
  margin:6px 1px 0;
  color:#8f97a6;
  font-size:12px;
  line-height:1.4;
}

.ps-source-discover .facetwp-radio {
  display:inline-block;
  margin:2px 4px 2px 0;
  padding:6px 10px 6px 28px;
  border:1px solid #3b414b;
  border-radius:999px;
  background-color:#1b1f27;
  color:#d7dbe2;
  font-size:12px;
}

.ps-source-discover .facetwp-radio.checked {
  border-color:#3AB6E8 !important;
  background-color:rgba(58,182,232,.12) !important;
  color:#fff !important;
}

.ps-source-filter-country select,
.ps-source-filter-country .facetwp-dropdown {
  width:min(100%, 320px);
  min-height:38px;
  box-sizing:border-box;
}

/* ============================================================
 * Mobile open grizat — true edge-to-edge media cards
 * Keep controls/filter UI inside the normal app gutter, but let the
 * source grid use the full viewport width.
 * ============================================================ */
@media (max-width:700px) {
  body.grizat-app-shell #ps-grilla-view #ps-grilla-channels {
    width:calc(100% + 32px) !important;
    max-width:none !important;
    margin-left:-16px !important;
    margin-right:-16px !important;
  }

  body.grizat-app-shell #ps-grilla-view #ps-grilla-channels .ps-stream-card,
  body.grizat-app-shell #ps-grilla-view #ps-grilla-channels .ps-stream-card > div:first-child,
  body.grizat-app-shell #ps-grilla-view #ps-grilla-channels iframe,
  body.grizat-app-shell #ps-grilla-view #ps-grilla-channels video {
    width:100% !important;
    max-width:none !important;
  }
}

@media (max-width:380px) {
  body.grizat-app-shell #ps-grilla-view #ps-grilla-channels {
    width:calc(100% + 24px) !important;
    margin-left:-12px !important;
    margin-right:-12px !important;
  }
}

/* ============================================================
 * Source Picker — visual polish only (Phase 11)
 * No search/index/add behavior changes.
 * ============================================================ */
.ps-source-discover-search .facetwp-facet-search input,
.ps-source-discover-search .facetwp-type-search input {
  border-color:#394455;
  background:#151b24;
}

.ps-source-directory-filters {
  padding-top:2px;
}

.ps-source-filter-row {
  margin:8px 0;
}

/* Unselected choices must look available, not disabled. */
.ps-source-discover .facetwp-checkbox,
.ps-source-discover .facetwp-radio {
  border-color:#465267;
  background:#18202b;
  color:#e6ebf2;
  opacity:1;
  transition:border-color .15s ease, background .15s ease, color .15s ease;
}
.ps-source-discover .facetwp-checkbox:hover,
.ps-source-discover .facetwp-radio:hover {
  border-color:#68778e;
  background:#1d2734;
}
.ps-source-discover .facetwp-checkbox.checked,
.ps-source-discover .facetwp-radio.checked {
  border-color:#00F2FE !important;
  background:rgba(0,242,254,.09) !important;
  color:#fff !important;
}

/* Country belongs to the same dark control family as the other facets. */
.ps-source-filter-country select,
.ps-source-filter-country .facetwp-dropdown {
  width:min(100%,320px);
  min-height:40px;
  padding:0 38px 0 12px;
  border:1px solid #465267;
  border-radius:9px;
  background:#18202b;
  color:#eef2f7;
  font-size:13px;
  box-shadow:none;
}
.ps-source-filter-country select:focus,
.ps-source-filter-country .facetwp-dropdown:focus {
  outline:none;
  border-color:#00F2FE;
  box-shadow:0 0 0 2px rgba(0,242,254,.10);
}

/* Result cards: quieter action hierarchy and more breathing room. */
.ps-source-discover-results .grizat-discover-add-btn {
  width:74px !important;
  min-width:74px !important;
  height:34px !important;
  padding:0 9px !important;
  border-radius:8px !important;
  font-size:11px !important;
}

/* Radio-only sources are information-first: the large black media preview
 * adds little value, so collapse it and let the title breathe. */
.ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) {
  grid-template-columns:42px minmax(0,1fr) auto;
  min-height:62px !important;
  padding:9px 10px !important;
}
.ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) .ps-lazy-player {
  width:42px !important;
  height:42px !important;
  min-height:42px !important;
  border:1px solid #303b4b;
  border-radius:50% !important;
  background:#101722 !important;
}
.ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) .ps-lazy-player img {
  object-fit:cover !important;
}

@media (max-width:700px) {
  .ps-source-search-help {
    margin-top:7px;
    font-size:11.5px;
  }
  .ps-source-filter-label {
    margin-bottom:1px;
    color:#a9b4c4;
  }
  .ps-source-filter-row .facetwp-facet {
    width:100%;
  }
  .ps-source-filter-country select,
  .ps-source-filter-country .facetwp-dropdown {
    width:100%;
  }
  .ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) {
    grid-template-columns:42px minmax(0,1fr) auto;
    grid-template-rows:1fr;
    gap:10px;
  }
  .ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) .ps-lazy-player {
    grid-column:1;
    grid-row:1;
  }
  .ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) .ps-channel-card-title {
    grid-column:2;
    grid-row:1;
    align-self:center;
    -webkit-line-clamp:2;
  }
  .ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) .grizat-discover-add-btn {
    grid-column:3;
    grid-row:1;
    justify-self:end;
    align-self:center;
  }

  /* The source grid itself is the media canvas. Remove both the app-shell
   * gutter and any residual workspace spacing, while controls stay inset. */
  body.grizat-app-shell #ps-grilla-view #ps-grilla-channels {
    width:100vw !important;
    max-width:100vw !important;
    margin-left:calc(50% - 50vw) !important;
    margin-right:calc(50% - 50vw) !important;
    gap:10px !important;
  }
  body.grizat-app-shell #ps-grilla-view #ps-grilla-channels .ps-stream-card {
    border-left:0 !important;
    border-right:0 !important;
    border-radius:0 !important;
  }
}

/* ============================================================
 * Source Picker — Phase 11.1
 * Stable Type control + radio-first result cards.
 * ============================================================ */
.ps-source-native-type-facet {
  display:none !important;
}

.ps-source-type-control {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
}

.ps-source-type-choice {
  min-height:34px;
  padding:0 14px;
  border:1px solid #465267;
  border-radius:999px;
  background:#18202b;
  color:#e6ebf2;
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  transition:border-color .15s ease, background .15s ease, color .15s ease;
}
.ps-source-type-choice:hover {
  border-color:#68778e;
  background:#1d2734;
}
.ps-source-type-choice.is-active {
  border-color:#00F2FE;
  background:rgba(0,242,254,.09);
  color:#fff;
}

.ps-source-card-meta {
  display:none;
}

/* Radio-only results are rows, not miniature video cards. */
.ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) {
  grid-template-columns:48px minmax(0,1fr) auto !important;
  grid-template-rows:auto auto !important;
  column-gap:12px !important;
  row-gap:2px !important;
  width:100% !important;
  min-height:72px !important;
  padding:11px 12px !important;
}

.ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) .ps-clean-card-container > div:first-child {
  grid-column:1 !important;
  grid-row:1 / span 2 !important;
  position:relative !important;
  width:48px !important;
  height:48px !important;
  min-height:48px !important;
  padding:0 !important;
  margin:0 !important;
  border:1px solid #344154 !important;
  border-radius:50% !important;
  overflow:hidden !important;
  background:#111923 !important;
  align-self:center !important;
}

.ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) .ps-clean-card-container > div:first-child > div {
  position:absolute !important;
  inset:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:0 !important;
}

/* The headphones glyph becomes redundant in the compact row. */
.ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) .ps-clean-card-container > div:first-child > div > div:first-child {
  display:none !important;
}

.ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) .ps-clean-card-container > div:first-child button {
  width:38px !important;
  height:38px !important;
  margin:0 !important;
  border:0 !important;
  border-radius:50% !important;
  background:transparent !important;
  color:#fff !important;
  font-size:15px !important;
}

.ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) .ps-channel-card-title {
  grid-column:2 !important;
  grid-row:1 !important;
  align-self:end !important;
  margin:0 !important;
  font-size:14px !important;
  line-height:1.25 !important;
  -webkit-line-clamp:2 !important;
}

.ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) .ps-source-card-meta.is-radio-only {
  display:block;
  grid-column:2 !important;
  grid-row:2 !important;
  align-self:start;
  min-width:0;
  color:#8f9bad;
  font-size:11px;
  line-height:1.3;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) .grizat-discover-add-btn {
  grid-column:3 !important;
  grid-row:1 / span 2 !important;
  justify-self:end !important;
  align-self:center !important;
  width:auto !important;
  min-width:66px !important;
  height:32px !important;
  padding:0 10px !important;
  font-size:10.5px !important;
}

@media (max-width:700px) {
  .ps-source-filter-type .ps-source-filter-label {
    flex-basis:100%;
  }

  .ps-source-type-control {
    width:100%;
  }

  .ps-source-type-choice {
    min-height:34px;
    padding:0 13px;
  }

  .ps-source-discover-results .facetwp-template {
    width:100% !important;
    max-width:none !important;
  }

  .ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) {
    grid-template-columns:46px minmax(0,1fr) auto !important;
    grid-template-rows:auto auto !important;
    width:100% !important;
    min-height:70px !important;
    padding:10px !important;
    gap:2px 10px !important;
  }

  .ps-source-discover-results .ps-custom-card:has(.grizat-discover-add-btn.is-radio-only) .ps-clean-card-container > div:first-child {
    width:46px !important;
    height:46px !important;
    min-height:46px !important;
  }
}
