/* Domina y Aplica la IA · estilos comunes (estructura de prompts.gratis con la marca de Domina) */
@font-face{font-family:Poppins;font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/poppins-400.woff2) format("woff2")}
@font-face{font-family:Poppins;font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/poppins-600.woff2) format("woff2")}
@font-face{font-family:Poppins;font-style:normal;font-weight:700;font-display:swap;src:url(../fonts/poppins-700.woff2) format("woff2")}

:root {
  --ink: #14152b; --text: #2a2c45; --muted: #555a75; --muted-2: #8a8da6;
  --primary: #5b60e6; --primary-2: #858aff; --primary-dark: #4b50d1; --violet: #a78bfa;
  --soft: #efeffe; --soft-2: #f6f6fd; --bg: #f7f7fc; --surface: #fff; --border: #e3e4f2; --border-2: #ebebf5;
  --yellow: #ffd23f; --yellow-2: #ffdc5e; --yellow-ink: #14152b; --yellow-soft: #fff3c4;
  --ok: #2a9d97; /* verde azulado de casosdeuso: base de todos los verdes */ --warn: #b7791f; --bad: #c4413b;
  --grad: linear-gradient(135deg, #5b60e6 0%, #6b70ee 45%, #858aff 100%);
  --grad-soft: linear-gradient(135deg, #a78bfa, #858aff 50%, #5b60e6);
  --shadow: 0 1px 2px rgba(20,21,43,.04), 0 6px 18px rgba(20,21,43,.06);
  --drop: drop-shadow(0 1px 1px rgba(20,21,43,.05)) drop-shadow(0 6px 10px rgba(20,21,43,.06)); /* --shadow como filtro: para piezas que juntas forman una tarjeta */
  --shadow-lg: 0 18px 44px -14px rgba(91,96,230,.35);
  --radius: 22px; --radius-sm: 14px; --sb: 300px;
  --font: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}
html.sb-collapsed { --sb: 76px; }

/* ---------- Base ---------- */
*,::before,::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.65; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1,h2,h3,h4 { color: var(--ink); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img, svg, video { max-width: 100%; height: auto; }
img { border-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; }
.skip-link:focus { left: 12px; color: #fff; }
mark { background: none; color: inherit; }
::selection { background: var(--yellow-soft); color: var(--ink); }

/* ---------- Estructura ---------- */
.app { margin-left: var(--sb); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .2s ease; }
main { flex: 1; min-width: 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 40px) 48px; }
.wrap-narrow { max-width: 820px; }
.wrap-full { max-width: none; padding-inline: clamp(16px, 2.2vw, 32px); }

/* ---------- Sidebar ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sb); z-index: 60; background: var(--surface); border-right: 1px solid var(--border-2); display: flex; flex-direction: column; padding: 16px 14px 14px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; transition: width .2s ease, transform .25s ease; }
.sidebar::-webkit-scrollbar { display: none; }
.admin-bar .sidebar { top: 32px; }
@media (max-width: 782px) { .admin-bar .sidebar { top: 46px; } }
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 2px 0 14px 8px; }
.sb-top-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.sidebar .logo-mark { display: none; } /* desplegada: solo el texto del logo; plegada: solo el icono */
.logo { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo-mark { width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--grad-soft); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 14px -6px rgba(91,96,230,.8), inset 0 1px 0 rgba(255,255,255,.3); }
.logo-mark .sparkles { width: 24px; height: 24px; }
.logo-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.logo-img { display: block; width: 182px; height: auto; } /* el logo en imagen; en modo oscuro, la versión con el texto claro */
.logo-img.is-dark, html.dark .logo-img { display: none; }
html.dark .logo-img.is-dark { display: block; }
.sidebar .logo-mark { width: 36px; height: 36px; }
.sidebar .logo { gap: 8px; }
.sb-icon, .icon-btn { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.sb-icon:hover, .icon-btn:hover { background: var(--soft); color: var(--ink); }
.sb-label { font-size: .68rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); margin: 16px 10px 6px; }
.sb-nav { list-style: none; margin: 0; padding: 0; }
.sb-nav a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 11px; color: var(--muted); font-size: .92rem; transition: background .15s, color .15s; }
.sb-nav a:hover { background: var(--soft-2); color: var(--ink); }
.sb-nav a[aria-current="page"], .sb-nav .current-menu-item > a { background: var(--soft); color: var(--ink); font-weight: 600; }
.sb-nav a[aria-current="page"] .i, .sb-nav .current-menu-item > a .i { color: var(--primary); }
.sb-nav .i { width: 20px; height: 20px; }
.sb-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-badge { font-size: .7rem; font-weight: 600; color: var(--primary); background: var(--soft); border-radius: 999px; padding: 1px 8px; }
/* Actividad reciente */
.sb-activity { margin-top: 18px; }
.sb-activity .sb-label { display: flex; align-items: center; gap: 8px; }
.sb-activity ul { list-style: none; margin: 0; padding: 0; }
.sb-activity a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 10px; color: var(--text); font-size: .86rem; }
.sb-activity a:hover { background: var(--soft-2); color: var(--ink); }
.sb-activity .heart { width: 15px; height: 15px; flex: none; color: #e5486a; }
.sb-activity .ac-done { width: 15px; height: 15px; flex: none; color: var(--ok); stroke-width: 2.6; }
.sb-activity .ac-com { width: 15px; height: 15px; flex: none; color: var(--primary); fill: currentColor; } /* bocadillo relleno, como el corazón */
.ac-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-activity time { flex: none; font-size: .74rem; color: var(--muted-2); }
.sb-cta { margin-top: auto; padding-top: 16px; }
.sb-cta-card { position: relative; border-radius: 18px; padding: 16px; background: var(--grad); color: #fff; overflow: hidden; }
.sb-cta-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 70%); }
.sb-cta-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.18); margin-bottom: 10px; }
.sb-cta-ico .sparkles { width: 20px; height: 20px; }
.sb-cta-title { font-weight: 700; margin: 0 0 4px; font-size: .98rem; }
.sb-cta-text { font-size: .8rem; opacity: .9; margin: 0 0 12px; line-height: 1.45; }
.sb-cta-login { font-size: .78rem; margin: 10px 0 0; text-align: center; opacity: .95; }
.sb-cta-login a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.sb-cta-mini { display: none; }
.sb-user { position: relative; margin-top: auto; padding-top: 14px; }
.sb-user-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border-2); border-radius: 14px; background: var(--surface); cursor: pointer; text-align: left; }
.sb-user-btn:hover { background: var(--soft-2); }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--grad-soft); color: #fff; font-weight: 700; }
.sb-user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.sb-user-info b { font-size: .88rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-info small { font-size: .74rem; color: var(--muted-2); }
.sb-user-chev { color: var(--muted-2); transition: transform .15s; }
.sb-user-btn[aria-expanded="true"] .sb-user-chev { transform: rotate(180deg); }
.sb-user-menu { position: absolute; left: 0; right: 0; bottom: calc(100% - 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-lg); }
.sb-user-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); font-size: .9rem; }
.sb-user-menu a:hover { background: var(--soft-2); }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(20,21,43,.4); backdrop-filter: blur(2px); }

/* Barra plegada (solo escritorio) */
@media (min-width: 1025px) {
  html.sb-collapsed .sidebar { padding-inline: 10px; }
  html.sb-collapsed .sb-top { flex-direction: column; gap: 10px; padding-left: 2px; }
  html.sb-collapsed .sb-top-actions { flex-direction: column; gap: 6px; }
  html.sb-collapsed .sidebar .logo-mark { display: grid; }
  html.sb-collapsed .logo-text, html.sb-collapsed .sb-text, html.sb-collapsed .sb-badge, html.sb-collapsed .sb-activity, html.sb-collapsed .sb-label,
  html.sb-collapsed .sb-cta-card, html.sb-collapsed .sb-user-info, html.sb-collapsed .sb-user-chev { display: none; }
  html.sb-collapsed .sb-nav a { justify-content: center; padding: 10px; }
  html.sb-collapsed .sb-cta-mini { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto; border-radius: 12px; background: var(--yellow); color: var(--yellow-ink); }
  html.sb-collapsed .sb-user-btn { justify-content: center; border: 0; padding: 4px; }
  html.sb-collapsed .sb-user-menu { width: 200px; right: auto; left: 0; }
}

/* Barra móvil */
.mobile-bar { display: none; }

/* Sin barra lateral (DYALIA › Permisos): la página a todo el ancho, con la barra de arriba */
.no-sb { --sb: 0px; }
html .no-sb .app, html.sb-collapsed .no-sb.has-fbar .app { margin-left: 0; }
.top-bar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 6px clamp(12px, 4vw, 40px); background: var(--surface); border-bottom: 1px solid var(--border-2); }
.admin-bar .top-bar { top: 32px; }
.top-bar .logo-img { width: 190px; max-width: 42vw; }
.top-bar nav { display: flex; align-items: center; gap: 16px; font-weight: 600; font-size: .94rem; }
.top-bar nav > a:not(.btn) { color: var(--ink); }
.top-bar nav > a.top-login { color: #4a4d5c; font-weight: 500; } /* Acceder: gris oscuro, con menos presencia que «Me apunto» */
html.dark .top-bar nav > a.top-login { color: var(--muted); }
.top-bar .btn { min-height: 38px; padding: 7px 18px; }
@media (max-width: 560px) { .top-bar .logo-img { width: 150px; } .top-bar nav { gap: 12px; } .top-bar .btn { min-height: 34px; padding: 6px 14px; font-size: .84rem; } }

/* ---------- Acceder y registro (inc/auth.php) ---------- */
.auth { display: grid; place-items: center; padding-block: clamp(28px, 6vw, 72px); }
.auth-card { width: 100%; max-width: 440px; padding: 30px 30px 26px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 26px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 14px 0 6px; font-size: clamp(1.5rem, 3vw, 1.85rem); }
.auth-intro { color: var(--muted); font-size: .92rem; }
.auth-intro > :last-child { margin-bottom: 0; }
.auth-card .notice { margin: 0 0 16px; }
.auth-form { display: grid; gap: 14px; margin-top: 20px; }
.auth-form label { display: grid; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--text); }
.auth-form input[type=text], .auth-form input[type=email], .auth-form input[type=password] { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font: 400 .95rem var(--font); color: var(--ink); }
.auth-form input:focus { outline: 0; border-color: var(--primary-2); box-shadow: 0 0 0 4px var(--soft); }
.auth-form .acc-check { font-weight: 400; display: flex; align-items: flex-start; gap: 8px; }
.auth-form .acc-check input { margin-top: 4px; }
.auth-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: .86rem; }
.auth-row a { font-weight: 500; }
.auth-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; } /* campo trampa para bots */
.auth-alt { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--border-2); text-align: center; color: var(--muted); font-size: .9rem; }
.auth-alt a { font-weight: 600; }
html.dark .auth-form input[type=text], html.dark .auth-form input[type=email], html.dark .auth-form input[type=password] { background: var(--soft-2); }

/* ---------- Botones, chips, etiquetas ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: .94rem; line-height: 1.2; cursor: pointer; text-align: center; transition: transform .15s, box-shadow .15s, background .15s, color .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-lg { min-height: 52px; padding: 13px 26px; font-size: 1rem; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .86rem; }
.btn-block { width: 100%; }
.btn-yellow { background: var(--yellow); color: var(--yellow-ink); box-shadow: 0 10px 22px -12px rgba(224,176,0,.95); }
.btn-yellow:hover { background: var(--yellow-2); color: var(--yellow-ink); box-shadow: 0 14px 26px -12px rgba(224,176,0,1); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 22px -10px rgba(91,96,230,.8); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary-2); color: var(--primary); }
.btn-glass { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.4); }
.btn-glass:hover { background: rgba(255,255,255,.24); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--soft-2); border: 1px solid var(--border-2); color: var(--text); font-size: .8rem; line-height: 1.4; }
a.chip:hover { border-color: var(--primary-2); color: var(--primary); background: #fff; }
.chip .tool-logo { width: 16px; height: 16px; }
.level { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--soft); color: var(--primary-dark); }
.level .i { width: 14px; height: 14px; }
.level-principiante { background: #e4f4f3; color: var(--ok); }
.level-intermedio { background: #fff6dc; color: var(--warn); }
.level-avanzado { background: #fdeceb; color: var(--bad); }
.tool-logo { display: inline-block; width: 20px; height: 20px; flex: none; object-fit: contain; }
.tool-ini { --s: 20px; width: var(--s); height: var(--s); border-radius: 6px; display: inline-grid; place-items: center; background: var(--soft); color: var(--primary); font-size: calc(var(--s) * .55); font-weight: 700; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); background: var(--soft); padding: 5px 12px; border-radius: 999px; }
.eyebrow .sparkles { width: 14px; height: 14px; color: var(--yellow); filter: drop-shadow(0 0 1px rgba(20,21,43,.25)); }
.hl { background: linear-gradient(transparent 62%, var(--yellow-soft) 62%, var(--yellow-soft) 92%, transparent 92%); padding: 0 2px; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: #2a9d97; box-shadow: 0 0 0 4px rgba(42, 157, 151, .2); display: inline-block; }
.link-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .92rem; }

/* ---------- Cabecera de listado ---------- */
.page-head { margin-bottom: 22px; }
.page-head h1 { display: flex; align-items: center; gap: 12px; font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin: 12px 0 6px; }
.page-head h1 .tool-logo { width: 40px; height: 40px; padding: 6px; background: #fff; border: 1px solid var(--border-2); border-radius: 12px; box-sizing: content-box; }
.page-desc { color: var(--muted); max-width: 70ch; margin: 0; }
/* Ordenar: cada botón, el icono y una palabra debajo */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 18px; }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 40px; padding: 7px 2px 6px; border-radius: 14px; color: var(--muted); font-size: .68rem; line-height: 1.1; }
.tabs a .i { width: 18px; height: 18px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="true"] { background: var(--soft); color: var(--primary); box-shadow: var(--shadow); }

/* Favoritos */
.fav { position: relative; z-index: 3; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px; border: 0; border-radius: 9px; background: none; color: var(--muted-2); font: 600 .84rem var(--font); cursor: pointer; transition: color .15s, background .15s, transform .15s; }
.fav:hover { background: #fdeef1; color: #e5486a; }
.fav[aria-pressed="false"] .heart { fill: none; }
.fav[aria-pressed="true"] { color: #e5486a; }
.fav[aria-pressed="true"] .heart { animation: dai-pop .3s ease; }
.fav .fav-n { color: var(--text); }
.fav:disabled { cursor: progress; }
@keyframes dai-pop { 50% { transform: scale(1.3); } }
.sb-lock { width: 15px; height: 15px; margin-left: auto; color: var(--muted-2); }

/* ---------- Paginación y vacío ---------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 34px 0 0; }
.pagination .page-numbers { min-width: 42px; height: 42px; display: inline-grid; place-items: center; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-2); color: var(--text); font-weight: 600; font-size: .9rem; }
.pagination .page-numbers:hover { border-color: var(--primary-2); color: var(--primary); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .dots { border: 0; background: none; }
.pagination[hidden] { display: none; }
/* Scroll infinito: aviso mientras carga y al final de la lista */
.rows-more { min-height: 1px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0; font-size: .86rem; color: var(--muted); }
.rows-more.is-loading, .rows-more.is-end { padding: 22px 0 6px; }
.rows-more.is-loading::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--soft); border-top-color: var(--primary); animation: dai-spin .7s linear infinite; }
@keyframes dai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rows-more.is-loading::before { animation-duration: 2s; } }
.empty { text-align: center; padding: 56px 20px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-ico { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--soft); color: var(--primary); }
.empty-ico .i, .empty-ico .sparkles { width: 28px; height: 28px; }
.empty-title { font-size: 1.25rem; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.empty p { color: var(--muted); }
.empty-404 { margin-top: 40px; }
.search-404 { position: relative; display: flex; align-items: center; max-width: 420px; margin: 0 auto 18px; }
.search-404 .i { position: absolute; left: 14px; color: var(--muted-2); }
.search-404 input { width: 100%; height: 48px; padding: 0 16px 0 42px; border: 1px solid var(--border); border-radius: 999px; background: var(--soft-2); }

/* ---------- Portada ---------- */
.hero { position: relative; overflow: hidden; background: var(--grad); color: #fff; padding: clamp(48px, 8vw, 96px) clamp(16px, 4vw, 48px); text-align: center; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 520px; height: 520px; left: -160px; top: -220px; background: radial-gradient(circle, rgba(167,139,250,.55), transparent 65%); }
.hero::after { width: 560px; height: 560px; right: -200px; bottom: -280px; background: radial-gradient(circle, rgba(255,210,63,.22), transparent 60%); }
.hero-in { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hero-badge .sparkles { width: 16px; height: 16px; color: var(--yellow); }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 6vw, 4.2rem); text-transform: uppercase; letter-spacing: -.03em; line-height: 1.05; margin: 22px 0 18px; }
.hero h1 mark { display: inline-block; background: var(--yellow); color: var(--yellow-ink); padding: 0 .18em; border-radius: .14em; transform: rotate(-2deg); box-shadow: 0 10px 24px -10px rgba(20,21,43,.5); }
.hero-text { font-size: clamp(1rem, 2vw, 1.18rem); max-width: 640px; margin: 0 auto 28px; opacity: .95; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero-pills { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 0; margin: 28px 0 0; }
.hero-pills li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); font-size: .88rem; }
.hero-pills .i { color: var(--yellow); }
.section { margin: 8px 0 44px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); margin: 0; }
.tool-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.tool-pill { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow); color: var(--ink); font-weight: 600; font-size: .92rem; transition: transform .15s, border-color .15s; }
.tool-pill:hover { transform: translateY(-2px); border-color: var(--primary-2); color: var(--ink); }
.tool-pill small { font-size: .74rem; color: var(--muted-2); font-weight: 500; }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.level-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow); color: var(--text); transition: transform .18s, box-shadow .18s; }
.level-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--text); }
.level-card b { font-size: 1.1rem; color: var(--ink); }
.level-card p { color: var(--muted); font-size: .9rem; margin: 0 0 6px; }
.level-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--primary); margin-bottom: 6px; }
.level-card.level-principiante .level-ico { background: #e4f4f3; color: var(--ok); }
.level-card.level-intermedio .level-ico { background: #fff6dc; color: var(--warn); }
.level-card.level-avanzado .level-ico { background: #fdeceb; color: var(--bad); }
.level-card .link-more { margin-top: auto; color: var(--primary); }
.cta-band { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: clamp(24px, 4vw, 40px); border-radius: 28px; background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(91,96,230,.6), transparent 65%); }
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; font-size: clamp(1.3rem, 2.6vw, 1.8rem); margin: 0 0 4px; }
.cta-band p { margin: 0; opacity: .8; }

/* ---------- Páginas ---------- */
.page-title { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 8px 0 22px; }
.entry { font-size: 1rem; }
.entry h2 { font-size: 1.45rem; margin: 1.8em 0 .6em; }
.entry h3 { font-size: 1.15rem; margin: 1.5em 0 .5em; }
.entry ul, .entry ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.entry li { margin: .3em 0; }
.entry img { border-radius: 14px; }
.entry figure { margin: 1.4em 0; }
.entry figcaption { font-size: .84rem; color: var(--muted-2); text-align: center; margin-top: 6px; }
.entry blockquote { margin: 1.4em 0; padding: 14px 20px; border-left: 4px solid var(--primary-2); background: var(--soft-2); border-radius: 0 14px 14px 0; }
.entry table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .92rem; }
.entry th, .entry td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.entry code { font-family: var(--mono); font-size: .88em; background: var(--soft); padding: 2px 6px; border-radius: 6px; }
.entry a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- Pie ---------- */
#site-footer { border-top: 1px solid var(--border-2); background: var(--surface); }
.footer-in { max-width: 1240px; margin: 0 auto; padding: 22px clamp(16px, 3vw, 40px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: .84rem; color: var(--muted-2); }
.footer-in p { margin: 0; }
.footer-in nav { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-in a { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  :root, html.sb-collapsed { --sb: 0px; }
  .sidebar { width: 288px; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  html.sb-open .sidebar { transform: none; }
  .sb-toggle { display: none; }
  .mobile-bar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 60px; padding: 0 10px; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border-2); }
  .mobile-bar .logo-mark { width: 34px; height: 34px; }
  .mobile-bar .logo-img { width: 190px; }
}
@media (max-width: 640px) {
  .wrap { padding-top: 22px; }
  .hero h1 { font-size: clamp(2rem, 10vw, 2.6rem); }
  .btn-lg { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Listado: columna principal (la barra de filtros va aparte, a la derecha) ---------- */
.list-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.list-main { min-width: 0; }
/* Anillo de progreso (ficha del alumno en la barra lateral y Mi cuenta) */
.me-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.me-ring circle { fill: none; stroke-width: 7; }
.me-ring .ring-bg { stroke: #fff; }
.me-ring .ring-fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .5s ease; }

/* ---------- Lista de casos: una tarjeta por caso (ver «Tarjetas de los casos») ---------- */
.rows-label { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.rows-label .sparkles, .rows-label .i-solid { width: 15px; height: 15px; flex: none; }
.rows { list-style: none; margin: 0; padding: 10px 0 0; display: grid; gap: 22px; }
/* Nivel: barras de señal de color */
.lvl { display: inline-flex; align-items: flex-end; justify-content: center; gap: 2px; width: 28px; height: 16px; }
.lvl i { display: block; width: 4px; border-radius: 2px; background: #e3e4ef; }
.lvl i:nth-child(1) { height: 6px; }
.lvl i:nth-child(2) { height: 11px; }
.lvl i:nth-child(3) { height: 16px; }
.lvl-principiante i.on { background: var(--ok); }
.lvl-intermedio i.on { background: #d97706; }
.lvl-avanzado i.on { background: #dc2626; }

/* ---------- Búsqueda en ventana (lupa / Ctrl K) ---------- */
.search-bg { position: fixed; inset: 0; z-index: 110; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(20, 21, 43, .45); backdrop-filter: blur(3px); }
.search-bg.open { display: flex; }
.admin-bar .search-bg { top: 32px; }
.search-box { width: min(100%, 720px); max-height: 76vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; }
.sx-head { display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--border-2); }
.sx-head > .i { color: var(--primary); }
.sx-head input[type=search] { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 1.05rem; color: var(--ink); }
.sx-head input::-webkit-search-cancel-button { display: none; }
.sx-close { width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.sx-close:hover { background: var(--soft-2); color: var(--ink); }
.sx-body { overflow-y: auto; padding: 6px 10px 12px; }
.sx-group { margin: 14px 12px 6px; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-2); }
.sx-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink); }
.sx-item:hover, .sx-item.active { background: var(--soft); color: var(--ink); }
button.sx-item { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; } /* al elegir un caso (soporte), los resultados son botones */
button.sx-item:hover, button.sx-item.active { background: var(--soft); }
.sx-ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--soft-2); border: 1px solid var(--border-2); font-size: .9rem; color: var(--primary); }
.sx-ico img { width: 18px; height: 18px; }
.sx-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-item small { margin-left: auto; padding-left: 12px; font-size: .78rem; color: var(--muted-2); white-space: nowrap; }
.sx-all { color: var(--primary); font-weight: 600; margin-top: 6px; }
.sx-empty { margin: 0; padding: 18px 12px 8px; color: var(--muted); }
@media (max-width: 782px) { .admin-bar .search-bg { top: 46px; } }
@media (max-width: 640px) { .search-bg { padding: 10px; } .search-box { max-height: 88vh; } }


/* ---------- Mi cuenta (/mi-cuenta/) ----------
   Arriba, la cabecera del perfil con el progreso; debajo, dos columnas: foto y contraseña */
.avatar.has-img { overflow: hidden; background: var(--soft); }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.notice { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 16px; border-radius: 14px; font-size: .92rem; font-weight: 500; }
.notice .i { width: 18px; height: 18px; flex: none; }
.notice-ok { background: #e4f4f3; color: #217f7a; }
.notice-error { background: #fdeceb; color: #b42318; }
.notice-info { background: var(--soft); color: var(--primary); }
/* ---------- Mi cuenta (/mi-cuenta/): con el diseño de Valoraciones y Ayuda. Píldoras «Perfil | Contraseña» (.val-type),
   cada apartado en una tarjeta (.val-compose) y «Tu progreso» en la barra plegable de la derecha (.fbar, has-fbar) ---------- */
.account > .notice { margin: 0 0 14px; }
.acc-tabs button { padding: 0; border: 0; border-radius: 999px; background: none; font: inherit; cursor: pointer; }
.acc-tabs span { gap: 7px; }
.acc-tabs .i { width: 15px; height: 15px; color: var(--muted-2); }
.acc-tabs button:hover span { border-color: var(--primary-2); color: var(--ink); }
.acc-tabs button[aria-selected="true"] span { background: var(--soft); border-color: var(--primary-2); color: var(--primary-dark); font-weight: 600; }
.acc-tabs button[aria-selected="true"] .i { color: var(--primary); }
.acc-tabs button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.acc-card { padding: 18px 20px; scroll-margin-top: 90px; } /* al volver a #foto o #contrasena se ve el aviso de arriba */
.acc-card[hidden] { display: none; }
.acc-card + .acc-card { margin-top: 16px; } /* sin JS se ven los dos apartados */
.acc-card .val-compose-foot { margin-top: 18px; }
.val-compose-foot.acc-foot-end { justify-content: flex-end; }
.acc-card .val-compose-foot .val-note { color: var(--muted-2); font-size: .76rem; }
/* Perfil: la foto con sus botones */
.acc-photo { display: flex; align-items: center; gap: 18px; }
.acc-photo-av { flex: none; line-height: 0; }
.acc-avatar { width: 84px; height: 84px; font-size: 2.1rem; box-shadow: 0 0 0 5px var(--soft); }
.acc-photo-txt { display: grid; gap: 4px; min-width: 0; }
.acc-photo-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 8px; }
.acc-photo-btns > .dai-err { order: 3; flex-basis: 100%; margin: 0; }
.acc-photo-btns .fb-chip { cursor: pointer; }
.acc-photo-btns .fb-chip span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-file:hover .fb-chip { border-color: var(--primary-2); color: var(--ink); }
.acc-file input:focus-visible + .fb-chip { outline: 2px solid var(--primary); outline-offset: 2px; }
.acc-file input.is-invalid + .fb-chip { border-color: #e7a9a5; }
/* Contraseña: campos en píldora (como el asunto de Ayuda) con el ojo para ver lo escrito */
.val-compose-ico.acc-ico { color: var(--primary); }
.acc-head { display: grid; gap: 2px; min-width: 0; }
.acc-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; padding-left: 50px; }
.acc-span { grid-column: 1 / -1; }
.acc-field { display: grid; gap: 6px; align-content: start; }
.acc-field-t { color: var(--text); font-size: .82rem; font-weight: 600; }
.acc-field .dai-err { margin: 0; }
.acc-pw { position: relative; display: block; }
.acc-pw input { width: 100%; min-height: 42px; padding: 0 46px 0 16px; border: 0; border-radius: 999px; background: var(--soft-2); color: var(--ink); font: 500 .95rem var(--font); transition: background .15s, box-shadow .15s; }
.acc-pw input:focus { outline: 0; background: var(--surface); box-shadow: 0 0 0 2px var(--primary-2); }
.acc-pw input.is-invalid { box-shadow: 0 0 0 2px #e7a9a5; }
.acc-eye { position: absolute; top: 50%; right: 6px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted-2); cursor: pointer; transform: translateY(-50%); }
.acc-eye:hover { background: var(--soft); color: var(--primary); }
.acc-eye .i { width: 17px; height: 17px; }
.acc-eye .i:last-child, .acc-eye[aria-pressed="true"] .i:first-child { display: none; }
.acc-eye[aria-pressed="true"] .i:last-child { display: block; }
/* Barra «Tu progreso»: quién eres, el anillo, los totales (como los enlaces de la barra lateral) y la membresía */
.acc-me { display: flex; align-items: center; gap: 12px; }
.acc-me-av { width: 48px; height: 48px; flex: none; font-size: 1.2rem; box-shadow: 0 0 0 3px var(--soft); }
.acc-me-txt { display: grid; gap: 1px; min-width: 0; }
.acc-me-txt b, .acc-me-txt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-me-txt b { color: var(--ink); font-size: .95rem; }
.acc-me-txt span { color: var(--muted); font-size: .8rem; }
.acc-me-txt small { color: var(--muted-2); font-size: .74rem; }
.acc-prog { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border-2); border-radius: 14px; background: var(--soft-2); }
.acc-prog p { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.4; }
.acc-prog p b { display: block; color: var(--ink); font-size: 1rem; }
.acc-ring { position: relative; width: 54px; height: 54px; flex: none; }
.acc-ring > b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; color: var(--ink); }
.acc-ring .me-ring .ring-bg { stroke: var(--soft); }
.acc-stats { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.acc-stats a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 11px; color: var(--muted); font-size: .9rem; transition: background .15s, color .15s; }
.acc-stats a:hover { background: var(--soft-2); color: var(--ink); }
.acc-stats .i-solid { flex: none; color: var(--primary); }
.acc-stat-t { flex: 1; min-width: 0; }
.acc-more { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-2); border-radius: 14px; background: var(--soft-2); color: var(--ink); font-weight: 600; font-size: .9rem; }
.acc-more .i { width: 18px; height: 18px; color: var(--primary); }
.acc-more .i:last-child { margin-left: auto; }
.acc-more:hover { border-color: var(--primary-2); color: var(--primary); }
@media (max-width: 640px) {
  .acc-card { padding: 16px; }
  .acc-photo { align-items: flex-start; gap: 14px; }
  .acc-avatar { width: 64px; height: 64px; font-size: 1.6rem; box-shadow: 0 0 0 4px var(--soft); }
  .acc-fields { grid-template-columns: minmax(0, 1fr); padding-left: 0; }
  .acc-card .val-compose-top { flex-wrap: nowrap; align-items: flex-start; }
}
/* Compartidos con Ayuda (adjuntar captura) y con Acceder / Registro */
.acc-hint { display: block; margin-top: 12px; color: var(--muted); font-size: .8rem; }
.acc-file { position: relative; cursor: pointer; }
.acc-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.acc-file input:focus-visible + .btn { outline: 2px solid var(--primary); outline-offset: 2px; }
.acc-file .btn span { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.acc-check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; cursor: pointer; }
.acc-link { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--muted); font: 500 .86rem var(--font); cursor: pointer; }
.acc-link:hover { color: var(--bad); }
.acc-link .i { width: 15px; height: 15px; }

/* ---------- Soporte (/soporte/): con el diseño de la página de opiniones. El tipo de consulta en píldoras (.val-type), el
   formulario y el ticket en tarjetas (.val-compose) y «Mis tickets» en la barra plegable de la derecha (.fbar, has-fbar) ---------- */
.sup > .notice { margin: 0 0 14px; }
.sup-compose .val-compose-more { gap: 10px; }
.sup-subject { flex: 1; min-width: 0; }
.sup-subject input { width: 100%; min-height: 42px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--soft-2); color: var(--ink); font: 600 .95rem var(--font); transition: background .15s, box-shadow .15s; }
.sup-subject input::placeholder { color: var(--muted); font-weight: 400; }
.sup-subject input:focus { outline: 0; background: var(--surface); box-shadow: 0 0 0 2px var(--primary-2); }
.sup-help { display: flex; align-items: center; gap: 8px; margin: 12px 4px 0; color: var(--muted-2); font-size: .8rem; }
.sup-help .i { width: 15px; height: 15px; color: var(--primary); }
/* Caso relacionado: botón discreto o el caso elegido en una píldora */
.sup-about[hidden], .sup-add-case[hidden] { display: none; }
.sup-add-case { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px dashed var(--border); border-radius: 999px; background: none; color: var(--primary); font: 600 .84rem var(--font); cursor: pointer; }
.sup-add-case small { color: var(--muted); font-weight: 400; }
.sup-add-case .i { width: 15px; height: 15px; }
.sup-add-case:hover { border-color: var(--primary-2); background: var(--soft-2); }
.sup-about { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin: 0; padding: 4px 6px 4px 14px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: .86rem; }
.sup-about > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-about b { color: var(--primary-dark); font-weight: 600; }
.sup-about .i { width: 15px; height: 15px; flex: none; color: var(--primary); }
.sup-about-x { display: grid; place-items: center; width: 28px; height: 28px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.sup-about-x:hover { background: var(--surface); color: var(--bad); }
.sup-about-x .i { width: 14px; height: 14px; color: inherit; }
.sup-compose textarea, .sup-reply textarea { width: 100%; min-height: 96px; padding: 6px 0; border: 0; background: none; color: var(--ink); font: 400 .95rem/1.6 var(--font); resize: vertical; }
.sup-reply textarea { min-height: 58px; padding-top: 9px; }
.sup-compose textarea:focus, .sup-reply textarea:focus { outline: 0; }
.sup-compose textarea::placeholder, .sup-reply textarea::placeholder { color: var(--muted-2); }
.sup-reply { flex: 1; min-width: 0; }
.sup .val-compose-foot .acc-file { margin-right: auto; }
.sup-keys { color: var(--muted-2); font-size: .76rem; }
/* El ticket abierto */
.sup-ticket { padding: 20px 22px; }
.sup-ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border-2); }
.sup-ticket-head .feed-meta { margin-bottom: 6px; }
.sup-ticket-head .feed-title { overflow-wrap: anywhere; }
.sup-case-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .86rem; font-weight: 600; }
.sup-case-link .i { width: 14px; height: 14px; }
.sup-solved { flex: none; cursor: pointer; font-family: inherit; }
.sup-solved .i { color: var(--ok); }
.sup-nav .fb-chip .i { width: 15px; height: 15px; }
.sup-thread { list-style: none; margin: 0; padding: 20px 0; display: grid; gap: 16px; }
.sup-msg { display: flex; gap: 12px; align-items: flex-start; }
.sup-av { width: 36px; height: 36px; flex: none; font-size: .9rem; }
.sup-av.is-team { background: var(--primary); color: #fff; }
.sup-av.is-team .sparkles { width: 18px; height: 18px; color: #fff; }
.sup-bubble { min-width: 0; flex: 1; padding: 12px 16px; border-radius: 4px 16px 16px 16px; background: var(--soft-2); border: 1px solid var(--border-2); }
.sup-msg.is-team .sup-bubble { background: var(--soft); border-color: transparent; }
.sup-meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0 0 4px; font-size: .84rem; }
.sup-meta b { color: var(--ink); }
.sup-meta time { margin-left: auto; color: var(--muted); font-size: .76rem; }
.sup-text { color: var(--text); font-size: .95rem; line-height: 1.6; overflow-wrap: anywhere; }
.sup-text a { text-decoration: underline; }
.sup-img { display: inline-block; margin-top: 10px; }
.sup-img img { display: block; max-width: min(100%, 360px); max-height: 260px; border-radius: 10px; border: 1px solid var(--border-2); }
.sup-answer { padding-top: 16px; border-top: 1px solid var(--border-2); }
.sup-answer .val-compose-foot { margin-top: 10px; padding-left: 50px; }
.sup-closed { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--muted); font-size: .86rem; }
.sup-closed .i { width: 16px; height: 16px; }
/* Estados */
.sup-state { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.sup-state.is-abierto { background: #fff3d6; color: #8a5a00; }
.sup-state.is-respondido { background: #e4f4f3; color: #217f7a; }
.sup-state.is-cerrado { background: var(--soft-2); color: var(--muted); border: 1px solid var(--border-2); }
/* «Mis tickets»: el abierto resaltado; con respuesta nueva, un punto violeta */
.sup-my { position: relative; }
.sup-my.is-current { background: var(--soft); border-color: var(--primary-2); }
.sup-my.is-new .val-my-t { padding-right: 16px; }
.sup-my.is-new::after { content: ""; position: absolute; top: 14px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.sup-my .val-my-t { overflow-wrap: anywhere; }
/* Respuestas del soporte sin leer: el número de la barra lateral, en violeta */
.sb-badge[data-sup-new] { background: var(--primary); color: #fff; }
@media (max-width: 640px) {
  .sup-ticket { padding: 16px; }
  .sup-ticket-head { flex-direction: column; }
  .sup-av { display: none; }
  .sup-answer .val-compose-foot { padding-left: 0; }
  .sup-keys { display: none; }
}

/* ---------- Tarjetas de los casos ----------
   Cada caso: etiqueta de estado sobre el borde, herramienta y fecha, título y resumen; en el pie, las caras, completados y
   favoritos, y el nivel; los recursos, en la columna de la derecha (en el móvil, sello en la esquina) */
.feed-item { --tc: var(--primary); position: relative; display: grid; gap: 14px; padding: 22px 24px; border: 1px solid var(--border-2); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.feed-item:hover { border-color: var(--primary-2); box-shadow: var(--shadow-lg); }
.feed-main { min-width: 0; display: grid; gap: 8px; align-content: start; }
.feed-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0; color: var(--muted-2); font-size: .82rem; }
.feed-tool { display: inline-flex; align-items: center; gap: 7px; }
.feed-tool .tool-logo { width: 18px; height: 18px; }
.feed-tool b { color: var(--tc); font-weight: 700; } /* la herramienta en su color */
.feed-mark { width: 18px; height: 18px; flex: none; background: var(--tc); -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
/* Estado: etiqueta sobre el borde de arriba de la tarjeta */
.feed-label { position: absolute; top: -10px; left: 22px; z-index: 1; display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; color: #fff; font-size: .62rem; font-weight: 700; letter-spacing: .08em; line-height: 1.5; text-transform: uppercase; white-space: nowrap; }
.feed-label .i { width: 11px; height: 11px; }
.feed-label.is-new { background: #a8457f; }
.feed-label.is-done { background: var(--ok); }
.feed-label.is-trend { background: #d9682b; }
.feed-label.is-done .i { stroke-width: 3; }
.feed-label.is-cur { background: #5b60e6; }
.feed-label.is-cur .i { fill: currentColor; }
.feed-title { position: relative; margin: 0; font-size: 1.22rem; line-height: 1.35; letter-spacing: -.01em; }
.feed-title a { color: var(--ink); }
.feed-title a:hover { color: var(--primary); }
.feed-text { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Portada: la imagen del caso o el color y el logo de su herramienta */
/* Pie: botones redondos a la izquierda, nivel y recursos a la derecha */
/* Pie: prueba social (caras y completados), favoritos y, a la derecha, nivel y recursos */
.feed-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding-top: 12px; border-top: 1px solid var(--border-2); color: var(--muted); font-size: .84rem; }
.feed-social { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.feed-foot .fav, .feed-info { white-space: nowrap; }
.feed-social b { color: var(--ok); font-weight: 700; }
.feed-faces { display: inline-flex; padding-left: 8px; }
.feed-face { display: grid; place-items: center; width: 24px; height: 24px; margin-left: -8px; border-radius: 50%; border: 2px solid var(--surface); font-style: normal; }
.feed-face.avatar { font-size: .62rem; } /* foto o inicial de un alumno */
.feed-face.f1 { background: #7c80e8; }
.feed-face.f2 { background: #d97757; }
.feed-face.f3 { background: #2a9d97; }
.feed-face.f4 { background: #f2994a; }
.feed-faces.is-empty .feed-face { border: 1.5px dashed var(--ok); color: var(--ok); font-size: .9rem; font-weight: 700; }
.feed-sep { color: var(--muted-2); }
.feed-foot .fav { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px; margin-left: -8px; border-radius: 999px; color: var(--muted); font-size: .84rem; }
.feed-foot .fav:hover { background: #fdeef1; }
.feed-foot .fav .heart { width: 16px; height: 16px; color: #e5486a; } /* el corazón, siempre rojo */
.feed-foot .fav .fav-n { color: #e5486a; font-weight: 700; }
.feed-foot .fav .fav-txt { color: var(--muted); font-weight: 400; }
.feed-info { margin-left: auto; display: inline-flex; align-items: center; gap: 14px; color: var(--muted-2); font-size: .8rem; }
.feed-info .lvl { margin-right: -8px; }
/* Recursos: columna de 110px a la derecha, de arriba abajo, separada por una línea fina; la cifra grande y «recursos» debajo */
.feed-item.has-res { grid-template-columns: minmax(0, 1fr) 110px; column-gap: 0; }
.feed-item.has-res > .feed-main { grid-column: 1; grid-row: 1; }
.feed-item.has-res > .feed-foot { grid-column: 1; grid-row: 2; }
.feed-res { grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; margin: -22px -24px -22px 24px; border-left: 1px solid var(--border-2); color: var(--primary); line-height: 1; }
.feed-item.is-current .feed-res { margin: -21px -23px -21px 24px; }
.feed-res b { font-size: 44px; font-weight: 600; color: #a5a8f0; } /* morado suave: que no le quite protagonismo al título */
.feed-res-l { color: var(--muted-2); font-size: .78rem; }
.feed-res svg { display: none; width: 14px; height: 14px; }
/* Continúa con: la entrada dentro de un recuadro violeta suave */
.rows-continue { margin: 0 0 22px; }
.feed-item.is-current { padding: 21px 23px; border: 2px solid #5b60e6; background: #f9f9ff; }
/* Completados: título en gris y sin resumen */
.feed-item.is-done .feed-title a { color: var(--muted); }
.feed-item.is-done .feed-text { display: none; }
.feed-item.is-done { box-shadow: none; opacity: .5; transition: opacity .2s, border-color .15s; } /* completados: apagados (en «Completados» no) */
.feed-item.is-done:hover, .feed-item.is-done:focus-within { opacity: 1; }
@media (max-width: 600px) {
  .feed-item { gap: 10px; padding: 16px; }
  .feed-foot { gap: 10px; flex-wrap: wrap; }
  .feed-social { flex-wrap: wrap; row-gap: 4px; }
  .feed-sep { display: none; } /* los favoritos bajan a otra línea: sin el punto colgando */
  .feed-title { font-size: 1.02rem; }
  .feed-text { display: none; }
  .feed-info span:not(.lvl) { display: none; }
  /* en móvil, la columna quitaría ancho al título: sello morado claro en la esquina de arriba con las capas y la cifra */
  .feed-item.has-res { grid-template-columns: minmax(0, 1fr); }
  .feed-res { grid-area: auto; position: absolute; top: -1px; right: -1px; flex-direction: row; gap: 5px; margin: 0; padding: 5px 12px 5px 13px; border: 0; border-radius: 0 20px 0 12px; background: var(--soft); font-size: .78rem; }
  .feed-item.is-current .feed-res { top: -2px; right: -2px; margin: 0; }
  .feed-res b { font-size: inherit; font-weight: 700; color: inherit; }
  .feed-res svg { display: block; }
  .feed-res-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .feed-meta { padding-right: 56px; } /* que no pise el sello */
}
html.dark .feed-item.is-current { background: #17162a; }
html.dark .feed-foot .fav:hover { background: rgba(229, 72, 106, .12); }

/* ---------- Barra de filtros del listado (a la derecha) ---------- */
/* Barra lateral derecha (Ordenar, Filtrar y Recomendados): a toda la altura en escritorio, sin tarjetas, apartados
   separados por líneas. En pantallas más pequeñas va encima del listado, en un bloque */
.fbar { gap: 0; padding: 4px 20px 20px; background: var(--surface); }
.fb-sec { display: grid; gap: 12px; padding: 18px 0; }
.fb-sec + .fb-sec { border-top: 1px solid var(--border-2); }
@media (min-width: 1281px) {
  .has-fbar { --fbw: 300px; }
  .has-fbar .app { margin-right: var(--fbw); }
  .has-fbar .list-layout { padding-inline: 32px; } /* aire a los dos lados del listado (la pestaña «Filtros» no queda pegada) */
  html.sb-collapsed .has-fbar .app { margin-left: 300px; } /* el listado conserva su medida aunque se pliegue la barra lateral */
  .fbar { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: var(--fbw); align-content: start; overflow-y: auto; border-left: 1px solid var(--border-2); scrollbar-width: thin; }
  .admin-bar .fbar { top: 32px; }
}
@media (max-width: 1280px) { .fbar { order: -1; border: 1px solid var(--border-2); border-radius: 22px; box-shadow: var(--shadow); } } /* encima del listado */
/* Pestaña «Filtros»: pegada por fuera al borde de la barra (no ocupa sitio dentro). Icono, «FILTROS» en vertical y flecha;
   con filtros puestos, un circulito magenta con cuántos */
.fb-tab { position: fixed; top: 50%; right: var(--fbw, 300px); z-index: 51; display: flex; flex-direction: column; align-items: center; gap: 10px; width: 30px; padding: 14px 0; transform: translateY(-50%); border: 1px solid var(--border-2); border-right: 0; border-radius: 12px 0 0 12px; background: var(--soft); color: var(--primary); box-shadow: -4px 0 12px -6px rgba(20, 21, 43, .18); cursor: pointer; transition: right .25s ease, background .15s; }
.fb-tab:hover { background: #e3e4fd; }
html.dark .fb-tab:hover { background: #2c2b48; }
.fb-tab > .i { width: 16px; height: 16px; flex: none; }
.fb-tab-t { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.fb-tab .fb-tab-close, .fb-tab .fb-tab-open { width: 13px; height: 13px; color: var(--muted-2); }
.fb-tab-n { position: absolute; top: -7px; left: -7px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; border: 2px solid var(--surface); background: #a8457f; color: #fff; font-size: .62rem; font-weight: 700; line-height: 1; }
.fb-tab-open, html.fb-collapsed .fb-tab-close { display: none; }
html.fb-collapsed .fb-tab-open { display: block; }
@media (max-width: 1280px) { .fb-tab { display: none; } } /* la pestaña solo tiene sentido con la barra a la derecha */
@media (min-width: 1281px) {
  /* Plegada: la barra sale de la pantalla y la pestaña se queda en el borde */
  .fbar { transition: transform .25s ease, visibility 0s linear 0s; }
  html.fb-collapsed .fbar { transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
  html.fb-collapsed .fb-tab { right: 0; }
}
.fb-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.fb-title .i, .fb-title .sparkles { width: 15px; height: 15px; }
.fbar .tabs { width: 100%; justify-content: space-between; }
.fbar .tabs a { flex: 1 1 auto; } /* cada una, al menos lo que ocupa su palabra */
/* Filtros en acordeón (F1): cada filtro es una fila; al abrirlo, sus opciones salen debajo con una línea violeta */
.fb-filters { display: grid; gap: 2px; }
.fb-f summary { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; color: var(--text); font-size: .9rem; cursor: pointer; list-style: none; transition: background .15s; }
.fb-f summary::-webkit-details-marker { display: none; }
.fb-f summary:hover, .fb-f[open] summary { background: var(--soft-2); color: var(--ink); }
.fb-f summary > .i:first-child { width: 17px; height: 17px; flex: none; color: var(--primary); }
.fb-f-t { flex: none; }
.fb-f-cur { min-width: 0; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--primary); font-size: .8rem; font-weight: 600; }
.fb-f-chev { width: 15px; height: 15px; flex: none; margin-left: auto; color: var(--muted-2); transition: transform .15s; }
.fb-f-cur + .fb-f-chev { margin-left: 0; }
.fb-f[open] .fb-f-chev { transform: rotate(180deg); }
.fb-f-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; margin: 4px 0 8px 18px; padding-left: 12px; border-left: 2px solid var(--soft); }
/* Cada opción se ajusta al ancho: los nombres largos pasan a una segunda línea (nunca scroll lateral) */
.fb-opts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; min-width: 0; max-height: 280px; overflow: hidden auto; scrollbar-width: thin; }
.fb-opt { display: flex; align-items: flex-start; gap: 8px; min-width: 0; padding: 6px 10px; border-radius: 9px; color: var(--text); font-size: .84rem; line-height: 1.35; }
.fb-opt:hover { background: var(--soft-2); color: var(--ink); }
.fb-opt.is-on { background: var(--soft); color: var(--primary-dark); font-weight: 600; }
.fb-opt-ico { display: grid; place-items: center; width: 18px; height: 18px; flex: none; }
.fb-opt-ico .tool-logo { width: 16px; height: 16px; }
.fb-opt-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fb-opt-n { flex: none; margin-top: 1px; padding: 0 7px; border-radius: 999px; background: var(--soft-2); color: var(--muted); font-size: .7rem; line-height: 1.6; }
.fb-opt-x { width: 13px; height: 13px; flex: none; margin-top: 3px; color: var(--muted); }
.fb-search { display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 9px; background: var(--soft-2); }
.fb-search .i { width: 14px; height: 14px; flex: none; color: var(--muted-2); }
.fb-search input { width: 100%; min-width: 0; height: 32px; border: 0; background: none; color: var(--ink); font: 400 .82rem var(--font); }
.fb-search input:focus { outline: 0; }
.fb-opts li[hidden] { display: none; }
/* «Quitar filtros»: botón a todo el ancho en el magenta de «Nuevo» (se ve, pero no compite con el violeta) */
.fb-clear { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; padding: 9px 14px; border: 1px solid #ecc6dc; border-radius: 12px; background: #fbf0f6; color: #a8457f; font-weight: 600; font-size: .84rem; }
.fb-clear:hover { border-color: #a8457f; background: #a8457f; color: #fff; }
.fb-clear .i { width: 14px; height: 14px; }
html.dark .fb-clear { border-color: rgba(214, 120, 172, .35); background: rgba(214, 120, 172, .12); color: #e08ab9; }
html.dark .fb-clear:hover { background: #a8457f; color: #fff; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .84rem; font-weight: 500; transition: border-color .15s, background .15s; }
.fb-chip:hover { border-color: var(--primary-2); color: var(--ink); }
.fb-chip .i, .fb-chip .tool-logo { width: 15px; height: 15px; color: var(--primary); }
.fb-chip.is-on { background: var(--soft); border-color: var(--primary-2); color: var(--primary-dark); font-weight: 600; }
.fb-chip.is-on .i:last-child { width: 13px; height: 13px; color: var(--muted); }
/* ---------- Ficha del alumno (abajo de la barra lateral) ----------
   Avatar dentro del anillo con la pastilla del %, nombre y casos al lado, y debajo cuándo sale el próximo caso */
.sb-me-card { display: grid; gap: 12px; padding: 16px 6px 2px; border-top: 1px solid var(--border-2); } /* sin caja: una línea suave la separa de lo de arriba */
.sb-me-head { display: flex; align-items: center; gap: 14px; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.sb-me-ring { position: relative; width: 64px; height: 64px; flex: none; }
.sb-me-ring .me-ring { position: absolute; inset: 0; }
.sb-me-ring .me-ring circle { stroke-width: 4.5; }
.sb-me-ring .me-ring .ring-bg { stroke: var(--soft); }
.sb-me-ring .avatar { position: absolute; inset: 8px; width: auto; height: auto; font-size: 1.1rem; }
.sb-me-pct { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); padding: 1px 7px; border-radius: 999px; border: 2px solid var(--surface); background: #5b60e6; color: #fff; font-size: .62rem; line-height: 1.4; white-space: nowrap; }
.sb-me-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sb-me-info b { color: var(--ink); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-me-info > span { color: var(--muted); font-size: .8rem; }
.sb-me-info small { margin-top: 2px; color: var(--primary); font-size: .74rem; font-weight: 600; }
.sb-me-head[aria-expanded="true"] .sb-user-chev { transform: rotate(180deg); }
/* Próximo caso: una línea discreta bajo una raya discontinua */
.sb-me-next { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; padding-top: 10px; border-top: 1px dashed var(--border); color: var(--muted-2); font-size: .74rem; }
.sb-me-next b { color: var(--muted); font-weight: 600; }
.sb-me-next .sparkles { width: 13px; height: 13px; flex: none; color: var(--yellow); filter: drop-shadow(0 0 1px rgba(20, 21, 43, .25)); }
.sb-me .sb-user-menu { bottom: calc(100% - 4px); }
@media (min-width: 1025px) {
  html.sb-collapsed .sb-me-card { padding: 0; border: 0; box-shadow: none; background: none; }
  html.sb-collapsed .sb-me-card > :not(.sb-me-head), html.sb-collapsed .sb-me-info, html.sb-collapsed .sb-me-head .sb-user-chev, html.sb-collapsed .sb-me-pct { display: none; }
  html.sb-collapsed .sb-me-ring { width: 48px; height: 48px; margin: 0 auto; }
  html.sb-collapsed .sb-me-ring .avatar { inset: 6px; }
}

/* ---------- Modo oscuro (html.dark: lo activa el usuario en su desplegable y se recuerda en el navegador) ----------
   La mayoría sale de cambiar las variables; debajo, lo que usa colores fijos. Versión solo clara en git: «claro-v1» */
html.dark {
  --ink: #eeeef6; --text: #c8c9d8; --muted: #9798ac; --muted-2: #6f7086;
  --primary: #8b90ff; --primary-2: #9da1ff; --primary-dark: #b3b6ff;
  --soft: #23223a; --soft-2: #18181f; --bg: #0b0b10; --surface: #131319; --border: #2a2a36; --border-2: #212129;
  --yellow-soft: #3b3415;
  --ok: #3cbab3; --warn: #fbbf24; --bad: #f87171;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 22px rgba(0,0,0,.28);
  --drop: drop-shadow(0 1px 1px rgba(0,0,0,.3)) drop-shadow(0 8px 12px rgba(0,0,0,.28));
  --shadow-lg: 0 18px 44px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}
/* Botón principal y gradientes: mismo violeta de marca, texto blanco */
html.dark .btn-primary { background: #5b60e6; }
html.dark .btn-primary:hover { background: #4b50d1; }
/* Bloques que usaban --ink como fondo oscuro: ahora un violeta muy oscuro con borde */
html.dark .cta-band { background: #17161f; border: 1px solid var(--border); }
html.dark .skip-link { background: #5b60e6; }
/* Logos de herramientas en cuadrado oscuro; los de un solo color (ChatGPT, Notion…) se pintan en blanco */
html.dark .page-head h1 .tool-logo, html.dark .btn-try .tool-logo, html.dark .rail-try .rail-logo { background: var(--soft-2); }
html.dark .tool-logo-mono { filter: invert(1) brightness(1.1); }
/* Fondos claros fijos → versiones oscuras */
html.dark a.chip:hover, html.dark .caso .wp-block-image, html.dark .panel .gallery .wp-block-image, html.dark .caso-body figure:has(> img) { background: var(--surface); }
html.dark .level-principiante, html.dark .level-card.level-principiante .level-ico, html.dark .notice-ok,
html.dark .caso-done-bar, html.dark .caso-mbar .done-btn[aria-pressed="true"] { background: rgba(60, 186, 179, .12); border-color: rgba(60, 186, 179, .3); color: var(--ok); }
html.dark .level-intermedio, html.dark .level-card.level-intermedio .level-ico { background: rgba(251, 191, 36, .12); color: var(--warn); }
html.dark .level-avanzado, html.dark .level-card.level-avanzado .level-ico, html.dark .notice-error { background: rgba(248, 113, 113, .12); color: var(--bad); }
html.dark .fav:hover, html.dark .rail-fav .fav[aria-pressed="true"] .heart { background: rgba(229, 72, 106, .15); border-color: rgba(229, 72, 106, .35); }
html.dark .me-ring .ring-bg { stroke: var(--soft); }
html.dark .lvl i { background: #34343f; }
/* Ficha: círculos del hilo, cajas de prompt y barra móvil */
html.dark .toc .toc-h2 > a::before, html.dark .toc .toc-h2.is-locked::before { background: var(--surface); }
html.dark .box { --bx: 139, 144, 255; background: var(--surface); }
html.dark .box-head { background: #1e1d2e; }
html.dark .box-body, html.dark .box-more { background: #16161d; color: var(--text); }
html.dark .box-body.is-cut:not(.is-open)::after { background: linear-gradient(rgba(22, 22, 29, 0), rgba(22, 22, 29, .85) 55%, #16161d); }
html.dark .caso-mbar, html.dark .mobile-bar { background: rgba(19, 19, 25, .96); }
html.dark .caso-mbar .fav, html.dark .caso-mbar .mbar-btn, html.dark .caso-mbar .done-btn { background: var(--surface); }
/* Contenido del caso: tablas, citas y código heredan las variables; los vídeos e imágenes se quedan como están */
/* Soporte */
html.dark .sup-state.is-abierto { background: rgba(251, 191, 36, .12); color: var(--warn); }
html.dark .sup-state.is-respondido { background: rgba(60, 186, 179, .12); color: var(--ok); }
html.dark ::selection { background: #3a3960; color: #fff; }

/* Interruptor del modo oscuro en el desplegable del usuario */
.theme-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: 500 .9rem var(--font); cursor: pointer; text-align: left; }
.theme-toggle:hover { background: var(--soft-2); color: var(--ink); }
.theme-toggle .i { width: 18px; height: 18px; }
.theme-switch { position: relative; margin-left: auto; width: 34px; height: 20px; flex: none; border-radius: 999px; background: var(--border); transition: background .2s; }
.theme-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.theme-toggle[aria-checked="true"] .theme-switch { background: #5b60e6; }
.theme-toggle[aria-checked="true"] .theme-switch::after { transform: translateX(14px); }

/* ---------- Valoraciones (inc/ratings.php): estrellas, tarjetas y la página de opiniones ---------- */
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars .star { fill: var(--border); }
.stars .star.is-on { fill: #f5b400; }
.feed-rate { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; color: #b7791f; font-weight: 700; font-size: .78rem; }
.val-sum { display: flex; align-items: center; gap: 12px; }
.val-sum > b { font-size: 2.4rem; line-height: 1; color: var(--ink); letter-spacing: -.03em; }
.val-sum small { display: block; color: var(--muted); font-size: .8rem; }
.val-list { list-style: none; margin: 0; padding: 0; }
.val-item { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 18px; box-shadow: var(--shadow); }
.val-item.is-pending { border-style: dashed; }
.val-head { display: flex; align-items: center; gap: 10px; }
.val-head > div { flex: 1; min-width: 0; line-height: 1.3; }
.val-head b { display: block; color: var(--ink); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.val-head time { color: var(--muted-2); font-size: .76rem; }
.val-avatar { width: 34px; height: 34px; font-size: .85rem; flex: none; }
.val-text { margin: 10px 0 0; color: var(--text); font-size: .92rem; overflow-wrap: anywhere; }
.val-tag { display: inline-block; margin-top: 8px; padding: 2px 9px; border-radius: 999px; background: #fdf3dc; color: #8a5a12; font-size: .72rem; font-weight: 600; }
.val-case { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-2); color: var(--primary); font-size: .84rem; font-weight: 600; }
.val-case span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.val-case .tool-logo, .val-case .i { width: 16px; height: 16px; flex: none; }
.val-bars { list-style: none; margin: 0; padding: 0; min-width: 200px; font-size: .78rem; color: var(--muted); }
.val-bars li { display: flex; align-items: center; gap: 8px; }
.val-bars i { flex: 1; height: 7px; border-radius: 9px; background: var(--soft); overflow: hidden; }
.val-bars b { display: block; height: 100%; background: #f5b400; }
.val-bars small { width: 24px; text-align: right; }
html.dark .val-tag { background: rgba(245, 180, 0, .14); color: #f5c542; }
/* Formulario de valorar (panel del caso y barra de la página de opiniones) */
.val-pick { display: grid; gap: 8px; }
.val-chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--soft); color: var(--ink); }
.val-chosen .i { width: 18px; height: 18px; color: var(--ok); }
.val-chosen .acc-link { margin-left: auto; }
.val-chosen .acc-link:hover { color: var(--primary); }
.val-error { margin: 0; color: var(--bad); font-size: .86rem; font-weight: 500; }
.val-pickers[hidden], .val-chosen[hidden], .val-error[hidden] { display: none; } /* su display ganaría al atributo hidden */
.val-label { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.val-note { margin: 0; color: var(--muted); font-size: .8rem; }
.val-form fieldset { margin: 0; padding: 0; border: 0; }
.val-form legend { margin-bottom: 6px; font-weight: 600; font-size: .9rem; color: var(--ink); }
.val-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.val-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.val-input label { cursor: pointer; line-height: 0; }
.val-input svg { fill: var(--border); transition: fill .12s, transform .12s; }
.val-input label:hover svg, .val-input label:hover ~ label svg, .val-input input:checked ~ label svg { fill: #f5b400; }
.val-input label:hover svg { transform: scale(1.1); }
.val-input input:focus-visible + label svg { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.val-form textarea { width: 100%; min-height: 90px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink); font: 400 .9rem/1.5 var(--font); resize: vertical; }
.val-form textarea:focus { outline: 0; border-color: var(--primary-2); box-shadow: 0 0 0 4px var(--soft); }
.val-form > .btn { justify-self: start; }
/* Página de opiniones: como el listado de casos (tarjetas a la izquierda y la barra plegable de la derecha) */
.val-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 18px; color: var(--muted); font-size: .86rem; }
/* Tarjeta de una valoración: arriba quién opina (foto, nombre y, debajo, sus estrellas y la fecha); después su comentario, más
   grande y oscuro, que es lo protagonista; abajo, en gris y pequeño, de qué es (herramienta · caso) y el enlace a más */
.val-card { min-width: 0; } /* un nombre o un título largo no ensancha la tarjeta */
.val-card .feed-main { gap: 14px; }
.val-card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.val-card-av { width: 44px; height: 44px; flex: none; font-size: 1.05rem; box-shadow: 0 0 0 3px var(--soft); }
.val-card-who { display: grid; gap: 3px; min-width: 0; }
.val-card-name { margin: 0; color: var(--ink); font-size: 1rem; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.val-card-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; color: var(--muted-2); font-size: .8rem; }
.val-card-rate .star { width: 17px; height: 17px; }
.val-card-rate b { color: #b7791f; font-size: .82rem; font-weight: 700; }
.val-card .val-text { margin: 0; color: var(--ink); font-size: 1rem; line-height: 1.65; }
.val-card-foot { gap: 8px 16px; }
.val-about { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; margin: 0; color: var(--muted-2); font-size: .8rem; }
.val-about-tool { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.val-about-tool .tool-logo, .val-about-tool .sparkles { width: 16px; height: 16px; flex: none; }
.val-about-tool .sparkles { color: var(--primary); }
.val-about-case { min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
a.val-about-case:hover { color: var(--primary); }
.val-card-more { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.val-card-more .i { width: 14px; height: 14px; }
@media (max-width: 640px) { .val-about { flex-basis: 100%; } .val-about-sep { display: none; } .val-about-case { flex-basis: 100%; } .val-card-more { margin-left: 0; } }
.val-fold > summary { list-style: none; cursor: pointer; }
.val-fold > summary::-webkit-details-marker { display: none; }
.val-fold > summary .fb-opt-n { margin-left: auto; }
.val-fold > summary .fb-f-chev { margin-left: 0; }
.val-fold[open] > summary { margin-bottom: 12px; }
@media (min-width: 1281px) { .val-fold > summary { pointer-events: none; } .val-fold > summary .fb-f-chev { display: none; } } /* en escritorio, siempre abierto */
/* «Valorar un caso» encima de las opiniones: tarjeta compacta, el caso a la izquierda y la valoración a la derecha */
/* Barra «Mis valoraciones» */
.val-mine { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.val-my { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: 14px; background: var(--soft-2); }
.val-my.is-pending { border-style: dashed; }
.val-my-t { color: var(--ink); font-weight: 600; font-size: .86rem; line-height: 1.35; }
.val-my-t:hover { color: var(--primary); }
.val-my-meta { display: flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: .74rem; }
.val-my-meta .star { width: 13px; height: 13px; }
.val-my .val-tag { justify-self: start; margin: 2px 0 0; }
.val-my-text { margin: 2px 0 0; color: var(--text); font-size: .8rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Slider «Completados y sin valorar» encima de «Valorar un caso»: dos líneas, el título con las flechas y los casos en fila */
.val-slider { margin: 0 0 12px; }
.val-slider-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.val-slider-head .fb-opt-n { margin-left: 2px; }
.val-slider-nav { display: flex; gap: 4px; }
.val-slider-nav button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border-2); border-radius: 50%; background: var(--surface); color: var(--muted); cursor: pointer; transition: border-color .15s, color .15s; }
.val-slider-nav button:hover { border-color: var(--primary-2); color: var(--primary); }
.val-slider-nav .i { width: 14px; height: 14px; }
.val-slider.is-static .val-slider-nav { display: none; } /* caben todos: sin flechas */
.val-slider-track { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px 0; -webkit-mask: linear-gradient(90deg, #000 90%, transparent); mask: linear-gradient(90deg, #000 90%, transparent); }
.val-slider.is-static .val-slider-track { -webkit-mask: none; mask: none; }
.val-slider-track::-webkit-scrollbar { display: none; }
.val-slider-track .fb-chip { flex: none; max-width: min(340px, 82vw); scroll-snap-align: start; cursor: pointer; font-family: inherit; }
.val-slider-track .fb-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.val-slider-track .fb-chip b { flex: none; margin-left: 4px; color: var(--primary); font-size: .78rem; font-weight: 700; }
.val-slider-track .fb-chip.is-on b { color: var(--ok); }
/* «Valorar un caso»: compositor minimalista con el aspecto de las tarjetas del feed. Arriba, la foto, la píldora del
   caso y las estrellas; debajo, el comentario y «Publicar» */
.val-new { margin: 0 0 30px; scroll-margin-top: 80px; }
.val-new > .notice { margin: 0 0 12px; }
.val-compose { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 20px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.val-compose:focus-within { border-color: #d9dbf7; box-shadow: var(--shadow), 0 0 0 4px var(--soft-2); }
.val-compose-top { display: flex; align-items: center; gap: 12px; }
.val-compose-top > p { flex: 1; margin: 0; color: var(--muted); font-size: .92rem; }
.val-compose .val-avatar { width: 38px; height: 38px; flex: none; }
.val-compose-ico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--soft); color: #f5b400; }
.val-compose-ico .i { width: 18px; height: 18px; }
.val-compose-case { flex: 1; min-width: 0; }
.val-compose-prompt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--soft-2); color: var(--muted); font: 400 .92rem var(--font); text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.val-compose-prompt:hover { background: var(--soft); color: var(--primary); }
.val-compose-prompt .i { width: 17px; height: 17px; flex: none; }
.val-compose-prompt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.val-compose-prompt[hidden] { display: none; }
.val-compose .val-chosen { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 8px; max-width: 100%; min-height: 42px; padding: 0 6px 0 14px; border-radius: 999px; background: var(--soft); color: var(--primary-dark); font-size: .9rem; }
.val-compose .val-chosen[hidden] { display: none; }
.val-compose .val-chosen b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.val-compose .val-chosen > .i { width: 16px; height: 16px; flex: none; color: var(--ok); }
.val-compose .val-chosen button { width: 30px; height: 30px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.val-compose .val-chosen button:hover { background: var(--surface); color: var(--ink); }
.val-compose .val-chosen button .i { width: 14px; height: 14px; }
.val-compose-stars { flex: none; margin: 0; padding: 0; border: 0; }
.val-compose-more { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 10px; padding-left: 50px; } /* minmax: un título largo no ensancha la tarjeta */
.val-compose textarea { width: 100%; min-height: 54px; padding: 6px 0; border: 0; background: none; color: var(--ink); font: 400 .95rem/1.55 var(--font); resize: vertical; }
.val-compose textarea:focus { outline: 0; }
.val-compose textarea::placeholder { color: var(--muted-2); }
.val-compose .val-error { margin: 0; }
.val-compose-info { display: grid; gap: 2px; min-width: 0; margin-top: -2px; }
.val-compose-info .val-note { font-size: .76rem; color: var(--muted-2); }
.val-compose-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--border-2); }
/* La puntuación, grande y a la izquierda, con su texto («Muy bien»…); «Publicar», a la derecha */
.val-compose-rate { display: flex; align-items: center; gap: 14px; min-width: 0; }
.val-compose-stars .val-input { gap: 4px; }
.val-compose-stars .val-input svg { width: 34px; height: 34px; }
.val-rate-label { color: var(--muted); font-size: .9rem; font-weight: 500; white-space: nowrap; transition: color .15s; }
.val-rate-label.is-set { color: #b7791f; font-weight: 700; }
.val-compose-foot .btn { min-width: 128px; }
@media (max-width: 480px) { .val-compose-stars .val-input svg { width: 30px; height: 30px; } .val-compose-foot .btn { flex: 1; } }
@media (max-width: 640px) {
  .val-compose-top { flex-wrap: wrap; }
  .val-compose-case { flex-basis: calc(100% - 50px); }
  .val-compose-more { padding-left: 0; }
}
/* Qué se valora: «Un caso» o «Tu experiencia» (pestañas pequeñas encima del compositor) */
.val-type { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; } /* las mismas píldoras que los filtros de abajo (.fb-chip) */
.val-type label { position: relative; cursor: pointer; }
.val-type input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.val-type span { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .84rem; font-weight: 500; transition: border-color .15s, background .15s; }
.val-type label:hover span { border-color: var(--primary-2); color: var(--ink); }
.val-type input:checked + span { background: var(--soft); border-color: var(--primary-2); color: var(--primary-dark); font-weight: 600; }
.val-type input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.val-type input:disabled + span { opacity: .45; cursor: not-allowed; }
.val-compose-q { margin: 0; color: var(--ink); font-weight: 600; font-size: .95rem; }
[data-tipo="general"] .val-compose-prompt, [data-tipo="general"] .val-chosen, [data-tipo="general"] .val-for-caso,
[data-tipo="caso"] .val-compose-q, [data-tipo="caso"] .val-for-general { display: none !important; }
/* Filtros por tipo y medias, encima de las tarjetas */
.val-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin: 0 0 18px; }
.val-types { display: flex; flex-wrap: wrap; gap: 6px; }
.val-types .fb-chip .fb-opt-n { margin-left: 2px; }
.val-avgs { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; color: var(--muted); font-size: .82rem; }
.val-avgs > span { display: inline-flex; align-items: center; gap: 6px; }
.val-avgs b { color: var(--ink); }
.val-avgs .star { width: 13px; height: 13px; }
.val-my.is-general { background: var(--soft); }
.val-my-t .sparkles { width: 14px; height: 14px; margin-right: 6px; color: var(--primary); vertical-align: -2px; }

/* ---------- Avisos de los formularios (main.js, data-dai-validate): en lugar de los del navegador, una píldora junto al campo ---------- */
.dai-err { display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; margin: 8px 0 0; padding: 6px 12px 6px 7px; border-radius: 14px; background: #fdeceb; color: #b42318; font-size: .82rem; font-weight: 600; line-height: 1.35; animation: dai-err-in .18s ease-out; }
.dai-err::before { content: "!"; display: grid; place-items: center; width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--bad); color: #fff; font-size: .72rem; font-weight: 800; }
@keyframes dai-err-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@keyframes dai-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
html.dark .dai-err { background: rgba(248, 113, 113, .12); color: var(--bad); }
/* Campos marcados: el comentario y el mensaje (sin recuadro), con una línea roja; el asunto y la píldora del caso, con un aro */
textarea.is-invalid { box-shadow: inset 0 -2px 0 #e7a9a5; }
textarea.is-invalid::placeholder { color: #c98a86; }
.sup-subject input.is-invalid { box-shadow: 0 0 0 2px #e7a9a5; }
.val-compose-case.is-invalid .val-compose-prompt { box-shadow: 0 0 0 2px #e7a9a5; color: #b42318; }
/* Estrellas sin elegir: tiemblan, se tiñen y su aviso ocupa el sitio de «Elige tu puntuación» */
fieldset.is-invalid .val-input { animation: dai-shake .3s ease-in-out 2; }
fieldset.is-invalid .val-input svg { fill: #f3c9c6; }
.val-compose-rate .dai-err { margin: 0; }
.val-compose-rate .dai-err + .val-rate-label { display: none; }
/* La captura, en una línea propia bajo los botones */
.val-compose-foot > .dai-err { order: 3; flex-basis: 100%; margin: 0; }
@media (prefers-reduced-motion: reduce) { .dai-err, fieldset.is-invalid .val-input { animation: none; } }

/* ---------- Newsletter: formulario [dai_newsletter] y páginas de confirmar / baja ---------- */
.dai-nl { display: grid; gap: 10px; max-width: 560px; }
.dai-nl-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.dai-nl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dai-nl-row input { flex: 1 1 200px; min-height: 46px; padding: 10px 18px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); }
.dai-nl-row input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.dai-nl-row .btn { flex: none; }
.dai-nl-ok { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.dai-nl-ok input { margin-top: 3px; accent-color: var(--primary); }
.dai-nl .notice { margin: 0; }
.nl-page { max-width: 520px; margin: 40px auto; padding: 36px 30px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.nl-page-ico { display: inline-grid; place-items: center; width: 58px; height: 58px; margin-bottom: 12px; border-radius: 50%; background: var(--soft); color: var(--primary); }
.nl-page-ico .i { width: 26px; height: 26px; }
.nl-page h1 { font-size: 1.5rem; }
.nl-page p { color: var(--muted); }
.nl-page form { margin: 0 0 14px; }
.nl-page-home { margin: 6px 0 0; font-size: .9rem; }
