/* ZZ Mate — design system portado de mockup/index.html (fuente de verdad del front). */

:root {
  --bg: #fbf9f3;
  --bg-card: #ffffff;
  --bg-elev: #f2ecdf;
  --border: #e6ded0;
  --text: #17170f;
  --muted: #5c584f;
  --accent: #0f6b4f;
  --accent-2: #18805c;  /* era #1f8f68: blanco encima daba 4,05:1, ahora 4,9:1 (AA) */
  --danger: #b0413e;
  --warn: #b0894f;
  --gold: #b0894f;       /* decoración y texto >= 18px bold: sobre --bg da 3,05:1 */
  --gold-text: #8a6a35;  /* dorado para texto chico (eyebrows, etiquetas): 4,8:1 */
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Constantia", "Iowan Old Style", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: auto; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; top: 0; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; font-variant-numeric: lining-nums; }
h1 { font-size: 1.9rem; margin: .2em 0; }
h2 { font-size: 1.3rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 26px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.brand {
  font-family: var(--serif); font-size: 1.3rem; font-weight: 600;
  white-space: nowrap; display: flex; align-items: center; gap: 9px; color: var(--text);
}
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a { color: var(--text); font-weight: 500; }
.topbar nav a.muted { color: var(--muted); }
.topbar .topbar-links { margin-left: 18px; gap: 26px; }
.topbar .topbar-links a { color: var(--muted); }
.topbar .topbar-links a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 860px) {
  .topbar { padding: 10px 16px; gap: 12px; }
  .topbar .topbar-links { display: none; }
}
.spacer { flex: 1; }

.pill { padding: 4px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.rating-pill { background: var(--bg-elev); border: 1px solid var(--border); }
.plan-free { background: var(--bg-elev); color: var(--muted); border: 1px solid var(--border); }
.plan-premium { background: #17170f; color: #d2ac74; cursor: pointer; }

/* ---- Layout ---- */
/* Ancho del contenedor general (2026-08-09, monitor real del dueño 1920x1080).
   1080→1400 fue el primer paso, quedaba mucho margen todavía con el rail
   lateral nuevo restando 84px; 1400→1760 después de verlo en pantalla real
   (deja ~28px de aire de cada lado en 1920px con el rail, en vez de ~220px).
   `width:100%` es necesario desde que .wrap pasó a ser grid-item de
   body.has-rail (nav lateral, mismo día): con margin:auto pero sin width
   explícito, un grid item no se estira solo — se achica al tamaño de su
   contenido (fit-content) en vez de llenar la columna 1fr disponible, dejando
   un montón de espacio vacío a la derecha. Con width:100% vuelve a ocupar
   toda la columna y el max-width sigue funcionando como tope. */
.wrap { width: 100%; max-width: 1760px; margin: 0 auto; padding: 28px 26px; }

/* ---- Botones ---- */
.btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 12px 22px; border-radius: 11px; font-weight: 600; border: none;
  cursor: pointer; font-size: 1rem; text-align: center;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:disabled { opacity: .4; cursor: default; filter: none; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-success { background: var(--accent-2); }
.btn-warn { background: var(--warn); color: #2a1c00; }
.btn-block { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.btn-link {
  background: none; border: none; padding: 0; font: inherit; font-weight: 500;
  color: var(--muted); cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }

/* ---- Tarjetas / grillas ---- */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  box-shadow: 0 1px 2px rgba(20, 20, 15, .04);
}
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* Hub de Táctica: 8 modos y 4 de Biblioteca en filas parejas de 4 (2 en pantallas medianas). */
.grid.hub-g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.hub-g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid.hub-g4 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .g2 { grid-template-columns: 1fr; } }

.stat { text-align: center; }
.stat .num { font-family: var(--serif); font-size: 2rem; font-weight: 700; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; margin-top: 6px; }

.tag {
  display: inline-block; background: var(--bg-elev); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 999px; font-size: .76rem; color: var(--muted); margin: 2px;
}

/* ---- Modos / secciones colapsables (selector de temas, hub de entrenamiento) ---- */
.mode { cursor: pointer; position: relative; transition: .15s; text-decoration: none; display: block; }
.mode:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.mode .ico { font-size: 1.7rem; }
.mode .ico:has(.ic-badge) { line-height: 0; }  /* el círculo del ícono, sin espacio de línea debajo */
.mode h3 { margin: 8px 0 3px; }
.badge-count {
  position: absolute; top: 12px; right: 12px; background: var(--danger); color: #fff;
  font-weight: 800; font-size: .78rem; padding: 2px 9px; border-radius: 999px;
}
.entreno-sec { margin-top: 6px; }
.sec-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  cursor: pointer; margin-top: 20px; padding: 2px 0;
}
.sec-title { display: flex; align-items: center; gap: 9px; }
.sec-title h2 { margin: 0; }
.chev { color: var(--muted); font-size: .85rem; transition: transform .18s; display: inline-block; width: 14px; }
.entreno-sec.collapsed .chev { transform: rotate(-90deg); }
.entreno-sec.collapsed .sec-body { display: none; }
.sec-body { margin-top: 12px; }

/* ---- Mensajes (Django messages framework) ---- */
.messages { list-style: none; max-width: 1400px; margin: 12px auto 0; padding: 0 26px; }
.msg { padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; }
.msg.error { background: #f6e0de; color: var(--danger); }
.msg.success { background: #e4efe8; color: var(--accent); }

/* ---- Formularios / auth ---- */
.auth-wrap { max-width: 440px; margin: 40px auto; }
.auth-wrap h1 { font-size: 1.7rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field input, form input[type=text], form input[type=email], form input[type=password] {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  font-size: 1rem; font-family: inherit;
}
.field input:focus, form input:focus { outline: none; border-color: var(--accent); }
.field input:focus-visible, form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text); font-size: 1rem; font-family: inherit;
  min-height: 120px; resize: vertical;
}
select.inp {
  padding: 9px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-family: inherit; font-size: .95rem;
}
.helptext, .errorlist { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.errorlist { color: var(--danger); list-style: none; padding: 0; }
.auth-alt { text-align: center; margin-top: 16px; color: var(--muted); font-size: .92rem; }
.g-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  background: #fff; color: #1f2330; border: 1px solid var(--border); border-radius: 10px;
  padding: 11px; font-weight: 700; font-size: .98rem; cursor: pointer; font-family: inherit;
  text-decoration: none;
}
.g-btn:hover { filter: brightness(.96); text-decoration: none; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.terms { font-size: .78rem; color: var(--muted); margin-top: 14px; text-align: center; }

.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 26px; display: grid; gap: 6px; justify-items: center; }

.footer-brand { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }

/* ---- Páginas de error (templates/404.html, 500.html) ---- */
.error-page { max-width: 520px; margin: 9vh auto; text-align: center; display: grid; justify-items: center; gap: 10px; }
.error-page h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0; }
.error-page p { margin: 0 0 8px; font-size: 1.05rem; }
.error-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---- Entrenador de táctica ---- */
.trainer { display: grid; grid-template-columns: minmax(300px, 1fr) 320px; gap: 24px; align-items: start; }
.trainer.wide { grid-template-columns: minmax(460px, 1fr) 420px; }
.wrap:has(.trainer.wide) { max-width: 1560px; }
.trainer.with-index { grid-template-columns: 480px minmax(420px, 1fr) 340px; }
@media (max-width: 1600px) { .trainer.with-index { grid-template-columns: 440px minmax(320px, 1fr) 320px; } }
@media (max-width: 1300px) { .trainer.with-index { grid-template-columns: minmax(300px, 1fr) 320px; } .chapters-index { display: none; } }
/* Escritorio: el tablero entra entero en la altura de la ventana (a 1366×768 el del Bot medía
   751px y había que bajar para ver la primera fila). */
@media (min-width: 821px) { .trainer .board-wrap { max-width: min(860px, calc(100vh - 120px)); margin-inline: auto; } }
/* Celular: una sola columna. Va DESPUÉS de las reglas de arriba (misma especificidad), si no la pisan. */
@media (max-width: 820px) { .trainer, .trainer.wide, .trainer.with-index { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .trainer.with-index { grid-template-columns: 1fr; }
  /* Pantallas angostas: el comentario de la jugada (Explicación) se ve apenas
     terminado el tablero, antes de la lista completa de jugadas — si no,
     queda enterrado debajo de "La línea" (que puede ser larga). */
  .side-panel { display: flex; flex-direction: column; }
  .side-panel > .status { order: -2; }
  .side-panel .explain-card { order: -1; }
}
/* 1680px quedaba angosto en monitores grandes (mucho aire a los costados,
   reportado por el dueño 2026-09-17) — subido a 1900px para aprovechar más
   ancho; el tablero sigue topeado por .board-wrap{max-width:860px}, así que
   lo que gana esta pantalla es más aire de sobra para el índice/panel
   lateral, no un tablero desproporcionado. */
.wrap:has(.trainer.with-index) { max-width: 1900px; }
.trainer.with-index .board-wrap { margin: 0 auto; }
.chapters-index { max-height: 640px; overflow-y: auto; }
.list.chapters li.active { background: var(--bg-elev); border-radius: 8px; color: var(--accent); font-weight: 700; }
.board-wrap { position: relative; width: 100%; max-width: 860px; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; }
.board-wrap .cg-wrap { width: 100%; height: 100%; }
/* Casillas: el marrón de Lichess (oscuras #b58863, claras #f0d9b5), igual que los diagramas de
   Por tema. El tema "brown" vendorizado de Chessground pinta negro al 20 % y quedaba gris (#c0ae91).
   Vale para todos los tableros del sitio (también la portada, que carga style.css). */
.cg-wrap cg-board { background-color: #f0d9b5; background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4IDgiIHNoYXBlLXJlbmRlcmluZz0iY3Jpc3BFZGdlcyI+PHJlY3Qgd2lkdGg9IjgiIGhlaWdodD0iOCIgZmlsbD0iI2YwZDliNSIvPjxnIGZpbGw9IiNiNTg4NjMiPjxyZWN0IHg9IjEiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48cmVjdCB4PSIzIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIi8+PHJlY3QgeD0iNSIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIvPjxyZWN0IHg9IjciIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48cmVjdCB4PSIwIiB5PSIxIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIi8+PHJlY3QgeD0iMiIgeT0iMSIgd2lkdGg9IjEiIGhlaWdodD0iMSIvPjxyZWN0IHg9IjQiIHk9IjEiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48cmVjdCB4PSI2IiB5PSIxIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIi8+PHJlY3QgeD0iMSIgeT0iMiIgd2lkdGg9IjEiIGhlaWdodD0iMSIvPjxyZWN0IHg9IjMiIHk9IjIiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48cmVjdCB4PSI1IiB5PSIyIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIi8+PHJlY3QgeD0iNyIgeT0iMiIgd2lkdGg9IjEiIGhlaWdodD0iMSIvPjxyZWN0IHg9IjAiIHk9IjMiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48cmVjdCB4PSIyIiB5PSIzIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIi8+PHJlY3QgeD0iNCIgeT0iMyIgd2lkdGg9IjEiIGhlaWdodD0iMSIvPjxyZWN0IHg9IjYiIHk9IjMiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48cmVjdCB4PSIxIiB5PSI0IiB3aWR0aD0iMSIgaGVpZ2h0PSIxIi8+PHJlY3QgeD0iMyIgeT0iNCIgd2lkdGg9IjEiIGhlaWdodD0iMSIvPjxyZWN0IHg9IjUiIHk9IjQiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48cmVjdCB4PSI3IiB5PSI0IiB3aWR0aD0iMSIgaGVpZ2h0PSIxIi8+PHJlY3QgeD0iMCIgeT0iNSIgd2lkdGg9IjEiIGhlaWdodD0iMSIvPjxyZWN0IHg9IjIiIHk9IjUiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48cmVjdCB4PSI0IiB5PSI1IiB3aWR0aD0iMSIgaGVpZ2h0PSIxIi8+PHJlY3QgeD0iNiIgeT0iNSIgd2lkdGg9IjEiIGhlaWdodD0iMSIvPjxyZWN0IHg9IjEiIHk9IjYiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48cmVjdCB4PSIzIiB5PSI2IiB3aWR0aD0iMSIgaGVpZ2h0PSIxIi8+PHJlY3QgeD0iNSIgeT0iNiIgd2lkdGg9IjEiIGhlaWdodD0iMSIvPjxyZWN0IHg9IjciIHk9IjYiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48cmVjdCB4PSIwIiB5PSI3IiB3aWR0aD0iMSIgaGVpZ2h0PSIxIi8+PHJlY3QgeD0iMiIgeT0iNyIgd2lkdGg9IjEiIGhlaWdodD0iMSIvPjxyZWN0IHg9IjQiIHk9IjciIHdpZHRoPSIxIiBoZWlnaHQ9IjEiLz48cmVjdCB4PSI2IiB5PSI3IiB3aWR0aD0iMSIgaGVpZ2h0PSIxIi8+PC9nPjwvc3ZnPg=='); }
.board-wrap .cg-wrap coords { font-size: clamp(11px, 1.3vw, 15px); font-weight: 700; opacity: 1; }
.board-wrap .cg-wrap coords coord { color: rgba(58, 40, 20, .85) !important; }
.board-wrap .cg-wrap coords.files { height: 1.5em; bottom: 0; }
/* Columnas en minúscula, como se escriben las jugadas (informe de QA #29). */
body .cg-wrap coords.files { text-transform: none; }  /* gana a chessground.base.css, que carga después */
.status {
  font-size: 1.02rem; font-weight: 700; padding: 12px; border-radius: 11px;
  background: var(--bg-elev); text-align: center; margin-bottom: 14px;
}
.status.turn { color: var(--accent); }
.status.ok { color: var(--accent-2); }
.status.bad { color: var(--danger); }
.theme-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 18px; }
.progress-hint { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.delta-up { color: var(--accent); font-weight: 800; }
.delta-down { color: var(--danger); font-weight: 800; }

/* ---- Flujo alumno / padre-tutor ---- */
.acct-type { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 6px; }
@media (max-width: 440px) { .acct-type { grid-template-columns: 1fr; } }
.atc {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer;
  text-align: center; font-weight: 700; transition: .14s; line-height: 1.3;
  background: var(--bg-card); color: var(--text); display: block; text-decoration: none;
}
.atc:hover { border-color: var(--accent); text-decoration: none; }
.atc.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(15, 107, 79, .15); }
.atc .ic { font-size: 1.5rem; display: block; margin-bottom: 4px; }
.atc small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 3px; }
.reg-sec {
  font-family: var(--serif); font-weight: 600; font-size: 1.05rem; margin: 20px 0 8px;
  display: flex; align-items: center; gap: 8px;
}
.reg-sec .n {
  background: var(--accent); color: #fff; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; flex: none;
}
.consent-box { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 6px 14px; }
.consent-item {
  display: flex; gap: 11px; padding: 11px 0; font-size: .88rem; align-items: flex-start;
  border-bottom: 1px solid var(--border);
}
.consent-item:last-child { border-bottom: none; }
.consent-item input { margin-top: 2px; width: 17px; height: 17px; flex: none; }
.gate-note {
  background: #fdf3dd; border: 1px solid #ecdcb3; color: #8a6d1f; border-radius: 10px;
  padding: 11px 13px; font-size: .85rem; margin-top: 8px;
}
/* Textos legales (Términos, Privacidad, Cookies) */
.legal h2 { font-size: 1.12rem; margin: 26px 0 6px; }
.legal p, .legal li { line-height: 1.65; }
.legal ul { padding-left: 20px; }
.child-card .head { display: flex; gap: 12px; align-items: center; }
.consent-ok { color: var(--accent); font-weight: 700; font-size: .8rem; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #0f6b4f, #b0894f);
  display: grid; place-items: center; font-weight: 700; color: #fff; flex: none;
}
.set-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.set-row:last-child { border-bottom: none; }
.set-row .t { font-weight: 600; }
.set-row .s { font-size: .82rem; color: var(--muted); }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; background: var(--border); border-radius: 999px; cursor: pointer; transition: .15s; }
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(20px); }
.big-avatar {
  width: 76px; height: 76px; border-radius: 50%; background: linear-gradient(135deg, #0f6b4f, #b0894f);
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 1.9rem;
  font-family: var(--serif); flex: none;
}
.tag.minor { background: #eef3f7; color: #3b4a52; border-color: #cfdce4; }

.crumbs { color: var(--muted); font-size: .9rem; margin-bottom: 14px; }
.crumbs a { cursor: pointer; }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }

.empty-state { text-align: center; max-width: 460px; margin: 44px auto; padding: 38px 26px; }
.empty-state .ico { font-size: 3rem; line-height: 1; }
.empty-state h2 { margin: 12px 0 6px; }
.empty-state p { color: var(--muted); margin: 0 0 20px; }

/* ---- Repaso (SRS) ---- */
.bar { height: 8px; border-radius: 99px; background: var(--bg-elev); overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.hero-review { background: linear-gradient(135deg, #e9f3ed, #f5f0e5); border: 1px solid #cfe3d8; }
.hero-review .big { font-family: var(--serif); font-size: 3rem; font-weight: 700; line-height: 1; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; font-weight: 700; color: var(--gold-text); margin-bottom: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #e4efe8; color: var(--text); padding: 5px 12px; border-radius: 999px; font-size: .85rem; margin: 3px 3px 0 0; }
.tac-result { border-radius: 12px; padding: 13px; text-align: center; margin-bottom: 14px; font-weight: 700; background: #e9f3ed; border: 1px solid #cfe3d8; }

/* ---- Cursos ---- */
.fchips { display: flex; gap: 7px; flex-wrap: wrap; margin: 10px 0 4px; }
.fchip { background: var(--bg-card); border: 1px solid var(--border); color: var(--muted); font: inherit; font-weight: 600; font-size: .85rem; padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: .14s; white-space: nowrap; text-decoration: none; }
.fchip:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.fchip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.fchip-lbl { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; align-self: center; margin-right: 2px; }
.tag.prem { color: #2a1c00; background: linear-gradient(135deg, #e3c07f, #c79a5b); border: none; }
.notation { display: flex; flex-wrap: wrap; gap: 4px; line-height: 1.9; }
.notation .mv { cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.notation .mv:hover { background: var(--bg-elev); }
.notation .mv.cur { background: var(--accent); color: #fff; font-weight: 700; }
.notation .mv.train { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }

/* Lista de jugadas estilo Lichess (una fila por jugada completa) — solo la usa
   courses/lesson.html; el resto de las pantallas con .notation siguen con el
   flujo en línea de arriba, sin .mv-row. */
.notation .mv-row { width: 100%; display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 6px; }
.notation .mv-row:nth-of-type(even) { background: var(--bg-elev); }
.notation .mv-no { color: var(--muted); width: 28px; flex: none; text-align: right; }
.notation .mv-row .mv { flex: 1; min-width: 64px; }
.notation .mv.keyx::after { content: ' ★'; }
.list.chapters { list-style: none; padding: 0; margin: 0; }
.list.chapters li { display: flex; justify-content: space-between; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.list.chapters li:last-child { border-bottom: none; }
.list.chapters li:hover { color: var(--accent); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--border); }
.dot.done { background: var(--accent); }
.dot.half { background: var(--gold); }
.dot.todo { background: var(--border); }
.seg { display: inline-flex; background: var(--bg-elev); border-radius: 10px; padding: 3px; }
.seg a, .seg button { background: transparent; border: none; color: var(--muted); font: inherit; font-weight: 700; padding: 6px 16px; border-radius: 8px; cursor: pointer; text-decoration: none; }
.seg a.active, .seg button.active { background: var(--accent); color: #fff; }
.lesson-lbl { text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; font-weight: 700; color: var(--gold-text); margin-bottom: 6px; }

/* ---- Bot: elegí tu rival ---- */
.note-preview {
  background: var(--bg-elev); border: 1px dashed var(--border); border-radius: 12px;
  padding: 10px 16px; font-size: .85rem; color: var(--muted); margin-bottom: 22px;
}
.note-preview code { background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: .82rem; }
.level-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px 0 10px; }
.level-pill { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; font-size: .72rem; font-weight: 700; }
.level-elo { color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }

.bot-roster { display: none; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 24px; }
.bot-roster.active { display: grid; }
.bot-card {
  position: relative; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(20, 20, 15, .05);
  transition: transform .15s, border-color .15s;
}
.bot-card:hover { transform: translateY(-3px); border-color: var(--accent-2); }
.bot-photo { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: #000; }
.bot-card .card-body { padding: 14px 16px 16px; text-align: center; }
.bot-card .bot-name { font-size: 1rem; margin: 0 0 8px; }
.bot-card .rec-badge {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2;
  background: var(--accent); color: #fff; font-size: .66rem; font-weight: 700;
  padding: 4px 12px; border-radius: 999px; white-space: nowrap; box-shadow: 0 3px 8px rgba(15,107,79,.4);
}
.bot-card .bot-blurb { color: var(--muted); font-size: .8rem; margin: 0 0 14px; min-height: 2.4em; }
.bot-card .btn-play {
  display: block; width: 100%; background: var(--accent); color: #fff; border: none;
  padding: 10px 14px; border-radius: 10px; font-weight: 700; font-size: .86rem; cursor: pointer;
  text-align: center; box-sizing: border-box;
}
.bot-card .btn-play:hover { filter: brightness(1.08); }

.bp-rival { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.bp-rival img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.bp-rival h3 { margin: 0; font-size: 1.05rem; }
#moves { max-height: 260px; overflow-y: auto; margin: 4px 0 14px; }
.notation .mv.inaccuracy { color: var(--gold-text); font-weight: 700; }
.notation .mv.mistake { color: var(--gold-text); font-weight: 700; }
.notation .mv.blunder { color: var(--danger); font-weight: 700; }
#result #analyze-btn { margin-top: 8px; }
.acc-big { font-family: var(--serif); font-size: 1.8rem; font-weight: 700; margin: 10px 0 2px; }

/* El overlay queda anclado a .board-col (no a toda la pantalla) a propósito:
   así el panel lateral con la lista de jugadas nunca se tapa, se puede leer
   siempre, incluso con el modal de fin de partida abierto. */
.board-col { position: relative; }
.modal-overlay {
  position: absolute; inset: 0; background: rgba(21, 23, 15, .55); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 34px 30px;
  max-width: 360px; width: 100%; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.modal-result { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; margin: 0 0 24px; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-actions .btn { width: 100%; box-sizing: border-box; }

.promo-card { max-width: 280px; }
.promo-choices { display: flex; gap: 10px; justify-content: center; }
.promo-btn {
  width: 58px; height: 58px; font-size: 2.1rem; line-height: 1; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); cursor: pointer;
}
.promo-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.bp-color-row { margin: 14px 0; }
.bp-color-btns { display: flex; gap: 8px; margin-top: 6px; }
.bp-color-btns .btn { flex: 1; }
.bp-controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bp-controls-grid .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Girar el tablero: debajo del tablero, no encima (tapaba la pieza de la esquina, ej. el rey en h8). */
.board-flip-btn {
  display: flex; align-items: center; gap: 6px; margin: 8px 0 0 auto; height: 32px; padding: 0 12px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.board-flip-btn:hover { background: var(--bg-elev); border-color: var(--accent); }

/* ---- Wizard de importación de PGN / editor de curso ---- */
.wiz-steps { display: flex; gap: 8px; margin: 8px 0 22px; flex-wrap: wrap; }
.wiz-step { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 150px; }
.wiz-step .num { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-elev); border: 1px solid var(--border); display: grid; place-items: center; font-weight: 700; font-size: .82rem; flex: none; color: var(--muted); }
.wiz-step.active .num { background: var(--accent); color: #fff; border-color: var(--accent); }
.wiz-step.done .num { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }
.wiz-step .lbl { font-size: .85rem; font-weight: 600; color: var(--muted); }
.wiz-step.active .lbl, .wiz-step.done .lbl { color: var(--text); }
.pgn-ta { width: 100%; min-height: 200px; font-family: monospace; font-size: .85rem; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: var(--bg-card); color: var(--text); }
.map-item { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.map-item:last-child { border-bottom: none; }
.map-item input[type=text] { flex: 1; }
.map-item .meta { font-size: .78rem; color: var(--muted); white-space: nowrap; }

/* ---- Hub de Entrenamiento (tarjetas/lista, "Pronto") ---- */
.view-toggle button { font-size: 1.05rem; line-height: 1; }
.list-view .grid { grid-template-columns: 1fr; gap: 8px; }
.list-view .mode { display: flex; align-items: center; gap: 10px; padding: 11px 16px; }
.list-view .mode:hover { transform: none; }
.list-view .mode .ico { display: none; }
.list-view .mode h3 { margin: 0; font-size: 1rem; }
.list-view .mode p { display: none; }
.mode .soon { position: absolute; top: 12px; right: 12px; font-size: .66rem; font-weight: 700; background: var(--bg-elev); color: var(--gold-text); padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); }

/* ---- Planes / precios ---- */
.price { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 680px) { .price { grid-template-columns: 1fr; } }
.price .plan { position: relative; }
.price .best { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-weight: 700; font-size: .72rem; padding: 3px 12px; border-radius: 999px; }
.price .amount { font-family: var(--serif); font-size: 2.4rem; font-weight: 700; }
.price ul { list-style: none; padding: 0; margin: 14px 0; }
.price li { padding: 6px 0; border-bottom: 1px solid var(--border); }

/* ---- Campana de notificaciones ---- */
.icon-btn { position: relative; background: transparent; border: 1px solid var(--border); border-radius: 10px; width: 38px; height: 38px; cursor: pointer; font-size: 1.05rem; display: grid; place-items: center; color: var(--text); }
.icon-btn:hover { background: var(--bg-elev); border-color: var(--accent); }
.dot-badge { position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff; font-size: .64rem; font-weight: 800; min-width: 17px; height: 17px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px; }
.notif-wrap { position: relative; }
.notif-panel { position: absolute; right: 0; top: 46px; width: 330px; max-width: 88vw; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 14px 36px rgba(20, 20, 15, .18); z-index: 40; display: none; overflow: hidden; }
.notif-panel.open { display: block; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border-bottom: 1px solid var(--border); }
.notif-head a { cursor: pointer; font-size: .82rem; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { display: flex; gap: 11px; padding: 11px 15px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: flex-start; text-decoration: none; color: inherit; }
.notif-item:hover { background: var(--bg-elev); text-decoration: none; }
.notif-item.unread { background: #f2f8f5; }
.notif-item .ni-ic { font-size: 1.15rem; flex: none; line-height: 1.2; }
.notif-item .ni-t { font-size: .88rem; line-height: 1.35; }
.notif-item .ni-time { color: var(--muted); font-size: .75rem; margin-top: 2px; }
.notif-item .ni-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 5px; }
.notif-foot { padding: 10px 15px; text-align: center; }
.notif-empty { padding: 26px 15px; text-align: center; color: var(--muted); font-size: .9rem; }

/* ---- Racha semanal / logros / heatmap (Hoy, Progreso) ---- */
.week { display: flex; gap: 8px; margin-top: 14px; }
.week .day { flex: 1; text-align: center; }
.week .day .d { width: 100%; aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; background: var(--bg-elev); border: 1px solid var(--border); }
.week .day.on .d { background: #e4efe8; border-color: #bfe0d1; }
.week .day.today .d { border: 2px solid var(--accent); }
.week .day .lbl { font-size: .7rem; color: var(--muted); margin-top: 5px; }
.medals-row { display: flex; gap: 12px; flex-wrap: wrap; }
.medals-row .m { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; background: linear-gradient(135deg, #f6e8c6, #e0bd77); border: 1px solid #d3ac68; flex: none; }
.medals-row .m.locked { background: var(--bg-elev); border: 1px solid var(--border); filter: grayscale(1); opacity: .6; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.badge { border: 1px solid var(--border); border-radius: 16px; padding: 20px 16px; text-align: center; background: var(--bg-card); box-shadow: 0 1px 2px rgba(20, 20, 15, .04); }
.badge .medal { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; margin: 0 auto 10px; background: linear-gradient(135deg, #f6e8c6, #e0bd77); border: 1px solid #d3ac68; box-shadow: 0 3px 8px rgba(176, 137, 79, .25); }
.badge h4 { font-family: var(--serif); font-weight: 600; margin: 0 0 3px; font-size: 1rem; }
.badge .desc { font-size: .78rem; color: var(--muted); }
.badge.locked .medal { background: var(--bg-elev); border: 1px solid var(--border); box-shadow: none; filter: grayscale(1); opacity: .7; }
.badge.locked h4 { color: var(--muted); }
.ced-logro-row { display: grid; grid-template-columns: 1fr 76px; gap: 10px; }
.ced-logro-ico input { text-align: center; }
/* Logros agrupados por sección, con nivel (bronce, plata, oro) en el borde de la medalla. */
.lg-summary { margin-bottom: 22px; }
.lg-legend { display: flex; gap: 14px; margin-top: 10px; }
.lg-legend .tier::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.lg-legend .bronce::before { background: #b87333; }
.lg-legend .plata::before { background: #a8a9ad; }
.lg-legend .oro::before { background: #d4a72c; }
.lg-group { margin-bottom: 26px; }
.lg-group-h { font-size: 1.15rem; margin: 0 0 12px; display: flex; align-items: baseline; gap: 10px; }
.badge.tier-bronce .medal { border: 3px solid #b87333; }
.badge.tier-plata .medal { border: 3px solid #a8a9ad; }
.badge.tier-oro .medal { border: 3px solid #d4a72c; }
.badge.locked.tier-bronce .medal, .badge.locked.tier-plata .medal, .badge.locked.tier-oro .medal { border-color: var(--border); }
.badge .lg-bar { margin: 10px 0 4px; height: 6px; }
.badge .lg-when { margin-top: 6px; }
.cal { display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; margin-top: 10px; }
.cal i { aspect-ratio: 1; border-radius: 3px; background: var(--bg-elev); display: block; }
.cal i.l1 { background: #cfe3d8; }
.cal i.l2 { background: #9cc9ae; }
.cal i.l3 { background: #5fa87e; }
.cal i.l4 { background: var(--accent); }

/* ---- Panel del profesor ---- */
.prof-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 14px; }
.seats-meter { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; min-width: 170px; }
.seats-meter .lbl { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.seats-meter .val { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.qa-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 6px; }
.qa-row .btn { padding: 10px 16px; font-size: .92rem; }
.av-sm { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #0f6b4f, #b0894f); display: inline-grid; place-items: center; font-weight: 700; color: #fff; font-size: .8rem; flex: none; }
.stu-cell { display: flex; align-items: center; gap: 10px; }
.tag.seat { background: #eae2f3; color: #5b3f8f; border: none; }
.tag.trial { background: #fdf3dd; color: #8a6d1f; border: none; }
.gcard { cursor: pointer; }
.gcard.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(15, 107, 79, .15); }
.gcard .gmeta { color: var(--muted); font-size: .85rem; }
.wk { display: flex; align-items: center; gap: 12px; margin: 9px 0; }
.wk .wname { flex: 0 0 190px; font-size: .9rem; font-weight: 600; }
.wk .bar { flex: 1; margin: 0; }
.wk .wpct { flex: 0 0 42px; text-align: right; font-size: .85rem; color: var(--muted); font-weight: 700; }
.attn-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.attn-item:last-child { border-bottom: none; }
.attn-item .why { color: var(--muted); font-size: .85rem; }
.attn-badge { font-size: 1.15rem; flex: none; }
@media (max-width: 640px) { .wk .wname { flex-basis: 120px; } }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.games { width: 100%; border-collapse: collapse; font-size: .92rem; }
.games th { text-align: left; color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.games td { padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.games tbody tr:last-child td { border-bottom: none; }
.games tbody tr { cursor: pointer; }
.games tbody tr:hover { background: var(--bg-elev); }
/* El link real de cada fila (la fila entera también abre con el mouse): da acceso con el teclado. */
.games .row-link { color: inherit; text-decoration: none; }
.games .row-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.games tbody tr:focus-within { background: var(--bg-elev); }
.res { font-weight: 700; }

/* ---- Base de datos de partidas (Mis partidas / Biblioteca) ---- */
.db-layout { display: grid; grid-template-columns: 240px 1fr; gap: 22px; align-items: start; }
.db-layout > * { min-width: 0; }
@media (max-width: 800px) { .db-layout { grid-template-columns: 1fr; } }
.db { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 13px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; color: inherit; text-decoration: none; }
.db:hover { text-decoration: none; }
.db:hover { background: var(--bg-elev); }
.db.active { background: var(--bg-elev); border-color: var(--border); font-weight: 600; }
.db .cnt { color: var(--muted); font-size: .82rem; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

/* Casilla de aceptación de Términos y Privacidad (registro, ingreso con Google). */
.field .accept-legal-row { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; font-size: .88rem; line-height: 1.45; cursor: pointer; }
.field .accept-legal-row input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; padding: 0; accent-color: var(--accent); }

/* Franja de arriba con los botones de arrepentimiento y baja (Disposición 954/2025), para visitantes. */
.legal-strip { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px 18px; padding: 6px 26px; background: var(--bg-elev); border-bottom: 1px solid var(--border); font-size: .8rem; font-weight: 600; }
.legal-strip a { color: var(--text); }
@media (max-width: 760px) { .legal-strip { justify-content: center; padding: 6px 12px; } }

/* ---- Botones S, secundario y de texto (documentacion/marca/revision-interfaz.md §3.1) ---- */
.btn-s { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px; font-size: .875rem; font-weight: 600; white-space: nowrap; line-height: 1; }
.btn .ic { flex: none; }
.btn-sec { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); }
.btn-sec:hover { filter: none; border-color: var(--accent); color: var(--accent); }
.btn-sec.danger { color: var(--danger); }
.btn-sec.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-txt { background: transparent; border: 0; color: var(--accent); padding: 0 6px; }
.btn-txt:hover { filter: none; text-decoration: underline; }
.btn-ico { width: 36px; padding: 0; }
.btn-ico.on { color: var(--gold-text); border-color: var(--gold); }
.btn-ico.on .ic { fill: var(--gold); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- Base de datos (templates/games/): encabezado con pestañas, bases, filtros y tabla ---- */
.dbh h1 { margin: 0; }
.dbh > p { margin: 4px 0 14px; }
.dbh-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; margin-bottom: 20px; }
.dbh-tabs a { white-space: nowrap; }
.db-intro { margin: -4px 0 18px; max-width: 760px; }
.db-side-h { color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin: 4px 0 8px 13px; }
.db-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-side-note { color: var(--muted); font-size: .84rem; line-height: 1.45; margin: 14px 13px 0; }
.db-new { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); }
.db-new[hidden] { display: none; }
.db-new input { margin: 0; }
.db-new-a { display: flex; gap: 6px; }
.db-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 12px; }
.db-title { margin: 0; font-size: 1.3rem; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.db-title span { font-family: var(--font); font-size: .86rem; font-weight: 500; color: var(--muted); }
.db-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.db-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.db-filters input[type=text], .db-filters input[type=search], .db-filters select,
.pos-results select, .trainer .field select, .db-adv select, .db-adv input {
  height: 36px; margin: 0; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); font: inherit; font-size: .9rem; box-sizing: border-box;
}
.trainer .field select, .db-adv select, .db-adv input { width: 100%; }
.db-filters input:focus-visible, .db-filters select:focus-visible, .db-adv input:focus-visible, .db-adv select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.db-search { position: relative; flex: 1 1 220px; display: flex; align-items: center; margin: 0; }
.db-search .ic { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.db-filters .db-search input { width: 100%; padding-left: 36px; }
.db-filters input[type=text] { width: auto; flex: 1 1 150px; min-width: 0; }
.db-filters .db-open { flex: 0 1 160px; }
.db-checks { display: flex; align-items: center; gap: 10px; border: 0; margin: 0; padding: 0 4px; font-size: .88rem; }
.db-checks legend { float: left; color: var(--muted); margin-right: 2px; padding: 0; }
.db-checks label, .db-check-one { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: .88rem; font-weight: 500; white-space: nowrap; }
.db-adv { flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; padding: 14px 16px 2px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); }
.db-adv[hidden] { display: none; }
.db-adv .field label { font-size: .82rem; }
.games .elo { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.games .eco { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.games .num { text-align: right; font-variant-numeric: tabular-nums; }
.games .open-c { max-width: clamp(150px, 16vw, 340px); overflow: hidden; text-overflow: ellipsis; }
.games .pl-c { max-width: clamp(130px, 12vw, 240px); overflow: hidden; text-overflow: ellipsis; }
.games .ev-c { max-width: clamp(100px, 9vw, 240px); overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.games .fav-c { width: 22px; padding-right: 0; }
.fav-on { display: inline-flex; color: var(--gold-text); }
.fav-on .ic { fill: var(--gold); }
.th-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.th-sort:hover { color: var(--accent); text-decoration: none; }
.res-pill { display: inline-block; min-width: 38px; padding: 2px 8px; border-radius: 99px; background: var(--bg-elev); font-weight: 700; font-size: .82rem; text-align: center; font-variant-numeric: tabular-nums; }
.res-pill.win { background: #e3f1ea; color: var(--accent); }
.res-pill.loss { background: #f8e4e1; color: var(--danger); }
.res-pill.draw { background: var(--bg-elev); color: var(--muted); }
.db-pager { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.db-pager-a { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.db-page-in { width: 64px; height: 32px; text-align: center; border: 1px solid var(--border); border-radius: 8px; }
.empty-state .ico-c { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--bg-elev); color: var(--accent); }
.pos-tools { gap: 8px; margin: -4px 0 14px; }
.trainer.pos-grid { grid-template-columns: minmax(280px, 600px) minmax(280px, 360px); justify-content: start; }
@media (max-width: 760px) { .trainer.pos-grid { grid-template-columns: 1fr; } }
.pos-results { margin-top: 26px; }
.pos-results h2 { margin: 0 0 12px; font-size: 1.2rem; }
.std-new-h { margin-top: 0; font-size: 1.1rem; }
.std-tip { margin-bottom: 0; }
.std-item-a form { margin: 0; }
@media (max-width: 800px) {
  .db-side { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; align-items: center; }
  .db-side .db { flex: none; padding: 8px 12px; border-color: var(--border); }
  .db-side .db.active { border-color: var(--accent); }
  .db-side-h, .db-side-note { display: none; }
  .db-new { flex: none; flex-direction: row; }
  .db-filters .db-open { width: auto; flex: 1 1 140px; }
}

/* ---- Visor de partida (games/partida.html) sobre el esqueleto .lsn ---- */
.gv-players { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 3px; align-items: center; margin-top: 4px; }
.gv-pl { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-family: var(--serif); font-weight: 600; font-size: 1.12rem; line-height: 1.25; }
.gv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gv-dot { flex: none; width: 11px; height: 11px; border-radius: 3px; border: 1.5px solid var(--text); align-self: center; }
.gv-dot.w { background: #fff; }
.gv-dot.b { background: var(--text); }
.gv-elo { font-family: var(--font); font-size: .82rem; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.gv-res { grid-column: 2; grid-row: 1 / span 2; font-family: var(--serif); font-weight: 700; font-size: 1.2rem; padding: 6px 12px; border-radius: 10px; background: var(--bg-elev); font-variant-numeric: tabular-nums; }
.gv-res.win { background: #e3f1ea; color: var(--accent); }
.gv-res.loss { background: #f8e4e1; color: var(--danger); }
.gv-meta { flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }
.gv-meta span + span::before { content: '·'; margin-right: 10px; }
.gv-open { margin-top: 6px; padding: 7px 10px; border-radius: 8px; background: var(--bg-elev); font-size: .9rem; }
.gv-open b { font-family: var(--serif); }
.gv-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gv-acts form { margin: 0; }
/* "Buscar mis errores" en una partida importada (Premium, static/js/zz-errores.mjs). */
.gv-scan { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, var(--bg-card)); font-size: .86rem; }
.gv-scan[hidden] { display: none; }
.gv-scan p { margin: 0 0 6px; }
.gv-scan p:last-child { margin-bottom: 0; }
.gv-scan-bar { display: block; height: 6px; border-radius: 99px; background: var(--bg-elev); overflow: hidden; }
.gv-scan-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.gv-scan-side { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }

/* ---- Importar partidas (games/importar.html) ---- */
.imp { max-width: 620px; margin: 0 auto; }
.imp h1 { margin: 0; }
.imp-sub { margin: 4px 0 16px; }
.imp-form { padding: 22px; }
.imp-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px; border: 1.5px dashed var(--border); border-radius: 12px; background: var(--bg); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.imp-drop:hover, .imp-drop.over { border-color: var(--accent); background: var(--soft); }
.imp-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.imp-drop.has-file { border-style: solid; border-color: var(--accent); }
.imp-drop-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-elev); color: var(--accent); }
.imp-drop-t { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.imp-drop-s { font-size: .86rem; color: var(--muted); }
.imp-form textarea { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88rem; min-height: 120px; }
.imp-form .field select { width: 100%; height: 46px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font: inherit; font-size: 1rem; }
.imp-form .field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.imp-dest { margin-top: 4px; }
.imp-dest [hidden] { display: none; }
.imp-help { margin: 16px 4px 0; color: var(--muted); font-size: .9rem; }
.imp-help summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.imp-help ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.55; }
/* Celular: jugadores y resultado van en la barra de arriba; del encabezado quedan los botones. */
@container (max-width: 859px) {
  .gv .lsn-head:not(:has(.lsn-chips, .lsn-seg)) { display: block; }
  .gv .lsn-crumb, .gv .gv-players, .gv .gv-meta, .gv .gv-open { display: none; }
  .gv .gv-acts { margin-top: 0; }
}
.filters input, .filters select {
  padding: 9px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-family: inherit; font-size: .9rem;
}
@media (max-width: 640px) {
  .hero-review .big { font-size: 2.2rem; }
}

/* ---- Backoffice (superficie staff-only, shell propio) ---- */
.cat-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0 4px; }
.cat-search { position: relative; flex: 1; min-width: 220px; display: block; }
.cat-search input {
  width: 100%; margin: 0; padding: 11px 14px 11px 40px; font: inherit; color: var(--text);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
}
.cat-search input:focus { outline: none; border-color: var(--accent); }
.cat-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cat-search::before {
  content: "🔎"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: .95rem; opacity: .55; pointer-events: none; line-height: 1;
}
.admin-shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.admin-side { background: #14140e; color: #c7ccbe; padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; }
.admin-brand { color: #fff; font-family: var(--serif); font-weight: 600; font-size: 1.12rem; display: flex; align-items: center; gap: 9px; padding: 6px 8px 14px; text-decoration: none; }
.admin-nav { display: flex; flex-direction: column; gap: 3px; }
.admin-nav a, .admin-nav button {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: transparent; border: none;
  color: #c7ccbe; font: inherit; font-weight: 600; padding: 9px 11px; border-radius: 9px; cursor: pointer; font-size: .92rem;
  text-decoration: none;
}
.admin-nav a:hover, .admin-nav button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-nav a.active, .admin-nav button.active { background: var(--accent); color: #fff; }
.admin-nav a.disabled { opacity: .45; cursor: default; pointer-events: none; }
.pager a.disabled { opacity: .45; cursor: default; pointer-events: none; }
.admin-side .sp { flex: 1; }
.admin-back { color: #9a9a88; font-size: .85rem; padding: 9px 11px; cursor: pointer; border-top: 1px solid #2a2a1f; margin-top: 8px; text-decoration: none; display: block; }
.admin-back:hover { color: #fff; }
.admin-main { background: var(--bg); min-width: 0; }
.admin-top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 26px;
  border-bottom: 1px solid var(--border); background: var(--bg-card); position: sticky; top: 0; z-index: 5;
}
.admin-top h1 { margin: 0; font-size: 1.35rem; }
.admin-content { padding: 24px 26px; max-width: 1120px; }
.admin-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.admin-card h3 { margin: 0 0 4px; }
@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { flex-direction: row; overflow-x: auto; gap: 6px; padding: 8px; }
  .admin-brand, .admin-side .sp, .admin-back { display: none; }
  .admin-nav { flex-direction: row; gap: 6px; }
  .admin-nav a, .admin-nav button { white-space: nowrap; }
}
/* Import masivo */
.bulk-steps { display: flex; gap: 8px; margin: 2px 0 18px; flex-wrap: wrap; }
.bulk-step { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 130px; }
.bulk-step .num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg-elev); border: 1px solid var(--border);
  display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; color: var(--muted);
}
.bulk-step.active .num { background: var(--accent); color: #fff; border-color: var(--accent); }
.bulk-step.done .num { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }
.bulk-step .lbl { font-size: .82rem; font-weight: 600; color: var(--muted); }
.bulk-step.active .lbl, .bulk-step.done .lbl { color: var(--text); }
.dropzone { border: 2px dashed var(--border); border-radius: 14px; padding: 34px; text-align: center; color: var(--muted); background: var(--bg-elev); }
.dropzone .ic { font-size: 2.4rem; }
.bulk-file { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.bulk-file:last-child { border-bottom: none; }
.bulk-file .bf-meta { color: var(--muted); font-size: .82rem; margin-left: auto; white-space: nowrap; }

/* ---- Mensajería (chat profe ↔ alumno) ---- */
.chat { display: grid; grid-template-columns: 300px 1fr; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--bg-card); min-height: 540px; margin-top: 16px; }
.chat-list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 620px; }
.conv { display: flex; gap: 11px; align-items: center; padding: 13px 15px; cursor: pointer; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.conv:hover, .conv.active { background: var(--bg-elev); }
.conv .meta { flex: 1; min-width: 0; }
.conv .nm { font-weight: 600; font-size: .92rem; display: flex; justify-content: space-between; gap: 6px; }
.conv .nm .tm { color: var(--muted); font-weight: 400; font-size: .74rem; flex: none; }
.conv .sn { color: var(--muted); font-size: .83rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .unread { background: var(--accent); color: #fff; font-size: .68rem; font-weight: 800; border-radius: 999px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; flex: none; }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 11px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.chat-head .who { font-weight: 700; }
.chat-head .rol { color: var(--muted); font-size: .82rem; }
.mod-banner { background: #fdf3dd; color: #8a6d1f; font-size: .82rem; padding: 9px 18px; border-bottom: 1px solid #ecdcb3; display: flex; gap: 8px; align-items: center; }
.chat-body { flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); max-height: 460px; }
.bubble { max-width: 74%; padding: 10px 14px; border-radius: 14px; font-size: .92rem; line-height: 1.4; }
.bubble .tm { display: block; font-size: .66rem; opacity: .7; margin-top: 4px; text-align: right; }
.bubble.them { align-self: flex-start; background: var(--bg-card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.day-sep { align-self: center; color: var(--muted); font-size: .74rem; background: var(--bg-elev); padding: 3px 12px; border-radius: 999px; margin: 4px 0; }
.chat-compose { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); align-items: center; }
.chat-compose input { flex: 1; padding: 11px 14px; border: 1px solid var(--border); border-radius: 999px; font: inherit; background: var(--bg-card); color: var(--text); }
.chat-compose input:focus { outline: none; border-color: var(--accent); }
.chat-compose input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 720px) { .chat { grid-template-columns: 1fr; } .chat-list { max-height: 190px; } }

/* ---- Directorio de profesores ---- */
.prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.pcard { cursor: pointer; transition: .16s; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; }
.pcard:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 8px 22px rgba(20, 20, 15, .10); text-decoration: none; }
.pav { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #0f6b4f, #b0894f); display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 1.3rem; flex: none; }
.pcard .phead { display: flex; gap: 13px; align-items: center; }
.verified { color: var(--accent); font-size: .76rem; font-weight: 700; }
.rate { color: var(--gold-text); font-size: .85rem; font-weight: 700; }
.rate .cnt { color: var(--muted); font-weight: 400; }
.free-badge { display: inline-block; background: #e4efe8; color: var(--accent); font-weight: 700; font-size: .72rem; padding: 3px 9px; border-radius: 999px; }
.price-tag { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; }
.price-tag small { font-family: var(--font); font-weight: 600; font-size: .8rem; color: var(--muted); }
.specs { display: flex; gap: 5px; flex-wrap: wrap; }
.pp-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; margin-top: 12px; }
@media (max-width: 900px) { .pp-grid { grid-template-columns: 1fr; } }
.pp-cta { position: sticky; top: 80px; }
.review { padding: 12px 0; border-top: 1px solid var(--border); }
.review:first-of-type { border-top: none; }
.review .rh { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; }
.avail-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.avail-row .slot { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; font-size: .82rem; }

/* ---- Aperturas: tarjetas + buscador (índice por letra/código, apps.openings) ---- */
.aper-stats { display: flex; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; margin: 4px 0 20px; }
.aper-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.aper-stats .dot { opacity: .5; }

.aper-searchbar {
  position: sticky; top: 12px; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; box-shadow: 0 1px 2px rgba(20, 20, 15, .04); margin-bottom: 20px;
}
.aper-searchbar svg { flex: none; opacity: .5; color: var(--muted); }
.aper-searchbar input {
  flex: 1; border: none; background: none; font: inherit; font-size: .98rem;
  color: var(--text); outline: none;
}
.aper-searchbar input::placeholder { color: var(--muted); }
.aper-searchbar .aper-count { font-size: .78rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.aper-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: -10px 0 20px; }
.aper-filter-btn {
  border: 1px solid var(--border); background: var(--bg-card); color: var(--muted);
  font: inherit; font-size: .82rem; font-weight: 600; padding: 6px 14px; border-radius: 999px;
  cursor: pointer; transition: background .1s, border-color .1s, color .1s;
}
.aper-filter-btn:hover { border-color: var(--accent); color: var(--text); }
.aper-filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Selector de rango de Progreso — mismo patrón visual que .aper-filter-btn
   (chips), pero son <a> (recargan la página con ?rango=, no hay estado
   client-side que filtrar: rating/tiempo dedicado se recalculan server-side). */
.prog-range { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.prog-range-btn {
  border: 1px solid var(--border); background: var(--bg-card); color: var(--muted);
  font-size: .82rem; font-weight: 600; padding: 6px 14px; border-radius: 999px;
  text-decoration: none; transition: background .1s, border-color .1s, color .1s;
}
.prog-range-btn:hover { border-color: var(--accent); color: var(--text); }
.prog-range-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Gráficos de Progreso (Chart.js) — el <canvas> necesita un contenedor con
   altura explícita (Chart.js con maintainAspectRatio:false llena el 100%
   del padre, si no tiene alto crece sin límite). */
.prog-chart-wrap { position: relative; height: 220px; }
.prog-chart-wrap-sm { height: 160px; }
.prog-chart-reset {
  border: 1px solid var(--border); background: var(--bg-card); color: var(--muted);
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer; font-size: .95rem; line-height: 1;
}
.prog-chart-reset:hover { border-color: var(--accent); color: var(--text); }

.prog-medals { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.prog-medal { text-align: center; width: 76px; }
.prog-medal-ico { font-size: 1.8rem; line-height: 1; }
.prog-medal-name { font-size: .74rem; font-weight: 600; margin-top: 4px; }
.prog-medal-date { font-size: .7rem; color: var(--muted); }

.prog-recs { display: flex; flex-direction: column; gap: 8px; }
.prog-rec {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: .88rem; transition: background .1s, border-color .1s;
}
.prog-rec:hover { background: var(--bg-elev); border-color: var(--accent); }
.prog-rec-arrow { color: var(--accent); flex: none; }

/* Barra de progreso por apertura (cobertura: ejercicios distintos ya
   resueltos / total disponible) — reusa .bar/.bar>i, ver static/css para
   la definición base y core/progreso.html para el mismo patrón. */
.aper-card-meta + .bar { margin-top: 8px; }
.aper-progress-label { font-size: .74rem; color: var(--muted); margin-top: 4px; }

.aper-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.aper-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 20, 15, .04); overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.aper-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 24px -12px rgba(15, 107, 79, .28); }
.aper-card.hidden { display: none; }

.aper-card-head { padding: 18px 18px 14px; cursor: pointer; }
.aper-eco-badge {
  display: inline-block; background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--gold-text); font-weight: 700; font-size: .74rem; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.aper-card-head h3 { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; margin: 10px 0 6px; }
.aper-card-meta { font-size: .8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.aper-card-meta .sep { opacity: .5; }

.aper-card-toggle {
  width: 100%; text-align: left; background: none; border: none; border-top: 1px solid var(--border);
  padding: 10px 18px; font: inherit; font-size: .82rem; font-weight: 600; color: var(--accent);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.aper-card-toggle:hover { background: var(--bg-elev); }
.aper-card-toggle .chev { transition: transform .15s; }
.aper-card.open .aper-card-toggle .chev { transform: rotate(180deg); }

.aper-card-body { display: none; padding: 4px 18px 18px; border-top: 1px solid var(--border); }
.aper-card.open .aper-card-body { display: block; }
.aper-variant-list { margin: 10px 0 0; padding: 0; list-style: none; }
.aper-variant-list li { border-bottom: 1px solid var(--border); }
.aper-variant-list li:last-child { border-bottom: none; }
.aper-variant-list a {
  display: block; padding: 7px 4px; margin: 0 -4px; border-radius: 6px;
  font-size: .84rem; color: inherit; text-decoration: none; transition: background .1s;
}
.aper-variant-list a:hover { background: var(--bg-elev); }
.aper-variant-list a:hover .vname { color: var(--accent); }
.aper-variant-list .vname { color: var(--text); }
.aper-variant-list .vpgn { display: block; color: var(--muted); font-size: .78rem; margin-top: 1px; }
.aper-variant-list .vcount { display: block; color: var(--accent-2); font-size: .74rem; margin-top: 2px; }
/* Variante sin ejercicios: fila deshabilitada en vez de un link que lleva a
   "sin ejercicios todavía" — antes se veía igual de practicable que una con
   contenido real (ver apps/openings/views.py::_variant_puzzle_counts). */
.aper-variant-list li.empty { opacity: .55; }
.aper-variant-list .vrow { display: block; padding: 7px 4px; margin: 0 -4px; font-size: .84rem; }
.aper-variant-list li.empty .vcount { color: var(--muted); }

.aper-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 10px 0 14px; font-size: .78rem; color: var(--muted);
}
.aper-pager-btn {
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text);
  font: inherit; font-size: .78rem; font-weight: 600; padding: 5px 11px; border-radius: 8px;
  cursor: pointer;
}
.aper-pager-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.aper-pager-btn:disabled { opacity: .35; cursor: default; }
.aper-pager .aper-page-label { font-variant-numeric: tabular-nums; }

.aper-btn-play {
  display: block; width: 100%; text-align: center; background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: .88rem; border: none;
  cursor: pointer; text-decoration: none; margin-top: 12px;
}
.aper-btn-play:hover { filter: brightness(1.08); text-decoration: none; }

.aper-empty { text-align: center; color: var(--muted); padding: 50px 20px; display: none; }
.aper-empty.show { display: block; }

@media (max-width: 520px) {
  .aper-searchbar { position: static; }
}

/* ---- Responsive / móvil (topbar simple, solo usuarios anónimos) ---- */
@media (max-width: 640px) {
  .topbar { gap: 10px; padding: 10px 14px; }
  .spacer { display: none; }
  .topbar .brand { font-size: 1.1rem; }
  h1 { font-size: 1.6rem; }
}

/* ---- Nav lateral (rail, usuarios logueados) ----
   Paleta oscura reutilizada de la del propio sitio para modo oscuro (ver
   @media prefers-color-scheme:dark más arriba) — no son colores nuevos,
   es la misma tal cual, fijada acá porque el rail siempre queda oscuro
   sin importar el tema de la página. Referencia de layout: la maqueta
   comparada contra chess.com "Jugar contra bots" (Propuesta B). */
/* body.has-rail arma una grilla de 2 columnas — el rail ocupa la columna 1
   en las 3 filas (mensajes/main/footer apilados en la columna 2). Así no
   hace falta un <div> extra envolviendo mensajes+main+footer, y {% block
   content %} sigue apareciendo una sola vez en el template (Django no deja
   repetirlo ni siquiera en ramas de un {% if %} mutuamente excluyentes). */
/* Menú lateral con nombres (opción A del rediseño, 2026-11-05): ~212 px con ícono + nombre de cada
   sección. Se achica a solo íconos (68 px) en las pantallas con tablero (.lsn) y en pantallas
   angostas, para no quitarle lugar al tablero. En el celular pasa a una barra abajo. */
body.has-rail { --nav-w: 212px; display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); grid-template-rows: auto 1fr auto; min-height: 100vh; }
body.has-rail:has(main .lsn) { --nav-w: 68px; }
@media (max-width: 1180px) { body.has-rail { --nav-w: 68px; } }
body.has-rail > .side-rail { grid-column: 1; grid-row: 1 / 4; }
body.has-rail > .messages { grid-column: 2; grid-row: 1; }
body.has-rail > main.wrap { grid-column: 2; grid-row: 2; }
body.has-rail > .footer { grid-column: 2; grid-row: 3; }

.side-rail {
  background: #15170f; color: #f2efe4; width: var(--nav-w);
  display: flex; flex-direction: column; padding: 14px 10px;
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; overflow-x: hidden;
  z-index: 60; /* sticky arma su propio apilado: sin esto el panel de notificaciones quedaba debajo del tablero */
}
.side-rail .brand-mark { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #f4efe4; flex: none; }
.side-rail .brand-mark:hover { text-decoration: none; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.18rem; white-space: nowrap; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: #b9b5a3; text-decoration: none; font-size: .93rem; font-weight: 600; white-space: nowrap; flex: none;
}
.side-link .nav-ic { flex: none; }
.side-link:hover { background: rgba(255, 255, 255, .07); color: #f4efe4; text-decoration: none; }
.side-link.on { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 #d2ac74; }
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 99px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; text-align: center; }
.side-spacer { flex: 1; min-height: 14px; }
.side-me { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: .8rem; color: #9a9683; white-space: nowrap; }
.side-me .plan { padding: 1px 8px; border-radius: 99px; border: 1px solid #3a3d2f; font-weight: 700; }
.side-me .plan.prem { color: #d2ac74; border-color: #6b5832; }
.side-tools { display: flex; align-items: center; gap: 4px; padding: 4px 6px; }
.side-rail .side-icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: #b9b5a3; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; flex: none;
}
.side-rail .side-icon-btn:hover { background: rgba(255, 255, 255, .08); color: #f4efe4; }
.side-rail .avatar { flex: none; margin-left: auto; }
.side-rail .dot-badge { position: absolute; top: 3px; right: 3px; }
.side-logout { display: inline-flex; background: none; border: none; color: #9a9683; cursor: pointer; padding: 8px; border-radius: 10px; }
.side-logout:hover { color: #f4efe4; background: rgba(255, 255, 255, .08); }
.side-tools form { margin: 0; }
/* El rail tiene scroll propio (overflow): un panel absoluto adentro quedaba recortado. Fixed lo saca
   del recorte; se abre hacia arriba desde el pie del menú. */
.side-rail .notif-panel { position: fixed; left: calc(var(--nav-w) + 10px); right: auto; top: auto; bottom: 16px; margin: 0; color: var(--text); }

/* Menú achicado: solo íconos (el nombre queda en el title de cada link). Solo en la compu: en el
   celular el menú es la barra de abajo, igual en todas las pantallas. */
@media (min-width: 761px) {
  body.has-rail:has(main .lsn) .side-rail :is(.brand-name, .side-link .lbl, .side-me),
  body.has-rail:has(main .lsn) .side-link .nav-badge { display: none; }
  body.has-rail:has(main .lsn) .side-rail { padding: 14px 8px; }
  body.has-rail:has(main .lsn) .side-link { justify-content: center; padding: 10px 0; }
  body.has-rail:has(main .lsn) .side-rail .brand-mark { justify-content: center; padding: 4px 0 18px; }
  body.has-rail:has(main .lsn) .side-tools { flex-direction: column; padding: 0; }
  body.has-rail:has(main .lsn) .side-rail .avatar { margin: 4px 0 0; }
  body.has-rail:has(main .lsn) .side-link.has-due::after { content: ''; position: absolute; top: 7px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
}
@media (min-width: 761px) and (max-width: 1180px) {
  .side-rail :is(.brand-name, .side-link .lbl, .side-me), .side-link .nav-badge { display: none; }
  .side-rail { padding: 14px 8px; }
  .side-link { justify-content: center; padding: 10px 0; }
  .side-rail .brand-mark { justify-content: center; padding: 4px 0 18px; }
  .side-tools { flex-direction: column; padding: 0; }
  .side-rail .avatar { margin: 4px 0 0; }
  .side-link.has-due::after { content: ''; position: absolute; top: 7px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
}

@media (max-width: 760px) {
  body.has-rail { display: block; --mbar: calc(58px + env(safe-area-inset-bottom, 0px)); }
  body.has-rail > .side-rail {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto; width: 100%;
    height: var(--mbar); box-sizing: border-box;
    flex-direction: row; justify-content: space-around; align-items: center;
    padding: 4px 4px env(safe-area-inset-bottom, 0px); overflow: visible; z-index: 50; border-top: 1px solid #2c3022;
  }
  .side-rail .brand-mark, .side-me, .side-spacer, .side-link.nav-sec { display: none; }
  .side-nav { flex-direction: row; gap: 0; }
  .side-link { flex-direction: column; gap: 2px; padding: 6px 8px; font-size: .64rem; box-shadow: none; }
  .side-rail .side-link .lbl { display: block; }
  .side-link.on { box-shadow: none; }
  .side-tools { flex-direction: row; padding: 0; }
  .side-rail .avatar { margin: 0 0 0 4px; }
  .side-tools form { display: none; }
  .side-rail .notif-panel { left: 8px; right: 8px; bottom: calc(var(--mbar) + 12px); width: auto; max-width: none; }
  /* El pie va después del contenido: es él quien reserva el lugar de la barra (si no, los links
     legales de la última línea quedaban tapados). */
  body.has-rail > .footer { padding-bottom: calc(var(--mbar) + 26px); }
}

/* Aviso de cookies: en la esquina, para no tapar el contenido del centro (en la portada tapaba
   el botón que aparece bajo el tablero al terminar el mate). En el celular, ancho completo y
   arriba de la barra de navegación. */
#cookie-banner { position: fixed; left: 16px; bottom: 16px; max-width: 420px; margin: 0; z-index: 90; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
body.has-rail #cookie-banner { left: calc(var(--nav-w) + 16px); }
@media (max-width: 760px) {
  #cookie-banner { right: 16px; max-width: none; }
  body.has-rail #cookie-banner { left: 16px; bottom: calc(var(--mbar) + 16px); }
}

/* Ruta del Maestro */
.banner-ruta { background: linear-gradient(135deg,#17170f,#123726); border: none; color: #f4efe4; }
.banner-ruta h3 { color: #f4efe4; margin: 0 0 4px; }
.route { margin-top: 10px; }
.stage { display: flex; gap: 16px; }
.stage .node-col { display: flex; flex-direction: column; align-items: center; flex: none; width: 34px; }
.stage .node {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif);
  font-weight: 700; background: var(--bg-elev); border: 2px solid var(--border); color: var(--muted); flex: none;
}
.stage .line { flex: 1; width: 2px; background: var(--border); margin: 2px 0; min-height: 14px; }
.stage:last-child .line { display: none; }
.stage .body { flex: 1; padding-bottom: 16px; }
.stage.done .node { background: var(--accent); border-color: var(--accent); color: #fff; }
.stage.current .node { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px #e4efe8; }
.stage.locked .body { opacity: .55; }
.stage.current .body .card, .stage.done .body .card { cursor: pointer; }
.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.op { border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; transition: .12s; background: var(--bg-card); }
.op:hover { border-color: var(--accent); }
.op.sel { border-color: var(--accent); background: #eef6f2; }
.op .chk { float: right; color: var(--accent); font-weight: 800; opacity: 0; }
.op.sel .chk { opacity: 1; }
.op .nm { font-weight: 600; }
.op .sd { font-size: .76rem; color: var(--muted); }
.challenge { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.challenge:last-child { border-bottom: none; }
.challenge .ic { font-size: 1.5rem; flex: none; }
.challenge .txt { flex: 1; }

/* Cursos: lección de lectura (árbol con variantes) + pestañas de líneas — courses/lesson.html */
.tree-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.seg .seg-off { color: var(--muted); font-weight: 700; padding: 6px 16px; opacity: .5; cursor: not-allowed; }
.tree-lines { display: flex; flex-wrap: wrap; gap: 6px; }
.tree-line {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font-size: .88rem; font-weight: 600;
}
.tree-line:hover { border-color: var(--accent); text-decoration: none; }
.tree-line.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tree-line.locked { color: var(--muted); background: var(--bg-elev); }
.tree-line .tag { margin: 0 0 0 2px; padding: 1px 8px; font-size: .7rem; }
.tree-line-ok { color: var(--accent-2); font-weight: 800; }
.tree-line.active .tree-line-ok { color: #fff; }
.notation .mv-row .tree-gap { flex: 1; min-width: 64px; padding: 2px 6px; color: var(--muted); }
.notation.tree { display: block; line-height: 1.7; }
.notation.tree .mv-row { padding: 2px 6px; }
.notation.tree .mv-row:nth-of-type(even) { background: transparent; }
.notation.tree .mv-row + .mv-row { border-top: 1px solid var(--bg-elev); }
.notation.tree > .tree-comment { display: block; margin: 4px 6px 6px 34px; }
.notation.tree .tree-comment { color: var(--muted); font-size: .9rem; }
.notation.tree .tree-var .tree-comment { margin: 0 4px; }
.notation.tree .tree-var {
  margin: 2px 0 6px 22px; padding: 2px 0 2px 10px; border-left: 2px solid var(--border); font-size: .92rem;
}
.notation.tree .tree-var.deep { margin-left: 12px; border-left-style: dashed; }
.notation.tree .tree-var .mv { padding: 1px 4px; white-space: nowrap; }
.notation.tree { overflow-x: hidden; overflow-wrap: anywhere; }
.notation.tree .tree-no { color: var(--muted); font-weight: 400; margin-right: 2px; }
.notation.tree .mv.cur .tree-no, .notation.tree .mv.cur .tree-nag { color: #fff; }
.notation .tree-nag { font-weight: 700; margin-left: 1px; }
.notation .tree-nag.good, .notation .tree-nag.brilliant { color: var(--accent); }
.notation .tree-nag.interesting { color: var(--accent-2); }
.notation .tree-nag.dubious, .notation .tree-nag.mistake { color: var(--gold-text); }
.notation .tree-nag.blunder { color: var(--danger); }

/* ---- Lección de curso (courses/lesson.html) — propuesta A, 2026-11-04 ----
   Capítulos | tablero | un solo panel (cabecera / jugadas con scroll propio / barra fija).
   El tablero sale del ALTO de la pantalla y los dos costados miden lo mismo que él.
   Anchos medidos contra Lichess Study (350 · 835 · 389 a 1920) y el lienzo de Estudio.
   - 3 columnas si el tablero queda en 620 px o más (>= 1342 px de contenido);
   - 2 columnas debajo de eso: los capítulos pasan a la pestaña "Capítulos" del panel;
   - apilado (celular/tablet vertical): tablero arriba a lo ancho, panel debajo hasta el
     final de la pantalla, sin scroll de página; la lista se acomoda sola a la jugada. */
.wrap:has(.lsn) { max-width: none; padding: 20px 24px; container-type: inline-size; }
.lsn {
  --side: 300px; --panel: 390px; --gap: 16px; --chrome: 40px;
  --soft: color-mix(in srgb, var(--accent) 11%, var(--bg-card));
  --b: min(calc(100vh - var(--chrome) - var(--pb, 0px)), calc(100cqw - var(--side) - var(--panel) - 2 * var(--gap)));
  display: grid; grid-template-columns: var(--side) var(--b) var(--panel);
  gap: var(--gap); justify-content: center; align-items: start;
}
@container (min-width: 1600px) { .lsn { --side: 320px; --panel: 420px; } }
.lsn .board-wrap { max-width: none; width: var(--b); border-radius: 6px; box-shadow: 0 2px 10px rgba(23, 23, 15, .16); }
.lsn-side, .lsn-panel {
  height: var(--b); background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  display: flex; flex-direction: column; overflow: hidden; min-width: 0;
}
.lsn-mtop, .lsn-tabs, .lsn-side-close { display: none; }

/* Columna de capítulos */
.lsn-side-h { position: relative; padding: 14px 16px 12px; border-bottom: 1px solid var(--border); }
.lsn-back { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.1rem; line-height: 1.25; color: var(--text); margin-bottom: 8px; }
.lsn-back:hover { color: var(--accent); text-decoration: none; }
.lsn-prog { height: 6px; border-radius: 99px; background: var(--bg-elev); overflow: hidden; }
.lsn-prog > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.lsn-prog-t { font-size: .76rem; color: var(--muted); margin-top: 5px; font-variant-numeric: tabular-nums; }
.lsn-side-b { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 0; }
.lsn-side-f { border-top: 1px solid var(--border); padding: 9px 16px; font-size: .76rem; color: var(--muted); }
.lsn kbd { font-family: var(--font); font-size: .72rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--bg); }
.lsn-chapters, .lsn-lines { list-style: none; margin: 0; padding: 0; }
.lsn-ch-row { display: flex; align-items: baseline; gap: 2px; padding: 9px 16px; font-size: .9rem; color: var(--text); line-height: 1.35; }
.lsn-ch-row .dot { flex: none; transform: translateY(-1px); }
.lsn-ch-row .t { flex: 1; min-width: 0; }
.lsn-ch-row.locked { color: var(--muted); }
a.lsn-ch-row:hover { background: var(--bg-elev); text-decoration: none; }
.lsn-ch.on > .lsn-ch-row { background: var(--bg-elev); color: var(--accent); font-weight: 700; }
.lsn-line { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 33px; font-size: .86rem; color: var(--text); }
.lsn-line:hover { background: var(--bg-elev); text-decoration: none; }
.lsn-line .ic { display: flex; color: var(--muted); }
.lsn-line .end { margin-left: auto; }
.lsn-line .ok { color: var(--accent); font-weight: 800; }
.lsn-line .tag, .lsn-chip .tag { margin: 0; padding: 1px 7px; font-size: .68rem; }
.lsn-line.on { background: var(--soft); box-shadow: inset 3px 0 var(--accent); font-weight: 700; }
.lsn-line.on .ic { color: var(--accent); }
.lsn-line.locked { color: var(--muted); }

/* Panel: cabecera mínima */
.lsn-head { padding: 12px 16px 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.lsn-title { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; line-height: 1.25; }
.lsn-sub { display: flex; align-items: center; gap: 10px; font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lsn-sub .lsn-prog { flex: 1; height: 4px; min-width: 40px; }
.lsn-chips { display: none; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.lsn-chip {
  flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--muted); font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.lsn-chip:hover { border-color: var(--accent); text-decoration: none; }
.lsn-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lsn-chip .ok { color: var(--accent); font-weight: 800; }
.lsn-chip.on .ok { color: #fff; }
.lsn-chip.locked { background: var(--bg-elev); }
.lsn-seg { display: flex; background: var(--bg-elev); border-radius: 99px; padding: 3px; gap: 2px; }
.lsn-seg a { flex: 1; text-align: center; padding: 5px 10px; border-radius: 99px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.lsn-seg a:hover { text-decoration: none; color: var(--text); }
.lsn-seg a.on { background: var(--bg-card); color: var(--accent); box-shadow: 0 1px 2px rgba(23, 23, 15, .12); }
.lsn-tabs { border-bottom: 1px solid var(--border); }
.lsn-tabs button { flex: 1; border: 0; background: transparent; padding: 10px 0 9px; font-size: .86rem; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; border-radius: 0; }
.lsn-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.lsn-pane { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 0; }

/* Panel: jugadas (un solo componente de notación, como Lichess) */
.lsn-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.lsn-body[hidden], .lsn-pane[hidden] { display: none; }
.lsn-nt { font-size: 16.5px; }
.lsn-nt .rw { display: grid; grid-template-columns: 44px 1fr 1fr; }
.lsn-nt .ix { background: var(--bg); color: var(--muted); text-align: center; padding: 5px 0; font-size: .9rem; font-variant-numeric: tabular-nums; border-right: 1px solid var(--bg-elev); }
.lsn-nt .mv { padding: 5px 10px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.lsn-nt .mv.gap { color: var(--muted); opacity: .6; cursor: default; }
.lsn-nt .mv:not(.gap):hover, .lsn-nt .vm:hover { background: var(--soft); }
.lsn-nt .mv.cur, .lsn-nt .vm.cur { background: var(--accent); color: #fff; font-weight: 700; }
.lsn-nt .mv.cur .ng, .lsn-nt .vm.cur .ng, .lsn-nt .vm.cur .no { color: #fff; }  /* gana a .ng.good (verde sobre verde) */
.lsn-nt .key::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-left: 5px; vertical-align: 2px; }
.lsn-nt .ng { font-weight: 800; margin-left: 1px; }
.lsn-nt .ng.good { color: var(--accent); }
.lsn-nt .ng.bad { color: var(--danger); }
.lsn-nt .ng.int { color: var(--gold-text); }
.lsn-nt .cm { padding: 9px 14px 10px 16px; font-size: 16px; line-height: 1.55; border-top: 1px solid var(--bg-elev); border-bottom: 1px solid var(--bg-elev); }
.lsn-nt .cm.intro { background: var(--bg); border-top: 0; }
.lsn-nt .var { background: var(--bg); padding: 7px 14px 7px 18px; font-size: 15.5px; line-height: 1.75; border-bottom: 1px solid var(--bg-elev); overflow-wrap: anywhere; }
.lsn-nt .var .var { background: transparent; border: 0; border-left: 2px dashed var(--border); margin: 3px 0 3px 4px; padding: 0 0 0 10px; }
.lsn-nt .vm { padding: 1px 4px; border-radius: 4px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.lsn-nt .no { color: var(--muted); font-weight: 500; margin-right: 2px; }
.lsn-nt .vc { color: var(--muted); padding: 1px 3px; border-radius: 4px; }
.lsn-nt .here, .lsn-end.here { background: var(--soft); box-shadow: inset 3px 0 var(--accent); }
.lsn-nt .vc.here { color: var(--text); box-shadow: none; }
.lsn-nt [role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lsn-end { margin: 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg); font-size: .95rem; }
.lsn-end b { font-family: var(--serif); font-size: 1.08rem; }
.lsn-task { margin: 12px 12px 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: .98rem; }
.lsn-turn { margin: 0 12px 10px; padding: 10px 12px; border-radius: 10px; font-weight: 700; font-size: 1.02rem; }
.lsn-turn.ask { background: var(--soft); color: #123726; }
/* Un aviso que queda fijo arriba del panel mientras la lista scrollea ("Te toca" en Jugarla). */
.lsn-sticky { position: sticky; top: 0; z-index: 2; margin-top: 10px; box-shadow: 0 -10px 0 0 var(--bg-card), 0 6px 0 0 var(--bg-card); }
.lsn-turn.ok { background: var(--accent); color: #fff; }
.lsn-turn.bad { background: color-mix(in srgb, var(--danger) 12%, var(--bg-card)); color: var(--danger); }
.lsn-fen { margin: 0 12px; font-size: .8rem; color: var(--muted); }
/* Pantalla de error del entrenador (Jugarla / Repaso / Mi repertorio) */
.lsn-err, .lsn-why { margin: 10px 12px; padding: 12px 14px; border-radius: 10px; font-size: .95rem; line-height: 1.45; }
.lsn-err { background: color-mix(in srgb, var(--danger) 7%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--bg-card)); }
.lsn-err b, .lsn-why b { display: block; margin-bottom: 2px; }
.lsn-err .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); margin-right: 7px; vertical-align: 1px; }
.lsn-why { background: var(--bg-elev); }
.lsn-why b { font-size: .9rem; }
.lsn-err[hidden], .lsn-why[hidden], .lsn-turn[hidden] { display: none; }
.lsn-nt .mv.ask { background: var(--bg-elev); border-radius: 4px; font-weight: 700; }
.lsn-nt .mv.ask.err { background: color-mix(in srgb, var(--danger) 14%, var(--bg-card)); color: var(--danger); }
.lsn-nav .lsn-act { flex: 1; }
.lsn-nb.lsn-nb-alt { flex: 0 0 auto; padding: 0 16px; background: var(--bg-card); border: 1px solid var(--border); }
.lsn-fen code { display: block; margin-top: 4px; word-break: break-all; color: var(--text); }

/* Panel: barra fija abajo */
.lsn-foot { border-top: 1px solid var(--border); padding: 8px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-card); }
.lsn-nav { display: flex; gap: 6px; }
.lsn-nb {
  flex: 1; height: 42px; border: 0; border-radius: 8px; background: var(--bg-elev); color: var(--text);
  font-size: 1.15rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.lsn-nb:hover:not(:disabled) { background: color-mix(in srgb, var(--bg-elev) 85%, var(--text)); text-decoration: none; }
.lsn-nb:disabled { opacity: .35; cursor: default; }
.lsn-nb.sm { flex: 0 0 42px; font-size: 1rem; color: var(--muted); }
.lsn-nb.txt { font-size: .86rem; font-weight: 700; padding: 0 10px; gap: 6px; }
.lsn-act { height: 42px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: .9rem; font-weight: 700; cursor: pointer; }
.lsn-act:hover { background: var(--accent-2); }
.lsn-act[hidden], .lsn-nb[hidden], .lsn-nav[hidden], #rep-srs[hidden] { display: none; }
.lsn-grade-box { padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 9%, var(--bg-card)); border: 1.5px solid var(--accent); animation: grade-in .35s ease-out; }
@keyframes grade-in { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.lsn-grade-box[hidden] { display: none; }
.lsn-grade-q { font-size: .88rem; color: var(--text); text-align: center; margin-bottom: 8px; }
.lsn-grade-k { font-size: .72rem; color: var(--muted); text-align: center; margin-top: 6px; }
.lsn-grade { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lsn-grade button { min-height: 64px; padding: 6px 2px; line-height: 1.2; position: relative; border-radius: 8px; border: 1.5px solid var(--border); background: var(--bg-card); font-weight: 700; font-size: .85rem; cursor: pointer; }
.lsn-grade button:hover { border-color: currentColor; }
.lsn-grade .g1 { color: var(--danger); }
.lsn-grade .g2 { color: var(--gold-text); }
.lsn-grade .g3 { color: var(--accent); }
.lsn-grade .g4 { color: #3c5f86; }

.lsn-grade button small { display: block; margin-top: 2px; font-size: .68rem; font-weight: 500; color: var(--muted); }
.lsn-grade button span { display: block; font-size: .72rem; font-weight: 600; color: var(--text); opacity: .8; }
.lsn-grade button.sug { border-color: currentColor; border-width: 2px; background: color-mix(in srgb, currentColor 10%, var(--bg-card)); }
.lsn-grade button.sug::before { content: 'Sugerido'; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 0 7px; border-radius: 99px; color: #fff; font-size: .62rem; font-weight: 800; line-height: 16px; white-space: nowrap; }
.lsn-grade .g1.sug::before { background: var(--danger); }
.lsn-grade .g2.sug::before { background: var(--gold-text); }
.lsn-grade .g3.sug::before { background: var(--accent); }
.lsn-grade .g4.sug::before { background: #3c5f86; }
.lsn-crumb { font-size: .8rem; font-weight: 600; color: var(--muted); }
.lsn-act-link { display: flex; align-items: center; justify-content: center; }
.lsn-act-link:hover { text-decoration: none; color: #fff; }
.lsn-rating { margin: 12px 12px 0; font-size: .95rem; font-variant-numeric: tabular-nums; }
.lsn-rating[hidden] { display: none; }
.lsn-title-sub { font-family: var(--font); font-size: .85rem; font-weight: 500; color: var(--muted); }
.lsn-title .tag { font-family: var(--font); font-size: .7rem; margin-left: 6px; vertical-align: 2px; }
.lsn-meta { margin: 12px; display: flex; flex-direction: column; gap: 8px; font-size: .86rem; color: var(--muted); }
.lsn-meta[hidden], .lsn-meta a[hidden] { display: none; }
.lsn-analyze { display: block; margin: 12px 12px 0; padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--accent); color: var(--accent); font-weight: 700; font-size: .9rem; text-align: center; }
.lsn-analyze:hover { background: var(--soft); text-decoration: none; }
.lsn-analyze[hidden] { display: none; }
.lsn-meta .theme-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* Sin columna izquierda (Repaso, y a futuro el entrenador de táctica): tablero | panel. */
.lsn.no-side { --b: min(calc(100vh - var(--chrome) - var(--pb, 0px)), calc(100cqw - var(--panel) - var(--gap))); grid-template-columns: var(--b) var(--panel); }

/* 2 columnas: la lista de capítulos pasa a una pestaña del panel. */
@container (max-width: 1341px) {
  .lsn { --panel: 400px; --b: min(calc(100vh - var(--chrome) - var(--pb, 0px)), calc(100cqw - var(--panel) - var(--gap))); grid-template-columns: var(--b) var(--panel); }
  .lsn-side { display: none; }
  .lsn-tabs { display: flex; }
  .lsn-chips { display: flex; }
}

/* Apilado: tablero arriba a lo ancho, panel hasta el final de la pantalla. */
@container (max-width: 859px) {
  .lsn, .lsn.no-side {
    --stack: 40px;
    --b: min(100cqw, calc(100dvh - var(--stack) - var(--pb, 0px) - 320px));
    display: flex; flex-direction: column; align-items: stretch; gap: 0; height: calc(100dvh - var(--stack) - var(--pb, 0px));
  }
  .lsn > * { flex: none; }
  .lsn-mtop { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px; background: var(--bg-card); border-bottom: 1px solid var(--border); position: relative; }
  .lsn-mback { font-size: 1.4rem; line-height: 1; color: var(--muted); width: 26px; text-align: center; }
  .lsn-mback:hover { text-decoration: none; color: var(--text); }
  .lsn-mtitle { flex: 1; min-width: 0; font-family: var(--serif); font-weight: 600; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lsn-mcount { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
  .lsn-mbtn { border: 1px solid var(--border); background: var(--bg-card); border-radius: 8px; height: 32px; padding: 0 10px; font-size: .8rem; font-weight: 700; color: var(--accent); cursor: pointer; }
  .lsn-mbar { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--bg-elev); }
  .lsn-mbar > i { display: block; height: 100%; width: 0; background: var(--accent); }
  .lsn-board { width: 100%; display: flex; justify-content: center; }
  .lsn .board-wrap { width: min(100%, var(--b)); border-radius: 0; box-shadow: none; }
  .lsn-panel { flex: 1 1 auto; min-height: 0; height: auto; border-radius: 0; border-width: 0; }
  .lsn-tabs, .lsn-title, .lsn-sub, .lsn-head .lsn-crumb { display: none; }
  .lsn-head { padding: 6px 10px; gap: 6px; }
  .lsn-head:not(:has(.lsn-chips, .lsn-seg)) { display: none; }
  .lsn.is-err .lsn-head { display: none; }  /* con un error, lugar para las tarjetas */
  .lsn-foot { padding: 6px 8px; }
  .lsn-nb, .lsn-act { height: 46px; }
  /* La lista de capítulos se abre como una hoja debajo de la barra de arriba. */
  .lsn-side.open {
    display: flex; position: fixed; z-index: 60; left: 0; right: 0; top: 44px; height: auto; max-height: 70vh;
    border-radius: 0 0 14px 14px; box-shadow: 0 16px 40px rgba(23, 23, 15, .3);
  }
  .lsn-side.open .lsn-side-close { display: block; position: absolute; right: 10px; top: 10px; border: 0; background: transparent; font-size: 1.4rem; line-height: 1; color: var(--muted); cursor: pointer; }
  .lsn-side-f { display: none; }
}
@media (max-width: 760px) {
  body.has-rail > main.wrap:has(.lsn) { padding: 0 0 var(--mbar, 0px); }
  .lsn, .lsn.no-side { --stack: var(--mbar, 0px); }
}

/* ---- Estudio (games/estudio.html): mismo esqueleto .lsn + editor de anotaciones y motor ---- */
.std-title { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; margin: -3px -6px; background: transparent; color: var(--text); width: calc(100% + 12px); }
.std-title:hover { border-color: var(--border); }
.std-title:focus { border-color: var(--accent); background: var(--bg-card); outline: none; }
#save-state.bad { color: var(--danger); font-weight: 700; }
.std-sub-a { margin-left: auto; }
.std-dl { display: inline-flex; align-items: center; gap: 4px; }
.std-eng { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .84rem; }
.std-switch { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; cursor: pointer; }
.std-switch input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.std-eval { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 3.5em; }
.std-eval.w { color: var(--accent); }
.std-eval.b { color: var(--text); }
.std-depth { color: var(--muted); font-size: .76rem; }
.std-pv { flex-basis: 100%; padding: 6px 9px; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: .84rem; line-height: 1.45; cursor: pointer; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.std-pv:hover { color: var(--text); background: var(--soft); }
.std-pv[hidden] { display: none; }
/* Motor del estudio: barra (interruptor, evaluación, profundidad, líneas, flechas) + una fila por línea. */
.eng { margin-top: 2px; }
.eng-bar { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.tgl { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; font-weight: 700; font-size: .9rem; }
.tgl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tgl-t { position: relative; flex: none; width: 34px; height: 20px; border-radius: 99px; background: var(--border); transition: background .15s; }
.tgl-t::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.tgl input:checked + .tgl-t { background: var(--accent); }
.tgl input:checked + .tgl-t::after { transform: translateX(14px); }
.tgl input:focus-visible + .tgl-t { outline: 2px solid var(--accent); outline-offset: 2px; }
.eng-eval { min-width: 3.6em; padding: 3px 8px; border-radius: 6px; font-weight: 800; font-size: .95rem; text-align: center; font-variant-numeric: tabular-nums; }
.eng-eval:empty { display: none; }
.eng-eval.w { background: #fff; color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.eng-eval.b { background: #2b2a24; color: #fff; }
.eng-eval.eq { background: var(--bg-elev); color: var(--text); }
.eng-depth { color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eng-tools { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.eng:not(.on) .eng-tools { opacity: .45; }
.eng-n { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--bg-elev); }
.eng-n button { width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 700; font-size: .82rem; cursor: pointer; }
.eng-n button[aria-pressed="true"] { background: var(--bg-card); color: var(--text); box-shadow: 0 1px 3px rgba(23,23,15,.12); }
.eng-ico { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); color: var(--muted); cursor: pointer; }
.eng-ico[aria-pressed="true"] { color: #2f6db0; border-color: #9cbde0; background: #eef4fb; }
.eng-n button:focus-visible, .eng-ico:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.eng-lines { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--bg-elev); border-radius: 8px; overflow: hidden; }
.eng-lines[hidden] { display: none; }
.eng-lines li { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; font-size: .86rem; line-height: 1.4; cursor: pointer; }
.eng-lines li + li { border-top: 1px solid var(--bg-elev); }
.eng-lines li:hover, .eng-lines li:focus-visible { background: var(--soft); outline: none; }
.eng-sc { flex: none; min-width: 3.4em; padding: 1px 5px; border-radius: 4px; font-weight: 800; font-size: .8rem; text-align: center; font-variant-numeric: tabular-nums; }
.eng-sc.w { background: #fff; box-shadow: inset 0 0 0 1px var(--border); }
.eng-sc.b { background: #2b2a24; color: #fff; }
.eng-sc.eq { background: var(--bg-elev); }
.eng-mv { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.std-edit { display: flex; flex-direction: column; gap: 6px; }
.std-edit[hidden] { display: none; }
.std-nags { display: flex; flex-wrap: wrap; gap: 4px; }
.std-nag, .std-tool { height: 32px; min-width: 36px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-card); font-weight: 800; font-size: .86rem; cursor: pointer; padding: 0 8px; color: var(--text); }
.std-nag[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.std-nag:disabled, .std-tool:disabled { opacity: .35; cursor: default; }
.std-tool { font-size: .95rem; color: var(--muted); }
.std-tool:first-of-type { margin-left: auto; }
.std-tool.danger:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
#std-comment { width: 100%; resize: vertical; min-height: 44px; max-height: 160px; font: inherit; font-size: .88rem; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
#std-comment:focus { outline: none; border-color: var(--accent); background: var(--bg-card); }
.std-new { color: var(--accent); font-weight: 700; }
/* Mis estudios (lista) */
.std-list-grid { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 18px; align-items: start; }
.std-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.std-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 14px 16px; }
.std-item-t { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; flex: 1 1 240px; }
.std-item-a { display: flex; gap: 6px; }
.std-more { margin: 4px 0 12px; }
.std-more summary { cursor: pointer; font-size: .88rem; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.std-more textarea { width: 100%; font-family: ui-monospace, monospace; font-size: .82rem; }
@media (max-width: 760px) { .std-list-grid { grid-template-columns: 1fr; } }
@container (max-width: 859px) { .std .lsn-head { display: flex; } .std .std-title, .std .lsn-sub { display: none; } }
/* ---- Editor de cursos (courses/editor_chapter.html y editor_course.html) ---- */
.ced-ed .lsn-chips { display: flex; flex-wrap: wrap; overflow: visible; }
.ced-add { position: relative; }
.ced-add summary { list-style: none; cursor: pointer; color: var(--accent); border-style: dashed; }
.ced-add summary::-webkit-details-marker { display: none; }
.ced-add-f {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 260px; display: flex; flex-direction: column; gap: 8px;
  padding: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgba(23, 23, 15, .18);
}
.ced-add-f label { font-size: .86rem; display: flex; gap: 6px; align-items: center; }
.ced-add-f input[name="fen"] { font-size: .8rem; padding: 6px 8px; }
.ced-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ced-line input, .ced-line select { font: inherit; font-size: .84rem; padding: 4px 7px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-card); color: var(--text); }
.ced-line #ln-name { flex: 1 1 140px; min-width: 0; font-weight: 600; }
.ced-free { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 600; }
.ced-free input { accent-color: var(--accent); }
.ced-line-act { display: flex; gap: 4px; margin-left: auto; }
.ced-line-act .lsn-nb { height: 30px; min-width: 32px; }
.ced-line-act .danger:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.ced-warn { background: var(--soft); }
.ced-hint { min-height: 1.2em; }
.ced-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; }
.ced-preview .tag { margin: 0; }
.ced-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.ced-head h1 { margin: 8px 0 0; }
.ced-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ced-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr); gap: 18px; align-items: start; margin-top: 14px; }
.ced-col { display: flex; flex-direction: column; gap: 18px; }
.ced-grid h2 { font-size: 1.1rem; margin: 0 0 10px; }
.ced-chapters { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; }
.ced-chapters > li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.ced-chapters > li:target { background: var(--soft); }
.ced-ch-t { flex: 1 1 240px; display: flex; gap: 10px; color: var(--text); font-weight: 600; min-width: 0; }
.ced-ch-t .n { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.6em; text-align: right; }
.ced-ch-meta { display: inline-flex; gap: 8px; align-items: center; }
.ced-ch-more summary { list-style: none; cursor: pointer; padding: 0 8px; border-radius: 6px; font-weight: 800; color: var(--muted); }
.ced-ch-more summary::-webkit-details-marker { display: none; }
.ced-ch-more[open] { flex-basis: 100%; }
.ced-ch-menu { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 4px 2.6em; }
.ced-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.ced-inline input { flex: 1 1 200px; min-width: 0; }
.ced-new { padding-top: 4px; }
.ced-versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; }
.ced-versions li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.ced-v-act { display: flex; gap: 6px; }
.btn.danger:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
@media (max-width: 900px) { .ced-grid { grid-template-columns: 1fr; } }
/* ---- Inicio (core/dashboard.html, rediseño 2026-11-05) ---- */
.home-verify { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.home-verify-a { display: flex; gap: 10px; align-items: center; }
.home-verify-a form { margin: 0; }
.home-plan { margin: 0; font-size: .9rem; color: var(--muted); }
.home-sec { font-family: var(--font); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.home-teacher { margin-bottom: 30px; border-color: var(--accent); }
.home-teacher-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.home-teacher ul { list-style: none; padding: 0; margin: 6px 0 0; }
.home-teacher li { padding: 8px 0; border-bottom: 1px solid var(--border); }

/* ===== Inicio, opción A (documentacion/marca/maquetas-inicio/, 2026-11-08): .hm-* ===== */
.hm { max-width: 1320px; }
.hm-head { display: flex; justify-content: space-between; align-items: center; gap: 10px 20px; flex-wrap: wrap; margin: 4px 0 18px; }
.hm-head h1 { margin: 0; font-size: 2.1rem; }
.hm-chips { display: flex; gap: 8px; }
.hm-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px; padding: 6px 13px; font-size: .86rem; font-weight: 700; color: var(--text); }
.hm-chip:hover { text-decoration: none; border-color: var(--accent); }
.hm-chip .ic { color: var(--accent); }
.hm-k { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--gold-text); }
.hm-k.sm { font-size: .66rem; }
.hm-sec { font-family: var(--font); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--muted); margin: 30px 0 12px; }
.hm-lnk { color: var(--accent); font-weight: 600; font-size: .82rem; }
.hm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.hm-main { display: grid; gap: 18px; min-width: 0; }
.hm-hero { display: grid; grid-template-columns: 360px minmax(0, 1fr); overflow: hidden; padding: 0; }
.hm-board-side { background: var(--text); padding: 18px 20px 16px; display: grid; gap: 10px; align-content: start; }
.hm-cap { margin: 0; color: #e9e4d6; font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.hm-cap .ic { color: #d2ac74; }
.hm-cap b { color: #fff; }
.hm-cap2 { margin: 0; color: #a7a194; font-size: .74rem; }
.hm-board { display: block; width: 100%; }
.hm-board-msg { color: #e9e4d6; display: grid; gap: 10px; justify-items: start; padding: 40px 6px; }
.hm-board-msg h3 { color: #fff; margin: 0; }
.hm-board-msg p { margin: 0; color: #cfcabd; font-size: .9rem; }
.hm-plan-side { padding: 22px 26px; min-width: 0; }
.hm-plan-side h2 { font-size: 1.6rem; margin: 4px 0 0; }
.hm-sub { color: var(--muted); font-size: .9rem; margin: 4px 0 14px; }
.hm-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hm-step { display: grid; grid-template-columns: 22px 40px minmax(0, 1fr) 20px; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: var(--bg-card); color: var(--text); }
.hm-step:hover { text-decoration: none; border-color: var(--accent); }
.hm-step .num { font-family: var(--serif); font-weight: 700; color: #b9b1a1; font-size: 1.05rem; text-align: center; }
.hm-step .tx { display: grid; line-height: 1.3; min-width: 0; }
.hm-step .tx b { font-size: .98rem; }
.hm-step .tx small { color: var(--muted); font-size: .8rem; }
.hm-step .go { color: var(--accent); display: grid; }
.hm-step.cur { border: 2px solid var(--accent); padding: 9px 13px; background: #0f6b4f08; box-shadow: 0 6px 18px #0f6b4f18; }
.hm-step.cur .num { color: var(--accent); }
.hm-step.done .tx b { text-decoration: line-through; text-decoration-color: #0f6b4f88; color: var(--muted); }
.hm-premium { margin: 10px 0 0; font-size: .86rem; }
.hm-step.off { opacity: .55; }
.hm-wait { margin: 16px 0 0; font-size: .9rem; color: var(--muted); font-weight: 600; }
.hm-premium a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.hm-cta { display: flex; align-items: center; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.hm-start { height: 52px; padding: 0 24px; font-size: 1.02rem; border-radius: 12px; display: inline-flex; align-items: center; gap: 10px; }
.hm-more { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; font-weight: 700; }
.hm-more a { border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: .86rem; background: var(--bg-card); }
.hm-side { display: grid; gap: 16px; }
.hm-stat { display: grid; gap: 4px; padding: 16px 18px; color: var(--text); }
.hm-stat:hover { text-decoration: none; border-color: var(--accent); }
/* "Tu rating": Táctica · Partidas en la misma tarjeta (maqueta rating.png). */
.hm-rating:hover { border-color: var(--border); }
.hm-seg { display: inline-flex; background: var(--bg-elev); border-radius: 999px; padding: 3px; gap: 2px; }
.hm-seg button { border: 0; background: none; font: inherit; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: var(--muted); cursor: pointer; }
.hm-seg button.on { background: var(--bg-card); color: var(--text); box-shadow: 0 1px 3px #0002; }
.hm-pane { display: grid; gap: 4px; }
.hm-pane[hidden] { display: none; }
.hm-rfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.hm-gtp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0 4px; }
.hm-gtp span { border-radius: 10px; padding: 6px 8px; font-size: .7rem; color: var(--muted); display: grid; text-align: center; }
.hm-gtp b { font-family: var(--serif); font-size: 1.15rem; color: var(--text); }
.hm-gtp .g { background: #0f6b4f12; } .hm-gtp .g b { color: var(--accent); }
.hm-gtp .t { background: #8a857a1a; }
.hm-gtp .p { background: #b0413e12; } .hm-gtp .p b { color: var(--danger); }
.hm-empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 10px 6px 4px; }
.hm-empty .ic { color: var(--accent); }
.hm-empty .btn { margin-top: 4px; }
/* Elegí tu rival: "Tu Elo de partidas". */
.br-elo { background: var(--bg-elev); border-radius: 12px; padding: 10px 14px; display: grid; gap: 2px; justify-self: end; color: var(--text); }
.br-elo:hover { text-decoration: none; }
.br-elo > div { display: flex; align-items: baseline; gap: 10px; }
.br-elo b { font-family: var(--serif); font-size: 1.6rem; }
.br-elo small { color: var(--muted); font-size: .78rem; letter-spacing: .06em; }
.dz-note { margin: 10px 0 0; font-size: .78rem; color: var(--muted); }
/* Progreso: Táctica · Partidas arriba del gráfico. */
.prog-chart-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.prog-chart-h .hm-seg { margin-left: auto; }
.hm-stat-h { display: flex; justify-content: space-between; align-items: center; }
.hm-big { font-family: var(--serif); font-size: 2.3rem; font-weight: 700; line-height: 1.05; font-variant-numeric: lining-nums; }
.hm-big.sm { font-size: 1.5rem; }
.hm-big small { font-family: var(--font); font-size: .78rem; color: var(--muted); font-weight: 600; }
.hm-spark { width: 100%; height: 48px; display: block; margin: 6px 0 2px; }
.hm-spark .l { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.hm-spark .a { fill: #0f6b4f14; stroke: none; }
.hm-row2 { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.hm-wk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.hm-wk span { display: grid; justify-items: center; gap: 3px; font-size: .68rem; color: var(--muted); font-weight: 700; }
.hm-wk i { width: 22px; height: 22px; border-radius: 7px; background: var(--bg-elev); display: block; }
.hm-wk .on i { background: var(--accent); }
.hm-wk .hoy i { background: var(--bg-card); border: 2px dashed var(--accent); }
.hm-bar { display: block; height: 6px; border-radius: 99px; background: var(--bg-elev); overflow: hidden; margin: 10px 0 4px; }
.hm-bar i { display: block; height: 100%; background: var(--accent); }
.hm-cont { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.hm-cc { display: grid; grid-template-columns: 112px minmax(0, 1fr); overflow: hidden; padding: 0; color: var(--text); min-height: 112px; }
.hm-cc:hover { text-decoration: none; border-color: var(--accent); }
.hm-cc .cb { padding: 12px 16px; display: grid; gap: 3px; align-content: center; min-width: 0; }
.hm-cc .cb b { font-family: var(--serif); font-size: 1.08rem; line-height: 1.2; }
.hm-cc .cb small { color: var(--muted); font-size: .8rem; }
.hm-cc .hm-bar { margin: 6px 0 0; }
.hm-mini { width: 112px; height: 112px; }
.hm-mini .cg-wrap { width: 112px; height: 112px; }
.hm-cc.dark { background: var(--text); border-color: var(--text); color: #f2efe4; }
.hm-cc.dark .hm-k { color: #d2ac74; }
.hm-cc.dark small { color: #bdb6a6; }
.hm-riv { display: grid; place-items: center; background: #23251c; }
.hm-riv img { width: 80px; height: 80px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; }
.hm-dots { display: flex; gap: 5px; margin-top: 6px; }
.hm-dots i { width: 16px; height: 6px; border-radius: 3px; background: #ffffff26; }
.hm-dots i.w { background: var(--accent); }
.hm-dots i.p { background: #ffffff66; }
.hm-dots i.now { background: var(--gold); }
.hm-xp { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hm-xp a { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 14px 14px 16px; display: grid; grid-template-columns: 44px minmax(0, 1fr) 16px; gap: 12px; align-items: center; color: var(--text); }
.hm-xp .ic-badge { width: 44px; height: 44px; }
.hm-xp a > span { display: grid; line-height: 1.3; min-width: 0; }
.hm-xp b { font-size: .95rem; display: inline-flex; align-items: center; gap: 5px; }
.hm-xp b .ic { color: var(--muted); }
.hm-xp small { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.hm-xp a > .ic { color: #b9b1a1; }
.hm-xp a:hover { text-decoration: none; border-color: var(--accent); }
.hm-mrow, .hm-sticky { display: none; }
@media (max-width: 1180px) {
  .hm-grid { grid-template-columns: minmax(0, 1fr); }
  .hm-side { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hm-xp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hm-hero { grid-template-columns: minmax(0, 1fr); }
}
/* Celular (A2-celular.png): una columna, los pasos sin el texto chico, "Seguí donde dejaste" y el
   progreso como renglones que se abren, y "Empezar el entrenamiento" fijo abajo. */
@media (max-width: 640px) {
  .hm-head h1 { font-size: 1.6rem; }
  .hm-chip-l, .hm-chip-r, .hm-cap2, .hm-sub, .hm-step .tx small, .hm-step .ic-badge, .hm-cta { display: none; }
  .hm-board-side { padding: 10px; border-radius: 14px; }
  .hm-hero { background: none; border: 0; box-shadow: none; gap: 12px; overflow: visible; }
  .hm-plan-side { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 12px; }
  .hm-plan-side h2 { font-size: 1.2rem; margin-bottom: 8px; }
  .hm-step { grid-template-columns: 18px minmax(0, 1fr) 16px; padding: 8px 10px; gap: 10px; }
  .hm-step.cur { padding: 7px 9px; }
  .hm-mrow { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
  .hm-mrow span { color: var(--accent); font-weight: 700; }
  .hm-side, .hm-cont-wrap { display: none; }
  .hm-side.open, .hm-cont-wrap.open { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 10px; }
  .hm-cont-wrap.open .hm-sec { display: none; }
  /* Celular: una sola tarjeta con forma de lista (maqueta explora-celular, la de la derecha). */
  .hm-xp { display: block; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
  .hm-xp a { grid-template-columns: 36px minmax(0, 1fr) 14px; padding: 11px 14px; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
  .hm-xp a:first-child { border-top: 0; }
  .hm-xp .ic-badge { width: 36px !important; height: 36px !important; }
  .hm-xp b { font-size: .92rem; }
  .hm-xp small { font-size: .78rem; }
  .hm-sticky { display: block; position: sticky; bottom: var(--mbar, 0px); margin: 18px -26px 0; padding: 12px 26px; background: var(--bg); border-top: 1px solid var(--border); z-index: 5; }
  .hm-sticky .hm-start { width: 100%; justify-content: center; }
}

/* Barra de "Tu entrenamiento de hoy" en las demás pantallas (templates/core/_plan_bar.html). */
.pb { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 36px); background: var(--text); color: #f2efe4; border-radius: 14px; padding: 10px 12px 10px 16px; box-shadow: 0 10px 30px #0004; font-size: .86rem; }
.pb-steps { display: flex; gap: 4px; }
.pb-steps i { width: 10px; height: 10px; border-radius: 50%; background: #ffffff33; }
.pb-steps i.done { background: #3fb68b; }
.pb-steps i.here { outline: 2px solid #d2ac74; outline-offset: 1px; }
.pb-t { display: grid; line-height: 1.25; }
.pb-t small { color: #bdb6a6; font-size: .74rem; }
.pb .btn { background: var(--accent); color: #fff; white-space: nowrap; }
body.pb-on { --pb: 72px; }
body.pb-on main { padding-bottom: 72px; }
.pb .btn.btn-ghost { background: transparent; color: #f2efe4; border: 1px solid #ffffff44; }
.pb-x { color: #bdb6a6; font-size: 1.2rem; line-height: 1; padding: 4px; }
.pb-x:hover { color: #fff; text-decoration: none; }
@media (max-width: 640px) { .pb { left: 10px; right: 10px; bottom: calc(var(--mbar, 0px) + 10px); } .pb-steps { display: none; } }
.done-card { max-width: 600px; margin: 24px auto; }
.done-card h1 { margin: .2em 0; }
.done-ico { font-size: 2.8rem; }
.done-card .done-stats { margin: 18px 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
abbr.prov { text-decoration: none; cursor: help; opacity: .75; margin-left: 1px; }
/* Rating provisorio (primeros 20 ejercicios): "1200 · provisorio", la palabra chica y gris. */
.prov-w { font-size: .78em; font-weight: 500; color: var(--muted); cursor: help; white-space: nowrap; }
.done-next-t { margin: 20px 0 8px; font-weight: 700; }
.done-next { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cat-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.cat-head h1 { margin: 0; }
.cat-head p { margin: 4px 0 0; }
/* ---- Catálogo de cursos: tarjeta con portada (posición clave en un tablero) ---- */
.ccards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.ccard { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--bg-card); border: 1px solid var(--border); color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s; }
.ccard:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(23, 23, 15, .12); }
.ccard-cover { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 0 22px; background: linear-gradient(135deg, #17170f, #123726); }
.ccard-cover.cat-tactica { background: linear-gradient(135deg, #2a1414, #5b2a1d); }
.ccard-cover.cat-estrategia { background: linear-gradient(135deg, #1b2235, #2f4161); }
.ccard-cover.cat-finales { background: linear-gradient(135deg, #2b2416, #6b5832); }
.ccard .ccard-board.board-wrap { width: 172px; max-width: 172px; margin: 0; border-radius: 4px; box-shadow: 0 8px 22px rgba(0, 0, 0, .45); pointer-events: none; }
.cdetail-cover { border-radius: 14px; margin-bottom: 14px; padding: 26px 0; }
.cdetail-cover ~ .grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cdetail-cover .ccard-board.board-wrap { width: 220px; max-width: 220px; margin: 0; border-radius: 4px; box-shadow: 0 8px 22px rgba(0, 0, 0, .45); pointer-events: none; }
.ccard-flags { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; }
.ccard-flag { padding: 2px 9px; border-radius: 99px; font-size: .7rem; font-weight: 800; letter-spacing: .02em; }
.ccard-flag.prem { margin-left: auto; color: #2a1c00; background: linear-gradient(135deg, #e3c07f, #c79a5b); }
.ccard-flag.free { margin-left: auto; color: #fff; background: rgba(255, 255, 255, .18); }
.ccard-flag.draft { color: #fff; background: rgba(255, 255, 255, .16); border: 1px dashed rgba(255, 255, 255, .5); }
.ccard-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.ccard-cat { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.ccard h3 { margin: 0; font-family: var(--serif); font-size: 1.22rem; line-height: 1.2; }
.ccard-desc { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.45; }
.ccard-meta { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.ccard-sample { color: var(--accent); }
.ccard-prog { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; color: var(--accent); }
.ccard-prog .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--bg-elev); overflow: hidden; }
.ccard-prog .bar i { display: block; height: 100%; background: var(--accent); }
/* ---- Capítulos (Section) desplegables: detalle del curso, índice de la lección y editor ---- */
.csec { border-top: 1px solid var(--border); }
.csec:first-of-type { border-top: 0; }
.csec > summary { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 2px; cursor: pointer; list-style: none; }
.csec > summary::-webkit-details-marker { display: none; }
.csec > summary::before { content: '›'; display: inline-block; width: 1em; color: var(--muted); font-weight: 800; transition: transform .15s; }
.csec[open] > summary::before { transform: rotate(90deg); }
.csec-t { flex: 1; font-family: var(--serif); font-weight: 700; font-size: 1.02rem; }
.csec-m { font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.csec .list.chapters { margin: 0 0 10px 1em; }
.crow { color: inherit; text-decoration: none; display: flex; justify-content: space-between; width: 100%; }
.crow:hover { text-decoration: none; color: var(--accent); }
.lsn-sec > summary { display: flex; align-items: baseline; gap: 8px; padding: 10px 16px 6px; cursor: pointer; list-style: none; font-size: .78rem; font-weight: 800; letter-spacing: .03em; color: var(--muted); }
.lsn-sec > summary::-webkit-details-marker { display: none; }
.lsn-sec > summary::before { content: '›'; font-weight: 800; transition: transform .15s; }
.lsn-sec[open] > summary::before { transform: rotate(90deg); }
.lsn-sec > summary .t { flex: 1; text-transform: uppercase; }
.lsn-sec > summary .m { font-variant-numeric: tabular-nums; }
.lsn-sec > summary:hover { color: var(--text); }
.ced-group + .ced-group { margin-top: 10px; }
.ced-sec { padding: 8px 4px 4px; }
.ced-sec > summary { cursor: pointer; font-family: var(--serif); }
.ced-sec-f { margin: 8px 0 4px; }
/* ---- Táctica › Por tema (diseño de Branding: documentacion/marca/tactica-por-tema.md) ---- */
.tseg { display: inline-flex; background: var(--bg-elev); border-radius: 999px; padding: 4px; gap: 2px; margin-bottom: 22px; }
.tseg a { padding: 8px 18px; border-radius: 999px; font-size: .9rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.tseg a:hover { color: var(--text); text-decoration: none; }
.tseg a.on { background: var(--bg-card); color: var(--text); box-shadow: 0 1px 4px rgba(23,23,15,.1); }
.tpanel[hidden] { display: none; }
.tpanel-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.tpanel-head h2 { margin: 0; font-size: 1.5rem; }
.tpanel-head .muted { font-size: .9rem; }
.tpanel-link { font-size: .9rem; font-weight: 700; }
.tpanel-intro { margin: 4px 0 16px; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.tpanel > .tgrid { margin-bottom: 18px; }
.tcard {
  display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: center; padding: 12px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.tcard.tcard-text { grid-template-columns: 1fr; padding: 14px 16px; }
.tcard:hover, .tcard:focus-visible { border-color: var(--accent); box-shadow: 0 2px 10px rgba(23,23,15,.06); text-decoration: none; }
.tcard:hover .tcard-name, .tcard:focus-visible .tcard-name { color: var(--accent); }
.tcard-img { width: 88px; height: 88px; border-radius: 6px; display: block; }
.tcard-num { width: 88px; height: 88px; border-radius: 6px; background: #F4EFE4; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tcard-num b { font: 600 2.5rem/1 var(--serif); font-variant-numeric: lining-nums; }
.tcard-num small { margin-top: 6px; font-size: .62rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 700; }
.tcard-body { display: flex; flex-direction: column; min-width: 0; }
.tcard-eyebrow { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--gold-text); margin-bottom: 3px; }
.tcard-name { font: 600 1.05rem/1.2 var(--serif); font-variant-numeric: lining-nums; color: var(--text); }
.tcard-desc {
  margin-top: 4px; font-size: .83rem; line-height: 1.35; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tcard-data { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: .76rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tcard-bar { width: 44px; height: 5px; border-radius: 99px; background: var(--bg-elev); overflow: hidden; flex: none; }
.tcard-bar i { display: block; height: 100%; background: var(--accent); }
.tsec { border-top: 1px solid var(--border); }
.tsec > summary { display: flex; align-items: center; gap: 12px; padding: 14px 4px; cursor: pointer; list-style: none; }
.tsec > summary::-webkit-details-marker { display: none; }
.tsec > summary::before { content: '▾'; font-size: .95rem; color: var(--muted); transition: transform .15s; transform: rotate(-90deg); }
.tsec[open] > summary::before { transform: none; }
.tsec-mark { width: 30px; height: 30px; border-radius: 50%; background: #F4EFE4; display: grid; place-items: center; flex: none; font: 600 1rem/1 var(--serif); font-variant-numeric: lining-nums; }
.tsec-t { font: 600 1.15rem/1.2 var(--serif); font-variant-numeric: lining-nums; }
.tsec-n { margin-left: auto; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.tsec > .tgrid { margin: 0 0 18px; }
@media (max-width: 560px) {
  .tsec-n { display: none; }
  .tgrid { grid-template-columns: 1fr; }
}
/* ---- Ruta: reiniciar ---- */
.ruta-reset { margin: 28px 0 0; }
.ruta-reset summary { cursor: pointer; color: var(--muted); font-size: .86rem; }
.ruta-reset form { margin: 6px 0 0; }
/* ---- Partida contra el bot (tactics/bot_play.html) en el esqueleto .lsn ---- */
.lsn-board { position: relative; }
.lsn-head .bp-rival { margin: 0; }
.lsn-head .bp-rival img, .lsn-head .bp-rival .ch-mono { width: 44px; height: 44px; font-size: 1.25rem; }
.lsn-head .bp-rival img.ch-portrait.sm { border-radius: 50%; }
.bp-opening { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--bg-elev); }
.bp-opening b { font-family: var(--serif); }
.bp-view { margin: 0 12px 6px; }
.bp-view[hidden], .bp-result[hidden], #analysis[hidden], #analysis-summary[hidden] { display: none; }
.bp-result { margin: 10px 12px; }
.bp-result textarea { width: 100%; box-sizing: border-box; font-size: .8rem; }
.lsn-body .ch-book-note { margin: 0 12px 10px; }
/* ---- Campeones (templates/champions/ y el modo campeón de tactics/bot_play.html). Retrato ilustrado
   (medallón con cartela de nombre y años sobre fondo negro); sin retrato, la inicial. ---- */
.ch-portrait { flex: none; display: block; width: 88px; height: 88px; border-radius: 12px; object-fit: cover; background: #000; }
.ch-portrait.lg { width: 168px; height: 168px; border-radius: 16px; }
.ch-portrait.sm { width: 56px; height: 56px; border-radius: 50%; object-position: 50% 30%; }
.ch-mono {
  flex: none; width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-family: var(--serif); font-weight: 700; font-size: 1.5rem;
}
.ch-mono.lg { width: 72px; height: 72px; font-size: 2.1rem; }
/* Campeones con la misma tarjeta que los bots (champions/_card.html): la cartela del retrato ya trae
   nombre y años. */
.ch-roster { margin-top: 8px; }
.ch-bot { display: flex; flex-direction: column; }
.ch-bot .bot-photo { height: auto; }
.ch-bot .card-body { flex: 1; display: flex; flex-direction: column; }
.ch-bot .btn-play { margin-top: auto; }
.ch-bot .bot-blurb { min-height: 3.6em; }
.ch-photo-mono { display: grid; place-items: center; background: var(--accent); color: #fff; font-family: var(--serif); font-weight: 700; font-size: 3rem; }
.ch-lock { position: absolute; top: 10px; right: 10px; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--gold-text); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.bot-card .ch-play-locked { display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--bg-card); color: var(--gold-text); border: 1px solid var(--gold); }
.ch-faces { display: flex; justify-content: center; margin: 4px 0 10px; }
.ch-faces img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; border: 3px solid var(--bg-card); margin-left: -14px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.ch-faces img:first-child { margin-left: 0; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ch-card { display: flex; gap: 14px; align-items: flex-start; color: var(--text); }
.ch-card:hover { text-decoration: none; border-color: var(--accent); }
.ch-card h3 { margin: 0; font-size: 1.05rem; }
.ch-card p { margin: 6px 0 0; color: var(--text); }
.ch-head { display: flex; gap: 18px; align-items: center; margin: 6px 0 18px; }
@media (max-width: 560px) {
  .ch-head { flex-direction: column; align-items: flex-start; }
  .ch-card .ch-portrait { width: 72px; height: 72px; }
}
.ch-head h1 { margin: 0; }
.ch-head p { margin: 6px 0 0; }
.ch-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.ch-modes h2 { margin: 0 0 6px; font-size: 1.15rem; }
.ch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ch-games { margin-top: 14px; }
.ch-games summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.ch-games .table-wrap { max-height: 420px; overflow: auto; }
.ch-book-note { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: var(--soft); font-size: .86rem; }
.ch-book-note.out { background: var(--bg-elev); color: var(--muted); }
.ch-book-note[hidden], .ch-feedback[hidden] { display: none; }
.ch-feedback { margin: 8px 0; padding: 8px 10px; border-radius: 8px; font-size: .88rem; background: var(--bg-elev); }
.ch-feedback.ok { background: var(--soft); }
.ch-feedback.bad { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.ch-score { display: flex; gap: 6px; align-items: baseline; font-weight: 700; margin: 4px 0 8px; }
.ch-final { margin: 10px 0; }
.notation .mv.hit { color: var(--accent); font-weight: 800; }
.notation .mv.near { color: var(--gold-text, var(--accent)); font-weight: 700; }
.notation .mv.miss { color: var(--danger); font-weight: 700; }
/* ---- Backoffice: tarjetas de números (Dashboard, Suscripciones), como en mockup/backoffice.html ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 13px; margin-bottom: 18px; }
.kpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 15px 16px; }
.kpi .k-lbl { color: var(--muted); font-size: .78rem; font-weight: 600; }
.kpi .k-val { font-family: var(--serif); font-size: 1.65rem; font-weight: 700; line-height: 1.1; margin-top: 3px; }
.kpi .k-delta { font-size: .78rem; font-weight: 700; margin-top: 3px; }
/* ---- Cursos: "¿Seguís ahí?" (mate en 1 entre líneas, apps/courses/guard.py) ---- */
.seguir { max-width: 520px; margin: 32px auto; text-align: center; }
.seguir h1 { margin: 4px 0 8px; }
.seguir-board { max-width: 420px; margin: 16px auto 4px; }
.seguir-fallo { color: var(--danger); font-weight: 700; margin: 8px 0 0; }
/* ---- Partida contra el bot: fin de partida y revisión (templates/tactics/bot_play.html) ---- */
.go-card { position: relative; max-width: 380px; width: calc(100% - 32px); text-align: center; padding: 26px 24px 20px; }
.go-close { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; }
.go-close:hover { color: var(--text); }
.go-title { font: 600 1.7rem/1.15 var(--serif); font-variant-numeric: lining-nums; margin: 0; }
.go-sub { color: var(--muted); margin: 4px 0 0; }
.go-main { display: block; width: 100%; box-sizing: border-box; margin-top: 20px; padding: 13px 16px; font-size: 1.05rem; }
.go-wide { display: block; margin-top: 16px; }
.go-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.go-row .btn { width: 100%; box-sizing: border-box; text-align: center; }
.go-row.one { grid-template-columns: 1fr; }
.lsn-nb.armed { background: color-mix(in srgb, var(--danger) 14%, var(--bg-card)); color: var(--danger); }
.go-study { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 10px; font-weight: 600; font-size: .9rem; }
.lsn.no-side.reviewing { --panel: 460px; }
.rv { padding: 14px 16px 18px; }
.rv-h { font: 600 1.15rem/1.2 var(--serif); margin: 0 0 10px; }
.rv-bar { height: 8px; border-radius: 99px; background: var(--bg-elev); overflow: hidden; }
.rv-bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
/* Ventana "Analizando tu partida…" (bot_play.html) */
.rv-modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: rgba(23, 23, 15, .45); }
.rv-modal[hidden] { display: none; }
.rv-modal-card { width: min(420px, 100%); background: var(--bg-card); border-radius: 16px; padding: 22px 24px 20px; box-shadow: 0 24px 60px rgba(23, 23, 15, .3); display: grid; gap: 8px; animation: grade-in .25s ease-out; }
.rv-modal-card .rv-h { margin: 0; font-size: 1.3rem; }
.rv-modal-card .rv-eyebrow { margin: 0; }
.rv-modal-p { margin: 0 0 6px; }
.rv-modal-card .rv-bar { height: 10px; }
.rv-modal-card .muted { margin: 0; }
.rv-modal-card .btn { justify-self: end; margin-top: 6px; }
.rv-eyebrow { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--gold-text); margin: 0 0 6px; }
.rv-coach { font: 600 1.15rem/1.35 var(--serif); margin: 0 0 14px; }
.rv-graph { display: block; width: 100%; height: 90px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 1px solid var(--border); }
.rv-g-bg { fill: #3d3a34; }
.rv-g-white { fill: #f4efe4; }
.rv-g-mid { stroke: #8a8578; stroke-width: 1; stroke-dasharray: 4 4; }
.rv-g-cur { stroke: var(--accent); stroke-width: 2; }
.rv-g-dot { stroke: #fff; stroke-width: 1.5; }
.rv-table { margin-top: 14px; }
.rv-row { display: grid; grid-template-columns: 1fr 82px 82px; align-items: center; gap: 8px; padding: 6px 0; font-size: .95rem; }
.rv-row > b { text-align: center; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.rv-hd > b { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-accrow { padding: 8px 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.rv-acc { display: inline-block; justify-self: center; min-width: 58px; padding: 6px 8px; border-radius: 8px; background: var(--bg-elev); font: 700 1.25rem/1 var(--serif); font-variant-numeric: lining-nums; }
.rv-acc.me { background: var(--accent); color: #fff; }
.rv-lbl { display: flex; align-items: center; gap: 10px; }
.rv-sep { border-top: 1px solid var(--border); margin: 6px 0; }
.rv-badge {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none;
  font-style: normal; font-weight: 800; font-size: .72rem; color: #fff; letter-spacing: -.04em;
}
.rv-badge.big { width: 40px; height: 40px; font-size: 1.05rem; }
.c-mejor { background: #0F6B4F; fill: #0F6B4F; } .t-mejor { color: #0F6B4F; }
.c-excelente { background: #3E8E5E; fill: #3E8E5E; } .t-excelente { color: #3E8E5E; }
.c-buena { background: #7A9A6B; fill: #7A9A6B; } .t-buena { color: #6a8a5b; }
.c-imprecision { background: #C99A2E; fill: #C99A2E; } .t-imprecision { color: #a87d1c; }
.c-error { background: #D9772B; fill: #D9772B; } .t-error { color: #c4661d; }
.c-grave { background: #B0413E; fill: #B0413E; } .t-grave { color: #B0413E; }
.rv-actions { display: grid; gap: 8px; margin-top: 16px; }
.rv-actions .go-main { margin-top: 0; }
.rv-note { margin: 12px 0 0; }
.rv-step-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--bg-card); }
.rv-step-top { display: flex; align-items: center; gap: 12px; }
.rv-step-title { font: 600 1.15rem/1.25 var(--serif); margin: 0; }
.rv-step-top .muted { margin: 2px 0 0; }
.rv-step-eval { margin: 12px 0 0; font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rv-step-best { margin: 6px 0 0; font-weight: 700; color: var(--accent); }
/* Por qué es un error: la respuesta que lo castiga (bot_play.html, revisión de la partida). */
.rv-why { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #b0413e0d; border: 1px solid #b0413e33; }
.rv-why-t { margin: 0; font-size: .86rem; font-weight: 700; color: var(--danger); }
.rv-why-line { margin: 4px 0 8px; font-size: .95rem; font-weight: 600; line-height: 1.5; }
.rv-why .btn { display: inline-flex; align-items: center; gap: 6px; }
.rv-step-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.rv-step-nav .btn { flex: 0 0 auto; }

/* ---- Mi repertorio v2 (templates/openings/repertorio*.html; documentacion/marca/mi-repertorio-v2.md,
   maquetas marca/maquetas-aperturas/4, 4b y 5) ---- */
.rep-w { max-width: 1240px; }
.rep-new-w { max-width: 880px; }
.rep-ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.rep-ph h1 { font-size: 2.1rem; margin: .1em 0 0; }
.rep-ph p { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.rep-ph .crumbs { margin-bottom: 4px; }
.rep-acts { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.rep-meta { font-size: .85rem; color: var(--muted); }
.rep-meta-l { font-size: .98rem; margin-top: 6px; }
.rep-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid #00000040; vertical-align: -1px; margin-right: 6px; }
.rep-dot.blancas { background: #f4f1ea; }
.rep-dot.negras { background: #2b2b25; }
.rep-disc { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-elev); color: var(--accent); display: grid; place-items: center; flex: none; }
.rep-grow { flex: 1; min-width: 0; }
.rep-num { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-elev); color: var(--gold-text); font-weight: 700; display: grid; place-items: center; flex: none; font-size: .8rem; font-family: var(--font); }
.rep-limit { margin: 18px 0 0; }
/* Lista */
.rep-today { display: flex; align-items: center; gap: 16px; padding: 14px 18px; margin-bottom: 22px; flex-wrap: wrap; }
.rep-today b { font-family: var(--serif); font-size: 1.15rem; }
.rep-list { display: grid; gap: 14px; }
.rep-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) minmax(220px, 300px) auto; gap: 24px; align-items: center; padding: 16px 22px 16px 16px; color: var(--text); }
.rep-row:hover { border-color: var(--accent); text-decoration: none; }
.rep-row h2 { font-size: 1.35rem; margin: 2px 0 4px; }
.rep-mini.board-wrap { width: 92px; max-width: 92px; margin: 0; border-radius: 6px; pointer-events: none; }
.rep-mini-empty { width: 92px; height: 92px; display: grid; place-items: center; border-radius: 6px; background: var(--bg-elev); color: var(--muted); }
.rep-prog { display: grid; gap: 8px; }
.rep-stack { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--bg-elev); }
.rep-stack .h { background: var(--danger); } .rep-stack .a { background: var(--gold); } .rep-stack .d { background: var(--accent); }
.rep-legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.rep-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rep-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.rep-legend .h { background: var(--danger); } .rep-legend .a { background: var(--gold); } .rep-legend .d { background: var(--accent); } .rep-legend .n { background: #b9b2a3; }
.rep-go { font-weight: 700; color: var(--accent); white-space: nowrap; }
.rep-how { margin-top: 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rep-how > div { display: flex; gap: 12px; align-items: flex-start; font-size: .88rem; color: var(--muted); }
.rep-how b { display: block; color: var(--text); font-size: .95rem; }
/* Nuevo */
.rep-step { padding: 22px 24px; margin-bottom: 16px; }
.rep-step h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.rep-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rep-f { font-size: .82rem; font-weight: 600; display: block; margin-bottom: 6px; padding: 0; }
.rep-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.rep-input { width: 100%; box-sizing: border-box; height: 44px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); padding: 0 14px; font: inherit; }
.rep-side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rep-side label { margin: 0; cursor: pointer; }
.rep-side input, .rep-way input { position: absolute; opacity: 0; pointer-events: none; }
.rep-side label > span { height: 44px; border-radius: 10px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 2px; font-weight: 600; font-size: .92rem; background: var(--bg-card); }
.rep-side input:checked + span { border: 2px solid var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 4%, var(--bg-card)); }
.rep-side input:focus-visible + span, .rep-way:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.rep-ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rep-way { position: relative; border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: grid; gap: 8px; align-content: start; background: var(--bg-card); cursor: pointer; margin: 0; font-weight: 400; }
.rep-way:hover { border-color: var(--accent); }
.rep-way:has(input:checked) { border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 4%, var(--bg-card)); padding: 17px; }
.rep-way b { font-size: 1rem; }
.rep-way small { color: var(--muted); font-size: .84rem; line-height: 1.4; }
.rep-panel { display: none; margin-top: 14px; }
.rep-panel textarea, .rep-panel select { width: 100%; box-sizing: border-box; font: inherit; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); padding: 10px 14px; }
.rep-panel textarea { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; min-height: 90px; margin-bottom: 8px; }
.rep-step:has(input[value="pgn"]:checked) .rep-panel-pgn,
.rep-step:has(input[value="curso"]:checked) .rep-panel-curso { display: block; }
.rep-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
/* Un repertorio */
.rep-more { position: relative; }
.rep-more > summary { list-style: none; letter-spacing: .1em; }
.rep-more > summary::-webkit-details-marker { display: none; }
.rep-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 270px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); box-shadow: 0 12px 30px rgba(23, 23, 15, .14); display: grid; gap: 4px; }
.rep-menu a, .rep-menu-del { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--text); font: inherit; font-size: .9rem; background: none; border: 0; width: 100%; cursor: pointer; text-align: left; }
.rep-menu a:hover, .rep-menu-del:hover { background: var(--bg-elev); text-decoration: none; }
.rep-menu-del { color: var(--danger); }
.rep-menu form { margin: 0; }
.rep-rename { padding: 6px 10px 8px; border-top: 1px solid var(--bg-elev); border-bottom: 1px solid var(--bg-elev); }
.rep-rename span { display: flex; gap: 6px; margin-top: 4px; }
.rep-rename input { flex: 1; min-width: 0; font: inherit; font-size: .88rem; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }
.rep-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 18px; }
.rep-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--bg-elev); color: var(--muted); }
.rep-chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #b9b2a3; }
.rep-chip.h { background: color-mix(in srgb, var(--danger) 8%, transparent); color: #8f3431; } .rep-chip.h i { background: var(--danger); }
.rep-chip.a { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold-text); } .rep-chip.a i { background: var(--gold); }
.rep-chip.d { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); } .rep-chip.d i { background: var(--accent); }
.rep-chip.c i { display: none; }
/* "Falta tu respuesta": ámbar propio, distinto del rojo de "Para hoy" (maquetas 7) */
.rep-chip.f { background: #c47f1a1f; color: #8a5a10; } .rep-chip.f i { background: #c47f1a; }
.rep-line.falta { box-shadow: inset 3px 0 #c47f1a; }
.rep-line.falta.on { background: #c47f1a0f; box-shadow: inset 3px 0 #c47f1a; }
.falta-note { display: flex; gap: 10px; align-items: flex-start; background: #c47f1a14; border: 1px solid #c47f1a40;
  border-radius: 12px; padding: 10px 12px; font-size: .84rem; color: #6b470d; line-height: 1.45; }
.falta-note b { color: #5a3b0a; }
.falta-note .btn-link { color: #8a5a10; font-weight: 700; text-decoration: underline; }
.falta-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c47f1a; flex: none; margin-top: 5px; }
.rep-falta { align-items: center; margin-bottom: 18px; padding: 12px 16px; font-size: .9rem; }
.rep-falta > div { flex: 1; }
.rep-falta .falta-dot { margin-top: 0; }
/* Nombre de una variante (etiqueta dorada con marcador) y el hueco "tu respuesta" */
.vtag { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; font-family: var(--font);
  color: var(--gold-text); background: #b0894f1a; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.vtag svg { width: 12px; height: 12px; fill: currentColor; flex: none; }
.vtag.auto { background: var(--bg-elev); color: var(--muted); }
.lsn-nt .tagrow { padding: 6px 12px 0 46px; }
.slot { display: inline-block; border: 1.5px dashed #c47f1a; color: #8a5a10; border-radius: 6px; padding: 0 8px;
  font-size: .8rem; font-weight: 600; background: #c47f1a0d; white-space: nowrap; }
.lsn-nt .mv.slotc { cursor: default; }
a.rep-chip:hover { text-decoration: none; color: var(--text); }
.rep-det-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.rep-gh { font-size: 1.1rem; margin: 6px 0 10px 4px; }
.rep-gh small { font-family: var(--font); font-size: .78rem; font-weight: 500; color: var(--muted); margin-left: 6px; }
.rep-groups section + section { margin-top: 18px; }
.rep-lines { padding: 0; overflow: hidden; }
.rep-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 13px 16px; cursor: pointer; }
.rep-line + .rep-line { border-top: 1px solid var(--bg-elev); }
.rep-line:hover { background: color-mix(in srgb, var(--bg-elev) 45%, var(--bg-card)); }
.rep-line.on { background: color-mix(in srgb, var(--accent) 5%, var(--bg-card)); box-shadow: inset 3px 0 var(--accent); }
.rep-line:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rep-line-t b { display: block; font-size: .98rem; }
.rep-line-full { display: block; font-size: .8rem; color: var(--muted); margin-top: 3px; }
.rep-line-full strong { color: var(--text); }
.rep-pick { position: sticky; top: 16px; padding: 18px; display: grid; gap: 10px; }
.rep-pick h2 { font-size: 1.15rem; margin: 0; }
.rep-pick .eyebrow { margin: 0; }
.rep-pick-board.board-wrap { width: 100%; max-width: 100%; margin: 0; border-radius: 6px; }
.rep-pick p { margin: 0; line-height: 1.45; }
.rep-pick-btn { width: 100%; height: 42px; }
.rep-empty { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.rep-empty p { margin: 0; }
@media (max-width: 1100px) {
  .rep-row { grid-template-columns: 80px minmax(0, 1fr) auto; }
  .rep-row .rep-prog { grid-column: 2 / -1; }
  .rep-mini.board-wrap, .rep-mini-empty { width: 80px; max-width: 80px; height: auto; }
  .rep-mini-empty { height: 80px; }
}
@media (max-width: 860px) {
  .rep-det-grid { grid-template-columns: 1fr; }
  .rep-pick { display: none; }
  .rep-how, .rep-ways, .rep-row2 { grid-template-columns: 1fr; }
  .rep-row { grid-template-columns: 64px minmax(0, 1fr); gap: 12px 14px; padding: 14px; }
  .rep-mini.board-wrap { width: 64px; max-width: 64px; }
  .rep-mini-empty { width: 64px; height: 64px; }
  .rep-row .rep-prog, .rep-row .rep-go { grid-column: 1 / -1; }
  .rep-line { grid-template-columns: minmax(0, 1fr) auto; }
  .rep-line .btn { display: none; }
  .rep-ph h1 { font-size: 1.7rem; }
  .rep-today .rep-disc { display: none; }
  .rep-today .rep-grow { flex-basis: 100%; }
  .rep-today .btn { width: 100%; }
}
/* Editor del árbol de un repertorio (games/estudio.html con rep_mode; maqueta marca/maquetas-aperturas/6). */
.std-lines-h { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin-top: 6px; }
/* "‹ Volver a Caro-Kann": un botón, no un título (pedido del dueño). */
.std-back { max-width: 100%; justify-content: flex-start; overflow: hidden; text-overflow: ellipsis; margin: 0 28px 8px 0; }
.std-back:hover { text-decoration: none; }
.std-lines { display: flex; flex-direction: column; }
.std-lines-g { padding: 12px 16px 6px; font-size: .78rem; font-weight: 700; color: var(--gold-text); border-top: 1px solid var(--bg-elev); }
.std-lines-g:first-child { border-top: 0; }
.std-line { display: grid; gap: 4px; justify-items: start; width: 100%; text-align: left; padding: 8px 16px 8px 28px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; }
.std-line .t { font-size: .86rem; font-weight: 600; }
.std-lines .std-line.falta { box-shadow: inset 3px 0 #c47f1a; }
.std-lines .std-line.falta.on { background: #c47f1a0f; box-shadow: inset 3px 0 #c47f1a; }
.std-lines-g { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.std-lines-g small { font-size: .76rem; font-weight: 500; color: var(--muted); }
.std-lines .falta-note { margin: 10px 12px 4px; padding: 7px 10px; }
.std-lines .falta-note .falta-dot { margin-top: 5px; }
.std-lines .std-lines-warn { padding: 6px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
.std-lines-tip[hidden] { display: none; }
/* Campo "Nombre de la variante" (arriba del comentario) */
.std-name { display: grid; gap: 6px; }
.std-name-mv { font-size: .78rem; color: var(--muted); }
.std-name-mv b { color: var(--text); }
.std-name label { font-size: .78rem; font-weight: 700; display: flex; justify-content: space-between; margin: 0; }
.std-name label span { font-weight: 500; color: var(--muted); }
.std-name-inp { display: flex; align-items: center; gap: 8px; height: 40px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg-card); padding: 0 12px; }
.std-name-inp:focus-within { border-color: var(--accent); }
.std-name-inp svg { width: 14px; height: 14px; fill: var(--gold); flex: none; }
.std-name-inp input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: .92rem; padding: 0; height: auto; }
.std-name small { font-size: .76rem; color: var(--muted); }
.std-sheet-h, .std-sheet-done { display: none; }
.std-reply { flex: 1; }
.std-line small.st-hoy { color: var(--danger); } .std-line small.st-dominada { color: var(--accent); } .std-line small.st-falta { color: var(--gold-text); font-weight: 600; }
.std-line.falta span { color: var(--muted); }
.std-line:hover { background: color-mix(in srgb, var(--bg-elev) 45%, var(--bg-card)); }
.std-line.on { background: color-mix(in srgb, var(--accent) 5%, var(--bg-card)); box-shadow: inset 3px 0 var(--accent); }
.std-lines-tip { margin: 10px 14px 14px; padding: 10px 12px; border-radius: 10px; background: var(--bg-elev); font-size: .8rem; color: var(--muted); line-height: 1.45; }
.std-lines-empty { margin: 12px 16px; font-size: .86rem; color: var(--muted); }
.std-lines-warn { margin: 10px 12px 4px; padding: 9px 11px; border-radius: 10px; font-size: .8rem; line-height: 1.45;
  background: color-mix(in srgb, var(--gold) 14%, var(--bg-card)); color: var(--gold-text); }
/* Editor del repertorio en notebooks (≈1280-1440 px): la columna de líneas sigue a la vista
   (es la que explica la jerarquía), con el tablero un poco más chico. */
@container (min-width: 980px) and (max-width: 1341px) {
  .lsn.std-repm {
    --side: 230px; --panel: 360px;
    --b: min(calc(100vh - var(--chrome) - var(--pb, 0px)), calc(100cqw - var(--side) - var(--panel) - 2 * var(--gap)));
    grid-template-columns: var(--side) var(--b) var(--panel);
  }
  .lsn.std-repm .lsn-side { display: flex; }
  .lsn.std-repm .lsn-tabs { display: none; }
}
/* Celular: pestañas "Árbol" / "Líneas" debajo del tablero, y nombre + comentario en una hoja. */
@container (max-width: 859px) {
  .lsn.std-repm .lsn-tabs { display: flex; }
  .lsn.std-repm .std-edit:not([hidden]) {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; max-height: 85vh; overflow-y: auto;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--bg-card);
    border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px rgba(23, 23, 15, .28); gap: 12px;
  }
  .lsn.std-repm .std-sheet-h { display: block; font-family: var(--serif); font-size: 1.15rem; }
  .lsn.std-repm .std-sheet-h::before { content: ''; display: block; width: 44px; height: 4px; border-radius: 2px; background: var(--border); margin: -4px auto 10px; }
  .lsn.std-repm .std-sheet-done { display: block; height: 46px; }
  .lsn.std-repm .std-name-inp { height: 46px; }
}
@media (min-width: 901px) and (max-height: 1000px) {
  .lsn.std-repm .std-name-mv, .lsn.std-repm .std-eyebrow, .lsn.std-repm .std-name label { display: none; }
  .lsn.std-repm .std-name { gap: 4px; }
  .lsn.std-repm .std-name-inp { height: 34px; }
  .lsn.std-repm .std-name small { display: none; }
  .lsn.std-repm .std-name:focus-within small { display: block; }
  .lsn.std-repm .std-nag, .lsn.std-repm .std-tool { height: 28px; }
  .lsn.std-repm #std-comment { min-height: 34px; height: 34px; padding: 6px 9px; resize: none; }
  .lsn.std-repm #std-comment:focus { height: 72px; }
  .lsn.std-repm .std-edit { gap: 5px; }
}
body.std-sheet-open::after { content: ''; position: fixed; inset: 0; z-index: 85; background: rgba(23, 23, 15, .35); }
.std-eyebrow { margin: 0 0 2px; }
.lsn-nt .own:not(.cur) { color: var(--accent); font-weight: 700; }
/* Estudio que es un repertorio: aviso arriba del panel. */
.std-rep { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; padding: 7px 10px; border-radius: 8px; background: var(--soft); font-size: .84rem; }
.std-rep form { display: flex; align-items: center; gap: 6px; margin: 0; }
.std-rep select { font: inherit; font-size: .84rem; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); }
.rep-promo { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; color: var(--text); max-width: 640px; }
.rep-promo:hover { border-color: var(--accent); text-decoration: none; }
.rep-promo b { display: block; font-family: var(--serif); font-size: 1.05rem; }
.rep-promo small { display: block; color: var(--muted); font-size: .86rem; }

/* ---- Backoffice › Bots (templates/backoffice/bots.html y bot_edit.html) ---- */
.bo-bots-intro { margin: 0 0 14px; max-width: 760px; }
.bo-bots { margin-bottom: 16px; padding: 14px 0; }
.bo-bots h3 { margin: 0 18px 8px; }
.bo-bot { display: grid; grid-template-columns: 40px minmax(150px, 1fr) 120px minmax(0, 2fr) auto auto; gap: 12px; align-items: center; padding: 8px 18px; color: var(--text); border-top: 1px solid var(--bg-elev); }
.bo-bot:hover { background: color-mix(in srgb, var(--bg-elev) 45%, var(--bg-card)); text-decoration: none; }
.bo-bot img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.bo-bot-ini { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--bg-elev); color: var(--gold-text); font-family: var(--serif); font-weight: 700; }
.bot-ini { display: grid; place-items: center; background: var(--bg-elev); color: var(--gold-text); font-family: var(--serif); font-size: 3rem; font-weight: 700; }
.bo-bot-n b { display: block; }
.bo-bot-n small, .bo-bot-sum { color: var(--muted); font-size: .82rem; }
.bo-bot-style { justify-self: start; font-size: .76rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--bg-elev); color: var(--muted); }
.s-agresivo { background: color-mix(in srgb, var(--danger) 10%, transparent); color: #8f3431; }
.s-sacrificador { background: #c47f1a1f; color: #8a5a10; }
.s-posicional { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.s-simplificador { background: color-mix(in srgb, #3c5f86 12%, transparent); color: #3c5f86; }
.bo-bot-tag { font-size: .76rem; color: var(--muted); }
.bo-bot-go { font-weight: 700; color: var(--accent); font-size: .86rem; }
.bo-crumb { margin: 0 0 10px; }
.bo-bot-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.bo-bot-head img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.bo-bot-head h2 { margin: 0; }
.bo-bot-head p { margin: 2px 0 0; }
.bo-bot-head .btn { margin-left: auto; }
.bo-bot-form .admin-card { margin-bottom: 16px; }
.bo-bot-form h3 { margin-top: 0; }
.bo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 10px; }
.bo-grid label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.bo-grid small { font-weight: 400; color: var(--muted); font-size: .76rem; }
.bo-grid input, .bo-grid select { font: inherit; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); }
.bo-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.bo-style { position: relative; margin: 0; cursor: pointer; }
.bo-style input { position: absolute; opacity: 0; }
.bo-style span { display: grid; gap: 4px; height: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); }
.bo-style small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.bo-style input:checked + span { border: 2px solid var(--accent); padding: 11px 13px; background: color-mix(in srgb, var(--accent) 4%, var(--bg-card)); }
.bo-style input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.bo-open { display: grid; gap: 8px; margin-top: 12px; }
.bo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bo-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--bg-elev); font-size: .84rem; }
.bo-chip button { border: 0; background: none; font-size: 1rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.bo-chip button:hover { color: var(--danger); }
.bo-open-in { font: inherit; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; max-width: 460px; }
.bo-bot-actions { display: flex; gap: 10px; }
.bo-bots h3 small { font-family: var(--font); font-size: .78rem; font-weight: 500; margin-left: 6px; }
.bo-bot-row { display: flex; align-items: center; border-top: 1px solid var(--bg-elev); }
.bo-bot-row .bo-bot { flex: 1; border-top: 0; }
.bo-bot-row.off .bo-bot { opacity: .55; }
.bo-vis { margin: 0 18px 0 6px; }
.bo-switch { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; font: inherit; font-size: .82rem; font-weight: 600; color: var(--muted); cursor: pointer; padding: 4px 0; white-space: nowrap; }
.bo-switch i { width: 34px; height: 20px; border-radius: 999px; background: var(--border); position: relative; flex: none; transition: background .15s; }
.bo-switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.bo-switch.on { color: var(--accent); }
.bo-switch.on i { background: var(--accent); }
.bo-switch.on i::after { left: 16px; }
.bo-bot-head .bo-vis { margin: 0 0 0 auto; }
.bo-bot-head .bo-vis + .btn { margin-left: 8px; }
/* Estilo del bot en "Elegí tu rival" */
.bot-style { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.level-row:has(.bot-style) { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.s-equilibrado { background: color-mix(in srgb, #5c584f 12%, transparent); color: #5c584f; }

/* ---- Tu Torneo (templates/route/ruta.html, fin.html, etapa_ganada.html; maquetas en
   documentacion/marca/maquetas-torneo/). Cuadro del torneo, ronda de hoy, escalera. ---- */
.tt-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.tt-col { display: grid; gap: 16px; min-width: 0; }
.tt-mob { display: none; }
.tt-cuadro { padding: 18px 20px 20px; }
.tt-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.tt-head h2 { font-size: 1.55rem; margin: 2px 0 0; }
.tt-head p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.tt-score { text-align: right; flex: none; }
.tt-score b { font-family: var(--serif); font-size: 2.4rem; line-height: 1; display: block; font-variant-numeric: lining-nums; }
.tt-pts, .tt-res { font-variant-numeric: lining-nums; }
.tt-score span { font-size: .8rem; color: var(--muted); }
.tt-rounds { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 8px; }
.tt-rd { border: 1px solid var(--border); border-radius: 12px; padding: 12px 6px 10px; text-align: center; display: grid; justify-items: center; align-content: start; gap: 4px; background: var(--bg-card); position: relative; }
.tt-n { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tt-short { display: none; }
.tt-rd img, .tt-ph { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.tt-ph { background: var(--bg-elev); display: grid; place-items: center; color: #b9b1a1; font-weight: 700; }
.tt-who { font-size: .76rem; font-weight: 600; line-height: 1.2; min-height: 2.3em; }
.tt-res { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; min-width: 34px; height: 26px; border-radius: 7px; display: grid; place-items: center; }
.tt-res.w { background: #0f6b4f17; color: var(--accent); }
.tt-res.d { background: #8a857a1f; color: var(--muted); }
.tt-res.l { background: #b0413e17; color: var(--danger); }
.tt-res.now { background: var(--accent); color: #fff; font-family: var(--font); font-size: .72rem; padding: 0 9px; }
.tt-res.fut { color: #b9b1a1; }
.tt-rd.dec { border-color: #d9bf8e; background: #f6eedd; }
.tt-dtag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #fff; font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.tt-rd.now { border: 2px solid var(--accent); box-shadow: 0 6px 18px #0f6b4f22; }
.tt-rd.fut { opacity: .75; }
.tt-note { font-size: .78rem; color: var(--muted); margin: 12px 0 0; }

.tt-today { display: grid; grid-template-columns: 250px minmax(0, 1fr); overflow: hidden; padding: 0; }
.tt-rival { background: #17170f; color: #f2efe4; padding: 22px 20px; display: grid; justify-items: center; text-align: center; gap: 6px; align-content: start; }
.tt-rival img { width: 132px; height: 132px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); }
.tt-rival-txt { display: grid; justify-items: center; gap: 6px; }
.tt-rival .eyebrow { color: #d2ac74; margin: 4px 0 0; }
.tt-rival h3 { font-size: 1.35rem; margin: 0; color: #fff; }
.tt-meta { font-size: .82rem; color: #bdb6a6; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.tt-stag { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px 3px 8px; font-size: .76rem; font-weight: 700; }
.tt-stag i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tt-rival .tt-stag { background: #ffffff1a; color: #e9e4d6; }
.tt-rival .tt-stag.s-agresivo { background: #b0413e40; color: #f0a19e; }
.tt-rival .tt-stag.s-sacrificador { background: #c47f1a40; color: #f0c27a; }
.tt-rival .tt-stag.s-posicional { background: #0f6b4f55; color: #9fd8bf; }
.tt-rival .tt-stag.s-simplificador { background: #3c5f8655; color: #b3c9e6; }
.tt-open { margin-top: 8px; font-size: .8rem; background: #ffffff12; border-radius: 10px; padding: 8px 10px; color: #e9e4d6; }
.tt-open b { color: #fff; }
.tt-steps { padding: 18px 22px; }
.tt-steps h2 { font-size: 1.3rem; margin: 0; }
.tt-sub { color: var(--muted); font-size: .88rem; margin: 2px 0 12px; }
.tt-st { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.tt-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; border: 2px solid var(--border); color: var(--muted); background: var(--bg-card); }
.tt-st.done .tt-ic { background: var(--accent); border-color: var(--accent); color: #fff; }
.tt-st.cur .tt-ic { border-color: var(--accent); color: var(--accent); }
.tt-st b { display: block; font-size: .98rem; }
.tt-st small { color: var(--muted); font-size: .84rem; }
.tt-st.lock { opacity: .6; }
.tt-prog { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.tt-prog span { font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tt-bar { height: 6px; border-radius: 3px; background: var(--bg-elev); overflow: hidden; flex: 0 1 220px; }
.tt-score.start b { font-size: 1.6rem; }
.tt-bar i { display: block; height: 100%; background: var(--accent); }
.tt-ok { font-size: .82rem; font-weight: 700; color: var(--accent); }

.tt-side { padding: 16px 18px; }
.tt-side > summary { list-style: none; pointer-events: none; }
.tt-side > summary::-webkit-details-marker { display: none; }
.tt-side > summary h3 { font-size: 1.1rem; margin: 2px 0 10px; }
.tt-side > summary .eyebrow { display: block; }
.tt-ladder { display: grid; gap: 2px; }
.tt-tr { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 10px; }
.tt-tr.current { background: #0f6b4f0f; box-shadow: inset 3px 0 0 var(--accent); }
.tt-tr b { font-size: .92rem; display: block; }
.tt-tr small { font-size: .78rem; color: var(--muted); }
.tt-tr.locked { opacity: .55; }
.tt-cup { width: 26px; height: 26px; color: #c9c0b0; }
.tt-tr.current .tt-cup, .tt-tr.finished .tt-cup { color: var(--gold); }
.tt-tr form { margin: 0; }
.tt-go { border: 0; background: none; font: inherit; font-size: .8rem; font-weight: 700; color: var(--accent); cursor: pointer; padding: 4px 2px; }
.tt-rules { margin: 0; padding: 0 0 0 18px; font-size: .86rem; color: var(--muted); display: grid; gap: 6px; }
.tt-rules b { color: var(--text); }
.tt-set { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: .88rem; margin: 0; }
.tt-side > summary + .tt-set { border-top: 0; }
.tt-set a { font-weight: 600; }
.tt-set select { width: auto; max-width: 190px; padding: 6px 8px; font-size: .86rem; font-weight: 600; color: var(--accent); }
.tt-reset { margin-top: 8px; }
.tt-reset > summary { color: var(--danger); font-size: .84rem; font-weight: 600; cursor: pointer; }
.tt-mbar { display: none; }

.tt-fin { max-width: 760px; margin: 10px auto 0; text-align: center; padding: 34px 40px 30px; display: grid; justify-items: center; gap: 8px; }
.tt-fin-sm { max-width: 680px; }
.tt-bigcup { width: 96px; height: 96px; color: var(--gold); }
.tt-fin-sm .tt-bigcup { width: 72px; height: 72px; }
.tt-cup.big { width: 64px; height: 64px; color: var(--gold); }
.tt-fin h1 { font-size: 2.3rem; margin: 0; }
.tt-fin-sm h1 { font-size: 2rem; }
.tt-pts { font-family: var(--serif); font-size: 3.6rem; font-weight: 700; line-height: 1; color: var(--accent); margin-top: 6px; }
.tt-pts small { font-size: 1.2rem; color: var(--muted); font-weight: 600; }
.tt-pts-sm { font-size: 2.4rem; }
.tt-fin p { color: var(--muted); margin: 0; max-width: 520px; }
.tt-fin .tt-rounds { width: 100%; margin: 18px 0 8px; text-align: center; }
.tt-logro { display: inline-flex; align-items: center; gap: 12px; background: #f6eedd; border: 1px solid #e3cfa6; border-radius: 14px; padding: 10px 16px; text-align: left; margin-top: 6px; }
.tt-md { width: 40px; height: 40px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; font-size: 1.2rem; flex: none; }
.tt-logro b { display: block; font-size: .95rem; }
.tt-logro span { font-size: .8rem; color: var(--muted); }
.tt-acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.tt-acts form { margin: 0; }
.tt-next { margin-top: 18px; font-size: .86rem; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 14px; width: 100%; }

@media (max-width: 1100px) {
  .tt-today { grid-template-columns: 1fr; }
  .tt-rival { grid-template-columns: auto 1fr; justify-items: start; text-align: left; align-items: center; gap: 14px; }
  .tt-rival img { width: 84px; height: 84px; }
  .tt-rival-txt { justify-items: start; }
  .tt-meta { justify-content: flex-start; }
}
@media (max-width: 960px) { .tt-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .tt-mob { display: inline; }
  .tt-desk { display: none; }
  .tt-cuadro { padding: 14px; }
  .tt-head { margin-bottom: 14px; }
  .tt-head h2 { font-size: 1.2rem; }
  .tt-score b { font-size: 1.8rem; }
  .tt-score.start b { font-size: 1.25rem; }
  .tt-rounds { gap: 5px; }
  .tt-rd { padding: 9px 2px 6px; border-radius: 10px; }
  .tt-rd img, .tt-ph { width: 30px; height: 30px; }
  .tt-who { display: none; }
  .tt-long { display: none; }
  .tt-short { display: inline; }
  .tt-n { font-size: .62rem; letter-spacing: .02em; }
  .tt-res { min-width: 26px; height: 22px; font-size: .9rem; }
  .tt-res.now { font-size: .62rem; padding: 0 5px; }
  .tt-dtag { font-size: .5rem; padding: 1px 5px; top: -8px; letter-spacing: .02em; }
  .tt-rival { padding: 12px; border-radius: 14px; }
  .tt-rival img { width: 64px; height: 64px; border-width: 2px; }
  .tt-rival h3 { font-size: 1.1rem; }
  .tt-open { margin-top: 2px; }
  .tt-today { background: transparent; border: 0; box-shadow: none; gap: 12px; overflow: visible; }
  .tt-steps { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 6px 14px; }
  .tt-steps > .eyebrow, .tt-steps > h2, .tt-sub { display: none; }
  .tt-st { grid-template-columns: 30px minmax(0, 1fr); }
  .tt-st > .btn, .tt-st > .tt-ok, .tt-st > span:last-child:empty { display: none; }
  .tt-sub + .tt-st { border-top: 0; }
  .tt-bar { flex: 1 1 auto; }
  .tt-side { padding: 0; }
  .tt-side > summary { pointer-events: auto; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; }
  .tt-side > summary .eyebrow { display: none; }
  .tt-side > summary h3 { font-size: .95rem; margin: 0; font-family: var(--font); font-weight: 600; }
  .tt-side > summary::after { content: 'Ver ›'; color: var(--accent); font-weight: 600; font-size: .9rem; }
  .tt-side[open] > summary::after { content: 'Cerrar'; }
  .tt-side[open] { padding-bottom: 12px; }
  .tt-side[open] > :not(summary) { margin-left: 14px; margin-right: 14px; }
  .tt-mbar { display: block; position: sticky; bottom: var(--mbar, 0px); z-index: 20; margin: 14px -16px 0; background: var(--bg-card); border-top: 1px solid var(--border); padding: 10px 16px 14px; }
  .tt-mbar .btn { display: flex; justify-content: center; width: 100%; }
  .tt-fin { padding: 24px 16px; }
  .tt-fin h1 { font-size: 1.6rem; }
  .tt-pts { font-size: 2.8rem; }
  .tt-acts { flex-direction: column; align-items: stretch; width: 100%; }
  .tt-acts .btn { width: 100%; justify-content: center; }
}

/* ---- Backoffice › Torneos (templates/backoffice/torneos.html; maqueta 4-backoffice-torneos) ---- */
.msg.warning { background: #f6eedd; color: #6e5226; }
.bt-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.bt-toolbar form { margin: 0 0 0 auto; }
.bt-tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--bg-elev); border-radius: 12px; padding: 4px; }
.bt-tabs a { padding: 7px 12px; border-radius: 9px; font-size: .86rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.bt-tabs a.on { background: var(--bg-card); color: var(--text); box-shadow: 0 1px 3px #15170f1f; }
.bt-tabs a.off { opacity: .7; }
.bt-tabs small { font-weight: 500; }
.bt-ed { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.bt-main { padding: 0; overflow: visible; }
.bt-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.bt-head h2 { font-size: 1.35rem; margin: 0; }
.bt-sw { cursor: pointer; }
.bt-tbl { width: 100%; border-collapse: collapse; }
.bt-tbl th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 20px; background: #fcfbf7; border-bottom: 1px solid var(--border); }
.bt-tbl td { padding: 10px 20px; border-top: 1px solid var(--border); vertical-align: top; position: relative; }
.bt-tbl tr.dec td { background: #f6eedd88; }
.bt-rn { font-weight: 700; white-space: nowrap; padding-top: 22px !important; width: 90px; }
.bt-dc { white-space: nowrap; padding-top: 18px !important; width: 140px; }
.bt-ac { padding-top: 22px !important; white-space: nowrap; width: 80px; }
.bt-try { color: var(--accent); font-weight: 600; font-size: .86rem; }
.bt-pick { position: relative; max-width: 440px; }
.bt-cur { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--border); background: var(--bg-card); border-radius: 10px; padding: 7px 12px; font: inherit; text-align: left; cursor: pointer; color: var(--text); }
.bt-pick.open .bt-cur { border-color: var(--accent); box-shadow: 0 0 0 2px #0f6b4f22; }
.bt-cur.off { border-color: #d9bf8e; background: #f6eedd; }
.bt-cur img, .bt-opt img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.bt-txt { display: grid; min-width: 0; }
.bt-txt b { font-size: .92rem; }
.bt-txt > span { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bt-txt em { font-style: normal; color: var(--danger); font-weight: 700; }
.bt-caret { margin-left: auto; font-style: normal; color: var(--muted); }
.bt-auto { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-elev); display: grid; place-items: center; font-weight: 700; color: var(--accent); flex: none; }
.bt-drop { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); border: 1px solid var(--accent); border-radius: 10px; background: var(--bg-card); box-shadow: 0 10px 26px #15170f22; overflow: hidden; }
.bt-q { width: 100%; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 9px 12px; font-size: .88rem; background: var(--bg-card); }
.bt-list { max-height: 320px; overflow-y: auto; }
.bt-opt { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-top: 1px solid #f2ecdf; background: none; padding: 7px 12px; font: inherit; text-align: left; cursor: pointer; color: var(--text); }
.bt-opt:first-child { border-top: 0; }
.bt-opt img, .bt-opt .bt-auto { width: 30px; height: 30px; }
.bt-opt:hover:not(:disabled) { background: #0f6b4f0d; }
.bt-opt.on { background: #0f6b4f14; }
.bt-opt.off { opacity: .45; cursor: not-allowed; }
.bt-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--border); }
.bt-side { display: grid; gap: 16px; }
.bt-fld { display: grid; gap: 4px; margin-top: 10px; font-size: .8rem; font-weight: 700; }
.bt-fld input, .bt-fld select { font-weight: 400; font-size: .9rem; }
.bt-fld select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev); color: var(--text); font-family: inherit; }
.bt-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bt-acts .btn { display: flex; justify-content: center; }
@media (max-width: 1240px) { .bt-ed { grid-template-columns: 1fr; } .bt-side { grid-template-columns: 1fr 1fr; } .bt-acts { grid-column: 1 / -1; } }
@media (max-width: 1000px) {
  .bt-side { grid-template-columns: 1fr; }
  .bt-tbl th:nth-child(3), .bt-tbl th:nth-child(4) { display: none; }
  .bt-tbl tr { display: grid; grid-template-columns: auto 1fr; }
  .bt-tbl td { border-top: 0; padding: 8px 14px; }
  .bt-tbl tr { border-top: 1px solid var(--border); }
  .bt-rn { padding-top: 18px !important; }
  .bt-tbl td:nth-child(2) { grid-column: 2; }
  .bt-dc, .bt-ac { padding-top: 4px !important; width: auto; }
  .bt-tbl tr.bt-steps-row { border-top: 0; display: block; }
  .bt-tbl tr.bt-steps-row td:first-child { display: none; }
  .bt-tbl tr.bt-steps-row td { display: block; padding: 0 14px 12px; }
}

/* Pasos de cada ronda como fichas (Backoffice › Torneos; maqueta maquetas-torneo/5-backoffice-pasos). */
.bt-tbl tr.bt-steps-row td { border-top: 0; padding-top: 0; }
.bt-chip-list { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bt-chip { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-size: .85rem; }
.bt-chip.on { border: 2px solid var(--accent); }
.bt-chip.fin { background: #fcfbf7; }
.bt-chip.drag { opacity: .4; }
.bt-grip { color: #c9c3b3; font-size: .7rem; letter-spacing: -2px; padding-left: 8px; cursor: grab; }
.bt-chip-b { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 7px 8px; font: inherit; cursor: pointer; color: var(--text); }
.bt-chip-b span { color: var(--muted); }
.bt-chip-b .ic { color: var(--accent); }
.bt-x { border: 0; background: none; color: var(--muted); font-size: 1rem; padding: 0 9px 0 2px; cursor: pointer; }
.bt-x:hover { color: var(--danger); }
.bt-add-w { position: relative; }
.bt-add { border: 1.5px dashed #d6cfbd; border-radius: 10px; background: none; padding: 7px 12px; font: inherit; font-size: .85rem; font-weight: 700; color: var(--accent); cursor: pointer; }
.bt-menu { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; display: grid; min-width: 200px; padding: 6px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px #15170f22; }
.bt-menu button { display: flex; gap: 8px; align-items: center; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; font: inherit; font-size: .88rem; cursor: pointer; }
.bt-menu button:hover { background: #f4f1e8; }
.bt-cfg { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fcfbf7; display: grid; gap: 8px; max-width: 520px; font-size: .88rem; }
.bt-cfg .eyebrow { margin-bottom: 2px; }
.bt-menu[hidden], .bt-cfg[hidden], .bp-blind[hidden] { display: none; }
.bt-cfg-row { display: grid; grid-template-columns: 200px 70px 1fr; gap: 10px; align-items: center; }
.bt-cfg-row input { width: 70px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; font: inherit; text-align: center; }
.bt-cfg-r { display: flex; gap: 8px; align-items: center; }
.bt-inv { grid-column: 1 / -1; padding: 0; overflow: hidden; }
.bt-inv-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; }
.bt-inv-head h2 { margin: 0; }
.bt-inv-tbl td { vertical-align: middle; font-size: .86rem; }
.bt-inv-n { display: inline-flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; }
.bt-inv-n:hover b { text-decoration: underline; }
.bt-inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
@media (max-width: 1000px) {
  .bt-inv-tbl thead { display: none; }
  .bt-cfg-row { grid-template-columns: 1fr 70px; }
  .bt-cfg-row > .muted { grid-column: 1 / -1; }
}

/* Partida a ciegas (templates/tactics/bot_play.html; maqueta maquetas-torneo/8-a-ciegas): el tablero
   sin piezas, la última jugada marcada; "Espiar" las muestra 3 segundos. */
.lsn.blind .cg-wrap piece { visibility: hidden; }
.lsn.blind.peek .cg-wrap piece { visibility: visible; }
.bp-blind { display: grid; gap: 6px; padding: 12px 14px; margin: 0 0 12px; border: 1px solid var(--border); border-radius: 12px; background: #fcfbf7; }
.bp-blind-l { font-weight: 700; font-size: .85rem; }
.bp-blind-row { display: flex; gap: 8px; }
.bp-blind-row input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 1.05rem; background: #fff; }
.bp-blind-row input.bad { border-color: var(--danger, #b3261e); box-shadow: 0 0 0 2px #b3261e22; }
.bp-blind-msg { margin: 0; font-size: .82rem; color: var(--muted); }
.bp-blind-msg.bad { color: var(--danger, #b3261e); }
.bp-blind #peek-btn { justify-self: start; }

/* Invitaciones opcionales de Tu Torneo (templates/route/_invitacion_card.html e invitacion.html;
   maquetas maquetas-torneo/6 y 7). */
.iv-card { display: grid; gap: 10px; padding: 16px 18px; margin-bottom: 16px; border: 1.5px solid #e3cfa6; background: linear-gradient(180deg, #fbf6ea, #fff 60%); }
.iv-card p { margin: 0; font-size: .9rem; }
.iv-head { display: flex; gap: 12px; align-items: center; }
.iv-head h3 { font-size: 1.15rem; margin: 2px 0 0; }
.iv-head .eyebrow { margin-bottom: 0; }
.iv-logro { display: flex; gap: 10px; align-items: center; background: #f6eedd; border-radius: 10px; padding: 8px 10px; }
.iv-logro b { display: block; font-size: .9rem; } .iv-logro span { font-size: .76rem; color: var(--muted); }
.iv-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.iv-acts form { margin: 0; }
.iv-page { max-width: 860px; display: grid; gap: 16px; }
.iv-top { display: flex; gap: 18px; align-items: center; padding: 20px 22px; }
.iv-top h1 { font-size: 1.8rem; margin: 4px 0 0; }
.iv-top p { margin: 6px 0 0; }
.iv-score { margin-left: auto; text-align: right; flex: none; }
.iv-score b { font-family: var(--serif); font-size: 2.4rem; display: block; line-height: 1; }
.iv-score span { font-size: .8rem; color: var(--muted); }
.iv-games { padding: 18px 20px; display: grid; gap: 14px; }
.iv-grid { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 8px; }
.iv-g { display: grid; justify-items: center; gap: 6px; padding: 14px 8px; border: 1px solid var(--border); border-radius: 12px; text-align: center; font-size: .86rem; }
.iv-g.now { border: 2px solid var(--accent); box-shadow: 0 6px 18px #0f6b4f1f; }
.iv-gn { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.iv-res { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; padding: 0 10px; border-radius: 6px; }
.iv-res.gano { background: #0f6b4f17; color: var(--accent); }
.iv-res.tablas { background: #b0894f1f; color: var(--gold-text); }
.iv-res.perdio { background: #b0413e17; color: var(--danger); }
.iv-now { background: var(--accent); color: #fff; font-weight: 700; font-size: .78rem; padding: 3px 10px; border-radius: 6px; }
.iv-goal { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .86rem; color: var(--muted); }
.iv-goal span:first-child { color: var(--accent); font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.iv-logro-big { display: flex; gap: 18px; align-items: center; padding: 18px 22px; border: 1.5px solid #e3cfa6; background: #fbf6ea; }
.iv-logro-big.off { background: #fff; border-color: var(--border); }
.iv-logro-big.off .ic-badge { filter: grayscale(1); opacity: .55; }
.iv-logro-big h2 { font-size: 1.5rem; margin: 2px 0 4px; }
.iv-logro-big p { margin: 0 0 10px; }
@media (max-width: 640px) {
  .iv-top { flex-wrap: wrap; }
  .iv-score { margin-left: 0; text-align: left; }
}

/* Hub de Táctica (templates/tactics/hub.html; documentacion/marca/tactica-hub-propuesta.md). */
.th { display: grid; gap: 28px; }
.th-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.th-head h1 { margin: 0 0 4px; }
.th-head p { margin: 0; }
.th-stats { display: grid; grid-template-columns: repeat(4, auto); margin: 0; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.th-stats > div { padding: 10px 20px; border-left: 1px solid var(--border); }
.th-stats > div:first-child { border-left: 0; }
.th-stats dt { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--gold-text); }
.th-stats dd { margin: 2px 0 0; font-family: var(--serif); font-size: 1.5rem; font-weight: 700; line-height: 1.1; font-variant-numeric: lining-nums; }
.th-stats dd small { font-family: var(--font); font-size: .75rem; font-weight: 400; color: var(--muted); }
.th-top { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; }
.th-next { display: flex; gap: 28px; align-items: center; padding: 26px; border-radius: 18px; background: var(--text); color: #f2efe4; }
.th-board { width: 230px; flex: none; }
.th-next-txt h2 { color: #fff; font-size: 2rem; margin: 4px 0 8px; }
.th-next-txt p { margin: 0 0 14px; color: #d8d6cb; }
.th-next .eyebrow { color: #d6b77c; }
.th-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.th-pills span { padding: 5px 12px; border-radius: 999px; background: #ffffff14; border: 1px solid #ffffff22; font-size: .82rem; }
.th-go { background: #f6f2e6; color: var(--text); border-color: #f6f2e6; }
.th-go:hover { background: #fff; color: var(--text); }
.th-left { margin: 12px 0 0 !important; font-size: .82rem; color: #bdbcb2 !important; }
.th-side { display: grid; gap: 18px; }
.th-row { display: flex; gap: 16px; align-items: center; padding: 20px; color: var(--text); text-decoration: none; }
.th-row > div { flex: 1; min-width: 0; }
.th-row h3 { margin: 0 0 4px; }
.th-row p { margin: 0; font-size: .9rem; }
.th-num { font-family: var(--serif); font-size: 1.6rem; color: var(--danger); margin-right: 2px; }
.th-sec-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.th-sec-h h2 { margin: 0 0 4px; }
.th-sec-h p { margin: 0; }
.th-sec-h > a { font-weight: 700; color: var(--accent); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.th-themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.th-theme { display: flex; gap: 18px; align-items: center; padding: 14px; color: var(--text); text-decoration: none; }
.th-theme img { width: 104px; height: 104px; border-radius: 6px; flex: none; }
.th-theme > div { flex: 1; min-width: 0; }
.th-theme h3 { margin: 0 0 10px; }
.th-bar { height: 6px; border-radius: 3px; background: #ece6d6; overflow: hidden; }
.th-bar i { display: block; height: 100%; background: var(--gold); }
.th-meta { display: flex; justify-content: space-between; gap: 8px; margin: 8px 0; }
.th-link { display: inline-flex; gap: 4px; align-items: center; font-weight: 700; font-size: .9rem; color: var(--accent); text-decoration: none; margin-right: 14px; }
.th-explore { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.th-ex { display: flex; gap: 18px; align-items: flex-start; padding: 20px; color: var(--text); text-decoration: none; }
.th-ex h3 { margin: 0 0 6px; }
.th-ex p { margin: 0 0 10px; font-size: .9rem; }
.th-coords { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; flex-wrap: wrap; }
.th-coords h3 { margin: 0 0 2px; font-size: 1rem; }
.th-coords p { margin: 0; }
.th-coords-b { display: flex; gap: 8px; flex-wrap: wrap; }
a.card.th-row:hover, a.card.th-theme:hover, a.card.th-ex:hover { border-color: var(--accent); }
@media (max-width: 1100px) {
  .th-top { grid-template-columns: 1fr; }
  .th-explore { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .th-stats { grid-template-columns: repeat(2, 1fr); width: 100%; }
  .th-stats > div:nth-child(3) { border-left: 0; }
  .th-stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .th-next { flex-direction: column; align-items: stretch; padding: 18px; }
  .th-board { width: 100%; }
  .th-next-txt h2 { font-size: 1.6rem; }
  .th-themes { grid-template-columns: 1fr; }
  .th-theme img { width: 84px; height: 84px; }
  .th-row .btn { display: none; }
}

/* "Tus errores" (templates/tactics/errores.html y el aviso en la revisión de bot_play.html). */
.te-page { max-width: 900px; display: grid; gap: 16px; }
.te-list { padding: 0; overflow: hidden; }
.te-tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.te-tbl th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 16px; background: #fcfbf7; border-bottom: 1px solid var(--border); }
.te-tbl td { padding: 10px 16px; border-top: 1px solid var(--border); }
.te-bad { color: var(--danger); font-weight: 700; }
.te-good { color: var(--accent); font-weight: 700; }
.te-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.te-acts form { margin: 0; }
.rv-errores { margin: 4px 0 10px; padding: 10px 12px; border-radius: 10px; background: #0f6b4f12; font-size: .88rem; }
.rv-errores .ic { vertical-align: -3px; color: var(--accent); }
@media (max-width: 640px) { .te-tbl th:nth-child(4), .te-tbl td:nth-child(4) { display: none; } }

/* Paquete de visión (templates/tactics/vision_*.html; apps/tactics/vision.py). */
.vi-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.vi-seg button { border: 0; background: #fff; padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; color: var(--muted); }
.vi-seg button.on { background: var(--accent); color: #fff; font-weight: 700; }
.vi-score { margin: 10px 0 6px; }
/* ¿Qué cuelga? (vision_cuelga.html): por qué cuelga cada pieza, después de comprobar. */
.vi-pad { margin: 0 24px 10px; }
.vi-why { list-style: none; margin: 8px 12px 0; padding: 0; display: grid; gap: 6px; font-size: .86rem; }
.vi-why li { padding: 7px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 9%, var(--bg-card)); }
.vi-why li.miss { background: color-mix(in srgb, #c9a227 16%, var(--bg-card)); }
.vi-score b { font-family: var(--serif); font-size: 1.6rem; }
.vi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vi-chip { padding: 3px 10px; border-radius: 8px; font-weight: 700; font-size: .9rem; }
.vi-chip.ok { background: #0f6b4f17; color: var(--accent); }
.vi-chip.miss { background: #b0413e17; color: var(--danger); }
.vi-lives { display: inline-flex; gap: 2px; margin-left: 8px; vertical-align: -3px; }
.vi-lives .on .ic { color: var(--danger); }
.vi-lives .off .ic { color: #cfc8b8; }
.cg-wrap.vi-pal { position: static; width: auto; height: auto; display: grid; gap: 6px; margin-top: 12px; }
.vi-pal-row { display: flex; gap: 4px; flex-wrap: wrap; }
.vi-pal button { width: 46px; height: 46px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: #f4efe2; cursor: pointer; }
.vi-pal button.on { border: 2px solid var(--accent); background: #e6efe9; }
.cg-wrap.vi-pal piece { position: static; display: block; width: 100%; height: 100%; transform: none !important; pointer-events: none; }
.vi-pal .vi-erase { width: auto; padding: 0 12px; display: inline-flex; gap: 6px; align-items: center; font: inherit; font-size: .85rem; justify-self: start; }
.vi-target { display: flex; gap: 14px; align-items: flex-start; margin-top: 12px; }
.vi-target-b { width: 160px; flex: none; }
.lsn .vi-target-b .board-wrap { width: 160px; box-shadow: none; }
.vi-target p { margin: 4px 0; }
.vi-moves { font-weight: 700; min-height: 1.4em; }

/* Tu Torneo sin Premium (templates/route/premium.html). */
.tp-page { max-width: 860px; display: grid; gap: 16px; }
.tp-hero { display: flex; gap: 22px; align-items: flex-start; padding: 24px; }
.tp-hero h1 { margin: 2px 0 6px; }
.tp-hero p { margin: 0 0 14px; }
.tp-sec { padding: 18px 22px; }
.tp-steps, .tp-ladder { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.tp-steps li { display: flex; gap: 12px; align-items: center; }
.tp-steps b, .tp-steps span { display: block; }
.tp-steps span { color: var(--muted); font-size: .9rem; }
.tp-ladder li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.nav-lock { color: var(--gold); vertical-align: -1px; }
@media (max-width: 640px) { .tp-hero { flex-direction: column; } }

/* Contrarreloj como paso de Tu Torneo (templates/tactics/rush.html con ?ruta_fase). */
.rush-goal { display: grid; gap: 4px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--border); border-left: 4px solid var(--gold); border-radius: 10px; background: #fcfbf7; font-size: .9rem; }
.rush-of { font-size: 1rem; font-weight: 600; color: var(--muted); }
/* Contrarreloj: los dos modos (apps/tactics/views.py::RUSH_MODES). */
.rz-head { max-width: 720px; margin-bottom: 18px; }
.rz-head h1 { margin: .1em 0 6px; }
.rz-head p { margin: 0 0 4px; }
.rz-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; max-width: 760px; }
.rz-mode { display: grid; justify-items: start; gap: 8px; padding: 22px 24px; color: var(--text); }
.rz-mode:hover { text-decoration: none; border-color: var(--accent); }
.rz-mode.main { border: 2px solid var(--accent); }
.rz-mode.off { opacity: .55; pointer-events: none; }
.rz-mode h2 { margin: 6px 0 0; font-size: 1.5rem; }
.rz-mode p { margin: 0; color: var(--muted); font-size: .92rem; }
.rz-rec { font-size: .9rem; }
.rz-mode .btn { margin-top: 6px; display: inline-flex; align-items: center; gap: 8px; }
.rz-timer { color: var(--muted); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 4px; }
.rz-timer.down { color: var(--text); font-weight: 800; font-size: 1.15rem; }
.rz-timer.low { color: var(--danger); }
.rz-timer small { font-size: .74rem; }
.rz-rules { margin: 0 0 12px; font-size: .86rem; color: var(--muted); line-height: 1.45; }

/* ---- Reloj y estrellas de las partidas contra un bot (apps/tactics/clock.py; maquetas
   documentacion/marca/maquetas-bots/4-ritmo-y-estrellas y 5-partida-reloj). ---- */
.zz-stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.zz-stars i { width: 18px; height: 18px; display: block; }
.zz-stars svg { width: 100%; height: 100%; fill: #e3dccd; display: block; }
.zz-stars i.on svg { fill: #c9962e; }
.zz-stars.sm i { width: 13px; height: 13px; }

.br-head { margin-bottom: 16px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.br-tabsrow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.br-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .78rem; color: var(--muted); margin-left: auto; }
.br-legend span { margin-right: 10px; }
.bot-srow { min-height: 20px; display: flex; align-items: center; justify-content: center; margin: 2px 0 4px; }
.bot-srow.empty { font-size: .76rem; color: #a39a88; }
.bot-card.full { border: 2px solid #c9962e; box-shadow: 0 6px 20px #c9962e33; }

/* Partida: relojes como en Lichess (rival arriba del panel, vos abajo). */
.bp-clk { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fcfbf7; }
.lsn-head .bp-clk.top { margin: 0 -16px -10px; padding: 10px 14px; border-top: 1px solid var(--border); }
.bp-clk.bot { border-top: 1px solid var(--border); flex: none; }
.bp-clk img, .bp-clk .ch-mono { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.bp-clk .bp-you { width: 40px; height: 40px; border-radius: 50%; background: var(--text); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .78rem; flex: none; }
.bp-clk-n { min-width: 0; }
.bp-clk-n b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-clk-n span { font-size: .76rem; color: var(--muted); }
.bp-time { margin-left: auto; font-family: var(--font); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.8rem; line-height: 1.2; padding: 4px 14px; border-radius: 10px; background: var(--bg-elev); color: var(--muted); min-width: 108px; text-align: right; flex: none; }
.run > .bp-time, .bp-time.run { background: var(--accent); color: #fff; }
.low > .bp-time, .bp-time.low { background: var(--danger); color: #fff; }
.bp-meta { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; color: var(--muted); margin: 10px 12px 0; }
.bp-meta b { color: var(--text); }
.bp-retro { display: flex; gap: 10px; align-items: center; background: #f6eedd; border: 1px solid #e3cfa6; border-radius: 10px; padding: 8px 12px; font-size: .84rem; }
.bp-mclock { display: none; }
@container (max-width: 859px) {
  .lsn.has-clock { --stack: 120px; }
  .lsn.has-clock .lsn-board { flex-direction: column; align-items: center; }
  .bp-mclock { display: flex; align-items: center; gap: 8px; width: min(100%, var(--b)); padding: 4px 10px; background: var(--bg-card); box-sizing: border-box; }
  .bp-mclock img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
  .bp-mclock b { font-size: .86rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bp-mclock .bp-time { font-size: 1.15rem; min-width: 70px; padding: 2px 10px; }
  .bp-clk.bot { display: none; }
  .bp-meta { display: none; }
  .bp-retro { padding: 6px 10px; font-size: .8rem; }
}

/* Botón "Desafiar" (igual en todas las tarjetas) y ventana Desafiar (maqueta 6-desafiar). */
.bot-card { display: flex; flex-direction: column; }
.bot-card .card-body { flex: 1; display: flex; flex-direction: column; }
.bot-card .bot-blurb { flex: 1; }
.btn-desafiar { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; box-sizing: border-box; border: 0; border-radius: 12px; background: #17170f; color: #f6eedd; font: inherit; font-weight: 700; font-size: .95rem; letter-spacing: .02em; box-shadow: inset 0 -2px 0 #0006, 0 2px 0 #c9962e55; cursor: pointer; text-decoration: none; margin-top: auto; }
.btn-desafiar:hover { text-decoration: none; filter: brightness(1.25); color: #f6eedd; }
.btn-desafiar .sw2 { width: 18px; height: 18px; color: #d2ac74; flex: none; }
.btn-desafiar.big { width: auto; padding: 0 26px; height: 48px; font-size: 1rem; margin: 0; }
.btn-desafiar.locked { background: var(--bg-card); color: var(--gold-text); border: 1px solid var(--gold); box-shadow: none; }

.dz { border: 0; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); border-radius: 16px; background: var(--bg-card); color: var(--text); box-shadow: 0 24px 60px #0005; }
.dz::backdrop { background: #15170f8c; }
.dz-card { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); margin: 0; }
.dz-head { display: flex; gap: 14px; align-items: center; padding: 18px 20px; background: #fcfbf7; border-bottom: 1px solid var(--border); position: relative; flex: none; }
.dz-head img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); flex: none; }
.dz-head img[src=""] { display: none; }
.dz-head h2 { font-size: 1.5rem; margin: 2px 0 6px; }
.dz-head .eyebrow { margin: 0; }
.dz-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dz-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.dz-body { padding: 16px 20px 6px; overflow-y: auto; }
.dz-l { font-weight: 700; font-size: .95rem; margin-bottom: 8px; }
.dz-l span { font-weight: 500; font-size: .78rem; color: var(--muted); margin-left: 6px; }
.dz-gl { display: flex; align-items: center; gap: 6px; margin: 12px 0 6px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-text); }
.dz-gl svg { width: 15px; height: 15px; color: var(--gold); }
.dz-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dz-tile { border: 1px solid var(--border); background: var(--bg-card); border-radius: 12px; height: 46px; display: grid; place-items: center; font: inherit; color: var(--text); cursor: pointer; width: 100%; }
.dz-tile b { font-family: var(--serif); font-size: 1.15rem; font-variant-numeric: lining-nums; }
.dz-tile b.txt { font-family: var(--font); font-size: .9rem; }
.dz-tile:hover { border-color: var(--accent); }
.dz-tile.on { border: 2px solid var(--accent); background: #0f6b4f0d; }
.dz-tile.on b { color: var(--accent); }
.dz-tile.cust { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; border-style: dashed; }
.dz-tile.cust.on { border-style: solid; }
.dz-tile.cust span { font-size: .78rem; color: var(--muted); }
.dz-custom { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.dz-custom[hidden] { display: none; }
.dz-custom label { display: flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; }
.dz-custom input { width: 72px; padding: 6px 8px; }
.dz-colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
/* "Desafiar" a ciegas (Premium): Normal / A ciegas espiando 3 veces / sin espiar. */
.dz-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dz-modes .dz-tile { height: auto; min-height: 52px; padding: 6px 8px; display: flex; flex-direction: column; justify-content: center; gap: 2px; text-align: center; }
.dz-modes .dz-tile span { font-size: .74rem; color: var(--muted); }
.dz-modes .dz-tile.locked { grid-column: span 2; text-decoration: none; border-style: dashed; }
.dz-modes .dz-tile.locked b { display: inline-flex; align-items: center; gap: 6px; }
.dz-ctile { border: 1px solid var(--border); background: var(--bg-card); border-radius: 12px; height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px; font: inherit; font-weight: 700; font-size: .9rem; color: var(--text); cursor: pointer; }
.dz-ctile:hover { border-color: var(--accent); }
.dz-ctile.on { border: 2px solid var(--accent); background: #0f6b4f0d; color: var(--accent); }
.dz-ctile i { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #8a857a; display: block; flex: none; }
.dz-ctile .kw { background: #fff; }
.dz-ctile .kb { background: #1d1d18; }
.dz-ctile .kh { background: linear-gradient(90deg, #fff 50%, #1d1d18 50%); }
.dz-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px 18px; border-top: 1px solid var(--border); flex: none; }
@media (max-width: 600px) {
  .dz { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .dz[open] { animation: dz-up .22s ease-out; }
  .dz-card { max-height: 92dvh; }
  .dz-head { padding: 14px 16px; }
  .dz-head img { width: 56px; height: 56px; }
  .dz-head h2 { font-size: 1.25rem; }
  .dz-body { padding: 12px 16px 4px; }
  .dz-foot { padding: 12px 16px 16px; }
  .dz-foot .muted { display: none; }
  .dz-foot .btn-desafiar.big { width: 100%; }
}
@keyframes dz-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

/* ---- Backoffice › Suscripciones: Resumen, Suscriptores, Avisos, Planes y Bajas
   (apps/backoffice/subscribers.py; maquetas documentacion/marca/maquetas-pagos). ---- */
.bo-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; vertical-align: middle; margin-left: 4px; }
.sb-subnav { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 16px; }
.sb-subnav a { padding: 9px 14px; font-weight: 600; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.sb-subnav a:hover { color: var(--text); text-decoration: none; }
.sb-subnav a.on { color: var(--text); border-color: var(--accent); }
.sb-subnav em { font-style: normal; background: var(--danger); color: #fff; border-radius: 999px; font-size: .7rem; padding: 1px 6px; margin-left: 6px; }
.sb-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.sb-kpi { padding: 14px 16px; display: grid; gap: 2px; }
.sb-kpi span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.sb-kpi b { font-family: var(--serif); font-size: 1.7rem; font-variant-numeric: lining-nums; }
.sb-kpi small { font-size: .76rem; color: var(--muted); }
.sb-kpi.bad b { color: var(--danger); }
.sb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sb-bar .bt-tabs small { opacity: .7; font-weight: 600; margin-left: 2px; }
.sb-search { margin: 0; }
.sb-search input { min-width: 240px; padding: 8px 12px; }
.sb-tools { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sb-giftbox > summary { list-style: none; cursor: pointer; }
.sb-giftbox > summary::-webkit-details-marker { display: none; }
.sb-giftbox[open] > summary { margin-bottom: 8px; }
.sb-giftbox .admin-card { padding: 14px 16px; }
.sb-gift { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.sb-gift input[type=email] { min-width: 240px; padding: 8px 12px; }
.sb-gift select, .sb-gift input[type=date] { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev); font: inherit; font-size: .9rem; }
.sb-gift input[hidden] { display: none; }
.sb-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.sb-list { padding: 0; overflow: hidden; }
.sb-table td { font-size: .86rem; vertical-align: middle; white-space: normal; }
.sb-table td b { display: block; font-size: .9rem; color: var(--text); }
.sb-table td span:not(.sb-chip) { display: block; font-size: .76rem; color: var(--muted); }
.sb-table td a:hover { text-decoration: none; }
.sb-table td.mut { color: var(--muted); font-size: .8rem; }
.sb-table tr.sel td { background: #0f6b4f0b; }
.sb-table tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.sb-chip { display: inline-block; font-size: .74rem; font-weight: 700; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.sb-chip.ok { background: #0f6b4f17; color: var(--accent); }
.sb-chip.warn { background: #c47f1a22; color: #8a5a0c; }
.sb-chip.bad { background: #b0413e17; color: var(--danger); }
.sb-chip.muted { background: var(--bg-elev); color: var(--muted); }
.sb-chip.gold { background: #f6eedd; color: #8a6a35; }
.sb-det { padding: 16px; display: grid; gap: 12px; position: sticky; top: 16px; }
.sb-dh { display: flex; gap: 10px; align-items: center; }
.sb-av { width: 40px; height: 40px; border-radius: 50%; background: #17170f; color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.sb-dh b { display: block; }
.sb-dh span { font-size: .8rem; color: var(--muted); }
.sb-alert { border-radius: 10px; padding: 10px 12px; font-size: .84rem; border: 1px solid var(--border); background: var(--bg-elev); }
.sb-alert.bad { background: #b0413e12; border-color: #b0413e40; }
.sb-alert.warn { background: #c47f1a14; border-color: #c47f1a40; }
.sb-alert.gold { background: #f6eedd; border-color: #e3cfa6; }
.sb-dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 10px; margin: 0; font-size: .84rem; }
.sb-dl dt { color: var(--muted); }
.sb-dl dd { margin: 0; font-weight: 600; }
.sb-dl dd a { color: var(--accent); }
.sb-id { font-size: .72rem; color: var(--muted); font-weight: 400; }
.sb-h { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.sb-pays { display: grid; gap: 6px; font-size: .84rem; }
.sb-pays div { display: flex; align-items: center; gap: 8px; }
.sb-pays em { margin-left: auto; font-style: normal; font-size: .76rem; color: var(--muted); }
.sb-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.sb-dot.ok { background: var(--accent); }
.sb-dot.bad { background: var(--danger); }
.sb-dot.warn { background: #c47f1a; }
.sb-dot.muted { background: #b3ab9b; }
.sb-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.sb-acts form { margin: 0; }
.sb-days > summary { list-style: none; cursor: pointer; }
.sb-days > summary::-webkit-details-marker { display: none; }
.sb-days[open] { flex-basis: 100%; }
.sb-days form { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .86rem; }
.sb-days input { width: 72px; padding: 6px 8px; }
.sb-danger { border: 1px solid #b0413e55; color: var(--danger); background: var(--bg-card); }
.sb-danger:hover { background: #b0413e0d; filter: none; }
.sb-agrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.sb-col { display: grid; gap: 16px; }
.sb-avl { padding: 0; overflow: hidden; }
.sb-avh { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.sb-avh-r { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sb-avh-r form { margin: 0; }
.sb-av2 { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.sb-avh + .sb-av2 { border-top: 0; }
.sb-av2:hover { background: #0f6b4f08; text-decoration: none; }
.sb-av2.new { background: #0f6b4f0d; }
.sb-av2 b { display: block; font-size: .92rem; }
.sb-av2 span { font-size: .82rem; color: var(--muted); }
.sb-av2 em { margin-left: auto; font-style: normal; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.sb-rs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sb-rs div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.sb-rs b { display: block; font-family: var(--serif); font-size: 1.35rem; font-variant-numeric: lining-nums; }
.sb-rs span { font-size: .78rem; color: var(--muted); }
.sb-rs .bad b { color: var(--danger); }
@media (max-width: 1200px) {
  .sb-split, .sb-agrid { grid-template-columns: 1fr; }
  .sb-det { position: static; }
}
@media (max-width: 800px) { .sb-kpis { grid-template-columns: 1fr 1fr; } }

/* ---- Íconos propios (apps/core/icons.py; guía documentacion/marca/iconos/README.md). Suelto:
   `.ic`, 18 px, color del texto. En círculo de color suave: `.ic-badge` (36 / 46 / 76) con un
   tono (verde, dorado, rojo, naranja solo para la racha, gris; bronce/plata/oro en logros). ---- */
.ic { flex: none; vertical-align: -.2em; }
.ic-badge { display: inline-grid; place-items: center; flex: none; border-radius: 50%; color: var(--tone, #0F6B4F); background: color-mix(in srgb, var(--tone, #0F6B4F) 14%, transparent); }
.ic-badge .ic { vertical-align: 0; }
.ic-badge.s36 { width: 36px; height: 36px; }
.ic-badge.s46 { width: 46px; height: 46px; }
.ic-badge.s76 { width: 76px; height: 76px; }
.ic-badge.t-verde { --tone: #0F6B4F; }
.ic-badge.t-dorado { --tone: #8A6A35; }
.ic-badge.t-rojo { --tone: #B0413E; }
.ic-badge.t-naranja { --tone: #C2662D; }
.ic-badge.t-gris { --tone: #5C584F; }
.ic-badge.t-bronce { --tone: #A0663A; }
.ic-badge.t-plata { --tone: #7D848C; }
.ic-badge.t-oro { --tone: #8A6A35; }
.ic-gold { color: #8A6A35; }
.ic-red { color: var(--danger); }
.ic-green { color: var(--accent); }
.ic-muted { color: var(--muted); }
.ic-streak { color: #C2662D; }

/* ===== Test de nivel (documentacion/marca/maquetas-test-nivel/, 2026-11-08): .lt-* ===== */
.lt-onb { max-width: 560px; margin: 12px auto 30px; padding: 32px 36px 28px; display: grid; justify-items: start; gap: 4px; }
.lt-onb h1 { font-size: 2rem; margin: 2px 0 6px; }
.lt-lead { color: var(--muted); font-size: 1rem; margin: 0 0 18px; }
.lt-form { width: 100%; display: grid; }
.lt-q { display: grid; gap: 2px; margin-bottom: 10px; }
.lt-opts { display: grid; gap: 8px; margin-bottom: 18px; }
.lt-opt { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: .95rem; cursor: pointer; min-height: 48px; }
.lt-opt.on { border: 2px solid var(--accent); padding: 9px 13px; background: #0f6b4f08; }
.lt-opt input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.lt-opt:not(.on) .lt-inp { visibility: hidden; }
.lt-inp { margin-left: auto; width: 110px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font: inherit; font-weight: 700; }
.lt-go { height: 52px; font-size: 1.02rem; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.lt-skip { justify-self: center; margin-top: 12px; color: var(--muted); font-size: .9rem; text-decoration: underline; background: none; border: 0; cursor: pointer; }
.lt-facts { list-style: none; padding: 16px 0 0; margin: 18px 0 0; border-top: 1px solid var(--border); width: 100%; display: grid; gap: 6px; font-size: .86rem; color: var(--muted); }
.lt-facts li { display: flex; gap: 8px; align-items: center; }
.lt-facts .ic { color: var(--accent); }
.lt-credit { text-align: center; font-size: .78rem; color: var(--muted); margin: 8px 0 0; }
.lt-dots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin-top: 10px; }
.lt-dots i { height: 26px; border-radius: 7px; background: var(--bg-elev); display: grid; place-items: center; font-size: .72rem; font-weight: 800; font-style: normal; color: #fff; }
.lt-dots i.ok { background: var(--accent); }
.lt-dots i.bad { background: var(--danger); }
.lt-dots i.now { background: var(--bg-card); border: 2px solid var(--accent); color: var(--accent); }
.lt-how { margin: 12px 24px 0; }
.lt-res { max-width: 1040px; margin: 4px auto 30px; }
.lt-res-h { display: grid; grid-template-columns: 340px minmax(0, 1fr); overflow: hidden; padding: 0; }
.lt-res-n { background: var(--text); color: #f2efe4; padding: 26px 28px; }
.lt-res-n .eyebrow { color: #d2ac74; }
.lt-big { font-family: var(--serif); font-size: 4.4rem; font-weight: 700; line-height: 1; margin: 6px 0 8px; font-variant-numeric: lining-nums; }
.lt-res-sub { color: #bdb6a6; font-size: .88rem; margin: 6px 0; }
.lt-scale { margin: 14px 0 10px; }
.lt-sbar { position: relative; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #e9e2d3, #b0894f 55%, #0f6b4f); }
.lt-sbar i { position: absolute; top: -5px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); transform: translateX(-50%); box-shadow: 0 2px 6px #0004; }
.lt-slab { display: flex; justify-content: space-between; font-size: .7rem; color: #9d978a; margin-top: 6px; }
.lt-res-d { padding: 22px 26px; display: grid; align-content: space-between; gap: 16px; }
.lt-res-d h3 { font-size: 1.05rem; margin: 0 0 8px; }
.lt-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.lt-th { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lt-th li { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; font-size: .92rem; }
.lt-share { display: flex; align-items: center; gap: 10px; background: var(--bg-elev); border-radius: 12px; padding: 10px 14px; font-size: .86rem; }
.lt-share .ic { color: var(--accent); flex: none; }
.lt-share .btn { margin-left: auto; flex: none; }
.lt-share.wide { margin-top: 16px; }
.lt-recs { display: grid; gap: 10px; }
.lt-rec { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 18px; }
.lt-rec img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
.lt-rec > div { display: grid; line-height: 1.3; }
.lt-rec b { font-size: 1.02rem; }
.lt-rec small { color: var(--muted); }
.lt-res-f { display: flex; justify-content: center; margin-top: 22px; }
.lt-save { margin-top: 16px; padding: 24px 28px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: center; border: 2px solid var(--accent); }
.lt-save h2 { font-size: 1.6rem; margin: 4px 0 6px; }
.lt-save p { margin: 0; }
.lt-save-a { display: grid; gap: 8px; justify-items: center; }
/* La caja del hero de la portada (maqueta 4-portada). */
.lt-hero-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lt-pill { background: var(--accent); color: #fff; border-radius: 999px; padding: 3px 10px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.lt-hero-h b { font-family: var(--serif); font-size: 1.2rem; }
.lt-hero-sub { color: var(--muted); font-size: .86rem; margin: 6px 0 10px; }
.lt-hero-f { margin-top: 10px; display: grid; gap: 8px; font-size: .88rem; }
.lt-bars { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.lt-bars i { height: 8px; border-radius: 4px; background: var(--bg-elev); }
.lt-bars i.ok { background: var(--accent); }
.lt-bars i.bad { background: var(--danger); }
.lt-bars i.now { background: var(--gold); }
.lt-hero-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.lt-hero-acts .btn[hidden] { display: none; }
.lt-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.lt-band > div { display: flex; gap: 14px; align-items: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; }
.lt-band b { display: block; }
.lt-band span { color: var(--muted); font-size: .86rem; }
.lt-band p { margin: 0; }
/* Progreso: hacer o repetir el test. */
.lt-prog { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 18px; }
.lt-prog > div { flex: 1; display: grid; gap: 2px; }
.lt-prog .btn { flex: none; }
@media (max-width: 860px) {
  .lt-res-h, .lt-save { grid-template-columns: minmax(0, 1fr); }
  .lt-band { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .lt-onb { padding: 22px 18px; }
  .lt-onb h1 { font-size: 1.6rem; }
  .lt-rec { grid-template-columns: 40px minmax(0, 1fr); }
  .lt-rec .btn { grid-column: 2; justify-self: start; }
  .lt-share { flex-wrap: wrap; }
  .lt-prog { flex-wrap: wrap; }
}
