/* =======================================================
   HOME GLOBAL THEME — colores, fuentes y márgenes base
   ======================================================= */
:root {
  --theme-bg: linear-gradient(135deg, #1a0f00 0%, #994407 60%, #1a0f00 100%);
  --theme-text: #ffffff;
  --secondary-bar-height: 70px;
  --font-primary: 'Poppins', sans-serif;
}

/* =======================================================
   BASE DEL BODY
   ======================================================= */
body {
  background: linear-gradient(135deg, #1a0f00 0%, #471e01 60%, #1a0f00 100%);
  color: var(--theme-text);
  font-family: var(--font-primary);
  margin: 0;
  padding-top: var(--secondary-bar-height);
}

/* =======================================================
   MAIN HEADER
   ======================================================= */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--secondary-bar-height);
  background: var(--theme-bg);
  color: var(--theme-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  z-index: 1000;
}

/* LOGO */
.header-logo {
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-primary);
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.header-logo:hover {
  transform: scale(1.05);
  opacity: 0.8;
}
.logo-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: url('logo.png') center/cover no-repeat;
  border: 2px solid #f8f5f3;
}
.logo-text {
  color: var(--theme-text);
  text-decoration: none;
}
.header-logo:hover .logo-text {
  text-decoration: underline;
  text-decoration-color: #ffffff;
}

/* =======================================================
   ICONO HOME 2D
   ======================================================= */
.home-icon-2d {
  --icon-color: #fff;
  --icon-size: 30px;
  --icon-move-x: -10px;
  --icon-move-y: 5px;
  width: 22px;
  height: 22px;
  position: relative;
  margin-left: 0.6rem;
  top: -10px;
  color: var(--icon-color);
  transform: translate(var(--icon-move-x), var(--icon-move-y)) scale(calc(var(--icon-size) / 22px));
  transform-origin: left top;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.home-icon-2d::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 11px solid currentColor;
}
.home-icon-2d::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 3px;
  width: 16px;
  height: 11px;
  background: currentColor;
}
.home-icon-2d:hover {
  transform: scale(1.1) rotate(8deg);
  opacity: 0.85;
}

/* =======================================================
   BOTÓN HOME
   ======================================================= */
.language-selector {
  margin-left: 1rem;
}
.lang-btn {
  background: linear-gradient(180deg, #eb4411 0%, #000000 50%, #6b2205 100%);
  border: 2px solid #faf6f6;
  color: var(--theme-text);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
  top: 2px;
}
.lang-btn:hover {
  background: #fffdfc;
  color: #000;
}

/* =======================================================
   HOME CONTROLS
   ======================================================= */
.home-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: 970px;
}

/* =======================================================
   BLOQUE DERECHO DE LA BARRA SUPERIOR
   ======================================================= */
.header-right {
  position: absolute;
  top: 0;
  right: 6rem;
  height: 100%;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0 1rem;
  box-sizing: border-box;
  z-index: 1200;
}

/* AVATARES */
.user-avatar,
.curator-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.95);
  background: rgba(0,0,0,0.12);
  flex: 0 0 auto;
  cursor: pointer;
}
.user-avatar img,
.curator-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .18s ease, opacity .18s ease;
}
.user-avatar img:hover,
.curator-avatar img:hover {
  transform: scale(1.08);
  opacity: 0.95;
}

/* SELECTOR DE IDIOMA */
.lang-selector {
  padding: 6px 12px;
  border: 2px solid #fff;
  border-radius: 25px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s ease;
}
.lang-selector:hover {
  background: #fff;
  color: #000;
}

/* BOTONES DEL BLOQUE DERECHO */
.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-btn i {
  font-size: 1.3rem;
  margin-bottom: 0.15rem;
}
.nav-btn:hover {
  transform: scale(1.1);
  opacity: 0.85;
}

/* ============================================================
   MENÚ EXPLORAR — NUEVO DISEÑO COMPACTO Y VISTOSO
   ============================================================ */
.explorar-dropdown {
  position: absolute;
  top: 50px;                   /* justo debajo del botón */
  right: 140px;                /* alineado al botón */
  width: 360px;                /* compacto y elegante */

  background: #120700;
  border: 2px solid #ff9a3c;
  border-radius: 14px;

  padding: 15px 0;

  display: flex;
  flex-direction: column;
  gap: 8px;

  max-height: 0;               /* 🔥 colapsado al inicio */
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);
  transition: max-height 0.35s ease, opacity 0.35s ease, transform 0.35s ease;

  box-shadow: 0 6px 18px rgba(0,0,0,0.65),
              0 0 10px rgba(255,120,0,0.55);

  z-index: 99999;
}

#user-menu {
  right: 140px !important;   /* alineado al avatar */
  top: 50px !important;
}

.explorar-dropdown.show {
  max-height: 200px;  /* ajusta si quieres más alto */
  opacity: 1;
  transform: translateY(0);
}


.explorar-item {
  width: 90%;
  padding: 3px 0;
  text-align: center;

  font-weight: 800;
  font-size: 0.95rem;
  color: #ffd79e;

  border-bottom: 2px solid rgba(255,150,50,0.35);

  background: linear-gradient(180deg, #4a1a00, #2a0c00);
  cursor: pointer;
  transition: all .2s ease;

  border-radius: 10px;   /* 🔥 ESQUINAS REDONDEADAS */
  margin: 3px auto;       /* 🔥 SEPARA DEL BORDE PARA CALZAR CON EL MENÚ */
}


.explorar-item:last-child {
  border-bottom: none;
}

.explorar-item:hover {
  background: linear-gradient(180deg, #ff7c11, #b93f00);
  color: #fff;
  transform: scale(1.03);
}


/* =======================================================
   RESPONSIVE
   ======================================================= */
@media (max-width: 880px) {
  .header-right {
    max-width: calc(100% - 120px);
    right: 0.6rem;
    gap: 0.6rem;
  }
  .user-avatar,
  .curator-avatar {
    width: 36px;
    height: 36px;
  }
  .nav-btn i {
    font-size: 1.1rem;
  }
  .nav-btn .nav-label {
    font-size: 0.72rem;
  }
}

/* ============================================================
   HISTORIAL DEL USUARIO - MENÚ MOBILE BASE OCULTA PC (REAL-LIVE)
   ============================================================ */
.mobile-dashboard-menu-shell,
.mobile-dashboard-menu-btn,
#mobile-dashboard-menu {
  display: none;
}

/* =======================================================
   BOTÓN DE DIRECCIÓN
   ======================================================= */
.direction-btn {
  --scale: 1;
  --arrow-ratio: 0.50;

  background-color: #220b01;
  border: 2px solid #ffffff;
  border-radius: 10px;
  width: calc(35px * var(--scale));
  height: calc(35px * var(--scale));
  position: absolute;
  top: 21.8px;
  left: 400px;
  margin-left: 13px;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.direction-btn .arrow-icon {
  position: absolute;
  top: calc(50% + var(--offset-y, 0px));
  left: calc(50% + var(--offset-x, 0px));
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  width: 0;
  height: 0;
  border-left: calc(12px * var(--scale, 1)) solid transparent;
  border-right: calc(12px * var(--scale, 1)) solid transparent;
  border-bottom: calc(15px * var(--scale, 1)) solid var(--arrow-color, #fff);
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.4));
  transition: all 0.3s ease;
}

.direction-btn.down .arrow-icon {
  transform: translateX(-50%) rotate(180deg);
}

.direction-btn:hover {
  background-color: #f70b0b;
  transform: scale(1.05);
}

.direction-btn:active {
  transform: scale(0.80);
  opacity: 0.85;
}

.direction-btn {
  transform: scale(var(--btn-scale, 1));
  transform-origin: center center;
}



/* === Barra Secundaria Ajustada (importada de Landing Page) === */
.secondary-bar {
  width: 100%;
  background: linear-gradient(180deg, rgba(97, 13, 2, 0.9) 0%, rgba(11,11,11,0.8) 100%);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  position: relative;
  z-index: 9;
  border-bottom: 0px solid rgb(41, 19, 1);
  backdrop-filter: blur(6px);
}

/* Contenedor interno */
.secondary-bar .container {
  width: 100%;
  max-width: 1400px;
  padding: 0;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Grupo de elementos */
.sb-group {
  display: flex;
  align-items: center;
  gap: 20px;
  transform: translateX(70px);
}

/* Título */
.language-selector {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 26px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 25px;
  background: rgba(207, 94, 14, 0.678);
  box-shadow: 0 3px 8px rgba(255,107,0,0.28);
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  transition: all .25s ease;
  white-space: nowrap;
  margin-left: -35px;
}
.language-selector:hover {
  background: rgba(255, 106, 0, 0.959);
  transform: translateY(-1px);
}


/* =======================================================
   TOKENS EN BARRA SECUNDARIA — VERSIÓN CORREGIDA Y UNIFICADA
   ======================================================= */
.tokens-container {
  display: flex;                     /* Alinea los tokens en fila */
  align-items: center;               /* Centra verticalmente */
  gap: 0px;                         /* Espacio entre tokens */
  margin-left: 0px;                 /* Separación respecto al botón “Galería de Tokens” */
  cursor: pointer;
}


.token-item {
  display: flex;                     /* Ícono + bloque de texto */
  align-items: center;               /* Centrado vertical */
  gap: 10px;                         /* Espaciado entre ícono y texto */
  background: rgba(165, 73, 11, 0);   /* Fondo semitransparente */
  border-radius: 50px;               /* Bordes redondeados */
  padding: 6px 12px;                 /* Espaciado interno */
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
  transition: transform 0.2s ease;
}
.token-item:hover {
  transform: scale(1.05);            /* Efecto al pasar el cursor */
}

/* ÍCONO */
.token-icon {
  width: 36px;                       /* Tamaño del ícono */
  height: 36px;
  border-radius: 50%;                /* Forma circular */
  object-fit: cover;
  border: 2px solid #fff;            /* Borde blanco definido */
}

/* BLOQUE DE TEXTO (nombre + contador debajo) */
.token-text {
  display: flex;                     /* Permite apilar texto */
  flex-direction: column;            /* NOMBRE arriba / x0 abajo */
  align-items: center;               /* Centra ambos horizontalmente */
  justify-content: center;           /* Centrado vertical */
  line-height: 1.1;
}

/* NOMBRE */
.token-name {
  font-size: 0.8rem;                 /* Más pequeño */
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 2px;                /* Separación mínima con el x0 */
}

/* CONTADOR (x0 debajo del nombre, centrado) */
.token-count {
  font-size: 0.7rem;
  font-weight: 800;
  color: #ffae42;
}

/* COLORES DIFERENCIADOS */
.token-item:nth-child(1) .token-icon { box-shadow: 0 0 10px rgba(0,145,255,0.8); }  /* DAILY */
.token-item:nth-child(2) .token-icon { box-shadow: 0 0 10px rgba(0,255,120,0.8); }  /* REGALO */
.token-item:nth-child(3) .token-icon { box-shadow: 0 0 10px rgba(255,0,200,0.8); }  /* INDIE */

/* =======================================================
   🔧 BLOQUE DE MODIFICACIÓN RÁPIDA
   =======================================================
   - Tamaño del ícono: ajustar width / height en .token-icon
   - Forma: modificar border-radius (100% = círculo)
   - Tamaño texto: cambiar font-size en .token-name / .token-count
   - Espaciado general: modificar gap y padding en .token-item
   - Colores de borde o sombra: editar box-shadow por token
   - Añadir más tokens: duplicar bloque HTML manteniendo estructura
   - Todos los tokens comparten este mismo estilo de base
   ======================================================= */


   /* ============================================================
   SECCIÓN HISTORIAL — NUEVO SISTEMA AVANZADO
   ============================================================ */

.historial-cards-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 0px;
}

.historial-card {
  width: 100%;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  padding: 0;
  overflow: hidden;
  transition: all .25s ease;
}

.historial-toggle-btn {
  width: 100%;
  background: #f7f3f1;
  border: none;
  padding: 16px 20px;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
}

.historial-toggle-btn img {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
}

.historial-toggle-btn:hover {
  background: #e6d2c8;
}

.historial-scrollbox {
  max-height: 0;
  overflow-y: auto;
  padding: 0 20px;
  transition: max-height .28s ease;
}

.historial-card.abierto .historial-scrollbox {
  max-height: 300px;
  padding: 20px;
}

.historial-item {
  background: #fff;
  border-left: 6px solid #d0691f;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.historial-item-titulo {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.historial-item-fecha {
  font-size: 0.85rem;
  opacity: 0.7;
}

.historial-item-estado,
.historial-item-detalle {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* ANIMACIÓN DE APERTURA */
.historial-card {
  transition: max-height .25s ease, padding .25s ease;
}

.historial-card.abierto {
  box-shadow: 0 0 14px rgba(255,140,60,0.45);
}

/* ANIMACIÓN DE ITEMS */
.historial-item {
  animation: pop .25s ease;
}

@keyframes pop {
  0% { transform: scale(.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* SEPARADOR POR FECHA */
.historial-separador {
  font-size: .9rem;
  font-weight: 800;
  opacity: .65;
  margin: 14px 0 6px 4px;
}

/* ============================================================
   HISTORIAL — ASPECTO VISUAL FINAL COMPLETO (CORREGIDO)
   ============================================================ */

/* CONTENEDOR PRINCIPAL */
.historial-section {
  width: 96%;
  max-width: 1400px;
  margin: 40px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* FILA DE CARDS */
.historial-cards-row {
  display: flex;
  flex-direction: column;
  gap: 35px;
}

/* BOTÓN SUPERIOR CON ICONO */
.historial-toggle-btn {
  width: 100%;
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.38);
  padding: 12px 18px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  backdrop-filter: blur(4px);
  transition: all .25s ease;
}

.historial-toggle-btn img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.historial-toggle-btn:hover {
  background: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

/* CARD */
.historial-card {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  transition: all .23s ease;
  box-shadow: 0 0 12px rgba(0,0,0,0.45);
}

.historial-card.abierto {
  box-shadow: 0 0 18px rgba(255,150,60,0.55);
  border-color: rgba(255,160,80,0.9);
}

/* SCROLL INTERNO */
.historial-scrollbox {
  max-height: 0;
  overflow-y: auto;
  padding: 0 12px;
  transition: max-height .25s ease, padding .25s ease;
}

.historial-card.abierto .historial-scrollbox {
  max-height: 320px;
  padding: 14px 12px;
}

/* SEPARADOR DE FECHA */
.historial-separador {
  font-size: .95rem;
  font-weight: 900;
  opacity: .9;
  margin: 8px 0 4px 6px;
  color: #ffca8a;
}

/* ============================================================
   ITEM — AJUSTES EXACTOS ORDENADOS POR TI
   ============================================================ */

.historial-item {
  background: rgba(255,255,255,0.95);
  color: #000;
  padding: 5px 10px;         /* REDUCIDO UN POCO MÁS */
  border-radius: 9px;
  margin-bottom: 6px;        /* ESPACIO VERTICAL REDUCIDO */
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
  animation: pop .25s ease;
}

/* TÍTULO */
.historial-item-titulo {
  font-size: .97rem;
  font-weight: 800;
  margin-bottom: 2px;
}

/* DETALLE Y HORA EN LA MISMA LÍNEA */
.historial-item-detalle {
  font-size: .9rem;
  opacity: .85;
  display: inline-block;
}

/* HORA — OSCURECIDA Y AL LADO */
.historial-item-fecha {
  font-size: 0.8rem;
  opacity: 7;             /* MÁS OSCURA */
  margin-left: 8px;
  display: inline-block;
}

/* ESTADO */
.historial-item-estado {
  font-size: .87rem;
  opacity: .8;
  margin-top: 2px;
}

/* ANIMACIÓN */
@keyframes pop {
  0% { transform: scale(.94); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* AUTO SUAVIZADO VISUAL Y TRANSICIONES */
.historial-card {
  transition: max-height .28s ease, padding .28s ease, box-shadow .28s ease;
  scroll-margin-top: 100px;
}

.historial-toggle-btn {
  transition: all .25s ease;
}

.historial-scrollbox {
  scrollbar-width: thin;
}

/* ============================================================
   HISTORIAL DE PLAYLISTS — CARD INTERNA ESPECIALIZADA
   ============================================================ */

.historial-card[data-tipo="playlists"].abierto .historial-scrollbox {
  max-height: 560px;
}

.historial-item-playlists {
  padding: 10px 12px;
}

.historial-playlists-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.historial-playlists-header-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.historial-playlists-time {
  margin-left: 0;
  flex-shrink: 0;
  color: #000;
  font-weight: 900;
  opacity: 1;
}

.historial-playlists-service-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.historial-playlists-service-name {
  min-width: 108px;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1.2;
}

.historial-playlists-covers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

.historial-playlists-cover {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.08);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.historial-playlists-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.historial-playlists-sync-title {
  font-size: .94rem;
  font-weight: 800;
  margin-top: 14px;
  color: #5a2a06;
}

.historial-playlists-sync-title.is-pending {
  display: none;
  color: #8d3f0e;
}

/* ============================================================
   HISTORIAL PLAYLISTS - BOTON COMPARTIR / EXPORTAR REAL-LIVE
   ============================================================ */

.historial-compartir-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0;
}

.historial-compartir-btn {
  min-height: 34px;
  padding: 7px 14px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 12px;
  background: linear-gradient(180deg, #ff7c11, #7c2100);
  color: #fff;
  font-size: .82rem;
  line-height: 1.1;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(0,0,0,0.28);
  transition: transform .16s ease, background .16s ease, opacity .16s ease;
}

.historial-compartir-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(90deg, #f70b0b, #5a0000);
}

.historial-compartir-btn:disabled {
  opacity: .62;
  cursor: wait;
  transform: none;
}

/* ============================================================
   HISTORIAL PLAYLISTS - ARCHIVO BAJO SOLICITUD SITUACION VISUAL
   Pendientes automáticas; compartidas mediante búsqueda o Cargar Más.
   ============================================================ */

.historial-card[data-tipo="playlists"]:not(.abierto) .historial-playlists-archive-controls {
  display: none;
}

.historial-playlists-archive-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 14px 14px;
  background: rgba(255, 255, 255, 0.96);
}

.historial-playlists-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.historial-playlists-search-label,
.historial-playlists-date-label {
  color: #5a2a06;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.historial-playlists-search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  min-width: 180px;
}

.historial-playlists-search-icon {
  position: absolute;
  left: 10px;
  z-index: 1;
  color: #7c2100;
  font-size: 1.25rem;
  line-height: 1;
  pointer-events: none;
}

.historial-playlists-search-field input,
#historial-playlists-date-input {
  min-height: 36px;
  border: 1px solid rgba(124, 33, 0, 0.42);
  border-radius: 10px;
  background: #fff;
  color: #351304;
  font: inherit;
  font-size: .84rem;
  font-weight: 700;
  outline: none;
}

.historial-playlists-search-field input {
  width: 100%;
  padding: 7px 10px 7px 31px;
}

#historial-playlists-date-input {
  padding: 7px 9px;
}

.historial-playlists-search-field input:focus,
#historial-playlists-date-input:focus {
  border-color: #ff7c11;
  box-shadow: 0 0 0 2px rgba(255, 124, 17, 0.18);
}

.historial-playlists-archive-btn {
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid rgba(124, 33, 0, 0.55);
  border-radius: 10px;
  background: linear-gradient(180deg, #ff7c11, #7c2100);
  color: #fff;
  font-size: .78rem;
  font-weight: 900;
  cursor: pointer;
  transition: opacity .16s ease, transform .16s ease;
}

.historial-playlists-archive-btn:hover {
  transform: translateY(-1px);
}

.historial-playlists-archive-btn:disabled {
  opacity: .55;
  cursor: wait;
  transform: none;
}

.historial-playlists-archive-feedback {
  min-height: 1.1em;
  color: #7c2100;
  font-size: .76rem;
  font-weight: 800;
}

@media (max-width: 760px) {
  .historial-playlists-service-row {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .historial-playlists-service-name {
    min-width: 0;
  }

  .historial-playlists-cover {
    width: 54px;
    height: 54px;
  }

  .historial-compartir-actions {
    justify-content: flex-end;
  }

  .historial-compartir-btn {
    width: auto;
  }

  .historial-playlists-search-row {
    align-items: stretch;
  }

  .historial-playlists-search-label,
  .historial-playlists-date-label {
    flex: 0 0 100%;
  }

  .historial-playlists-search-field,
  #historial-playlists-date-input,
  .historial-playlists-search-row .historial-playlists-archive-btn {
    width: 100%;
    flex-basis: 100%;
  }
}

/* ============================================================
   HISTORIAL DEL USUARIO - BARRA PRINCIPAL MOBILE REAL-LIVE
   Replica móvil del Dashboard sin tocar la versión PC.
   ============================================================ */
@media (hover: none) and (pointer: coarse) and (max-width: 920px),
       (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 560px) {
  html,
  body {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    position: relative;
    overflow-x: hidden !important;
    overscroll-behavior-x: none;
    touch-action: pan-y;
  }

  @supports (overflow: clip) {
    html,
    body {
      overflow-x: clip !important;
    }
  }

  .main-header,
  .main-header * {
    box-sizing: border-box;
  }

  .main-header {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: var(--secondary-bar-height);
    min-height: var(--secondary-bar-height);
    padding: 10px;
    gap: 0;
    justify-content: flex-start;
    align-items: center;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
    overflow: visible;
  }

  .header-logo {
    gap: 0.6rem;
    min-width: 0;
    max-width: calc(100vw - 238px);
    margin-right: 0;
    font-size: 0.88rem;
    font-weight: 900;
    flex: 0 1 auto;
    transform: none;
  }

  .header-logo:hover {
    transform: none;
    opacity: 0.88;
  }

  .logo-circle {
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
  }

  .logo-text {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .home-icon-2d,
  .header-right > :not(.lang-selector):not(.mobile-dashboard-menu-shell) {
    display: none !important;
  }

  .home-controls {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    z-index: 1202;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    margin-left: 6px;
    margin-right: 0;
    transform: none;
  }

  .language-selector-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .lang-btn {
    top: 0;
    min-width: 54px;
    min-height: 34px;
    padding: 6px 11px;
    border-radius: 25px;
    font-size: 0.84rem;
    line-height: 1;
    text-transform: uppercase;
  }

  .direction-btn {
    --scale: 1;
    position: relative;
    top: auto;
    left: auto;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    margin-left: 0;
  }

  .direction-btn .arrow-icon {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 13px solid #fff;
  }

  .direction-btn.down .arrow-icon {
    transform: translate(-50%, -50%) rotate(180deg);
  }

  .header-right {
    position: relative;
    top: auto;
    right: auto;
    height: auto;
    max-width: none;
    z-index: 1201;
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0;
    transform: none;
    gap: 6px;
  }

  .header-right .lang-selector {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    min-height: 34px;
    padding: 6px 9px;
    border-radius: 25px;
    font-size: 0.84rem;
    font-weight: 900;
    line-height: 1;
  }

  /* ============================================================
     HISTORIAL DEL USUARIO - MENÚ MOBILE BOTÓN Y DESPLEGABLE (REAL-LIVE)
     ============================================================ */
  .mobile-dashboard-menu-shell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }

  .mobile-dashboard-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    min-height: 34px;
    padding: 6px 10px;
    border: 2px solid #fff;
    border-radius: 25px;
    background: linear-gradient(180deg, #4a1a00, #120700);
    color: #fff;
    font-family: var(--font-primary);
    font-size: 0.84rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    list-style: none;
    transition: transform .2s ease, opacity .2s ease, background .2s ease;
  }

  .mobile-dashboard-menu-btn::-webkit-details-marker {
    display: none;
  }

  .mobile-dashboard-menu-btn:hover,
  .mobile-dashboard-menu-btn:focus-visible {
    background: linear-gradient(180deg, #ff7c11, #7a2600);
    opacity: 0.95;
    outline: none;
    transform: scale(1.03);
  }

  #mobile-dashboard-menu.mobile-dashboard-dropdown {
    position: fixed;
    top: calc(var(--secondary-bar-height) + 8px);
    left: 50%;
    right: auto;
    width: min(310px, calc(100vw - 32px));
    max-height: 0;
    display: flex;
    padding: 12px 0;
    transform: translate(-50%, -10px);
    z-index: 99999;
  }

  #mobile-dashboard-menu.mobile-dashboard-dropdown .explorar-item {
    min-height: 36px;
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
  }

  .mobile-dashboard-menu-shell[open] #mobile-dashboard-menu.mobile-dashboard-dropdown,
  #mobile-dashboard-menu.mobile-dashboard-dropdown.show {
    max-height: min(520px, calc(100vh - var(--secondary-bar-height) - 24px));
    overflow-y: auto;
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (hover: none) and (pointer: coarse) and (max-width: 360px) {
  .header-logo {
    max-width: calc(100vw - 238px);
  }

  .lang-btn {
    min-width: 50px;
    padding-right: 9px;
    padding-left: 9px;
  }

  .mobile-dashboard-menu-btn {
    min-width: 56px;
    padding-right: 8px;
    padding-left: 8px;
  }
}

/* ============================================================
   HISTORIAL DEL USUARIO - BARRA SECUNDARIA MOBILE REAL-LIVE
   ============================================================ */
@media (hover: none) and (pointer: coarse) and (max-width: 920px),
       (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 560px) {
  .secondary-bar {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .secondary-bar .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
  }

  .secondary-bar .sb-group {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    transform: none;
  }

  .secondary-bar .sb-group > .language-selector:not(:first-child),
  .secondary-bar .tokens-container {
    display: none !important;
  }

  .secondary-bar .sb-group > .language-selector:first-child {
    margin-left: 0;
    max-width: 100%;
    padding: 8px 26px;
    text-align: center;
    font-size: 0;
    line-height: 1;
    pointer-events: none;
  }

  .secondary-bar .sb-group > .language-selector:first-child::after {
    content: attr(data-mobile-label);
    display: inline-block;
    max-width: 100%;
    color: #fff;
    font-size: 0.84rem;
    font-weight: 900;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* ============================================================
   HISTORIAL DEL USUARIO - CONTENIDO MOBILE SIN OVERFLOW (REAL-LIVE)
   ============================================================ */
@media (hover: none) and (pointer: coarse) and (max-width: 920px),
       (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 560px) {
  .historial-section,
  .historial-section * {
    box-sizing: border-box;
  }

  .historial-section {
    width: 100%;
    max-width: 100%;
    margin: 24px 0 34px;
    padding: 0 10px;
    overflow-x: hidden;
  }

  .historial-cards-row {
    width: 100%;
    max-width: 100%;
    gap: 24px;
    overflow-x: hidden;
  }

  .historial-toggle-btn,
  .historial-card,
  .historial-scrollbox,
  .historial-item {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .historial-toggle-btn {
    padding: 12px 14px;
    gap: 10px;
    font-size: 0.94rem;
    line-height: 1.15;
  }

  .historial-toggle-btn img {
    flex: 0 0 32px;
  }

  .historial-scrollbox {
    overflow-x: hidden;
  }

  .historial-card.abierto .historial-scrollbox {
    max-height: 58vh;
    padding: 14px 10px;
  }

  .historial-card[data-tipo="playlists"].abierto .historial-scrollbox {
    max-height: 62vh;
  }

  .historial-item-titulo,
  .historial-item-detalle,
  .historial-item-estado,
  .historial-playlists-service-name,
  .historial-playlists-sync-title {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .historial-playlists-header {
    flex-wrap: wrap;
    min-width: 0;
  }

  .historial-playlists-header-meta {
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .historial-playlists-service-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .historial-playlists-covers {
    min-width: 0;
    max-width: 100%;
  }

  .historial-playlists-cover {
    flex: 0 0 54px;
  }
}
