/* AUDIBLE — rediseño 2026: claro por defecto (rojo, blanco, dorado; detalles en negro) y tema oscuro. Un solo botón rojo por pantalla; dorado = destacado. */
@font-face { font-family: "Barlow Condensed"; src: url(../fonts/barlow-600.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(../fonts/barlow-800.woff2) format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(../fonts/barlow-800i.woff2) format("woff2"); font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url(../fonts/inter.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  /* Tema claro (por defecto, como los mockups): rojo #D7182A, blanco, dorado #E8B447 y detalles en negro #141414 */
  color-scheme: light;
  --bg: #F6F4EF;
  --bg-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F3F0EA;
  --surface-3: #E9E4DA;
  --border: #E6E1D6;
  --border-2: #D3CCBE;
  --hair: rgba(20,20,20,.12);
  --text: #141414;
  --text-2: #3B3833;
  --muted: #6E6A63;
  --strong: #141414;
  --ink: #141414;
  --on-ink: #FFFFFF;
  --red: #D7182A;
  --red-2: #A30F1E;
  --red-soft: rgba(215, 24, 42, .10);
  --red-glow: transparent;
  --gold: #E8B447;
  --gold-2: #B8871A;
  --gold-ink: #8A6412;
  --gold-soft: #FBF1D9;
  --gold-line: #EBD39A;
  --ok: #1C8A4A;
  --ok-ink: #17733E;
  --danger: #C4122A;
  --danger-ink: #A30F1E;
  --warn-ink: #7A5A10;
  --u-ofensiva: #D7182A;
  --u-defensiva: #141414;
  --u-especiales: #B8871A;
  --u-general: #8F8A80;
  --field-bg: #FFFFFF;
  --bar-bg: #FFFFFF;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(20,20,20,.16);
  --shadow-card: 0 1px 0 rgba(0,0,0,.04), 0 4px 14px rgba(20,20,20,.06);
  --shadow-hard: 0 3px 0 var(--ink);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --sidebar-w: 248px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
/* Tema oscuro (Perfil → Tema): mismas reglas, superficies casi negras */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E0E10;
  --bg-2: #18181B;
  --surface: #17171A;
  --surface-2: #202024;
  --surface-3: #2B2B30;
  --border: #29292E;
  --border-2: #3B3B42;
  --hair: rgba(255,255,255,.14);
  --text: #F4F4F5;
  --text-2: #CFCFD4;
  --muted: #9A9AA3;
  --strong: #FFFFFF;
  --ink: #F4F4F5;
  --on-ink: #141414;
  --red: #E01E31;
  --red-2: #B3121F;
  --red-soft: rgba(224, 30, 49, .16);
  --gold-ink: #E8B447;
  --gold-soft: rgba(232, 180, 71, .14);
  --gold-line: rgba(232, 180, 71, .4);
  --ok: #22C55E;
  --ok-ink: #9BE7B4;
  --danger: #FF7A86;
  --danger-ink: #FFB3BB;
  --warn-ink: #FFE2A0;
  --u-ofensiva: #FF5A68;
  --u-defensiva: #E8E8EA;
  --u-especiales: #E8B447;
  --bar-bg: #141417;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  --shadow-card: 0 1px 0 rgba(255,255,255,.03), 0 4px 14px rgba(0,0,0,.35);
  --shadow-hard: 0 3px 0 #000;
}
body[data-field="dark"] { --field-bg: #0E4122; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; touch-action: manipulation; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
/* iOS Safari: avoid double-tap zoom on controls while keeping field/board gestures scoped below. */
a, button, input, select, textarea, summary, [role="button"] { touch-action: manipulation; }
img, svg { display: block; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--text-2); outline-offset: 2px; }

/* ---------- Shell ---------- */
.shell { min-height: 100%; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--bg);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 24px 14px 18px; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand img { width: 28px; height: 28px; }
.wordmark { font-family: var(--display); font-weight: 800; font-style: italic; letter-spacing: .03em; font-size: 26px; line-height: 1; color: var(--strong); }
.team-name { margin: 8px 8px 22px; font-size: 13px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 500; font-size: 14.5px; transition: background .15s, color .15s;
}
.nav a svg { width: 20px; height: 20px; flex: none; opacity: .8; }
.nav a:hover { background: var(--surface); color: var(--strong); }
.nav a.active { background: var(--surface); color: var(--strong); font-weight: 600; }
.nav a.active svg { color: var(--red); opacity: 1; }
.nav .sep { height: 1px; background: var(--border); margin: 12px 8px; }
.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 4px; }
.sidebar-foot .who { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; color: var(--text-2); }
.sidebar-foot .who:hover { background: var(--surface); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--strong); flex: none; }

.topbar { display: none; }
.tabbar { display: none; }
.more-sheet { display: none; }

.view { margin-left: var(--sidebar-w); padding: 36px 44px 64px; min-height: 100vh; outline: none; max-width: calc(1360px + var(--sidebar-w)); }

@media (max-width: 900px) {
  /* Safari zooms the page when a focused control is smaller than 16px. */
  input, textarea, select { font-size: 16px !important; }
@media (hover: none) and (pointer: coarse) { input, textarea, select { font-size: 16px !important; } }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 30; padding: calc(8px + var(--safe-t)) 12px 8px 16px; background: var(--bg);
  }
  .topbar .brand { padding: 0; }
  .topbar .brand img { width: 26px; height: 26px; }
  .topbar .wordmark { font-size: 22px; }
  .view { margin-left: 0; padding: 12px 16px calc(100px + var(--safe-b)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 36;
    background: var(--bg); border-top: 1px solid var(--border); padding: 4px 4px calc(4px + var(--safe-b));
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; padding: 0; border: 0; background: none; font-size: 11px; font-weight: 500; color: var(--muted); border-radius: 10px; cursor: pointer; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .active { color: var(--strong); }
  .tabbar .active svg { color: var(--red); }
  /* Menú “Más” (hoja inferior) */
  .more-sheet { display: block; position: fixed; inset: 0; z-index: 35; pointer-events: none; }
  .more-sheet .more-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .2s; }
  .more-sheet .more-panel {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(76px + var(--safe-b));
    background: var(--surface); border-radius: 18px 18px 0 0; transform: translateY(100%); transition: transform .24s cubic-bezier(.2,.8,.2,1);
  }
  .more-sheet.open { pointer-events: auto; }
  .more-sheet.open .more-scrim { opacity: 1; }
  .more-sheet.open .more-panel { transform: none; }
  .more-title { font-size: 13px; color: var(--muted); padding: 8px 12px 6px; }
  .more-panel a { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 12px; border-radius: 12px; color: var(--text); }
  .more-panel a svg { width: 22px; height: 22px; color: var(--text-2); flex: none; }
  .more-panel a span { display: grid; line-height: 1.3; }
  .more-panel a b { font-weight: 600; font-size: 15px; }
  .more-panel a small { color: var(--muted); font-size: 13px; }
  .more-panel a:hover, .more-panel a:active { background: var(--surface-2); }
  .more-panel a.active svg { color: var(--red); }
}

.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--surface); color: var(--strong); }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
h1.title { font-family: var(--font); font-weight: 700; font-size: 30px; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h2.section { font-family: var(--font); font-weight: 600; font-size: 17px; margin: 32px 0 12px; }
.subtitle { color: var(--muted); margin: 6px 0 0; font-size: 14px; max-width: 62ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 900px) { h1.title { font-size: 24px; } .page-head { margin-bottom: 18px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-2);
  background: transparent; color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s; white-space: nowrap; user-select: none;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-2); border-color: var(--red-2); }
.btn.gold { background: transparent; border-color: var(--border-2); color: var(--text); } /* secundario: el dorado queda solo como acento */
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--strong); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.icon { width: 44px; padding: 0; }
.btn.sm.icon { width: 36px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 4px; color: var(--text-2); font-weight: 500; font-size: 14px; }
.link-btn:hover { color: var(--strong); }
.link-btn svg { width: 18px; height: 18px; }

/* Menú “…” en tarjetas */
.more { position: relative; flex: none; }
.more-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.more-btn:hover, .more-btn[aria-expanded="true"] { background: var(--surface-3); color: var(--strong); }
.more-btn svg { width: 20px; height: 20px; }
.more-pop { position: absolute; right: 0; bottom: calc(100% + 4px); z-index: 15; min-width: 190px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: var(--shadow); display: grid; gap: 2px; }
.more-pop[hidden] { display: none; }
.more-pop > * { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; white-space: nowrap; }
.more-pop > *:hover { background: var(--surface-3); }
.more-pop svg { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.more-pop .danger, .more-pop .danger svg { color: var(--danger); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 10px;
  padding: 10px 12px; color: var(--strong); outline: none; transition: border-color .15s; font-size: 15px;
}
.input, .select { height: 44px; min-width: 0; }
.p-head-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .p-head-grid { grid-template-columns: 1fr 1fr; } .p-head-grid > :first-child { grid-column: 1 / -1; } .row.stack-sm { grid-template-columns: 1fr; } }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--text-2); }
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 600px) { .row-3 { grid-template-columns: 1fr 1fr; } }
.search { position: relative; flex: 1; min-width: 200px; }
.search svg { position: absolute; left: 12px; top: 12px; width: 20px; height: 20px; color: var(--muted); }
.search .input { padding-left: 40px; background: var(--surface); border-color: transparent; }
.search .input:focus { border-color: var(--border-2); }

/* ---------- Chips / etiquetas (discretos) ---------- */
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { color: var(--strong); }
.chip.active, .chip.active.red { background: var(--surface-3); color: var(--strong); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 500; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); background: none !important; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, currentColor); }
.u-ofensiva { --dot: var(--u-ofensiva); }
.u-defensiva { --dot: var(--u-defensiva); }
.u-especiales { --dot: var(--u-especiales); }
.u-general { --dot: var(--u-general); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--muted)); margin-right: 6px; vertical-align: 1px; }
/* Filtros en fila con desplazamiento horizontal (móvil) */
.toolbar .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.toolbar .chips::-webkit-scrollbar { display: none; }
.toolbar .chips .chip { flex: none; min-height: 40px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 0; border-radius: var(--radius); }
.card.pad { padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid.plays { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.drills { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (max-width: 600px) { .grid.plays, .grid.drills { grid-template-columns: 1fr; gap: 12px; } .card.pad { padding: 16px; } }

.play-card { display: flex; flex-direction: column; transition: background .15s; position: relative; }
.play-card:hover { background: var(--surface-2); }
.play-card .thumb { aspect-ratio: 1000/640; background: var(--field-bg); cursor: pointer; position: relative; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.play-card .thumb svg { width: 100%; height: 100%; }
.play-card .thumb .badge, .play-card .thumb .fmt { display: none; }
.play-card .body { padding: 12px 16px; flex: 1; min-width: 0; }
.play-card .name { font-family: var(--font); font-weight: 600; font-size: 16px; line-height: 1.3; cursor: pointer; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; } /* nombres largos (Playmaker): hasta 2 líneas */
/* Grupos del playbook (p. ej. ULI, CUADRO, FOUR…): encabezado simple que ocupa toda la fila de la cuadrícula */
.grid.plays .pb-group { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; margin: 14px 0 -4px; font-family: var(--font); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.grid.plays .pb-group:first-child { margin-top: 0; }
.grid.plays .pb-group .count { font-weight: 500; letter-spacing: 0; color: var(--muted); }
.play-card .pm-num { display: inline-block; min-width: 22px; margin-right: 7px; padding: 0 5px; border-radius: 6px; background: var(--surface-3); color: var(--gold); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; vertical-align: 1px; }
.play-card .meta { color: var(--muted); font-size: 13px; margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-card .foot { display: flex; gap: 6px; padding: 0 8px 8px 16px; align-items: center; }
.play-card .foot .btn { flex: 1; }
.play-card .card-row { display: flex; align-items: center; padding-right: 6px; }
.play-card .card-row .body { flex: 1; }

.drill-card { padding: 0; overflow: hidden; display: grid; grid-template-columns: 104px 1fr; min-height: 96px; cursor: pointer; transition: background .15s; }
.drill-card:hover { background: var(--surface-2); }
.drill-card .side { background: var(--field-bg); position: relative; }
.drill-card .side svg { width: 100%; height: 100%; object-fit: cover; }
.drill-card .side.noplay { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.drill-card .side .min, .lib-drill .side .min { position: absolute; bottom: 6px; left: 6px; background: rgba(0,0,0,.7); border-radius: 6px; padding: 1px 6px; font-weight: 600; font-size: 12px; }
.drill-card .content { padding: 14px 16px; min-width: 0; align-self: center; }
.drill-card .name { font-family: var(--font); font-weight: 600; font-size: 16px; line-height: 1.3; margin: 0 0 2px; }
.drill-card .desc { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.big-min { font-weight: 700; font-size: 30px; color: var(--text); line-height: 1; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); border-radius: var(--radius); background: var(--surface); }
.empty strong { display: block; color: var(--strong); font-size: 17px; font-weight: 600; margin-bottom: 4px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }

/* ---------- Inicio ---------- */
.greet { margin: 8px 0 28px; }
.greet h1 { font-weight: 700; font-size: 30px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -.01em; }
.greet p { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.greet .actions { gap: 4px 16px; }
.greet .btn.primary { height: 48px; padding: 0 22px; font-size: 15px; }
@media (max-width: 600px) { .greet h1 { font-size: 26px; } .greet .btn.primary { width: 100%; } .greet .actions { justify-content: space-around; } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
.stat { padding: 14px 16px; display: block; background: var(--surface); border-radius: 0; }
.stat:hover { background: var(--surface-2); }
.stat .n { font-weight: 700; font-size: 22px; line-height: 1.2; }
.stat .l { color: var(--muted); font-size: 13px; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
@media (max-width: 1100px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
.list { display: grid; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px; border-top: 1px solid var(--border); }
.list-row:first-child { border-top: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row .th { width: 64px; flex: none; border-radius: 6px; overflow: hidden; background: var(--field-bg); }
.list-row .th svg { width: 100%; height: auto; }
.list-row .tx { flex: 1; min-width: 0; }
.list-row .tx b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .tx span { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .chev { color: var(--muted); flex: none; }
.list-row .chev svg { width: 18px; height: 18px; transform: rotate(180deg); }
.list-row .dtile { width: 64px; flex: none; text-align: center; line-height: 1.1; }
.list-row .dtile b { display: block; font-size: 20px; font-weight: 700; }
.list-row .dtile small { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.sug-home { padding: 16px 20px 8px; margin: 28px 0 0; }
.sug-home h3 { margin: 0 0 2px; font-size: 15px; font-weight: 600; }
.sug-home p { margin: 0; color: var(--muted); font-size: 13.5px; }
.goal-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.goal-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.goal-links a:hover { color: var(--strong); }
.goal-links a::after { content: "→"; margin-left: 6px; color: var(--muted); }

.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--hair); cursor: pointer; padding: 0; position: relative; }
.swatch.active { border-color: var(--strong); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--strong); }
.swatch-custom { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; border: 2px dashed var(--border-2); position: relative; cursor: pointer; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.swatch-custom input { position: absolute; inset: -8px; opacity: 0; cursor: pointer; width: 50px; height: 50px; }
.panel { padding: 18px; }
.panel + .panel { margin-top: 14px; }
.panel h3 { margin: 0 0 12px; font-weight: 600; font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; background: var(--bg-2); border-radius: 10px; }
.seg button { min-height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 500; font-size: 13.5px; cursor: pointer; }
.seg button:hover { color: var(--strong); }
.seg button.active { background: var(--surface-3); color: var(--strong); font-weight: 600; }
.sel-info { font-size: 13px; color: var(--muted); }
.sticky-save { position: sticky; bottom: 0; }
@media (max-width: 900px) { .sticky-save { bottom: calc(70px + var(--safe-b)); } }

/* ---------- Entrenamientos ---------- */
.practice-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .practice-layout { grid-template-columns: minmax(0, 1fr); } }
.summary-bar { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; padding: 16px; margin-bottom: 14px; }
.summary-bar .kpi .v { font-weight: 700; font-size: 22px; line-height: 1.2; }
.summary-bar .kpi .k { font-size: 12.5px; color: var(--muted); }
.dist { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--surface-3); flex: 1; min-width: 160px; }
.dist span { display: block; height: 100%; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.blocks { display: flex; flex-direction: column; gap: 8px; }
.block {
  display: grid; grid-template-columns: 30px 70px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 10px 10px 0; border-radius: 12px; background: var(--surface); position: relative; overflow: hidden;
}
.block::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--unit-color, var(--u-general)); }
.block.dragging { opacity: .95; box-shadow: var(--shadow); background: var(--surface-2); z-index: 5; }
.block .handle { cursor: grab; color: var(--muted); display: grid; place-items: center; height: 100%; min-height: 44px; touch-action: none; padding-left: 6px; }
.block .handle svg { width: 18px; height: 18px; }
.block .time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 16px; line-height: 1; color: var(--text); }
.block .time small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; margin-top: 3px; }
.block .main { min-width: 0; }
.block .bt { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block .sub { display: flex; gap: 8px; align-items: center; margin-top: 5px; flex-wrap: wrap; }
.block .sub .select { height: 34px; padding: 0 28px 0 10px; font-size: 13px; width: auto; background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px; }
.block .sub .input { height: 34px; width: 70px; padding: 0 8px; font-size: 13px; text-align: center; }
.block .btns { display: flex; gap: 2px; }
.block .notes { grid-column: 3 / 5; }
.block .notes .input { height: 38px; font-size: 13px; }
@media (max-width: 600px) {
  .block { grid-template-columns: 26px 58px 1fr; }
  .block .btns { grid-column: 2 / 4; justify-content: flex-end; }
  .block .notes { grid-column: 2 / 4; }
}
.picker-list { display: flex; flex-direction: column; gap: 2px; max-height: 460px; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.pick { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; min-height: 52px; padding: 8px 10px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.pick:hover { background: var(--surface-2); }
.pick .n { font-weight: 600; font-size: 14px; }
.pick .m { font-size: 12.5px; color: var(--muted); }
.pick .plus { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; color: var(--strong); }
.pick .plus svg { width: 16px; height: 16px; }
.practice-card { padding: 12px 6px 12px 16px; display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; cursor: pointer; transition: background .15s; }
.practice-card:hover { background: var(--surface-2); }
.practice-card .pt { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.practice-card .pm { color: var(--muted); font-size: 13px; }
.date-tile { width: 52px; text-align: center; line-height: 1.15; }
.date-tile .m { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: capitalize; }
.date-tile .d { font-weight: 700; font-size: 22px; }
.date-tile .w { display: none; }

/* ---------- Ejercicio (formulario) ---------- */
.linked-play { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: var(--bg-2); margin-top: 8px; }
.linked-play .th { border-radius: 8px; overflow: hidden; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .form-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Datos ---------- */
.data-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.data-grid .card h3 { margin: 0 0 6px; font-weight: 600; font-size: 17px; }
.data-grid .card p { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--bg-2); padding: 2px 6px; border-radius: 6px; }

/* ---------- Modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s ease-out; }
.modal { width: min(460px, 100%); padding: 24px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); animation: pop .18s ease-out; }
.modal h3 { margin: 0 0 8px; font-weight: 600; font-size: 19px; }
.modal p { color: var(--text-2); margin: 0 0 20px; }
.modal .actions { justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 200; background: var(--strong); color: var(--bg); font-weight: 600; font-size: 14px; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); transition: all .22s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 900px) { .toast { bottom: calc(86px + var(--safe-b)); } }

/* ---------- Vista imprimible ---------- */
.print-view { background: #fff; color: #111; border-radius: 16px; padding: 28px; max-width: 900px; margin: 0 auto; }
.print-view .ph { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 2px solid #111; padding-bottom: 14px; margin-bottom: 18px; }
.print-view .ph .brandp { display: flex; align-items: center; gap: 10px; }
.print-view .ph .brandp b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 24px; letter-spacing: .03em; }
.print-view h1 { font-weight: 700; font-size: 26px; margin: 0; line-height: 1.15; }
.print-view .meta { color: #555; margin-top: 4px; }
.print-view .totals { display: flex; gap: 16px; text-align: right; }
.print-view .totals .v { font-weight: 700; font-size: 22px; line-height: 1.1; color: #111; }
.print-view .totals .k { font-size: 12px; color: #666; }
.print-view table { width: 100%; border-collapse: collapse; }
.print-view th { text-align: left; font-size: 12px; color: #666; border-bottom: 1px solid #ddd; padding: 8px 6px; font-weight: 600; }
.print-view td { border-bottom: 1px solid #eee; padding: 10px 6px; vertical-align: top; font-size: 14px; }
.print-view td.t { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; width: 110px; }
.print-view .ubar { display: inline-block; width: 4px; height: 16px; border-radius: 2px; vertical-align: middle; margin-right: 8px; }
.print-view .unit-pill { font-size: 12px; font-weight: 600; }
.print-view .drill-detail { display: grid; grid-template-columns: 1fr 220px; gap: 14px; break-inside: avoid; border: 1px solid #e5e5e5; border-radius: 10px; padding: 12px; margin-top: 10px; }
.print-view .drill-detail h4 { margin: 0 0 4px; font-size: 15px; }
.print-view .drill-detail p { margin: 0 0 6px; font-size: 13px; color: #333; white-space: pre-line; }
.print-view .drill-detail .cp { color: #7a1010; }
.print-view h2 { font-size: 17px; font-weight: 700; margin: 22px 0 6px; }
.print-view .notes { background: #f7f7f5; padding: 10px 12px; border-radius: 8px; font-size: 14px; white-space: pre-line; }
@media (max-width: 600px) { .print-view { padding: 16px; } .print-view .ph { flex-direction: column; align-items: flex-start; } .print-view .drill-detail { grid-template-columns: 1fr; } .print-view td.t { width: 80px; } }
.print-toolbar { max-width: 900px; margin: 0 auto 14px; }

@media print {
  body { background: #fff !important; }
  .sidebar, .topbar, .tabbar, .more-sheet, .print-toolbar, .toast { display: none !important; }
  .view { margin: 0 !important; padding: 0 !important; }
  .print-view { border-radius: 0; padding: 0; max-width: none; }
  @page { margin: 14mm; }
}

.muted { color: var(--muted); }
@media (max-width: 600px) { .hide-sm { display: none !important; } .page-head .actions .btn:not(.primary) { padding: 0 12px; } }
.gold-text { color: var(--gold); }
.mt { margin-top: 14px; }
.hide { display: none !important; }
.pre { white-space: pre-line; }
@media (hover: none) { .hide-touch { display: none !important; } }

/* ---------- Sugerencias ---------- */
.tabs { display: flex; gap: 2px; margin-bottom: 22px; padding: 3px; background: var(--surface); border-radius: 12px; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 500; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tabs button svg { display: none; }
.tabs button:hover { color: var(--strong); }
.tabs button.active { background: var(--surface-3); color: var(--strong); font-weight: 600; }
@media (max-width: 600px) { .tabs { width: 100%; } .tabs button { flex: 1; padding: 0 8px; justify-content: center; } .tabs .cnt { display: none; } }
.tabs .cnt { font-size: 12px; color: var(--muted); font-weight: 500; }
.select.sm { height: 44px; width: auto; font-size: 14px; padding-right: 30px; background-position: calc(100% - 16px) 19px, calc(100% - 11px) 19px; }
.sg-filters .search { min-width: 220px; }
.lvl, .fmt { display: inline; font-size: inherit; font-weight: inherit; color: inherit; background: none; border: 0; padding: 0; }
.lib-card .when { display: none; }
.btn.added { color: var(--text-2); border-color: transparent; background: transparent; }
.btn.added svg { color: var(--gold); }
.grid.lib-drills { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
@media (max-width: 600px) { .grid.lib-drills { grid-template-columns: 1fr; gap: 12px; } }
.lib-drill { display: grid; grid-template-columns: 112px 1fr; grid-template-rows: 1fr auto; overflow: hidden; transition: background .15s; }
.lib-drill:hover { background: var(--surface-2); }
.lib-drill .side { grid-row: 1 / 2; background: var(--field-bg); position: relative; cursor: pointer; min-height: 84px; }
.lib-drill .side svg { width: 100%; height: 100%; }
.lib-drill .side.noplay { display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.lib-drill .content { padding: 12px 16px 2px; min-width: 0; align-self: center; }
.lib-drill .name { font-family: var(--font); font-weight: 600; font-size: 16px; line-height: 1.3; margin: 0 0 2px; cursor: pointer; }
.lib-drill .desc { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.lib-drill .foot { grid-column: 1 / 3; display: flex; gap: 4px; padding: 4px 8px 6px 16px; justify-content: flex-end; }
.lib-card .foot .btn.icon { flex: 0 0 44px; }
.lib-card .foot .btn:not(.icon) { flex: 1; }
.sg-form { margin-bottom: 18px; }
.step { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; margin-bottom: 12px; }
.step span { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 12.5px; color: var(--text-2); }
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.goal-btn { text-align: left; min-height: 44px; padding: 12px 14px; border-radius: 12px; border: 1px solid transparent; background: var(--bg-2); cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: border-color .15s, background .15s; }
.goal-btn b { font-size: 14.5px; font-weight: 600; color: var(--strong); }
.goal-btn small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.goal-btn:hover { background: var(--surface-2); }
.goal-btn.active { border-color: var(--text-2); background: var(--surface-2); }
.goal-btn[data-off] { opacity: .5; }
.sg-row { display: grid; grid-template-columns: 1.5fr 1.2fr 1.6fr; gap: 16px; align-items: end; }
.sg-row.two { grid-template-columns: 1fr 1fr; max-width: 520px; }
.min-picker { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.min-picker .input { width: 84px; height: 44px; text-align: center; }
.min-picker .chip { min-height: 44px; min-width: 48px; justify-content: center; }
.btn.big { height: 50px; padding: 0 24px; font-size: 15px; margin-top: 4px; }
@media (max-width: 1000px) { .sg-row { grid-template-columns: 1fr 1fr; } .sg-row > :last-child { grid-column: 1 / -1; } }
@media (max-width: 600px) { .sg-row, .sg-row.two { grid-template-columns: 1fr; } .goal-grid { grid-template-columns: 1fr 1fr; } .goal-btn { padding: 10px 12px; } .goal-btn small { display: none; } .btn.big { width: 100%; } }
.plan { padding: 22px; }
.plan-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.plan-title { font-weight: 700; font-size: 22px; line-height: 1.2; margin: 2px 0 4px; }
.plan-kpis { display: flex; gap: 20px; }
.plan-kpis div { text-align: left; }
.plan-kpis b { display: block; font-size: 20px; font-weight: 700; line-height: 1.2; }
.plan-kpis span { font-size: 12.5px; color: var(--muted); }
.plan-rows { display: flex; flex-direction: column; }
.plan-row { display: grid; grid-template-columns: 52px 3px 1fr auto; gap: 12px; align-items: center; min-height: 44px; padding: 6px 2px; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.plan-row:last-child { border-bottom: 0; }
.plan-row .t { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.plan-row .bar { height: 18px; border-radius: 2px; }
.plan-row .n a { color: var(--strong); font-weight: 500; text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 3px; }
.plan-row .m { font-weight: 600; font-size: 14px; color: var(--text-2); }
.plan-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.check { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
.modal.lg { width: min(900px, 100%); max-height: 92vh; overflow: auto; position: relative; }
.modal-x { position: absolute; top: 12px; right: 12px; }
.modal.lg h3 { font-size: 24px; font-weight: 700; padding-right: 50px; }
.modal.lg h4 { margin: 16px 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.modal.lg p { margin: 0; font-size: 14.5px; color: var(--text-2); }
.detail-board { border-radius: 12px; overflow: hidden; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 700px) { .detail-grid { grid-template-columns: 1fr; gap: 0; } .modal.lg { padding: 18px; } .modal.lg h3 { font-size: 21px; } }
.cp-list { margin: 0; padding-left: 18px; font-size: 14.5px; color: var(--text-2); }
.cp-list li { margin-bottom: 4px; }
.cp-list li::marker { color: var(--muted); }
.detail-meta { color: var(--muted); font-size: 13.5px; margin-bottom: 6px; }

/* ================================================================ Acceso (login) y nube */
body.auth-mode .shell { display: none; }
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 18px; padding: 28px 18px calc(28px + env(safe-area-inset-bottom)); background: var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border-radius: 18px; padding: 28px 24px 22px; position: relative; }
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; }
.auth-brand .wordmark { font-size: 34px; }
.auth-team { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 20px; }
.auth-title { font-weight: 700; font-size: 21px; margin: 0 0 12px; }
.auth-sub { color: var(--muted); margin: -4px 0 14px; font-size: 14px; }
.auth-card .field { margin-bottom: 12px; }
.auth-card .hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.btn.wide { width: 100%; justify-content: center; }
.auth-msg { border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 4px 0 12px; line-height: 1.4; }
.auth-msg.err { background: var(--red-soft); color: var(--danger-ink); }
.auth-msg.ok { background: var(--gold-soft); color: var(--warn-ink); }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.link { background: none; border: 0; color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; padding: 10px 0; text-decoration: underline; text-decoration-color: rgba(255,255,255,.25); text-underline-offset: 3px; }
.link:hover { color: var(--strong); }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 16px 0 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border-2); }
.auth-foot { color: var(--muted); font-size: 12.5px; text-align: center; max-width: 360px; margin: 0; }
.code-input { font-weight: 700; font-size: 20px; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--bg-2); border-radius: 12px; margin: 8px 0; cursor: pointer; }
.check-row input { accent-color: var(--red); width: 18px; height: 18px; margin-top: 2px; }

.sync-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sync-pill.big { font-size: 13px; color: var(--strong); background: var(--bg-2); border-radius: 999px; padding: 6px 12px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #777; flex: none; }
body[data-sync="ok"] .sync-dot { background: #2ECC71; }
body[data-sync="syncing"] .sync-dot, body[data-sync="idle"] .sync-dot { background: var(--gold); animation: syncPulse 1s infinite alternate; }
body[data-sync="pending"] .sync-dot { background: var(--gold); }
body[data-sync="offline"] .sync-dot { background: #8a8a8a; }
body[data-sync="error"] .sync-dot { background: var(--red); }
@keyframes syncPulse { to { opacity: .35; } }
#topDataBtn { position: relative; }
body[data-sync="offline"] #topDataBtn::after, body[data-sync="error"] #topDataBtn::after, body[data-sync="pending"] #topDataBtn::after { content: ""; position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); border: 2px solid var(--bg); }
body[data-sync="error"] #topDataBtn::after { background: var(--red); }
.team-card-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.sync-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 16px; }
.team-grid h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.member-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.member-list li { display: flex; gap: 10px; align-items: center; font-size: 13.5px; }
.join-code { display: inline-flex; align-items: center; gap: 8px; background: var(--bg-2); border-radius: 12px; padding: 6px 6px 6px 14px; }
.join-code span { font-weight: 700; font-size: 20px; letter-spacing: .08em; color: var(--gold); font-variant-numeric: tabular-nums; }

/* ================================================================ Reglas por formato (Pizarra) */
.seg-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.seg-3 button { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; padding: 6px 4px; font-size: 13px; }
.seg-3 button small { font-size: 11px; font-weight: 500; color: var(--muted); }
.seg-3 button.active small { color: var(--text-2); }
.rules-box { margin: -4px 0 14px; font-size: 13.5px; }
.rules-det { background: var(--bg-2); border-radius: 10px; padding: 10px 12px; }
.rules-det summary { cursor: pointer; color: var(--strong); }
.rules-det summary b { color: var(--strong); }
.rules-det ul { margin: 6px 0 2px; padding-left: 18px; color: var(--text-2); }
.rules-det li { margin: 3px 0; }
.rule-issues { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.rule-issues li { border-radius: 8px; padding: 8px 10px; font-size: 13px; line-height: 1.4; }
.rule-issues li.error { background: var(--red-soft); color: var(--danger-ink); }
.rule-issues li.aviso { background: var(--gold-soft); color: var(--warn-ink); }
.rule-ok { margin: 8px 0; color: #86E0AC; font-size: 13px; font-weight: 500; }

/* ---------- Pizarra (pantalla completa, mobile-first) ---------- */
body.pz-full { overflow: hidden; overscroll-behavior: none; }
body.pz-full .sidebar, body.pz-full .topbar, body.pz-full .tabbar, body.pz-full .more-sheet { display: none !important; }
body.pz-full .view { margin: 0; padding: 0; min-height: 0; max-width: none; }
body.pz-full .toast { top: calc(var(--safe-t) + 108px); bottom: auto; transform: translate(-50%, -12px); }
body.pz-full .toast.show { transform: translate(-50%, 0); }

.pz {
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --top-h: 60px; --meta-h: 40px; --bar-h: 70px; --ctx-h: 112px; --sheet-w: 380px;
  position: fixed; inset: 0; z-index: 40; height: 100vh; height: 100dvh; overflow: hidden;
  background: #0A1A10; color: var(--strong); touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.pz [hidden] { display: none !important; }
.pz input, .pz textarea, .pz select { -webkit-user-select: text; user-select: text; }

/* Campo */
.pz-stage {
  position: absolute; left: var(--sl); right: var(--sr);
  top: calc(var(--safe-t) + var(--top-h) + var(--meta-h));
  bottom: calc(var(--safe-b) + var(--bar-h) + var(--ctx-h));
  display: grid; place-items: center; container-type: size; touch-action: none;
  transition: right .28s cubic-bezier(.2,.8,.2,1);
}
.pz-turf { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .7; }
.pz .board { position: relative; width: 100%; width: min(100cqw, 100cqh * 1.5625); aspect-ratio: 1000 / 640; border-radius: 4px; overflow: hidden; background: #0E4122; }
.pz .board svg { width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: crosshair; }
.pz .board.tool-move svg { cursor: grab; }
.pz .board.tool-erase svg { cursor: not-allowed; }
.pz .board.tool-O svg, .pz .board.tool-S svg, .pz .board.tool-X svg { cursor: cell; }

/* Barra superior */
.pz-top {
  position: absolute; z-index: 8; top: 0; left: 0; right: 0; height: calc(var(--safe-t) + var(--top-h));
  padding: calc(var(--safe-t) + 7px) calc(var(--sr) + 10px) 7px calc(var(--sl) + 6px);
  display: flex; align-items: center; gap: 2px; background: rgba(11,11,12,.92);
}
.pz-spacer { flex: 1; }
.pz-btn {
  height: 46px; min-width: 46px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 12px; border: 0; background: transparent; color: var(--strong); font-weight: 500; font-size: 14px; cursor: pointer; flex: none; transition: background .15s, opacity .15s;
}
.pz-btn svg { width: 22px; height: 22px; }
.pz-btn:hover { background: rgba(255,255,255,.08); }
.pz-btn:disabled { opacity: .3; cursor: default; }
.pz-btn.sm { height: 44px; min-width: 44px; }
.pz-exit { padding: 0 12px 0 6px; color: var(--text-2); }
#tMore[aria-expanded="true"] { background: rgba(255,255,255,.12); }
.pz-save {
  position: relative; height: 44px; margin-left: 6px; padding: 0 18px; flex: none; display: inline-flex; align-items: center; gap: 8px;
  border-radius: 12px; border: 0; background: var(--red); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer;
}
.pz-save:hover { background: var(--red-2); }
.pz-save svg { width: 20px; height: 20px; }
.pz.dirty .pz-save::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); border: 2px solid var(--bg); }

/* Nombre + chip de reglas */
.pz-meta {
  position: absolute; z-index: 4; top: calc(var(--safe-t) + var(--top-h) + 6px);
  left: calc(var(--sl) + 14px); right: calc(var(--sr) + 12px); height: 30px;
  display: flex; align-items: center; gap: 10px; pointer-events: none; transition: right .28s cubic-bezier(.2,.8,.2,1);
}
.pz-meta > * { pointer-events: auto; }
.pz-name { min-width: 0; display: flex; align-items: baseline; gap: 8px; padding: 0; border: 0; background: none; color: var(--strong); cursor: pointer; text-align: left; }
.pz-name #dTitle { font-family: var(--font); font-weight: 600; font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.pz-name .eyebrow-sm { display: none; }
.eyebrow-sm { flex: none; font-size: 12px; font-weight: 500; color: var(--muted); }
.pz-chip {
  position: relative; margin-left: auto; flex: none; height: 30px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; border: 0; background: rgba(11,11,12,.72); font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; color: var(--text-2);
}
.pz-chip::before { content: ""; position: absolute; inset: -8px -4px; } /* área táctil más grande */
.pz-chip svg { width: 14px; height: 14px; stroke-width: 2.4; }
.pz-chip b { color: var(--strong); font-weight: 600; }
.pz-chip .sep { width: 1px; height: 12px; background: currentColor; opacity: .3; }
.pz-chip.ok svg { color: #7EE2A8; }
.pz-chip.aviso { color: var(--warn-ink); }
.pz-chip.error { color: #FF8A96; background: rgba(40,6,10,.85); }

/* Barra flotante inferior + fila contextual */
.pz-bottom {
  position: absolute; z-index: 5; left: calc(var(--sl) + 6px); right: calc(var(--sr) + 6px); bottom: calc(var(--safe-b) + 8px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; transition: right .28s cubic-bezier(.2,.8,.2,1);
}
.pz-ctx { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.pz-ctx > *, .pz-bar { pointer-events: auto; }
.pz-card { max-width: 100%; background: rgba(21,21,23,.96); border-radius: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.pz-row { display: flex; align-items: center; gap: 4px; padding: 4px; }
.pz-opt { height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 10px; background: transparent;
  color: var(--muted); font-weight: 500; font-size: 13.5px; cursor: pointer; }
.pz-opt svg { width: 20px; height: 20px; }
.pz-opt:hover { color: var(--strong); }
.pz-opt.active { background: var(--surface-3); color: var(--strong); }
.pz-tag { flex: none; padding: 0 4px 0 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
#selPanel { width: min(560px, 100%); }
#selPanel .seg { flex: 1; }
#selPanel .seg button { height: 38px; }
.pz-label-in { flex: none; width: 58px; height: 44px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--bg-2); color: var(--strong);
  text-align: center; font-weight: 700; font-size: 15px; text-transform: uppercase; outline: none; }
.pz-label-in:focus { border-color: var(--text-2); }
.pz-chips { flex: 1; min-width: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; }
.pz-chips::-webkit-scrollbar { display: none; }
.pz-chips .chip { flex: none; min-height: 44px; min-width: 44px; padding: 0 10px; justify-content: center; font-weight: 600; }
.pz-del { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; cursor: pointer; border: 0; background: transparent; color: var(--danger); }
.pz-del:hover { background: var(--red-soft); }
.pz-del svg { width: 20px; height: 20px; }
.pz-colors { width: min(430px, 100%); padding: 12px 14px; display: grid; gap: 10px; }
.pz-colors-row { display: grid; gap: 6px; }
.pz-colors .swatch, .pz-colors .swatch-custom { width: 36px; height: 36px; }
.pz-hint { max-width: 100%; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.66); color: #fff; font-size: 12.5px; font-weight: 500;
  text-align: center; opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s; pointer-events: none !important; }
.pz-hint.show { opacity: 1; transform: none; }
.pz.drawing .pz-hint { opacity: 0; }

.pz-bar { max-width: 100%; display: flex; gap: 0; padding: 4px; border-radius: 18px; background: rgba(15,15,17,.96); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.pz-tool {
  flex: 1 1 0; min-width: 40px; width: 62px; height: 56px; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; border-radius: 13px; background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s;
}
.pz-tool svg { width: 22px; height: 22px; flex: none; color: var(--text-2); }
.pz-tool:hover { color: var(--strong); }
.pz-tool.active { background: var(--red); color: #fff; }
.pz-tool.active svg { color: #fff; }
.pz-tool.off, .pz-tool:disabled { opacity: .3; cursor: not-allowed; }
#tColor { position: relative; }
#tColor.active { background: rgba(255,255,255,.1); color: var(--strong); }
.pz-dot { display: block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85);
  background: conic-gradient(var(--c, #F2B632) 0 50%, var(--p, #fff) 50% 100%); }

/* Hoja de opciones */
.pz-scrim { position: absolute; inset: 0; z-index: 6; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
.pz.sheet-open .pz-scrim { opacity: 1; pointer-events: auto; }
.pz-sheet {
  position: absolute; z-index: 7; left: 0; right: 0; bottom: 0; height: 78vh; height: 78dvh;
  max-height: calc(100dvh - var(--safe-t) - var(--top-h) - 12px);
  display: flex; flex-direction: column; background: var(--surface); border-radius: 20px 20px 0 0;
  transform: translateY(105%); visibility: hidden; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s .28s;
}
.pz.sheet-open .pz-sheet { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s; }
.pz-sheet-head { position: relative; display: flex; align-items: center; gap: 10px; padding: 16px 10px 8px 20px; }
.pz-grab { position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--border-2); }
.pz-sheet-head h3 { flex: 1; margin: 0; font-weight: 600; font-size: 17px; }
.pz-sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y;
  padding: 8px 20px calc(28px + var(--safe-b)); }
.pz-sec { scroll-margin-top: 8px; }
.pz-sec + .pz-sec { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.pz-sec h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pz-sec .rules-box { margin: 0; }
.pz-sec #ruleCheck > :first-child { margin-top: 0; }
.pz-save-row .btn { width: 100%; height: 48px; font-size: 15px; }
.pz-saved { margin-top: 8px; text-align: center; font-size: 12.5px; }
.pz-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pz-actions .btn { height: 46px; }

/* Tablet / escritorio */
@media (min-width: 700px) and (min-height: 600px) {
  .pz { --top-h: 66px; --bar-h: 76px; }
  .pz-top { padding-left: calc(var(--sl) + 12px); padding-right: calc(var(--sr) + 16px); }
  .pz-tool { width: 72px; height: 62px; font-size: 11.5px; }
  .pz-meta { left: calc(var(--sl) + 20px); right: calc(var(--sr) + 18px); }
  .pz .board { border-radius: 6px; }
}
@media (min-width: 1000px) {
  .pz-sheet { left: auto; right: 0; top: calc(var(--safe-t) + var(--top-h)); width: calc(var(--sheet-w) + var(--sr)); height: auto; max-height: none;
    padding-right: var(--sr); border-left: 1px solid var(--border); border-radius: 0; transform: translateX(105%); }
  .pz-grab { display: none; }
  .pz.sheet-open .pz-scrim { opacity: 0; pointer-events: none; }
  .pz.sheet-open .pz-stage { right: calc(var(--sr) + var(--sheet-w) + 12px); left: calc(var(--sl) + 12px); }
  .pz.sheet-open .pz-bottom, .pz.sheet-open .pz-meta { right: calc(var(--sr) + var(--sheet-w) + 16px); }
}

/* Teléfono en horizontal: rieles laterales, el campo usa toda la altura */
@media (orientation: landscape) and (max-height: 540px) {
  .pz { --rail: 60px; }
  .pz-top { bottom: 0; right: auto; height: auto; width: calc(var(--sl) + var(--rail) + 12px); flex-direction: column; gap: 6px;
    padding: calc(var(--safe-t) + 6px) 6px calc(var(--safe-b) + 6px) calc(var(--sl) + 6px); }
  .pz-btn, .pz-btn.sm { width: 100%; height: 44px; min-width: 0; padding: 0; }
  .pz-exit .lbl { display: none; }
  .pz-save { width: 100%; height: 58px; margin: 0; padding: 0; flex-direction: column; justify-content: center; gap: 2px; font-size: 10.5px; }
  .pz-stage { top: var(--safe-t); bottom: var(--safe-b); left: calc(var(--sl) + var(--rail) + 16px); right: calc(var(--sr) + var(--rail) + 16px); }
  .pz-meta { top: calc(var(--safe-t) + 6px); left: calc(var(--sl) + var(--rail) + 24px); right: auto; }
  .pz-name #dTitle { font-size: 15px; max-width: 30vw; }
  .pz-chip { margin-left: 0; }
  .pz-bottom { left: auto; top: calc(var(--safe-t) + 6px); bottom: calc(var(--safe-b) + 6px); right: calc(var(--sr) + 6px); flex-direction: row; align-items: stretch; }
  .pz-bar { flex-direction: column; padding: 3px; }
  .pz-tool { width: var(--rail); height: auto; min-height: 36px; font-size: 9.5px; gap: 1px; border-radius: 11px; }
  .pz-tool svg { width: 20px; height: 20px; }
  .pz-ctx { position: absolute; right: calc(100% + 8px); bottom: 0; width: min(470px, 58vw); align-items: flex-end; justify-content: flex-end; }
  .pz-sheet { left: auto; top: 0; right: 0; height: 100%; max-height: none; width: min(420px, 72vw); border-radius: 18px 0 0 18px;
    transform: translateX(105%); padding-right: var(--sr); }
  .pz-grab { display: none; }
  body.pz-full .toast { top: calc(var(--safe-t) + 12px); }
}

/* Netlify inyecta en producción un iframe fijo ("Powered by Netlify" / toolbar) abajo a la derecha.
   Se apaga en Netlify → Project configuration → General → Powered by Netlify badge; esto es respaldo. */
#nl-badge-frame, #nl-hud-frame { display: none !important; visibility: hidden !important; pointer-events: none !important; }

/* ---------- Simulador ---------- */
.pz-actions #btnSim { grid-column: 1 / -1; }
.sim-page { max-width: 760px; }
.sim-page [hidden], .sim [hidden] { display: none !important; }
.sim-lead { margin: 6px 0 0; max-width: 60ch; font-size: 14px; }
.sim-setup { display: grid; gap: 16px; }
.sim-setup .field { margin: 0; }
.sim-mode button { min-height: 44px; font-size: 14px; }
.sim-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sim-go { height: 50px; font-size: 15px; justify-content: center; }
.sim-go svg { width: 18px; height: 18px; }
.sim-disc { margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.sim-small { font-size: 13px; margin: 6px 0 0; }
.sim-how { margin-top: 14px; font-size: 14px; color: var(--text-2); }
.sim-how summary { cursor: pointer; font-weight: 600; color: var(--strong); min-height: 24px; }
.sim-how ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; }
@media (max-width: 600px) { .sim-row2 { grid-template-columns: 1fr; } }

/* tabla defensa vs jugadas */
.sim-dvp { margin-top: 16px; }
.sim-h2 { font-weight: 700; font-size: 21px; margin: 4px 0 0; line-height: 1.2; }
.sim-bw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.sim-bw { display: grid; gap: 3px; padding: 12px; border-radius: 12px; background: var(--bg-2); font-size: 13px; color: var(--text-2); border-left: 3px solid transparent; }
.sim-bw b { color: var(--strong); font-size: 15px; }
.sim-bw.bad { border-left-color: var(--red); }
.sim-bw.ok { border-left-color: var(--gold); }
.sim-table-wrap { overflow-x: auto; margin: 0 -4px 10px; }
.sim-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sim-table th { text-align: right; font-size: 12px; font-weight: 500; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.sim-table td { text-align: right; padding: 7px 4px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sim-table th:first-child, .sim-table td.nm { text-align: left; white-space: normal; }
.sim-table td.nm { font-weight: 600; color: var(--strong); min-width: 110px; }
.sim-table td.hot { color: var(--danger); font-weight: 700; }
.sim-table td.cold { color: var(--gold); font-weight: 700; }
.sim-table tr[data-k] { cursor: pointer; }
.sim-table tr[data-k]:hover td { background: var(--surface-2); }
.sim-table .btn.sm { height: 36px; padding: 0 8px; font-size: 12.5px; }
.sim-table .btn svg { width: 15px; height: 15px; }

.sim-progress { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(0,0,0,.6); }
.sim-progress-card { width: min(320px, 86vw); padding: 18px; border-radius: 14px; background: var(--surface); display: grid; gap: 12px; font-weight: 600; font-size: 14px; }
.sim-progress-card i { display: block; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.sim-progress-card b { display: block; height: 100%; background: var(--text-2); transition: width .1s; }

/* visor en pantalla completa */
.sim {
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  position: fixed; inset: 0; z-index: 60; height: 100vh; height: 100dvh; overflow: hidden; background: #050806; color: #fff;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.sim-stage { position: absolute; inset: 0; touch-action: none; }
.sim-stage svg { width: 100%; height: 100%; display: block; }
.sim-num { font: 600 24px Inter, Arial, sans-serif; fill: #fff; fill-opacity: .35; text-anchor: middle; }
.sim-lbl { font: 600 14px Inter, Arial, sans-serif; letter-spacing: .5px; }
.sim-ez { font: 800 italic 44px "Barlow Condensed", "Arial Narrow", Arial, sans-serif; fill: #fff; fill-opacity: .3; text-anchor: middle; letter-spacing: 4px; }
.sim-top {
  position: absolute; z-index: 5; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 6px;
  padding: calc(var(--safe-t) + 7px) calc(var(--sr) + 10px) 8px calc(var(--sl) + 6px); background: rgba(11,11,12,.92);
}
.sim-title { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.sim-title b { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-title small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-title .eyebrow-sm { font-size: 11.5px; }
.sim-read {
  position: absolute; z-index: 4; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 80px);
  max-width: calc(100% - 24px); padding: 8px 14px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(11,11,12,.8); font-weight: 500; font-size: 14px; color: #fff;
}
.sim-ctrl {
  position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px;
  padding: 10px calc(var(--sr) + 10px) calc(var(--safe-b) + 26px) calc(var(--sl) + 10px); background: rgba(11,11,12,.92);
}
.sim-play { background: var(--red) !important; min-width: 52px; }
.sim-ctrl input[type=range] { flex: 1; min-width: 60px; accent-color: #fff; height: 30px; }
.sim-time { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 500; color: var(--text-2); min-width: 44px; text-align: right; }
.sim-speed { min-width: 52px; font-variant-numeric: tabular-nums; }
.sim-disc-fl { position: absolute; z-index: 6; left: 0; right: 0; bottom: calc(var(--safe-b) + 6px); text-align: center; font-size: 11px; padding: 0 10px; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-result {
  position: absolute; z-index: 7; left: calc(var(--sl) + 10px); right: calc(var(--sr) + 10px); bottom: calc(var(--safe-b) + 86px);
  max-height: calc(100% - var(--safe-t) - 190px); overflow: auto; border-radius: 16px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow);
  transform: translateY(16px); opacity: 0; transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .2s;
  -webkit-user-select: text; user-select: text;
}
.sim-result.show { transform: none; opacity: 1; }
.sim-result.min .sim-res-body { display: none; }
.sim-res-head { position: sticky; top: 0; display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 16px; background: var(--surface-2); color: var(--text); }
.sim-res-title { font-weight: 700; font-size: 18px; line-height: 1.1; color: var(--strong); }
.sim-res-head.ok .sim-res-title { color: var(--ok-ink, #15803d); } .sim-res-head.bad .sim-res-title { color: var(--danger-ink, #b91c1c); } .sim-res-head.meh .sim-res-title { color: var(--warn-ink, #a16207); }
.sim-res-yds { font-weight: 500; font-size: 15px; color: var(--text-2); flex: 1; }
.sim-res-x { height: 44px !important; min-width: 44px !important; color: var(--text-2); }
.sim-result.min .sim-res-x svg { transform: rotate(180deg); }
.sim-res-body { padding: 12px 16px 14px; display: grid; gap: 10px; font-size: 14px; line-height: 1.45; color: var(--text); }
.sim-res-body p { margin: 0; color: var(--text); }
.sim-res-meta { font-size: 12.5px; color: var(--muted); }
.sim-why { color: var(--text); }
.sim-why b { color: var(--strong); }
.sim-tip { display: flex; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.sim-tip span { color: var(--text); }
.sim-tip b { color: var(--strong); }
.sim-tip svg { width: 20px; height: 20px; flex: none; color: var(--gold); margin-top: 1px; }
.sim-notes { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-2); }
.sim-mode-split { margin: 6px 0 0; font-size: 14px; color: var(--text); font-weight: 500; }
.sim-mode-split b { color: var(--strong); font-variant-numeric: tabular-nums; }
.sim-stats .grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 6px; }
.sim-stats .grid div { display: grid; text-align: center; padding: 8px 2px; border-radius: 10px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.sim-stats b { font-size: 16px; font-variant-numeric: tabular-nums; color: var(--strong); }
.sim-stats span:not(.eyebrow-sm) { font-size: 11px; color: var(--muted); }
.sim-stats .eyebrow-sm { color: var(--muted); }
.sim-res-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sim-res-actions .btn { justify-content: center; height: 44px; }
@media (min-width: 760px) {
  .sim-result { left: auto; width: 420px; bottom: calc(var(--safe-b) + 90px); }
}
@media (orientation: landscape) and (max-height: 540px) { /* horizontal en teléfono */
  .sim .pz-btn, .sim .pz-btn.sm { width: auto; min-width: 44px; height: 44px; padding: 0 10px; }
  .sim-top { padding-top: calc(var(--safe-t) + 5px); padding-bottom: 5px; }
  .sim-title b { font-size: 15px; }
  .sim-read { top: calc(var(--safe-t) + 66px); font-size: 13px; padding: 6px 12px; }
  .sim-result { top: calc(var(--safe-t) + 66px); bottom: calc(var(--safe-b) + 76px); max-height: none; left: auto; width: min(420px, 60%); }
  .sim-ctrl { padding-bottom: calc(var(--safe-b) + 18px); padding-top: 6px; }
}

/* ---------- Ajustes móviles: tarjetas compactas (miniatura + texto) ---------- */
.list { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 600px) {
  .grid.plays .play-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); align-items: center; min-height: 84px; }
  .grid.plays .play-card .thumb { height: 100%; aspect-ratio: auto; min-height: 84px; border-radius: var(--radius) 0 0 var(--radius); }
  .grid.plays .play-card .thumb svg { object-fit: cover; }
  .grid.plays .play-card .card-row { min-width: 0; padding-right: 4px; }
  .grid.plays .play-card .body { padding: 10px 6px 10px 14px; }
  .grid.plays .play-card .card-row .btn.sm { flex: none; padding: 0 10px; }
  .goal-btn { min-height: 48px; justify-content: center; }
  .goal-btn b { font-size: 13.5px; }
}
/* Biblioteca de jugadas: “Agregar” como botón de ícono (el texto queda para lectores de pantalla) */
.lib-card .card-row .btn.sm { flex: none; width: 44px; height: 44px; padding: 0; }
.lib-card .card-row .btn.sm .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- Asistente IA ---------------- */
.ai-page { max-width: 820px; display: flex; flex-direction: column; gap: 0; }
/* Solo la lista de mensajes se desplaza; la barra de escribir + aviso quedan debajo (nunca encima del último mensaje). */
.ai-scroll { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; padding-bottom: 16px; scroll-padding-bottom: 16px; }
body.ai-full .view { padding-bottom: 0; min-height: 0; }
body.ai-full .ai-page { height: calc(100vh - 92px); height: calc(100dvh - 92px); }
body.ai-full .ai-head { flex: none; margin-bottom: 12px; }
.ai-head { margin-bottom: 4px; }
.ai-fmt { max-width: 420px; }
.ai-notice { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; }
.ai-notice > svg { width: 22px; height: 22px; color: var(--gold); flex: none; margin-top: 2px; }
.ai-notice b { display: block; color: var(--strong); font-size: 15px; }
.ai-notice span { display: block; color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.ai-notice .link-btn { margin-top: 2px; }
.ai-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.ai-chips::-webkit-scrollbar { display: none; }
.ai-chip { flex: none; min-height: 40px; border: 1px solid var(--border-2); color: var(--text-2); }
.ai-chip.active { border-color: transparent; }
.ai-panel { background: var(--surface); border-radius: var(--radius); padding: 14px 16px 2px; }
.ai-panel[hidden] { display: none; }
.ai-panel-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 480px) { .ai-panel-row { grid-template-columns: 1fr; } }
.ai-log { display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.ai-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 16px; color: var(--muted); font-size: 14px; }
.ai-empty svg { width: 30px; height: 30px; color: var(--gold); }
.ai-empty b { color: var(--strong); font-size: 17px; font-weight: 600; }
.ai-msg { display: flex; }
.ai-msg.me { justify-content: flex-end; }
.ai-bubble { max-width: min(640px, 92%); border-radius: 16px; padding: 10px 14px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.ai-msg.me .ai-bubble { background: var(--surface-3); color: var(--strong); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.ai-msg.bot .ai-bubble { background: var(--surface); color: var(--text); border-bottom-left-radius: 6px; max-width: 100%; }
.ai-msg.bot .ai-bubble p { margin: 0 0 8px; }
.ai-msg.bot .ai-bubble h4 { margin: 12px 0 6px; font-size: 15px; color: var(--strong); }
.ai-msg.bot .ai-bubble ul, .ai-msg.bot .ai-bubble ol { margin: 0 0 8px; padding-left: 20px; }
.ai-msg.bot .ai-bubble li { margin: 2px 0; }
.ai-msg.err .ai-bubble { display: flex; gap: 8px; background: var(--red-soft); color: #FFD5D9; font-size: 13.5px; }
.ai-msg.err svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.ai-msg.pending .ai-bubble { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.ai-dots { display: inline-flex; gap: 4px; }
.ai-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: aiDot 1s infinite ease-in-out; }
.ai-dots i:nth-child(2) { animation-delay: .15s; } .ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-links { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.ai-links .eyebrow-sm { margin-bottom: 2px; }
.ai-link { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: 10px; background: var(--bg-2); color: var(--strong); font-size: 14px; }
.ai-link svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.ai-link span { flex: 1; min-width: 0; }
.ai-link small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ai-link:hover { background: var(--surface-2); }
.ai-prac { margin-top: 12px; background: var(--bg-2); border-radius: 12px; padding: 12px; }
.ai-prac-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.ai-prac-head b { color: var(--strong); font-size: 15px; }
.ai-prac-head span { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.ai-prac-blocks { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-prac-blocks li { display: flex; gap: 10px; align-items: center; min-height: 32px; padding-left: 10px; border-left: 3px solid var(--u); font-size: 13.5px; }
.ai-prac-blocks .min { color: var(--muted); font-variant-numeric: tabular-nums; width: 30px; flex: none; }
.ai-prac-blocks a { color: var(--strong); text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 3px; }
.ai-head { flex-wrap: nowrap; align-items: flex-start; }
.ai-head .actions { flex-wrap: nowrap; gap: 4px; }
.ai-dock { flex: none; position: relative; background: var(--bg); padding: 10px 0 12px; z-index: 5; border-top: 1px solid var(--border); }
.ai-composer { display: flex; gap: 8px; align-items: flex-end; }
.ai-composer .textarea { resize: none; min-height: 44px; max-height: 160px; line-height: 1.4; font-family: inherit; }
.ai-composer .btn.icon { flex: none; height: 44px; }
.ai-disc { margin: 6px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
@media (max-width: 900px) {
  body.ai-full .ai-page { height: calc(100dvh - 60px - 65px - var(--safe-t) - var(--safe-b)); }
  .ai-scroll { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  body.ai-full .ai-dock { padding-bottom: 8px; }
}

/* ---------- Playbook estilo Playmaker: carpetas, miniaturas, vista grande, selección, arrastrar ---------- */
.pb-fbar { display: flex; align-items: center; gap: 6px; margin: -6px 0 12px; min-width: 0; }
.pb-folders { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding: 2px 0; }
.pb-folders::-webkit-scrollbar { display: none; }
.fchip { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-2); background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.fchip svg { width: 16px; height: 16px; color: var(--muted); }
.fchip .n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.fchip:hover { color: var(--strong); border-color: var(--text-2); }
.fchip.active { background: var(--strong); border-color: var(--strong); color: var(--bg); font-weight: 600; }
.fchip.active svg, .fchip.active .n { color: #0B0B0C; opacity: .7; }
.fchip.add { border-style: dashed; color: var(--muted); }
.fchip.drag-ghost { box-shadow: var(--shadow); background: var(--surface-3); color: var(--strong); border-color: var(--gold); }
.fchip.drag-src { opacity: .35; }
.pb-toolbar { margin-bottom: 10px; }
.pb-toolbar .chips { order: 5; }
.pb-hint { font-size: 12.5px; margin: 0 0 12px; min-height: 1px; }
.grid.plays.pb-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pb-grid .play-card { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pb-grid .play-card .thumb { background: var(--field-bg); }
.pb-grid .play-card .thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .18s; }
.pb-grid .play-card .thumb.ready img { opacity: 1; }
.pb-grid .play-card .meta .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--u-general); }
.pb-grid .play-card .meta .dot.u-ofensiva { background: var(--u-ofensiva); } .pb-grid .play-card .meta .dot.u-defensiva { background: var(--u-defensiva); } .pb-grid .play-card .meta .dot.u-especiales { background: var(--u-especiales); }
.pb-grid .pb-empty-folder { grid-column: 1 / -1; padding: 14px 16px; border: 1px dashed var(--border-2); border-radius: var(--radius); color: var(--muted); font-size: 13px; }
.play-card.drag-src { opacity: .3; }
.play-card.drag-ghost { box-shadow: 0 18px 40px rgba(0,0,0,.6); outline: 2px solid var(--gold); transform: rotate(1.5deg) scale(1.03); opacity: .95; }
body.dragging-now, body.dragging-now * { cursor: grabbing !important; }
.sel-mark { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.45); display: none; place-items: center; }
.sel-mark svg { width: 16px; height: 16px; color: #fff; opacity: 0; }
.pb-grid.selecting .sel-mark { display: grid; }
.pb-grid.selecting .play-card { cursor: pointer; }
.pb-grid .play-card.selected { outline: 2px solid var(--red); outline-offset: -2px; }
.pb-grid .play-card.selected .sel-mark { background: var(--red); border-color: var(--red); }
.pb-grid .play-card.selected .sel-mark svg { opacity: 1; }
#pbSelect.active { background: var(--surface-3); color: var(--strong); }
.pb-selbar { position: fixed; left: calc(var(--sidebar-w) + 24px); right: 24px; bottom: 16px; z-index: 34; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px 10px 18px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 14px; box-shadow: var(--shadow); }
.pb-selbar[hidden] { display: none; }
/* Con la barra de selección abierta, el aviso (toast) sale por encima de ella en vez de taparla. */
body.pb-selecting .toast { bottom: 96px; }
@media (max-width: 900px) { body.pb-selecting .toast { bottom: calc(210px + var(--safe-b)); } }
.pb-selinfo { display: flex; align-items: center; font-size: 14px; color: var(--text-2); }
.pb-selinfo b { color: var(--strong); }
.pb-selacts { display: flex; gap: 6px; flex-wrap: wrap; }
body.pb-selecting .view { padding-bottom: 140px; }
@media (max-width: 900px) {
  .pb-selbar { left: 8px; right: 8px; bottom: calc(70px + var(--safe-b)); padding: 8px 10px; }
  .pb-selacts { width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .pb-selacts .btn svg { width: 18px; height: 18px; }
  .pb-selacts .btn { padding: 0 4px; font-size: 12px; flex-direction: column; height: 50px; gap: 2px; }
  body.pb-selecting .view { padding-bottom: 220px; }
}
@media (max-width: 600px) {
  .grid.plays.pb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.plays.pb-grid .play-card { display: flex; flex-direction: column; align-items: stretch; min-height: 0; }
  .grid.plays.pb-grid .play-card .thumb { height: auto; aspect-ratio: 1000/640; min-height: 0; border-radius: var(--radius) var(--radius) 0 0; }
  .pb-head { flex-wrap: nowrap; align-items: center; }
  .pb-head .actions { flex-wrap: nowrap; gap: 2px; }
  .pb-head .actions .btn.ghost { width: 44px; padding: 0; }
  .pb-head .actions .btn.primary { padding: 0 14px; }
  .pb-grid .play-card .body { padding: 8px 4px 10px 10px; }
  .pb-grid .play-card .name { font-size: 13.5px; }
  .pb-grid .play-card .meta { font-size: 11.5px; }
  .pb-grid .play-card .pm-num { min-width: 18px; margin-right: 5px; font-size: 11px; line-height: 18px; }
  .pb-grid .play-card .more-btn { width: 36px; height: 40px; }
  .pb-grid .play-card .card-row { padding-right: 0; align-items: flex-start; }
  .pb-toolbar { gap: 8px; }
  .pb-toolbar .search { flex-basis: 100%; }
  .pb-toolbar .select.sm { flex: 1; }
  .pb-head .actions .btn.ghost span { display: none; }
  body.pb-selecting .pb-head .actions #pbSelect { width: auto; padding: 0 12px; }
  body.pb-selecting .pb-head .actions #pbSelect span { display: inline; }
}
/* Diálogos de carpetas */
.fpick { display: grid; gap: 4px; max-height: 44vh; overflow: auto; margin: 4px 0 12px; }
.fpick-item { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--bg-2); color: var(--text); font-size: 14.5px; cursor: pointer; text-align: left; }
.fpick-item svg { width: 18px; height: 18px; color: var(--muted); }
.fpick-item:hover { background: var(--surface-3); }
.fpick-item.cur { outline: 1px solid var(--border-2); color: var(--muted); }
.fpick-new { display: flex; gap: 8px; }
.fpick-new .input { flex: 1; }
/* Vista grande */
.pv { position: fixed; inset: 0; z-index: 110; background: #050506; display: grid; grid-template-rows: auto 1fr auto; animation: fade .15s ease-out; }
.pv-top { display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-t)) 14px 8px 8px; }
.pv-title { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.pv-title b { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-title small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-title .pm-num { display: inline-block; min-width: 24px; margin-right: 8px; padding: 0 6px; border-radius: 6px; background: var(--surface-3); color: var(--gold); font-size: 13px; font-weight: 700; line-height: 22px; text-align: center; }
.pv-count { color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.pv-stage { position: relative; overflow: hidden; display: grid; place-items: center; padding: 8px 12px; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; min-height: 0; }
.pv-slide { width: 100%; height: 100%; display: grid; place-items: center; transition: transform .2s ease-out; min-height: 0; }
.pv-slide .pv-svg { width: 100%; height: 100%; max-height: 100%; border-radius: 10px; }
.pv-slide.in-r { animation: pvInR .22s ease-out; } .pv-slide.in-l { animation: pvInL .22s ease-out; }
@keyframes pvInR { from { transform: translateX(40px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes pvInL { from { transform: translateX(-40px); opacity: .3; } to { transform: none; opacity: 1; } }
.pv-bot { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 10px 14px calc(12px + var(--safe-b)); }
.pv-bot .btn.primary { min-width: 200px; height: 48px; }
.pv-bot .btn.icon { width: 48px; height: 48px; }
/* ---------- Impresión del Playbook (fondo claro) ---------- */
.pbp-bar { max-width: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.pbp-seg { grid-auto-columns: auto; }
.pbp-seg button { display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; }
.pbp-seg button svg { width: 16px; height: 16px; }
.pbp-opts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; flex: 1; }
.pbp-opts label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.pbp-opts label[hidden] { display: none; }
.pbp-opts .select.sm { height: 36px; font-size: 13px; }
.pbp-info { font-size: 13px; margin: 0 0 12px; }
.pbp-scroll { overflow-x: hidden; }
.pbp { width: 8.5in; margin: 0 auto; }
.pbp-page { width: 8.5in; height: 10.98in; padding: .4in; background: #fff; color: #111; margin: 0 auto 20px; box-shadow: 0 6px 24px rgba(0,0,0,.45); overflow: hidden; display: flex; flex-direction: column; font-family: var(--font); }
.pbp-ph { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #111; padding-bottom: 6px; margin-bottom: 10px; font-size: 11px; color: #444; }
.pbp-ph div { display: flex; align-items: baseline; gap: 10px; }
.pbp-brand { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 20px; color: #111; letter-spacing: .03em; }
.pbp-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr); gap: .14in; }
.pbp-cell { margin: 0; min-height: 0; display: flex; flex-direction: column; border: 1px solid #cfcfd4; border-radius: 6px; padding: 5px 6px 4px; break-inside: avoid; }
.pbp-cell figcaption { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; line-height: 1.2; min-width: 0; }
.pbp-cell .num { flex: none; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 5px; background: #111; color: #fff; display: grid; place-items: center; font-size: 12.5px; }
.pbp-cell .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbp-dia { flex: 1; min-height: 0; display: grid; place-items: center; margin: 4px 0 2px; }
.pbp-dia .pbp-svg { width: 100%; height: 100%; }
.pbp-meta { font-size: 9.5px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.band-sheet { display: grid; grid-template-columns: repeat(var(--bcols), var(--bw)); grid-auto-rows: var(--bh); gap: .22in .3in; justify-content: center; align-content: start; flex: 1; }
.band-card { width: var(--bw); height: var(--bh); border: 1.5px dashed #777; padding: .05in; display: grid; grid-template-columns: repeat(var(--c), 1fr); grid-template-rows: repeat(var(--r), 1fr); gap: .03in; break-inside: avoid; }
.band-cell { position: relative; min-width: 0; min-height: 0; border: 1px solid #bbb; display: flex; flex-direction: column; overflow: hidden; }
.band-cell.blank { border-style: dotted; border-color: #ddd; background: #fff; }
.band-cell .pbp-svg { flex: 1; min-height: 0; width: 100%; }
.band-cell .bn { position: absolute; top: 0; left: 0; z-index: 1; min-width: .2in; padding: 0 3px; background: #111; color: #fff; font-weight: 800; font-size: 10px; line-height: 13px; text-align: center; border-bottom-right-radius: 3px; }
.band-cell .bnm { font-size: 6.5px; font-weight: 700; line-height: 1.15; padding: 1px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid #ddd; color: #111; }
.band-foot { font-size: 9px; color: #777; margin: 8px 0 0; text-align: center; }
@media (max-width: 900px) { .pbp-bar .btn.primary { width: 100%; } .pbp-seg { width: 100%; grid-auto-columns: 1fr; } .pbp-seg button { justify-content: center; } }
@media print {
  body.pb-print .pbp-info, body.pb-print .pb-selbar { display: none !important; }
  body.pb-print .pbp { zoom: 1 !important; width: auto; }
  body.pb-print .pbp-page { margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
  body.pb-print .pbp-page:last-child { break-after: auto; page-break-after: auto; }
  body.pb-print .view { max-width: none; }
  body.pb-print { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.field-label { display: block; font-size: 13px; color: var(--text-2); font-weight: 500; }
button.link-btn { border: 0; background: none; cursor: pointer; }
.pb-selinfo .link-btn { min-height: 36px; margin-left: 6px; color: var(--gold); }
.btn[hidden] { display: none !important; }
.pb-head > div:first-child { min-width: 0; }

/* Simulador: encuadre (ver todo el campo / acercar al balón) */
.sim-zoom { width: auto !important; gap: 6px; padding: 0 12px !important; font-size: 13px; font-weight: 600; }
.sim-zoom[aria-pressed="true"] { background: rgba(255,255,255,.16); }
@media (max-width: 420px) { .sim-zoom .lbl { display: none; } .sim-zoom { padding: 0 !important; width: 44px !important; } }

/* ---------- Burbuja flotante del Asistente IA (balón) ---------- */
.ai-fab {
  position: fixed; z-index: 33; left: auto; top: auto; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.55)); transition: transform .15s;
}
.ai-fab[hidden] { display: none; }
.ai-fab.snap { transition: left .24s cubic-bezier(.2,.8,.2,1), top .24s cubic-bezier(.2,.8,.2,1), transform .15s; }
.ai-fab:active, .ai-fab.dragging { cursor: grabbing; transform: scale(1.08); }
.ai-fab-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 200deg, #E0182D, #E8B447, #FFFFFF, #E0182D); }
.ai-fab-core { position: absolute; inset: 3px; border-radius: 50%; background: #121214; display: grid; place-items: center; overflow: hidden; }
.ai-fab-ball { width: 42px; height: 42px; }
.ai-fab:hover .ai-fab-spark, .ai-fab:focus-visible .ai-fab-spark { animation: fabSpark 1s ease-in-out infinite; transform-origin: 51px 12px; }
@keyframes fabSpark { 50% { transform: scale(1.35) rotate(20deg); } }
@media (prefers-reduced-motion: reduce) { .ai-fab, .ai-fab.snap { transition: none; } .ai-fab-spark { animation: none !important; } }

.ai-sheet { position: fixed; inset: 0; z-index: 95; }
.ai-sheet[hidden] { display: none; }
.ai-sheet-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .2s; }
.ai-sheet.open .ai-sheet-scrim { opacity: 1; }
.ai-sheet-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); display: flex; flex-direction: column;
  background: var(--bg); border-left: 1px solid var(--border); box-shadow: -12px 0 32px rgba(0,0,0,.45);
  transform: translateX(100%); transition: transform .26s cubic-bezier(.2,.8,.2,1);
}
.ai-sheet.open .ai-sheet-panel { transform: none; }
.ai-sheet-head { display: flex; align-items: center; gap: 8px; padding: calc(var(--safe-t) + 10px) 8px 10px 16px; border-bottom: 1px solid var(--border); position: relative; }
.ai-sheet-head b { flex: 1; font-size: 16px; font-weight: 600; }
.ai-sheet-ico svg { width: 28px; height: 28px; }
.ai-sheet-grip { display: none; }
.ai-sheet-body { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; padding: 0; }
.ai-page.embedded { max-width: none; flex: 1 1 auto; min-height: 0; }
.ai-page.embedded .ai-scroll { margin: 0; padding: 12px 16px 16px; }
.ai-page.embedded .ai-head { display: none; }
.ai-page.embedded .ai-dock { padding: 10px 16px calc(10px + var(--safe-b)); }
body.ai-sheet-open { overflow: hidden; }
@media (max-width: 900px) {
  /* Altura según el área visible (barra de Safari / teclado de iOS): --ai-vvh y --ai-kb los pone ai-fab.js con visualViewport */
  .ai-sheet-panel { top: auto; left: 0; width: 100%; height: min(88vh, calc(100% - 40px)); height: min(88dvh, calc(var(--ai-vvh, 100dvh) - 40px));
    bottom: var(--ai-kb, 0px); border-left: 0; border-radius: 18px 18px 0 0; transform: translateY(100%); }
  .ai-sheet.kb .ai-page.embedded .ai-dock { padding-bottom: 10px; }
  .ai-sheet-head { padding-top: 16px; }
  .ai-sheet-grip { display: block; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--border-2); }
}
.ai-scroll > * { flex-shrink: 0; }
.ai-page.embedded .ai-log, body.ai-full .ai-log { flex: 1 0 auto; }

/* ---------- Pizarra de ejercicios ---------- */
.db { --ctx-h: 118px; }
.db .db-stage { padding: 6px; }
.db-board { position: relative; width: min(100cqw, 100cqh * var(--asp, 1)); aspect-ratio: var(--asp, 1); border-radius: 6px; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.db-board svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.db-board.tool-move svg { cursor: default; }
.db-board.tool-move .db-item, .db-board.tool-move .db-path { cursor: grab; }
.db-board.tool-erase svg { cursor: not-allowed; }
.db-board.tool-place svg { cursor: cell; }
.db-rot { cursor: grab; }
.db-anim { width: min(560px, 100%); padding: 4px 6px; display: grid; gap: 2px; }
.db-steps, .db-play { display: flex; align-items: center; gap: 4px; min-width: 0; }
.db-stepchips { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; }
.db-stepchips::-webkit-scrollbar { display: none; }
.db-step { min-width: 40px; min-height: 40px; justify-content: center; font-weight: 700; flex: none; }
.db-play input[type=range] { flex: 1; min-width: 60px; accent-color: #fff; height: 30px; }
.db-playbtn { background: var(--surface-3) !important; }
.db-speed { min-width: 48px; font-variant-numeric: tabular-nums; font-size: 13px; }
.db-sel { width: min(560px, 100%); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.db-sel .pz-opt { padding: 0 11px; font-size: 18px; flex: none; }
.db-sel .seg { flex: 1; min-width: 0; }
.db-sel .seg button { height: 38px; font-size: 12.5px; padding: 0 8px; }
.db-text-in { flex: 1; min-width: 90px; height: 44px; }
.db-warn { color: #FFD66B; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.db-pal { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.db-pal-it { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; min-height: 92px; border-radius: 12px; border: 1px solid var(--border); background: #0E4122; color: #fff; font-size: 12px; font-weight: 500; cursor: pointer; text-align: center; line-height: 1.2; }
.db-pal-it svg { width: 44px; height: 44px; }
.db-pal-it small { color: var(--gold); }
.db-pal-it:hover { border-color: var(--text-2); }
.db-pal-it:disabled { opacity: .35; cursor: not-allowed; }
.db-pal-tip { font-size: 12.5px; margin: 14px 0 0; }
.db-areas { display: flex; flex-wrap: wrap; gap: 6px; }
@media (orientation: landscape) and (max-height: 540px) { .db { --ctx-h: 0px; } .db .pz-bottom { left: auto; width: min(520px, 60%); } }

/* Editor de ejercicio: diagrama y video */
.dr-diagram { border-radius: 12px; overflow: hidden; border: 1px solid var(--border-2); background: #0E4122; }
.dr-diagram svg { width: 100%; height: auto; max-height: 340px; display: block; }
.dr-diagram-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.dr-video { margin-top: 10px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-2); background: #000; }
.dr-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.dr-video-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); color: var(--strong); }
.dr-video-link svg { width: 22px; height: 22px; flex: none; color: var(--red); }
.dr-video-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.dr-video-link small { display: block; color: var(--muted); font-size: 12px; }
.dr-video-thumb { position: relative; display: block; }
.dr-video-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.dr-video-thumb .play { position: absolute; inset: 0; display: grid; place-items: center; }
.dr-video-thumb .play i { width: 64px; height: 44px; border-radius: 12px; background: rgba(224,24,45,.92); display: grid; place-items: center; }
.dr-video-thumb .play svg { width: 24px; height: 24px; color: #fff; fill: #fff; }
.drill-card .side .vbadge { position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; border-radius: 6px; background: rgba(0,0,0,.7); font-size: 11px; font-weight: 700; color: #fff; }
.drill-card .side.diag svg { background: #0E4122; }

/* Animación de jugada (Pizarra) */
.pa { position: fixed; inset: 0; z-index: 70; background: #050806; color: #fff; display: grid; grid-template-rows: auto 1fr auto; height: 100dvh; }
.pa-top { display: flex; align-items: center; gap: 8px; padding: calc(var(--safe-t) + 6px) 12px 6px 6px; background: rgba(11,11,12,.92); }
.pa-title { display: grid; line-height: 1.25; min-width: 0; }
.pa-title b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pa-title small { font-size: 12px; color: var(--muted); }
.pa-stage { min-height: 0; display: grid; place-items: center; padding: 8px; }
.pa-stage svg { width: 100%; height: 100%; max-height: 100%; }
.pa-ctrl { display: flex; align-items: center; gap: 6px; padding: 10px 12px calc(var(--safe-b) + 16px); background: rgba(11,11,12,.92); }
.pa-ctrl input[type=range] { flex: 1; accent-color: #fff; height: 30px; }

/* ---------- Asistente IA: jugada / ejercicio generados ---------- */
body.db-open .ai-sheet { display: none; }
.ai-gen { margin-top: 12px; background: var(--bg-2); border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.ai-gen-fig { background: var(--field-bg); line-height: 0; cursor: default; }
.ai-gen-fig svg { width: 100%; height: auto; display: block; }
.ai-gen-fig.drill { padding: 8px; background: #0B2414; display: flex; justify-content: center; }
.ai-gen-fig.drill svg { max-height: 300px; width: auto; max-width: 100%; border-radius: 6px; }
.ai-gen-body { padding: 12px; display: grid; gap: 10px; }
.ai-gen-head { display: grid; gap: 2px; }
.ai-gen-head b { color: var(--strong); font-size: 15.5px; }
.ai-gen-head span { color: var(--muted); font-size: 12.5px; }
.ai-gen-ok { display: flex; gap: 6px; align-items: center; color: var(--ok-ink); font-size: 13px; font-weight: 600; }
.ai-gen-ok svg { width: 16px; height: 16px; }
.ai-gen-issues { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.ai-gen-issues li { padding: 6px 8px; border-radius: 8px; }
.ai-gen-issues li.err { background: rgba(224,24,45,.14); color: #FCA5A5; }
.ai-gen-issues li.warn { background: var(--gold-soft); color: var(--gold); }
.ai-gen-fixes { font-size: 12.5px; color: var(--text-2); }
.ai-gen-fixes summary { cursor: pointer; color: var(--gold); font-weight: 600; }
.ai-gen-fixes ul, .ai-gen-notes ul { margin: 6px 0 0; padding-left: 18px; }
.ai-gen-notes { font-size: 13px; color: var(--text-2); }
.ai-gen-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ai-gen-saved { font-size: 12px; color: var(--ok-ink); }

/* ---------- Playbook por formato: 5v5 / 7v7 / Tackle → subcarpetas → jugadas ---------- */
.pb-head { align-items: center; }
.pb-titlewrap { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.pb-titles { min-width: 0; }
.pb-titles .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-back { flex: none; margin-left: -10px; color: var(--strong); }
.pb-back svg { width: 24px; height: 24px; }
.pb-crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 2px; white-space: nowrap; overflow: hidden; }
.pb-crumbs a { color: var(--text-2); }
.pb-crumbs a:hover { color: var(--strong); text-decoration: underline; text-underline-offset: 3px; }
.pb-head .actions { align-items: center; }
#pbFolderMenu .more-btn { width: 44px; height: 44px; }
.pb-filters { display: contents; }
.pb-filters[hidden] { display: none; }
.pb-formats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pb-fmt { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "ico n" "txt txt"; gap: 18px 12px; padding: 22px 22px 20px; min-height: 196px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; transition: background .15s, border-color .15s; }
.pb-fmt:hover { background: var(--surface-2); border-color: var(--border-2); }
.pb-fmt-ico { grid-area: ico; width: 48px; height: 48px; border-radius: 12px; background: var(--bg-2); display: grid; place-items: center; }
.pb-fmt-ico svg { width: 26px; height: 26px; color: var(--gold); }
.pb-fmt-txt { grid-area: txt; display: flex; flex-direction: column; gap: 2px; min-width: 0; align-self: end; }
.pb-fmt-name { font-size: 40px; line-height: 1; font-weight: 700; letter-spacing: -.02em; color: var(--strong); }
.pb-fmt-txt small { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }
.pb-fmt-subs { color: var(--muted); font-size: 12.5px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-fmt-n { grid-area: n; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.pb-fmt-n .n { font-size: 26px; line-height: 1.1; font-weight: 700; color: var(--strong); font-variant-numeric: tabular-nums; }
.pb-fmt-n small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pb-fmt-go { display: none; }
.pb-subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.pb-ftile { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; text-align: left; padding: 0; color: inherit;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: background .15s, border-color .15s; }
.pb-ftile:hover { background: var(--surface-2); border-color: var(--border-2); }
.pb-ftile .thumb { aspect-ratio: 1000/640; background: var(--field-bg); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; position: relative; }
.pb-ftile .thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .18s; filter: saturate(.85) brightness(.85); }
.pb-ftile .thumb.ready img { opacity: 1; }
.pb-ftile .thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0,0,0,.35)); pointer-events: none; }
.pb-ftile-empty { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg-2); }
.pb-ftile-empty svg { width: 34px; height: 34px; color: var(--border-2); }
.pb-ftile.none .thumb { background: var(--bg-2); }
.pb-ftile-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px 10px 12px; min-height: 60px; }
.pb-ftile-ico svg { width: 20px; height: 20px; color: var(--gold); flex: none; }
.pb-ftile.none .pb-ftile-ico svg { color: var(--muted); }
.pb-ftile-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pb-ftile-txt .fname { font-size: 15px; font-weight: 600; color: var(--strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-ftile-txt .n { color: var(--muted); font-size: 12.5px; }
.pb-ftile .more-btn { width: 40px; height: 44px; }
.pb-ftile.add { align-items: center; justify-content: center; gap: 4px; min-height: 160px; border-style: dashed; border-color: var(--border-2); background: transparent; color: var(--muted); font: inherit; }
.pb-ftile.add b { color: var(--text-2); font-weight: 600; font-size: 14.5px; }
.pb-ftile.add small { font-size: 12px; }
.pb-add-ico { width: 40px; height: 40px; border-radius: 50%; border: 1px dashed var(--border-2); display: grid; place-items: center; margin-bottom: 4px; }
.pb-add-ico svg { width: 20px; height: 20px; }
.pb-ftile.drag-ghost { box-shadow: var(--shadow); border-color: var(--gold); }
.pb-ftile.drag-src { opacity: .35; }
@media (max-width: 900px) {
  .pb-formats { grid-template-columns: 1fr; gap: 10px; }
  .pb-fmt { grid-template-columns: auto 1fr auto auto; grid-template-areas: "ico txt n go"; align-items: center; gap: 14px; min-height: 0; padding: 16px 12px 16px 16px; border-radius: 16px; }
  .pb-fmt-ico { width: 44px; height: 44px; }
  .pb-fmt-txt { align-self: center; }
  .pb-fmt-name { font-size: 28px; }
  .pb-fmt-txt small { margin-top: 2px; font-size: 12.5px; }
  .pb-fmt-subs { margin-top: 4px; font-size: 12px; }
  .pb-fmt-n .n { font-size: 22px; }
  .pb-fmt-n small { font-size: 11px; }
  .pb-fmt-go { display: block; color: var(--muted); }
  .pb-fmt-go svg { width: 18px; height: 18px; }
  .pb-subs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pb-ftile-row { padding: 8px 0 8px 10px; min-height: 54px; gap: 8px; }
  .pb-ftile-txt .fname { font-size: 14px; }
  .pb-ftile-ico { display: none; }
  .pb-ftile.add { min-height: 0; aspect-ratio: auto; padding: 18px 8px; }
  .pb-head .actions #pbFolderMenu .more-btn { width: 40px; }
  .pb-titles .title { font-size: 22px; }
}
.fpick-fmt { margin: -4px 0 10px; font-size: 13px; }

/* Impresión: elegir carpetas */
.pbp-folders { max-width: 900px; margin: 0 auto 14px; background: var(--surface); border-radius: var(--radius); padding: 0 16px; }
.pbp-folders > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; cursor: pointer; list-style: none; }
.pbp-folders > summary::-webkit-details-marker { display: none; }
.pbp-fl-t { display: inline-flex; align-items: center; gap: 8px; }
.pbp-fl-t svg { width: 18px; height: 18px; color: var(--gold); }
.pbp-folders > summary small { color: var(--muted); font-size: 12.5px; text-align: right; }
.pbp-folders[open] > summary { border-bottom: 1px solid var(--border); }
.pbp-src { margin: 12px 0 2px; max-width: 420px; grid-auto-columns: 1fr; }
.pbp-src button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pbp-src button svg { width: 16px; height: 16px; }
.pbp-fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; padding: 12px 0 16px; }
.pbp-fgrid.off { opacity: .45; }
.pbp-fmt { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pbp-fmt legend { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0 0 4px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.pbp-fmt label.check { display: flex; align-items: center; gap: 10px; min-height: 38px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.pbp-fmt label.check input { width: 18px; height: 18px; accent-color: var(--red); flex: none; margin: 0; }
.pbp-all b { color: var(--strong); font-size: 16px; }
.pbp-all span { color: var(--muted); font-size: 12.5px; }
.pbp-fk span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbp-fmt small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
@media print { .pbp-folders { display: none !important; } }

/* Pizarra: carpeta destino · Asistente: carpeta al guardar */
.pz-folder { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pz-folder svg { width: 15px; height: 15px; color: var(--gold); flex: none; }
.pz-folder b { color: var(--text-2); font-weight: 600; }
.ai-gen-folder { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-gen-folder label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.ai-gen-folder label svg { width: 16px; height: 16px; color: var(--gold); }
.ai-gen-folder .select.sm { height: 38px; font-size: 13.5px; flex: 1; min-width: 150px; max-width: 280px; }

.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; }
.pb-filt-btn { flex: none; width: 44px; padding: 0; }
.pb-filt-btn.active { background: var(--surface-2); color: var(--strong); }
.pb-titles .subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .pb-head[data-level="1"] #pbNew span, .pb-head[data-level="2"] #pbNew span { display: none; }
  .pb-head[data-level="1"] #pbNew, .pb-head[data-level="2"] #pbNew { width: 44px; padding: 0 !important; }
  .pb-toolbar .search { flex-basis: 0; }
  .pb-toolbar .pb-filters .select.sm { flex-basis: 100%; }
}

/* =====================================================================================================
   Día de juego y scouting (Hoja de llamadas, Partido, Rivales, Escanear, Quiz, Plantillas, visor ver.html).
   Mismo lenguaje visual del resto de la app (superficies oscuras, rojo = acción principal, dorado = acento)
   con clases propias (gd-*, cs-*, gm-*, rv-*, qz-*, tpl-*, vw-*) para poder re-vestirlo sin tocar la lógica.
   ===================================================================================================== */
.gd-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); font-size: 13.5px; margin: 10px 0; }
.gd-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.gd-note.warn { background: var(--gold-soft); color: #F3D58F; }
.gd-note.err { background: var(--red-soft); color: var(--danger-ink); }
.gd-note.ok { background: rgba(34, 197, 94, .1); color: var(--ok-ink); }
.gd-note.ai { background: var(--surface-2); color: var(--text); }
.gd-note.hudl ol { margin: 6px 0; padding-left: 18px; } .gd-note.hudl p { margin: 0 0 4px; } .gd-note.hudl li { margin: 3px 0; }
.gd-tabs { max-width: 420px; margin-bottom: 16px; }
.gd-tabs button, .seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.gd-tabs svg { width: 16px; height: 16px; }
.gd-cols { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 16px; align-items: start; }
.gd-form .section, .rv-sec .section { margin: 0 0 10px; }
.gd-drop { border: 1.5px dashed var(--border-2); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 16px; }
.gd-drop-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.gd-drop-btns .btn { flex: 1; min-width: 150px; cursor: pointer; }
.gd-prev img { display: block; max-width: 100%; max-height: 260px; margin-top: 10px; border-radius: 8px; }
.gd-file { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.gd-file > svg { width: 20px; height: 20px; color: var(--gold); flex: none; }
.gd-file span { flex: 1; min-width: 0; display: grid; font-size: 14px; overflow-wrap: anywhere; } .gd-file small { color: var(--muted); }
.gd-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 14px 0 8px; }
.gd-or::before, .gd-or::after { content: ''; flex: 1; height: 1px; background: var(--border-2); }
.gd-go { width: 100%; }
.gd-out-empty { padding: 56px 20px; }
.gd-busy { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 36px 20px; }
.gd-busy p { margin: 0; max-width: 360px; font-size: 13.5px; }
.gd-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--red); animation: gdspin .9s linear infinite; }
@keyframes gdspin { to { transform: rotate(360deg); } }
.gd-bar { width: min(320px, 100%); height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.gd-bar i { display: block; height: 100%; background: var(--gold); transition: width .2s; }
.gd-fail { display: grid; justify-items: start; gap: 8px; }
.gd-fail > svg { width: 24px; height: 24px; color: var(--gold); }
.gd-fail p { margin: 0; color: var(--text-2); }
.gd-result { overflow: hidden; }
.gd-dia { aspect-ratio: 1000/640; background: var(--field-bg); } .gd-dia svg { width: 100%; height: 100%; display: block; }
.gd-answer { margin: 4px 0 10px; padding-left: 18px; color: var(--text-2); font-size: 14px; } .gd-answer li { margin: 3px 0; }
.gd-scout { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 14px; margin: 8px 0 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.gd-scout div.wide { grid-column: 1 / -1; }
.gd-scout dt { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gd-scout dd { margin: 2px 0 0; font-size: 14px; color: var(--text); } .gd-scout ul { margin: 0; padding-left: 18px; }
.gd-fixes { font-size: 13px; color: var(--muted); margin: 6px 0; } .gd-fixes ul { margin: 6px 0; padding-left: 18px; }
.gd-result-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; } .gd-result-acts .btn { flex: 1; min-width: 140px; }
.gd-list .gd-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--gold); flex: none; }
.gd-list .gd-ico svg { width: 20px; height: 20px; }
.gd-modal { max-width: 900px; }
.gd-search { margin: 6px 0 12px; }
.gd-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 56vh; overflow: auto; padding: 2px; }
.gd-pick-item { position: relative; display: grid; gap: 6px; padding: 0 0 8px; border: 2px solid transparent; border-radius: 12px; background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer; overflow: hidden; font: inherit; }
.gd-pick-item .th { aspect-ratio: 1000/640; background: var(--field-bg); } .gd-pick-item .th svg { width: 100%; height: 100%; display: block; }
.gd-pick-item .nm { padding: 0 10px; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-pick-item .mk { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.55); display: none; place-items: center; }
.gd-pick-item .mk svg { width: 14px; height: 14px; }
.gd-pick-item.on { border-color: var(--gold); } .gd-pick-item.on .mk { display: grid; background: var(--gold); color: #111; }
.gd-pick-foot { margin-top: 14px; align-items: center; } .gd-pick-foot .muted { margin-right: auto; font-size: 13px; }

/* ---- Hoja de llamadas ---- */
.cs-head { align-items: center; }
.cs-titlewrap { display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1; }
.cs-titlewrap > div { min-width: 0; flex: 1; }
.cs-title { font-size: 22px; font-weight: 700; background: transparent; border-color: transparent; padding-left: 6px; height: 44px; max-width: 520px; width: 100%; }
.cs-title:hover, .cs-title:focus { background: var(--surface); border-color: var(--border-2); }
.cs-head .subtitle { margin: 2px 0 0 6px; }
.cs-bar { gap: 8px; }
.cs-rival { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.cs-saved { font-size: 12.5px; margin-left: auto; }
.cs-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.cs-pool { padding: 12px; position: sticky; top: 12px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; gap: 10px; }
.cs-pool-list { overflow: auto; display: grid; gap: 6px; align-content: start; }
.cs-secs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.cs-sec { padding: 10px; border: 2px solid transparent; transition: border-color .12s; }
.cs-sec.over { border-color: var(--gold); }
.cs-sec-h { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.cs-sec-t { flex: 1; min-width: 0; display: grid; text-align: left; background: none; border: 0; color: var(--text); cursor: pointer; padding: 4px; font: inherit; }
.cs-sec-t b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 19px; letter-spacing: .02em; text-transform: uppercase; }
.cs-sec-t small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-sec-n { min-width: 24px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--surface-3); color: var(--text-2); font-size: 12px; display: grid; place-items: center; }
.cs-drop { display: grid; gap: 6px; min-height: 44px; border-radius: 10px; }
.cs-drop:empty { border: 1.5px dashed var(--border-2); }
.cs-item { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 10px; background: var(--surface-2); cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-y; -webkit-touch-callout: none; }
.cs-item.used { opacity: .55; }
.cs-item.dragging { opacity: .3; }
.cs-num { min-width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 800; font-size: 15px; display: grid; place-items: center; flex: none; font-variant-numeric: tabular-nums; }
.cs-pool .cs-num { display: none; }
.cs-th { width: 54px; aspect-ratio: 1000/640; border-radius: 6px; overflow: hidden; background: var(--field-bg); flex: none; } .cs-th svg { width: 100%; height: 100%; display: block; }
.cs-nm { flex: 1; min-width: 0; display: grid; line-height: 1.25; } .cs-nm b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-nm small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-sc { color: var(--gold); font-style: normal; font-weight: 600; }
.cs-x, .cs-add { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.cs-x:hover, .cs-add:hover { background: var(--surface-3); color: var(--strong); } .cs-x svg, .cs-add svg { width: 16px; height: 16px; }
.cs-plus { width: 100%; margin-top: 6px; min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font: inherit; font-size: 13.5px; }
.cs-plus:hover { background: var(--surface-2); color: var(--strong); } .cs-plus svg { width: 16px; height: 16px; }
.cs-ghost { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; box-shadow: var(--shadow); opacity: .95; }
body.cs-dragging { cursor: grabbing; user-select: none; }

/* ---- Partido (control remoto) ---- */
.gm-pick { max-width: 640px; }
.gm-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.gm-role { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 16px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; }
.gm-role:hover { border-color: var(--red); } .gm-role svg { width: 24px; height: 24px; color: var(--gold); } .gm-role b { font-size: 17px; } .gm-role small { color: var(--muted); font-size: 13px; }
.gm { display: flex; flex-direction: column; gap: 10px; max-width: 760px; margin: 0 auto; }
.gm-top { display: flex; align-items: center; gap: 10px; }
.gm-title { flex: 1; min-width: 0; display: grid; line-height: 1.3; } .gm-title b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-title small { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.gm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; } .gm-dot.ok { background: var(--ok); } .gm-dot.off { background: var(--red); } .gm-dot.connecting { background: var(--gold); }
.gm-count { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 14px; }
.gm-secs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .gm-secs .chip { flex: none; background: var(--surface); }
.gm-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.gm-cap { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.gm-num { min-width: 52px; height: 52px; padding: 0 8px; border-radius: 12px; background: var(--ink); color: #fff; font-family: var(--display); font-weight: 800; font-size: 34px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.gm-nm { min-width: 0; display: grid; } .gm-nm b { font-size: 22px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; } .gm-nm small { color: var(--muted); font-size: 13.5px; }
.gm-dia { aspect-ratio: 1000/640; background: var(--field-bg); } .gm-dia svg { width: 100%; height: 100%; display: block; }
.gm-next-row { display: grid; gap: 4px; } .gm-next-row > .muted { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.gm-card.next { display: flex; align-items: center; } .gm-card.next .gm-cap { flex: 1; padding: 8px 10px; } .gm-card.next .gm-num { min-width: 38px; height: 38px; font-size: 24px; }
.gm-card.next .gm-nm b { font-size: 16px; } .gm-card.next .gm-dia { width: 110px; flex: none; }
.gm-card.empty-card { padding: 16px; color: var(--muted); }
.gm-log { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .gm-log .btn { flex: 1; }
.gm-ok { color: var(--ok-ink); } .gm-no { color: var(--danger-ink); } .gm-log .muted { width: 100%; text-align: center; font-size: 12.5px; }
.gm-bot { display: flex; gap: 10px; position: sticky; bottom: calc(76px + var(--safe-b)); padding: 6px 0; background: var(--bg); }
.gm-go { flex: 1; height: 56px; font-size: 18px; }
.gm-bot .btn.icon { width: 56px; height: 56px; }
body.gm-full .sidebar, body.gm-full .topbar, body.gm-full .tabbar, body.gm-full .ai-fab { display: none !important; }
body.gm-full .view { max-width: none; padding: calc(8px + var(--safe-t)) 12px 12px; margin: 0; }
body.gm-full .shell { display: block; }
.gm-display { max-width: none; height: calc(100dvh - 20px); }
.gm-stage { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr minmax(220px, 26%); gap: 12px; }
.gm-stage > .gm-card.big { display: flex; flex-direction: column; min-height: 0; } .gm-stage .gm-card.big .gm-dia { flex: 1; min-height: 0; aspect-ratio: auto; }
.gm-display .gm-num { min-width: 84px; height: 84px; font-size: 60px; } .gm-display .gm-card.big .gm-nm b { font-size: clamp(26px, 4vw, 48px); }
.gm-side { display: flex; flex-direction: column; gap: 6px; } .gm-side .gm-card.next { flex-direction: column; align-items: stretch; } .gm-side .gm-card.next .gm-dia { width: auto; }
.gm-manual { position: static; justify-content: center; align-items: center; }
@media (max-width: 760px) { .gm-stage { grid-template-columns: 1fr; } .gm-roles { grid-template-columns: 1fr; } }

/* ---- Rivales ---- */
.rv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.rv-wide { grid-column: 1 / -1; }
.rv-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; } .rv-h .section { margin: 0; }
.rv-sec .textarea { min-height: 110px; width: 100%; }
.rv-sec .seg { margin-bottom: 18px; }
.rv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.rv-chip { min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-2); background: transparent; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: inherit; font-size: 13.5px; }
.rv-chip small { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: rgba(0,0,0,.25); }
.rv-chip.on { color: var(--strong); border-color: transparent; background: var(--surface-3); }
.rv-chip.f-mucho { background: rgba(232, 180, 71, .22); } .rv-chip.f-siempre { background: var(--red); }
.rv-chip.add svg { width: 14px; height: 14px; }
.rv-callbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .rv-callbar .select { min-width: 200px; }
.rv-rank { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 6px; }
.rv-rank li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); }
.rv-rank .rk { width: 26px; text-align: center; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.rv-rank .th { width: 64px; aspect-ratio: 1000/640; border-radius: 6px; overflow: hidden; background: var(--field-bg); flex: none; } .rv-rank .th svg { width: 100%; height: 100%; display: block; }
.rv-rank .tx { flex: 1; min-width: 0; display: grid; } .rv-rank .tx b { font-size: 14.5px; } .rv-rank .tx small { color: var(--muted); font-size: 12.5px; }
.rv-rank .sc { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-2); }
.rv-log { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; } .rv-log li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.rv-log li span { flex: 1; } .rv-log .ok { color: var(--ok-ink); } .rv-log .no { color: var(--danger-ink); }
.rv-rep { padding: 8px 0; border-bottom: 1px solid var(--border); } .rv-rep summary { cursor: pointer; font-size: 14px; color: var(--text-2); }
.rv-plays { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* ---- Quiz ---- */
.qz-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.qz-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 3px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.qz-tag .th { width: 40px; aspect-ratio: 1000/640; border-radius: 5px; overflow: hidden; } .qz-tag .th svg { width: 100%; height: 100%; display: block; }
.qz-tag button { width: 26px; height: 26px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; } .qz-tag button svg { width: 14px; height: 14px; }
.qz-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; counter-reset: q; }
.qz-list > li { display: flex; gap: 12px; padding: 8px; border-radius: 10px; background: var(--surface-2); }
.qz-list .th { width: 120px; aspect-ratio: 1000/640; border-radius: 6px; overflow: hidden; flex: none; background: var(--field-bg); } .qz-list .th svg { width: 100%; height: 100%; display: block; }
.qz-list b { font-size: 14.5px; } .qz-list ul { margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--text-2); } .qz-list li.ok { color: var(--gold); font-weight: 600; }

/* ---- Pizarra: plantillas, etiquetas y video ---- */
.pz-tplrow { margin-top: 0; margin-bottom: 12px; }
.tpl-tabs { margin: 4px 0 10px; } .tpl-side { margin-bottom: 8px; max-width: 360px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tpl-item { display: grid; gap: 3px; padding: 0 0 10px; border-radius: 12px; border: 1px solid transparent; background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer; overflow: hidden; font: inherit; }
.tpl-item:hover { border-color: var(--gold); }
.tpl-item .th { aspect-ratio: 1000/640; background: var(--field-bg); margin-bottom: 4px; } .tpl-item .th svg { width: 100%; height: 100%; display: block; }
.tpl-item b { padding: 0 10px; font-size: 14px; } .tpl-item small { padding: 0 10px; color: var(--muted); font-size: 12px; line-height: 1.3; }
.tag-sug { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag-chip { min-height: 30px; padding: 0 10px; font-size: 12.5px; background: var(--surface-2); color: var(--text-2); }
.tag-chip.active { background: var(--gold); color: #111; }
.pb-filters .tag-chips { flex-wrap: wrap; }
.vid-badge { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 6px; border-radius: 6px; background: var(--red-soft); color: #FF8A95; vertical-align: -3px; }
.vid-badge svg { width: 12px; height: 12px; }
.pb-vid .dr-video iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }

/* ---- Impresión: hoja de llamadas y pulsera de texto ---- */
.pbp-sheetpick { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.pbp-sheetpick[hidden], .pbp-src[hidden], .pbp-fgrid[hidden], .pbp-opts select[hidden] { display: none; }
.calls-grid { columns: 2; column-gap: .3in; }
.calls-sec { break-inside: avoid; margin: 0 0 .16in; border: 1.5px solid #111; border-radius: 4px; }
.calls-sec h4 { margin: 0; padding: 3px 8px; background: #111; color: #fff; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.calls-sec ol { list-style: none; margin: 0; padding: 2px 6px 4px; }
.calls-sec li { display: flex; align-items: baseline; gap: 6px; padding: 2px 0; border-bottom: 1px solid #ddd; font-size: 11px; color: #111; }
.calls-sec li:last-child { border-bottom: 0; }
.calls-sec .cn { min-width: 22px; font-weight: 800; font-size: 12px; } .calls-sec .ct { flex: 1; font-weight: 600; } .calls-sec small { color: #555; font-size: 9.5px; }
.band-card { position: relative; }
.band-who { position: absolute; top: -.16in; right: 0; font-size: 8px; font-weight: 700; color: #111; }
.band-cell.txt { flex-direction: row; align-items: center; gap: 3px; padding-left: .24in; }
.band-cell.txt .bn { top: 50%; transform: translateY(-50%); border-radius: 0 3px 3px 0; font-size: 11px; line-height: 15px; }
.band-cell .btx { min-width: 0; display: grid; line-height: 1.1; } .band-cell .btx b { font-size: 8px; color: #111; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.band-cell .btx small { font-size: 6.5px; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Visor de solo lectura (ver.html) ---- */
.vw-body { background: var(--bg); color: var(--text); margin: 0; }
.vw { max-width: 820px; margin: 0 auto; padding: calc(10px + var(--safe-t)) 14px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; min-height: 100dvh; }
.vw-loading { margin: auto; color: var(--muted); }
.vw-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vw-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--strong); text-decoration: none; }
.vw-brand .wordmark { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 20px; letter-spacing: .04em; }
.vw-head h1 { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.15; } .vw-head p { margin: 4px 0 0; color: var(--muted); }
.vw-stage { border-radius: var(--radius); overflow: hidden; background: var(--field-bg); aspect-ratio: 1000/640; } .vw-stage svg { width: 100%; height: 100%; display: block; }
.vw-ctrl { display: flex; align-items: center; gap: 8px; position: static; background: var(--surface); border-radius: 12px; padding: 8px; }
.vw-ctrl input[type=range] { flex: 1; accent-color: var(--red); }
.vw-video iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--radius); display: block; background: #000; }
.vw-vlink { align-self: flex-start; }
.vw-notes { background: var(--surface); border-radius: var(--radius); padding: 12px 14px; } .vw-notes h2 { margin: 0 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; } .vw-notes p { margin: 0; white-space: pre-line; color: var(--text-2); }
.vw-foot { text-align: center; font-size: 12px; margin-top: auto; }
.vw-q { font-size: 22px !important; }
.vw-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vw-opt { min-height: 54px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.vw-opt.ok { background: rgba(34, 197, 94, .18); border-color: var(--ok); } .vw-opt.no { background: var(--red-soft); border-color: var(--red); }
.vw-exp { margin: 0; color: var(--text-2); } .vw-next { display: flex; justify-content: flex-end; }
.vw-done { text-align: center; margin: auto 0; display: grid; gap: 14px; justify-items: center; }
.vw-err { margin-top: 20px; }

@media (max-width: 900px) {
  .gd-cols { grid-template-columns: 1fr; }
  .cs-layout { grid-template-columns: 1fr; }
  .cs-pool { display: none; }
  .rv-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .cs-title { font-size: 19px; }
  .cs-secs { grid-template-columns: 1fr; }
  .qz-list .th { width: 92px; }
  .vw-head h1 { font-size: 22px; }
  .page-head.cs-head .actions .btn span.hide-sm { display: none; }
}
/* elementos ocultos dentro de las vistas nuevas (los .seg/.field tienen display propio) */
.gd-modal [hidden], .gd-cols [hidden], .rv-grid [hidden], .gm [hidden], .cs-layout [hidden], .pbp-bar [hidden] { display: none !important; }
/* impresión en touch: los select chicos con letra de 16 px (anti-zoom de iOS) no deben cortarse */
@media (hover: none) and (pointer: coarse) { .pbp-opts .select.sm, .pbp-opts .input.sm { height: 42px; line-height: 1.2; padding-top: 0; padding-bottom: 0; background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px; } }
.pb-vid { z-index: 120; } /* el video se abre encima de la vista grande */
.pz-video:has(#fVideoStartF[hidden]) { grid-template-columns: 1fr; }
.gd-result > .pad { padding: 16px 18px 18px; display: grid; gap: 4px; }
@media (max-width: 600px) { .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .tpl-item small { display: none; } }

/* =====================================================================================
   REDISEÑO 2026 (capa final): navegación de 4 pestañas + ＋ Crear, selector único de formato,
   Inicio “Hoy”, Playbook con carpetas grandes, Pizarra clara, Coach IA y Modo partido.
   Títulos en Barlow Condensed (mayúsculas), texto en Inter; un botón rojo por pantalla, dorado = destacado.
   ===================================================================================== */
h1.title, .sec-title, .more-title, .create-head b, .pb-fmt-name, .eyebrow-d { font-family: var(--display); }
h1.title { font-weight: 800; text-transform: uppercase; letter-spacing: .02em; font-size: 40px; line-height: 1; }
@media (max-width: 900px) { h1.title { font-size: 34px; } }
h2.section { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 20px; }
.eyebrow-d { font-weight: 700; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-2); }
:root[data-theme="dark"] .eyebrow-d { color: var(--gold); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Botones (48 px mínimo, rojo con “escalón”) ---------- */
.btn { min-height: 48px; height: 48px; border-radius: 14px; font-weight: 700; border: 1.5px solid var(--border-2); background: var(--surface); }
.btn.sm { min-height: 40px; height: 40px; border-radius: 11px; }
.btn.icon { width: 48px; } .btn.sm.icon { width: 40px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost-b { background: var(--surface); border: 1.5px solid var(--ink); color: var(--ink); }
.btn.ghost-b:hover { background: var(--surface-2); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 3px 0 var(--red-2); }
.btn.primary:hover { background: #C41425; border-color: #C41425; }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-2); }
.btn.xl { width: 100%; height: 54px; min-height: 54px; font-size: 17px; gap: 10px; }
.btn.xl svg { width: 20px; height: 20px; }
.icon-btn, .more-btn { width: 48px; height: 48px; border-radius: 12px; }

/* ---------- Chips: activo negro, dorado = contexto ---------- */
.chip { min-height: 40px; padding: 0 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 600; font-size: 14px; white-space: nowrap; }
.chip:hover { color: var(--strong); border-color: var(--border-2); }
.chip.active, .chip.active.red, .chip.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip.gold { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-ink); }
.chip.gold.active { background: var(--gold); border-color: var(--gold); color: #141414; }
.chip.ghost { background: transparent; border-style: dashed; border-color: var(--border-2); }
.chip svg { width: 16px; height: 16px; }
.seg { background: var(--surface-2); border-radius: 12px; }
.seg button { min-height: 40px; border-radius: 9px; font-weight: 600; }
.seg button.active { background: var(--surface); color: var(--strong); box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.08); }
:root[data-theme="dark"] .seg button.active { background: var(--surface-3); }
.card { border: 1px solid var(--border); box-shadow: var(--shadow-card); }

/* ---------- Selector de formato ---------- */
.fmt-seg { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(0,0,0,.06); }
.fmt-seg button { flex: 1; min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 700; font-size: 15px; cursor: pointer; border-bottom: 2px solid transparent; }
.fmt-seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.1); border-bottom-color: var(--gold); }
:root[data-theme="dark"] .fmt-seg { background: rgba(255,255,255,.06); }
:root[data-theme="dark"] .fmt-seg button.on { background: var(--surface-3); color: var(--strong); }
.fmt-seg.hero { background: rgba(0,0,0,.22); }
.fmt-seg.hero button { color: #fff; min-height: 46px; font-size: 16px; }
.fmt-seg.hero button.on { background: #fff; color: #141414; }
.fmt-pill-wrap { position: relative; }
.fmt-pill { display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 48px; padding: 0 14px; border-radius: 20px; background: var(--surface); border: 1.5px solid var(--ink); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; }
.fmt-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.fmt-pill .car { font-size: 11px; }
.fmt-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 190px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow); display: grid; gap: 2px; }
.fmt-menu[hidden] { display: none; }
.fmt-menu button { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.fmt-menu button b { font-size: 16px; } .fmt-menu button small { color: var(--muted); font-size: 12.5px; }
.fmt-menu button:hover { background: var(--surface-2); }
.fmt-menu button.on { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }

/* ---------- Shell: barra lateral (escritorio) ---------- */
.sidebar { background: var(--surface); padding: 22px 14px 16px; overflow-y: auto; }
.sidebar .brand { padding: 0 6px; }
.sidebar .brand .wm { width: 150px; height: auto; }
.wm-d { display: none !important; }
:root[data-theme="dark"] .wm-l { display: none !important; }
:root[data-theme="dark"] .wm-d { display: block !important; }
.team-name { margin: 6px 8px 14px; }
.side-fmt { margin: 0 4px 14px; }
.side-fmt .fmt-seg button { min-height: 40px; font-size: 14px; }
.nav a { min-height: 48px; border-radius: 12px; font-weight: 600; }
.nav a.active { background: var(--red-soft); color: var(--red); }
.nav a.active svg { color: var(--red); }
:root[data-theme="dark"] .nav a.active { color: #fff; }
.nav-label { padding: 4px 12px 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.side-create { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 6px 0; padding: 0 14px; border: 0; border-radius: 14px; background: var(--red); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: 0 3px 0 var(--red-2); }
.side-create svg { width: 20px; height: 20px; }
.side-create:hover { background: #C41425; }
.view { background: var(--bg); }

/* ---------- Móvil: barra superior + pestañas con ＋ Crear ---------- */
@media (max-width: 900px) {
  .topbar { background: var(--bg); padding: calc(8px + var(--safe-t)) 14px 8px 16px; min-height: calc(60px + var(--safe-t)); }
  .topbar .brand { gap: 10px; }
  .topbar .brand .mark { width: 34px; height: 34px; border-radius: 9px; }
  .topbar .brand .wm { width: auto; height: 26px; }
  .top-r { display: flex; align-items: center; gap: 8px; }
  .avatar-btn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); font-weight: 800; font-size: 14px; display: grid; place-items: center; cursor: pointer; position: relative; }
  .avatar-btn::before { content: ""; position: absolute; inset: -4px; } /* 52 px de área táctil */
  .avatar-btn.active, .avatar-btn[aria-expanded="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
  #topFmt .fmt-pill { height: 40px; }
  /* Inicio: barra transparente sobre el encabezado rojo */
  body[data-route="inicio"] .topbar { position: absolute; left: 0; right: 0; background: transparent; z-index: 31; }
  body[data-route="inicio"] .topbar .wm-l { display: none !important; }
  body[data-route="inicio"] .topbar .wm-d { display: block !important; }
  body[data-route="inicio"] #topFmt { display: none; }
  body[data-route="inicio"] .avatar-btn { background: rgba(255,255,255,.16); border-color: var(--gold); color: #fff; }
  /* Playbook y Coach IA: el título de la pantalla hace de encabezado (como los mockups) */
  body[data-route="playbook"] .topbar, body[data-route="asistente"] .topbar { display: none; }
  body[data-route="playbook"] .view, body[data-route="asistente"] .view { padding-top: calc(14px + var(--safe-t)); }

  .view { padding: 12px 16px calc(104px + var(--safe-b)); }
  .tabbar { grid-template-columns: 1fr 1fr 84px 1fr 1fr; align-items: start; padding: 6px 4px calc(6px + var(--safe-b)); background: var(--bar-bg); border-top: 1px solid var(--border); box-shadow: 0 -4px 18px rgba(20,20,20,.05); }
  .tabbar a, .tabbar button { min-height: 58px; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
  .tabbar svg { width: 26px; height: 26px; color: var(--ink); }
  .tabbar .active, .tabbar .active svg { color: var(--red); }
  .tabbar .tab-create { position: relative; justify-content: flex-end; padding-bottom: 2px; }
  .tab-create .fab-c { position: absolute; top: -30px; left: 50%; margin-left: -31px; width: 62px; height: 62px; border-radius: 50%; background: var(--red); display: grid; place-items: center;
    box-shadow: 0 0 0 4px var(--bar-bg), 0 0 0 6px var(--gold), 0 8px 16px rgba(0,0,0,.28); transition: transform .15s; }
  .tab-create .fab-c svg { width: 28px; height: 28px; color: #fff; stroke-width: 3; }
  .tab-create[aria-expanded="true"] .fab-c { transform: rotate(45deg); }
  .tab-create:active .fab-c { transform: scale(.94); }
  body.pb-selecting .tab-create { visibility: hidden; } /* en modo selección la barra de acciones va arriba de las pestañas */
}

/* ---------- Hojas: Perfil y más (avatar) y ＋ Crear ---------- */
.more-sheet { position: fixed; inset: 0; z-index: 70; pointer-events: none; display: block; visibility: hidden; }
.more-sheet.open { pointer-events: auto; visibility: visible; }
.more-sheet .more-scrim { position: absolute; inset: 0; background: rgba(20,20,20,.5); opacity: 0; transition: opacity .2s; }
.more-sheet.open .more-scrim { opacity: 1; }
.more-sheet .more-panel, .create-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; padding: 8px 14px calc(18px + var(--safe-b));
  background: var(--surface); border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .26s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -10px 30px rgba(0,0,0,.18); }
.more-sheet.open .more-panel, .more-sheet.open .create-panel { transform: none; }
.sheet-grip { display: block; width: 40px; height: 5px; margin: 2px auto 10px; border-radius: 3px; background: var(--border-2); }
.more-who { display: flex; align-items: center; gap: 12px; padding: 6px 6px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; border: 2px solid var(--gold); background: var(--ink); color: var(--on-ink); }
.more-who b { display: block; font-size: 17px; } .more-who small { color: var(--muted); font-size: 13px; }
.more-title { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 15px; color: var(--muted); padding: 12px 6px 6px; }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.more-panel a { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 12px; border-radius: 14px; color: var(--text); background: var(--bg); border: 1px solid var(--border); }
.more-panel a svg { width: 22px; height: 22px; color: var(--ink); flex: none; }
.more-panel a span { display: grid; line-height: 1.25; min-width: 0; }
.more-panel a b { font-weight: 700; font-size: 14.5px; }
.more-panel a small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-panel a:hover { border-color: var(--border-2); }
.more-panel a.active { border-color: var(--red); } .more-panel a.active svg { color: var(--red); }
.more-panel .more-data { margin-top: 12px; }
.more-set { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 4px 6px; }
.more-set > span { font-weight: 600; font-size: 14.5px; }
.pref-seg { min-width: 200px; }
.create-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 8px 6px; }
.create-head b { font-size: 26px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.create-item { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 10px 12px; margin-bottom: 8px; border-radius: 16px; background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.create-item > svg { width: 20px; height: 20px; color: var(--muted); margin-left: auto; flex: none; }
.create-item span:not(.ci-ico) { display: grid; line-height: 1.3; }
.create-item b { font-size: 16px; font-weight: 700; } .create-item small { color: var(--muted); font-size: 13px; }
.ci-ico { width: 46px; height: 46px; flex: none; border-radius: 13px; background: var(--gold-soft); border: 1.5px solid var(--ink); display: grid; place-items: center; }
.ci-ico svg { width: 22px; height: 22px; color: var(--ink); }
.create-item.main { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 3px 0 var(--red-2); }
.create-item.main small, .create-item.main > svg { color: rgba(255,255,255,.85); }
.create-item.main .ci-ico { background: #fff; border-color: #141414; }
.create-item.main .ci-ico svg { color: var(--red); }
.create-item:hover { border-color: var(--border-2); }
@media (min-width: 901px) {
  .more-sheet:not(.create-sheet) { display: none; }
  .create-panel { left: 50%; right: auto; bottom: auto; top: 50%; width: 460px; border-radius: 22px; transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform .2s, opacity .2s; padding-bottom: 14px; }
  .more-sheet.open .create-panel { transform: translate(-50%, -50%); opacity: 1; }
  .create-panel .sheet-grip { display: none; }
}

/* ---------- Inicio “Hoy” ---------- */
.hoy-hero { position: relative; margin: -12px -16px 0; padding: calc(78px + var(--safe-t)) 20px 92px; color: #fff; overflow: hidden;
  background: linear-gradient(160deg, #E01E31 0%, #C01425 60%, #A30F1E 100%); }
.hoy-hero::before { content: ""; position: absolute; right: -40px; top: 40px; width: 260px; height: 260px; opacity: .10;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 8 92 92H74L50 40 26 92H8Z' fill='%23fff'/%3E%3C/svg%3E"); pointer-events: none; }
.hoy-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--gold); box-shadow: 0 2px 0 #141414; }
.hoy-hello { position: relative; font-weight: 600; font-size: 15px; opacity: .9; margin-bottom: 14px; }
.hoy-hero .fmt-seg { position: relative; }
.hoy-card { position: relative; z-index: 2; margin: -74px 0 0; padding: 18px; border-radius: 20px; background: var(--surface); box-shadow: 0 10px 30px rgba(20,20,20,.18), 0 0 0 1px rgba(0,0,0,.04); }
.hoy-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hoy-until { font-weight: 700; font-size: 12px; background: var(--ink); color: var(--on-ink); padding: 4px 9px; border-radius: 8px; white-space: nowrap; }
.hoy-main { display: flex; gap: 14px; align-items: center; margin: 12px 0 16px; color: inherit; }
.hoy-date { width: 62px; height: 66px; flex: none; border-radius: 12px; border: 2px solid var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hoy-date small { font-weight: 700; font-size: 11px; color: var(--red); letter-spacing: .04em; }
.hoy-date b { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; }
.hoy-date.empty svg { width: 28px; height: 28px; color: var(--muted); }
.hoy-tx { display: grid; min-width: 0; }
.hoy-tx b { font-weight: 800; font-size: 20px; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
.hoy-tx span { color: var(--muted); font-size: 14px; font-weight: 500; margin-top: 3px; }
.hoy-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.shortcut { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-height: 104px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); color: var(--text); }
.shortcut:hover { border-color: var(--border-2); }
.sc-ico { width: 40px; height: 40px; border-radius: 11px; background: var(--gold-soft); border: 1.5px solid var(--ink); display: grid; place-items: center; }
.sc-ico svg { width: 20px; height: 20px; color: var(--ink); stroke-width: 2.4; }
.shortcut span:last-child { display: grid; }
.shortcut b { font-weight: 800; font-size: 16px; line-height: 1.2; } .shortcut small { color: var(--muted); font-size: 12.5px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 4px 10px; }
.sec-title { margin: 0; font-weight: 800; font-size: 22px; letter-spacing: .04em; text-transform: uppercase; }
.sec-link { font-weight: 700; font-size: 14px; color: var(--red); min-height: 44px; display: inline-flex; align-items: center; }
.hoy-recent { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 8px; }
.hoy-recent::-webkit-scrollbar { display: none; }
.rc-card { flex: none; width: 154px; scroll-snap-align: start; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); color: var(--text); }
.rc-card .thumb { display: block; height: 98px; background: var(--field-bg); border-bottom: 1px solid var(--border); overflow: hidden; }
.rc-card .thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .18s; }
.rc-card .thumb.ready img { opacity: 1; }
.rc-tx { display: grid; padding: 9px 11px 10px; }
.rc-tx b { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-tx small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hoy-ai { display: flex; align-items: center; gap: 12px; min-height: 64px; margin-top: 18px; padding: 10px 14px; border-radius: 18px; background: var(--ink); color: var(--on-ink); }
.hoy-ai > svg:first-child { width: 26px; height: 26px; color: var(--gold); flex: none; }
.hoy-ai span { display: grid; flex: 1; } .hoy-ai b { font-size: 15px; } .hoy-ai small { opacity: .75; font-size: 12.5px; }
.hoy-ai > svg:last-child { width: 20px; height: 20px; opacity: .7; }
@media (min-width: 901px) {
  .hoy-hero { margin: -36px -44px 0; padding: 40px 44px 110px; }
  .hoy-hero .fmt-seg { max-width: 420px; }
  .hoy-card, .hoy-shortcuts, .sec-head, .hoy-recent, .hoy-ai, .view > .empty { max-width: 860px; }
  .hoy-card { padding: 22px 24px; }
  .hoy-card .btn.xl { max-width: 360px; }
  .hoy-recent { margin: 0; padding: 2px 0 8px; flex-wrap: wrap; overflow: visible; }
  .rc-card { width: 200px; } .rc-card .thumb { height: 124px; }
}
:root[data-theme="dark"] .hoy-card { box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 0 1px var(--border); }

/* ---------- Playbook ---------- */
.pb-head { flex-wrap: nowrap; align-items: center; margin-bottom: 14px; }
.pb-head .actions { flex-wrap: nowrap; gap: 8px; }
.pb-head .actions .btn.icon, .pb-search-btn, .pb-filt-btn { width: 48px; height: 48px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--ink); }
.pb-head .actions .btn.icon.active, .pb-search-btn.active, .pb-filt-btn.active { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.pb-head .pb-print, .pb-head .pb-new.ghost { background: var(--surface); border: 1px solid var(--border); }
.pb-toolbar { display: none; flex-wrap: wrap; gap: 8px; }
.pb-toolbar.open { display: flex; }
.pb-toolbar .search .input { height: 48px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.pb-formats { gap: 10px; }
.pb-fmt { position: relative; display: flex; flex-direction: column; min-height: 118px; padding: 12px; gap: 0; border-radius: 16px; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); overflow: hidden; }
.pb-fmt.on { background: linear-gradient(160deg, #E01E31, #B01222); border-color: transparent; color: #fff; box-shadow: 0 4px 0 #141414, 0 10px 20px rgba(215,24,42,.25); }
.pb-fmt:hover { border-color: var(--border-2); } .pb-fmt.on:hover { background: linear-gradient(160deg, #E8283A, #B8162A); }
.pb-fmt-ico { width: 30px; height: 24px; border-radius: 0; background: none; display: block; }
.pb-fmt-ico svg { width: 30px; height: 24px; fill: var(--gold-soft); stroke: var(--gold-2); stroke-width: 1.6; color: inherit; }
.pb-fmt.on .pb-fmt-ico svg { fill: var(--gold); stroke: #141414; }
:root[data-theme="dark"] .pb-fmt-ico svg { fill: rgba(232,180,71,.25); stroke: var(--gold); }
.pb-fmt-txt { margin-top: 8px; align-self: stretch; }
.pb-fmt-name { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: .01em; text-transform: uppercase; color: inherit; }
.pb-fmt-txt small { color: inherit; opacity: .8; font-size: 11.5px; font-weight: 600; margin-top: 3px; }
.pb-fmt-subs { color: inherit; opacity: .7; font-size: 12px; }
.pb-fmt-n { position: absolute; right: 11px; top: 10px; }
.pb-fmt-n .n { font-family: var(--display); font-weight: 800; font-size: 22px; color: inherit; }
.pb-fmt-n small { color: inherit; opacity: .75; font-size: 11.5px; }
.pb-chiprow { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 16px -16px 0; padding: 0 16px 2px; }
.pb-chiprow::-webkit-scrollbar { display: none; }
.pb-chiprow .chip { flex: none; min-height: 44px; }
.pb-gridhead { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.pb-gridbtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; }
.pb-gridbtn svg { width: 28px; height: 28px; padding: 6px; border-radius: 8px; background: var(--ink); color: var(--on-ink); }
.pb-fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pb-tile { display: flex; flex-direction: column; padding: 0; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.pb-tile:hover { border-color: var(--border-2); }
.pb-tile .thumb { position: relative; display: block; aspect-ratio: 173 / 112; background: var(--field-bg); border-bottom: 1px solid var(--border); overflow: hidden; }
.pb-tile .thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .18s; }
.pb-tile .thumb.ready img { opacity: 1; }
.pb-num { position: absolute; left: 8px; top: 8px; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 7px; background: #141414; color: #fff; font-family: var(--display); font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.pb-tile-tx { display: grid; padding: 9px 11px 10px; min-width: 0; }
.pb-tile-tx b { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-tile-tx small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; overflow: hidden; white-space: nowrap; }
.pb-tile-tx .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--u-general); }
.pb-tile-tx .dot.u-ofensiva { background: var(--u-ofensiva); } .pb-tile-tx .dot.u-defensiva { background: var(--u-defensiva); } .pb-tile-tx .dot.u-especiales { background: var(--u-especiales); }
.play-card { border-radius: 18px; overflow: hidden; }
.play-card .thumb { border-bottom: 1px solid var(--border); }
.play-card .name { font-weight: 800; font-size: 15px; }
.play-card .pm-num { background: #141414; color: #fff; font-family: var(--display); font-weight: 800; font-size: 13px; }
.pb-ftile { border-radius: 18px; box-shadow: var(--shadow-card); }
.pb-ftile .thumb::after { display: none; }
.pb-ftile .thumb img { filter: none; }
.pb-selbar { background: var(--surface); border: 1.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); border-radius: 18px; }
@media (max-width: 900px) {
  .pb-head .hide-sm { display: none; }
  .pb-head .pb-print, .pb-head .pb-new.ghost { width: 48px; padding: 0; }
  .pb-head .pb-new.ghost span { display: none; }
  .pb-head[data-level="0"] .pb-new { display: none; } /* en móvil se crea con ＋ */
  .pb-fgrid, .grid.plays.pb-grid, .pb-subs { grid-template-columns: 1fr 1fr; gap: 12px; }
  .pb-fmt-name { font-size: 26px; }
  .pb-fmt-subs, .pb-fmt-n small { display: none; }
  .pb-fmt-n .n { font-size: 18px; }
  .pb-selbar { left: 10px; right: 10px; bottom: calc(80px + var(--safe-b)); }
  .play-card .body { padding: 9px 11px 10px; }
}
@media (min-width: 901px) {
  .pb-toolbar { display: flex; }
  .pb-search-btn { display: none !important; }
  .pb-chiprow { margin: 18px 0 0; padding: 0; flex-wrap: wrap; overflow: visible; }
  .pb-fmt { min-height: 150px; padding: 18px; }
  .pb-fmt-name { font-size: 40px; }
}

/* ---------- Coach IA ---------- */
.ai-head { margin-bottom: 12px; align-items: center; }
.ai-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ai-tile { width: 44px; height: 44px; flex: none; border-radius: 12px; background: #141414; display: grid; place-items: center; }
.ai-tile svg { width: 24px; height: 24px; color: var(--gold); }
:root[data-theme="dark"] .ai-tile { box-shadow: 0 0 0 1px var(--border-2); }
.ai-head h1.title { font-size: 32px; }
.ai-head .subtitle { margin: 2px 0 0; font-weight: 600; font-size: 12.5px; }
.ai-head .actions { align-items: center; gap: 6px; }
.ai-chips { gap: 8px; padding-bottom: 2px; }
.ai-chip { min-height: 44px; }
.ai-chip-ic { font-size: 15px; } .ai-chip-ic::before { content: attr(data-ic); }
.ai-panel { border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.ai-msg.me .ai-bubble { background: var(--red); color: #fff; border-radius: 18px 18px 4px 18px; padding: 12px 15px; font-weight: 500; box-shadow: 0 2px 0 var(--red-2); max-width: 82%; }
.ai-msg.bot .ai-bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 18px 18px 18px 4px; box-shadow: var(--shadow-card); padding: 13px 15px; max-width: min(640px, 96%); }
.ai-msg.err .ai-bubble { color: var(--danger-ink); }
.ai-card-fig { margin: 10px 0 0; border: 1.5px solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--field-bg); line-height: 0; }
.ai-card-fig svg { width: 100%; height: auto; aspect-ratio: 1000 / 470; }
.ai-card-acts, .ai-gen-acts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ai-card-acts .btn, .ai-gen-acts .btn { flex: 1 1 140px; height: 46px; min-height: 46px; font-size: 14.5px; }
.ai-gen { border: 1.5px solid var(--ink); border-radius: 14px; background: var(--surface); }
.ai-gen-fig { border-bottom: 1px solid var(--border); }
.ai-gen-issues li.err { background: var(--red-soft); color: var(--danger-ink); }
.ai-gen-issues li.warn { color: var(--warn-ink); }
.ai-gen-fixes summary { color: var(--gold-ink); }
.ai-empty svg { color: var(--gold-2); }
.ai-sug { margin-top: 8px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.ai-sug-head { display: flex; justify-content: space-between; align-items: center; }
.ai-sug-head b { font-family: var(--display); font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: .04em; }
.ai-sug-goals { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.ai-sug-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ai-sug-links a { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); font-weight: 600; font-size: 13.5px; }
.ai-sug-links svg { width: 18px; height: 18px; flex: none; }
.ai-dock { background: var(--bg); border-top: 0; }
.ai-composer { align-items: center; }
.ai-composer .textarea { min-height: 52px; border-radius: 26px; padding: 14px 18px; border: 1.5px solid var(--ink); background: var(--surface); }
.ai-composer .btn.icon { width: 52px; height: 52px; min-height: 52px; border-radius: 50%; flex: none; }
.ai-mic { background: var(--surface); border: 1.5px solid var(--ink); color: var(--ink); }
.ai-mic.rec { background: var(--gold); border-color: var(--gold); color: #141414; animation: aiRec 1.2s ease-in-out infinite; }
@keyframes aiRec { 50% { box-shadow: 0 0 0 6px rgba(232,180,71,.35); } }
.ai-send svg { width: 22px; height: 22px; stroke-width: 2.6; }
.ai-disc { text-align: center; }

/* ---------- Pizarra: campo blanco que se lee al sol (toggle oscuro) ---------- */
#pz{ --top-h: 64px; --meta-h: 0px; --bar-h: 88px; --ctx-h: 0px; background: var(--bg); color: var(--ink); }
#pz .pz-stage{ left: calc(var(--sl) + 12px); right: calc(var(--sr) + 12px); top: calc(var(--safe-t) + var(--top-h) + 6px); bottom: calc(var(--safe-b) + var(--bar-h) + 22px + var(--ctx-fix, 0px) + var(--ctx-pop, 0px));
  border: 2px solid #141414; border-radius: 18px; overflow: hidden; background: var(--field-bg); box-shadow: 0 6px 0 rgba(20,20,20,.08); }
:root[data-theme="dark"] #pz .pz-stage{ border-color: #3B3B42; box-shadow: none; }
#pz .pz-turf{ opacity: 1; }
#pz .board{ border-radius: 0; background: var(--field-bg); position: relative; z-index: 1; }
#pz .pz-top{ background: transparent; height: calc(var(--safe-t) + var(--top-h)); padding: calc(var(--safe-t) + 8px) calc(var(--sr) + 12px) 6px calc(var(--sl) + 6px); gap: 6px; color: var(--ink); }
#pz .pz-btn{ color: var(--ink); min-width: 48px; height: 48px; }
#pz .pz-btn:hover{ background: var(--surface-2); }
#pz .pz-btn.boxed{ width: 46px; min-width: 46px; height: 46px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
#tMore[aria-expanded="true"] { background: var(--surface-3); }
#pz .pz-exit{ padding: 0 4px; color: var(--ink); }
#pz .pz-exit .lbl{ display: none; }
#pz .pz-exit svg{ width: 26px; height: 26px; stroke-width: 2.6; }
#pz .pz-meta{ position: static; height: auto; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; pointer-events: auto; }
#pz .pz-name #dTitle{ font-weight: 800; font-size: 19px; text-shadow: none; color: var(--ink); line-height: 1.15; }
#pz .pz-status{ display: flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; }
#pz .pz-save{ height: 24px; margin: 0; padding: 0; background: none; color: var(--ok); font-size: 12.5px; font-weight: 700; gap: 3px; border-radius: 6px; position: relative; }
#pz .pz-save::before{ content: ""; position: absolute; inset: -12px -4px; }
#pz .pz-save:hover{ background: none; text-decoration: underline; }
#pz .pz-save svg{ width: 14px; height: 14px; stroke-width: 3; }
#pz .pz-save[data-state="saving"]{ color: var(--muted); } #pz .pz-save[data-state="saving"] svg{ display: none; }
#pz .pz-save[data-state="new"], #pz .pz-save[data-state="dirty"]{ color: var(--muted); } #pz .pz-save[data-state="new"] svg, #pz .pz-save[data-state="dirty"] svg{ display: none; }
#pz .pz-save[data-state="error"]{ color: var(--danger); }
#pz .pz-save[data-state="draft"]{ height: 30px; padding: 0 12px; background: var(--red); color: #fff; border-radius: 9px; box-shadow: 0 2px 0 var(--red-2); }
#pz .pz-save[data-state="draft"] svg{ display: none; }

#pz .pz-chip{ margin: 0; height: 24px; padding: 0 0 0 2px; background: none; color: var(--ok); font-size: 12.5px; font-weight: 700; }
#pz .pz-chip::after{ content: none; }
#pz .pz-chip b{ color: inherit; font-weight: 700; }
#pz .pz-chip .sep{ display: none; }
#pz .pz-chip.ok svg{ color: var(--ok); }
#pz .pz-chip.aviso{ color: var(--warn-ink); background: none; }
#pz .pz-chip.error{ color: var(--danger); background: none; }
#pz .pz-save::after{ content: "·"; display: inline; position: static; width: auto; height: auto; background: none; border: 0; margin: 0 0 0 5px; color: var(--muted); font-weight: 700; }
#pz .pz-chip{ position: relative; } #pz .pz-chip::before{ content: ""; position: absolute; inset: -12px -2px; }
#pz .pz-name{ min-height: 44px; margin-bottom: -20px; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; } /* área táctil 44 px; la fila de estado queda encima */
#pz .pz-quick{ position: absolute; inset: 0; z-index: 5; pointer-events: none; }
#pz .pz-hint{ position: absolute; left: 12px; top: 12px; max-width: calc(100% - 24px); text-align: left; background: #141414; color: #fff; border-radius: 10px; padding: 7px 11px; font-weight: 600; font-size: 12.5px; opacity: 0; }
#pz .pz-hint.show{ opacity: .92; }
#pz .pz-quick-row{ position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; gap: 8px; justify-content: flex-end; pointer-events: none; }
#pz .pz-q{ pointer-events: auto; height: 48px; padding: 0 16px; display: inline-flex; align-items: center; gap: 7px; border-radius: 14px; border: 1.5px solid #141414; background: #fff; color: #141414;
  font-weight: 800; font-size: 15px; cursor: pointer; box-shadow: 0 3px 0 #141414; }
#pz .pz-q svg{ width: 18px; height: 18px; stroke-width: 2.4; }
#pz .pz-q.red{ background: var(--red); color: #fff; }
#pz .pz-q.on, #pz .pz-q[aria-pressed="true"]{ background: var(--gold); color: #141414; }
#pz .pz-q:active{ transform: translateY(2px); box-shadow: 0 1px 0 #141414; }
#pz.locked .pz-bar .pz-tool:not(#tMoreTools){ opacity: .35; }
#pz .pz-bottom{ left: calc(var(--sl) + 12px); right: calc(var(--sr) + 12px); bottom: calc(var(--safe-b) + 10px); }
#pz .pz-bar{ position: relative; width: 100%; max-width: 640px; justify-content: space-around; align-items: center; padding: 8px 6px; border-radius: 20px; background: var(--surface); border: 1.5px solid #141414; box-shadow: 0 4px 0 #141414; }
:root[data-theme="dark"] #pz .pz-bar{ border-color: var(--border-2); box-shadow: 0 4px 0 #000; }
#pz .pz-tool{ flex: 0 1 64px; width: 64px; height: 66px; gap: 4px; border-radius: 14px; color: var(--ink); font-size: 12px; font-weight: 700; }
#pz .pz-tool svg{ width: 26px; height: 26px; color: var(--ink); stroke-width: 2.3; }
#pz .pz-tool:hover{ background: var(--surface-2); color: var(--ink); }
#pz .pz-tool.active{ background: var(--red); color: #fff; } #pz .pz-tool.active svg{ color: #fff; }
#tColor.active { background: var(--surface-3); color: var(--ink); }
#pz .pz-dot{ border-color: #141414; }
#pz .pz-extra{ display: none; }
#pz.extra-open .pz-extra{ display: flex; position: absolute; right: 0; bottom: calc(100% + 10px); padding: 6px; gap: 2px; border-radius: 18px; background: var(--surface); border: 1.5px solid #141414; box-shadow: 0 4px 0 #141414; z-index: 6; }
#tMoreTools[aria-expanded="true"] { background: var(--surface-3); }
#pz .pz-ctx{ position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); }
#pz.extra-open .pz-ctx{ bottom: calc(100% + 96px); }
#pz .pz-card{ background: var(--surface); color: var(--ink); border: 1.5px solid #141414; box-shadow: 0 4px 0 rgba(20,20,20,.9); }
:root[data-theme="dark"] #pz .pz-card, :root[data-theme="dark"] #pz.extra-open .pz-extra{ border-color: var(--border-2); box-shadow: 0 6px 18px rgba(0,0,0,.5); }
#pz .pz-opt{ color: var(--text-2); font-weight: 600; min-height: 48px; height: 48px; }
#pz .pz-opt:hover{ color: var(--ink); }
#pz .pz-opt.active{ background: var(--ink); color: var(--on-ink); }
#pz .pz-sheet{ background: var(--surface); color: var(--text); }
#pz .pz-sheet .pz-sheet-head h3{ font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: .03em; }
@media (min-width: 700px) and (min-height: 600px) {
  #pz{ --top-h: 70px; --bar-h: 90px; }
  #pz .pz-extra{ display: flex; gap: 2px; }
  #pz.extra-open .pz-extra{ position: static; padding: 0; border: 0; box-shadow: none; background: none; }
  #tMoreTools { display: none; }
  #pz .pz-bar{ max-width: 860px; }
  #pz .pz-name #dTitle{ font-size: 22px; }
  #pz .pz-save, #pz .pz-chip{ font-size: 13.5px; }
}
@media (min-width: 1000px) {
  #pz.sheet-open .pz-stage{ right: calc(var(--sr) + var(--sheet-w) + 12px); }
}
@media (orientation: landscape) and (max-height: 540px) {
  #pz{ --bar-h: 0px; }
  #pz .pz-top{ background: var(--bg); }
  #pz .pz-meta{ position: absolute; z-index: 4; top: calc(var(--safe-t) + 14px); left: calc(var(--sl) + var(--rail) + 30px); right: auto; flex: none; max-width: 46vw; padding: 4px 12px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-card); }
  #pz .pz-hint{ top: 62px; }
  #pz .pz-stage{ top: calc(var(--safe-t) + 8px); bottom: calc(var(--safe-b) + 8px); left: calc(var(--sl) + var(--rail) + 18px); right: calc(var(--sr) + var(--rail) + 18px); }
  #pz .pz-bar{ width: auto; flex-direction: column; padding: 4px; box-shadow: 0 3px 0 #141414; }
  #pz .pz-tool{ width: var(--rail); height: auto; min-height: 44px; font-size: 10px; }
  #pz .pz-tool svg{ width: 20px; height: 20px; }
  #pz .pz-name #dTitle{ font-size: 14px; }
  #pz .pz-q{ height: 44px; padding: 0 12px; font-size: 13px; }
  #pz.extra-open .pz-extra{ right: calc(100% + 8px); bottom: 0; flex-direction: column; }
  #pz .pz-ctx{ position: absolute; left: auto; right: calc(100% + 8px); bottom: 0; }
  /* rieles: botones de la Pizarra a la izquierda, herramientas a la derecha */
  #pz .pz-top{ bottom: 0; right: auto; height: auto; width: calc(var(--sl) + var(--rail) + 12px); flex-direction: column; align-items: stretch; gap: 6px; padding: calc(var(--safe-t) + 8px) 6px calc(var(--safe-b) + 8px) calc(var(--sl) + 6px); background: var(--bg); }
  #pz .pz-btn, #pz .pz-btn.boxed{ width: 100%; min-width: 0; height: 46px; }
  #pz .pz-bottom{ left: auto; top: calc(var(--safe-t) + 6px); bottom: calc(var(--safe-b) + 6px); right: calc(var(--sr) + 6px); flex-direction: row; align-items: stretch; }
  #pz .pz-bar{ height: 100%; max-width: none; justify-content: space-around; }
  #pz .pz-save{ width: auto; height: 24px; flex-direction: row; font-size: 12px; } #pz .pz-meta .pz-chip{ font-size: 12px; }
  #pz .pz-stage{ left: calc(var(--sl) + var(--rail) + 22px); right: calc(var(--sr) + var(--rail) + 24px); }
}

/* ---------- Partido = Modo partido ---------- */
.gm-head .eyebrow-d { display: block; margin-bottom: 4px; }
.gm-role { min-height: 120px; border-radius: 18px; border: 1.5px solid var(--border); background: var(--surface); box-shadow: var(--shadow-card); }
.gm-role svg { color: var(--red); width: 28px; height: 28px; }
.gm-role:hover { border-color: var(--ink); }
.gm-top { padding: 4px 0; }
.gm-mode { font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-2); }
:root[data-theme="dark"] .gm-mode { color: var(--gold); }
.gm-title b { font-size: 18px; font-weight: 800; }
.gm-count { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 10px; background: var(--ink); color: var(--on-ink); font-weight: 700; }
.gm-count svg { width: 14px; height: 14px; color: var(--gold); }
.gm-secs .chip { background: var(--surface); }
.gm-secs .chip.active { background: var(--ink); color: var(--on-ink); }
.gm-swipe { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.gm-swipe-hint { position: absolute; right: 12px; bottom: 10px; padding: 4px 9px; border-radius: 8px; background: rgba(20,20,20,.75); color: #fff; font-size: 11.5px; font-weight: 600; pointer-events: none; }
.gm-card { border: 1.5px solid var(--border); box-shadow: var(--shadow-card); border-radius: 20px; }
.gm-card.big { border: 2px solid #141414; box-shadow: 0 5px 0 #141414; }
:root[data-theme="dark"] .gm-card.big { border-color: var(--border-2); box-shadow: 0 5px 0 #000; }
.gm-num { background: #141414; color: #fff; border-radius: 12px; box-shadow: inset 0 -3px 0 var(--gold); }
.gm-nm b { font-weight: 800; font-size: 24px; }
.gm-card.big .gm-dia { border-top: 1px solid var(--border); }
.gm-next-row > .muted { font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: .1em; }
.gm-log .btn { height: 56px; font-size: 16px; }
.gm-ok { color: var(--ok-ink); border-color: var(--ok); } .gm-no { color: var(--danger-ink); border-color: var(--danger); }
.gm-bot { bottom: calc(84px + var(--safe-b)); padding: 8px 0; }
.gm-go { height: 60px; font-size: 19px; }
.gm-bot .btn.icon { width: 60px; height: 60px; }
body.gm-full .gm-display { background: var(--bg); }
.gm-display .gm-card.big .gm-nm b { font-family: var(--display); text-transform: uppercase; letter-spacing: .02em; }
@media (min-width: 901px) { .gm-bot { bottom: 12px; } }

/* ---------- Otras pantallas: encabezados y acentos de la paleta ---------- */
.page-head .eyebrow { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; color: var(--gold-2); }
.toast { background: #141414; color: #fff; border-radius: 14px; font-weight: 600; }
.modal h3 { font-family: var(--display); font-weight: 800; font-size: 24px; text-transform: uppercase; letter-spacing: .02em; }
.pbp-brand { height: 22px; width: auto; display: inline-block; vertical-align: middle; margin-right: 6px; }
.print-view .ph .brandp img { height: 30px; width: auto; }
.auth-brand { flex-direction: column; }
.auth-brand .wm { width: 220px; height: auto; }
.vw-brand .wm { width: 104px; height: auto; }
@media print { .wm-d { display: none !important; } .wm-l { display: block !important; } }
/* ajustes tras comparar con los mockups */
#pz .pz-spacer{ display: none; }
#pz .pz-chip .sep{ display: inline; width: auto; height: auto; background: none; opacity: 1; color: var(--muted); }
#pz .pz-chip .sep::before{ content: "·"; }
#pz .pz-chip.ok svg{ display: none; }
#pz .pz-chip > * + *{ margin-left: 0; }
@media (max-width: 699px), (max-height: 599px) { #pz:not(.extra-open) #lineMode{ display: none !important; } }
/* Escritorio/tablet: la fila Auto/Recta/Libre y la paleta de colores tienen su espacio (no tapan el campo) */
@media (min-width: 700px) and (min-height: 600px) { #pz { --ctx-fix: 58px; } }
@media (max-width: 900px) {
  .pb-formats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 10px; }
  .pb-fmt { min-height: 118px !important; padding: 12px !important; display: flex !important; flex-direction: column; align-items: flex-start; }
  .pb-fmt-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}
.pb-fmt-go { display: none !important; }
.pb-fmt { display: flex; flex-direction: column; align-items: flex-start; }
.pb-fmt-txt { margin-top: auto; padding-top: 8px; }
/* Menú “…” abierto: su tarjeta queda por encima de las vecinas (las tarjetas crean su propio contexto de apilamiento) */
.card:has(.more-pop:not([hidden])), .pb-tile:has(.more-pop:not([hidden])) { position: relative; z-index: 30; overflow: visible; }
/* Pizarra en celular: como el mockup, “Rehacer” solo aparece cuando hay algo que rehacer; así cabe “Guardado · formato · reglas” */
@media (max-width: 599px) {
  #pz #tRedo:disabled { display: none; }
  #pz .pz-save, #pz .pz-chip { font-size: 12px; }
  #pz .pz-save svg { width: 13px; height: 13px; }
}

/* ---------- Pizarra header: título largo con ellipsis; atrás siempre clickeable (iPhone Safari) ---------- */
#pz .pz-top { overflow: visible; }
#pz .pz-exit {
  position: relative; z-index: 5; flex: 0 0 auto;
  min-width: 48px; min-height: 48px; width: 48px; height: 48px;
  padding: 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
#pz .pz-exit::before { content: ""; position: absolute; inset: -4px; } /* hit ≥ 56 px */
#pz .pz-btn.boxed { position: relative; z-index: 5; flex: 0 0 auto; touch-action: manipulation; }
#pz .pz-meta {
  position: static; z-index: 1; flex: 1 1 0%; min-width: 0; max-width: 100%;
  overflow: hidden; pointer-events: auto;
}
#pz .pz-name {
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  width: 100%; max-width: 100%; min-width: 0; min-height: 44px; margin-bottom: -20px;
  overflow: hidden; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
}
#pz .pz-name #dTitle {
  display: block; width: 100%; max-width: 100%; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 800; font-size: 19px; line-height: 1.15; color: var(--ink); text-shadow: none;
}
#pz .pz-status { max-width: 100%; overflow: hidden; }
/* Animación / Simulador: mismos títulos largos */
.pa-top { gap: 6px; }
.pa-title { flex: 1; min-width: 0; overflow: hidden; }
.sim-top .pz-exit { position: relative; z-index: 5; min-width: 48px; min-height: 48px; }
.sim-title { overflow: hidden; }

/* Miniaturas de Inicio y del Playbook: acercadas a la zona de juego (alrededor de la LOS), como en los mockups */
.rc-card .thumb img, .pb-tile .thumb img { transform: scale(1.28); transform-origin: 50% 60%; }


/* Aviso no bloqueante: el otro coach cambió la jugada abierta en la Pizarra */
.pz-remote {
  position: absolute; left: 50%; top: calc(var(--safe-t) + 58px); transform: translateX(-50%);
  z-index: 40; display: flex; align-items: center; gap: 10px;
  background: #141414; color: #fff; font-size: 13px; font-weight: 600;
  padding: 10px 12px 10px 14px; border-radius: 14px; box-shadow: var(--shadow);
  max-width: calc(100% - 24px); pointer-events: auto;
}
.pz-remote-btn {
  appearance: none; border: 0; background: #E8B447; color: #141414;
  font: inherit; font-weight: 800; font-size: 12px; padding: 8px 12px; border-radius: 10px; cursor: pointer;
}
.pz-remote-x {
  appearance: none; border: 0; background: transparent; color: #fff; opacity: .7;
  font-size: 20px; line-height: 1; padding: 4px 6px; cursor: pointer;
}
.toast.toast-action {
  display: flex; align-items: center; gap: 12px; pointer-events: auto;
  padding: 12px 12px 12px 18px;
}
.toast-btn {
  appearance: none; border: 0; background: #E8B447; color: #141414;
  font: inherit; font-weight: 800; font-size: 13px; padding: 8px 14px; border-radius: 10px; cursor: pointer;
}

/* ===================== Cronómetro de entrenamiento (Iniciar entrenamiento) ===================== */
.prun { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 96px; }
.prun-tr em { font-size: 12px; white-space: nowrap; }
.prun-back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; color: var(--muted); min-height: 44px; }
.prun-back svg { width: 18px; height: 18px; }
.prun-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.prun-total { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.prun-total small { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.prun-total b { font-size: 26px; font-variant-numeric: tabular-nums; }
.prun-steps { display: flex; gap: 4px; }
.prun-steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); }
.prun-steps i.done { background: var(--unit-color); opacity: .45; }
.prun-steps i.cur { background: var(--unit-color); }
.prun-cur { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 6px solid var(--unit-color, var(--gold)); border-radius: 18px; padding: 16px 18px 18px; text-align: center; transition: background .3s, border-color .3s; }
.prun-row { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.prun-unit { color: var(--unit-color); text-transform: uppercase; letter-spacing: .05em; }
.prun-name { font-size: 24px; line-height: 1.15; margin: 8px 0 4px; overflow-wrap: anywhere; }
.prun-big { font-size: clamp(64px, 22vw, 108px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.prun-biglab { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.prun-bar { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; margin: 14px 0 10px; }
.prun-bar i { display: block; height: 100%; width: 0; background: var(--unit-color, var(--gold)); border-radius: 5px; transition: width .25s linear; }
.prun-meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); }
.prun-meta b { font-variant-numeric: tabular-nums; color: var(--text); }
.prun-notes { margin: 10px 0 0; font-size: 14px; color: var(--text-2); text-align: left; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.prun-cur.over { border-color: var(--red); background: var(--red-soft); }
.prun-cur.over .prun-big, .prun-cur.over .prun-biglab { color: var(--red); }
.prun-cur.over .prun-bar i { background: var(--red); }
.prun-flash .prun-cur { animation: prunFlash .5s ease-in-out 6 alternate; }
@keyframes prunFlash { from { background: var(--red-soft); } to { background: var(--red); color: #fff; } }
.prun-alert { display: flex; align-items: center; gap: 10px; background: var(--red); color: #fff; font-weight: 800; font-size: 17px; border-radius: 14px; padding: 12px 14px; }
.prun-alert svg { width: 24px; height: 24px; flex: none; }
.prun-next { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; background: var(--surface-2); color: var(--text); border-radius: 14px; padding: 12px 14px; font-size: 16px; }
.prun-next .label { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.prun-next b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prun-finish { width: 100%; min-height: 64px; font-size: 19px; font-weight: 800; border-radius: 16px; justify-content: center; }
.prun-finish svg { width: 22px; height: 22px; }
.prun-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.prun-tools .chip { min-height: 44px; padding: 0 14px; }
.prun-tools .chip svg { width: 16px; height: 16px; }
.prun-end { min-height: 48px; justify-content: center; }
.prun-help { font-size: 12.5px; color: var(--muted); text-align: center; margin: 0; }
.prun-start { text-align: center; padding-top: 10px; }
.prun-cta { width: 100%; min-height: 56px; font-size: 17px; font-weight: 800; justify-content: center; margin-bottom: 10px; border-radius: 14px; }
.prun-banner { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px; margin-bottom: 10px; border-radius: 14px; background: var(--red); color: #fff; font-size: 15px; }
.prun-banner svg { width: 22px; height: 22px; flex: none; }
.prun-banner span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prun-banner .t { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 18px; }
.prun-last { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px; margin-bottom: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 14px; }
.prun-last svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.prun-last span:first-of-type { flex: 1; }
.tag.prun-real.late { color: var(--red); }
.tag.prun-real.early { color: var(--ok); }
.prun-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prun-kpis .kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 8px; text-align: center; }
.prun-kpis .kpi .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.prun-kpis .kpi .k { font-size: 12px; color: var(--muted); font-weight: 700; }
.prun-kpis .kpi.late .v { color: var(--red); }
.prun-kpis .kpi.early .v { color: var(--ok); }
.prun-table { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.prun-tr { display: grid; grid-template-columns: 1fr 52px 66px 54px; gap: 6px; align-items: center; padding: 11px 12px; border-left: 4px solid var(--unit-color, transparent); border-top: 1px solid var(--border); font-size: 14px; font-variant-numeric: tabular-nums; }
.prun-tr span:not(.n) { text-align: right; }
.prun-tr.head { border-top: 0; border-left-color: transparent; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
.prun-tr .n { font-weight: 700; overflow-wrap: anywhere; }
.prun-tr .d { font-weight: 800; }
.prun-tr .d.late { color: var(--red); }
.prun-tr .d.early { color: var(--ok); }
.prun-sum-actions { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.prun-sum-actions .btn { min-height: 48px; }
.prun [hidden] { display: none !important; }

/* ===================== Pizarra: picker de rutas estilo Playmaker ===================== */
.pz .rp { position: absolute; z-index: 6; left: 8px; top: 8px; max-width: calc(100% - 12px); background: rgba(14,14,16,.94); color: #fff;
  border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.35); touch-action: manipulation; }
.pz .rp-shapes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pz .rp-shape { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 11px;
  background: rgba(255,255,255,.08); color: #fff; font-size: 11.5px; font-weight: 700; cursor: pointer; padding: 4px 2px; }
.pz .rp-shape svg { width: 26px; height: 26px; color: #F2B632; }
.pz .rp-shape.active { background: #F2B632; color: #141414; }
.pz .rp-shape.active svg { color: #141414; }
.pz .rp-shape:active { transform: scale(.96); }
.pz .rp-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.pz .rp-who { font-weight: 800; font-size: 13px; background: rgba(255,255,255,.12); border-radius: 8px; padding: 4px 8px; flex: none; }
.pz .rp-tip { flex: 1; min-width: 0; font-size: 12px; color: rgba(255,255,255,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pz .rp-btn { min-height: 46px; min-width: 64px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px;
  background: rgba(255,255,255,.12); color: #fff; font-weight: 800; font-size: 14px; padding: 0 12px; cursor: pointer; flex: none; }
.pz .rp-btn svg { width: 18px; height: 18px; }
.pz .rp-btn.gold { background: #F2B632; color: #141414; }
.pz .rp-btn:disabled { opacity: .4; }
/* Interruptor del final de la ruta: flecha ↔ alto (T) */
.pz .rp-end { display: inline-flex; flex: none; gap: 2px; padding: 2px; border-radius: 14px; background: rgba(255,255,255,.08); }
.pz .rp-end .rp-btn { min-width: 46px; width: 46px; padding: 0; background: transparent; }
.pz .rp-end .rp-btn svg { width: 22px; height: 22px; color: #F2B632; }
.pz .rp-end .rp-btn.active { background: #F2B632; }
.pz .rp-end .rp-btn.active svg { color: #141414; }

/* ===================== Tutorial de bienvenida (coach-marks) ===================== */
.more-panel .more-tour { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; margin-top: 12px; padding: 8px 12px; border-radius: 14px; text-align: left;
  color: var(--text); background: var(--gold-soft); border: 1.5px solid var(--gold); font: inherit; cursor: pointer; }
.more-panel .more-tour svg { width: 22px; height: 22px; color: var(--gold-ink); flex: none; }
.more-panel .more-tour span { display: grid; line-height: 1.25; min-width: 0; }
.more-panel .more-tour b { font-weight: 700; font-size: 14.5px; } .more-panel .more-tour small { color: var(--muted); font-size: 12px; }
.sidebar-foot .side-tour { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; margin-top: 4px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.sidebar-foot .side-tour svg { width: 18px; height: 18px; color: var(--gold-2); }
.sidebar-foot .side-tour:hover { background: var(--surface); }
:root[data-theme="dark"] .more-panel .more-tour { background: rgba(232,180,71,.12); }
:root[data-theme="dark"] .more-panel .more-tour svg { color: var(--gold); }

.tour { position: fixed; inset: 0; z-index: 150; touch-action: none; }
.tour.no-target { background: rgba(10,10,10,.66); }
.tour-hole { position: fixed; border-radius: 16px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(10,10,10,.66); outline: 3px solid var(--gold); outline-offset: 0;
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease; }
.tour.no-target .tour-hole { display: none; }
.tour-card { position: fixed; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 16px 16px 14px; border-radius: 20px; background: var(--surface); color: var(--text);
  border: 1.5px solid #141414; box-shadow: 0 4px 0 #141414, 0 18px 40px rgba(0,0,0,.35); outline: none; animation: tourIn .22s ease-out; }
.tour-card.center { left: 12px; right: 12px; top: 50%; transform: translateY(-50%); margin: 0 auto; max-width: 420px; animation: none; }
@keyframes tourIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tour-prog { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tour-count { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); }
.tour-dots i.done { background: var(--gold); } .tour-dots i.on { background: var(--red); width: 20px; border-radius: 4px; }
.tour-title { margin: 0 0 6px; font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.02; text-transform: uppercase; letter-spacing: .01em; color: var(--strong); }
.tour-text { margin: 0; font-size: 16px; line-height: 1.45; color: var(--text-2); }
.tour-text b, .tour-list b { color: var(--strong); }
.tour-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.tour-list li { position: relative; padding-left: 24px; font-size: 15.5px; line-height: 1.4; color: var(--text-2); }
.tour-list li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 10px; height: 10px; border-radius: 3px; background: var(--red); box-shadow: 2px 2px 0 var(--gold); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tour-r { display: flex; gap: 8px; }
.tour-actions .btn { min-height: 52px; height: 52px; font-size: 16px; border-radius: 14px; }
.tour-skip { padding: 0 14px; color: var(--muted); }
.tour-back { width: 52px; padding: 0; justify-content: center; }
.tour-next { padding: 0 20px; box-shadow: 0 3px 0 var(--red-2); }
.tour-next svg { margin-left: 2px; }
.tour-art { margin: 6px 0 10px; }
.tour-field { position: relative; aspect-ratio: 660 / 300; border-radius: 14px; overflow: hidden; border: 1.5px solid #141414; background: var(--field-bg); }
.tour-field svg { display: block; width: 100%; height: 100%; }
.tour-tap { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 3px solid var(--gold); background: rgba(232,180,71,.25); animation: tourTap 1.4s ease-out infinite; pointer-events: none; }
@keyframes tourTap { 0% { transform: scale(.6); opacity: 1; } 80%, 100% { transform: scale(1.35); opacity: 0; } }
.tour-chips { display: flex; gap: 6px; margin-top: 8px; }
.tour-chip { flex: 1; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 11px; background: #17171A; color: #fff; font-size: 11.5px; font-weight: 700; }
.tour-chip svg { width: 22px; height: 22px; color: #F2B632; }
.tour-chip.on { background: #F2B632; color: #141414; } .tour-chip.on svg { color: #141414; }
.tour-chip.anim { background: var(--red); } .tour-chip.anim svg { color: #fff; width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-card { transition: none; animation: none; } .tour-tap { animation: none; } }
