/* ================================================================ */
/*  PSN ENGLISH PLATFORM — main.css                                 */
/*  Rediseño v2.0 — Mobile-first, azul plano #1a56db, sin degradados*/
/*  Autor: PSN / Claude — Junio 2026                                */
/* ================================================================ */

/* ================================================================ */
/*  1. RESET & VARIABLES GLOBALES                                   */
/* ================================================================ */
*, *::before, *::after { box-sizing: border-box; }

:root {
    /* Azul principal plano — color único predominante */
    --psn-primary:        #1a56db;
    --psn-primary-dark:   #1648b8;
    --psn-primary-light:  #eef2ff; /* fondo suave azul, sin degradado */
    --psn-primary-mid:    #6b8df0; /* azul medio para bordes sutiles */

    /* Semánticos */
    --psn-success:  #2e7d32;
    --psn-success-bg: #f0faf0;
    --psn-success-border: #a5d6a7;
    --psn-warning:  #e65100;
    --psn-danger:   #c62828;
    --psn-danger-bg: #fff5f5;
    --psn-danger-border: #ffcdd2;

    /* Textos */
    --psn-text:           #1c1c1e;
    --psn-text-secondary: #555555;
    --psn-text-muted:     #9e9e9e;

    /* Superficies — planas, sin sombras llamativas */
    --psn-bg:       #f5f7ff;   /* fondo página: azul muy tenue */
    --psn-card-bg:  #ffffff;
    --psn-surface:  #fafafa;   /* gris casi blanco para elementos secundarios */

    /* Bordes */
    --psn-border:       #e0e0e0;
    --psn-border-light: #ebebeb;

    /* Radios */
    --psn-radius:    14px;
    --psn-radius-sm: 10px;
    --psn-radius-xs: 7px;

    /* Altura header fijo */
    --psn-header-h: 48px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--psn-bg);
    color: var(--psn-text);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--psn-primary); text-decoration: none !important; transition: opacity .2s; }
a:hover { opacity: .82; text-decoration: none !important; }
img { max-width: 100%; height: auto; }

/* ================================================================ */
/*  2. HEADER GLOBAL                                                */
/* ================================================================ */
.psn-top-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: var(--psn-header-h);
    background: #fff;
    border-bottom: 0.5px solid var(--psn-border-light);
    position: sticky;
    top: 0;
    z-index: 9997;
}
.psn-header-logo {
    font-size: 15px;
    font-weight: 700;
    color: var(--psn-primary); /* logo en azul */
}
.psn-header-spacer { flex: 1; }
.psn-header-user  { display: flex; align-items: center; gap: 6px; }

/* Avatar: círculo azul plano, sin degradado */
.psn-header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--psn-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
/* Pill de nivel en el header */
.psn-header-level {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--psn-primary-light);
    color: var(--psn-primary);
    font-weight: 700;
}

/* ================================================================ */
/*  3. BOTTOM NAVIGATION                                            */
/* ================================================================ */
.psn-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    background: #fff;
    border-top: 0.5px solid var(--psn-border-light);
    z-index: 9998;
    padding: 4px 0;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
}
/* Ocultar nav en onboarding */
.psn-onboarding .psn-bottom-nav,
body.page-template:has(.psn-onboarding) .psn-bottom-nav { display: none; }

.psn-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 5px 0 3px;
    text-decoration: none !important;
    color: var(--psn-text-muted);
    transition: color .2s;
    font-size: 9px;
}
.psn-nav-item:hover { color: var(--psn-primary); }
.psn-nav-item.active { color: var(--psn-primary); }
.psn-nav-icon  { font-size: 19px; line-height: 1; }
.psn-nav-label { font-weight: 500; }

/* Espacio inferior para el nav fijo */
.psn-has-bottom-nav { padding-bottom: 64px; }
@media (min-width: 1024px) {
    .psn-bottom-nav { display: none; }
    .psn-has-bottom-nav { padding-bottom: 0; }
}

/* ================================================================ */
/*  4. BOTONES GLOBALES                                             */
/* ================================================================ */
.psn-btn,
.psn-primary-btn,
.psn-lib-action-btn,
.psn-day-btn,
.psn-next-btn,
.psn-lesson-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 20px !important;
    border-radius: var(--psn-radius-sm) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all .18s ease;
    text-decoration: none !important;
    line-height: 1;
    border: 0.5px solid var(--psn-border);
    background: #fff;
    color: var(--psn-text);
    outline: none;
    font-family: inherit;
}
.psn-btn:hover,
.psn-primary-btn:hover { opacity: .9; }

/* Botón primario — azul plano sin degradado */
.psn-btn-primary,
.psn-primary-btn,
.psn-lib-action-btn.primary,
.psn-lesson-btn.primary,
.psn-day-btn {
    background: var(--psn-primary) !important;
    color: #fff !important;
    border-color: var(--psn-primary) !important;
}
.psn-btn-primary:hover,
.psn-primary-btn:hover,
.psn-day-btn:hover { background: var(--psn-primary-dark) !important; }

.psn-btn-success  { background: var(--psn-success); color: #fff; border-color: var(--psn-success); }
.psn-btn-danger   { background: var(--psn-danger); color: #fff; border-color: var(--psn-danger); }
.psn-btn-small    { padding: 7px 13px !important; font-size: 12px !important; }
.psn-btn-back     { background: transparent; border: none; color: var(--psn-primary); padding-left: 0; }
.psn-btn-secondary,
.psn-lesson-btn.secondary {
    background: #fff;
    color: var(--psn-primary);
    border-color: var(--psn-primary);
}

/* ================================================================ */
/*  5. BOTÓN PLAY — Fix visibilidad: SVG blanco sobre azul          */
/* ================================================================ */
/* Botón pequeño ▶ en las filas de días del plan */
.psn-day-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    background: var(--psn-primary) !important;
    border-radius: var(--psn-radius-xs) !important;
    color: #fff !important;
    font-size: 0 !important;         /* oculta texto "▶" si lo hay */
    line-height: 1 !important;
    flex-shrink: 0;
    text-decoration: none !important;
}
/* SVG de triángulo blanco dentro del botón */
.psn-day-btn::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 0 6px 11px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 2px;
}

/* Botón grande "Ir a mi clase" en el plan */
.psn-next-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 13px 24px !important;
    background: var(--psn-primary) !important;
    color: #fff !important;
    border-color: var(--psn-primary) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-radius: var(--psn-radius-sm) !important;
    text-decoration: none !important;
    width: 100%;
    box-sizing: border-box;
}
.psn-next-btn:hover { background: var(--psn-primary-dark) !important; }

/* ================================================================ */
/*  6. CARDS GENÉRICAS                                              */
/* ================================================================ */
.psn-card {
    background: var(--psn-card-bg);
    border-radius: var(--psn-radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 0.5px solid var(--psn-border);
}
.psn-card-header { font-weight: 600; font-size: 15px; margin-bottom: 10px; }

/* ================================================================ */
/*  7. FORMULARIOS                                                  */
/* ================================================================ */
.psn-input,
.psn-auth-input {
    width: 100%;
    padding: 11px 13px;
    border: 0.5px solid var(--psn-border);
    border-radius: var(--psn-radius-sm);
    font-size: 15px;
    transition: border-color .2s;
    background: #fff;
    font-family: inherit;
}
.psn-input:focus,
.psn-auth-input:focus {
    border-color: var(--psn-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--psn-primary-light);
}
.psn-select   { padding: 10px 13px; border: 0.5px solid var(--psn-border); border-radius: var(--psn-radius-sm); font-size: 14px; background: #fff; }
.psn-textarea { width: 100%; padding: 11px 13px; border: 0.5px solid var(--psn-border); border-radius: var(--psn-radius-sm); font-size: 15px; resize: vertical; font-family: inherit; }
.psn-textarea:focus { border-color: var(--psn-primary); outline: none; box-shadow: 0 0 0 3px var(--psn-primary-light); }
.psn-form-group { margin-bottom: 14px; }
.psn-form-group label { display: block; font-weight: 500; margin-bottom: 5px; font-size: 13px; color: var(--psn-text); }

/* ================================================================ */
/*  8. LAYOUT GENÉRICO                                             */
/* ================================================================ */
.psn-app-content { max-width: 700px; margin: 0 auto; padding: 14px 14px 80px; min-height: 80vh; }
.psn-container   { max-width: 700px; margin: 0 auto; padding: 14px; }
.psn-page-header { text-align: center; margin-bottom: 20px; }
.psn-page-header h1 { font-size: 22px; margin: 0 0 3px; }
.psn-subtitle { color: var(--psn-text-secondary); font-size: 14px; margin: 0; }

/* ================================================================ */
/*  9. ESTADOS GLOBALES                                            */
/* ================================================================ */
.psn-loading-state { text-align: center; padding: 40px 20px; color: var(--psn-text-muted); }
.psn-empty-state   { text-align: center; padding: 40px 20px; }
.psn-empty-state h3 { margin: 0 0 6px; font-size: 17px; }
.psn-empty-state p  { color: var(--psn-text-muted); margin: 0 0 14px; }

/* Spinner — azul plano */
.psn-spinner {
    width: 22px; height: 22px;
    border: 2.5px solid var(--psn-border);
    border-top-color: var(--psn-primary);
    border-radius: 50%;
    animation: psn-spin .8s linear infinite;
    display: inline-block;
    margin-bottom: 10px;
}
@keyframes psn-spin { to { transform: rotate(360deg); } }

/* Toast */
.psn-toast {
    position: fixed; bottom: 80px;
    left: 50%; transform: translateX(-50%);
    background: var(--psn-text); color: #fff;
    padding: 11px 22px; border-radius: 22px;
    font-size: 13px; z-index: 99999;
    animation: psn-toast-in .25s ease;
}
@keyframes psn-toast-in { from { opacity:0; transform:translateX(-50%) translateY(8px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* ================================================================ */
/*  10. BADGES Y PILLS                                             */
/* ================================================================ */
.psn-badge       { display:inline-flex; align-items:center; gap:3px; padding:3px 9px; border-radius:18px; font-size:11px; font-weight:500; background:var(--psn-surface); color:var(--psn-text-muted); }
.psn-badge-level { background:var(--psn-primary-light); color:var(--psn-primary); }
.psn-badge-type  { background:#f0f0f0; }

.psn-level-badge { font-size:10px; font-weight:700; padding:2px 7px; border-radius:5px; }
.psn-level-badge.level-a1 { background:#dcfce7; color:#166534; }
.psn-level-badge.level-a2 { background:#fef9c3; color:#a16207; }
.psn-level-badge.level-b1 { background:var(--psn-primary-light); color:var(--psn-primary); }
.psn-level-badge.level-b2 { background:#f3e8ff; color:#7c3aed; }
.psn-level-badge.level-c1 { background:#fee2e2; color:#dc2626; }

/* ================================================================ */
/*  11. MODAL GENÉRICO                                             */
/* ================================================================ */
.psn-modal         { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,.4); display:flex; align-items:center; justify-content:center; z-index:9999; padding:20px; }
.psn-modal-content { background:#fff; border-radius:var(--psn-radius); max-width:500px; width:100%; max-height:80vh; overflow-y:auto; }
.psn-modal-header  { display:flex; justify-content:space-between; align-items:center; padding:18px 22px 0; }
.psn-modal-header h2 { margin:0; font-size:18px; }
.psn-modal-close   { background:none; border:none; font-size:22px; cursor:pointer; color:var(--psn-text-muted); padding:0 3px; }
.psn-modal-body    { padding:18px 22px; }
.psn-modal-footer  { padding:14px 22px; border-top:0.5px solid var(--psn-border-light); display:flex; gap:8px; justify-content:flex-end; }

/* ================================================================ */
/*  12. AUTH PAGES                                                 */
/* ================================================================ */
.psn-auth-page     { min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:24px 16px; background:var(--psn-bg); }
.psn-auth-box      { width:100%; max-width:400px; background:#fff; border-radius:var(--psn-radius); padding:28px 22px; border:0.5px solid var(--psn-border); }
.psn-auth-title    { font-size:20px; font-weight:700; text-align:center; margin:0 0 3px; }
.psn-auth-subtitle { font-size:13px; color:var(--psn-text-muted); text-align:center; margin:0 0 20px; }
.psn-auth-field    { margin-bottom:12px; }
.psn-auth-field label { display:block; font-size:12px; font-weight:600; margin-bottom:3px; }
.psn-auth-btn      { width:100%; padding:12px; border-radius:var(--psn-radius-sm); font-size:14px; font-weight:600; cursor:pointer; border:none; background:var(--psn-primary); color:#fff; transition:all .18s; }
.psn-auth-btn:hover { background:var(--psn-primary-dark); }
.psn-auth-link     { text-align:center; margin-top:12px; font-size:13px; color:var(--psn-text-muted); }
.psn-auth-link a   { color:var(--psn-primary); font-weight:500; }
.psn-auth-divider  { height:0.5px; background:var(--psn-border); margin:14px 0; }
.psn-auth-error    { background:#FEF2F2; color:var(--psn-danger); border:0.5px solid #FECACA; border-radius:8px; padding:9px 13px; font-size:12px; margin-bottom:12px; display:none; }

/* ================================================================ */
/*  13. DASHBOARD — Rediseño v2                                    */
/* ================================================================ */

/* Contenedor principal */
.psn-dashboard { max-width: 640px; margin: 0 auto; padding: 0 0 40px; }
.psn-dash-container { width: 100%; }

/* --- Hero azul plano (sin degradado) --- */
.psn-dash-header {
    background: var(--psn-primary);
    color: #fff;
    padding: 18px 16px 16px;
    /* Sin border-radius: fluye desde el header global */
}
.psn-dash-greeting-text {
    display: block;
    font-size: 12px;
    opacity: .8;
    margin-bottom: 1px;
}
.psn-dash-name {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px;
    color: #fff;
    line-height: 1.2;
}
/* Pills de nivel y objetivo dentro del hero */
.psn-dash-hero-pills { display: flex; gap: 7px; flex-wrap: wrap; }
.psn-dash-hero-pill {
    background: var(--psn-primary-dark);
    border: 0.5px solid rgba(255,255,255,.25);
    border-radius: 14px;
    padding: 3px 11px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

/* --- Card progreso (blanca, borde suave) --- */
.psn-dash-progress-card {
    background: #fff;
    border: 0.5px solid var(--psn-border);
    border-radius: var(--psn-radius);
    padding: 13px 15px;
    margin: 13px 14px 0;
}
.psn-dash-progress-label { font-size: 11px; color: var(--psn-text-muted); margin-bottom: 6px; }

/* --- Barra de progreso — azul plano --- */
.psn-dash-progress-bar { height: 5px; background: var(--psn-primary-light); border-radius: 3px; margin-bottom: 5px; overflow: hidden; }
.psn-dash-progress-fill { height: 100%; background: var(--psn-primary); border-radius: 3px; transition: width .5s; }
.psn-dash-progress-row  { display: flex; justify-content: space-between; font-size: 10px; color: var(--psn-text-muted); }

/* --- Roadmap horizontal de semanas --- */
.psn-dash-roadmap { display: flex; gap: 5px; margin: 10px 14px; }
.psn-dash-rm-step {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    border-radius: 10px;
    border: 0.5px solid var(--psn-border);
    background: var(--psn-surface);
    cursor: default;
    transition: background .15s, border-color .15s;
}
.psn-dash-rm-step.active {
    background: var(--psn-primary-light);
    border-color: var(--psn-primary);
    border-width: 1.5px;
}
/* Número S1/S2/S3/S4 — tamaño base 12px */
.psn-dash-rm-num   { font-size: 13px; color: var(--psn-text-muted); margin-bottom: 3px; font-weight: 700; }
.psn-dash-rm-step.active .psn-dash-rm-num { color: var(--psn-primary); }
/* Etiqueta — tamaño base 12px */
.psn-dash-rm-label { font-size: 12px; font-weight: 700; color: var(--psn-text-secondary); line-height: 1.3; min-font-size: 12px; }
.psn-dash-rm-step.active .psn-dash-rm-label { color: var(--psn-primary); }

/* --- Card "Clase de hoy" --- */
.psn-dash-clase-card {
    margin: 10px 14px;
    background: #fff;
    border: 1.5px solid var(--psn-primary);
    border-radius: var(--psn-radius);
    padding: 14px;
}
.psn-dash-clase-tag   { font-size: 10px; font-weight: 700; color: var(--psn-primary); letter-spacing: .4px; margin-bottom: 4px; }
.psn-dash-clase-title { font-size: 17px; font-weight: 700; color: var(--psn-text); margin-bottom: 3px; }
.psn-dash-clase-meta  { font-size: 11px; color: var(--psn-text-muted); margin-bottom: 10px; }

/* Botón CTA con ícono play SVG blanco visible */
.psn-dash-clase-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: var(--psn-primary);
    color: #fff;
    padding: 12px;
    border-radius: var(--psn-radius-sm);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none !important;
    transition: background .18s;
}
.psn-dash-clase-btn:hover { background: var(--psn-primary-dark); color: #fff; }
/* Círculo blanco con triángulo azul */
.psn-dash-play-circle {
    width: 24px; height: 24px;
    background: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.psn-dash-play-circle svg { display: block; }

/* --- Stats row --- */
.psn-dash-stats { display: flex; gap: 6px; margin: 0 14px 11px; }
.psn-dash-stat-card {
    flex: 1;
    background: var(--psn-surface);
    border: 0.5px solid var(--psn-border);
    border-radius: var(--psn-radius-xs);
    padding: 9px 6px;
    text-align: center;
}
.psn-stat-number { display: block; font-size: 13px; font-weight: 700; color: var(--psn-text); line-height: 1.3; }
.psn-stat-label  { font-size: 9px; color: var(--psn-text-muted); display: block; margin-top: 1px; }

/* --- Logros en dashboard (reemplaza las cards repetidas del menú) --- */
.psn-dash-logros { margin: 0 14px 14px; }
.psn-dash-logros-title { font-size: 11px; font-weight: 600; color: var(--psn-text-muted); margin-bottom: 8px; }
.psn-dash-logros-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.psn-dash-logro {
    background: var(--psn-surface);
    border: 0.5px solid var(--psn-border);
    border-radius: 10px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.psn-dash-logro.done {
    background: var(--psn-success-bg);
    border-color: var(--psn-success-border);
}
.psn-dash-logro-icon  { font-size: 18px; flex-shrink: 0; }
.psn-dash-logro-name  { font-size: 10px; font-weight: 600; color: var(--psn-text); line-height: 1.2; }
.psn-dash-logro-state { font-size: 9px; color: var(--psn-text-muted); margin-top: 1px; }
.psn-dash-logro.done .psn-dash-logro-state { color: var(--psn-success); }

/* Botón cerrar sesión en dashboard */
.psn-dash-logout {
    display: block;
    text-align: center;
    margin: 0 14px 14px;
    padding: 11px;
    border: 0.5px solid var(--psn-danger-border);
    border-radius: var(--psn-radius-sm);
    background: var(--psn-danger-bg);
    color: var(--psn-danger);
    font-weight: 600;
    font-size: 13px;
}

/* ================================================================ */
/*  14. MI PLAN — Rediseño v2                                      */
/* ================================================================ */
.psn-plan-page { max-width: 640px; margin: 0 auto; }
.psn-plan-container { padding: 0 0 20px; }

/* Cabecera simple del plan */
.psn-plan-header { padding: 13px 15px 0; }
.psn-plan-title  { font-size: 18px; font-weight: 700; color: var(--psn-text); margin: 0 0 2px; }
.psn-plan-meta   { font-size: 11px; color: var(--psn-text-muted); }

/* --- CTA "Clase de hoy" VA PRIMERO en el plan --- */
.psn-plan-cta-top {
    margin: 12px 14px 0;
    background: var(--psn-primary);  /* azul plano */
    border-radius: var(--psn-radius);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.psn-plan-cta-body  { flex: 1; }
.psn-plan-cta-tag   { font-size: 9px; font-weight: 700; color: rgba(255,255,255,.8); letter-spacing: .5px; margin-bottom: 3px; text-transform: uppercase; }
.psn-plan-cta-title { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 3px; }
.psn-plan-cta-meta  { font-size: 11px; color: rgba(255,255,255,.75); }

/* Botón play circular blanco dentro del CTA */
.psn-plan-cta-play {
    width: 44px; height: 44px;
    background: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    text-decoration: none !important;
    transition: opacity .18s;
}
.psn-plan-cta-play:hover { opacity: .88; }
.psn-plan-cta-play svg { display: block; }

/* Progreso del plan */
.psn-plan-prog {
    padding: 10px 15px;
    background: var(--psn-primary-light);
    border-top: 0.5px solid #dde8ff;
    border-bottom: 0.5px solid #dde8ff;
    margin-top: 11px;
}
.psn-plan-prog-row { display: flex; justify-content: space-between; font-size: 10px; color: var(--psn-primary); margin-bottom: 5px; font-weight: 600; }
.psn-plan-prog-bar  { height: 5px; background: #c7d7fa; border-radius: 3px; overflow: hidden; }
.psn-plan-prog-fill { height: 100%; background: var(--psn-primary); border-radius: 3px; }
.psn-plan-prog-hint { font-size: 10px; color: var(--psn-text-muted); margin-top: 4px; }

/* Semanas */
.psn-plan-weeks { padding: 10px 14px; display: flex; flex-direction: column; gap: 7px; }
.psn-week-card  { border: 0.5px solid var(--psn-border); border-radius: var(--psn-radius); overflow: hidden; background: #fff; }
.psn-week-card.current { border-color: var(--psn-primary); }

.psn-week-header { display: flex; align-items: center; gap: 9px; padding: 11px 13px; background: #fff; cursor: pointer; }
.psn-week-header.current { background: var(--psn-primary-light); }
.psn-week-icon  { font-size: 18px; }
.psn-week-info  { flex: 1; }
.psn-week-title { font-size: 12px; font-weight: 600; color: var(--psn-text); }
.psn-week-sub   { font-size: 10px; color: var(--psn-text-muted); }

/* Badge de semana */
.psn-week-badge { font-size: 9px; padding: 2px 7px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.psn-week-badge.active   { background: var(--psn-primary-light); color: var(--psn-primary); }
.psn-week-badge.done     { background: var(--psn-success-bg); color: var(--psn-success); }
.psn-week-badge.locked   { background: #f0f0f0; color: var(--psn-text-muted); }

/* Toggle de semana */
.psn-week-toggle { font-size: 12px; color: var(--psn-text-muted); transition: transform .2s; }
.psn-week-card.open .psn-week-toggle { transform: rotate(180deg); }

/* Lista de días — oculto por defecto, visible con clase .week-days-open */
.psn-week-days { padding: 0 13px 11px; display: none; flex-direction: column; gap: 5px; }
.psn-week-days.week-days-open { display: flex !important; flex-direction: column !important; }
.psn-plan-day  { display: flex; align-items: center; gap: 9px; padding: 9px 11px; background: var(--psn-surface); border-radius: 9px; border: 0.5px solid transparent; }
.psn-plan-day.day-today   { background: #fff; border-color: var(--psn-primary); }
.psn-plan-day.day-done    { background: var(--psn-success-bg); }
.psn-plan-day.day-locked  { opacity: .55; }

.psn-day-icon { font-size: 13px; width: 22px; text-align: center; }
.psn-day-body { flex: 1; }
.psn-day-title { font-size: 12px; font-weight: 600; color: var(--psn-text); }
.psn-day-meta  { font-size: 10px; color: var(--psn-text-muted); }

/* El botón play del día: azul plano, triángulo blanco */
.psn-day-btn {
    width: 30px !important; height: 30px !important;
    padding: 0 !important;
    background: var(--psn-primary) !important;
    border-radius: var(--psn-radius-xs) !important;
    border: none !important;
    color: transparent !important;
    font-size: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    text-decoration: none !important;
    cursor: pointer;
}
.psn-day-btn::after {
    content: '';
    display: block;
    width: 0; height: 0;
    border-style: solid;
    border-width: 5px 0 5px 9px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 2px;
}

/* Puntaje día completado */
.psn-day-score { font-size: 11px; font-weight: 700; color: var(--psn-success); }
.psn-day-lock  { font-size: 13px; }

/* Card "próximo objetivo" al final del plan */
.psn-plan-next {
    margin: 0 14px 14px;
    background: var(--psn-primary-light);
    border: 0.5px solid var(--psn-primary-mid);
    border-radius: var(--psn-radius);
    padding: 14px;
}
.psn-next-label  { font-size: 10px; font-weight: 700; color: var(--psn-primary); letter-spacing: .4px; margin-bottom: 3px; }
.psn-next-title  { font-size: 15px; font-weight: 700; color: var(--psn-text); margin-bottom: 3px; }
.psn-next-meta   { font-size: 11px; color: var(--psn-text-muted); margin-bottom: 11px; }
/* .psn-next-btn ya definido arriba */

/* Barra de progreso de semana en el plan */
.psn-week-progress      { display: flex; align-items: center; gap: 9px; padding: 0 13px 10px; }
.psn-week-progress-bar  { flex: 1; height: 4px; background: var(--psn-primary-light); border-radius: 2px; overflow: hidden; }
.psn-week-progress-fill { height: 100%; background: var(--psn-primary); border-radius: 2px; }
.psn-week-days-count    { font-size: 10px; color: var(--psn-text-muted); white-space: nowrap; }

/* ================================================================ */
/*  15. BIBLIOTECA — Rediseño v2 Netflix                           */
/* ================================================================ */
.psn-library { max-width: 1100px; margin: 0 auto; padding: 0 0 40px; }

/* Hero azul plano sin imagen */
.psn-lib-hero {
    background: var(--psn-primary);
    padding: 16px 15px 14px;
    color: #fff;
}
.psn-lib-hero-title { font-size: 20px; font-weight: 700; color: #fff; margin: 0 0 2px; }
.psn-lib-hero-desc  { font-size: 11px; color: rgba(255,255,255,.78); margin: 0; }

/* Barra búsqueda + botón generar */
.psn-lib-search-row {
    display: flex; gap: 8px;
    padding: 11px 14px;
    border-bottom: 0.5px solid var(--psn-border-light);
    background: #fff;
}
.psn-lib-search-input {
    flex: 1;
    border: 0.5px solid var(--psn-border);
    border-radius: 18px;
    padding: 8px 13px;
    font-size: 13px;
    background: var(--psn-surface);
    color: var(--psn-text);
}
.psn-lib-search-input:focus { border-color: var(--psn-primary); outline: none; }

/* Botón generar */
.psn-lib-generate-btn {
    background: var(--psn-primary);
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s;
}
.psn-lib-generate-btn:hover { background: var(--psn-primary-dark); }

/* Cabecera de sección */
.psn-lib-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 14px 9px;
}
.psn-lib-section-title { font-size: 14px; font-weight: 700; color: var(--psn-text); }
.psn-lib-section-sub   { font-size: 10px; color: var(--psn-text-muted); }

/* --- Card "Recomendado" horizontal --- */
.psn-lib-reco-card {
    margin: 0 14px 14px;
    background: #fff;
    border: 0.5px solid var(--psn-border);
    border-radius: var(--psn-radius);
    overflow: hidden;
    display: flex;
    text-decoration: none !important;
    transition: border-color .18s;
}
.psn-lib-reco-card:hover { border-color: var(--psn-primary); }
.psn-lib-reco-img {
    width: 100px;
    min-height: 95px;
    flex-shrink: 0;
    object-fit: cover;
    display: block;
    background: var(--psn-primary-light);
}
.psn-lib-reco-body   { padding: 11px; flex: 1; }
.psn-lib-reco-badge  { font-size: 9px; font-weight: 700; color: var(--psn-primary); background: var(--psn-primary-light); padding: 2px 7px; border-radius: 5px; display: inline-block; margin-bottom: 5px; }
.psn-lib-reco-title  { font-size: 13px; font-weight: 700; color: var(--psn-text); margin-bottom: 3px; }
.psn-lib-reco-meta   { font-size: 10px; color: var(--psn-text-muted); }
.psn-lib-reco-tags   { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.psn-lib-reco-tag    { font-size: 9px; background: #f0f0f0; color: var(--psn-text-secondary); padding: 2px 6px; border-radius: 5px; }

/* --- Cards Netflix — scroll horizontal con imagen real --- */
/* Scroll wrapper */
.psn-lib-netflix-scroll {
    display: flex;
    gap: 10px;
    padding: 4px 14px 14px;
    overflow-x: auto;
    /* quitar scrollbar visual en webkit */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.psn-lib-netflix-scroll::-webkit-scrollbar { display: none; }

/* Card individual Netflix */
.psn-lib-nf-card {
    flex-shrink: 0;
    width: 110px;
    border-radius: 12px;
    overflow: hidden;
    border: none;                      /* sin borde — el overflow:hidden cubre la imagen */
    background: var(--psn-primary);    /* azul visible solo si imagen no carga */
    cursor: pointer;
    transition: transform .2s;
    text-decoration: none !important;
    display: block;
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
    box-shadow: 0 0 0 0.5px var(--psn-border);  /* sombra en lugar de border, no afecta overflow */
}
.psn-lib-nf-card:hover { transform: translateY(-4px); outline-color: var(--psn-primary); outline-width: 1.5px; }

/* Imagen de categoría: alta y con overlay oscuro para legibilidad */
.psn-lib-nf-img {
    width: 100%;               /* siempre 100% del contenedor */
    height: 130px;
    object-fit: cover;
    display: block;
    position: relative;
}
/* Overlay semitransparente para que el icono y texto se lean bien */
.psn-lib-nf-img-wrap {
    position: relative;
    width: 100%;                   /* ocupa el 100% de la card, no valor fijo */
    height: 130px;
    overflow: hidden;
    display: block;
    line-height: 0;
}
.psn-lib-nf-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    margin: 0; padding: 0;
    border: none;                  /* imagen sin borde propio */
}
/* Overlay oscuro en la mitad inferior (sin degradado CSS, solo rgba plano) */
.psn-lib-nf-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 20, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.psn-lib-nf-icon { font-size: 30px; pointer-events: none; }

/* Etiqueta debajo de la imagen */
.psn-lib-nf-label {
    padding: 6px 8px;
    background: #fff;
    font-size: 10px;
    font-weight: 600;
    color: var(--psn-text);
    text-align: center;
    /* sin border-top — la imagen encima ya da separación visual */
    line-height: 1.3;
}

/* Chips de filtro de la biblioteca */
.psn-lib-chips      { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 14px 12px; }
.psn-lib-chip       { padding: 7px 16px; border: 1.5px solid var(--psn-primary); border-radius: 18px; background: #fff; color: var(--psn-primary); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .18s; }
.psn-lib-chip:hover { border-color: var(--psn-primary); background: var(--psn-primary-light); }
.psn-lib-chip.active { background: var(--psn-primary); color: #fff; border-color: var(--psn-primary); }

/* Grid de contenidos de la biblioteca */
.psn-lib-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; padding: 0 14px; }
@media (min-width:600px)  { .psn-lib-grid { grid-template-columns: repeat(3,1fr); } }
@media (min-width:900px)  { .psn-lib-grid { grid-template-columns: repeat(4,1fr); } }

/* Card de contenido (grid) */
.psn-lib-card { display: block; background: #fff; border: 0.5px solid var(--psn-border); border-radius: var(--psn-radius); overflow: hidden; text-decoration: none !important; transition: transform .2s, border-color .2s; }
.psn-lib-card:hover { transform: translateY(-3px); border-color: var(--psn-primary); }
.psn-card-cover     { width: 100%; aspect-ratio: 16/10; overflow: hidden; background: var(--psn-primary-light); display: flex; align-items: center; justify-content: center; }
.psn-card-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.psn-card-body      { padding: 11px; display: flex; flex-direction: column; gap: 5px; }
.psn-card-badges    { display: flex; gap: 5px; flex-wrap: wrap; min-height: 20px; }
.psn-card-badge-new  { font-size: 10px; background: var(--psn-primary-light); color: var(--psn-primary); padding: 2px 7px; border-radius: 7px; font-weight: 600; }
.psn-card-badge-plan { font-size: 10px; background: var(--psn-primary-light); color: var(--psn-primary); padding: 2px 7px; border-radius: 7px; font-weight: 600; }
.psn-card-title     { font-size: 13px; font-weight: 600; margin: 0; color: var(--psn-text); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.psn-card-meta      { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--psn-text-muted); }
.psn-card-level     { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; }
.psn-card-level.level-a1 { background: #dcfce7; color: #166534; }
.psn-card-level.level-a2 { background: #fef9c3; color: #a16207; }
.psn-card-level.level-b1 { background: var(--psn-primary-light); color: var(--psn-primary); }
.psn-card-level.level-b2 { background: #f3e8ff; color: #7c3aed; }
.psn-card-level.level-c1 { background: #fee2e2; color: #dc2626; }

/* Modal de la biblioteca */
.psn-lib-modal         { position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.4);z-index:99999;display:flex;align-items:center;justify-content:center;padding:20px; }
.psn-lib-modal-content { background:#fff;border-radius:var(--psn-radius);max-width:440px;width:100%; }
.psn-lib-modal-header  { display:flex;justify-content:space-between;align-items:center;padding:18px 22px 0; }
.psn-lib-modal-header h2 { margin:0;font-size:17px; }
.psn-lib-modal-close   { background:none;border:none;font-size:19px;cursor:pointer;color:var(--psn-text-muted); }
.psn-lib-modal-body    { padding:14px 22px; }
.psn-lib-modal-footer  { padding:14px 22px 22px;display:flex;gap:8px;justify-content:flex-end; }
.psn-lib-field         { margin-bottom:12px; }
.psn-lib-field label   { display:block;font-size:12px;font-weight:600;margin-bottom:3px;color:var(--psn-text); }
.psn-lib-field select,
.psn-lib-field input   { width:100%;padding:9px 12px;border:0.5px solid var(--psn-border);border-radius:18px;font-size:13px;box-sizing:border-box; }
.psn-lib-field select:focus,
.psn-lib-field input:focus { border-color:var(--psn-primary);outline:none; }
.psn-lib-modal-btn     { padding:9px 18px;border-radius:18px;border:0.5px solid var(--psn-border);background:#fff;cursor:pointer;font-size:13px;font-weight:600; }
.psn-lib-modal-btn.primary { background:var(--psn-primary);color:#fff;border-color:var(--psn-primary); }

/* Skeleton loader biblioteca */
.psn-lib-skeleton      { padding: 14px; }
.psn-skel-hero         { height:140px;background:#eef2ff;border-radius:var(--psn-radius);margin-bottom:20px;animation:psnShimmer 1.5s infinite; }
.psn-skel-row          { margin-bottom:20px; }
.psn-skel-title        { height:16px;width:160px;background:#eef2ff;border-radius:6px;margin-bottom:10px;animation:psnShimmer 1.5s infinite; }
.psn-skel-cards        { display:flex;gap:8px; }
.psn-skel-cards span   { height:160px;flex:0 0 110px;background:#eef2ff;border-radius:10px;animation:psnShimmer 1.5s infinite; }
@keyframes psnShimmer  { 0%{opacity:1}50%{opacity:.6}100%{opacity:1} }

/* ================================================================ */
/*  16. VOCABULARIO — Rediseño v2                                  */
/* ================================================================ */
.psn-vocab-hero {
    background: var(--psn-primary);
    padding: 16px 15px 14px;
    color: #fff;
}
.psn-vocab-hero-title { font-size: 18px; font-weight: 700; color: #fff; margin: 0 0 10px; }
.psn-vocab-stats      { display: flex; gap: 6px; }
.psn-vocab-stat       { flex: 1; background: var(--psn-primary-dark); border-radius: 10px; padding: 8px 6px; text-align: center; }
.psn-vocab-stat-n     { font-size: 17px; font-weight: 700; color: #fff; }
.psn-vocab-stat-l     { font-size: 9px; color: rgba(255,255,255,.75); margin-top: 1px; }

/* Filtros de vocabulario */
.psn-vocab-filters { display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; -ms-overflow-style:none; scrollbar-width:none; }
.psn-vocab-filters::-webkit-scrollbar { display: none; }
.psn-vf { padding: 5px 13px; border-radius: 16px; border: 1.5px solid var(--psn-primary); font-size: 11px; font-weight: 600; color: var(--psn-primary); background: #fff; white-space: nowrap; cursor: pointer; transition: all .15s; }
.psn-vf:hover { border-color: var(--psn-primary); color: var(--psn-primary); }
.psn-vf.active { background: var(--psn-primary); color: #fff; border-color: var(--psn-primary); }

/* Buscador de vocabulario */
.psn-vocab-search { margin: 0 14px 10px; }
.psn-vocab-search-input { width: 100%; border: 0.5px solid var(--psn-border); border-radius: 10px; padding: 8px 13px; font-size: 13px; background: var(--psn-surface); }
.psn-vocab-search-input:focus { border-color: var(--psn-primary); outline: none; }

/* Lista de palabras */
.psn-vocab-list { padding: 0 14px; }
.psn-vocab-word { padding: 11px 0; border-bottom: 0.5px solid var(--psn-border-light); display: flex; align-items: flex-start; gap: 10px; }
.psn-vw-info    { flex: 1; min-width: 0; }
.psn-vw-word    { font-size: 15px; font-weight: 700; color: var(--psn-text); }
.psn-vw-def     { font-size: 11px; color: var(--psn-text-secondary); line-height: 1.4; margin: 2px 0; }
.psn-vw-es      { font-size: 11px; color: var(--psn-primary); }
.psn-vw-badge   { font-size: 9px; padding: 2px 7px; border-radius: 6px; background: #fff3e0; color: #e65100; font-weight: 600; margin-top: 3px; display: inline-block; }
.psn-vw-badge.learned { background: var(--psn-success-bg); color: var(--psn-success); }

/* Acciones de cada palabra */
.psn-vw-actions { display: flex; gap: 5px; align-items: center; flex-shrink: 0; }
.psn-vw-action  { width: 26px; height: 26px; border-radius: 6px; background: #f0f0f0; border: 0.5px solid var(--psn-border); display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer; transition: background .15s; }
.psn-vw-action:hover  { background: var(--psn-primary-light); }
.psn-vw-action.ok     { background: var(--psn-success-bg); border-color: var(--psn-success-border); color: var(--psn-success); }
.psn-vw-action.del    { background: var(--psn-danger-bg); border-color: var(--psn-danger-border); color: var(--psn-danger); }

/* ================================================================ */
/*  17. PERFIL — Rediseño v2                                       */
/* ================================================================ */
.psn-profile-page { max-width: 640px; margin: 0 auto; }

/* Hero azul plano */
.psn-profile-hero {
    background: var(--psn-primary);
    padding: 16px 15px;
    display: flex;
    align-items: center;
    gap: 13px;
}
.psn-profile-avatar {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: var(--psn-primary-dark);
    border: 2px solid rgba(255,255,255,.3);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 20px; font-weight: 700;
    flex-shrink: 0;
}
.psn-profile-info   { flex: 1; }
.psn-profile-name   { font-size: 17px; font-weight: 700; color: #fff; margin: 0 0 1px; }
.psn-profile-email  { font-size: 10px; color: rgba(255,255,255,.75); margin: 0 0 5px; }
.psn-profile-pills  { display: flex; gap: 5px; }
.psn-profile-pill   { background: var(--psn-primary-dark); border: 0.5px solid rgba(255,255,255,.25); border-radius: 10px; padding: 2px 8px; font-size: 10px; color: #fff; font-weight: 600; }

/* Stats row del perfil */
.psn-profile-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--psn-primary-light);
    border-bottom: 0.5px solid #dde8ff;
    width: 100%;
    overflow: hidden;
}
.psn-profile-stat  {
    text-align: center;
    padding: 10px 2px;
    border-right: 0.5px solid #dde8ff;
    min-width: 0;
    overflow: hidden;
}
.psn-profile-stat:last-child { border-right: none; }
.psn-profile-stat-n {
    font-size: 13px;               /* un poco más pequeño para que quepan 5 */
    font-weight: 700;
    color: var(--psn-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.psn-profile-stat-l {
    font-size: 8px;
    color: var(--psn-text-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Secciones del perfil */
.psn-profile-section  { margin: 11px 14px 0; }
.psn-profile-section-h { font-size: 11px; font-weight: 600; color: var(--psn-text-muted); margin-bottom: 7px; }

/* Filas de info */
.psn-profile-rows   { background: #fff; border: 0.5px solid var(--psn-border); border-radius: var(--psn-radius); overflow: hidden; }
.psn-profile-row    { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 0.5px solid var(--psn-border-light); }
.psn-profile-row:last-child { border-bottom: none; }
.psn-profile-row-l  { font-size: 12px; color: var(--psn-text-secondary); }
.psn-profile-row-v  { font-size: 12px; font-weight: 600; color: var(--psn-text); }

/* Grid de logros en perfil */
.psn-profile-logros { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 8px 14px 12px; }
.psn-profile-logro  { background: var(--psn-surface); border: 0.5px solid var(--psn-border); border-radius: 10px; padding: 10px; text-align: center; }
.psn-profile-logro.done { background: var(--psn-success-bg); border-color: var(--psn-success-border); }
.psn-pl-icon  { font-size: 20px; margin-bottom: 4px; }
.psn-pl-name  { font-size: 10px; font-weight: 600; color: var(--psn-text); line-height: 1.2; }
.psn-pl-state { font-size: 9px; color: var(--psn-text-muted); margin-top: 2px; }
.psn-profile-logro.done .psn-pl-state { color: var(--psn-success); }

/* Botones de acción del perfil */
.psn-profile-btns  { margin: 0 14px 14px; display: flex; flex-direction: column; gap: 7px; }
.psn-profile-btn   { padding: 11px; border-radius: var(--psn-radius-sm); border: 0.5px solid var(--psn-border); background: #fff; text-align: center; font-size: 13px; font-weight: 600; color: var(--psn-text); cursor: pointer; transition: background .15s; }
.psn-profile-btn:hover { background: var(--psn-primary-light); border-color: var(--psn-primary); color: var(--psn-primary); }
.psn-profile-btn.danger { color: var(--psn-danger); border-color: var(--psn-danger-border); background: var(--psn-danger-bg); }
.psn-profile-btn.danger:hover { background: #ffe0e0; }

/* ================================================================ */
/*  18. READER — Solo estilo del header de categoría               */
/*  (No se toca la funcionalidad — solo se añade el hero visual)   */
/* ================================================================ */

/* Header del reader con imagen de categoría como fondo */
.psn-reader-hero {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: var(--psn-text);  /* fallback si no carga la imagen */
}
.psn-reader-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Overlay oscuro plano (sin degradado) sobre la imagen */
.psn-reader-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 20, 0.52);
}
/* Contenido sobre el overlay */
.psn-reader-hero-content {
    position: relative;
    z-index: 1;
    padding: 14px 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.psn-reader-hero-badge {
    display: inline-block;
    background: rgba(26, 86, 219, 0.55);
    border: 0.5px solid rgba(107, 141, 240, 0.7);
    color: #fff;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: .4px;
    text-transform: uppercase;
}
.psn-reader-hero-title  { font-size: 18px; font-weight: 700; color: #fff; margin: 0 0 3px; line-height: 1.2; }
.psn-reader-hero-author { font-size: 11px; color: rgba(255,255,255,.75); }

/* Barra de acciones (Lee / Escucha / Traduce) */
.psn-reader-actions-bar {
    display: flex;
    gap: 7px;
    padding: 10px 14px;
    border-bottom: 0.5px solid var(--psn-border-light);
    background: #fff;
    align-items: center;
}
.psn-reader-action-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border-radius: 18px;
    border: 0.5px solid var(--psn-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--psn-text);
    background: var(--psn-surface);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.psn-reader-action-pill:hover { border-color: var(--psn-primary); color: var(--psn-primary); background: var(--psn-primary-light); }
.psn-reader-action-pill.active { background: var(--psn-primary); color: #fff; border-color: var(--psn-primary); }
.psn-reader-time-badge { margin-left: auto; font-size: 11px; color: var(--psn-text-muted); white-space: nowrap; }

/* ================================================================ */
/*  19. PROFILE EDITOR                                             */
/* ================================================================ */
.psn-profile-editor  { max-width: 500px; margin: 0 auto; padding: 14px; }
.psn-editor-avatar   { width: 68px; height: 68px; border-radius: 50%; background: var(--psn-primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px; font-weight: 700; margin: 0 auto 14px; }
.psn-editor-field    { margin-bottom: 14px; }
.psn-editor-field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 3px; color: var(--psn-text-muted); }
.psn-editor-field input { width: 100%; padding: 9px 12px; border: 0.5px solid var(--psn-border); border-radius: 8px; font-size: 14px; }
.psn-editor-field input:focus { border-color: var(--psn-primary); outline: none; }
.psn-editor-btn  { width: 100%; padding: 12px; border-radius: var(--psn-radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; border: none; background: var(--psn-primary); color: #fff; transition: all .18s; }
.psn-editor-btn:hover { background: var(--psn-primary-dark); }
.psn-editor-back { display: block; text-align: center; margin-top: 10px; font-size: 13px; color: var(--psn-text-muted); }

/* ================================================================ */
/*  20. RESPONSIVE                                                 */
/* ================================================================ */
@media (max-width: 480px) {
    .psn-dash-name    { font-size: 19px; }
    .psn-lib-nf-card  { width: 95px; }
    .psn-lib-nf-img-wrap { width: 100%; }  /* siempre 100% de la card */
    .psn-lib-nf-img-wrap img { width: 100%; }
}
@media (min-width: 600px) {
    .psn-lib-grid { grid-template-columns: repeat(3,1fr); }
    .psn-profile-logros { grid-template-columns: repeat(3,1fr); }
}
@media (min-width: 900px) {
    .psn-lib-grid { grid-template-columns: repeat(4,1fr); }
}

/* ================================================================ */
/*  21. ADMIN                                                       */
/* ================================================================ */
.psn-admin-wrap h1   { font-size: 22px; }
.psn-provider-card h3 { display: flex; align-items: center; gap: 7px; }

/* Sin subrayados en toda la app */
a, a:hover, a:focus, a:active { text-decoration: none !important; }

/* ================================================================ */
/*  BIBLIOTECA v2 — Nuevas clases rediseño                          */
/* ================================================================ */

/* Botón generar en el hero: fondo blanco, texto negro, sin borde */
.psn-lib-gen-hero-btn {
    display: block;
    width: 100%;
    padding: 13px;
    background: #ffffff !important;
    color: #1c1c1e !important;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    border: none !important;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    z-index: 1;
}
.psn-lib-gen-hero-btn:hover { background: #ffffff !important; color: #1c1c1e !important; opacity: .92; }

/* Búsqueda compacta bajo el hero */
.psn-lib-search-compact { padding: 9px 13px; border-bottom: 0.5px solid var(--psn-border); }
.psn-lib-search-input-compact {
    width: 100%;
    border: 0.5px solid var(--psn-border);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    background: var(--psn-surface);
    font-family: inherit;
}
.psn-lib-search-input-compact:focus { border-color: var(--psn-primary); outline: none; }

/* Card recomendada v2: imagen arriba a todo el ancho */
.psn-lib-reco-v2 {
    display: block;
    margin: 0 14px 14px;
    background: #fff;
    border: 0.5px solid var(--psn-border);
    border-radius: var(--psn-radius);
    overflow: hidden;
    text-decoration: none !important;
    transition: border-color .18s;
}
.psn-lib-reco-v2:hover { border-color: var(--psn-primary); }
.psn-lib-reco-cover {
    position: relative;
    width: 100%;
    height: 130px;          /* un poco más alta para que se vea la imagen */
    background: #c7d5e8;    /* fallback suave si la imagen no carga */
    overflow: hidden;
}
.psn-lib-reco-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;      /* cubre todo el área sin dejar espacios */
    object-position: center;
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
}
.psn-lib-reco-cover-ov {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 65%);
    z-index: 1;
}
.psn-lib-reco-cover-badge {
    position: absolute;
    top: 9px;
    left: 9px;
    background: var(--psn-primary);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    letter-spacing: .4px;
    z-index: 2;
}
.psn-lib-reco-cover-time {
    position: absolute;
    bottom: 9px;
    right: 9px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 5px;
    z-index: 2;
}
.psn-lib-reco-body-v2 {
    padding: 11px 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
}
.psn-lib-reco-body-info { flex: 1; min-width: 0; }
.psn-lib-reco-play {
    width: 38px;
    height: 38px;
    background: var(--psn-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Categorías: scroll horizontal, imagen redondeada + nombre fuera */
.psn-lib-cat-scroll {
    display: flex;
    gap: 10px;
    padding: 3px 14px 16px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #c7d7fa #f0f0f0;
}
.psn-lib-cat-scroll::-webkit-scrollbar { height: 4px; }
.psn-lib-cat-scroll::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 2px; }
.psn-lib-cat-scroll::-webkit-scrollbar-thumb { background: #c7d7fa; border-radius: 2px; }

.psn-lib-cat-card {
    flex-shrink: 0;
    width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: all .2s;
    text-align: center;
}
.psn-lib-cat-card:hover { opacity: .88; transform: scale(1.03); }
.psn-lib-cat-card:active { transform: scale(0.97); }

/* Imagen con bordes redondeados — efecto Netflix */
.psn-lib-cat-img {
    width: 110px;
    height: 160px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a56db; /* fallback si la imagen no carga */
}
.psn-lib-cat-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.psn-lib-cat-ov {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.psn-lib-cat-emoji {
    font-size: 30px;
    position: relative;
    z-index: 1;
}

/* Nombre FUERA de la imagen, debajo */
.psn-lib-cat-name {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--psn-text);
    margin-top: 7px;
    text-align: center;
    width: 100%;
}

/* Chips centradas con borde azul */
.psn-lib-chips-centered { padding: 4px 14px 13px; text-align: center; }
.psn-lib-chips-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--psn-text-muted);
    margin-bottom: 9px;
    text-align: center;
    display: block;
}
/* Chips centrados con borde azul */
.psn-lib-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: center !important;
    padding: 0 !important;
}
/* Override chips con borde azul siempre */
.psn-lib-chips .psn-lib-chip {
    border: 1.5px solid var(--psn-primary) !important;
    color: var(--psn-primary) !important;
    background: #fff !important;
    font-weight: 600 !important;
}
.psn-lib-chips .psn-lib-chip:hover,
.psn-lib-chips .psn-lib-chip.active {
    background: var(--psn-primary) !important;
    color: #fff !important;
}
